@everymatrix/lottery-tipping-page 1.87.31 → 1.87.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/general-multi-select_14.cjs.entry.js +116 -112
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/lottery-tipping-page.cjs.js +1 -1
- package/dist/esm/general-multi-select_14.entry.js +116 -112
- package/dist/esm/loader.js +1 -1
- package/dist/esm/lottery-tipping-page.js +1 -1
- package/dist/lottery-tipping-page/general-multi-select_14.entry.js +242 -242
- package/dist/lottery-tipping-page/lottery-tipping-page.esm.js +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
import{r as t,c as e,g as i,h as o,a as r}from"./index-3be4f76e.js";import{s as n,a as s,b as a}from"./lottery-tipping-page-af6b6291.js";export{L as lottery_tipping_page}from"./lottery-tipping-page-af6b6291.js";const l=class{constructor(o){t(this,o),this.change=e(this,"change",7),this.handleOutsideClick=t=>{t.composedPath().includes(this.el)||(this.dropdownOpen=!1,this.overflowOpen=!1)},this.toggleDropdown=t=>{t.stopPropagation(),this.dropdownOpen=!this.dropdownOpen,this.overflowOpen=!1},this.isSelected=t=>this.selectedValues.includes(t),this.selectItem=t=>{this.isSelected(t.value)||(this.selectedValues=[...this.selectedValues,t.value],this.change.emit(this.selectedValues))},this.toggleItem=t=>{this.isSelected(t.value)?this.removeItem(t.value):this.selectItem(t)},this.removeItem=(t,e)=>{e&&e.stopPropagation(),this.selectedValues=this.selectedValues.filter((e=>e!==t)),this.change.emit(this.selectedValues)},this.downIcon=i("../static/dropdown.svg"),this.upIcon=i("../static/dropup.svg"),this.isTouch="ontouchstart"in window,this.openOverflow=()=>{this.isTouch||(this.computePopoverPosition(),this.overflowOpen=!0)},this.closeOverflow=()=>{this.isTouch||(this.overflowOpen=!1)},this.toggleOverflow=t=>{t.stopPropagation(),this.computePopoverPosition(),this.overflowOpen=!this.overflowOpen},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.options=[],this.maxVisibleChips=2,this.placeholder="",this.selectedValues=[],this.dropdownOpen=!1,this.overflowOpen=!1,this.popoverStyle={top:"0px",left:"0px"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}async clear(){this.selectedValues=[],this.change.emit(this.selectedValues)}componentWillLoad(){document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}get selectedOptions(){return this.options.filter((t=>this.isSelected(t.value)))}get visibleChips(){return this.selectedOptions.slice(0,this.maxVisibleChips)}get hiddenChips(){return this.selectedOptions.slice(this.maxVisibleChips)}computePopoverPosition(){if(this.overflowChipEl&&this.el){const{left:t}=this.overflowChipEl.getBoundingClientRect(),{left:e,height:i}=this.el.getBoundingClientRect();this.popoverStyle={top:i-10+"px",left:t-e+"px"}}}render(){var t;return o("div",{key:"50b48397be3ede1907ab2c2abcd1cf2f43f69c13",class:"general-multi-select-container",ref:t=>this.stylingContainer=t},o("div",{key:"696a1bb1f221f8f5cf290fac040af10e2e5a115e",class:"multi-select-container",ref:t=>this.el=t},o("div",{key:"9ea92f01787b26d43054573a11896cf65065b073",class:"flex-row",onClick:this.toggleDropdown},o("div",{key:"f79720ca3ec383ee7f95b09483698ee18119c79a",class:"control"},this.visibleChips.map((t=>o("span",{class:"chip"},o("div",{class:"chip-text",title:t.text},t.text),o("div",{class:"remove-btn",onClick:e=>this.removeItem(t.value,e)},"×")))),this.hiddenChips.length>0&&o("span",{key:"25e9e527c33dd7a315dacb10cc51084fe69b9b7e",class:"chip overflow-chip",ref:t=>this.overflowChipEl=t,onMouseEnter:this.openOverflow,onMouseLeave:this.closeOverflow,onClick:this.toggleOverflow},"•••"),0===this.selectedValues.length&&o("span",{key:"b061de660a55f7a0d41ce9aa650108d3f38a9dc0",class:"placeholder"},this.placeholder)),o("div",{key:"f83b6517e88b3976cdc18590f8f1233cb2515230",class:"arrow"},o("img",{key:"1b61a49090237057b98e5ce8a4f7c1e3bfc9d4ba",class:"info-icon",src:this.dropdownOpen?this.upIcon:this.downIcon,style:{width:"18px"}}))),this.dropdownOpen&&o("div",{key:"e5b081007bcbdd251ce5ac235c1f19f17852c420",class:"dropdown"},this.options.map((t=>o("div",{class:{"dropdown-item":!0,selected:this.isSelected(t.value)},onClick:()=>this.toggleItem(t)},t.text)))),this.overflowOpen&&!!(null===(t=this.hiddenChips)||void 0===t?void 0:t.length)&&o("div",{key:"f8e3289042c69c569bebcd0a40d90f31261c6c12",class:"overflow-popover",style:{top:this.popoverStyle.top,left:this.popoverStyle.left},onMouseEnter:this.openOverflow,onMouseLeave:this.closeOverflow},this.hiddenChips.map((t=>o("span",{class:"chip"},o("span",{class:"chip-text",title:t.text},t.text),o("span",{class:"remove-btn",onClick:e=>this.removeItem(t.value,e)},"×")))))))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};l.style='.multi-select-container{position:relative;font-family:"Inter", sans-serif;margin-top:4px;width:100%}.flex-row{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;padding:6px 10px;padding-right:6px;border-radius:0.25em;background:var(--emw-selector-color-background, #e8ebef);cursor:pointer}.control{flex:1;display:flex;align-items:center;flex-wrap:nowrap;overflow:hidden}.control:focus-within{border-color:var(--emw--color-primary, #fed275);box-shadow:0 0 0 2px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.chip{display:inline-flex;align-items:center;background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-dialog-typography, #000);border-radius:4px;padding:2px 8px;margin-right:6px;font-size:0.875rem;line-height:1.2;justify-content:space-between;flex:0 1 auto;min-width:0}.chip-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overflow-chip{background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-300, #333);width:20px;text-align:center;display:block}.remove-btn{background:none;border:none;font-size:1rem;margin-left:6px;cursor:pointer;color:var(--emw--color-gray-150, #6f6f6f)}.remove-btn:hover{color:var(--emw--color-error, red)}.placeholder{color:var(--emw--color-gray-150, #6f6f6f);font-size:0.875rem;padding:3px 8px;padding-left:0;line-height:1.2}.arrow{margin-left:auto;font-size:0.8rem;width:20px;color:var(--emw--color-gray-150, #6f6f6f)}.dropdown{position:absolute;top:calc(100% + 4px);left:0;width:100%;max-height:240px;overflow-y:auto;border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;background:var(--emw--color-dialog-background, #ffffff);box-shadow:0 4px 12px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));z-index:10}.dropdown-item{padding:10px 14px;cursor:pointer;font-size:0.875rem;line-height:1.4;transition:background 0.2s}.dropdown-item:hover{background:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography, #000)}.dropdown-item.selected{background:var(--emw--color-background-secondary, #f5f5f5);color:var(--emw--color-typography, #000);font-weight:500}.overflow-popover{position:absolute;top:var(--overflow-top, 0px);left:var(--overflow-left, 0px);max-width:200px;padding:12px;display:flex;flex-wrap:wrap;gap:6px;border:1px solid var(--emw--color-gray-100, #d0d5dd);border-radius:6px;background:var(--emw--color-background, #ffffff);box-shadow:0 4px 12px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));z-index:20}';const h=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.position="top",this.delay=200,this.isVisible=!1,this._tooltipId=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this._tooltipId=`general-tooltip-${Math.random().toString(36).substring(2,9)}`}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}handleMouseEnterOrFocus(){clearTimeout(this.hideTimeout),this.showTimeout&&clearTimeout(this.showTimeout),this.showTimeout=setTimeout((()=>{this.isVisible=!0}),this.delay)}handleMouseLeaveOrBlur(){this.showTimeout&&clearTimeout(this.showTimeout),this.hideTimeout=setTimeout((()=>{this.isVisible=!1}),100)}handleKeyDown(t){"Escape"===t.key&&this.isVisible&&(this.isVisible=!1)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}render(){const t={"general-tooltip-popup":!0,visible:this.isVisible,[`general-tooltip-${this.position}`]:!0};return o("div",{key:"c0d52518e1e196e0d022789f7c6b7e64173b2c7d",class:"general-tooltip-wrapper"},o("slot",{key:"a935e103e16b0b619a024706e8224f4a937de6b9",name:"trigger"}),o("div",{key:"35c60e35ce3f8d5c2c42cd333fe64a3b289d34d4",class:"general-tooltip-container",role:"tooltip",ref:t=>this.stylingContainer=t},o("div",{key:"9d3fd9f142c1e3bd263dee289a2c1a9e4eebfddc",id:this._tooltipId,class:t,role:"tooltip"},o("slot",{key:"31344f0d4d4139f913d1819cc4f42a39f5113d8a",name:"content"}),o("div",{key:"f5cdd93060baec37b2a2879056efe2d66c5a553a",class:"general-tooltip-arrow"}))))}get hostElement(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};h.style=".general-tooltip-wrapper{display:inline-block;position:relative;line-height:0}.general-tooltip-container{display:contents;}.general-tooltip-popup{position:absolute;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background-inverse, #000);padding:8px 12px;border-radius:4px;font-size:0.875em;line-height:1.4;z-index:1000;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;white-space:nowrap;pointer-events:none;}.general-tooltip-popup.visible{opacity:1;visibility:visible}.general-tooltip-arrow{position:absolute;width:0;height:0;border-style:solid}.general-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:8px;}.general-tooltip-top .general-tooltip-arrow{top:100%;left:50%;transform:translateX(-50%);border-width:6px 6px 0 6px;border-color:var(--emw--color-gray-300, #333) transparent transparent transparent}.general-tooltip-bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:8px;}.general-tooltip-bottom .general-tooltip-arrow{bottom:100%;left:50%;transform:translateX(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--emw--color-gray-300, #333) transparent}.general-tooltip-left{right:100%;top:50%;transform:translateY(-50%);margin-right:8px;}.general-tooltip-left .general-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--emw--color-gray-300, #333)}.general-tooltip-right{left:100%;top:50%;transform:translateY(-50%);margin-left:8px;}.general-tooltip-right .general-tooltip-arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--emw--color-gray-300, #333) transparent transparent}";const c=["ro","en","fr","ar","hr"],d={en:{stop:"Stop",at:"at",turnover:"Turnover: ",start:"Sales Start",in:"in"},ro:{stop:"Oprește",at:"la"},fr:{stop:"Arrêtez",at:"à"},ar:{stop:"توقف",at:"في"},hr:{stop:"Stop",at:"u"}},u=(t,e)=>{const i=e;return d[void 0!==i&&c.includes(i)?i:"en"][t]};function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function v(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===p(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var g={};function b(){return g}function y(t){f(1,arguments);var e=v(t);return e.setHours(0,0,0,0),e}var w=6e4,x=36e5;var _={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},k="trunc";function C(t){f(1,arguments);var e=v(t),i=e.getUTCDay(),o=(i<1?7:0)+i-1;return e.setUTCDate(e.getUTCDate()-o),e.setUTCHours(0,0,0,0),e}function S(t){f(1,arguments);var e=v(t),i=e.getUTCFullYear(),o=new Date(0);o.setUTCFullYear(i+1,0,4),o.setUTCHours(0,0,0,0);var r=C(o),n=new Date(0);n.setUTCFullYear(i,0,4),n.setUTCHours(0,0,0,0);var s=C(n);return e.getTime()>=r.getTime()?i+1:e.getTime()>=s.getTime()?i:i-1}function T(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=b(),d=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.weekStartsOn)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==r?r:c.weekStartsOn)&&void 0!==o?o:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==i?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=v(t),p=u.getUTCDay(),g=(p<d?7:0)+p-d;return u.setUTCDate(u.getUTCDate()-g),u.setUTCHours(0,0,0,0),u}function A(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=v(t),d=c.getUTCFullYear(),u=b(),p=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.firstWeekContainsDate)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==o?o:null===(l=u.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(d+1,0,p),g.setUTCHours(0,0,0,0);var y=T(g,e),w=new Date(0);w.setUTCFullYear(d,0,p),w.setUTCHours(0,0,0,0);var x=T(w,e);return c.getTime()>=y.getTime()?d+1:c.getTime()>=x.getTime()?d:d-1}function z(t,e){for(var i=t<0?"-":"",o=Math.abs(t).toString();o.length<e;)o="0"+o;return i+o}const I=function(t,e){var i=t.getUTCFullYear(),o=i>0?i:1-i;return z("yy"===e?o%100:o,e.length)},M=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):z(i+1,2)},D=function(t,e){return z(t.getUTCDate(),e.length)},N=function(t,e){return z(t.getUTCHours()%12||12,e.length)},O=function(t,e){return z(t.getUTCHours(),e.length)},E=function(t,e){return z(t.getUTCMinutes(),e.length)},P=function(t,e){return z(t.getUTCSeconds(),e.length)},B=function(t,e){var i=e.length,o=t.getUTCMilliseconds();return z(Math.floor(o*Math.pow(10,i-3)),e.length)};var j={G:function(t,e,i){var o=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(o,{width:"abbreviated"});case"GGGGG":return i.era(o,{width:"narrow"});default:return i.era(o,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var o=t.getUTCFullYear();return i.ordinalNumber(o>0?o:1-o,{unit:"year"})}return I(t,e)},Y:function(t,e,i,o){var r=A(t,o),n=r>0?r:1-r;return"YY"===e?z(n%100,2):"Yo"===e?i.ordinalNumber(n,{unit:"year"}):z(n,e.length)},R:function(t,e){return z(S(t),e.length)},u:function(t,e){return z(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return z(o,2);case"Qo":return i.ordinalNumber(o,{unit:"quarter"});case"QQQ":return i.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(o,{width:"narrow",context:"formatting"});default:return i.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return z(o,2);case"qo":return i.ordinalNumber(o,{unit:"quarter"});case"qqq":return i.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(o,{width:"narrow",context:"standalone"});default:return i.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,i){var o=t.getUTCMonth();switch(e){case"M":case"MM":return M(t,e);case"Mo":return i.ordinalNumber(o+1,{unit:"month"});case"MMM":return i.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(o,{width:"narrow",context:"formatting"});default:return i.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,i){var o=t.getUTCMonth();switch(e){case"L":return String(o+1);case"LL":return z(o+1,2);case"Lo":return i.ordinalNumber(o+1,{unit:"month"});case"LLL":return i.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(o,{width:"narrow",context:"standalone"});default:return i.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,i,o){var r=function(t,e){f(1,arguments);var i=v(t),o=T(i,e).getTime()-function(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=b(),d=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.firstWeekContainsDate)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:c.firstWeekContainsDate)&&void 0!==o?o:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1),u=A(t,e),p=new Date(0);return p.setUTCFullYear(u,0,d),p.setUTCHours(0,0,0,0),T(p,e)}(i,e).getTime();return Math.round(o/6048e5)+1}(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):z(r,e.length)},I:function(t,e,i){var o=function(t){f(1,arguments);var e=v(t),i=C(e).getTime()-function(t){f(1,arguments);var e=S(t),i=new Date(0);return i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0),C(i)}(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):z(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):D(t,e)},D:function(t,e,i){var o=function(t){f(1,arguments);var e=v(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var o=e.getTime();return Math.floor((i-o)/864e5)+1}(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):z(o,e.length)},E:function(t,e,i){var o=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,i,o){var r=t.getUTCDay(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return z(n,2);case"eo":return i.ordinalNumber(n,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,o){var r=t.getUTCDay(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return z(n,e.length);case"co":return i.ordinalNumber(n,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var o=t.getUTCDay(),r=0===o?7:o;switch(e){case"i":return String(r);case"ii":return z(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,i){var o=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,e,i){var o,r=t.getUTCHours();switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,i){var o,r=t.getUTCHours();switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var o=t.getUTCHours()%12;return 0===o&&(o=12),i.ordinalNumber(o,{unit:"hour"})}return N(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var o=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):z(o,e.length)},k:function(t,e,i){var o=t.getUTCHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):z(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):P(t,e)},S:function(t,e){return B(t,e)},X:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return F(r);case"XXXX":case"XX":return R(r);default:return R(r,":")}},x:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"x":return F(r);case"xxxx":case"xx":return R(r);default:return R(r,":")}},O:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+$(r,":");default:return"GMT"+R(r,":")}},z:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+$(r,":");default:return"GMT"+R(r,":")}},t:function(t,e,i,o){return z(Math.floor((o._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,i,o){return z((o._originalDate||t).getTime(),e.length)}};function $(t,e){var i=t>0?"-":"+",o=Math.abs(t),r=Math.floor(o/60),n=o%60;if(0===n)return i+String(r);var s=e||"";return i+String(r)+s+z(n,2)}function F(t,e){return t%60==0?(t>0?"-":"+")+z(Math.abs(t)/60,2):R(t,e)}function R(t,e){var i=e||"",o=t>0?"-":"+",r=Math.abs(t);return o+z(Math.floor(r/60),2)+i+z(r%60,2)}const U=j;var V=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},H=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},W={p:H,P:function(t,e){var i,o=t.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return V(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",V(r,e)).replace("{{time}}",H(n,e))}};const q=W;var G=["D","DD"],Y=["YY","YYYY"];function J(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var X={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function K(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}var Z,Q={date:K({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:K({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:K({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function et(t){return function(e,i){var o;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,n=null!=i&&i.width?String(i.width):r;o=t.formattingValues[n]||t.formattingValues[r]}else{var s=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;o=t.values[a]||t.values[s]}return o[t.argumentCallback?t.argumentCallback(e):e]}}function it(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.width,r=e.match(o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth]);if(!r)return null;var n,s=r[0],a=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(s))return e}(a):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(s))return e}(a);return n=t.valueCallback?t.valueCallback(l):l,{value:n=i.valueCallback?i.valueCallback(n):n,rest:e.slice(s.length)}}}const ot={code:"en-US",formatDistance:function(t,e,i){var o,r=X[t];return o="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+o:o+" ago":o},formatLong:Q,formatRelative:function(t){return tt[t]},localize:{ordinalNumber:function(t){var e=Number(t),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:et({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:et({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:et({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:et({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:et({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(Z.matchPattern);if(!i)return null;var o=i[0],r=t.match(Z.parsePattern);if(!r)return null;var n=Z.valueCallback?Z.valueCallback(r[0]):r[0];return{value:n=e.valueCallback?e.valueCallback(n):n,rest:t.slice(o.length)}}),era:it({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:it({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:it({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:it({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:it({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var rt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,st=/^'([^]*?)'?$/,at=/''/g,lt=/[a-zA-Z]/;function ht(t,e,i){var o,r,n,s,a,l,h,c,d,u,g,y,w,x,_,k,C,S;f(2,arguments);var T=String(e),A=b(),z=null!==(o=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:A.locale)&&void 0!==o?o:ot,I=m(null!==(n=null!==(s=null!==(a=null!==(l=null==i?void 0:i.firstWeekContainsDate)&&void 0!==l?l:null==i||null===(h=i.locale)||void 0===h||null===(c=h.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==a?a:A.firstWeekContainsDate)&&void 0!==s?s:null===(d=A.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(I>=1&&I<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=m(null!==(g=null!==(y=null!==(w=null!==(x=null==i?void 0:i.weekStartsOn)&&void 0!==x?x:null==i||null===(_=i.locale)||void 0===_||null===(k=_.options)||void 0===k?void 0:k.weekStartsOn)&&void 0!==w?w:A.weekStartsOn)&&void 0!==y?y:null===(C=A.locale)||void 0===C||null===(S=C.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==g?g:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!z.localize)throw new RangeError("locale must contain localize property");if(!z.formatLong)throw new RangeError("locale must contain formatLong property");var D=v(t);if(!function(t){if(f(1,arguments),!function(t){return f(1,arguments),t instanceof Date||"object"===p(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=v(t);return!isNaN(Number(e))}(D))throw new RangeError("Invalid time value");var N=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(D),O=function(t,e){return f(2,arguments),function(t,e){f(2,arguments);var i=v(t).getTime(),o=m(e);return new Date(i+o)}(t,-m(e))}(D,N),E={firstWeekContainsDate:I,weekStartsOn:M,locale:z,_originalDate:D};return T.match(nt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,q[e])(t,z.formatLong):t})).join("").match(rt).map((function(o){if("''"===o)return"'";var r,n,s=o[0];if("'"===s)return(n=(r=o).match(st))?n[1].replace(at,"'"):r;var a=U[s];if(a)return null!=i&&i.useAdditionalWeekYearTokens||-1===Y.indexOf(o)||J(o,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!(-1!==G.indexOf(o))||J(o,e,String(t)),a(O,o,z.localize,E);if(s.match(lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return o})).join("")}function ct(t,e){var i;f(1,arguments);var o=m(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,n=function(t){var e,i={},o=t.split(dt.dateTimeDelimiter);if(o.length>2)return i;if(/:/.test(o[0])?e=o[0]:(i.date=o[0],e=o[1],dt.timeZoneDelimiter.test(i.date)&&(i.date=t.split(dt.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var r=dt.timezone.exec(e);r?(i.time=e.replace(r[1],""),i.timezone=r[1]):i.time=e}return i}(t);if(n.date){var s=function(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),o=t.match(i);if(!o)return{year:NaN,restDateString:""};var r=o[1]?parseInt(o[1]):null,n=o[2]?parseInt(o[2]):null;return{year:null===n?r:100*n,restDateString:t.slice((o[1]||o[2]).length)}}(n.date,o);r=function(t,e){if(null===e)return new Date(NaN);var i=t.match(ut);if(!i)return new Date(NaN);var o=!!i[4],r=ft(i[1]),n=ft(i[2])-1,s=ft(i[3]),a=ft(i[4]),l=ft(i[5])-1;if(o)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var o=new Date(0);o.setUTCFullYear(t,0,4);var r=7*(e-1)+i+1-(o.getUTCDay()||7);return o.setUTCDate(o.getUTCDate()+r),o}(e,a,l):new Date(NaN);var h=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(gt[e]||(bt(t)?29:28))}(e,n,s)&&function(t,e){return e>=1&&e<=(bt(t)?366:365)}(e,r)?(h.setUTCFullYear(e,n,Math.max(r,s)),h):new Date(NaN)}(s.restDateString,s.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var a,l=r.getTime(),h=0;if(n.time&&(h=function(t){var e=t.match(pt);if(!e)return NaN;var i=vt(e[1]),o=vt(e[2]),r=vt(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,o,r)?i*x+o*w+1e3*r:NaN}(n.time),isNaN(h)))return new Date(NaN);if(!n.timezone){var c=new Date(l+h),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return a=function(t){if("Z"===t)return 0;var e=t.match(mt);if(!e)return 0;var i="+"===e[1]?-1:1,o=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?i*(o*x+r*w):NaN}(n.timezone),isNaN(a)?new Date(NaN):new Date(l+h+a)}var dt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ut=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,pt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,mt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ft(t){return t?parseInt(t):1}function vt(t){return t&&parseFloat(t.replace(",","."))||0}var gt=[31,null,31,30,31,30,31,31,30,31,30,31];function bt(t){return t%400==0||t%4==0&&t%100!=0}const yt=({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}};function wt(t){if(t)return function(t){return f(1,arguments),function(t,e){f(2,arguments);var i=y(t),o=y(e);return i.getTime()===o.getTime()}(t,Date.now())}(new Date(t))?yt({date:t,format:"HH:mm"}):yt({date:t,format:"dd/MM/yyyy HH:mm"})}function xt(t,e){if(!t)return;let i=function(t,e,i){f(2,arguments);var o,r=function(t,e){return f(2,arguments),v(t).getTime()-v(e).getTime()}(t,e)/1e3;return((o=null==i?void 0:i.roundingMethod)?_[o]:_[k])(r)}("string"==typeof t?ct(t):t,e&&new Date);if(i<0)return"0D 00H 00M 00S";const o=Math.floor(i/86400);i%=86400;const r=Math.floor(i/3600);i%=3600;const n=Math.floor(i/60),s=i%60;return`${o}D ${r.toString().padStart(2,"0")}H ${n.toString().padStart(2,"0")}M ${s.toString().padStart(2,"0")}S`}const _t=class{constructor(i){t(this,i),this.lotteryBannerTimerStop=e(this,"lotteryBannerTimerStop",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.stopTime="",this.startTime="",this.bannerTitle=void 0,this.turnover=void 0,this.layout="logo,title,info",this.formattedTime=void 0}handleClientStylingChange(t,e){t!==e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleTimeChange(){this.startTimer()}async componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])d[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.startTimer()}startTimer(){this.timer&&clearInterval(this.timer),this.updateTime(),this.timer=setInterval((()=>{this.updateTime()}),1e3)}updateTime(){var t;this.formattedTime=function(t,e){const i=new Date;return t&&function(t,e){f(2,arguments);var i=v(t),o=v(e);return i.getTime()<o.getTime()}(i,ct(t))?{start:xt(t,i)}:t&&e&&function(t,e){f(2,arguments);var i=v(t).getTime(),o=v(e.start).getTime(),r=v(e.end).getTime();if(!(o<=r))throw new RangeError("Invalid interval");return i>=o&&i<=r}(i,{start:ct(t),end:ct(e)})?{end:wt(e)}:{}}(this.startTime,this.stopTime),(null===(t=this.formattedTime)||void 0===t?void 0:t.end)&&(this.timer&&clearInterval(this.timer),this.lotteryBannerTimerStop.emit())}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.timer&&clearInterval(this.timer)}renderElement(t,e=""){var i,r;switch(t){case"logo":return o("div",{class:`lottery-banner__logo-wrapper ${e}`},this.logoUrl&&o("img",{alt:"logo",src:this.logoUrl,class:"lottery-banner__logo"}));case"title":return this.bannerTitle&&o("div",{class:`lottery-banner__title ${e}`},this.bannerTitle);case"info":return o("div",{class:`lottery-banner__info ${e}`},(null===(i=this.formattedTime)||void 0===i?void 0:i.start)&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},o("span",{class:"lottery-banner__info-item-label__strong"},u("start",this.language))," ",u("in",this.language)),o("span",{class:"lottery-banner__info-item-value"},this.formattedTime.start)),(null===(r=this.formattedTime)||void 0===r?void 0:r.end)&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},o("span",{class:"lottery-banner__info-item-label__strong"},u("stop",this.language))," ",u("at",this.language)),o("span",{class:"lottery-banner__info-item-value"},this.formattedTime.end)),null!=this.turnover&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},u("turnover",this.language)),o("span",{class:"lottery-banner__info-item-value"},this.turnover)));default:return null}}render(){const t=this.layout.split(",").map((t=>t.trim()));return o("section",{key:"058aa04a8104d393f6066fd2738fb33cb6d832a2",ref:t=>this.stylingContainer=t,class:"lottery-banner"},t.map(((e,i)=>this.renderElement(e,3===t.length&&1===i?"lottery-banner__item--center":""))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],startTime:["handleTimeChange"],stopTime:["handleTimeChange"]}}};_t.style=":host {\n display: block;\n container-type: inline-size;\n}\n\n.lottery-banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--lottery-banner-gap, 0.5rem);\n padding: var(--lottery-banner-padding, 0px 20px);\n background: var(--lottery-banner-background, var(--emw--color-primary, #fed275));\n border-top: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-bottom: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-left: var(--lottery-banner-border-left, none);\n border-right: var(--lottery-banner-border-right, none);\n border-radius: var(--lottery-banner-border-radius, 0);\n white-space: nowrap;\n height: var(--lottery-banner-height, 50px);\n position: relative;\n box-sizing: border-box;\n}\n\n.lottery-banner__logo-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.lottery-banner__logo-wrapper img {\n height: 100%;\n object-fit: var(--lottery-banner-logo-object-fit, contain);\n}\n\n.lottery-banner__item--center {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.lottery-banner__title {\n text-align: center;\n font-size: var(--lottery-banner-title-font-size, 1.5rem);\n font-weight: 800;\n font-style: italic;\n letter-spacing: var(--lottery-banner-title-font-letter-spacing, 0.04em);\n color: var(--emw--color-typography, #000);\n}\n\n.lottery-banner__info {\n display: flex;\n align-items: center;\n gap: var(--lottery-banner-info-gap, 0.75rem);\n}\n\n.lottery-banner__info-item {\n font-size: var(--lottery-banner-info-font-size, 0.9rem);\n color: var(--lottery-banner-info-color, var(--emw--color-typography, #000));\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n}\n\n.lottery-banner__info-item-label {\n color: var(--lottery-banner-info-label-color, var(--emw--color-typography, #000));\n}\n.lottery-banner__info-item-label__strong {\n font-weight: var(--lottery-banner-info-label-font-weight, 700);\n}\n\n.lottery-banner__info-item-value {\n font-weight: var(--lottery-banner-info-value-font-weight, inherit);\n color: var(--lottery-banner-info-value-color, var(--emw--color-typography, #000));\n}\n\n@container (max-width: 700px) {\n .lottery-banner {\n height: auto;\n padding: var(--lottery-banner-mobile-padding, 0.5rem 1rem);\n }\n .lottery-banner__title {\n flex-basis: 100%;\n text-align: var(--lottery-banner-mobile-title-text-align, left);\n }\n .lottery-banner__info {\n flex-direction: column;\n align-items: flex-start;\n gap: var(--lottery-banner-mobile-info-gap, 0.1rem);\n }\n}";const kt=["ro","en","fr","ar","hr","zh"],Ct={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},St=class{constructor(e){t(this,e),this.handleClick=t=>{if(this.disabled)return;const e=this.host.shadowRoot.querySelector(".btn");if(!e)return;const i=e.getBoundingClientRect(),o=Math.max(i.width,i.height),r={top:t.clientY-i.top-o/2,left:t.clientX-i.left-o/2,size:o};this.ripples=[...this.ripples,r],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==r))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])Ct[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}render(){const{variant:t,disabled:e,size:i,color:r}=this,n=e||this.loading,s={};if(r)switch(t){case"primary":default:Object.assign(s,{backgroundColor:r,borderColor:r});break;case"outline":case"dashed":Object.assign(s,{color:r,borderColor:r});break;case"text":Object.assign(s,{color:r})}return o("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${i}`]:!0,"btn--loading":this.loading},style:r?s:void 0,disabled:n,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?o("div",{class:"loading-container"},o("span",{class:"content"},this.text||(()=>{const t=this.language;let e=Ct[void 0!==t&&kt.includes(t)?t:"en"].loading;return e})()),o("span",{class:"spinner"})):o("span",{class:"content"},o("slot",{name:"icon-left"}),this.text||o("slot",null),o("slot",{name:"icon-right"})),o("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,e)=>o("span",{key:e,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};St.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";const Tt=class{constructor(i){t(this,i),this.lotteryTippingBulletToggleEvent=e(this,"lotteryTippingBulletToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.value="",this.disabled=!1,this.isSelected=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}handleClick(){this.disabled||this.lotteryTippingBulletToggleEvent.emit({positionIdx:this.positionIdx})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return o("div",{key:"ef0fee38ed62adb7809b5a60668af6a499ebe5a6",ref:t=>this.stylingContainer=t},"text"===this.theme?o("div",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--text":!0}},this.value):o("button",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--disabled":this.disabled,"LotteryTippingBullet__segment--active":this.isSelected},onClick:this.handleClick.bind(this)},this.isSelected?"X":this.value))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Tt.style=".LotteryTippingBullet__segment{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:16px;line-height:1;font-weight:500;color:var(--emw--color-typography, #000);background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;cursor:pointer;transition:all 0.2s ease;user-select:none}.LotteryTippingBullet__segment:not(.LotteryTippingBullet__segment--disabled):hover{cursor:pointer;animation:jelly 0.3s ease-in-out;transform:scale(1.02)}.LotteryTippingBullet__segment--text{border:none;color:var(--emw--color-typography, #000);background:transparent;font-weight:400}.LotteryTippingBullet__segment--text:hover{cursor:not-allowed !important}.LotteryTippingBullet__segment--active{font-weight:600;background-color:var(--emw--color-background-inverse, #000);color:var(--emw--color-primary, #fed275)}.LotteryTippingBullet__segment--disabled:not(.LotteryTippingBullet__segment--active){background-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-gray-150, #6f6f6f);border-color:var(--emw--color-gray-100, #e6e6e6)}.LotteryTippingBullet__segment--disabled:hover{cursor:not-allowed}@keyframes jelly{0%{transform:translate(0, 0)}20%{transform:translate(-0.5px, -0.5px)}40%{transform:translate(0.5px, 0.5px)}60%{transform:translate(-0.25px, -0.25px)}80%{transform:translate(0.25px, 0.25px)}100%{transform:translate(0, 0)}}";const At=class{constructor(i){t(this,i),this.lotteryTippingBulletGroupToggleEvent=e(this,"lotteryTippingBulletGroupToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.mode="single",this.bulletConfigContent=""}get bulletConfigArr(){const t=[{value:"1"},{value:"X"},{value:"2"}];if("string"!=typeof this.bulletConfigContent||!this.bulletConfigContent)return t;try{return JSON.parse(this.bulletConfigContent)}catch(e){return console.error("Error parsing bulletConfigContent:",e),t}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryTippingBulletSelectionHandler(t){const{positionIdx:e}=t.detail;this.handleToggle(e)}handleToggle(t){let e=[...this.bulletConfigArr];"single"===this.mode?(e=e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1}))),e[t].isSelected=!0):(e=e.map((t=>Object.assign({},t))),e[t].isSelected=!e[t].isSelected),this.lotteryTippingBulletGroupToggleEvent.emit({bulletConfigArr:e,positionIdx:this.positionIdx+"-"+t})}render(){var t;return o("div",{ref:t=>this.stylingContainer=t,key:this.positionIdx},o("div",{key:"68223022eed831932c571378164be913206d98e9",style:{display:"flex",flexDirection:"row",gap:"10px"}},null===(t=this.bulletConfigArr)||void 0===t?void 0:t.map(((t,e)=>o("div",{key:e},o("lottery-tipping-bullet",{value:t.value,isSelected:t.isSelected,"position-idx":e,disabled:t.disabled,theme:this.theme,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};At.style="";const zt=["ro","en","fr","ar","hr"],It={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},Mt=(t,e)=>{const i=e;return It[void 0!==i&&zt.includes(i)?i:"en"][t]},Dt=class{constructor(i){t(this,i),this.open=e(this,"open",7),this.close=e(this,"close",7),this.confirm=e(this,"confirm",7),this.cancel=e(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])It[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const t=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),e=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],i=["mask",this.visible?"mask-enter":"mask-leave"],r=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return o("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:e.join(" "),ref:t=>this.stylingContainer=t},o("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:i.join(" "),onClick:this.handleMaskClick.bind(this)}),o("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:r,style:t,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&o("div",{key:"04d54878aa24e0d9eb98bc921ea3edfacd6de3af",class:"dialog-header"},o("h2",{key:"f6f6c279de47e49cde86d0c907b9b40a115926b3",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&o("button",{key:"e1625473e5460cd667961923bf678c9a91b69c82",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),o("div",{key:"fb0db8dd765832cf1d8e8b682131e4c97a93ac22",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},o("slot",{key:"75336f59c2a8fe6775fc12ed4e2e26ff6bb6b508"})),this.showFooter&&o("div",{key:"a305086a2830265317abb0fd6f59b4a053fd54a9",class:"dialog-footer"},o("slot",{key:"cb330ea63908002f4f8b4b8139d5843c2570302e",name:"footer"},this.showCancelBtn&&o("button",{key:"c3d2c15195e56efd6d388265e9ccb87030627b7b",class:"cancel-btn",onClick:this.handleClose.bind(this)},Mt("cancel",this.language)),o("button",{key:"af9c96b4e1ce82f9ecb73e2b9f4e93cba0382d76",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},Mt("confirm",this.language))))))}get el(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Dt.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";var Nt=Object.defineProperty,Ot=Object.defineProperties,Et=Object.getOwnPropertyDescriptors,Pt=Object.getOwnPropertySymbols,Bt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,Lt=(t,e,i)=>e in t?Nt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,$t=(t,e)=>{for(var i in e||(e={}))Bt.call(e,i)&&Lt(t,i,e[i]);if(Pt)for(var i of Pt(e))jt.call(e,i)&&Lt(t,i,e[i]);return t},Ft=(t,e)=>Ot(t,Et(e)),Rt=(t,e,i)=>(Lt(t,"symbol"!=typeof e?e+"":e,i),i),Ut=(t,e,i)=>new Promise(((o,r)=>{var n=t=>{try{a(i.next(t))}catch(t){r(t)}},s=t=>{try{a(i.throw(t))}catch(t){r(t)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())}))
|
|
1
|
+
import{r as t,c as e,g as i,h as o,a as r}from"./index-3be4f76e.js";import{s as n,a as s,b as a}from"./lottery-tipping-page-af6b6291.js";export{L as lottery_tipping_page}from"./lottery-tipping-page-af6b6291.js";const l=class{constructor(o){t(this,o),this.change=e(this,"change",7),this.handleOutsideClick=t=>{t.composedPath().includes(this.el)||(this.dropdownOpen=!1,this.overflowOpen=!1)},this.toggleDropdown=t=>{t.stopPropagation(),this.dropdownOpen=!this.dropdownOpen,this.overflowOpen=!1},this.isSelected=t=>this.selectedValues.includes(t),this.selectItem=t=>{this.isSelected(t.value)||(this.selectedValues=[...this.selectedValues,t.value],this.change.emit(this.selectedValues))},this.toggleItem=t=>{this.isSelected(t.value)?this.removeItem(t.value):this.selectItem(t)},this.removeItem=(t,e)=>{e&&e.stopPropagation(),this.selectedValues=this.selectedValues.filter((e=>e!==t)),this.change.emit(this.selectedValues)},this.downIcon=i("../static/dropdown.svg"),this.upIcon=i("../static/dropup.svg"),this.isTouch="ontouchstart"in window,this.openOverflow=()=>{this.isTouch||(this.computePopoverPosition(),this.overflowOpen=!0)},this.closeOverflow=()=>{this.isTouch||(this.overflowOpen=!1)},this.toggleOverflow=t=>{t.stopPropagation(),this.computePopoverPosition(),this.overflowOpen=!this.overflowOpen},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.options=[],this.maxVisibleChips=2,this.placeholder="",this.selectedValues=[],this.dropdownOpen=!1,this.overflowOpen=!1,this.popoverStyle={top:"0px",left:"0px"}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}async clear(){this.selectedValues=[],this.change.emit(this.selectedValues)}componentWillLoad(){document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){document.removeEventListener("click",this.handleOutsideClick),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}get selectedOptions(){return this.options.filter((t=>this.isSelected(t.value)))}get visibleChips(){return this.selectedOptions.slice(0,this.maxVisibleChips)}get hiddenChips(){return this.selectedOptions.slice(this.maxVisibleChips)}computePopoverPosition(){if(this.overflowChipEl&&this.el){const{left:t}=this.overflowChipEl.getBoundingClientRect(),{left:e,height:i}=this.el.getBoundingClientRect();this.popoverStyle={top:i-10+"px",left:t-e+"px"}}}render(){var t;return o("div",{key:"50b48397be3ede1907ab2c2abcd1cf2f43f69c13",class:"general-multi-select-container",ref:t=>this.stylingContainer=t},o("div",{key:"696a1bb1f221f8f5cf290fac040af10e2e5a115e",class:"multi-select-container",ref:t=>this.el=t},o("div",{key:"9ea92f01787b26d43054573a11896cf65065b073",class:"flex-row",onClick:this.toggleDropdown},o("div",{key:"f79720ca3ec383ee7f95b09483698ee18119c79a",class:"control"},this.visibleChips.map((t=>o("span",{class:"chip"},o("div",{class:"chip-text",title:t.text},t.text),o("div",{class:"remove-btn",onClick:e=>this.removeItem(t.value,e)},"×")))),this.hiddenChips.length>0&&o("span",{key:"25e9e527c33dd7a315dacb10cc51084fe69b9b7e",class:"chip overflow-chip",ref:t=>this.overflowChipEl=t,onMouseEnter:this.openOverflow,onMouseLeave:this.closeOverflow,onClick:this.toggleOverflow},"•••"),0===this.selectedValues.length&&o("span",{key:"b061de660a55f7a0d41ce9aa650108d3f38a9dc0",class:"placeholder"},this.placeholder)),o("div",{key:"f83b6517e88b3976cdc18590f8f1233cb2515230",class:"arrow"},o("img",{key:"1b61a49090237057b98e5ce8a4f7c1e3bfc9d4ba",class:"info-icon",src:this.dropdownOpen?this.upIcon:this.downIcon,style:{width:"18px"}}))),this.dropdownOpen&&o("div",{key:"e5b081007bcbdd251ce5ac235c1f19f17852c420",class:"dropdown"},this.options.map((t=>o("div",{class:{"dropdown-item":!0,selected:this.isSelected(t.value)},onClick:()=>this.toggleItem(t)},t.text)))),this.overflowOpen&&!!(null===(t=this.hiddenChips)||void 0===t?void 0:t.length)&&o("div",{key:"f8e3289042c69c569bebcd0a40d90f31261c6c12",class:"overflow-popover",style:{top:this.popoverStyle.top,left:this.popoverStyle.left},onMouseEnter:this.openOverflow,onMouseLeave:this.closeOverflow},this.hiddenChips.map((t=>o("span",{class:"chip"},o("span",{class:"chip-text",title:t.text},t.text),o("span",{class:"remove-btn",onClick:e=>this.removeItem(t.value,e)},"×")))))))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};l.style='.multi-select-container{position:relative;font-family:"Inter", sans-serif;margin-top:4px;width:100%}.flex-row{display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;padding:6px 10px;padding-right:6px;border-radius:0.25em;background:var(--emw-selector-color-background, #e8ebef);cursor:pointer}.control{flex:1;display:flex;align-items:center;flex-wrap:nowrap;overflow:hidden}.control:focus-within{border-color:var(--emw--color-primary, #fed275);box-shadow:0 0 0 2px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15))}.chip{display:inline-flex;align-items:center;background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-dialog-typography, #000);border-radius:4px;padding:2px 8px;margin-right:6px;font-size:0.875rem;line-height:1.2;justify-content:space-between;flex:0 1 auto;min-width:0}.chip-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overflow-chip{background:var(--emw--color-gray-100, #e6e6e6);color:var(--emw--color-gray-300, #333);width:20px;text-align:center;display:block}.remove-btn{background:none;border:none;font-size:1rem;margin-left:6px;cursor:pointer;color:var(--emw--color-gray-150, #6f6f6f)}.remove-btn:hover{color:var(--emw--color-error, red)}.placeholder{color:var(--emw--color-gray-150, #6f6f6f);font-size:0.875rem;padding:3px 8px;padding-left:0;line-height:1.2}.arrow{margin-left:auto;font-size:0.8rem;width:20px;color:var(--emw--color-gray-150, #6f6f6f)}.dropdown{position:absolute;top:calc(100% + 4px);left:0;width:100%;max-height:240px;overflow-y:auto;border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;background:var(--emw--color-dialog-background, #ffffff);box-shadow:0 4px 12px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));z-index:10}.dropdown-item{padding:10px 14px;cursor:pointer;font-size:0.875rem;line-height:1.4;transition:background 0.2s}.dropdown-item:hover{background:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-typography, #000)}.dropdown-item.selected{background:var(--emw--color-background-secondary, #f5f5f5);color:var(--emw--color-typography, #000);font-weight:500}.overflow-popover{position:absolute;top:var(--overflow-top, 0px);left:var(--overflow-left, 0px);max-width:200px;padding:12px;display:flex;flex-wrap:wrap;gap:6px;border:1px solid var(--emw--color-gray-100, #d0d5dd);border-radius:6px;background:var(--emw--color-background, #ffffff);box-shadow:0 4px 12px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));z-index:20}';const h=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.position="top",this.delay=200,this.isVisible=!1,this._tooltipId=void 0}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this._tooltipId=`general-tooltip-${Math.random().toString(36).substring(2,9)}`}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}handleMouseEnterOrFocus(){clearTimeout(this.hideTimeout),this.showTimeout&&clearTimeout(this.showTimeout),this.showTimeout=setTimeout((()=>{this.isVisible=!0}),this.delay)}handleMouseLeaveOrBlur(){this.showTimeout&&clearTimeout(this.showTimeout),this.hideTimeout=setTimeout((()=>{this.isVisible=!1}),100)}handleKeyDown(t){"Escape"===t.key&&this.isVisible&&(this.isVisible=!1)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),clearTimeout(this.showTimeout),clearTimeout(this.hideTimeout)}render(){const t={"general-tooltip-popup":!0,visible:this.isVisible,[`general-tooltip-${this.position}`]:!0};return o("div",{key:"c0d52518e1e196e0d022789f7c6b7e64173b2c7d",class:"general-tooltip-wrapper"},o("slot",{key:"a935e103e16b0b619a024706e8224f4a937de6b9",name:"trigger"}),o("div",{key:"35c60e35ce3f8d5c2c42cd333fe64a3b289d34d4",class:"general-tooltip-container",role:"tooltip",ref:t=>this.stylingContainer=t},o("div",{key:"9d3fd9f142c1e3bd263dee289a2c1a9e4eebfddc",id:this._tooltipId,class:t,role:"tooltip"},o("slot",{key:"31344f0d4d4139f913d1819cc4f42a39f5113d8a",name:"content"}),o("div",{key:"f5cdd93060baec37b2a2879056efe2d66c5a553a",class:"general-tooltip-arrow"}))))}get hostElement(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};h.style=".general-tooltip-wrapper{display:inline-block;position:relative;line-height:0}.general-tooltip-container{display:contents;}.general-tooltip-popup{position:absolute;color:var(--emw--color-typography-inverse, #fff);background:var(--emw--color-background-inverse, #000);padding:8px 12px;border-radius:4px;font-size:0.875em;line-height:1.4;z-index:1000;opacity:0;visibility:hidden;transition:opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;white-space:nowrap;pointer-events:none;}.general-tooltip-popup.visible{opacity:1;visibility:visible}.general-tooltip-arrow{position:absolute;width:0;height:0;border-style:solid}.general-tooltip-top{bottom:100%;left:50%;transform:translateX(-50%);margin-bottom:8px;}.general-tooltip-top .general-tooltip-arrow{top:100%;left:50%;transform:translateX(-50%);border-width:6px 6px 0 6px;border-color:var(--emw--color-gray-300, #333) transparent transparent transparent}.general-tooltip-bottom{top:100%;left:50%;transform:translateX(-50%);margin-top:8px;}.general-tooltip-bottom .general-tooltip-arrow{bottom:100%;left:50%;transform:translateX(-50%);border-width:0 6px 6px 6px;border-color:transparent transparent var(--emw--color-gray-300, #333) transparent}.general-tooltip-left{right:100%;top:50%;transform:translateY(-50%);margin-right:8px;}.general-tooltip-left .general-tooltip-arrow{left:100%;top:50%;transform:translateY(-50%);border-width:6px 0 6px 6px;border-color:transparent transparent transparent var(--emw--color-gray-300, #333)}.general-tooltip-right{left:100%;top:50%;transform:translateY(-50%);margin-left:8px;}.general-tooltip-right .general-tooltip-arrow{right:100%;top:50%;transform:translateY(-50%);border-width:6px 6px 6px 0;border-color:transparent var(--emw--color-gray-300, #333) transparent transparent}";const c=["ro","en","fr","ar","hr"],d={en:{stop:"Stop",at:"at",turnover:"Turnover: ",startIn:"Sales Start in:"},ro:{stop:"Oprește",at:"la"},fr:{stop:"Arrêtez",at:"à"},ar:{stop:"توقف",at:"في"},hr:{stop:"Stop",at:"u"}},u=(t,e)=>{const i=e;return d[void 0!==i&&c.includes(i)?i:"en"][t]};function p(t){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p(t)}function m(t){if(null===t||!0===t||!1===t)return NaN;var e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function f(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function v(t){f(1,arguments);var e=Object.prototype.toString.call(t);return t instanceof Date||"object"===p(t)&&"[object Date]"===e?new Date(t.getTime()):"number"==typeof t||"[object Number]"===e?new Date(t):("string"!=typeof t&&"[object String]"!==e||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"),console.warn((new Error).stack)),new Date(NaN))}var g={};function b(){return g}function y(t){f(1,arguments);var e=v(t);return e.setHours(0,0,0,0),e}var w=6e4,x=36e5;var _={ceil:Math.ceil,round:Math.round,floor:Math.floor,trunc:function(t){return t<0?Math.ceil(t):Math.floor(t)}},k="trunc";function C(t){f(1,arguments);var e=v(t),i=e.getUTCDay(),o=(i<1?7:0)+i-1;return e.setUTCDate(e.getUTCDate()-o),e.setUTCHours(0,0,0,0),e}function S(t){f(1,arguments);var e=v(t),i=e.getUTCFullYear(),o=new Date(0);o.setUTCFullYear(i+1,0,4),o.setUTCHours(0,0,0,0);var r=C(o),n=new Date(0);n.setUTCFullYear(i,0,4),n.setUTCHours(0,0,0,0);var s=C(n);return e.getTime()>=r.getTime()?i+1:e.getTime()>=s.getTime()?i:i-1}function T(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=b(),d=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.weekStartsOn)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==r?r:c.weekStartsOn)&&void 0!==o?o:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.weekStartsOn)&&void 0!==i?i:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var u=v(t),p=u.getUTCDay(),g=(p<d?7:0)+p-d;return u.setUTCDate(u.getUTCDate()-g),u.setUTCHours(0,0,0,0),u}function A(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=v(t),d=c.getUTCFullYear(),u=b(),p=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.firstWeekContainsDate)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:u.firstWeekContainsDate)&&void 0!==o?o:null===(l=u.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1);if(!(p>=1&&p<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var g=new Date(0);g.setUTCFullYear(d+1,0,p),g.setUTCHours(0,0,0,0);var y=T(g,e),w=new Date(0);w.setUTCFullYear(d,0,p),w.setUTCHours(0,0,0,0);var x=T(w,e);return c.getTime()>=y.getTime()?d+1:c.getTime()>=x.getTime()?d:d-1}function z(t,e){for(var i=t<0?"-":"",o=Math.abs(t).toString();o.length<e;)o="0"+o;return i+o}const I=function(t,e){var i=t.getUTCFullYear(),o=i>0?i:1-i;return z("yy"===e?o%100:o,e.length)},M=function(t,e){var i=t.getUTCMonth();return"M"===e?String(i+1):z(i+1,2)},D=function(t,e){return z(t.getUTCDate(),e.length)},N=function(t,e){return z(t.getUTCHours()%12||12,e.length)},O=function(t,e){return z(t.getUTCHours(),e.length)},E=function(t,e){return z(t.getUTCMinutes(),e.length)},P=function(t,e){return z(t.getUTCSeconds(),e.length)},B=function(t,e){var i=e.length,o=t.getUTCMilliseconds();return z(Math.floor(o*Math.pow(10,i-3)),e.length)};var j={G:function(t,e,i){var o=t.getUTCFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return i.era(o,{width:"abbreviated"});case"GGGGG":return i.era(o,{width:"narrow"});default:return i.era(o,{width:"wide"})}},y:function(t,e,i){if("yo"===e){var o=t.getUTCFullYear();return i.ordinalNumber(o>0?o:1-o,{unit:"year"})}return I(t,e)},Y:function(t,e,i,o){var r=A(t,o),n=r>0?r:1-r;return"YY"===e?z(n%100,2):"Yo"===e?i.ordinalNumber(n,{unit:"year"}):z(n,e.length)},R:function(t,e){return z(S(t),e.length)},u:function(t,e){return z(t.getUTCFullYear(),e.length)},Q:function(t,e,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"Q":return String(o);case"QQ":return z(o,2);case"Qo":return i.ordinalNumber(o,{unit:"quarter"});case"QQQ":return i.quarter(o,{width:"abbreviated",context:"formatting"});case"QQQQQ":return i.quarter(o,{width:"narrow",context:"formatting"});default:return i.quarter(o,{width:"wide",context:"formatting"})}},q:function(t,e,i){var o=Math.ceil((t.getUTCMonth()+1)/3);switch(e){case"q":return String(o);case"qq":return z(o,2);case"qo":return i.ordinalNumber(o,{unit:"quarter"});case"qqq":return i.quarter(o,{width:"abbreviated",context:"standalone"});case"qqqqq":return i.quarter(o,{width:"narrow",context:"standalone"});default:return i.quarter(o,{width:"wide",context:"standalone"})}},M:function(t,e,i){var o=t.getUTCMonth();switch(e){case"M":case"MM":return M(t,e);case"Mo":return i.ordinalNumber(o+1,{unit:"month"});case"MMM":return i.month(o,{width:"abbreviated",context:"formatting"});case"MMMMM":return i.month(o,{width:"narrow",context:"formatting"});default:return i.month(o,{width:"wide",context:"formatting"})}},L:function(t,e,i){var o=t.getUTCMonth();switch(e){case"L":return String(o+1);case"LL":return z(o+1,2);case"Lo":return i.ordinalNumber(o+1,{unit:"month"});case"LLL":return i.month(o,{width:"abbreviated",context:"standalone"});case"LLLLL":return i.month(o,{width:"narrow",context:"standalone"});default:return i.month(o,{width:"wide",context:"standalone"})}},w:function(t,e,i,o){var r=function(t,e){f(1,arguments);var i=v(t),o=T(i,e).getTime()-function(t,e){var i,o,r,n,s,a,l,h;f(1,arguments);var c=b(),d=m(null!==(i=null!==(o=null!==(r=null!==(n=null==e?void 0:e.firstWeekContainsDate)&&void 0!==n?n:null==e||null===(s=e.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==r?r:c.firstWeekContainsDate)&&void 0!==o?o:null===(l=c.locale)||void 0===l||null===(h=l.options)||void 0===h?void 0:h.firstWeekContainsDate)&&void 0!==i?i:1),u=A(t,e),p=new Date(0);return p.setUTCFullYear(u,0,d),p.setUTCHours(0,0,0,0),T(p,e)}(i,e).getTime();return Math.round(o/6048e5)+1}(t,o);return"wo"===e?i.ordinalNumber(r,{unit:"week"}):z(r,e.length)},I:function(t,e,i){var o=function(t){f(1,arguments);var e=v(t),i=C(e).getTime()-function(t){f(1,arguments);var e=S(t),i=new Date(0);return i.setUTCFullYear(e,0,4),i.setUTCHours(0,0,0,0),C(i)}(e).getTime();return Math.round(i/6048e5)+1}(t);return"Io"===e?i.ordinalNumber(o,{unit:"week"}):z(o,e.length)},d:function(t,e,i){return"do"===e?i.ordinalNumber(t.getUTCDate(),{unit:"date"}):D(t,e)},D:function(t,e,i){var o=function(t){f(1,arguments);var e=v(t),i=e.getTime();e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0);var o=e.getTime();return Math.floor((i-o)/864e5)+1}(t);return"Do"===e?i.ordinalNumber(o,{unit:"dayOfYear"}):z(o,e.length)},E:function(t,e,i){var o=t.getUTCDay();switch(e){case"E":case"EE":case"EEE":return i.day(o,{width:"abbreviated",context:"formatting"});case"EEEEE":return i.day(o,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},e:function(t,e,i,o){var r=t.getUTCDay(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"e":return String(n);case"ee":return z(n,2);case"eo":return i.ordinalNumber(n,{unit:"day"});case"eee":return i.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return i.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(r,{width:"short",context:"formatting"});default:return i.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,i,o){var r=t.getUTCDay(),n=(r-o.weekStartsOn+8)%7||7;switch(e){case"c":return String(n);case"cc":return z(n,e.length);case"co":return i.ordinalNumber(n,{unit:"day"});case"ccc":return i.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return i.day(r,{width:"narrow",context:"standalone"});case"cccccc":return i.day(r,{width:"short",context:"standalone"});default:return i.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,i){var o=t.getUTCDay(),r=0===o?7:o;switch(e){case"i":return String(r);case"ii":return z(r,e.length);case"io":return i.ordinalNumber(r,{unit:"day"});case"iii":return i.day(o,{width:"abbreviated",context:"formatting"});case"iiiii":return i.day(o,{width:"narrow",context:"formatting"});case"iiiiii":return i.day(o,{width:"short",context:"formatting"});default:return i.day(o,{width:"wide",context:"formatting"})}},a:function(t,e,i){var o=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"aaa":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},b:function(t,e,i){var o,r=t.getUTCHours();switch(o=12===r?"noon":0===r?"midnight":r/12>=1?"pm":"am",e){case"b":case"bb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"bbb":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},B:function(t,e,i){var o,r=t.getUTCHours();switch(o=r>=17?"evening":r>=12?"afternoon":r>=4?"morning":"night",e){case"B":case"BB":case"BBB":return i.dayPeriod(o,{width:"abbreviated",context:"formatting"});case"BBBBB":return i.dayPeriod(o,{width:"narrow",context:"formatting"});default:return i.dayPeriod(o,{width:"wide",context:"formatting"})}},h:function(t,e,i){if("ho"===e){var o=t.getUTCHours()%12;return 0===o&&(o=12),i.ordinalNumber(o,{unit:"hour"})}return N(t,e)},H:function(t,e,i){return"Ho"===e?i.ordinalNumber(t.getUTCHours(),{unit:"hour"}):O(t,e)},K:function(t,e,i){var o=t.getUTCHours()%12;return"Ko"===e?i.ordinalNumber(o,{unit:"hour"}):z(o,e.length)},k:function(t,e,i){var o=t.getUTCHours();return 0===o&&(o=24),"ko"===e?i.ordinalNumber(o,{unit:"hour"}):z(o,e.length)},m:function(t,e,i){return"mo"===e?i.ordinalNumber(t.getUTCMinutes(),{unit:"minute"}):E(t,e)},s:function(t,e,i){return"so"===e?i.ordinalNumber(t.getUTCSeconds(),{unit:"second"}):P(t,e)},S:function(t,e){return B(t,e)},X:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return F(r);case"XXXX":case"XX":return R(r);default:return R(r,":")}},x:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"x":return F(r);case"xxxx":case"xx":return R(r);default:return R(r,":")}},O:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+$(r,":");default:return"GMT"+R(r,":")}},z:function(t,e,i,o){var r=(o._originalDate||t).getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+$(r,":");default:return"GMT"+R(r,":")}},t:function(t,e,i,o){return z(Math.floor((o._originalDate||t).getTime()/1e3),e.length)},T:function(t,e,i,o){return z((o._originalDate||t).getTime(),e.length)}};function $(t,e){var i=t>0?"-":"+",o=Math.abs(t),r=Math.floor(o/60),n=o%60;if(0===n)return i+String(r);var s=e||"";return i+String(r)+s+z(n,2)}function F(t,e){return t%60==0?(t>0?"-":"+")+z(Math.abs(t)/60,2):R(t,e)}function R(t,e){var i=e||"",o=t>0?"-":"+",r=Math.abs(t);return o+z(Math.floor(r/60),2)+i+z(r%60,2)}const U=j;var V=function(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},H=function(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},W={p:H,P:function(t,e){var i,o=t.match(/(P+)(p+)?/)||[],r=o[1],n=o[2];if(!n)return V(t,e);switch(r){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;default:i=e.dateTime({width:"full"})}return i.replace("{{date}}",V(r,e)).replace("{{time}}",H(n,e))}};const q=W;var G=["D","DD"],Y=["YY","YYYY"];function J(t,e,i){if("YYYY"===t)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===t)throw new RangeError("Use `yy` instead of `YY` (in `".concat(e,"`) for formatting years to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===t)throw new RangeError("Use `d` instead of `D` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===t)throw new RangeError("Use `dd` instead of `DD` (in `".concat(e,"`) for formatting days of the month to the input `").concat(i,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var X={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function K(t){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=e.width?String(e.width):t.defaultWidth;return t.formats[i]||t.formats[t.defaultWidth]}}var Z,Q={date:K({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:K({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:K({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},tt={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function et(t){return function(e,i){var o;if("formatting"===(null!=i&&i.context?String(i.context):"standalone")&&t.formattingValues){var r=t.defaultFormattingWidth||t.defaultWidth,n=null!=i&&i.width?String(i.width):r;o=t.formattingValues[n]||t.formattingValues[r]}else{var s=t.defaultWidth,a=null!=i&&i.width?String(i.width):t.defaultWidth;o=t.values[a]||t.values[s]}return o[t.argumentCallback?t.argumentCallback(e):e]}}function it(t){return function(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.width,r=e.match(o&&t.matchPatterns[o]||t.matchPatterns[t.defaultMatchWidth]);if(!r)return null;var n,s=r[0],a=o&&t.parsePatterns[o]||t.parsePatterns[t.defaultParseWidth],l=Array.isArray(a)?function(t){for(var e=0;e<t.length;e++)if(t[e].test(s))return e}(a):function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].test(s))return e}(a);return n=t.valueCallback?t.valueCallback(l):l,{value:n=i.valueCallback?i.valueCallback(n):n,rest:e.slice(s.length)}}}const ot={code:"en-US",formatDistance:function(t,e,i){var o,r=X[t];return o="string"==typeof r?r:1===e?r.one:r.other.replace("{{count}}",e.toString()),null!=i&&i.addSuffix?i.comparison&&i.comparison>0?"in "+o:o+" ago":o},formatLong:Q,formatRelative:function(t){return tt[t]},localize:{ordinalNumber:function(t){var e=Number(t),i=e%100;if(i>20||i<10)switch(i%10){case 1:return e+"st";case 2:return e+"nd";case 3:return e+"rd"}return e+"th"},era:et({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:et({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(t){return t-1}}),month:et({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:et({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:et({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(Z={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(t){return parseInt(t,10)}},function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=t.match(Z.matchPattern);if(!i)return null;var o=i[0],r=t.match(Z.parsePattern);if(!r)return null;var n=Z.valueCallback?Z.valueCallback(r[0]):r[0];return{value:n=e.valueCallback?e.valueCallback(n):n,rest:t.slice(o.length)}}),era:it({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:it({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(t){return t+1}}),month:it({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:it({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:it({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};var rt=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,nt=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,st=/^'([^]*?)'?$/,at=/''/g,lt=/[a-zA-Z]/;function ht(t,e,i){var o,r,n,s,a,l,h,c,d,u,g,y,w,x,_,k,C,S;f(2,arguments);var T=String(e),A=b(),z=null!==(o=null!==(r=null==i?void 0:i.locale)&&void 0!==r?r:A.locale)&&void 0!==o?o:ot,I=m(null!==(n=null!==(s=null!==(a=null!==(l=null==i?void 0:i.firstWeekContainsDate)&&void 0!==l?l:null==i||null===(h=i.locale)||void 0===h||null===(c=h.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==a?a:A.firstWeekContainsDate)&&void 0!==s?s:null===(d=A.locale)||void 0===d||null===(u=d.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==n?n:1);if(!(I>=1&&I<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var M=m(null!==(g=null!==(y=null!==(w=null!==(x=null==i?void 0:i.weekStartsOn)&&void 0!==x?x:null==i||null===(_=i.locale)||void 0===_||null===(k=_.options)||void 0===k?void 0:k.weekStartsOn)&&void 0!==w?w:A.weekStartsOn)&&void 0!==y?y:null===(C=A.locale)||void 0===C||null===(S=C.options)||void 0===S?void 0:S.weekStartsOn)&&void 0!==g?g:0);if(!(M>=0&&M<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!z.localize)throw new RangeError("locale must contain localize property");if(!z.formatLong)throw new RangeError("locale must contain formatLong property");var D=v(t);if(!function(t){if(f(1,arguments),!function(t){return f(1,arguments),t instanceof Date||"object"===p(t)&&"[object Date]"===Object.prototype.toString.call(t)}(t)&&"number"!=typeof t)return!1;var e=v(t);return!isNaN(Number(e))}(D))throw new RangeError("Invalid time value");var N=function(t){var e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}(D),O=function(t,e){return f(2,arguments),function(t,e){f(2,arguments);var i=v(t).getTime(),o=m(e);return new Date(i+o)}(t,-m(e))}(D,N),E={firstWeekContainsDate:I,weekStartsOn:M,locale:z,_originalDate:D};return T.match(nt).map((function(t){var e=t[0];return"p"===e||"P"===e?(0,q[e])(t,z.formatLong):t})).join("").match(rt).map((function(o){if("''"===o)return"'";var r,n,s=o[0];if("'"===s)return(n=(r=o).match(st))?n[1].replace(at,"'"):r;var a=U[s];if(a)return null!=i&&i.useAdditionalWeekYearTokens||-1===Y.indexOf(o)||J(o,e,String(t)),null!=i&&i.useAdditionalDayOfYearTokens||!(-1!==G.indexOf(o))||J(o,e,String(t)),a(O,o,z.localize,E);if(s.match(lt))throw new RangeError("Format string contains an unescaped latin alphabet character `"+s+"`");return o})).join("")}function ct(t,e){var i;f(1,arguments);var o=m(null!==(i=null==e?void 0:e.additionalDigits)&&void 0!==i?i:2);if(2!==o&&1!==o&&0!==o)throw new RangeError("additionalDigits must be 0, 1 or 2");if("string"!=typeof t&&"[object String]"!==Object.prototype.toString.call(t))return new Date(NaN);var r,n=function(t){var e,i={},o=t.split(dt.dateTimeDelimiter);if(o.length>2)return i;if(/:/.test(o[0])?e=o[0]:(i.date=o[0],e=o[1],dt.timeZoneDelimiter.test(i.date)&&(i.date=t.split(dt.timeZoneDelimiter)[0],e=t.substr(i.date.length,t.length))),e){var r=dt.timezone.exec(e);r?(i.time=e.replace(r[1],""),i.timezone=r[1]):i.time=e}return i}(t);if(n.date){var s=function(t,e){var i=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),o=t.match(i);if(!o)return{year:NaN,restDateString:""};var r=o[1]?parseInt(o[1]):null,n=o[2]?parseInt(o[2]):null;return{year:null===n?r:100*n,restDateString:t.slice((o[1]||o[2]).length)}}(n.date,o);r=function(t,e){if(null===e)return new Date(NaN);var i=t.match(ut);if(!i)return new Date(NaN);var o=!!i[4],r=ft(i[1]),n=ft(i[2])-1,s=ft(i[3]),a=ft(i[4]),l=ft(i[5])-1;if(o)return function(t,e,i){return e>=1&&e<=53&&i>=0&&i<=6}(0,a,l)?function(t,e,i){var o=new Date(0);o.setUTCFullYear(t,0,4);var r=7*(e-1)+i+1-(o.getUTCDay()||7);return o.setUTCDate(o.getUTCDate()+r),o}(e,a,l):new Date(NaN);var h=new Date(0);return function(t,e,i){return e>=0&&e<=11&&i>=1&&i<=(gt[e]||(bt(t)?29:28))}(e,n,s)&&function(t,e){return e>=1&&e<=(bt(t)?366:365)}(e,r)?(h.setUTCFullYear(e,n,Math.max(r,s)),h):new Date(NaN)}(s.restDateString,s.year)}if(!r||isNaN(r.getTime()))return new Date(NaN);var a,l=r.getTime(),h=0;if(n.time&&(h=function(t){var e=t.match(pt);if(!e)return NaN;var i=vt(e[1]),o=vt(e[2]),r=vt(e[3]);return function(t,e,i){return 24===t?0===e&&0===i:i>=0&&i<60&&e>=0&&e<60&&t>=0&&t<25}(i,o,r)?i*x+o*w+1e3*r:NaN}(n.time),isNaN(h)))return new Date(NaN);if(!n.timezone){var c=new Date(l+h),d=new Date(0);return d.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),d.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),d}return a=function(t){if("Z"===t)return 0;var e=t.match(mt);if(!e)return 0;var i="+"===e[1]?-1:1,o=parseInt(e[2]),r=e[3]&&parseInt(e[3])||0;return function(t,e){return e>=0&&e<=59}(0,r)?i*(o*x+r*w):NaN}(n.timezone),isNaN(a)?new Date(NaN):new Date(l+h+a)}var dt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},ut=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,pt=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,mt=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ft(t){return t?parseInt(t):1}function vt(t){return t&&parseFloat(t.replace(",","."))||0}var gt=[31,null,31,30,31,30,31,31,30,31,30,31];function bt(t){return t%400==0||t%4==0&&t%100!=0}const yt=({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}};function wt(t){if(t)return function(t){return f(1,arguments),function(t,e){f(2,arguments);var i=y(t),o=y(e);return i.getTime()===o.getTime()}(t,Date.now())}(new Date(t))?yt({date:t,format:"HH:mm"}):yt({date:t,format:"dd/MM/yyyy HH:mm"})}function xt(t,e){if(!t)return;let i=function(t,e,i){f(2,arguments);var o,r=function(t,e){return f(2,arguments),v(t).getTime()-v(e).getTime()}(t,e)/1e3;return((o=null==i?void 0:i.roundingMethod)?_[o]:_[k])(r)}("string"==typeof t?ct(t):t,e&&new Date);if(i<0)return"0D 00H 00M 00S";const o=Math.floor(i/86400);i%=86400;const r=Math.floor(i/3600);i%=3600;const n=Math.floor(i/60),s=i%60;return`${o}D ${r.toString().padStart(2,"0")}H ${n.toString().padStart(2,"0")}M ${s.toString().padStart(2,"0")}S`}const _t=class{constructor(i){t(this,i),this.lotteryBannerTimerStop=e(this,"lotteryBannerTimerStop",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.stopTime="",this.startTime="",this.bannerTitle=void 0,this.turnover=void 0,this.layout="logo,title,info",this.formattedTime=void 0}handleClientStylingChange(t,e){t!==e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleTimeChange(){this.startTimer()}async componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])d[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl),this.startTimer()}startTimer(){this.timer&&clearInterval(this.timer),this.updateTime(),this.timer=setInterval((()=>{this.updateTime()}),1e3)}updateTime(){var t;this.formattedTime=function(t,e){const i=new Date;return t&&function(t,e){f(2,arguments);var i=v(t),o=v(e);return i.getTime()<o.getTime()}(i,ct(t))?{start:xt(t,i)}:t&&e&&function(t,e){f(2,arguments);var i=v(t).getTime(),o=v(e.start).getTime(),r=v(e.end).getTime();if(!(o<=r))throw new RangeError("Invalid interval");return i>=o&&i<=r}(i,{start:ct(t),end:ct(e)})?{end:wt(e)}:{}}(this.startTime,this.stopTime),(null===(t=this.formattedTime)||void 0===t?void 0:t.end)&&(this.timer&&clearInterval(this.timer),this.lotteryBannerTimerStop.emit())}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe(),this.timer&&clearInterval(this.timer)}renderElement(t,e=""){var i,r,n;switch(t){case"logo":return o("div",{class:`lottery-banner__logo-wrapper ${e}`},this.logoUrl&&o("img",{alt:"logo",src:this.logoUrl,class:"lottery-banner__logo"}));case"title":return this.bannerTitle&&o("div",{class:`lottery-banner__title ${e}`},this.bannerTitle);case"info":return o("div",{class:`lottery-banner__info ${e}`},(null===(i=this.formattedTime)||void 0===i?void 0:i.start)&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},o("span",{class:"lottery-banner__info-item-label__strong"},u("startIn",this.language))," "),o("span",{class:"lottery-banner__info-item-value lottery-banner__info-item-value__strong"},this.formattedTime.start)),(null===(r=this.formattedTime)||void 0===r?void 0:r.end)&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},o("span",{class:"lottery-banner__info-item-label__strong"},u("stop",this.language))," ",u("at",this.language)),o("span",{class:"lottery-banner__info-item-value"},this.formattedTime.end)),(null===(n=this.formattedTime)||void 0===n?void 0:n.end)&&null!=this.turnover&&o("div",{class:"lottery-banner__info-item"},o("span",{class:"lottery-banner__info-item-label"},u("turnover",this.language)),o("span",{class:"lottery-banner__info-item-value"},this.turnover)));default:return null}}render(){const t=this.layout.split(",").map((t=>t.trim()));return o("section",{key:"de09c785c74e1182381ba3332899158da814240d",ref:t=>this.stylingContainer=t,class:"lottery-banner"},t.map(((e,i)=>this.renderElement(e,3===t.length&&1===i?"lottery-banner__item--center":""))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],startTime:["handleTimeChange"],stopTime:["handleTimeChange"]}}};_t.style=":host {\n display: block;\n container-type: inline-size;\n}\n\n.lottery-banner {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--lottery-banner-gap, 0.5rem);\n padding: var(--lottery-banner-padding, 0px 20px);\n background: var(--lottery-banner-background, var(--emw--color-primary, #fed275));\n border-top: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-bottom: var(--lottery-banner-border-width, 2px) var(--lottery-banner-border-style, solid) var(--lottery-banner-border-color, var(--emw--color-primary, #fed275));\n border-left: var(--lottery-banner-border-left, none);\n border-right: var(--lottery-banner-border-right, none);\n border-radius: var(--lottery-banner-border-radius, 0);\n white-space: nowrap;\n height: var(--lottery-banner-height, 50px);\n position: relative;\n box-sizing: border-box;\n}\n\n.lottery-banner__logo-wrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n}\n.lottery-banner__logo-wrapper img {\n height: 100%;\n object-fit: var(--lottery-banner-logo-object-fit, contain);\n}\n\n.lottery-banner__item--center {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n}\n\n.lottery-banner__title {\n text-align: center;\n font-size: var(--lottery-banner-title-font-size, 1.5rem);\n font-weight: 800;\n font-style: italic;\n letter-spacing: var(--lottery-banner-title-font-letter-spacing, 0.04em);\n color: var(--emw--color-typography, #000);\n}\n\n.lottery-banner__info {\n display: flex;\n align-items: center;\n gap: var(--lottery-banner-info-gap, 0.75rem);\n}\n\n.lottery-banner__info-item {\n font-size: var(--lottery-banner-info-font-size, 0.9rem);\n color: var(--lottery-banner-info-color, var(--emw--color-typography, #000));\n display: inline-flex;\n align-items: center;\n gap: 0.3rem;\n}\n\n.lottery-banner__info-item-label {\n color: var(--lottery-banner-info-label-color, var(--emw--color-typography, #000));\n}\n.lottery-banner__info-item-label__strong {\n font-weight: var(--lottery-banner-info-label-font-weight, 700);\n}\n\n.lottery-banner__info-item-value {\n font-weight: var(--lottery-banner-info-value-font-weight, inherit);\n color: var(--lottery-banner-info-value-color, var(--emw--color-typography, #000));\n}\n.lottery-banner__info-item-value__strong {\n font-weight: 700;\n}\n\n@container (max-width: 700px) {\n .lottery-banner {\n height: auto;\n padding: var(--lottery-banner-mobile-padding, 0.5rem 1rem);\n }\n .lottery-banner__title {\n flex-basis: 100%;\n text-align: var(--lottery-banner-mobile-title-text-align, left);\n }\n .lottery-banner__info {\n flex-direction: column;\n align-items: flex-start;\n gap: var(--lottery-banner-mobile-info-gap, 0.1rem);\n }\n}";const kt=["ro","en","fr","ar","hr","zh"],Ct={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},St=class{constructor(e){t(this,e),this.handleClick=t=>{if(this.disabled)return;const e=this.host.shadowRoot.querySelector(".btn");if(!e)return;const i=e.getBoundingClientRect(),o=Math.max(i.width,i.height),r={top:t.clientY-i.top-o/2,left:t.clientX-i.left-o/2,size:o};this.ripples=[...this.ripples,r],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==r))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])Ct[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}render(){const{variant:t,disabled:e,size:i,color:r}=this,n=e||this.loading,s={};if(r)switch(t){case"primary":default:Object.assign(s,{backgroundColor:r,borderColor:r});break;case"outline":case"dashed":Object.assign(s,{color:r,borderColor:r});break;case"text":Object.assign(s,{color:r})}return o("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${i}`]:!0,"btn--loading":this.loading},style:r?s:void 0,disabled:n,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?o("div",{class:"loading-container"},o("span",{class:"content"},this.text||(()=>{const t=this.language;let e=Ct[void 0!==t&&kt.includes(t)?t:"en"].loading;return e})()),o("span",{class:"spinner"})):o("span",{class:"content"},o("slot",{name:"icon-left"}),this.text||o("slot",null),o("slot",{name:"icon-right"})),o("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,e)=>o("span",{key:e,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};St.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";const Tt=class{constructor(i){t(this,i),this.lotteryTippingBulletToggleEvent=e(this,"lotteryTippingBulletToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.value="",this.disabled=!1,this.isSelected=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}handleClick(){this.disabled||this.lotteryTippingBulletToggleEvent.emit({positionIdx:this.positionIdx})}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return o("div",{key:"ef0fee38ed62adb7809b5a60668af6a499ebe5a6",ref:t=>this.stylingContainer=t},"text"===this.theme?o("div",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--text":!0}},this.value):o("button",{class:{LotteryTippingBullet__segment:!0,"LotteryTippingBullet__segment--disabled":this.disabled,"LotteryTippingBullet__segment--active":this.isSelected},onClick:this.handleClick.bind(this)},this.isSelected?"X":this.value))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Tt.style=".LotteryTippingBullet__segment{display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;font-size:16px;line-height:1;font-weight:500;color:var(--emw--color-typography, #000);background:var(--emw--color-background, #fff);border:1px solid var(--emw--color-gray-100, #e6e6e6);border-radius:6px;cursor:pointer;transition:all 0.2s ease;user-select:none}.LotteryTippingBullet__segment:not(.LotteryTippingBullet__segment--disabled):hover{cursor:pointer;animation:jelly 0.3s ease-in-out;transform:scale(1.02)}.LotteryTippingBullet__segment--text{border:none;color:var(--emw--color-typography, #000);background:transparent;font-weight:400}.LotteryTippingBullet__segment--text:hover{cursor:not-allowed !important}.LotteryTippingBullet__segment--active{font-weight:600;background-color:var(--emw--color-background-inverse, #000);color:var(--emw--color-primary, #fed275)}.LotteryTippingBullet__segment--disabled:not(.LotteryTippingBullet__segment--active){background-color:var(--emw--color-background-tertiary, #ccc);color:var(--emw--color-gray-150, #6f6f6f);border-color:var(--emw--color-gray-100, #e6e6e6)}.LotteryTippingBullet__segment--disabled:hover{cursor:not-allowed}@keyframes jelly{0%{transform:translate(0, 0)}20%{transform:translate(-0.5px, -0.5px)}40%{transform:translate(0.5px, 0.5px)}60%{transform:translate(-0.25px, -0.25px)}80%{transform:translate(0.25px, 0.25px)}100%{transform:translate(0, 0)}}";const At=class{constructor(i){t(this,i),this.lotteryTippingBulletGroupToggleEvent=e(this,"lotteryTippingBulletGroupToggle",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.positionIdx=void 0,this.theme="default",this.mode="single",this.bulletConfigContent=""}get bulletConfigArr(){const t=[{value:"1"},{value:"X"},{value:"2"}];if("string"!=typeof this.bulletConfigContent||!this.bulletConfigContent)return t;try{return JSON.parse(this.bulletConfigContent)}catch(e){return console.error("Error parsing bulletConfigContent:",e),t}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryTippingBulletSelectionHandler(t){const{positionIdx:e}=t.detail;this.handleToggle(e)}handleToggle(t){let e=[...this.bulletConfigArr];"single"===this.mode?(e=e.map((t=>Object.assign(Object.assign({},t),{isSelected:!1}))),e[t].isSelected=!0):(e=e.map((t=>Object.assign({},t))),e[t].isSelected=!e[t].isSelected),this.lotteryTippingBulletGroupToggleEvent.emit({bulletConfigArr:e,positionIdx:this.positionIdx+"-"+t})}render(){var t;return o("div",{ref:t=>this.stylingContainer=t,key:this.positionIdx},o("div",{key:"68223022eed831932c571378164be913206d98e9",style:{display:"flex",flexDirection:"row",gap:"10px"}},null===(t=this.bulletConfigArr)||void 0===t?void 0:t.map(((t,e)=>o("div",{key:e},o("lottery-tipping-bullet",{value:t.value,isSelected:t.isSelected,"position-idx":e,disabled:t.disabled,theme:this.theme,clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};At.style="";const zt={icon:{tag:"svg",attrs:{viewBox:"0 0 1024 1024",focusable:"false"},children:[{tag:"path",attrs:{d:"M988 548c-19.9 0-36-16.1-36-36 0-59.4-11.6-117-34.6-171.3a440.45 440.45 0 00-94.3-139.9 437.71 437.71 0 00-139.9-94.3C629 83.6 571.4 72 512 72c-19.9 0-36-16.1-36-36s16.1-36 36-36c69.1 0 136.2 13.5 199.3 40.3C772.3 66 827 103 874 150c47 47 83.9 101.8 109.7 162.7 26.7 63.1 40.2 130.2 40.2 199.3.1 19.9-16 36-35.9 36z"}}]},name:"loading",theme:"outlined"};var It=function(){return It=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},It.apply(this,arguments)},Mt={primaryColor:"#333",secondaryColor:"#E6E6E6"};function Dt(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var i=e.placeholders||Mt;return Nt(t.icon(i.primaryColor,i.secondaryColor),e)}return Nt(t.icon,e)}function Nt(t,e){var i="svg"===t.tag?It(It({},t.attrs),e.extraSVGAttrs||{}):t.attrs,o=Object.keys(i).reduce((function(t,e){var o=i[e],r="".concat(e,'="').concat(o,'"');return t.push(r),t}),[]),r=o.length?" "+o.join(" "):"",n=(t.children||[]).map((function(t){return Nt(t,e)})).join("");return n&&n.length?"<".concat(t.tag).concat(r,">").concat(n,"</").concat(t.tag,">"):"<".concat(t.tag).concat(r," />")}const Ot=["ro","en","fr","ar","hr"],Et={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},Pt=(t,e)=>{const i=e;return Et[void 0!==i&&Ot.includes(i)?i:"en"][t]},Bt=class{constructor(i){t(this,i),this.open=e(this,"open",7),this.close=e(this,"close",7),this.confirm=e(this,"confirm",7),this.cancel=e(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0,this.confirmLoading=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])Et[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const t=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),e=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],i=["mask",this.visible?"mask-enter":"mask-leave"],r=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return o("div",{key:"05dd671f10bdebda6f138e8f8039f4bc0533fe98",class:e.join(" "),ref:t=>this.stylingContainer=t},o("div",{key:"6e814e02770149de5495617039750461fc0a42d1",class:i.join(" "),onClick:this.handleMaskClick.bind(this)}),o("div",{key:"4cbc5db20317ef1b0808fc4a91a53fa8b86c5f4f",part:"dialog",class:r,style:t,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},(this.dialogTitle||this.closable)&&o("div",{key:"85dc705676a37e6ea2828a7b683fc54b0eb77d17",class:"dialog-header"},o("h2",{key:"85b7472d2b72801dfae19a24fc2018f3c1f1529a",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&o("button",{key:"8089aaecfe511558055ee9f64214ff97030eb2a9",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),o("div",{key:"776255540f30d757caa3fcaee747c79ac638ae76",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},o("slot",{key:"5ef964615b6ab70a9e561f8efac8fe952fe47b4e"})),this.showFooter&&o("div",{key:"8927a0991d916caf7852d58db996b9818687da30",class:"dialog-footer"},o("slot",{key:"84de0306994ec62220ae30fa2881dadbae5544ea",name:"footer"},this.showCancelBtn&&o("button",{key:"ee87b8c3918c1f4d007923a2498142b3af2740a0",class:"cancel-btn",onClick:this.handleClose.bind(this)},Pt("cancel",this.language)),o("button",{key:"935cff86381b21fff07c2d4156b29779c50e5ce3",class:"confirm-btn",onClick:this.handleConfirm.bind(this),disabled:this.confirmLoading},this.confirmLoading?o("div",{class:"Loading",innerHTML:Dt(zt,{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}})}):Pt("confirm",this.language))))))}get el(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Bt.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background:var(--emw--color-mask-dialog-background, rgba(0, 0, 0, 0.5));opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px var(--emw--button-box-shadow-color-secondary, rgba(0, 0, 0, 0.15));opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;min-width:60px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";var jt=Object.defineProperty,Lt=Object.defineProperties,$t=Object.getOwnPropertyDescriptors,Ft=Object.getOwnPropertySymbols,Rt=Object.prototype.hasOwnProperty,Ut=Object.prototype.propertyIsEnumerable,Vt=(t,e,i)=>e in t?jt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Ht=(t,e)=>{for(var i in e||(e={}))Rt.call(e,i)&&Vt(t,i,e[i]);if(Ft)for(var i of Ft(e))Ut.call(e,i)&&Vt(t,i,e[i]);return t},Wt=(t,e)=>Lt(t,$t(e)),qt=(t,e,i)=>(Vt(t,"symbol"!=typeof e?e+"":e,i),i),Gt=(t,e,i)=>new Promise(((o,r)=>{var n=t=>{try{a(i.next(t))}catch(t){r(t)}},s=t=>{try{a(i.throw(t))}catch(t){r(t)}},a=t=>t.done?o(t.value):Promise.resolve(t.value).then(n,s);a((i=i.apply(t,e)).next())}))
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
5
5
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6
|
-
*/;function
|
|
6
|
+
*/;function Yt(t,e="24.5.10"){Object.defineProperty(t,"version",{get:()=>e});const i=customElements.get(t.is);if(i){const e=i.version;e&&t.version&&e===t.version?console.warn(`The component ${t.is} has been loaded twice`):console.error(`Tried to define ${t.is} version ${t.version} when version ${i.version} is already in use. Something will probably break.`)}else customElements.define(t.is,t)}
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
10
10
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
11
|
-
*/class
|
|
11
|
+
*/class Jt extends HTMLElement{static get is(){return"vaadin-lumo-styles"}}Yt(Jt);
|
|
12
12
|
/**
|
|
13
13
|
* @license
|
|
14
14
|
* Copyright 2019 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
const
|
|
17
|
+
const Xt=globalThis,Kt=Xt.ShadowRoot&&(void 0===Xt.ShadyCSS||Xt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Zt=Symbol(),Qt=new WeakMap;let te=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==Zt)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(Kt&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=Qt.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Qt.set(e,t))}return t}toString(){return this.cssText}};const ee=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[o+1]),t[0]);return new te(i,t,Zt)},ie=(t,e)=>{if(Kt)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),o=Xt.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=i.cssText,t.appendChild(e)}},oe=Kt?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return(t=>new te("string"==typeof t?t:t+"",void 0,Zt))(e)})(t):t
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/,{is:
|
|
22
|
+
*/,{is:re,defineProperty:ne,getOwnPropertyDescriptor:se,getOwnPropertyNames:ae,getOwnPropertySymbols:le,getPrototypeOf:he}=Object,ce=globalThis,de=ce.trustedTypes,ue=de?de.emptyScript:"",pe=ce.reactiveElementPolyfillSupport,me={toAttribute(t,e){switch(e){case Boolean:t=t?ue:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},fe=(t,e)=>!re(t,e),ve={attribute:!0,type:String,converter:me,reflect:!1,useDefault:!1,hasChanged:fe};null!=Symbol.metadata||(Symbol.metadata=Symbol("metadata")),null!=ce.litPropertyMetadata||(ce.litPropertyMetadata=new WeakMap);let ge=class extends HTMLElement{static addInitializer(t){var e;this._$Ei(),(null!=(e=this.l)?e:this.l=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=ve){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),o=this.getPropertyDescriptor(t,i,e);void 0!==o&&ne(this.prototype,t,o)}}static getPropertyDescriptor(t,e,i){var o;const{get:r,set:n}=null!=(o=se(this.prototype,t))?o:{get(){return this[e]},set(t){this[e]=t}};return{get:r,set(e){const o=null==r?void 0:r.call(this);null==n||n.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){var e;return null!=(e=this.elementProperties.get(t))?e:ve}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;const t=he(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){const t=this.properties,e=[...ae(t),...le(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(oe(t))}else void 0!==t&&e.push(oe(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e,i;(null!=(e=this._$EO)?e:this._$EO=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(i=t.hostConnected)||i.call(t))}removeController(t){var e;null==(e=this._$EO)||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){var t;const e=null!=(t=this.shadowRoot)?t:this.attachShadow(this.constructor.shadowRootOptions);return ie(e,this.constructor.elementStyles),e}connectedCallback(){var t;null!=this.renderRoot||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var i;const o=this.constructor.elementProperties.get(t),r=this.constructor._$Eu(t,o);if(void 0!==r&&!0===o.reflect){const n=(void 0!==(null==(i=o.converter)?void 0:i.toAttribute)?o.converter:me).toAttribute(e,o.type);this._$Em=t,null==n?this.removeAttribute(r):this.setAttribute(r,n),this._$Em=null}}_$AK(t,e){var i,o,r;const n=this.constructor,s=n._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=n.getPropertyOptions(s),a="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(i=t.converter)?void 0:i.fromAttribute)?t.converter:me;this._$Em=s;const l=a.fromAttribute(e,t.type);this[s]=null!=(r=null!=l?l:null==(o=this._$Ej)?void 0:o.get(s))?r:l,this._$Em=null}}requestUpdate(t,e,i,o=!1,r){var n,s;if(void 0!==t){const a=this.constructor;if(!1===o&&(r=this[t]),null!=i||(i=a.getPropertyOptions(t)),!((null!=(n=i.hasChanged)?n:fe)(r,e)||i.useDefault&&i.reflect&&r===(null==(s=this._$Ej)?void 0:s.get(t))&&!this.hasAttribute(a._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:o,wrapped:r},n){var s,a,l;i&&!(null!=(s=this._$Ej)?s:this._$Ej=new Map).has(t)&&(this._$Ej.set(t,null!=(a=null!=n?n:e)?a:this[t]),!0!==r||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===o&&this._$Em!==t&&(null!=(l=this._$Eq)?l:this._$Eq=new Set).add(t))}_$EP(){return Gt(this,null,(function*(){this.isUpdatePending=!0;try{yield this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&(yield t),!this.isUpdatePending}))}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(null!=this.renderRoot||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t){const{wrapped:t}=i,o=this[e];!0!==t||this._$AL.has(e)||void 0===o||this.C(e,void 0,i,o)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),null==(t=this._$EO)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(i)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;null==(e=this._$EO)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach((t=>this._$ET(t,this[t])))),this._$EM()}updated(t){}firstUpdated(t){}};var be;ge.elementStyles=[],ge.shadowRootOptions={mode:"open"},ge.elementProperties=new Map,ge.finalized=new Map,null==pe||pe({ReactiveElement:ge}),(null!=(be=ce.reactiveElementVersions)?be:ce.reactiveElementVersions=[]).push("2.1.2");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
28
|
+
const ye=globalThis,we=ye.trustedTypes,xe=we?we.createPolicy("lit-html",{createHTML:t=>t}):void 0,_e="$lit$",ke=`lit$${Math.random().toFixed(9).slice(2)}$`,Ce="?"+ke,Se=`<${Ce}>`,Te=document,Ae=()=>Te.createComment(""),ze=t=>null===t||"object"!=typeof t&&"function"!=typeof t,Ie=Array.isArray,Me="[ \t\n\f\r]",De=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ne=/-->/g,Oe=/>/g,Ee=RegExp(`>|${Me}(?:([^\\s"'>=/]+)(${Me}*=${Me}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),Pe=/'/g,Be=/"/g,je=/^(?:script|style|textarea|title)$/i,Le=Symbol.for("lit-noChange"),$e=Symbol.for("lit-nothing"),Fe=new WeakMap,Re=Te.createTreeWalker(Te,129);function Ue(t,e){if(!Ie(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==xe?xe.createHTML(e):e}class Ve{constructor({strings:t,_$litType$:e},i){let o;this.parts=[];let r=0,n=0;const s=t.length-1,a=this.parts,[l,h]=((t,e)=>{const i=t.length-1,o=[];let r,n=2===e?"<svg>":3===e?"<math>":"",s=De;for(let e=0;e<i;e++){const i=t[e];let a,l,h=-1,c=0;for(;c<i.length&&(s.lastIndex=c,l=s.exec(i),null!==l);)c=s.lastIndex,s===De?"!--"===l[1]?s=Ne:void 0!==l[1]?s=Oe:void 0!==l[2]?(je.test(l[2])&&(r=RegExp("</"+l[2],"g")),s=Ee):void 0!==l[3]&&(s=Ee):s===Ee?">"===l[0]?(s=null!=r?r:De,h=-1):void 0===l[1]?h=-2:(h=s.lastIndex-l[2].length,a=l[1],s=void 0===l[3]?Ee:'"'===l[3]?Be:Pe):s===Be||s===Pe?s=Ee:s===Ne||s===Oe?s=De:(s=Ee,r=void 0);const d=s===Ee&&t[e+1].startsWith("/>")?" ":"";n+=s===De?i+Se:h>=0?(o.push(a),i.slice(0,h)+_e+i.slice(h)+ke+d):i+ke+(-2===h?e:d)}return[Ue(t,n+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),o]})(t,e);if(this.el=Ve.createElement(l,i),Re.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(o=Re.nextNode())&&a.length<s;){if(1===o.nodeType){if(o.hasAttributes())for(const t of o.getAttributeNames())if(t.endsWith(_e)){const e=h[n++],i=o.getAttribute(t).split(ke),s=/([.?@])?(.*)/.exec(e);a.push({type:1,index:r,name:s[2],strings:i,ctor:"."===s[1]?Ye:"?"===s[1]?Je:"@"===s[1]?Xe:Ge}),o.removeAttribute(t)}else t.startsWith(ke)&&(a.push({type:6,index:r}),o.removeAttribute(t));if(je.test(o.tagName)){const t=o.textContent.split(ke),e=t.length-1;if(e>0){o.textContent=we?we.emptyScript:"";for(let i=0;i<e;i++)o.append(t[i],Ae()),Re.nextNode(),a.push({type:2,index:++r});o.append(t[e],Ae())}}}else if(8===o.nodeType)if(o.data===Ce)a.push({type:2,index:r});else{let t=-1;for(;-1!==(t=o.data.indexOf(ke,t+1));)a.push({type:7,index:r}),t+=ke.length-1}r++}}static createElement(t,e){const i=Te.createElement("template");return i.innerHTML=t,i}}function He(t,e,i=t,o){var r,n,s;if(e===Le)return e;let a=void 0!==o?null==(r=i._$Co)?void 0:r[o]:i._$Cl;const l=ze(e)?void 0:e._$litDirective$;return(null==a?void 0:a.constructor)!==l&&(null==(n=null==a?void 0:a._$AO)||n.call(a,!1),void 0===l?a=void 0:(a=new l(t),a._$AT(t,i,o)),void 0!==o?(null!=(s=i._$Co)?s:i._$Co=[])[o]=a:i._$Cl=a),void 0!==a&&(e=He(t,a._$AS(t,e.values),a,o)),e}class We{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){var e;const{el:{content:i},parts:o}=this._$AD,r=(null!=(e=null==t?void 0:t.creationScope)?e:Te).importNode(i,!0);Re.currentNode=r;let n=Re.nextNode(),s=0,a=0,l=o[0];for(;void 0!==l;){if(s===l.index){let e;2===l.type?e=new qe(n,n.nextSibling,this,t):1===l.type?e=new l.ctor(n,l.name,l.strings,this,t):6===l.type&&(e=new Ke(n,this,t)),this._$AV.push(e),l=o[++a]}s!==(null==l?void 0:l.index)&&(n=Re.nextNode(),s++)}return Re.currentNode=Te,r}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class qe{get _$AU(){var t,e;return null!=(e=null==(t=this._$AM)?void 0:t._$AU)?e:this._$Cv}constructor(t,e,i,o){var r;this.type=2,this._$AH=$e,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=o,this._$Cv=null==(r=null==o?void 0:o.isConnected)||r}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===(null==t?void 0:t.nodeType)&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){var i;t=He(this,t,e),ze(t)?t===$e||null==t||""===t?(this._$AH!==$e&&this._$AR(),this._$AH=$e):t!==this._$AH&&t!==Le&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):Ie(i=t)||"function"==typeof(null==i?void 0:i[Symbol.iterator])?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==$e&&ze(this._$AH)?this._$AA.nextSibling.data=t:this.T(Te.createTextNode(t)),this._$AH=t}$(t){var e;const{values:i,_$litType$:o}=t,r="number"==typeof o?this._$AC(t):(void 0===o.el&&(o.el=Ve.createElement(Ue(o.h,o.h[0]),this.options)),o);if((null==(e=this._$AH)?void 0:e._$AD)===r)this._$AH.p(i);else{const t=new We(r,this),e=t.u(this.options);t.p(i),this.T(e),this._$AH=t}}_$AC(t){let e=Fe.get(t.strings);return void 0===e&&Fe.set(t.strings,e=new Ve(t)),e}k(t){Ie(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,o=0;for(const r of t)o===e.length?e.push(i=new qe(this.O(Ae()),this.O(Ae()),this,this.options)):i=e[o],i._$AI(r),o++;o<e.length&&(this._$AR(i&&i._$AB.nextSibling,o),e.length=o)}_$AR(t=this._$AA.nextSibling,e){var i;for(null==(i=this._$AP)||i.call(this,!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){var e;void 0===this._$AM&&(this._$Cv=t,null==(e=this._$AP)||e.call(this,t))}}class Ge{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,o,r){this.type=1,this._$AH=$e,this._$AN=void 0,this.element=t,this.name=e,this._$AM=o,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=$e}_$AI(t,e=this,i,o){const r=this.strings;let n=!1;if(void 0===r)t=He(this,t,e,0),n=!ze(t)||t!==this._$AH&&t!==Le,n&&(this._$AH=t);else{const o=t;let s,a;for(t=r[0],s=0;s<r.length-1;s++)a=He(this,o[i+s],e,s),a===Le&&(a=this._$AH[s]),n||(n=!ze(a)||a!==this._$AH[s]),a===$e?t=$e:t!==$e&&(t+=(null!=a?a:"")+r[s+1]),this._$AH[s]=a}n&&!o&&this.j(t)}j(t){t===$e?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,null!=t?t:"")}}class Ye extends Ge{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===$e?void 0:t}}class Je extends Ge{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==$e)}}class Xe extends Ge{constructor(t,e,i,o,r){super(t,e,i,o,r),this.type=5}_$AI(t,e=this){var i;if((t=null!=(i=He(this,t,e,0))?i:$e)===Le)return;const o=this._$AH,r=t===$e&&o!==$e||t.capture!==o.capture||t.once!==o.once||t.passive!==o.passive,n=t!==$e&&(o===$e||r);r&&this.element.removeEventListener(this.name,this,o),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;"function"==typeof this._$AH?this._$AH.call(null!=(i=null==(e=this.options)?void 0:e.host)?i:this.element,t):this._$AH.handleEvent(t)}}class Ke{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){He(this,t)}}const Ze=ye.litHtmlPolyfillSupport;var Qe;null==Ze||Ze(Ve,qe),(null!=(Qe=ye.litHtmlVersions)?Qe:ye.litHtmlVersions=[]).push("3.3.2");const ti=(t,e,i)=>{var o,r;const n=null!=(o=null==i?void 0:i.renderBefore)?o:e;let s=n._$litPart$;if(void 0===s){const t=null!=(r=null==i?void 0:i.renderBefore)?r:null;n._$litPart$=s=new qe(e.insertBefore(Ae(),t),t,void 0,null!=i?i:{})}return s._$AI(t),s
|
|
29
29
|
/**
|
|
30
30
|
* @license
|
|
31
31
|
* Copyright 2017 Google LLC
|
|
32
32
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
33
|
-
*/},
|
|
33
|
+
*/},ei=globalThis;class ii extends ge{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return null!=(t=this.renderOptions).renderBefore||(t.renderBefore=e.firstChild),e}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=ti(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),null==(t=this._$Do)||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),null==(t=this._$Do)||t.setConnected(!1)}render(){return Le}}var oi;ii._$litElement$=!0,ii.finalized=!0,null==(oi=ei.litElementHydrateSupport)||oi.call(ei,{LitElement:ii});const ri=ei.litElementPolyfillSupport;var ni;null==ri||ri({LitElement:ii}),(null!=(ni=ei.litElementVersions)?ni:ei.litElementVersions=[]).push("4.2.2");
|
|
34
34
|
/**
|
|
35
35
|
* @license
|
|
36
36
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
37
37
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
38
38
|
*/
|
|
39
|
-
const
|
|
39
|
+
const si=t=>class extends t{static get properties(){return{_theme:{type:String,readOnly:!0}}}static get observedAttributes(){return[...super.observedAttributes,"theme"]}attributeChangedCallback(t,e,i){super.attributeChangedCallback(t,e,i),"theme"===t&&this._set_theme(i)}}
|
|
40
40
|
/**
|
|
41
41
|
* @license
|
|
42
42
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
43
43
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
44
|
-
*/,
|
|
44
|
+
*/,ai=[],li=new Set,hi=new Set;function ci(t){return t&&Object.prototype.hasOwnProperty.call(t,"__themes")}function di(t,e){return(t||"").split(" ").some((t=>new RegExp(`^${t.split("*").join(".*")}$`,"u").test(e)))}function ui(t){return t.map((t=>t.cssText)).join("\n")}const pi="vaadin-themable-mixin-style";function mi(t){t.prototype instanceof ii?t.elementStyles=t.finalizeStyles(t.styles):t.prototype._template.content.getElementById(pi).textContent=ui(t.getStylesForThis()),hi.forEach((e=>{const i=customElements.get(e);i!==t&&i.prototype instanceof t&&mi(i)}))}function fi(t,e,i={}){e=function(t=[]){return[t].flat(1/0).filter((t=>t instanceof te||(console.warn("An item in styles is not of type CSSResult. Use `unsafeCSS` or `css`."),!1)))}(e),window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.registerStyles(t,e,i):ai.push({themeFor:t,styles:e,include:i.include,moduleId:i.moduleId}),t&&hi.forEach((i=>{if(di(t,i)&&function(t){return ci(customElements.get(t))}(i)){const t=customElements.get(i);!function(t,e){const i=t.__themes;return!(!i||!e)&&i.some((t=>t.styles.some((t=>e.some((e=>e.cssText===t.cssText))))))}(t,e)?(!window.Vaadin||!window.Vaadin.suppressPostFinalizeStylesWarning)&&console.warn(`The custom element definition for "${i}" was finalized before a style module was registered. Ideally, import component specific style modules before importing the corresponding custom element. This warning can be suppressed by setting "window.Vaadin.suppressPostFinalizeStylesWarning = true".`):console.warn(`Registering styles that already exist for ${i}`),mi(t),function(t){li.forEach((e=>{const i=e.deref();i instanceof t?function(t){if(!t.shadowRoot)return;const e=t.constructor;t instanceof ii?([...t.shadowRoot.querySelectorAll("style")].forEach((t=>t.remove())),ie(t.shadowRoot,e.elementStyles)):t.shadowRoot.getElementById(pi).textContent=e.prototype._template.content.getElementById(pi).textContent}(i):i||li.delete(e)}))}(t)}}))}function vi(){return window.Vaadin&&window.Vaadin.styleModules?window.Vaadin.styleModules.getAllThemes():ai}function gi(t=""){let e=0;return t.startsWith("lumo-")||t.startsWith("material-")?e=1:t.startsWith("vaadin-")&&(e=2),e}function bi(t){const e=[];return t.include&&[].concat(t.include).forEach((t=>{const i=vi().find((e=>e.moduleId===t));i?e.push(...bi(i),...i.styles):console.warn(`Included moduleId ${t} not found in style registry`)}),t.styles),e}function yi(t){const e=`${t}-default-theme`,i=vi().filter((i=>i.moduleId!==e&&di(i.themeFor,t))).map((t=>Wt(Ht({},t),{styles:[...bi(t),...t.styles],includePriority:gi(t.moduleId)}))).sort(((t,e)=>e.includePriority-t.includePriority));return i.length>0?i:vi().filter((t=>t.moduleId===e))}const wi=t=>class extends(si(t)){constructor(){super(),li.add(new WeakRef(this))}static finalize(){if(super.finalize(),this.is&&hi.add(this.is),this.elementStyles)return;const t=this.prototype._template;!t||ci(this)||function(t,e){const i=document.createElement("style");i.id=pi,i.textContent=ui(t),e.content.appendChild(i)}(this.getStylesForThis(),t)}static finalizeStyles(t){const e=this.getStylesForThis();return t?[...[t].flat(1/0),...e]:e}static getStylesForThis(){const e=t.__themes||[],i=Object.getPrototypeOf(this.prototype);this.__themes=[...e,...(i?i.constructor.__themes:[])||[],...yi(this.is)];const o=this.__themes.flatMap((t=>t.styles));return o.filter(((t,e)=>e===o.lastIndexOf(t)))}}
|
|
45
45
|
/**
|
|
46
46
|
* @license
|
|
47
47
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
48
48
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
49
|
-
*/,
|
|
49
|
+
*/,xi=(t,...e)=>{((t,...e)=>{const i=document.createElement("style");i.id=t,i.textContent=e.map((t=>t.toString())).join("\n").replace(":host","html"),document.head.insertAdjacentElement("afterbegin",i)})(`lumo-${t}`,e)};xi("color-props",ee`
|
|
50
50
|
:host {
|
|
51
51
|
/* Base (background) */
|
|
52
52
|
--lumo-base-color: #fff;
|
|
@@ -131,7 +131,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
131
131
|
--lumo-disabled-text-color: GrayText;
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
`),
|
|
134
|
+
`),fi("",ee`
|
|
135
135
|
[theme~='dark'] {
|
|
136
136
|
/* Base (background) */
|
|
137
137
|
--lumo-base-color: hsl(214, 35%, 21%);
|
|
@@ -249,7 +249,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
249
249
|
pre code {
|
|
250
250
|
background: transparent;
|
|
251
251
|
}
|
|
252
|
-
`,{moduleId:"lumo-color"}),
|
|
252
|
+
`,{moduleId:"lumo-color"}),xi("font-icons",ee`
|
|
253
253
|
@font-face {
|
|
254
254
|
font-family: 'lumo-icons';
|
|
255
255
|
src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABEgAAsAAAAAIjQAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQwAAAFZAIUuKY21hcAAAAYgAAAD4AAADrsCU8d5nbHlmAAACgAAAC2cAABeAWri7U2hlYWQAAA3oAAAAMAAAADZa/6SsaGhlYQAADhgAAAAdAAAAJAbpA35obXR4AAAOOAAAABAAAACspBAAAGxvY2EAAA5IAAAAWAAAAFh57oA4bWF4cAAADqAAAAAfAAAAIAFKAXBuYW1lAAAOwAAAATEAAAIuUUJZCHBvc3QAAA/0AAABKwAAAelm8SzVeJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGS+yDiBgZWBgamKaQ8DA0MPhGZ8wGDIyAQUZWBlZsAKAtJcUxgcXjG+0mIO+p/FEMUcxDANKMwIkgMABn8MLQB4nO3SWW6DMABF0UtwCEnIPM/zhLK8LqhfXRybSP14XUYtHV9hGYQwQBNIo3cUIPkhQeM7rib1ekqnXg981XuC1qvy84lzojleh3puxL0hPjGjRU473teloEefAUNGjJkwZcacBUtWrNmwZceeA0dOnLlw5cadB09elPGhGf+j0NTI/65KfXerT6JhqKnpRKtgOpuqaTrtKjPUlqHmhto21I7pL6i6hlqY3q7qGWrfUAeGOjTUkaGODXViqFNDnRnq3FAXhro01JWhrg11Y6hbQ90Z6t5QD4Z6NNSToZ4N9WKoV0O9GerdUB+G+jTUl6GWRvkL24BkEXictVh9bFvVFb/nxvbz+7Rf/N6zHcd2bCfP+Wic1Z9N0jpNHCD9SNqqoVBgbQoMjY+pjA4hNnWa2pV1rHSIif0DGkyT2k10Kmu1Cag6huj4ZpqYBHSqJsTEJgZCG3TaVBFv595nO3ZIv4RIrPPuvefe884599zzO/cRF8G/tgn6CFFImNgkR0ggX8wlspbhSSWSdrC5ozd30s2dw5afzvgtyz9/zG9t1hV4RtF1pXolowvtzc2z6L2aYUQM45jKH9WDTvd1LRDoDASYWhfTzTyvboXz6uZX4ARX5wrF39y+HM2+CJ8d0pkyqBIqoze3D12ez4DrFoYzxI8dWwMrDlZ2DMqQAR9AROsJU+2smlTPaTTco52BVxXa2a2+I8vvqd2dVHm1LoPeTn/AZPRYGthDYOeZjBjKoFsVGulR3lGU95SeCK44oHU7MhWUGUKZDT3oSUcG2GWuh+EDDfUYA/jhIhl0TOsJNYSEu7mQmi3UzfXwZKA4BsVsHLXQYGgJW95qEtpJ1VcW9HiTriZBlFEqxsDjA09yCNUoQxxwd7KWSTt2y3GTKifkqHRCoWZc3m11Wa/dKdFgXD4kSYfkeJBKd8KMz7J8dZn/cGRCcLGDnA2Ge3bKzcvlnTDNthFWLH7Xt80ua5FMjA4WKelWv5Xo16vHuYzpRbJhhdVlftuRK0VlR27D9lu5TF0DPBi60OrHNO0AfP/uRWvhn/U3LXICE+nh+3IHPUJ8JE6GyBjZQLbjGchlrSgYngF8zyrIF4NJD3atUcgWsWunGN/UHX5B5/yg7uF87Nqp4Gf52F3gH73DjEZNRoqCKAr9giQJp5rGJABpiVE2htNhW9R8nw0jqYjCYcY4LIjwYNScf4WN06IZnZCEqsI4cFaQbo4Z1TsZBx40YhXkHOecaYE5oY37IIQ+iJJ+UsDYSun5MuRSBRZRUUhlY2DqOGajOR6zrSU/5My6l2DnusH1GQgnw5BZP7iuYM/ahcfQ7Z8y51ddfutvuwNqWQ0cBYr8fj0U0vsHpwerVaB2sWhXT2NExi2r1KUE2tUuVMnkepVQrxTmpQrZTG4iu8he8iPyM3KcPE/+RP5KPoE2CEAKclCBzXATxkYOtUY/o961PWRqsj0chRrHFBbtrjP9/P0ven5pcbRdpL94vfsy33e5+izuwz3nFLFPVNayPZx/jdG1fOChflFRvYzsW6L18efgLrSWIgvcqnGJYi4skO4xREURjbDuxKke5v0T3Mrzkt2fi31uyZlLLrqIpEuXXsMlgw442Jb0GAxjS1DM20kBoCzHLXm/jEm0IltdcvU0fEW24jgiwwRjVd9u4NJHcIyoHJcwvyVqgqj5hqBJ1ZWSJryh9p56UWhX1XbhRbW2ZopuZWsQd5y8mEQ8M+C6xjRYxZbDKWf5AgY+Qq/l6wSPk16zDFjowYuu+wjx13mfkxbyDDxadYT/LijZyI0THB+6yfLaWsRcO82zo9mWTNtpO18qlorZoIVMwSN40tky5DOQ1MCIAe24mvlsuwIIxPb10+uXDQ4uWz/9m3rj+ql7p6bufZARuPVq5tXtsn6KwfP8Jy0TeWOyNhUJN6mhX5rkUTtUppQWEMNTqEdaCGKFYKJaQrCE4JtDLYOlNEKmO5kBTPGY2A0N2sY3+dVlo1N9ycBsIGtOjQ2p/tlZvzo0ur4v6cOh8NTospB7U/X40KahoU3bGIH97dnwmtHlYffVG3R1YOwKM2vNhrPhCT5zk64sG53oS4b31aYjqe/B7+kQiXBN+b6h21hNUPMq29B8CU4elINdygMPKF1B+WBTG7Z9ZshpN/xwEuuDQZR+nuoo4CDaAiiwXmLpmukMQyPf/JMclqgL1ixZQ/nnP2VbdUODFGt2fgBvL123rlLYu/6A9ckb7F3K0/CyBMEu6aQoPscroCcacVehvyQyCZAsizsWWBkoLC+WAiWnOksLKaeuQDzGuqSk42aiYTiJ4zf9afl17SrqaTO1f+XlZAfIuYcq7/IqYMaMrksOJ6vHkOCPDq943xcCnHqVD9pHFRpMqSPXrIua1WNs+tOz1U+ciTCDpPk+c4QYJIHnYhxP/kVPAq+ahFpVhPcHp8qyarhiF+HsBU9Hrl+UZa876fbKipL0KqB6OdUveErgtOI97fZ63ae9SvWU6k2w1JfwqnUbHsYcFCJFrC/W12zIMMirWYEHxMPs6LGYSdkSZ5TsNP9PCpwnWC3HKZ1lydNjWHC2Mn3l6vL0dHn1ldP3LTSrX+vKrBqv7KmMr8p0SR6P1NqF63or6XRlIyO90f7+kf7+myOhvt4tq7f09oUiTc2/dycGgqFQcCDRLYmi1NL7fk0CknVMxEg/cdfs/TnpJMNkgqwj17B8beVazSrVbU4lG67IZYOCnWrYy3yBR9cyWcChywos3LJBEdhhFoAdYjiw0rLGm0xU5OzoGm5/ZfmHjVZpNNg6SznzGKDdwv2cCtVn6Eaxo12cfxLprpVtTcZ6hVx6dow7Yq7e8LXO8PY9Jgjoze9yCtU5FNbegcKkQMdCbt9au/te4Ebe0jkc0ukUL32eYnTpNs20h0KpUOhZPYwVcfhZnfdqeCvDfXiuCbAoYWcXERPc/mDQD3/hdF+wK4i/xv3kYfprIpAuMkk2kW3kdtS0kBIKpZwp8KxmsCyfM1MFzAss9LBkDxRyThiaqTLwKYKJVTwmWTudMyz+yks09346MDh4m72yOxCKrt1XMlQ1qPVlTEVVQ1ofdK/sCWjtZu9qGwZ8YZ9PPWlo1IV3eW3+U0aXblP39zrt+JPf6UhEQ1rUjNBULN+utyuaDNW34kpAVuSOeMTyWbSNWnooFu+QFNWQ4d/Ox4IPWx41fP/fB/Rjeoz08ezPA9TysMtmnOXfGN7Ui3xIYLDALrlDLOP09qtJuY2OeL0+QZXdRnR1nxRVBF/SOyKKPpcrn9mWzH4rH9IidE+PTNU2182+hOgSItrE1slByS24vaLvJpxOqe4Pduf3HJkZ+jLqUz9rRzB7p8gKcgWZwV1L8JtUS5Z2JxZSOCuBoMTQihMzLbCPA0KqGMAljRQjONklW/wjnXKy8vxT/Elvm3/KiMUMOoV0/vnDYlhec0SMKtt3/kKMyOt33tj2bqxQLsTjSGLl+EAsNhCnTyRGktW55EgCn/A4PlnWn+Mg8bgZrWqHxTbPwMuyy1u5YeZF2SUM7JRhddwRgiRuxpmgJmxn9ZW7XpcF3ViX/ar6ptRpGJ0S9Adg4qhb9sI3vbL7qNJV/y4i07t5TZBiho1imFoMz3gED+CtjYUxvP4SOxov4bFoNPg5aR1e+G4UgDPoedJTpogyCJ7oYvRqoVS0MQAy+CoNEdTDUjok5ZHZL/WtjV7rFj3PKQE3iKp7ou+rIxN3b9LB1dGjeT4cvKo3FrnWpYpuaFd/h3dtV8UeKN1Y9hpR3dt4p0H/zKuPQq0kZQUIIpuDfoiETsnIk+gCWMJZUXHtE8V9LkUc2TE8vOMbO4ax/MACabzyaGXc7u3FBr11ThBdB8SIeMAlCntG2KThHSPsaj2Dc9KNyY2a0KZ7ODaTHoRiFkeYz+shZBpCS4X6471KKKnuHd84edfk5F37d1XO5bbkcltu2ZLNbvnPXiUVAnVvprJrP+NObryjxrllS65md6Tm6wzFHRR4dY3QUUjb7MgxaIixU8hspi98fl/Xc+IB4iU66eCVL9YfAfahiSUt4TONS8x0D8W7u8vd3fGWx6OXlM/U1IoU/s61PGhpyXRFa3eReq2qG56lvmYtXavCC1iN7lbiBpWxXHU+cSlztVLVz0tVN600fVsLxaVDknhYioeoXP3t4lqV1r79MAw0GCI1FTL1YIGzPL1MMlJ9ZsN9P7lvA2yr9ZFUzwzPrVgxN/x/SS+chwB4nGNgZGBgAOLPrYdY4vltvjJwM78AijDUqG5oRND/XzNPZboF5HIwMIFEAU/lC+J4nGNgZGBgDvqfBSRfMAAB81QGRgZUoA0AVvYDbwAAAHicY2BgYGB+MTQwAM8EJo8AAAAAAE4AmgDoAQoBLAFOAXABmgHEAe4CGgKcAugEmgS8BNYE8gUOBSoFegXQBf4GRAZmBrYHGAeQCBgIUghqCP4JRgm+CdoKBAo+CoQKugr0C1QLmgvAeJxjYGRgYNBmTGEQZQABJiDmAkIGhv9gPgMAGJQBvAB4nG2RPU7DMBiG3/QP0UoIBGJh8QILavozdmRo9w7d09RpUzlx5LgVvQMn4BAcgoEzcAgOwVvzSZVQbcnf48fvFysJgGt8IcJxROiG9TgauODuj5ukG+EW+UG4jR4ehTv0Q+EunjER7uEWmk+IWpc0d3gVbuAKb8JN+nfhFvlDuI17fAp36L+Fu1jgR7iHp+jF7Arbz1Nb1nO93pnEncSJFtrVuS3VKB6e5EyX2iVer9TyoOr9eux9pjJnCzW1pdfGWFU5u9WpjzfeV5PBIBMfp7aAwQ4FLPrIkbKWqDHn+67pDRK4s4lzbsEux5qHvcIIMb/nueSMyTKkE3jWFdNLHLjW2PPmMa1Hxn3GjGW/wjT0HtOG09JU4WxLk9LH2ISuiv9twJn9y8fh9uIXI+BknAAAAHicbY7ZboMwEEW5CVBCSLrv+76kfJRjTwHFsdGAG+Xvy5JUfehIHp0rnxmNN/D6ir3/a4YBhvARIMQOIowQY4wEE0yxiz3s4wCHOMIxTnCKM5zjApe4wjVucIs73OMBj3jCM17wije84wMzfHqJ0EVmUkmmJo77oOmrHvfIRZbXsTCZplTZldlgb3TYGVHProwFs11t1A57tcON2rErR3PBqcwF1/6ctI6k0GSU4JHMSS6WghdJQ99sTbfuN7QLJ9vQ37dNrgyktnIxlDYLJNuqitpRbYWKFNuyDT6pog6oOYKHtKakeakqKjHXpPwlGRcsC+OqxLIiJpXqoqqDMreG2l5bv9Ri3TRX+c23DZna9WFFgmXuO6Ps1Jm/w6ErW8N3FbHn/QC444j0AA==)
|
|
@@ -302,7 +302,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
302
302
|
--lumo-icons-upload: '\\ea29';
|
|
303
303
|
--lumo-icons-user: '\\ea2a';
|
|
304
304
|
}
|
|
305
|
-
`),
|
|
305
|
+
`),xi("sizing-props",ee`
|
|
306
306
|
:host {
|
|
307
307
|
--lumo-size-xs: 1.625rem;
|
|
308
308
|
--lumo-size-s: 1.875rem;
|
|
@@ -317,7 +317,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
317
317
|
/* For backwards compatibility */
|
|
318
318
|
--lumo-icon-size: var(--lumo-icon-size-m);
|
|
319
319
|
}
|
|
320
|
-
`),
|
|
320
|
+
`),xi("spacing-props",ee`
|
|
321
321
|
:host {
|
|
322
322
|
/* Square */
|
|
323
323
|
--lumo-space-xs: 0.25rem;
|
|
@@ -340,7 +340,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
340
340
|
--lumo-space-tall-l: var(--lumo-space-l) calc(var(--lumo-space-l) / 2);
|
|
341
341
|
--lumo-space-tall-xl: var(--lumo-space-xl) calc(var(--lumo-space-xl) / 2);
|
|
342
342
|
}
|
|
343
|
-
`),
|
|
343
|
+
`),ee`
|
|
344
344
|
html {
|
|
345
345
|
/* Button */
|
|
346
346
|
--vaadin-button-background: var(--lumo-contrast-5pct);
|
|
@@ -423,7 +423,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
423
423
|
--vaadin-input-field-value-font-size: var(--lumo-font-size-m);
|
|
424
424
|
--vaadin-input-field-value-font-weight: 500;
|
|
425
425
|
}
|
|
426
|
-
`,
|
|
426
|
+
`,xi("style-props",ee`
|
|
427
427
|
:host {
|
|
428
428
|
/* Border radius */
|
|
429
429
|
--lumo-border-radius-s: 0.25em; /* Checkbox, badge, date-picker year indicator, etc */
|
|
@@ -446,7 +446,7 @@ const ei=t=>class extends t{static get properties(){return{_theme:{type:String,r
|
|
|
446
446
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
447
447
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
448
448
|
*/
|
|
449
|
-
const
|
|
449
|
+
const _i=ee`
|
|
450
450
|
:host {
|
|
451
451
|
/* prettier-ignore */
|
|
452
452
|
--lumo-font-family: -apple-system, BlinkMacSystemFont, 'Roboto', 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
|
|
@@ -466,7 +466,7 @@ const gi=Xt`
|
|
|
466
466
|
--lumo-line-height-s: 1.375;
|
|
467
467
|
--lumo-line-height-m: 1.625;
|
|
468
468
|
}
|
|
469
|
-
`;
|
|
469
|
+
`;fi("",ee`
|
|
470
470
|
body,
|
|
471
471
|
:host {
|
|
472
472
|
font-family: var(--lumo-font-family);
|
|
@@ -558,7 +558,7 @@ const gi=Xt`
|
|
|
558
558
|
border-left: none;
|
|
559
559
|
border-right: 2px solid var(--lumo-contrast-30pct);
|
|
560
560
|
}
|
|
561
|
-
`,{moduleId:"lumo-typography"}),
|
|
561
|
+
`,{moduleId:"lumo-typography"}),xi("typography-props",_i),fi("vaadin-checkbox",ee`
|
|
562
562
|
:host {
|
|
563
563
|
color: var(--vaadin-checkbox-label-color, var(--lumo-body-text-color));
|
|
564
564
|
font-size: var(--vaadin-checkbox-label-font-size, var(--lumo-font-size-m));
|
|
@@ -882,7 +882,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
882
882
|
Code distributed by Google as part of the polymer project is also
|
|
883
883
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
884
884
|
*/
|
|
885
|
-
let
|
|
885
|
+
let ki,Ci,Si=/(url\()([^)]*)(\))/g,Ti=/(^\/[^\/])|(^#)|(^[\w-\d]*:)/;function Ai(t,e){if(t&&Ti.test(t)||"//"===t)return t;if(void 0===ki){ki=!1;try{const t=new URL("b","http://a");t.pathname="c%20d",ki="http://a/c%20d"===t.href}catch(t){}}if(e||(e=document.baseURI||window.location.href),ki)try{return new URL(t,e).href}catch(e){return t}return Ci||(Ci=document.implementation.createHTMLDocument("temp"),Ci.base=Ci.createElement("base"),Ci.head.appendChild(Ci.base),Ci.anchor=Ci.createElement("a"),Ci.body.appendChild(Ci.anchor)),Ci.base.href=e,Ci.anchor.href=t,Ci.anchor.href||t}function zi(t,e){return t.replace(Si,(function(t,i,o,r){return i+"'"+Ai(o.replace(/["']/g,""),e)+"'"+r}))}function Ii(t){return t.substring(0,t.lastIndexOf("/")+1)}
|
|
886
886
|
/**
|
|
887
887
|
@license
|
|
888
888
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -891,7 +891,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
891
891
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
892
892
|
Code distributed by Google as part of the polymer project is also
|
|
893
893
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
894
|
-
*/const
|
|
894
|
+
*/const Mi=!window.ShadyDOM||!window.ShadyDOM.inUse,Di=Mi&&"adoptedStyleSheets"in Document.prototype&&"replaceSync"in CSSStyleSheet.prototype&&(()=>{try{const t=new CSSStyleSheet;t.replaceSync("");const e=document.createElement("div");return e.attachShadow({mode:"open"}),e.shadowRoot.adoptedStyleSheets=[t],e.shadowRoot.adoptedStyleSheets[0]===t}catch(t){return!1}})();let Ni=window.Polymer&&window.Polymer.rootPath||Ii(document.baseURI||window.location.href),Oi=window.Polymer&&window.Polymer.sanitizeDOMValue||void 0,Ei=window.Polymer&&window.Polymer.strictTemplatePolicy||!1,Pi=window.Polymer&&window.Polymer.allowTemplateFromDomModule||!1,Bi=window.Polymer&&window.Polymer.legacyOptimizations||!1,ji=window.Polymer&&window.Polymer.legacyWarnings||!1,Li=window.Polymer&&window.Polymer.syncInitialRender||!1,$i=window.Polymer&&window.Polymer.legacyUndefined||!1,Fi=window.Polymer&&window.Polymer.orderedComputed||!1,Ri=window.Polymer&&window.Polymer.removeNestedTemplates||!1,Ui=window.Polymer&&window.Polymer.fastDomIf||!1,Vi=window.Polymer&&window.Polymer.suppressTemplateNotifications||!1,Hi=window.Polymer&&window.Polymer.useAdoptedStyleSheetsWithBuiltCSS||!1,Wi=0;const qi=function(t){let e=t.__mixinApplications;e||(e=new WeakMap,t.__mixinApplications=e);let i=Wi++;return function(o){let r=o.__mixinSet;if(r&&r[i])return o;let n=e,s=n.get(o);if(!s){s=t(o),n.set(o,s);let e=Object.create(s.__mixinSet||r||null);e[i]=!0,s.__mixinSet=e}return s}};
|
|
895
895
|
/**
|
|
896
896
|
@license
|
|
897
897
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -900,7 +900,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
900
900
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
901
901
|
Code distributed by Google as part of the polymer project is also
|
|
902
902
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
903
|
-
*/let
|
|
903
|
+
*/let Gi={},Yi={};function Ji(t,e){Gi[t]=Yi[t.toLowerCase()]=e}function Xi(t){return Gi[t]||Yi[t.toLowerCase()]}class Ki extends HTMLElement{static get observedAttributes(){return["id"]}static import(t,e){if(t){let i=Xi(t);return i&&e?i.querySelector(e):i}return null}attributeChangedCallback(t,e,i,o){e!==i&&this.register()}get assetpath(){if(!this.__assetpath){const t=window.HTMLImports&&HTMLImports.importForElement?HTMLImports.importForElement(this)||document:this.ownerDocument,e=Ai(this.getAttribute("assetpath")||"",t.baseURI);this.__assetpath=Ii(e)}return this.__assetpath}register(t){if(t=t||this.id){if(Ei&&void 0!==Xi(t))throw Ji(t,null),new Error(`strictTemplatePolicy: dom-module ${t} re-registered`);this.id=t,Ji(t,this),(e=this).querySelector("style")&&console.warn("dom-module %s has style outside template",e.id)}var e}}Ki.prototype.modules=Gi,customElements.define("dom-module",Ki);
|
|
904
904
|
/**
|
|
905
905
|
@license
|
|
906
906
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -910,7 +910,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
910
910
|
Code distributed by Google as part of the polymer project is also
|
|
911
911
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
912
912
|
*/
|
|
913
|
-
const
|
|
913
|
+
const Zi="link[rel=import][type~=css]",Qi="include",to="shady-unscoped";function eo(t){return Ki.import(t)}function io(t){const e=zi((t.body?t.body:t).textContent,t.baseURI),i=document.createElement("style");return i.textContent=e,i}function oo(t){const e=t.trim().split(/\s+/),i=[];for(let t=0;t<e.length;t++)i.push(...ro(e[t]));return i}function ro(t){const e=eo(t);if(!e)return console.warn("Could not find style data in module named",t),[];if(void 0===e._styles){const t=[];t.push(...so(e));const i=e.querySelector("template");i&&t.push(...no(i,e.assetpath)),e._styles=t}return e._styles}function no(t,e){if(!t._styles){const i=[],o=t.content.querySelectorAll("style");for(let t=0;t<o.length;t++){let r=o[t],n=r.getAttribute(Qi);n&&i.push(...oo(n).filter((function(t,e,i){return i.indexOf(t)===e}))),e&&(r.textContent=zi(r.textContent,e)),i.push(r)}t._styles=i}return t._styles}function so(t){const e=[],i=t.querySelectorAll(Zi);for(let t=0;t<i.length;t++){let o=i[t];if(o.import){const t=o.import,i=o.hasAttribute(to);if(i&&!t._unscopedStyle){const e=io(t);e.setAttribute(to,""),t._unscopedStyle=e}else t._style||(t._style=io(t));e.push(i?t._unscopedStyle:t._style)}}return e}
|
|
914
914
|
/**
|
|
915
915
|
@license
|
|
916
916
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -919,7 +919,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
919
919
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
920
920
|
Code distributed by Google as part of the polymer project is also
|
|
921
921
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
922
|
-
*/const
|
|
922
|
+
*/const ao=window.ShadyDOM&&window.ShadyDOM.noPatch&&window.ShadyDOM.wrap?window.ShadyDOM.wrap:window.ShadyDOM?t=>ShadyDOM.patch(t):t=>t
|
|
923
923
|
/**
|
|
924
924
|
@license
|
|
925
925
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -928,7 +928,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
928
928
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
929
929
|
Code distributed by Google as part of the polymer project is also
|
|
930
930
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
931
|
-
*/;function
|
|
931
|
+
*/;function lo(t){return t.indexOf(".")>=0}function ho(t){let e=t.indexOf(".");return-1===e?t:t.slice(0,e)}function co(t,e){return 0===t.indexOf(e+".")}function uo(t,e){return 0===e.indexOf(t+".")}function po(t,e,i){return e+i.slice(t.length)}function mo(t){if(Array.isArray(t)){let e=[];for(let i=0;i<t.length;i++){let o=t[i].toString().split(".");for(let t=0;t<o.length;t++)e.push(o[t])}return e.join(".")}return t}function fo(t){return Array.isArray(t)?mo(t).split("."):t.toString().split(".")}function vo(t,e,i){let o=t,r=fo(e);for(let t=0;t<r.length;t++){if(!o)return;o=o[r[t]]}return i&&(i.path=r.join(".")),o}function go(t,e,i){let o=t,r=fo(e),n=r[r.length-1];if(r.length>1){for(let t=0;t<r.length-1;t++)if(o=o[r[t]],!o)return;o[n]=i}else o[e]=i;return r.join(".")}
|
|
932
932
|
/**
|
|
933
933
|
@license
|
|
934
934
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -937,7 +937,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
937
937
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
938
938
|
Code distributed by Google as part of the polymer project is also
|
|
939
939
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
940
|
-
*/const
|
|
940
|
+
*/const bo={},yo=/-[a-z]/g,wo=/([A-Z])/g;function xo(t){return bo[t]||(bo[t]=t.indexOf("-")<0?t:t.replace(yo,(t=>t[1].toUpperCase())))}function _o(t){return bo[t]||(bo[t]=t.replace(wo,"-$1").toLowerCase())}
|
|
941
941
|
/**
|
|
942
942
|
@license
|
|
943
943
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -946,7 +946,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
946
946
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
947
947
|
Code distributed by Google as part of the polymer project is also
|
|
948
948
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
949
|
-
*/let
|
|
949
|
+
*/let ko=0,Co=0,So=[],To=0,Ao=!1,zo=document.createTextNode("");new window.MutationObserver((function(){Ao=!1;const t=So.length;for(let e=0;e<t;e++){let t=So[e];if(t)try{t()}catch(t){setTimeout((()=>{throw t}))}}So.splice(0,t),Co+=t})).observe(zo,{characterData:!0});const Io={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Mo={run:t=>(Ao||(Ao=!0,zo.textContent=To++),So.push(t),ko++),cancel(t){const e=t-Co;if(e>=0){if(!So[e])throw new Error("invalid async handle: "+t);So[e]=null}}},Do=Mo,No=qi((t=>class extends t{static createProperties(t){const e=this.prototype;for(let i in t)i in e||e._createPropertyAccessor(i)}static attributeNameForProperty(t){return t.toLowerCase()}static typeForProperty(t){}_createPropertyAccessor(t,e){this._addPropertyToAttributeMap(t),this.hasOwnProperty(JSCompiler_renameProperty("__dataHasAccessor",this))||(this.__dataHasAccessor=Object.assign({},this.__dataHasAccessor)),this.__dataHasAccessor[t]||(this.__dataHasAccessor[t]=!0,this._definePropertyAccessor(t,e))}_addPropertyToAttributeMap(t){this.hasOwnProperty(JSCompiler_renameProperty("__dataAttributes",this))||(this.__dataAttributes=Object.assign({},this.__dataAttributes));let e=this.__dataAttributes[t];return e||(e=this.constructor.attributeNameForProperty(t),this.__dataAttributes[e]=t),e}_definePropertyAccessor(t,e){Object.defineProperty(this,t,{get(){return this.__data[t]},set:e?function(){}:function(e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}})}constructor(){super(),this.__dataEnabled=!1,this.__dataReady=!1,this.__dataInvalid=!1,this.__data={},this.__dataPending=null,this.__dataOld=null,this.__dataInstanceProps=null,this.__dataCounter=0,this.__serializing=!1,this._initializeProperties()}ready(){this.__dataReady=!0,this._flushProperties()}_initializeProperties(){for(let t in this.__dataHasAccessor)this.hasOwnProperty(t)&&(this.__dataInstanceProps=this.__dataInstanceProps||{},this.__dataInstanceProps[t]=this[t],delete this[t])}_initializeInstanceProperties(t){Object.assign(this,t)}_setProperty(t,e){this._setPendingProperty(t,e)&&this._invalidateProperties()}_getProperty(t){return this.__data[t]}_setPendingProperty(t,e,i){let o=this.__data[t],r=this._shouldPropertyChange(t,e,o);return r&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),this.__dataOld&&!(t in this.__dataOld)&&(this.__dataOld[t]=o),this.__data[t]=e,this.__dataPending[t]=e),r}_isPropertyPending(t){return!(!this.__dataPending||!this.__dataPending.hasOwnProperty(t))}_invalidateProperties(){!this.__dataInvalid&&this.__dataReady&&(this.__dataInvalid=!0,Do.run((()=>{this.__dataInvalid&&(this.__dataInvalid=!1,this._flushProperties())})))}_enableProperties(){this.__dataEnabled||(this.__dataEnabled=!0,this.__dataInstanceProps&&(this._initializeInstanceProperties(this.__dataInstanceProps),this.__dataInstanceProps=null),this.ready())}_flushProperties(){this.__dataCounter++;const t=this.__data,e=this.__dataPending,i=this.__dataOld;this._shouldPropertiesChange(t,e,i)&&(this.__dataPending=null,this.__dataOld=null,this._propertiesChanged(t,e,i)),this.__dataCounter--}_shouldPropertiesChange(t,e,i){return!!e}_propertiesChanged(t,e,i){}_shouldPropertyChange(t,e,i){return i!==e&&(i==i||e==e)}attributeChangedCallback(t,e,i,o){e!==i&&this._attributeToProperty(t,i),super.attributeChangedCallback&&super.attributeChangedCallback(t,e,i,o)}_attributeToProperty(t,e,i){if(!this.__serializing){const o=this.__dataAttributes,r=o&&o[t]||t;this[r]=this._deserializeValue(e,i||this.constructor.typeForProperty(r))}}_propertyToAttribute(t,e,i){this.__serializing=!0,this._valueToNodeAttribute(this,i=arguments.length<3?this[t]:i,e||this.constructor.attributeNameForProperty(t)),this.__serializing=!1}_valueToNodeAttribute(t,e,i){const o=this._serializeValue(e);("class"===i||"name"===i||"slot"===i)&&(t=ao(t)),void 0===o?t.removeAttribute(i):t.setAttribute(i,""===o&&window.trustedTypes?window.trustedTypes.emptyScript:o)}_serializeValue(t){return"boolean"==typeof t?t?"":void 0:null!=t?t.toString():void 0}_deserializeValue(t,e){switch(e){case Boolean:return null!==t;case Number:return Number(t);default:return t}}})),Oo={};
|
|
950
950
|
/**
|
|
951
951
|
@license
|
|
952
952
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -955,7 +955,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
955
955
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
956
956
|
Code distributed by Google as part of the polymer project is also
|
|
957
957
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
958
|
-
*/let
|
|
958
|
+
*/let Eo=HTMLElement.prototype;for(;Eo;){let t=Object.getOwnPropertyNames(Eo);for(let e=0;e<t.length;e++)Oo[t[e]]=!0;Eo=Object.getPrototypeOf(Eo)}const Po=window.trustedTypes?t=>trustedTypes.isHTML(t)||trustedTypes.isScript(t)||trustedTypes.isScriptURL(t):()=>!1,Bo=qi((t=>{const e=No(t);return class extends e{static createPropertiesForAttributes(){let t=this.observedAttributes;for(let e=0;e<t.length;e++)this.prototype._createPropertyAccessor(xo(t[e]))}static attributeNameForProperty(t){return _o(t)}_initializeProperties(){this.__dataProto&&(this._initializeProtoProperties(this.__dataProto),this.__dataProto=null),super._initializeProperties()}_initializeProtoProperties(t){for(let e in t)this._setProperty(e,t[e])}_ensureAttribute(t,e){this.hasAttribute(t)||this._valueToNodeAttribute(this,e,t)}_serializeValue(t){if("object"==typeof t){if(t instanceof Date)return t.toString();if(t){if(Po(t))return t;try{return JSON.stringify(t)}catch(t){return""}}}return super._serializeValue(t)}_deserializeValue(t,e){let i;switch(e){case Object:try{i=JSON.parse(t)}catch(e){i=t}break;case Array:try{i=JSON.parse(t)}catch(e){i=null,console.warn(`Polymer::Attributes: couldn't decode Array as JSON: ${t}`)}break;case Date:i=isNaN(t)?String(t):Number(t),i=new Date(i);break;default:i=super._deserializeValue(t,e)}return i}_definePropertyAccessor(t,e){(function(t,e){if(!Oo[e]){let i=t[e];void 0!==i&&(t.__data?t._setPendingProperty(e,i):(t.__dataProto?t.hasOwnProperty(JSCompiler_renameProperty("__dataProto",t))||(t.__dataProto=Object.create(t.__dataProto)):t.__dataProto={},t.__dataProto[e]=i))}})(this,t),super._definePropertyAccessor(t,e)}_hasAccessor(t){return this.__dataHasAccessor&&this.__dataHasAccessor[t]}_isPropertyPending(t){return!(!this.__dataPending||!(t in this.__dataPending))}}})),jo={"dom-if":!0,"dom-repeat":!0};let Lo=!1,$o=!1;const Fo=(()=>{const t=window.trustedTypes&&window.trustedTypes.createPolicy("polymer-template-event-attribute-policy",{createScript:t=>t});return(e,i,o)=>{const r=i.getAttribute(o);t&&o.startsWith("on-")?e.setAttribute(o,t.createScript(r,o)):e.setAttribute(o,r)}})();function Ro(t){let e=t.getAttribute("is");if(e&&jo[e]){let i=t;for(i.removeAttribute("is"),t=i.ownerDocument.createElement(e),i.parentNode.replaceChild(t,i),t.appendChild(i);i.attributes.length;){const{name:e}=i.attributes[0];Fo(t,i,e),i.removeAttribute(e)}}return t}function Uo(t,e){let i=e.parentInfo&&Uo(t,e.parentInfo);if(!i)return t;for(let t=i.firstChild,o=0;t;t=t.nextSibling)if(e.parentIndex===o++)return t}function Vo(t,e,i,o){o.id&&(e[o.id]=i)}function Ho(t,e,i){if(i.events&&i.events.length)for(let o,r=0,n=i.events;r<n.length&&(o=n[r]);r++)t._addMethodEventListenerToNode(e,o.name,o.value,t)}function Wo(t,e,i,o){i.templateInfo&&(e._templateInfo=i.templateInfo,e._parentTemplateInfo=o)}const qo=qi((t=>class extends t{static _parseTemplate(t,e){if(!t._templateInfo){let i=t._templateInfo={};i.nodeInfoList=[],i.nestedTemplate=!!e,i.stripWhiteSpace=e&&e.stripWhiteSpace||t.hasAttribute&&t.hasAttribute("strip-whitespace"),this._parseTemplateContent(t,i,{parent:null})}return t._templateInfo}static _parseTemplateContent(t,e,i){return this._parseTemplateNode(t.content,e,i)}static _parseTemplateNode(t,e,i){let o=!1,r=t;return"template"!=r.localName||r.hasAttribute("preserve-content")?"slot"===r.localName&&(e.hasInsertionPoint=!0):o=this._parseTemplateNestedTemplate(r,e,i)||o,function(t){(function(){if(!Lo){Lo=!0;const t=document.createElement("textarea");t.placeholder="a",$o=t.placeholder===t.textContent}return $o})()&&"textarea"===t.localName&&t.placeholder&&t.placeholder===t.textContent&&(t.textContent=null)}(r),r.firstChild&&this._parseTemplateChildNodes(r,e,i),r.hasAttributes&&r.hasAttributes()&&(o=this._parseTemplateNodeAttributes(r,e,i)||o),o||i.noted}static _parseTemplateChildNodes(t,e,i){if("script"!==t.localName&&"style"!==t.localName)for(let o,r=t.firstChild,n=0;r;r=o){if("template"==r.localName&&(r=Ro(r)),o=r.nextSibling,r.nodeType===Node.TEXT_NODE){let i=o;for(;i&&i.nodeType===Node.TEXT_NODE;)r.textContent+=i.textContent,o=i.nextSibling,t.removeChild(i),i=o;if(e.stripWhiteSpace&&!r.textContent.trim()){t.removeChild(r);continue}}let s={parentIndex:n,parentInfo:i};this._parseTemplateNode(r,e,s)&&(s.infoIndex=e.nodeInfoList.push(s)-1),r.parentNode&&n++}}static _parseTemplateNestedTemplate(t,e,i){let o=t,r=this._parseTemplate(o,e);return(r.content=o.content.ownerDocument.createDocumentFragment()).appendChild(o.content),i.templateInfo=r,!0}static _parseTemplateNodeAttributes(t,e,i){let o=!1,r=Array.from(t.attributes);for(let n,s=r.length-1;n=r[s];s--)o=this._parseTemplateNodeAttribute(t,e,i,n.name,n.value)||o;return o}static _parseTemplateNodeAttribute(t,e,i,o,r){return"on-"===o.slice(0,3)?(t.removeAttribute(o),i.events=i.events||[],i.events.push({name:o.slice(3),value:r}),!0):"id"===o&&(i.id=r,!0)}static _contentForTemplate(t){let e=t._templateInfo;return e&&e.content||t.content}_stampTemplate(t,e){t&&!t.content&&window.HTMLTemplateElement&&HTMLTemplateElement.decorate&&HTMLTemplateElement.decorate(t);let i=(e=e||this.constructor._parseTemplate(t)).nodeInfoList,o=document.importNode(e.content||t.content,!0);o.__noInsertionPoint=!e.hasInsertionPoint;let r=o.nodeList=new Array(i.length);o.$={};for(let t,n=0,s=i.length;n<s&&(t=i[n]);n++){let i=r[n]=Uo(o,t);Vo(0,o.$,i,t),Wo(0,i,t,e),Ho(this,i,t)}return o}_addMethodEventListenerToNode(t,e,i,o){let r=function(t,e,i){return t=t._methodHost||t,function(e){t[i]?t[i](e,e.detail):console.warn("listener method `"+i+"` not defined")}}(o=o||t,0,i);return this._addEventListenerToNode(t,e,r),r}_addEventListenerToNode(t,e,i){t.addEventListener(e,i)}_removeEventListenerFromNode(t,e,i){t.removeEventListener(e,i)}}));
|
|
959
959
|
/**
|
|
960
960
|
* @fileoverview
|
|
961
961
|
* @suppress {checkPrototypalTypes}
|
|
@@ -966,7 +966,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
966
966
|
* be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by
|
|
967
967
|
* Google as part of the polymer project is also subject to an additional IP
|
|
968
968
|
* rights grant found at http://polymer.github.io/PATENTS.txt
|
|
969
|
-
*/let Uo=0;const Vo=[],Ho={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},Wo="__computeInfo",qo=/[A-Z]/;function Go(t,e,i){let o=t[e];if(o){if(!t.hasOwnProperty(e)&&(o=t[e]=Object.create(t[e]),i))for(let t in o){let e=o[t],i=o[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else o=t[e]={};return o}function Yo(t,e,i,o,r,n){if(e){let s=!1;const a=Uo++;for(let l in i){let h=e[r?ro(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!r||Xo(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,o,e.info,r,n),s=!0)}return s}return!1}function Jo(t,e,i,o,r,n,s,a){let l=!1,h=e[s?ro(o):o];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!s||Xo(o,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,o,r,n,e.info,s,a),l=!0);return l}function Xo(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!no(i,t))||!(!e.wildcard||!so(i,t))}return!0}function Ko(t,e,i,o,r){let n="string"==typeof r.method?t[r.method]:r.method,s=r.property;n?n.call(t,t.__data[s],o[s]):r.dynamicFn||console.warn("observer method `"+r.method+"` not defined")}function Zo(t,e,i){let o=ro(e);return o!==e&&(Qo(t,go(o)+"-changed",i[e],e),!0)}function Qo(t,e,i,o){let r={value:i,queueProperty:!0};o&&(r.path=o),io(t).dispatchEvent(new CustomEvent(e,{detail:r}))}function tr(t,e,i,o,r,n){let s=(n?ro(e):e)!=e?e:null,a=s?co(t,s):t.__data[e];s&&void 0===a&&(a=i[e]),Qo(t,r.eventName,a,s)}function er(t,e,i,o,r){let n=t.__data[e];zi&&(n=zi(n,r.attrName,"attribute",t)),t._propertyToAttribute(e,r.attrName,n)}const ir=(t,e,i)=>{let o=0,r=e.length-1,n=-1;for(;o<=r;){const s=o+r>>1,a=i.get(e[s].methodInfo)-i.get(t.methodInfo);if(a<0)o=s+1;else{if(!(a>0)){n=s;break}r=s-1}}n<0&&(n=r+1),e.splice(n,0,t)},or=(t,e,i,o,r)=>{const n=e[r?ro(t):t];if(n)for(let e=0;e<n.length;e++){const s=n[e];s.info.lastRun!==Uo&&(!r||Xo(t,s.trigger))&&(s.info.lastRun=Uo,ir(s.info,i,o))}};function rr(t,e,i,o,r){let n=dr(t,e,i,0,r);if(n===Vo)return!1;let s=r.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[s]?t._setPendingProperty(s,n,!0):(t[s]=n,!1)}function nr(t,e,i,o,r,n,s){i.bindings=i.bindings||[];let a={kind:o,target:r,parts:n,literal:s,isCompound:1!==n.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||go(r)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let o=a.parts[i];o.compoundIndex=i,sr(t,e,a,o,l)}}function sr(t,e,i,o,r){if(!o.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let n=o.dependencies,s={index:r,binding:i,part:o,evaluator:t};for(let i=0;i<n.length;i++){let o=n[i];"string"==typeof o&&(o=br(o),o.wildcard=!0),t._addTemplatePropertyEffect(e,o.rootProperty,{fn:ar,info:s,trigger:o})}}}function ar(t,e,i,o,r,n,s){let a=s[r.index],l=r.binding,h=r.part;if(n&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let o=i[e];e=ao(h.source,l.target,e),a._setPendingPropertyOrPath(e,o,!1,!0)&&t._enqueueClient(a)}else{let s=r.evaluator._evaluateBinding(t,h,e,i,o,n);s!==Vo&&function(t,e,i,o,r){if(r=function(t,e,i,o){if(i.isCompound){let r=t.__dataCompoundStorage[i.target];r[o.compoundIndex]=e,e=r.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,r,i,o),zi&&(r=zi(r,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,r,i.target);else{let o=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[o]?(!e[Ho.READ_ONLY]||!e[Ho.READ_ONLY][o])&&e._setPendingProperty(o,r)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,o,r)}}(t,a,l,h,s)}}function lr(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),o=e.parts,r=new Array(o.length);for(let t=0;t<o.length;t++)r[t]=o[t].literal;let n=e.target;i[n]=r,e.literal&&"property"==e.kind&&("className"===n&&(t=io(t)),t[n]=e.literal)}}function hr(t,e,i){if(i.listenerEvent){let o=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,o,r){let n,s=t.detail,a=s&&s.path;a?(o=ao(i,o,a),n=s&&s.value):n=t.currentTarget[i],n=r?!n:n,(!e[Ho.READ_ONLY]||!e[Ho.READ_ONLY][o])&&e._setPendingPropertyOrPath(o,n,!0,!!a)&&(!s||!s.queueProperty)&&e._invalidateProperties()}(t,e,i.target,o.source,o.negate)}))}}function cr(t,e,i,o,r,n){let s={methodName:e.methodName,args:e.args,methodInfo:r,dynamicFn:n=e.static||n&&("object"!=typeof n||n[e.methodName])};for(let r,n=0;n<e.args.length&&(r=e.args[n]);n++)r.literal||t._addPropertyEffect(r.rootProperty,i,{fn:o,info:s,trigger:r});return n&&t._addPropertyEffect(e.methodName,i,{fn:o,info:s}),s}function dr(t,e,i,o,r){let n=t._methodHost||t,s=n[r.methodName];if(s){let o=t._marshalArgs(r.args,e,i);return o===Vo?Vo:s.apply(n,o)}r.dynamicFn||console.warn("method `"+r.methodName+"` not defined")}const ur=[],pr="(?:[a-zA-Z_$][\\w.:$\\-*]*)",mr="(?:("+pr+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",fr=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+pr+"\\s*(?:\\(\\s*(?:(?:"+mr+"(?:,\\s*"+mr+")*)?)\\)\\s*)?)(?:]]|}})","g");function vr(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function gr(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:ur};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=br(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function br(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},o=e[0];switch("-"===o&&(o=e[1]),o>="0"&&o<="9"&&(o="#"),o){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=ro(e),i.structured=oo(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function yr(t,e,i){let o=co(t,i);return void 0===o&&(o=e[i]),o}function wr(t,e,i,o){const r={indexSplices:o};Ei&&!t._overrideLegacyUndefined&&(e.splices=r),t.notifyPath(i+".splices",r),t.notifyPath(i+".length",e.length),Ei&&!t._overrideLegacyUndefined&&(r.indexSplices=[])}function xr(t,e,i,o,r,n){wr(t,e,i,[{index:o,addedCount:r,removed:n,object:e,type:"splice"}])}const _r=Ri((t=>{const e=Ro(Do(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return Ho}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(kr.length){let t=kr[kr.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[Ho.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==Ho.READ_ONLY);let o=Go(this,e,!0)[t];o||(o=this[e][t]=[]),o.push(i)}_removePropertyEffect(t,e,i){let o=Go(this,e,!0)[t],r=o.indexOf(i);r>=0&&o.splice(r,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,Ho.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,Ho.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,Ho.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,Ho.COMPUTE)}_setPendingPropertyOrPath(t,e,i,o){if(o||ro(Array.isArray(t)?t[0]:t)!==t){if(!o){let i=co(this,t);if(!(t=uo(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let o=t.__dataLinkedPaths;if(o){let r;for(let n in o){let s=o[n];so(n,e)?(r=ao(n,s,e),t._setPendingPropertyOrPath(r,i,!0,!0)):so(s,e)&&(r=ao(s,n,e),t._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=io(t)),t[e]=i)}_setPendingProperty(t,e,i){let o=this.__dataHasPaths&&oo(t);return!!this._shouldPropertyChange(t,e,(o?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),o?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(o||this[Ho.NOTIFY]&&this[Ho.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[Ho.READ_ONLY]||!this[Ho.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let o,r=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,o){let r=t[Ho.COMPUTE];if(r)if(Pi){Uo++;const n=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[Ho.COMPUTE];let o,{counts:r,ready:n,total:s}=function(t){const e=t[Wo],i={},o=t[Ho.COMPUTE],r=[];let n=0;for(let t in e){const o=e[t];n+=i[t]=o.args.filter((t=>!t.literal)).length+(o.dynamicFn?1:0)}for(let t in o)e[t]||r.push(t);return{counts:i,ready:r,total:n}}(t);for(;o=n.shift();){e.set(o,e.size);const t=i[o];t&&t.forEach((t=>{const e=t.info.methodInfo;--s,0==--r[e]&&n.push(e)}))}0!==s&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),s=[];for(let t in e)or(t,r,s,n,o);let a;for(;a=s.shift();)rr(t,"",e,0,a)&&or(a.methodInfo,r,s,n,o);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let n=e;for(;Yo(t,r,n,i,o);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),n=t.__dataPending,t.__dataPending=null}}(this,e,i,r),o=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,r),this._flushClients(),Yo(this,this[Ho.REFLECT],e,i,r),Yo(this,this[Ho.OBSERVE],e,i,r),o&&function(t,e,i,o,r){let n,s,a=t[Ho.NOTIFY],l=Uo++;for(let s in e)e[s]&&(a&&Jo(t,a,l,s,i,o,r)||r&&Zo(t,s,i))&&(n=!0);n&&(s=t.__dataHost)&&s._invalidateProperties&&s._invalidateProperties()}(this,o,e,i,r),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[Ho.PROPAGATE]&&Yo(this,this[Ho.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,o){const r=(e,o)=>{Yo(this,t.propertyEffects,e,i,o,t.nodeList);for(let r=t.firstChild;r;r=r.nextSibling)this._runEffectsForTemplate(r,e,i,o)};t.runEffects?t.runEffects(r,e,o):r(e,o)}linkPaths(t,e){t=lo(t),e=lo(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=lo(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};wr(this,co(this,t,i),i.path,e)}get(t,e){return co(e||this,t)}set(t,e,i){i?uo(i,t,e):(!this[Ho.READ_ONLY]||!this[Ho.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},o=co(this,t,i),r=o.length,n=o.push(...e);return e.length&&xr(this,o,i.path,r,e.length,[]),n}pop(t){let e={path:""},i=co(this,t,e),o=!!i.length,r=i.pop();return o&&xr(this,i,e.path,i.length,0,[r]),r}splice(t,e,i,...o){let r,n={path:""},s=co(this,t,n);return e<0?e=s.length-Math.floor(-e):e&&(e=Math.floor(e)),r=2===arguments.length?s.splice(e):s.splice(e,i,...o),(o.length||r.length)&&xr(this,s,n.path,e,o.length,r),r}shift(t){let e={path:""},i=co(this,t,e),o=!!i.length,r=i.shift();return o&&xr(this,i,e.path,0,0,[r]),r}unshift(t,...e){let i={path:""},o=co(this,t,i),r=o.unshift(...e);return e.length&&xr(this,o,i.path,0,e.length,[]),r}notifyPath(t,e){let i;if(1==arguments.length){let o={path:""};e=co(this,t,o),i=o.path}else i=Array.isArray(t)?lo(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,Ho.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let o={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,Ho.OBSERVE,{fn:Ko,info:o,trigger:{name:t}}),i&&this._addPropertyEffect(e,Ho.OBSERVE,{fn:Ko,info:o,trigger:{name:e}})}_createMethodObserver(t,e){let i=gr(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");cr(this,i,Ho.OBSERVE,dr,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,Ho.NOTIFY,{fn:tr,info:{eventName:go(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,Ho.REFLECT,{fn:er,info:{attrName:e}})}_createComputedProperty(t,e,i){let o=gr(e);if(!o)throw new Error("Malformed computed expression '"+e+"'");const r=cr(this,o,Ho.COMPUTE,rr,t,i);Go(this,Wo)[t]=r}_marshalArgs(t,e,i){const o=this.__data,r=[];for(let n=0,s=t.length;n<s;n++){let{name:s,structured:a,wildcard:l,value:h,literal:c}=t[n];if(!c)if(l){const t=so(s,e),r=yr(o,i,t?e:s);h={path:t?e:s,value:r,base:t?co(o,s):r}}else h=a?yr(o,i,s):o[s];if(Ei&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return Vo;r[n]=h}return r}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),o=this.__preBoundTemplateInfo==i;if(!o)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=o,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,o=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=o,o?o.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let o=t.propertyEffects=t.propertyEffects||{};(o[e]=o[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),kr.push(this);let i=super._stampTemplate(t,e);if(kr.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:o}=e;if(o.length)for(let e=0;e<o.length;e++){let r=i[e],n=o[e].bindings;if(n)for(let e=0;e<n.length;e++){let i=n[e];lr(r,i),hr(r,t,i)}r.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:o,parent:r}=e;i?i.nextSibling=o:r&&(r.firstChild=o),o?o.previousSibling=i:r&&(r.lastChild=i),e.nextSibling=e.previousSibling=null;let n=e.childNodes;for(let t=0;t<n.length;t++){let e=n[t];io(io(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,o){let r=e._parseTemplateNode.call(this,t,i,o);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=vr(e)||" ",nr(this,i,o,"text","textContent",e),r=!0)}return r}static _parseTemplateNodeAttribute(t,i,o,r,n){let s=this._parseBindings(n,i);if(s){let e=r,n="property";qo.test(r)?n="attribute":"$"==r[r.length-1]&&(r=r.slice(0,-1),n="attribute");let a=vr(s);return a&&"attribute"==n&&("class"==r&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(r)),t.setAttribute(r,a)),"attribute"==n&&"disable-upgrade$"==e&&t.setAttribute(r,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===n&&(r=vo(r)),nr(this,i,o,n,r,s,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,o,r,n)}static _parseTemplateNestedTemplate(t,i,o){let r=e._parseTemplateNestedTemplate.call(this,t,i,o);const n=t.parentNode,s=o.templateInfo,a="dom-if"===n.localName;Bi&&(a||"dom-repeat"===n.localName)&&(n.removeChild(t),(o=o.parentInfo).templateInfo=s,o.noted=!0,r=!1);let l=s.hostProps;if(ji&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),Bi||(o.parentInfo.noted=!0));else{let t="{";for(let e in l)nr(this,i,o,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return r}static _parseBindings(t,e){let i,o=[],r=0;for(;null!==(i=fr.exec(t));){i.index>r&&o.push({literal:t.slice(r,i.index)});let n=i[1][0],s=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==n&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=gr(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let o=e.dynamicFns;(o&&o[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);o.push({source:a,mode:n,negate:s,customEvent:l,signature:d,dependencies:u,event:h}),r=fr.lastIndex}if(r&&r<t.length){let e=t.substring(r);e&&o.push({literal:e})}return o.length?o:null}static _evaluateBinding(t,e,i,o,r,n){let s;return s=e.signature?dr(t,i,o,0,e.signature):i!=e.source?co(t,e.source):n&&oo(i)?co(t,i):t.__data[i],e.negate&&(s=!s),s}}})),kr=[],Cr=Ri((t=>{const e=Ao(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof r?e:null}function o(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
969
|
+
*/let Go=0;const Yo=[],Jo={COMPUTE:"__computeEffects",REFLECT:"__reflectEffects",NOTIFY:"__notifyEffects",PROPAGATE:"__propagateEffects",OBSERVE:"__observeEffects",READ_ONLY:"__readOnly"},Xo="__computeInfo",Ko=/[A-Z]/;function Zo(t,e,i){let o=t[e];if(o){if(!t.hasOwnProperty(e)&&(o=t[e]=Object.create(t[e]),i))for(let t in o){let e=o[t],i=o[t]=Array(e.length);for(let t=0;t<e.length;t++)i[t]=e[t]}}else o=t[e]={};return o}function Qo(t,e,i,o,r,n){if(e){let s=!1;const a=Go++;for(let l in i){let h=e[r?ho(l):l];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==a)&&(!r||er(l,e.trigger))&&(e.info&&(e.info.lastRun=a),e.fn(t,l,i,o,e.info,r,n),s=!0)}return s}return!1}function tr(t,e,i,o,r,n,s,a){let l=!1,h=e[s?ho(o):o];if(h)for(let e,c=0,d=h.length;c<d&&(e=h[c]);c++)(!e.info||e.info.lastRun!==i)&&(!s||er(o,e.trigger))&&(e.info&&(e.info.lastRun=i),e.fn(t,o,r,n,e.info,s,a),l=!0);return l}function er(t,e){if(e){let i=e.name;return i==t||!(!e.structured||!co(i,t))||!(!e.wildcard||!uo(i,t))}return!0}function ir(t,e,i,o,r){let n="string"==typeof r.method?t[r.method]:r.method,s=r.property;n?n.call(t,t.__data[s],o[s]):r.dynamicFn||console.warn("observer method `"+r.method+"` not defined")}function or(t,e,i){let o=ho(e);return o!==e&&(rr(t,_o(o)+"-changed",i[e],e),!0)}function rr(t,e,i,o){let r={value:i,queueProperty:!0};o&&(r.path=o),ao(t).dispatchEvent(new CustomEvent(e,{detail:r}))}function nr(t,e,i,o,r,n){let s=(n?ho(e):e)!=e?e:null,a=s?vo(t,s):t.__data[e];s&&void 0===a&&(a=i[e]),rr(t,r.eventName,a,s)}function sr(t,e,i,o,r){let n=t.__data[e];Oi&&(n=Oi(n,r.attrName,"attribute",t)),t._propertyToAttribute(e,r.attrName,n)}const ar=(t,e,i)=>{let o=0,r=e.length-1,n=-1;for(;o<=r;){const s=o+r>>1,a=i.get(e[s].methodInfo)-i.get(t.methodInfo);if(a<0)o=s+1;else{if(!(a>0)){n=s;break}r=s-1}}n<0&&(n=r+1),e.splice(n,0,t)},lr=(t,e,i,o,r)=>{const n=e[r?ho(t):t];if(n)for(let e=0;e<n.length;e++){const s=n[e];s.info.lastRun!==Go&&(!r||er(t,s.trigger))&&(s.info.lastRun=Go,ar(s.info,i,o))}};function hr(t,e,i,o,r){let n=vr(t,e,i,0,r);if(n===Yo)return!1;let s=r.methodInfo;return t.__dataHasAccessor&&t.__dataHasAccessor[s]?t._setPendingProperty(s,n,!0):(t[s]=n,!1)}function cr(t,e,i,o,r,n,s){i.bindings=i.bindings||[];let a={kind:o,target:r,parts:n,literal:s,isCompound:1!==n.length};if(i.bindings.push(a),function(t){return!!t.target&&"attribute"!=t.kind&&"text"!=t.kind&&!t.isCompound&&"{"===t.parts[0].mode}(a)){let{event:t,negate:e}=a.parts[0];a.listenerEvent=t||_o(r)+"-changed",a.listenerNegate=e}let l=e.nodeInfoList.length;for(let i=0;i<a.parts.length;i++){let o=a.parts[i];o.compoundIndex=i,dr(t,e,a,o,l)}}function dr(t,e,i,o,r){if(!o.literal)if("attribute"===i.kind&&"-"===i.target[0])console.warn("Cannot set attribute "+i.target+' because "-" is not a valid attribute starting character');else{let n=o.dependencies,s={index:r,binding:i,part:o,evaluator:t};for(let i=0;i<n.length;i++){let o=n[i];"string"==typeof o&&(o=kr(o),o.wildcard=!0),t._addTemplatePropertyEffect(e,o.rootProperty,{fn:ur,info:s,trigger:o})}}}function ur(t,e,i,o,r,n,s){let a=s[r.index],l=r.binding,h=r.part;if(n&&h.source&&e.length>h.source.length&&"property"==l.kind&&!l.isCompound&&a.__isPropertyEffectsClient&&a.__dataHasAccessor&&a.__dataHasAccessor[l.target]){let o=i[e];e=po(h.source,l.target,e),a._setPendingPropertyOrPath(e,o,!1,!0)&&t._enqueueClient(a)}else{let s=r.evaluator._evaluateBinding(t,h,e,i,o,n);s!==Yo&&function(t,e,i,o,r){if(r=function(t,e,i,o){if(i.isCompound){let r=t.__dataCompoundStorage[i.target];r[o.compoundIndex]=e,e=r.join("")}return"attribute"!==i.kind&&("textContent"===i.target||"value"===i.target&&("input"===t.localName||"textarea"===t.localName))&&(e=null==e?"":e),e}(e,r,i,o),Oi&&(r=Oi(r,i.target,i.kind,e)),"attribute"==i.kind)t._valueToNodeAttribute(e,r,i.target);else{let o=i.target;e.__isPropertyEffectsClient&&e.__dataHasAccessor&&e.__dataHasAccessor[o]?(!e[Jo.READ_ONLY]||!e[Jo.READ_ONLY][o])&&e._setPendingProperty(o,r)&&t._enqueueClient(e):t._setUnmanagedPropertyToNode(e,o,r)}}(t,a,l,h,s)}}function pr(t,e){if(e.isCompound){let i=t.__dataCompoundStorage||(t.__dataCompoundStorage={}),o=e.parts,r=new Array(o.length);for(let t=0;t<o.length;t++)r[t]=o[t].literal;let n=e.target;i[n]=r,e.literal&&"property"==e.kind&&("className"===n&&(t=ao(t)),t[n]=e.literal)}}function mr(t,e,i){if(i.listenerEvent){let o=i.parts[0];t.addEventListener(i.listenerEvent,(function(t){!function(t,e,i,o,r){let n,s=t.detail,a=s&&s.path;a?(o=po(i,o,a),n=s&&s.value):n=t.currentTarget[i],n=r?!n:n,(!e[Jo.READ_ONLY]||!e[Jo.READ_ONLY][o])&&e._setPendingPropertyOrPath(o,n,!0,!!a)&&(!s||!s.queueProperty)&&e._invalidateProperties()}(t,e,i.target,o.source,o.negate)}))}}function fr(t,e,i,o,r,n){let s={methodName:e.methodName,args:e.args,methodInfo:r,dynamicFn:n=e.static||n&&("object"!=typeof n||n[e.methodName])};for(let r,n=0;n<e.args.length&&(r=e.args[n]);n++)r.literal||t._addPropertyEffect(r.rootProperty,i,{fn:o,info:s,trigger:r});return n&&t._addPropertyEffect(e.methodName,i,{fn:o,info:s}),s}function vr(t,e,i,o,r){let n=t._methodHost||t,s=n[r.methodName];if(s){let o=t._marshalArgs(r.args,e,i);return o===Yo?Yo:s.apply(n,o)}r.dynamicFn||console.warn("method `"+r.methodName+"` not defined")}const gr=[],br="(?:[a-zA-Z_$][\\w.:$\\-*]*)",yr="(?:("+br+"|(?:[-+]?[0-9]*\\.?[0-9]+(?:[eE][-+]?[0-9]+)?)|(?:(?:'(?:[^'\\\\]|\\\\.)*')|(?:\"(?:[^\"\\\\]|\\\\.)*\")))\\s*)",wr=new RegExp("(\\[\\[|{{)\\s*(?:(!)\\s*)?("+br+"\\s*(?:\\(\\s*(?:(?:"+yr+"(?:,\\s*"+yr+")*)?)\\)\\s*)?)(?:]]|}})","g");function xr(t){let e="";for(let i=0;i<t.length;i++)e+=t[i].literal||"";return e}function _r(t){let e=t.match(/([^\s]+?)\(([\s\S]*)\)/);if(e){let t={methodName:e[1],static:!0,args:gr};return e[2].trim()?function(t,e){return e.args=t.map((function(t){let i=kr(t);return i.literal||(e.static=!1),i}),this),e}(e[2].replace(/\\,/g,",").split(","),t):t}return null}function kr(t){let e=t.trim().replace(/,/g,",").replace(/\\(.)/g,"$1"),i={name:e,value:"",literal:!1},o=e[0];switch("-"===o&&(o=e[1]),o>="0"&&o<="9"&&(o="#"),o){case"'":case'"':i.value=e.slice(1,-1),i.literal=!0;break;case"#":i.value=Number(e),i.literal=!0}return i.literal||(i.rootProperty=ho(e),i.structured=lo(e),i.structured&&(i.wildcard=".*"==e.slice(-2),i.wildcard&&(i.name=e.slice(0,-2)))),i}function Cr(t,e,i){let o=vo(t,i);return void 0===o&&(o=e[i]),o}function Sr(t,e,i,o){const r={indexSplices:o};$i&&!t._overrideLegacyUndefined&&(e.splices=r),t.notifyPath(i+".splices",r),t.notifyPath(i+".length",e.length),$i&&!t._overrideLegacyUndefined&&(r.indexSplices=[])}function Tr(t,e,i,o,r,n){Sr(t,e,i,[{index:o,addedCount:r,removed:n,object:e,type:"splice"}])}const Ar=qi((t=>{const e=qo(Bo(t));return class extends e{constructor(){super(),this.__isPropertyEffectsClient=!0}get PROPERTY_EFFECT_TYPES(){return Jo}_initializeProperties(){super._initializeProperties(),this._registerHost(),this.__dataClientsReady=!1,this.__dataPendingClients=null,this.__dataToNotify=null,this.__dataLinkedPaths=null,this.__dataHasPaths=!1,this.__dataCompoundStorage=this.__dataCompoundStorage||null,this.__dataHost=this.__dataHost||null,this.__dataTemp={},this.__dataClientsInitialized=!1}_registerHost(){if(zr.length){let t=zr[zr.length-1];t._enqueueClient(this),this.__dataHost=t}}_initializeProtoProperties(t){this.__data=Object.create(t),this.__dataPending=Object.create(t),this.__dataOld={}}_initializeInstanceProperties(t){let e=this[Jo.READ_ONLY];for(let i in t)(!e||!e[i])&&(this.__dataPending=this.__dataPending||{},this.__dataOld=this.__dataOld||{},this.__data[i]=this.__dataPending[i]=t[i])}_addPropertyEffect(t,e,i){this._createPropertyAccessor(t,e==Jo.READ_ONLY);let o=Zo(this,e,!0)[t];o||(o=this[e][t]=[]),o.push(i)}_removePropertyEffect(t,e,i){let o=Zo(this,e,!0)[t],r=o.indexOf(i);r>=0&&o.splice(r,1)}_hasPropertyEffect(t,e){let i=this[e];return!(!i||!i[t])}_hasReadOnlyEffect(t){return this._hasPropertyEffect(t,Jo.READ_ONLY)}_hasNotifyEffect(t){return this._hasPropertyEffect(t,Jo.NOTIFY)}_hasReflectEffect(t){return this._hasPropertyEffect(t,Jo.REFLECT)}_hasComputedEffect(t){return this._hasPropertyEffect(t,Jo.COMPUTE)}_setPendingPropertyOrPath(t,e,i,o){if(o||ho(Array.isArray(t)?t[0]:t)!==t){if(!o){let i=vo(this,t);if(!(t=go(this,t,e))||!super._shouldPropertyChange(t,e,i))return!1}if(this.__dataHasPaths=!0,this._setPendingProperty(t,e,i))return function(t,e,i){let o=t.__dataLinkedPaths;if(o){let r;for(let n in o){let s=o[n];uo(n,e)?(r=po(n,s,e),t._setPendingPropertyOrPath(r,i,!0,!0)):uo(s,e)&&(r=po(s,n,e),t._setPendingPropertyOrPath(r,i,!0,!0))}}}(this,t,e),!0}else{if(this.__dataHasAccessor&&this.__dataHasAccessor[t])return this._setPendingProperty(t,e,i);this[t]=e}return!1}_setUnmanagedPropertyToNode(t,e,i){(i!==t[e]||"object"==typeof i)&&("className"===e&&(t=ao(t)),t[e]=i)}_setPendingProperty(t,e,i){let o=this.__dataHasPaths&&lo(t);return!!this._shouldPropertyChange(t,e,(o?this.__dataTemp:this.__data)[t])&&(this.__dataPending||(this.__dataPending={},this.__dataOld={}),t in this.__dataOld||(this.__dataOld[t]=this.__data[t]),o?this.__dataTemp[t]=e:this.__data[t]=e,this.__dataPending[t]=e,(o||this[Jo.NOTIFY]&&this[Jo.NOTIFY][t])&&(this.__dataToNotify=this.__dataToNotify||{},this.__dataToNotify[t]=i),!0)}_setProperty(t,e){this._setPendingProperty(t,e,!0)&&this._invalidateProperties()}_invalidateProperties(){this.__dataReady&&this._flushProperties()}_enqueueClient(t){this.__dataPendingClients=this.__dataPendingClients||[],t!==this&&this.__dataPendingClients.push(t)}_flushClients(){this.__dataClientsReady?this.__enableOrFlushClients():(this.__dataClientsReady=!0,this._readyClients(),this.__dataReady=!0)}__enableOrFlushClients(){let t=this.__dataPendingClients;if(t){this.__dataPendingClients=null;for(let e=0;e<t.length;e++){let i=t[e];i.__dataEnabled?i.__dataPending&&i._flushProperties():i._enableProperties()}}}_readyClients(){this.__enableOrFlushClients()}setProperties(t,e){for(let i in t)(e||!this[Jo.READ_ONLY]||!this[Jo.READ_ONLY][i])&&this._setPendingPropertyOrPath(i,t[i],!0);this._invalidateProperties()}ready(){this._flushProperties(),this.__dataClientsReady||this._flushClients(),this.__dataPending&&this._flushProperties()}_propertiesChanged(t,e,i){let o,r=this.__dataHasPaths;this.__dataHasPaths=!1,function(t,e,i,o){let r=t[Jo.COMPUTE];if(r)if(Fi){Go++;const n=function(t){let e=t.constructor.__orderedComputedDeps;if(!e){e=new Map;const i=t[Jo.COMPUTE];let o,{counts:r,ready:n,total:s}=function(t){const e=t[Xo],i={},o=t[Jo.COMPUTE],r=[];let n=0;for(let t in e){const o=e[t];n+=i[t]=o.args.filter((t=>!t.literal)).length+(o.dynamicFn?1:0)}for(let t in o)e[t]||r.push(t);return{counts:i,ready:r,total:n}}(t);for(;o=n.shift();){e.set(o,e.size);const t=i[o];t&&t.forEach((t=>{const e=t.info.methodInfo;--s,0==--r[e]&&n.push(e)}))}0!==s&&console.warn(`Computed graph for ${t.localName} incomplete; circular?`),t.constructor.__orderedComputedDeps=e}return e}(t),s=[];for(let t in e)lr(t,r,s,n,o);let a;for(;a=s.shift();)hr(t,"",e,0,a)&&lr(a.methodInfo,r,s,n,o);Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),t.__dataPending=null}else{let n=e;for(;Qo(t,r,n,i,o);)Object.assign(i,t.__dataOld),Object.assign(e,t.__dataPending),n=t.__dataPending,t.__dataPending=null}}(this,e,i,r),o=this.__dataToNotify,this.__dataToNotify=null,this._propagatePropertyChanges(e,i,r),this._flushClients(),Qo(this,this[Jo.REFLECT],e,i,r),Qo(this,this[Jo.OBSERVE],e,i,r),o&&function(t,e,i,o,r){let n,s,a=t[Jo.NOTIFY],l=Go++;for(let s in e)e[s]&&(a&&tr(t,a,l,s,i,o,r)||r&&or(t,s,i))&&(n=!0);n&&(s=t.__dataHost)&&s._invalidateProperties&&s._invalidateProperties()}(this,o,e,i,r),1==this.__dataCounter&&(this.__dataTemp={})}_propagatePropertyChanges(t,e,i){this[Jo.PROPAGATE]&&Qo(this,this[Jo.PROPAGATE],t,e,i),this.__templateInfo&&this._runEffectsForTemplate(this.__templateInfo,t,e,i)}_runEffectsForTemplate(t,e,i,o){const r=(e,o)=>{Qo(this,t.propertyEffects,e,i,o,t.nodeList);for(let r=t.firstChild;r;r=r.nextSibling)this._runEffectsForTemplate(r,e,i,o)};t.runEffects?t.runEffects(r,e,o):r(e,o)}linkPaths(t,e){t=mo(t),e=mo(e),this.__dataLinkedPaths=this.__dataLinkedPaths||{},this.__dataLinkedPaths[t]=e}unlinkPaths(t){t=mo(t),this.__dataLinkedPaths&&delete this.__dataLinkedPaths[t]}notifySplices(t,e){let i={path:""};Sr(this,vo(this,t,i),i.path,e)}get(t,e){return vo(e||this,t)}set(t,e,i){i?go(i,t,e):(!this[Jo.READ_ONLY]||!this[Jo.READ_ONLY][t])&&this._setPendingPropertyOrPath(t,e,!0)&&this._invalidateProperties()}push(t,...e){let i={path:""},o=vo(this,t,i),r=o.length,n=o.push(...e);return e.length&&Tr(this,o,i.path,r,e.length,[]),n}pop(t){let e={path:""},i=vo(this,t,e),o=!!i.length,r=i.pop();return o&&Tr(this,i,e.path,i.length,0,[r]),r}splice(t,e,i,...o){let r,n={path:""},s=vo(this,t,n);return e<0?e=s.length-Math.floor(-e):e&&(e=Math.floor(e)),r=2===arguments.length?s.splice(e):s.splice(e,i,...o),(o.length||r.length)&&Tr(this,s,n.path,e,o.length,r),r}shift(t){let e={path:""},i=vo(this,t,e),o=!!i.length,r=i.shift();return o&&Tr(this,i,e.path,0,0,[r]),r}unshift(t,...e){let i={path:""},o=vo(this,t,i),r=o.unshift(...e);return e.length&&Tr(this,o,i.path,0,e.length,[]),r}notifyPath(t,e){let i;if(1==arguments.length){let o={path:""};e=vo(this,t,o),i=o.path}else i=Array.isArray(t)?mo(t):t;this._setPendingPropertyOrPath(i,e,!0,!0)&&this._invalidateProperties()}_createReadOnlyProperty(t,e){this._addPropertyEffect(t,Jo.READ_ONLY),e&&(this["_set"+function(t){return t[0].toUpperCase()+t.substring(1)}(t)]=function(e){this._setProperty(t,e)})}_createPropertyObserver(t,e,i){let o={property:t,method:e,dynamicFn:!!i};this._addPropertyEffect(t,Jo.OBSERVE,{fn:ir,info:o,trigger:{name:t}}),i&&this._addPropertyEffect(e,Jo.OBSERVE,{fn:ir,info:o,trigger:{name:e}})}_createMethodObserver(t,e){let i=_r(t);if(!i)throw new Error("Malformed observer expression '"+t+"'");fr(this,i,Jo.OBSERVE,vr,null,e)}_createNotifyingProperty(t){this._addPropertyEffect(t,Jo.NOTIFY,{fn:nr,info:{eventName:_o(t)+"-changed",property:t}})}_createReflectedProperty(t){let e=this.constructor.attributeNameForProperty(t);"-"===e[0]?console.warn("Property "+t+" cannot be reflected to attribute "+e+' because "-" is not a valid starting attribute name. Use a lowercase first letter for the property instead.'):this._addPropertyEffect(t,Jo.REFLECT,{fn:sr,info:{attrName:e}})}_createComputedProperty(t,e,i){let o=_r(e);if(!o)throw new Error("Malformed computed expression '"+e+"'");const r=fr(this,o,Jo.COMPUTE,hr,t,i);Zo(this,Xo)[t]=r}_marshalArgs(t,e,i){const o=this.__data,r=[];for(let n=0,s=t.length;n<s;n++){let{name:s,structured:a,wildcard:l,value:h,literal:c}=t[n];if(!c)if(l){const t=uo(s,e),r=Cr(o,i,t?e:s);h={path:t?e:s,value:r,base:t?vo(o,s):r}}else h=a?Cr(o,i,s):o[s];if($i&&!this._overrideLegacyUndefined&&void 0===h&&t.length>1)return Yo;r[n]=h}return r}static addPropertyEffect(t,e,i){this.prototype._addPropertyEffect(t,e,i)}static createPropertyObserver(t,e,i){this.prototype._createPropertyObserver(t,e,i)}static createMethodObserver(t,e){this.prototype._createMethodObserver(t,e)}static createNotifyingProperty(t){this.prototype._createNotifyingProperty(t)}static createReadOnlyProperty(t,e){this.prototype._createReadOnlyProperty(t,e)}static createReflectedProperty(t){this.prototype._createReflectedProperty(t)}static createComputedProperty(t,e,i){this.prototype._createComputedProperty(t,e,i)}static bindTemplate(t){return this.prototype._bindTemplate(t)}_bindTemplate(t,e){let i=this.constructor._parseTemplate(t),o=this.__preBoundTemplateInfo==i;if(!o)for(let t in i.propertyEffects)this._createPropertyAccessor(t);if(e)if(i=Object.create(i),i.wasPreBound=o,this.__templateInfo){const e=t._parentTemplateInfo||this.__templateInfo,o=e.lastChild;i.parent=e,e.lastChild=i,i.previousSibling=o,o?o.nextSibling=i:e.firstChild=i}else this.__templateInfo=i;else this.__preBoundTemplateInfo=i;return i}static _addTemplatePropertyEffect(t,e,i){(t.hostProps=t.hostProps||{})[e]=!0;let o=t.propertyEffects=t.propertyEffects||{};(o[e]=o[e]||[]).push(i)}_stampTemplate(t,e){e=e||this._bindTemplate(t,!0),zr.push(this);let i=super._stampTemplate(t,e);if(zr.pop(),e.nodeList=i.nodeList,!e.wasPreBound){let t=e.childNodes=[];for(let e=i.firstChild;e;e=e.nextSibling)t.push(e)}return i.templateInfo=e,function(t,e){let{nodeList:i,nodeInfoList:o}=e;if(o.length)for(let e=0;e<o.length;e++){let r=i[e],n=o[e].bindings;if(n)for(let e=0;e<n.length;e++){let i=n[e];pr(r,i),mr(r,t,i)}r.__dataHost=t}}(this,e),this.__dataClientsReady&&(this._runEffectsForTemplate(e,this.__data,null,!1),this._flushClients()),i}_removeBoundDom(t){const e=t.templateInfo,{previousSibling:i,nextSibling:o,parent:r}=e;i?i.nextSibling=o:r&&(r.firstChild=o),o?o.previousSibling=i:r&&(r.lastChild=i),e.nextSibling=e.previousSibling=null;let n=e.childNodes;for(let t=0;t<n.length;t++){let e=n[t];ao(ao(e).parentNode).removeChild(e)}}static _parseTemplateNode(t,i,o){let r=e._parseTemplateNode.call(this,t,i,o);if(t.nodeType===Node.TEXT_NODE){let e=this._parseBindings(t.textContent,i);e&&(t.textContent=xr(e)||" ",cr(this,i,o,"text","textContent",e),r=!0)}return r}static _parseTemplateNodeAttribute(t,i,o,r,n){let s=this._parseBindings(n,i);if(s){let e=r,n="property";Ko.test(r)?n="attribute":"$"==r[r.length-1]&&(r=r.slice(0,-1),n="attribute");let a=xr(s);return a&&"attribute"==n&&("class"==r&&t.hasAttribute("class")&&(a+=" "+t.getAttribute(r)),t.setAttribute(r,a)),"attribute"==n&&"disable-upgrade$"==e&&t.setAttribute(r,""),"input"===t.localName&&"value"===e&&t.setAttribute(e,""),t.removeAttribute(e),"property"===n&&(r=xo(r)),cr(this,i,o,n,r,s,a),!0}return e._parseTemplateNodeAttribute.call(this,t,i,o,r,n)}static _parseTemplateNestedTemplate(t,i,o){let r=e._parseTemplateNestedTemplate.call(this,t,i,o);const n=t.parentNode,s=o.templateInfo,a="dom-if"===n.localName;Ri&&(a||"dom-repeat"===n.localName)&&(n.removeChild(t),(o=o.parentInfo).templateInfo=s,o.noted=!0,r=!1);let l=s.hostProps;if(Ui&&a)l&&(i.hostProps=Object.assign(i.hostProps||{},l),Ri||(o.parentInfo.noted=!0));else{let t="{";for(let e in l)cr(this,i,o,"property","_host_"+e,[{mode:t,source:e,dependencies:[e],hostProp:!0}])}return r}static _parseBindings(t,e){let i,o=[],r=0;for(;null!==(i=wr.exec(t));){i.index>r&&o.push({literal:t.slice(r,i.index)});let n=i[1][0],s=!!i[2],a=i[3].trim(),l=!1,h="",c=-1;"{"==n&&(c=a.indexOf("::"))>0&&(h=a.substring(c+2),a=a.substring(0,c),l=!0);let d=_r(a),u=[];if(d){let{args:t,methodName:i}=d;for(let e=0;e<t.length;e++){let i=t[e];i.literal||u.push(i)}let o=e.dynamicFns;(o&&o[i]||d.static)&&(u.push(i),d.dynamicFn=!0)}else u.push(a);o.push({source:a,mode:n,negate:s,customEvent:l,signature:d,dependencies:u,event:h}),r=wr.lastIndex}if(r&&r<t.length){let e=t.substring(r);e&&o.push({literal:e})}return o.length?o:null}static _evaluateBinding(t,e,i,o,r,n){let s;return s=e.signature?vr(t,i,o,0,e.signature):i!=e.source?vo(t,e.source):n&&lo(i)?vo(t,i):t.__data[i],e.negate&&(s=!s),s}}})),zr=[],Ir=qi((t=>{const e=No(t);function i(t){const e=Object.getPrototypeOf(t);return e.prototype instanceof r?e:null}function o(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__ownProperties",t))){let e=null;if(t.hasOwnProperty(JSCompiler_renameProperty("properties",t))){const i=t.properties;i&&(e=
|
|
970
970
|
/**
|
|
971
971
|
@license
|
|
972
972
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -985,7 +985,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
985
985
|
Code distributed by Google as part of the polymer project is also
|
|
986
986
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
987
987
|
*/
|
|
988
|
-
function(t){const e={};for(let i in t){const o=t[i];e[i]="function"==typeof o?{type:o}:o}return e}(i))}t.__ownProperties=e}return t.__ownProperties}class r extends e{static get observedAttributes(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){const t=this._properties;this.__observedAttributes=t?Object.keys(t).map((t=>this.prototype._addPropertyToAttributeMap(t))):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const t=i(this);t&&t.finalize(),this.__finalized=!0,this._finalizeClass()}}static _finalizeClass(){const t=o(this);t&&this.createProperties(t)}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const t=i(this);this.__properties=Object.assign({},t&&t._properties,o(this))}return this.__properties}static typeForProperty(t){const e=this._properties[t];return e&&e.type}_initializeProperties(){this.constructor.finalize(),super._initializeProperties()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._enableProperties()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback()}}return r})),
|
|
988
|
+
function(t){const e={};for(let i in t){const o=t[i];e[i]="function"==typeof o?{type:o}:o}return e}(i))}t.__ownProperties=e}return t.__ownProperties}class r extends e{static get observedAttributes(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__observedAttributes",this))){const t=this._properties;this.__observedAttributes=t?Object.keys(t).map((t=>this.prototype._addPropertyToAttributeMap(t))):[]}return this.__observedAttributes}static finalize(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__finalized",this))){const t=i(this);t&&t.finalize(),this.__finalized=!0,this._finalizeClass()}}static _finalizeClass(){const t=o(this);t&&this.createProperties(t)}static get _properties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("__properties",this))){const t=i(this);this.__properties=Object.assign({},t&&t._properties,o(this))}return this.__properties}static typeForProperty(t){const e=this._properties[t];return e&&e.type}_initializeProperties(){this.constructor.finalize(),super._initializeProperties()}connectedCallback(){super.connectedCallback&&super.connectedCallback(),this._enableProperties()}disconnectedCallback(){super.disconnectedCallback&&super.disconnectedCallback()}}return r})),Mr=window.ShadyCSS&&window.ShadyCSS.cssBuild,Dr=qi((t=>{const e=Ir(Ar(t));function i(t,e,i,o){i.computed&&(i.readOnly=!0),i.computed&&(t._hasReadOnlyEffect(e)?console.warn(`Cannot redefine computed property '${e}'.`):t._createComputedProperty(e,i.computed,o)),i.readOnly&&!t._hasReadOnlyEffect(e)?t._createReadOnlyProperty(e,!i.computed):!1===i.readOnly&&t._hasReadOnlyEffect(e)&&console.warn(`Cannot make readOnly property '${e}' non-readOnly.`),i.reflectToAttribute&&!t._hasReflectEffect(e)?t._createReflectedProperty(e):!1===i.reflectToAttribute&&t._hasReflectEffect(e)&&console.warn(`Cannot make reflected property '${e}' non-reflected.`),i.notify&&!t._hasNotifyEffect(e)?t._createNotifyingProperty(e):!1===i.notify&&t._hasNotifyEffect(e)&&console.warn(`Cannot make notify property '${e}' non-notify.`),i.observer&&t._createPropertyObserver(e,i.observer,o[i.observer]),t._addPropertyToAttributeMap(e)}return class extends e{static get polymerElementVersion(){return"3.5.2"}static _finalizeClass(){e._finalizeClass.call(this);const t=((i=this).hasOwnProperty(JSCompiler_renameProperty("__ownObservers",i))||(i.__ownObservers=i.hasOwnProperty(JSCompiler_renameProperty("observers",i))?i.observers:null),i.__ownObservers);var i;t&&this.createObservers(t,this._properties),this._prepareTemplate()}static _prepareTemplate(){let t=this.template;t&&("string"==typeof t?(console.error("template getter must return HTMLTemplateElement"),t=null):Bi||(t=t.cloneNode(!0))),this.prototype._template=t}static createProperties(t){for(let e in t)i(this.prototype,e,t[e],t)}static createObservers(t,e){const i=this.prototype;for(let o=0;o<t.length;o++)i._createMethodObserver(t[o],e)}static get template(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_template",this))){let t=this.prototype.hasOwnProperty(JSCompiler_renameProperty("_template",this.prototype))?this.prototype._template:void 0;"function"==typeof t&&(t=t()),this._template=void 0!==t?t:this.hasOwnProperty(JSCompiler_renameProperty("is",this))&&function(t){let e=null;if(t&&(!Ei||Pi)&&(e=Ki.import(t,"template"),Ei&&!e))throw new Error(`strictTemplatePolicy: expecting dom-module or null template for ${t}`);return e}(this.is)||Object.getPrototypeOf(this.prototype).constructor.template}return this._template}static set template(t){this._template=t}static get importPath(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_importPath",this))){const t=this.importMeta;if(t)this._importPath=Ii(t.url);else{const t=Ki.import(this.is);this._importPath=t&&t.assetpath||Object.getPrototypeOf(this.prototype).constructor.importPath}}return this._importPath}constructor(){super()}_initializeProperties(){this.constructor.finalize(),this.constructor._finalizeTemplate(this.localName),super._initializeProperties(),this.rootPath=Ni,this.importPath=this.constructor.importPath;let t=function(t){if(!t.hasOwnProperty(JSCompiler_renameProperty("__propertyDefaults",t))){t.__propertyDefaults=null;let e=t._properties;for(let i in e){let o=e[i];"value"in o&&(t.__propertyDefaults=t.__propertyDefaults||{},t.__propertyDefaults[i]=o)}}return t.__propertyDefaults}(this.constructor);if(t)for(let e in t){let i=t[e];if(this._canApplyPropertyDefault(e)){let t="function"==typeof i.value?i.value.call(this):i.value;this._hasAccessor(e)?this._setPendingProperty(e,t,!0):this[e]=t}}}_canApplyPropertyDefault(t){return!this.hasOwnProperty(t)}static _processStyleText(t,e){return zi(t,e)}static _finalizeTemplate(t){const e=this.prototype._template;if(e&&!e.__polymerFinalized){e.__polymerFinalized=!0;const i=this.importPath;(function(t,e,i,o){if(!Mr){const r=e.content.querySelectorAll("style"),n=no(e),s=function(t){let e=eo(t);return e?so(e):[]}(i),a=e.content.firstElementChild;for(let i=0;i<s.length;i++){let r=s[i];r.textContent=t._processStyleText(r.textContent,o),e.content.insertBefore(r,a)}let l=0;for(let e=0;e<n.length;e++){let i=n[e],s=r[l];s!==i?(i=i.cloneNode(!0),s.parentNode.insertBefore(i,s)):l++,i.textContent=t._processStyleText(i.textContent,o)}}if(window.ShadyCSS&&window.ShadyCSS.prepareTemplate(e,i),Hi&&Mr&&Di){const i=e.content.querySelectorAll("style");if(i){let e="";Array.from(i).forEach((t=>{e+=t.textContent,t.parentNode.removeChild(t)})),t._styleSheet=new CSSStyleSheet,t._styleSheet.replaceSync(e)}}})(this,e,t,i?Ai(i):""),this.prototype._bindTemplate(e)}}connectedCallback(){window.ShadyCSS&&this._template&&window.ShadyCSS.styleElement(this),super.connectedCallback()}ready(){this._template&&(this.root=this._stampTemplate(this._template),this.$=this.root.$),super.ready()}_readyClients(){this._template&&(this.root=this._attachDom(this.root)),super._readyClients()}_attachDom(t){const e=ao(this);if(e.attachShadow)return t?(e.shadowRoot||(e.attachShadow({mode:"open",shadyUpgradeFragment:t}),e.shadowRoot.appendChild(t),this.constructor._styleSheet&&(e.shadowRoot.adoptedStyleSheets=[this.constructor._styleSheet])),Li&&window.ShadyDOM&&window.ShadyDOM.flushInitial(e.shadowRoot),e.shadowRoot):null;throw new Error("ShadowDOM not available. PolymerElement can create dom as children instead of in ShadowDOM by setting `this.root = this;` before `ready`.")}updateStyles(t){window.ShadyCSS&&window.ShadyCSS.styleSubtree(this,t)}resolveUrl(t,e){return!e&&this.importPath&&(e=Ai(this.importPath)),Ai(t,e)}static _parseTemplateContent(t,i,o){return i.dynamicFns=i.dynamicFns||this._properties,e._parseTemplateContent.call(this,t,i,o)}static _addTemplatePropertyEffect(t,i,o){return ji&&!(i in this._properties)&&!(o.info.part.signature&&o.info.part.signature.static)&&!o.info.part.hostProp&&!t.nestedTemplate&&console.warn(`Property '${i}' used in template but not declared in 'properties'; attribute will not be observed.`),e._addTemplatePropertyEffect.call(this,t,i,o)}}})),Nr=window.trustedTypes&&trustedTypes.createPolicy("polymer-html-literal",{createHTML:t=>t});class Or{constructor(t,e){Br(t,e);const i=e.reduce(((e,i,o)=>e+Er(i)+t[o+1]),t[0]);this.value=i.toString()}toString(){return this.value}}function Er(t){if(t instanceof Or)return t.value;throw new Error(`non-literal value passed to Polymer's htmlLiteral function: ${t}`)}const Pr=function(t,...e){Br(t,e);const i=document.createElement("template");let o=e.reduce(((e,i,o)=>e+function(t){if(t instanceof HTMLTemplateElement)return t.innerHTML;if(t instanceof Or)return Er(t);throw new Error(`non-template value passed to Polymer's html function: ${t}`)}(i)+t[o+1]),t[0]);return Nr&&(o=Nr.createHTML(o)),i.innerHTML=o,i},Br=(t,e)=>{if(!Array.isArray(t)||!Array.isArray(t.raw)||e.length!==t.length-1)throw new TypeError("Invalid call to the html template tag")},jr=Dr(HTMLElement),Lr=/\/\*[\*!]\s+vaadin-dev-mode:start([\s\S]*)vaadin-dev-mode:end\s+\*\*\//i,$r=window.Vaadin&&window.Vaadin.Flow&&window.Vaadin.Flow.clients;
|
|
989
989
|
/**
|
|
990
990
|
@license
|
|
991
991
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -994,7 +994,7 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
994
994
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
995
995
|
Code distributed by Google as part of the polymer project is also
|
|
996
996
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
997
|
-
*/function
|
|
997
|
+
*/function Fr(t,e){if("function"!=typeof t)return;const i=Lr.exec(t.toString());if(i)try{t=new Function(i[1])}catch(t){console.log("vaadin-development-mode-detector: uncommentAndRun() failed",t)}return t(e)}window.Vaadin=window.Vaadin||{};function Rr(){
|
|
998
998
|
/*! vaadin-dev-mode:start
|
|
999
999
|
(function () {
|
|
1000
1000
|
'use strict';
|
|
@@ -1473,7 +1473,7 @@ try {
|
|
|
1473
1473
|
|
|
1474
1474
|
}());
|
|
1475
1475
|
|
|
1476
|
-
vaadin-dev-mode:end **/}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=function(){try{return!!localStorage.getItem("vaadin.developmentmode.force")||["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0&&(
|
|
1476
|
+
vaadin-dev-mode:end **/}void 0===window.Vaadin.developmentMode&&(window.Vaadin.developmentMode=function(){try{return!!localStorage.getItem("vaadin.developmentmode.force")||["localhost","127.0.0.1"].indexOf(window.location.hostname)>=0&&($r?!($r&&Object.keys($r).map((t=>$r[t])).filter((t=>t.productionMode)).length>0):!Fr((function(){return!0})))}catch(t){return!1}}());
|
|
1477
1477
|
/**
|
|
1478
1478
|
* @license
|
|
1479
1479
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1483,7 +1483,7 @@ try {
|
|
|
1483
1483
|
* Code distributed by Google as part of the polymer project is also
|
|
1484
1484
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1485
1485
|
*/
|
|
1486
|
-
let
|
|
1486
|
+
let Ur=0,Vr=0;const Hr=[];let Wr=!1;const qr={after:t=>({run:e=>window.setTimeout(e,t),cancel(t){window.clearTimeout(t)}}),run:(t,e)=>window.setTimeout(t,e),cancel(t){window.clearTimeout(t)}},Gr={run:t=>window.requestAnimationFrame(t),cancel(t){window.cancelAnimationFrame(t)}},Yr={run:t=>window.requestIdleCallback?window.requestIdleCallback(t):window.setTimeout(t,16),cancel(t){window.cancelIdleCallback?window.cancelIdleCallback(t):window.clearTimeout(t)}},Jr={run(t){Wr||(Wr=!0,queueMicrotask((()=>function(){Wr=!1;const t=Hr.length;for(let e=0;e<t;e++){const t=Hr[e];if(t)try{t()}catch(t){setTimeout((()=>{throw t}))}}Hr.splice(0,t),Vr+=t}()))),Hr.push(t);const e=Ur;return Ur+=1,e},cancel(t){const e=t-Vr;if(e>=0){if(!Hr[e])throw new Error(`invalid async handle: ${t}`);Hr[e]=null}}},Xr=new Set;
|
|
1487
1487
|
/**
|
|
1488
1488
|
@license
|
|
1489
1489
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1492,43 +1492,43 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
1492
1492
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1493
1493
|
Code distributed by Google as part of the polymer project is also
|
|
1494
1494
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1495
|
-
*/let
|
|
1495
|
+
*/let Kr=class t{static debounce(e,i,o){return e instanceof t?e._cancelAsync():e=new t,e.setConfig(i,o),e}constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,Xr.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),Xr.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}};function Zr(t){Xr.add(t)}function Qr(){const t=!!Xr.size;return Xr.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t}const tn=()=>{let t;do{t=Qr()}while(t)},en=[];
|
|
1496
1496
|
/**
|
|
1497
1497
|
* @license
|
|
1498
1498
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1499
1499
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1500
|
-
*/function
|
|
1500
|
+
*/function on(t,e,i=t.getAttribute("dir")){e?t.setAttribute("dir",e):null!=i&&t.removeAttribute("dir")}function rn(){return document.documentElement.getAttribute("dir")}new MutationObserver((function(){const t=rn();en.forEach((e=>{on(e,t)}))})).observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});const nn=t=>class extends t{static get properties(){return{dir:{type:String,value:"",reflectToAttribute:!0,converter:{fromAttribute:t=>t||"",toAttribute:t=>""===t?null:t}}}}get __isRTL(){return"rtl"===this.getAttribute("dir")}connectedCallback(){super.connectedCallback(),(!this.hasAttribute("dir")||this.__restoreSubscription)&&(this.__subscribe(),on(this,rn(),null))}attributeChangedCallback(t,e,i){if(super.attributeChangedCallback(t,e,i),"dir"!==t)return;const o=rn(),r=i===o&&-1===en.indexOf(this),n=!i&&e&&-1===en.indexOf(this);r||n?(this.__subscribe(),on(this,o,i)):i!==o&&e===o&&this.__unsubscribe()}disconnectedCallback(){super.disconnectedCallback(),this.__restoreSubscription=en.includes(this),this.__unsubscribe()}_valueToNodeAttribute(t,e,i){"dir"===i&&""===e&&!t.hasAttribute("dir")||super._valueToNodeAttribute(t,e,i)}_attributeToProperty(t,e,i){"dir"!==t||e?super._attributeToProperty(t,e,i):this.dir=""}__subscribe(){en.includes(this)||en.push(this)}__unsubscribe(){en.includes(this)&&en.splice(en.indexOf(this),1)}}
|
|
1501
1501
|
/**
|
|
1502
1502
|
* @license
|
|
1503
1503
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1504
1504
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1505
|
-
*/;let
|
|
1505
|
+
*/;let sn;window.Vaadin||(window.Vaadin={}),window.Vaadin.registrations||(window.Vaadin.registrations=[]),window.Vaadin.developmentModeCallback||(window.Vaadin.developmentModeCallback={}),window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]=function(){!function(t,e){if(window.Vaadin.developmentMode)Fr(t,e)}(Rr)};const an=new Set,ln=t=>class extends(nn(t)){static finalize(){super.finalize();const{is:t}=this;t&&!an.has(t)&&(window.Vaadin.registrations.push(this),an.add(t),window.Vaadin.developmentModeCallback&&(sn=Kr.debounce(sn,Yr,(()=>{window.Vaadin.developmentModeCallback["vaadin-usage-statistics"]()})),Zr(sn)))}constructor(){super(),null===document.doctype&&console.warn('Vaadin components require the "standards mode" declaration. Please add <!DOCTYPE html> to the HTML document.')}}
|
|
1506
1506
|
/**
|
|
1507
1507
|
* @license
|
|
1508
1508
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1509
1509
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1510
|
-
*/;function
|
|
1510
|
+
*/;function hn(t){const e=[];let i;return"slot"===t.localName?i=t.assignedElements():(e.push(t),i=[...t.children]),i.forEach((t=>e.push(...hn(t)))),e}function cn(t){return t?new Set(t.split(" ")):new Set}function dn(t){return t?[...t].join(" "):""}function un(t,e,i){const o=cn(t.getAttribute(e));o.add(i),t.setAttribute(e,dn(o))}
|
|
1511
1511
|
/**
|
|
1512
1512
|
* @license
|
|
1513
1513
|
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
1514
1514
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1515
1515
|
*/
|
|
1516
|
-
class
|
|
1516
|
+
class pn{constructor(t,e){this.slot=t,this.callback=e,this._storedNodes=[],this._connected=!1,this._scheduled=!1,this._boundSchedule=()=>{this._schedule()},this.connect(),this._schedule()}connect(){this.slot.addEventListener("slotchange",this._boundSchedule),this._connected=!0}disconnect(){this.slot.removeEventListener("slotchange",this._boundSchedule),this._connected=!1}_schedule(){this._scheduled||(this._scheduled=!0,queueMicrotask((()=>{this.flush()})))}flush(){this._connected&&(this._scheduled=!1,this._processNodes())}_processNodes(){const t=this.slot.assignedNodes({flatten:!0});let e=[];const i=[],o=[];t.length&&(e=t.filter((t=>!this._storedNodes.includes(t)))),this._storedNodes.length&&this._storedNodes.forEach(((e,r)=>{const n=t.indexOf(e);-1===n?i.push(e):n!==r&&o.push(e)})),(e.length||i.length||o.length)&&this.callback({addedNodes:e,currentNodes:t,movedNodes:o,removedNodes:i}),this._storedNodes=t}}
|
|
1517
1517
|
/**
|
|
1518
1518
|
* @license
|
|
1519
1519
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1520
1520
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1521
|
-
*/let
|
|
1521
|
+
*/let mn=0;function fn(){return mn++}
|
|
1522
1522
|
/**
|
|
1523
1523
|
* @license
|
|
1524
1524
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1525
1525
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1526
|
-
*/class
|
|
1526
|
+
*/class vn extends EventTarget{static generateId(t,e="default"){return`${e}-${t.localName}-${fn()}`}constructor(t,e,i,o={}){super();const{initializer:r,multiple:n,observe:s,useUniqueId:a,uniqueIdPrefix:l}=o;this.host=t,this.slotName=e,this.tagName=i,this.observe="boolean"!=typeof s||s,this.multiple="boolean"==typeof n&&n,this.slotInitializer=r,n&&(this.nodes=[]),a&&(this.defaultId=this.constructor.generateId(t,l||e))}hostConnected(){this.initialized||(this.multiple?this.initMultiple():this.initSingle(),this.observe&&this.observeSlot(),this.initialized=!0)}initSingle(){let t=this.getSlotChild();t?(this.node=t,this.initAddedNode(t)):(t=this.attachDefaultNode(),this.initNode(t))}initMultiple(){const t=this.getSlotChildren();if(0===t.length){const t=this.attachDefaultNode();t&&(this.nodes=[t],this.initNode(t))}else this.nodes=t,t.forEach((t=>{this.initAddedNode(t)}))}attachDefaultNode(){const{host:t,slotName:e,tagName:i}=this;let o=this.defaultNode;return!o&&i&&(o=document.createElement(i),o instanceof Element&&(""!==e&&o.setAttribute("slot",e),this.defaultNode=o)),o&&(this.node=o,t.appendChild(o)),o}getSlotChildren(){const{slotName:t}=this;return Array.from(this.host.childNodes).filter((e=>e.nodeType===Node.ELEMENT_NODE&&e.slot===t||e.nodeType===Node.TEXT_NODE&&e.textContent.trim()&&""===t))}getSlotChild(){return this.getSlotChildren()[0]}initNode(t){const{slotInitializer:e}=this;e&&e(t,this.host)}initCustomNode(t){}teardownNode(t){}initAddedNode(t){t!==this.defaultNode&&(this.initCustomNode(t),this.initNode(t))}observeSlot(){const{slotName:t}=this,e=this.host.shadowRoot.querySelector(""===t?"slot:not([name])":`slot[name=${t}]`);this.__slotObserver=new pn(e,(({addedNodes:t,removedNodes:e})=>{const i=this.multiple?this.nodes:[this.node],o=t.filter((t=>{return!((e=t).nodeType===Node.TEXT_NODE&&""===e.textContent.trim()||i.includes(t));var e}));e.length&&(this.nodes=i.filter((t=>!e.includes(t))),e.forEach((t=>{this.teardownNode(t)}))),o&&o.length>0&&(this.multiple?(this.defaultNode&&this.defaultNode.remove(),this.nodes=[...i,...o].filter((t=>t!==this.defaultNode)),o.forEach((t=>{this.initAddedNode(t)}))):(this.node&&this.node.remove(),this.node=o[0],this.initAddedNode(this.node)))}))}}
|
|
1527
1527
|
/**
|
|
1528
1528
|
* @license
|
|
1529
1529
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1530
1530
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1531
|
-
*/class
|
|
1531
|
+
*/class gn extends vn{constructor(t){super(t,"tooltip"),this.setTarget(t)}initCustomNode(t){t.target=this.target,void 0!==this.ariaTarget&&(t.ariaTarget=this.ariaTarget),void 0!==this.context&&(t.context=this.context),void 0!==this.manual&&(t.manual=this.manual),void 0!==this.opened&&(t.opened=this.opened),void 0!==this.position&&(t._position=this.position),void 0!==this.shouldShow&&(t.shouldShow=this.shouldShow),this.__notifyChange()}teardownNode(){this.__notifyChange()}setAriaTarget(t){this.ariaTarget=t;const e=this.node;e&&(e.ariaTarget=t)}setContext(t){this.context=t;const e=this.node;e&&(e.context=t)}setManual(t){this.manual=t;const e=this.node;e&&(e.manual=t)}setOpened(t){this.opened=t;const e=this.node;e&&(e.opened=t)}setPosition(t){this.position=t;const e=this.node;e&&(e._position=t)}setShouldShow(t){this.shouldShow=t;const e=this.node;e&&(e.shouldShow=t)}setTarget(t){this.target=t;const e=this.node;e&&(e.target=t)}__notifyChange(){this.dispatchEvent(new CustomEvent("tooltip-changed",{detail:{node:this.node}}))}}
|
|
1532
1532
|
/**
|
|
1533
1533
|
@license
|
|
1534
1534
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1537,12 +1537,12 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
1537
1537
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
1538
1538
|
Code distributed by Google as part of the polymer project is also
|
|
1539
1539
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
1540
|
-
*/const
|
|
1540
|
+
*/const bn=t=>t,yn="string"==typeof document.head.style.touchAction,wn="__polymerGestures",xn="__polymerGesturesHandled",_n="__polymerGesturesTouchAction",kn=["mousedown","mousemove","mouseup","click"],Cn=[0,1,4,2],Sn=function(){try{return 1===new MouseEvent("test",{buttons:1}).buttons}catch(t){return!1}}();function Tn(t){return kn.indexOf(t)>-1}!function(){try{const t=Object.defineProperty({},"passive",{get(){}});window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){}}();const An=navigator.userAgent.match(/iP(?:[oa]d|hone)|Android/u),zn={button:!0,command:!0,fieldset:!0,input:!0,keygen:!0,optgroup:!0,option:!0,select:!0,textarea:!0};function In(t){const e=t.type;if(!Tn(e))return!1;if("mousemove"===e){let e=void 0===t.buttons?1:t.buttons;return t instanceof window.MouseEvent&&!Sn&&(e=Cn[t.which]||0),!!(1&e)}return 0===(void 0===t.button?0:t.button)}const Mn={touch:{x:0,y:0,id:-1,scrollDecided:!1}};function Dn(t,e,i){t.movefn=e,t.upfn=i,document.addEventListener("mousemove",e),document.addEventListener("mouseup",i)}function Nn(t){document.removeEventListener("mousemove",t.movefn),document.removeEventListener("mouseup",t.upfn),t.movefn=null,t.upfn=null}const On=window.ShadyDOM&&window.ShadyDOM.noPatch?window.ShadyDOM.composedPath:t=>t.composedPath&&t.composedPath()||[],En={},Pn=[];function Bn(t){const e=On(t);return e.length>0?e[0]:t.target}function jn(t){const e=t.type,i=t.currentTarget[wn];if(!i)return;const o=i[e];if(!o)return;if(!t[xn]&&(t[xn]={},e.startsWith("touch"))){const i=t.changedTouches[0];if("touchstart"===e&&1===t.touches.length&&(Mn.touch.id=i.identifier),Mn.touch.id!==i.identifier)return;yn||("touchstart"===e||"touchmove"===e)&&function(t){const e=t.changedTouches[0],i=t.type;if("touchstart"===i)Mn.touch.x=e.clientX,Mn.touch.y=e.clientY,Mn.touch.scrollDecided=!1;else if("touchmove"===i){if(Mn.touch.scrollDecided)return;Mn.touch.scrollDecided=!0;const i=function(t){let e="auto";const i=On(t);for(let t,o=0;o<i.length;o++)if(t=i[o],t[_n]){e=t[_n];break}return e}(t);let o=!1;const r=Math.abs(Mn.touch.x-e.clientX),n=Math.abs(Mn.touch.y-e.clientY);t.cancelable&&("none"===i?o=!0:"pan-x"===i?o=n>r:"pan-y"===i&&(o=r>n)),o?t.preventDefault():Un("track")}}(t)}const r=t[xn];if(!r.skip){for(let e,i=0;i<Pn.length;i++)e=Pn[i],o[e.name]&&!r[e.name]&&e.flow&&e.flow.start.indexOf(t.type)>-1&&e.reset&&e.reset();for(let i,n=0;n<Pn.length;n++)i=Pn[n],o[i.name]&&!r[i.name]&&(r[i.name]=!0,i[e](t))}}function Ln(t,e,i){return!!En[e]&&(function(t,e,i){const o=En[e],r=o.deps,n=o.name;let s=t[wn];s||(t[wn]=s={});for(let e,i,o=0;o<r.length;o++)e=r[o],(!An||!Tn(e)||"click"===e)&&(i=s[e],i||(s[e]=i={_count:0}),0===i._count&&t.addEventListener(e,jn,void 0),i[n]=(i[n]||0)+1,i._count=(i._count||0)+1);t.addEventListener(e,i),o.touchAction&&Fn(t,o.touchAction)}(t,e,i),!0)}function $n(t){Pn.push(t),t.emits.forEach((e=>{En[e]=t}))}function Fn(t,e){yn&&t instanceof HTMLElement&&Jr.run((()=>{t.style.touchAction=e})),t[_n]=e}function Rn(t,e,i){const o=new Event(e,{bubbles:!0,cancelable:!0,composed:!0});if(o.detail=i,bn(t).dispatchEvent(o),o.defaultPrevented){const t=i.preventer||i.sourceEvent;t&&t.preventDefault&&t.preventDefault()}}function Un(t){const e=function(t){for(let e,i=0;i<Pn.length;i++){e=Pn[i];for(let i,o=0;o<e.emits.length;o++)if(i=e.emits[o],i===t)return e}return null}(t);e.info&&(e.info.prevent=!0)}function Vn(t,e,i,o){e&&Rn(e,t,{x:i.clientX,y:i.clientY,sourceEvent:i,preventer:o,prevent:t=>Un(t)})}function Hn(t,e,i){if(t.prevent)return!1;if(t.started)return!0;const o=Math.abs(t.x-e),r=Math.abs(t.y-i);return o>=5||r>=5}function Wn(t,e,i){if(!e)return;const o=t.moves[t.moves.length-2],r=t.moves[t.moves.length-1];let n,s=0;o&&(n=r.x-o.x,s=r.y-o.y),Rn(e,"track",{state:t.state,x:i.clientX,y:i.clientY,dx:r.x-t.x,dy:r.y-t.y,ddx:n,ddy:s,sourceEvent:i,hover:()=>function(t,e){let i=document.elementFromPoint(t,e),o=i;for(;o&&o.shadowRoot&&!window.ShadyDOM;){const r=o;if(o=o.shadowRoot.elementFromPoint(t,e),r===o)break;o&&(i=o)}return i}(i.clientX,i.clientY)})}function qn(t,e,i){const o=Math.abs(e.clientX-t.x),r=Math.abs(e.clientY-t.y),n=Bn(i||e);!n||zn[n.localName]&&n.hasAttribute("disabled")||(isNaN(o)||isNaN(r)||o<=25&&r<=25||function(t){if("click"===t.type){if(0===t.detail)return!0;const e=Bn(t);if(!e.nodeType||e.nodeType!==Node.ELEMENT_NODE)return!0;const i=e.getBoundingClientRect(),o=t.pageX,r=t.pageY;return!(o>=i.left&&o<=i.right&&r>=i.top&&r<=i.bottom)}return!1}(e))&&(t.prevent||Rn(n,"tap",{x:e.clientX,y:e.clientY,sourceEvent:e,preventer:i}))}
|
|
1541
1541
|
/**
|
|
1542
1542
|
* @license
|
|
1543
1543
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1544
1544
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1545
|
-
|
|
1545
|
+
*/$n({name:"downup",deps:["mousedown","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["down","up"],info:{movefn:null,upfn:null},reset(){Nn(this.info)},mousedown(t){if(!In(t))return;const e=Bn(t),i=this;Dn(this.info,(t=>{In(t)||(Vn("up",e,t),Nn(i.info))}),(t=>{In(t)&&Vn("up",e,t),Nn(i.info)})),Vn("down",e,t)},touchstart(t){Vn("down",Bn(t),t.changedTouches[0],t)},touchend(t){Vn("up",Bn(t),t.changedTouches[0],t)}}),$n({name:"track",touchAction:"none",deps:["mousedown","touchstart","touchmove","touchend"],flow:{start:["mousedown","touchstart"],end:["mouseup","touchend"]},emits:["track"],info:{x:0,y:0,state:"start",started:!1,moves:[],addMove(t){this.moves.length>2&&this.moves.shift(),this.moves.push(t)},movefn:null,upfn:null,prevent:!1},reset(){this.info.state="start",this.info.started=!1,this.info.moves=[],this.info.x=0,this.info.y=0,this.info.prevent=!1,Nn(this.info)},mousedown(t){if(!In(t))return;const e=Bn(t),i=this,o=t=>{const o=t.clientX,r=t.clientY;Hn(i.info,o,r)&&(i.info.state=i.info.started?"mouseup"===t.type?"end":"track":"start","start"===i.info.state&&Un("tap"),i.info.addMove({x:o,y:r}),In(t)||(i.info.state="end",Nn(i.info)),e&&Wn(i.info,e,t),i.info.started=!0)};Dn(this.info,o,(t=>{i.info.started&&o(t),Nn(i.info)})),this.info.x=t.clientX,this.info.y=t.clientY},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchmove(t){const e=Bn(t),i=t.changedTouches[0],o=i.clientX,r=i.clientY;Hn(this.info,o,r)&&("start"===this.info.state&&Un("tap"),this.info.addMove({x:o,y:r}),Wn(this.info,e,i),this.info.state="track",this.info.started=!0)},touchend(t){const e=Bn(t),i=t.changedTouches[0];this.info.started&&(this.info.state="end",this.info.addMove({x:i.clientX,y:i.clientY}),Wn(this.info,e,i))}}),$n({name:"tap",deps:["mousedown","click","touchstart","touchend"],flow:{start:["mousedown","touchstart"],end:["click","touchend"]},emits:["tap"],info:{x:NaN,y:NaN,prevent:!1},reset(){this.info.x=NaN,this.info.y=NaN,this.info.prevent=!1},mousedown(t){In(t)&&(this.info.x=t.clientX,this.info.y=t.clientY)},click(t){In(t)&&qn(this.info,t)},touchstart(t){const e=t.changedTouches[0];this.info.x=e.clientX,this.info.y=e.clientY},touchend(t){qn(this.info,t.changedTouches[0],t)}});const Gn=qi((t=>class extends t{static get properties(){return{disabled:{type:Boolean,value:!1,observer:"_disabledChanged",reflectToAttribute:!0}}}_disabledChanged(t){this._setAriaDisabled(t)}_setAriaDisabled(t){t?this.setAttribute("aria-disabled","true"):this.removeAttribute("aria-disabled")}click(){this.disabled||super.click()}})),Yn=qi((t=>class extends t{ready(){super.ready(),this.addEventListener("keydown",(t=>{this._onKeyDown(t)})),this.addEventListener("keyup",(t=>{this._onKeyUp(t)}))}_onKeyDown(t){switch(t.key){case"Enter":this._onEnter(t);break;case"Escape":this._onEscape(t)}}_onKeyUp(t){}_onEnter(t){}_onEscape(t){}})),Jn=t=>class extends(Gn(Yn(t))){get _activeKeys(){return[" "]}ready(){super.ready(),Ln(this,"down",(t=>{this._shouldSetActive(t)&&this._setActive(!0)})),Ln(this,"up",(()=>{this._setActive(!1)}))}disconnectedCallback(){super.disconnectedCallback(),this._setActive(!1)}_shouldSetActive(t){return!this.disabled}_onKeyDown(t){super._onKeyDown(t),this._shouldSetActive(t)&&this._activeKeys.includes(t.key)&&(this._setActive(!0),document.addEventListener("keyup",(t=>{this._activeKeys.includes(t.key)&&this._setActive(!1)}),{once:!0}))}_setActive(t){this.toggleAttribute("active",t)}}
|
|
1546
1546
|
/**
|
|
1547
1547
|
* @license
|
|
1548
1548
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1552,64 +1552,64 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
1552
1552
|
* @license
|
|
1553
1553
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1554
1554
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1555
|
-
*/let
|
|
1555
|
+
*/let Xn=!1;function Kn(){let t=document.activeElement||document.body;for(;t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}function Zn(){return Xn}function Qn(t){const e=t.style;if("hidden"===e.visibility||"none"===e.display)return!0;const i=window.getComputedStyle(t);return"hidden"===i.visibility||"none"===i.display}function ts(t,e){const i=Math.max(t.tabIndex,0),o=Math.max(e.tabIndex,0);return 0===i||0===o?o>i:i>o}function es(t){const e=t.length;if(e<2)return t;const i=Math.ceil(e/2);return function(t,e){const i=[];for(;t.length>0&&e.length>0;)ts(t[0],e[0])?i.push(e.shift()):i.push(t.shift());return i.concat(t,e)}(es(t.slice(0,i)),es(t.slice(i)))}function is(t){return null===t.offsetParent&&0===t.clientWidth&&0===t.clientHeight||Qn(t)}function os(t){return!t.matches('[tabindex="-1"]')&&(t.matches("input, select, textarea, button, object")?t.matches(":not([disabled])"):t.matches("a[href], area[href], iframe, [tabindex], [contentEditable]"))}function rs(t){return t.getRootNode().activeElement===t}function ns(t,e){if(t.nodeType!==Node.ELEMENT_NODE||Qn(t))return!1;const i=t,o=function(t){if(!os(t))return-1;const e=t.getAttribute("tabindex")||0;return Number(e)}(i);let r=o>0;o>=0&&e.push(i);let n=[];return n="slot"===i.localName?i.assignedNodes({flatten:!0}):(i.shadowRoot||i).children,[...n].forEach((t=>{r=ns(t,e)||r})),r}window.addEventListener("keydown",(()=>{Xn=!0}),{capture:!0}),window.addEventListener("mousedown",(()=>{Xn=!1}),{capture:!0});
|
|
1556
1556
|
/**
|
|
1557
1557
|
* @license
|
|
1558
1558
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1559
1559
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1560
1560
|
*/
|
|
1561
|
-
const
|
|
1561
|
+
const ss=qi((t=>class extends t{get _keyboardActive(){return Zn()}ready(){this.addEventListener("focusin",(t=>{this._shouldSetFocus(t)&&this._setFocused(!0)})),this.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),super.ready()}disconnectedCallback(){super.disconnectedCallback(),this.hasAttribute("focused")&&this._setFocused(!1)}_setFocused(t){this.toggleAttribute("focused",t),this.toggleAttribute("focus-ring",t&&this._keyboardActive)}_shouldSetFocus(t){return!0}_shouldRemoveFocus(t){return!0}})),as=t=>class extends(Gn(t)){static get properties(){return{tabindex:{type:Number,reflectToAttribute:!0,observer:"_tabindexChanged"},_lastTabIndex:{type:Number}}}_disabledChanged(t,e){super._disabledChanged(t,e),t?(void 0!==this.tabindex&&(this._lastTabIndex=this.tabindex),this.tabindex=-1):e&&(this.tabindex=this._lastTabIndex)}_tabindexChanged(t){this.disabled&&-1!==t&&(this._lastTabIndex=t,this.tabindex=-1)}}
|
|
1562
1562
|
/**
|
|
1563
1563
|
* @license
|
|
1564
1564
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1565
1565
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1566
|
-
*/,
|
|
1566
|
+
*/,ls=qi((t=>class extends(ss(as(t))){static get properties(){return{autofocus:{type:Boolean},focusElement:{type:Object,readOnly:!0,observer:"_focusElementChanged"},_lastTabIndex:{value:0}}}constructor(){super(),this._boundOnBlur=this._onBlur.bind(this),this._boundOnFocus=this._onFocus.bind(this)}ready(){super.ready(),this.autofocus&&!this.disabled&&requestAnimationFrame((()=>{this.focus(),this.setAttribute("focus-ring","")}))}focus(){this.focusElement&&!this.disabled&&this.focusElement.focus()}blur(){this.focusElement&&this.focusElement.blur()}click(){this.focusElement&&!this.disabled&&this.focusElement.click()}_focusElementChanged(t,e){t?(t.disabled=this.disabled,this._addFocusListeners(t),this.__forwardTabIndex(this.tabindex)):e&&this._removeFocusListeners(e)}_addFocusListeners(t){t.addEventListener("blur",this._boundOnBlur),t.addEventListener("focus",this._boundOnFocus)}_removeFocusListeners(t){t.removeEventListener("blur",this._boundOnBlur),t.removeEventListener("focus",this._boundOnFocus)}_onFocus(t){t.stopPropagation(),this.dispatchEvent(new Event("focus"))}_onBlur(t){t.stopPropagation(),this.dispatchEvent(new Event("blur"))}_shouldSetFocus(t){return t.target===this.focusElement}_shouldRemoveFocus(t){return t.target===this.focusElement}_disabledChanged(t,e){super._disabledChanged(t,e),this.focusElement&&(this.focusElement.disabled=t),t&&this.blur()}_tabindexChanged(t){this.__forwardTabIndex(t)}__forwardTabIndex(t){void 0!==t&&this.focusElement&&(this.focusElement.tabIndex=t,-1!==t&&(this.tabindex=void 0)),this.disabled&&t&&(-1!==t&&(this._lastTabIndex=t),this.tabindex=void 0)}})),hs=qi((t=>class extends t{static get properties(){return{stateTarget:{type:Object,observer:"_stateTargetChanged"}}}static get delegateAttrs(){return[]}static get delegateProps(){return[]}ready(){super.ready(),this._createDelegateAttrsObserver(),this._createDelegatePropsObserver()}_stateTargetChanged(t){t&&(this._ensureAttrsDelegated(),this._ensurePropsDelegated())}_createDelegateAttrsObserver(){this._createMethodObserver(`_delegateAttrsChanged(${this.constructor.delegateAttrs.join(", ")})`)}_createDelegatePropsObserver(){this._createMethodObserver(`_delegatePropsChanged(${this.constructor.delegateProps.join(", ")})`)}_ensureAttrsDelegated(){this.constructor.delegateAttrs.forEach((t=>{this._delegateAttribute(t,this[t])}))}_ensurePropsDelegated(){this.constructor.delegateProps.forEach((t=>{this._delegateProperty(t,this[t])}))}_delegateAttrsChanged(...t){this.constructor.delegateAttrs.forEach(((e,i)=>{this._delegateAttribute(e,t[i])}))}_delegatePropsChanged(...t){this.constructor.delegateProps.forEach(((e,i)=>{this._delegateProperty(e,t[i])}))}_delegateAttribute(t,e){this.stateTarget&&("invalid"===t&&this._delegateAttribute("aria-invalid",!!e&&"true"),"boolean"==typeof e?this.stateTarget.toggleAttribute(t,e):e?this.stateTarget.setAttribute(t,e):this.stateTarget.removeAttribute(t))}_delegateProperty(t,e){this.stateTarget&&(this.stateTarget[t]=e)}})),cs=qi((t=>class extends t{static get properties(){return{inputElement:{type:Object,readOnly:!0,observer:"_inputElementChanged"},type:{type:String,readOnly:!0},value:{type:String,value:"",observer:"_valueChanged",notify:!0,sync:!0},_hasInputValue:{type:Boolean,value:!1,observer:"_hasInputValueChanged"}}}constructor(){super(),this._boundOnInput=this.__onInput.bind(this),this._boundOnChange=this._onChange.bind(this)}get _hasValue(){return null!=this.value&&""!==this.value}get _inputElementValueProperty(){return"value"}get _inputElementValue(){return this.inputElement?this.inputElement[this._inputElementValueProperty]:void 0}set _inputElementValue(t){this.inputElement&&(this.inputElement[this._inputElementValueProperty]=t)}clear(){this._hasInputValue=!1,this.value="",this._inputElementValue=""}_addInputListeners(t){t.addEventListener("input",this._boundOnInput),t.addEventListener("change",this._boundOnChange)}_removeInputListeners(t){t.removeEventListener("input",this._boundOnInput),t.removeEventListener("change",this._boundOnChange)}_forwardInputValue(t){this.inputElement&&(this._inputElementValue=null!=t?t:"")}_inputElementChanged(t,e){t?this._addInputListeners(t):e&&this._removeInputListeners(e)}_hasInputValueChanged(t,e){(t||e)&&this.dispatchEvent(new CustomEvent("has-input-value-changed"))}__onInput(t){this._setHasInputValue(t),this._onInput(t)}_onInput(t){const e=t.composedPath()[0];this.__userInput=t.isTrusted,this.value=e.value,this.__userInput=!1}_onChange(t){}_toggleHasValue(t){this.toggleAttribute("has-value",t)}_valueChanged(t,e){this._toggleHasValue(this._hasValue),(""!==t||void 0!==e)&&(this.__userInput||this._forwardInputValue(t))}_setHasInputValue(t){const e=t.composedPath()[0];this._hasInputValue=e.value.length>0}})),ds=qi((t=>class extends(hs(Gn(cs(t)))){static get properties(){return{checked:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0}}}static get delegateProps(){return[...super.delegateProps,"checked"]}_onChange(t){this._toggleChecked(t.target.checked)}_toggleChecked(t){this.checked=t}})),us=new Map;
|
|
1567
1567
|
/**
|
|
1568
1568
|
* @license
|
|
1569
1569
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1570
1570
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1571
|
-
*/function
|
|
1571
|
+
*/function ps(t){return us.has(t)||us.set(t,new WeakMap),us.get(t)}function ms(t,e){t&&t.removeAttribute(e)}function fs(t,e){if(!t||!e)return;const i=ps(e);if(i.has(t))return;const o=cn(t.getAttribute(e));i.set(t,new Set(o))}function vs(t,e,i={newId:null,oldId:null,fromUser:!1}){if(!t||!e)return;const{newId:o,oldId:r,fromUser:n}=i,s=ps(e),a=s.get(t);if(!n&&a)return r&&a.delete(r),void(o&&a.add(o));n&&(a?o||s.delete(t):fs(t,e),ms(t,e)),function(t,e,i){const o=cn(t.getAttribute(e));o.delete(i),0!==o.size?t.setAttribute(e,dn(o)):t.removeAttribute(e)}(t,e,r);const l=o||dn(a);l&&un(t,e,l)}
|
|
1572
1572
|
/**
|
|
1573
1573
|
* @license
|
|
1574
1574
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1575
1575
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1576
1576
|
*/
|
|
1577
|
-
class
|
|
1577
|
+
class gs{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__target=t,this.__setAriaRequiredAttribute(this.__required),this.__setLabelIdToAriaAttribute(this.__labelId,this.__labelId),null!=this.__labelIdFromUser&&this.__setLabelIdToAriaAttribute(this.__labelIdFromUser,this.__labelIdFromUser,!0),this.__setErrorIdToAriaAttribute(this.__errorId),this.__setHelperIdToAriaAttribute(this.__helperId),this.setAriaLabel(this.__label)}setRequired(t){this.__setAriaRequiredAttribute(t),this.__required=t}setAriaLabel(t){this.__setAriaLabelToAttribute(t),this.__label=t}setLabelId(t,e=!1){this.__setLabelIdToAriaAttribute(t,e?this.__labelIdFromUser:this.__labelId,e),e?this.__labelIdFromUser=t:this.__labelId=t}setErrorId(t){this.__setErrorIdToAriaAttribute(t,this.__errorId),this.__errorId=t}setHelperId(t){this.__setHelperIdToAriaAttribute(t,this.__helperId),this.__helperId=t}__setAriaLabelToAttribute(t){this.__target&&(t?(function(t,e){fs(t,e),ms(t,e)}(this.__target,"aria-labelledby"),this.__target.setAttribute("aria-label",t)):this.__label&&(function(t,e){if(!t)return;const i=ps(e),o=i.get(t);o&&0!==o.size?un(t,e,dn(o)):t.removeAttribute(e),i.delete(t)}(this.__target,"aria-labelledby"),this.__target.removeAttribute("aria-label")))}__setLabelIdToAriaAttribute(t,e,i){vs(this.__target,"aria-labelledby",{newId:t,oldId:e,fromUser:i})}__setErrorIdToAriaAttribute(t,e){vs(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setHelperIdToAriaAttribute(t,e){vs(this.__target,"aria-describedby",{newId:t,oldId:e,fromUser:!1})}__setAriaRequiredAttribute(t){this.__target&&(["input","textarea"].includes(this.__target.localName)||(t?this.__target.setAttribute("aria-required","true"):this.__target.removeAttribute("aria-required")))}}
|
|
1578
1578
|
/**
|
|
1579
1579
|
* @license
|
|
1580
1580
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1581
1581
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1582
|
-
*/const
|
|
1582
|
+
*/const bs=qi((t=>"function"==typeof t.prototype.addController?t:class extends t{constructor(){super(),this.__controllers=new Set}connectedCallback(){super.connectedCallback(),this.__controllers.forEach((t=>{t.hostConnected&&t.hostConnected()}))}disconnectedCallback(){super.disconnectedCallback(),this.__controllers.forEach((t=>{t.hostDisconnected&&t.hostDisconnected()}))}addController(t){this.__controllers.add(t),void 0!==this.$&&this.isConnected&&t.hostConnected&&t.hostConnected()}removeController(t){this.__controllers.delete(t)}})),ys=document.createElement("div");
|
|
1583
1583
|
/**
|
|
1584
1584
|
* @license
|
|
1585
1585
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1586
1586
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1587
|
-
*/let
|
|
1587
|
+
*/let ws;function xs(t,e={}){const i=e.mode||"polite",o=void 0===e.timeout?150:e.timeout;"alert"===i?(ys.removeAttribute("aria-live"),ys.removeAttribute("role"),ws=Kr.debounce(ws,Gr,(()=>{ys.setAttribute("role","alert")}))):(ws&&ws.cancel(),ys.removeAttribute("role"),ys.setAttribute("aria-live",i)),ys.textContent="",setTimeout((()=>{ys.textContent=t}),o)}
|
|
1588
1588
|
/**
|
|
1589
1589
|
* @license
|
|
1590
1590
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
1591
1591
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1592
|
-
*/
|
|
1592
|
+
*/ys.style.position="fixed",ys.style.clip="rect(0px, 0px, 0px, 0px)",ys.setAttribute("aria-live","polite"),document.body.appendChild(ys);class _s extends vn{constructor(t,e,i,o={}){super(t,e,i,Wt(Ht({},o),{useUniqueId:!0}))}initCustomNode(t){this.__updateNodeId(t),this.__notifyChange(t)}teardownNode(t){const e=this.getSlotChild();e&&e!==this.defaultNode?this.__notifyChange(e):(this.restoreDefaultNode(),this.updateDefaultNode(this.node))}attachDefaultNode(){const t=super.attachDefaultNode();return t&&this.__updateNodeId(t),t}restoreDefaultNode(){}updateDefaultNode(t){this.__notifyChange(t)}observeNode(t){this.__nodeObserver&&this.__nodeObserver.disconnect(),this.__nodeObserver=new MutationObserver((t=>{t.forEach((t=>{const e=t.target,i=e===this.node;"attributes"===t.type?i&&this.__updateNodeId(e):(i||e.parentElement===this.node)&&this.__notifyChange(this.node)}))})),this.__nodeObserver.observe(t,{attributes:!0,attributeFilter:["id"],childList:!0,subtree:!0,characterData:!0})}__hasContent(t){return!!t&&(t.nodeType===Node.ELEMENT_NODE&&(customElements.get(t.localName)||t.children.length>0)||t.textContent&&""!==t.textContent.trim())}__notifyChange(t){this.dispatchEvent(new CustomEvent("slot-content-changed",{detail:{hasContent:this.__hasContent(t),node:t}}))}__updateNodeId(t){t.nodeType===Node.ELEMENT_NODE&&(!this.multiple||!this.nodes||t===this.nodes[0])&&!t.id&&(t.id=this.defaultId)}}
|
|
1593
1593
|
/**
|
|
1594
1594
|
* @license
|
|
1595
1595
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1596
1596
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1597
|
-
*/class
|
|
1597
|
+
*/class ks extends _s{constructor(t){super(t,"error-message","div")}setErrorMessage(t){this.errorMessage=t,this.updateDefaultNode(this.node)}setInvalid(t){this.invalid=t,this.updateDefaultNode(this.node)}initAddedNode(t){t!==this.defaultNode&&this.initCustomNode(t)}initNode(t){this.updateDefaultNode(t)}initCustomNode(t){t.textContent&&!this.errorMessage&&(this.errorMessage=t.textContent.trim()),super.initCustomNode(t)}restoreDefaultNode(){this.attachDefaultNode()}updateDefaultNode(t){const{errorMessage:e,invalid:i}=this,o=!(!i||!e||""===e.trim());t&&(t.textContent=o?e:"",t.hidden=!o,o&&xs(e,{mode:"assertive"})),super.updateDefaultNode(t)}}
|
|
1598
1598
|
/**
|
|
1599
1599
|
* @license
|
|
1600
1600
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1601
1601
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1602
|
-
*/class
|
|
1602
|
+
*/class Cs extends _s{constructor(t){super(t,"helper",null)}setHelperText(t){this.helperText=t,this.getSlotChild()||this.restoreDefaultNode(),this.node===this.defaultNode&&this.updateDefaultNode(this.node)}restoreDefaultNode(){const{helperText:t}=this;if(t&&""!==t.trim()){this.tagName="div";const t=this.attachDefaultNode();this.observeNode(t)}}updateDefaultNode(t){t&&(t.textContent=this.helperText),super.updateDefaultNode(t)}initCustomNode(t){super.initCustomNode(t),this.observeNode(t)}}
|
|
1603
1603
|
/**
|
|
1604
1604
|
* @license
|
|
1605
1605
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1606
1606
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1607
|
-
*/class
|
|
1607
|
+
*/class Ss extends _s{constructor(t){super(t,"label","label")}setLabel(t){this.label=t,this.getSlotChild()||this.restoreDefaultNode(),this.node===this.defaultNode&&this.updateDefaultNode(this.node)}restoreDefaultNode(){const{label:t}=this;if(t&&""!==t.trim()){const t=this.attachDefaultNode();this.observeNode(t)}}updateDefaultNode(t){t&&(t.textContent=this.label),super.updateDefaultNode(t)}initCustomNode(t){super.initCustomNode(t),this.observeNode(t)}}
|
|
1608
1608
|
/**
|
|
1609
1609
|
* @license
|
|
1610
1610
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1611
1611
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1612
|
-
*/const
|
|
1612
|
+
*/const Ts=qi((t=>class extends(bs(t)){static get properties(){return{label:{type:String,observer:"_labelChanged"}}}constructor(){super(),this._labelController=new Ss(this),this._labelController.addEventListener("slot-content-changed",(t=>{this.toggleAttribute("has-label",t.detail.hasContent)}))}get _labelId(){const t=this._labelNode;return t&&t.id}get _labelNode(){return this._labelController.node}ready(){super.ready(),this.addController(this._labelController)}_labelChanged(t){this._labelController.setLabel(t)}})),As=qi((t=>class extends t{static get properties(){return{invalid:{type:Boolean,reflectToAttribute:!0,notify:!0,value:!1},required:{type:Boolean,reflectToAttribute:!0}}}validate(){const t=this.checkValidity();return this._setInvalid(!t),this.dispatchEvent(new CustomEvent("validated",{detail:{valid:t}})),t}checkValidity(){return!this.required||!!this.value}_setInvalid(t){this._shouldSetInvalid(t)&&(this.invalid=t)}_shouldSetInvalid(t){return!0}})),zs=t=>class extends(As(Ts(bs(t)))){static get properties(){return{ariaTarget:{type:Object,observer:"_ariaTargetChanged"},errorMessage:{type:String,observer:"_errorMessageChanged"},helperText:{type:String,observer:"_helperTextChanged"},accessibleName:{type:String,observer:"_accessibleNameChanged"},accessibleNameRef:{type:String,observer:"_accessibleNameRefChanged"}}}static get observers(){return["_invalidChanged(invalid)","_requiredChanged(required)"]}constructor(){super(),this._fieldAriaController=new gs(this),this._helperController=new Cs(this),this._errorController=new ks(this),this._errorController.addEventListener("slot-content-changed",(t=>{this.toggleAttribute("has-error-message",t.detail.hasContent)})),this._labelController.addEventListener("slot-content-changed",(t=>{const{hasContent:e,node:i}=t.detail;this.__labelChanged(e,i)})),this._helperController.addEventListener("slot-content-changed",(t=>{const{hasContent:e,node:i}=t.detail;this.toggleAttribute("has-helper",e),this.__helperChanged(e,i)}))}get _errorNode(){return this._errorController.node}get _helperNode(){return this._helperController.node}ready(){super.ready(),this.addController(this._fieldAriaController),this.addController(this._helperController),this.addController(this._errorController)}__helperChanged(t,e){this._fieldAriaController.setHelperId(t?e.id:null)}_accessibleNameChanged(t){this._fieldAriaController.setAriaLabel(t)}_accessibleNameRefChanged(t){this._fieldAriaController.setLabelId(t,!0)}__labelChanged(t,e){this._fieldAriaController.setLabelId(t?e.id:null)}_errorMessageChanged(t){this._errorController.setErrorMessage(t)}_helperTextChanged(t){this._helperController.setHelperText(t)}_ariaTargetChanged(t){t&&this._fieldAriaController.setTarget(t)}_requiredChanged(t){this._fieldAriaController.setRequired(t)}_invalidChanged(t){this._errorController.setInvalid(t),setTimeout((()=>{if(t){const t=this._errorNode;this._fieldAriaController.setErrorId(t&&t.id)}else this._fieldAriaController.setErrorId(null)}))}}
|
|
1613
1613
|
/**
|
|
1614
1614
|
* @license
|
|
1615
1615
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -1619,17 +1619,17 @@ class us{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1619
1619
|
* @license
|
|
1620
1620
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1621
1621
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1622
|
-
*/class
|
|
1622
|
+
*/class Is extends vn{constructor(t,e,i={}){const{uniqueIdPrefix:o}=i;super(t,"input","input",{initializer:(t,i)=>{i.value&&(t.value=i.value),i.type&&t.setAttribute("type",i.type),t.id=this.defaultId,"function"==typeof e&&e(t)},useUniqueId:!0,uniqueIdPrefix:o})}}
|
|
1623
1623
|
/**
|
|
1624
1624
|
* @license
|
|
1625
1625
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
1626
1626
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1627
|
-
*/class
|
|
1627
|
+
*/class Ms{constructor(t,e){this.input=t,this.__preventDuplicateLabelClick=this.__preventDuplicateLabelClick.bind(this),e.addEventListener("slot-content-changed",(t=>{this.__initLabel(t.detail.node)})),this.__initLabel(e.node)}__initLabel(t){t&&(t.addEventListener("click",this.__preventDuplicateLabelClick),this.input&&t.setAttribute("for",this.input.id))}__preventDuplicateLabelClick(){const t=e=>{e.stopImmediatePropagation(),this.input.removeEventListener("click",t)};this.input.addEventListener("click",t)}}
|
|
1628
1628
|
/**
|
|
1629
1629
|
* @license
|
|
1630
1630
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1631
1631
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1632
|
-
*/const
|
|
1632
|
+
*/const Ds=t=>class extends(zs(ds(ls(Jn(t))))){static get properties(){return{indeterminate:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},name:{type:String,value:""},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},tabindex:{type:Number,value:0,reflectToAttribute:!0}}}static get observers(){return["__readonlyChanged(readonly, inputElement)"]}static get delegateProps(){return[...super.delegateProps,"indeterminate"]}static get delegateAttrs(){return[...super.delegateAttrs,"name","invalid","required"]}constructor(){super(),this._setType("checkbox"),this._boundOnInputClick=this._onInputClick.bind(this),this.value="on"}ready(){super.ready(),this.addController(new Is(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new Ms(this.inputElement,this._labelController)),this._createMethodObserver("_checkedChanged(checked)")}_shouldSetActive(t){return!this.readonly&&"a"!==t.target.localName&&t.target!==this._helperNode&&t.target!==this._errorNode&&super._shouldSetActive(t)}_addInputListeners(t){super._addInputListeners(t),t.addEventListener("click",this._boundOnInputClick)}_removeInputListeners(t){super._removeInputListeners(t),t.removeEventListener("click",this._boundOnInputClick)}_onInputClick(t){this.readonly&&t.preventDefault()}__readonlyChanged(t,e){e&&(t?e.setAttribute("aria-readonly","true"):e.removeAttribute("aria-readonly"))}_toggleChecked(t){this.indeterminate&&(this.indeterminate=!1),super._toggleChecked(t)}checkValidity(){return!this.required||!!this.checked}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_checkedChanged(t){(t||this.__oldChecked)&&this.validate(),this.__oldChecked=t}_requiredChanged(t){super._requiredChanged(t),!1===t&&this.validate()}_onRequiredIndicatorClick(){this._labelNode.click()}}
|
|
1633
1633
|
/**
|
|
1634
1634
|
* @license
|
|
1635
1635
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -1640,7 +1640,7 @@ class us{constructor(t){this.host=t,this.__required=!1}setTarget(t){this.__targe
|
|
|
1640
1640
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1641
1641
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1642
1642
|
*/
|
|
1643
|
-
|
|
1643
|
+
fi("vaadin-checkbox",ee`
|
|
1644
1644
|
:host {
|
|
1645
1645
|
display: inline-block;
|
|
1646
1646
|
}
|
|
@@ -1728,7 +1728,7 @@ ci("vaadin-checkbox",Xt`
|
|
|
1728
1728
|
outline-width: 2px;
|
|
1729
1729
|
}
|
|
1730
1730
|
}
|
|
1731
|
-
`,{moduleId:"vaadin-checkbox-styles"});class
|
|
1731
|
+
`,{moduleId:"vaadin-checkbox-styles"});class Ns extends(Ds(ln(wi(jr)))){static get is(){return"vaadin-checkbox"}static get template(){return Pr`
|
|
1732
1732
|
<div class="vaadin-checkbox-container">
|
|
1733
1733
|
<div part="checkbox" aria-hidden="true"></div>
|
|
1734
1734
|
<slot name="input"></slot>
|
|
@@ -1744,13 +1744,13 @@ ci("vaadin-checkbox",Xt`
|
|
|
1744
1744
|
</div>
|
|
1745
1745
|
</div>
|
|
1746
1746
|
<slot name="tooltip"></slot>
|
|
1747
|
-
`}ready(){super.ready(),this._tooltipController=new
|
|
1747
|
+
`}ready(){super.ready(),this._tooltipController=new gn(this),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}Yt(Ns);
|
|
1748
1748
|
/**
|
|
1749
1749
|
* @license
|
|
1750
1750
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1751
1751
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1752
1752
|
*/
|
|
1753
|
-
const
|
|
1753
|
+
const Os=ee`
|
|
1754
1754
|
:host {
|
|
1755
1755
|
--_helper-spacing: var(--vaadin-input-field-helper-spacing, 0.4em);
|
|
1756
1756
|
}
|
|
@@ -1811,7 +1811,7 @@ const zs=Xt`
|
|
|
1811
1811
|
* @license
|
|
1812
1812
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
1813
1813
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1814
|
-
*/,
|
|
1814
|
+
*/,Es=ee`
|
|
1815
1815
|
[part='label'] {
|
|
1816
1816
|
align-self: flex-start;
|
|
1817
1817
|
color: var(--vaadin-input-field-label-color, var(--lumo-secondary-text-color));
|
|
@@ -1923,7 +1923,7 @@ const zs=Xt`
|
|
|
1923
1923
|
margin-left: 0;
|
|
1924
1924
|
margin-right: calc(var(--lumo-border-radius-m) / 4);
|
|
1925
1925
|
}
|
|
1926
|
-
`;
|
|
1926
|
+
`;fi("",Es,{moduleId:"lumo-required-field"}),fi("vaadin-checkbox-group",[Es,Os,ee`
|
|
1927
1927
|
:host {
|
|
1928
1928
|
color: var(--lumo-body-text-color);
|
|
1929
1929
|
font-size: var(--lumo-font-size-m);
|
|
@@ -1972,7 +1972,7 @@ const zs=Xt`
|
|
|
1972
1972
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
1973
1973
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1974
1974
|
*/
|
|
1975
|
-
const
|
|
1975
|
+
const Ps=t=>class extends(zs(ss(Gn(t)))){static get properties(){return{value:{type:Array,value:()=>[],notify:!0,sync:!0,observer:"__valueChanged"},readonly:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"__readonlyChanged"}}}constructor(){super(),this.__registerCheckbox=this.__registerCheckbox.bind(this),this.__unregisterCheckbox=this.__unregisterCheckbox.bind(this),this.__onCheckboxCheckedChanged=this.__onCheckboxCheckedChanged.bind(this),this._tooltipController=new gn(this),this._tooltipController.addEventListener("tooltip-changed",(t=>{const e=t.detail.node;if(e&&e.isConnected){const t=this.__checkboxes.map((t=>t.inputElement));this._tooltipController.setAriaTarget(t)}else this._tooltipController.setAriaTarget([])}))}get __checkboxes(){return this.__filterCheckboxes([...this.children])}ready(){super.ready(),this.ariaTarget=this,this.setAttribute("role","group");const t=this.shadowRoot.querySelector("slot:not([name])");this._observer=new pn(t,(({addedNodes:t,removedNodes:e})=>{const i=this.__filterCheckboxes(t),o=this.__filterCheckboxes(e);i.forEach(this.__registerCheckbox),o.forEach(this.__unregisterCheckbox);const r=this.__checkboxes.map((t=>t.inputElement));this._tooltipController.setAriaTarget(r),this.__warnOfCheckboxesWithoutValue(i)})),this.addController(this._tooltipController)}checkValidity(){return!this.required||!!(this.value&&this.value.length>0)}__filterCheckboxes(t){return t.filter((t=>t.nodeType===Node.ELEMENT_NODE&&"vaadin-checkbox"===t.localName))}__warnOfCheckboxesWithoutValue(t){t.some((t=>{const{value:e}=t;return!(t.hasAttribute("value")||e&&"on"!==e)}))&&console.warn("Please provide the value attribute to all the checkboxes inside the checkbox group.")}__registerCheckbox(t){t.addEventListener("checked-changed",this.__onCheckboxCheckedChanged),this.disabled&&(t.disabled=!0),this.readonly&&(t.readonly=!0),t.checked?this.__addCheckboxToValue(t.value):this.value&&this.value.includes(t.value)&&(t.checked=!0)}__unregisterCheckbox(t){t.removeEventListener("checked-changed",this.__onCheckboxCheckedChanged),t.checked&&this.__removeCheckboxFromValue(t.value)}_disabledChanged(t,e){super._disabledChanged(t,e),(t||void 0!==e)&&e!==t&&this.__checkboxes.forEach((e=>{e.disabled=t}))}__addCheckboxToValue(t){this.value?this.value.includes(t)||(this.value=[...this.value,t]):this.value=[t]}__removeCheckboxFromValue(t){this.value&&this.value.includes(t)&&(this.value=this.value.filter((e=>e!==t)))}__onCheckboxCheckedChanged(t){const e=t.target;e.checked?this.__addCheckboxToValue(e.value):this.__removeCheckboxFromValue(e.value)}__valueChanged(t,e){t&&0===t.length&&void 0===e||(this.toggleAttribute("has-value",t&&t.length>0),this.__checkboxes.forEach((e=>{e.checked=t&&t.includes(e.value)})),void 0!==e&&this.validate())}__readonlyChanged(t,e){(t||e)&&this.__checkboxes.forEach((e=>{e.readonly=t}))}_shouldRemoveFocus(t){return!this.contains(t.relatedTarget)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}}
|
|
1976
1976
|
/**
|
|
1977
1977
|
* @license
|
|
1978
1978
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
@@ -1983,7 +1983,7 @@ const Ms=t=>class extends(ks(es(Un(t)))){static get properties(){return{value:{t
|
|
|
1983
1983
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
1984
1984
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
1985
1985
|
*/
|
|
1986
|
-
|
|
1986
|
+
fi("vaadin-checkbox-group",ee`
|
|
1987
1987
|
:host {
|
|
1988
1988
|
display: inline-flex;
|
|
1989
1989
|
}
|
|
@@ -2012,7 +2012,7 @@ ci("vaadin-checkbox-group",Xt`
|
|
|
2012
2012
|
:host(:not([has-label])) [part='label'] {
|
|
2013
2013
|
display: none;
|
|
2014
2014
|
}
|
|
2015
|
-
`,{moduleId:"vaadin-checkbox-group-styles"});class
|
|
2015
|
+
`,{moduleId:"vaadin-checkbox-group-styles"});class Bs extends(Ps(ln(wi(jr)))){static get is(){return"vaadin-checkbox-group"}static get template(){return Pr`
|
|
2016
2016
|
<div class="vaadin-group-field-container">
|
|
2017
2017
|
<div part="label">
|
|
2018
2018
|
<slot name="label"></slot>
|
|
@@ -2033,13 +2033,13 @@ ci("vaadin-checkbox-group",Xt`
|
|
|
2033
2033
|
</div>
|
|
2034
2034
|
|
|
2035
2035
|
<slot name="tooltip"></slot>
|
|
2036
|
-
`}}
|
|
2036
|
+
`}}Yt(Bs);
|
|
2037
2037
|
/**
|
|
2038
2038
|
* @license
|
|
2039
2039
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
2040
2040
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2041
2041
|
*/
|
|
2042
|
-
const
|
|
2042
|
+
const js=ee`
|
|
2043
2043
|
:host {
|
|
2044
2044
|
top: var(--lumo-space-m);
|
|
2045
2045
|
right: var(--lumo-space-m);
|
|
@@ -2104,13 +2104,13 @@ const Ns=Xt`
|
|
|
2104
2104
|
opacity: 1;
|
|
2105
2105
|
}
|
|
2106
2106
|
}
|
|
2107
|
-
`;
|
|
2107
|
+
`;fi("",js,{moduleId:"lumo-overlay"});
|
|
2108
2108
|
/**
|
|
2109
2109
|
* @license
|
|
2110
2110
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
2111
2111
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
2112
2112
|
*/
|
|
2113
|
-
const
|
|
2113
|
+
const Ls=ee`
|
|
2114
2114
|
:host([opening]),
|
|
2115
2115
|
:host([closing]) {
|
|
2116
2116
|
animation: 0.14s lumo-overlay-dummy-animation;
|
|
@@ -2140,7 +2140,7 @@ const Os=Xt`
|
|
|
2140
2140
|
opacity: 0;
|
|
2141
2141
|
}
|
|
2142
2142
|
}
|
|
2143
|
-
`;
|
|
2143
|
+
`;fi("",Ls,{moduleId:"lumo-menu-overlay-core"});const $s=[js,Ls,ee`
|
|
2144
2144
|
/* Small viewport (bottom sheet) styles */
|
|
2145
2145
|
/* Use direct media queries instead of the state attributes ([phone] and [fullscreen]) provided by the elements */
|
|
2146
2146
|
@media (max-width: 450px), (max-height: 450px) {
|
|
@@ -2202,7 +2202,7 @@ const Os=Xt`
|
|
|
2202
2202
|
transform: translateY(150%);
|
|
2203
2203
|
}
|
|
2204
2204
|
}
|
|
2205
|
-
`];
|
|
2205
|
+
`];fi("",$s,{moduleId:"lumo-menu-overlay"}),fi("vaadin-date-picker-overlay",[$s,ee`
|
|
2206
2206
|
[part='overlay'] {
|
|
2207
2207
|
/*
|
|
2208
2208
|
Width:
|
|
@@ -2247,7 +2247,7 @@ const Os=Xt`
|
|
|
2247
2247
|
max-height: 70vh;
|
|
2248
2248
|
}
|
|
2249
2249
|
}
|
|
2250
|
-
`],{moduleId:"lumo-date-picker-overlay"});const
|
|
2250
|
+
`],{moduleId:"lumo-date-picker-overlay"});const Fs=ee`
|
|
2251
2251
|
:host {
|
|
2252
2252
|
/* Sizing */
|
|
2253
2253
|
--lumo-button-size: var(--lumo-size-m);
|
|
@@ -2523,7 +2523,7 @@ const Os=Xt`
|
|
|
2523
2523
|
margin-left: 0;
|
|
2524
2524
|
margin-right: 0;
|
|
2525
2525
|
}
|
|
2526
|
-
`;
|
|
2526
|
+
`;fi("vaadin-button",Fs,{moduleId:"lumo-button"}),fi("vaadin-date-picker-year",ee`
|
|
2527
2527
|
:host([current]) [part='year-number'] {
|
|
2528
2528
|
color: var(--lumo-primary-text-color);
|
|
2529
2529
|
}
|
|
@@ -2547,7 +2547,7 @@ const Os=Xt`
|
|
|
2547
2547
|
color: var(--lumo-disabled-text-color);
|
|
2548
2548
|
content: '\\2022';
|
|
2549
2549
|
}
|
|
2550
|
-
`,{moduleId:"lumo-date-picker-year"}),
|
|
2550
|
+
`,{moduleId:"lumo-date-picker-year"}),fi("vaadin-date-picker-overlay-content",ee`
|
|
2551
2551
|
:host {
|
|
2552
2552
|
position: relative;
|
|
2553
2553
|
/* Background for the year scroller, placed here as we are using a mask image on the actual years part */
|
|
@@ -2697,7 +2697,7 @@ const Os=Xt`
|
|
|
2697
2697
|
padding-left: 50px;
|
|
2698
2698
|
}
|
|
2699
2699
|
}
|
|
2700
|
-
`,{moduleId:"lumo-date-picker-overlay-content"}),
|
|
2700
|
+
`,{moduleId:"lumo-date-picker-overlay-content"}),fi("vaadin-month-calendar",ee`
|
|
2701
2701
|
:host {
|
|
2702
2702
|
-moz-user-select: none;
|
|
2703
2703
|
-webkit-user-select: none;
|
|
@@ -2844,7 +2844,7 @@ const Os=Xt`
|
|
|
2844
2844
|
:host([disabled]) * {
|
|
2845
2845
|
color: var(--lumo-disabled-text-color) !important;
|
|
2846
2846
|
}
|
|
2847
|
-
`,{moduleId:"lumo-month-calendar"}),
|
|
2847
|
+
`,{moduleId:"lumo-month-calendar"}),fi("vaadin-input-container",ee`
|
|
2848
2848
|
:host {
|
|
2849
2849
|
background: var(--_background);
|
|
2850
2850
|
padding: 0 calc(0.375em + var(--_input-container-radius) / 4 - 1px);
|
|
@@ -3028,7 +3028,7 @@ const Os=Xt`
|
|
|
3028
3028
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3029
3029
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3030
3030
|
*/
|
|
3031
|
-
const
|
|
3031
|
+
const Rs=ee`
|
|
3032
3032
|
[part$='button'] {
|
|
3033
3033
|
flex: none;
|
|
3034
3034
|
width: 1em;
|
|
@@ -3055,13 +3055,13 @@ const Bs=Xt`
|
|
|
3055
3055
|
font-family: 'lumo-icons';
|
|
3056
3056
|
display: block;
|
|
3057
3057
|
}
|
|
3058
|
-
`;
|
|
3058
|
+
`;fi("",Rs,{moduleId:"lumo-field-button"});
|
|
3059
3059
|
/**
|
|
3060
3060
|
* @license
|
|
3061
3061
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3062
3062
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3063
3063
|
*/
|
|
3064
|
-
const
|
|
3064
|
+
const Us=[Es,Rs,Os,ee`
|
|
3065
3065
|
:host {
|
|
3066
3066
|
--lumo-text-field-size: var(--lumo-size-m);
|
|
3067
3067
|
color: var(--vaadin-input-field-value-color, var(--lumo-body-text-color));
|
|
@@ -3192,7 +3192,7 @@ const js=[Is,Bs,zs,Xt`
|
|
|
3192
3192
|
[part='clear-button']::before {
|
|
3193
3193
|
content: var(--lumo-icons-cross);
|
|
3194
3194
|
}
|
|
3195
|
-
`];
|
|
3195
|
+
`];fi("",Us,{moduleId:"lumo-input-field-shared-styles"}),fi("vaadin-date-picker",[Us,ee`
|
|
3196
3196
|
[part='toggle-button']::before {
|
|
3197
3197
|
content: var(--lumo-icons-calendar);
|
|
3198
3198
|
}
|
|
@@ -3220,7 +3220,7 @@ const js=[Is,Bs,zs,Xt`
|
|
|
3220
3220
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3221
3221
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3222
3222
|
*/
|
|
3223
|
-
const
|
|
3223
|
+
const Vs=t=>class extends t{static get properties(){return{disabled:{type:Boolean,reflectToAttribute:!0},readonly:{type:Boolean,reflectToAttribute:!0},invalid:{type:Boolean,reflectToAttribute:!0}}}ready(){super.ready(),this.addEventListener("pointerdown",(t=>{t.target===this&&t.preventDefault()})),this.addEventListener("click",(t=>{t.target===this&&this.shadowRoot.querySelector("slot:not([name])").assignedNodes({flatten:!0}).forEach((t=>t.focus&&t.focus()))}))}}
|
|
3224
3224
|
/**
|
|
3225
3225
|
* @license
|
|
3226
3226
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
@@ -3231,7 +3231,7 @@ const Ls=t=>class extends t{static get properties(){return{disabled:{type:Boolea
|
|
|
3231
3231
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3232
3232
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3233
3233
|
*/
|
|
3234
|
-
|
|
3234
|
+
fi("vaadin-input-container",ee`
|
|
3235
3235
|
:host {
|
|
3236
3236
|
display: flex;
|
|
3237
3237
|
align-items: center;
|
|
@@ -3296,17 +3296,17 @@ ci("vaadin-input-container",Xt`
|
|
|
3296
3296
|
/* Override default opacity in Firefox */
|
|
3297
3297
|
opacity: 1;
|
|
3298
3298
|
}
|
|
3299
|
-
`,{moduleId:"vaadin-input-container-styles"});class
|
|
3299
|
+
`,{moduleId:"vaadin-input-container-styles"});class Hs extends(Vs(wi(nn(jr)))){static get is(){return"vaadin-input-container"}static get template(){return Pr`
|
|
3300
3300
|
<slot name="prefix"></slot>
|
|
3301
3301
|
<slot></slot>
|
|
3302
3302
|
<slot name="suffix"></slot>
|
|
3303
|
-
`}}
|
|
3303
|
+
`}}Yt(Hs);
|
|
3304
3304
|
/**
|
|
3305
3305
|
* @license
|
|
3306
3306
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3307
3307
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3308
3308
|
*/
|
|
3309
|
-
const
|
|
3309
|
+
const Ws=ee`
|
|
3310
3310
|
:host {
|
|
3311
3311
|
z-index: 200;
|
|
3312
3312
|
position: fixed;
|
|
@@ -3374,62 +3374,62 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
3374
3374
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
3375
3375
|
Code distributed by Google as part of the polymer project is also
|
|
3376
3376
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3377
|
-
*/;let
|
|
3377
|
+
*/;let qs=!1,Gs=[],Ys=[];function Js(t){const e=t[0],i=t[1],o=t[2];try{i.apply(e,o)}catch(t){setTimeout((()=>{throw t}))}}function Xs(t,e,i){qs||(qs=!0,requestAnimationFrame((function(){qs=!1,function(t){for(;t.length;)Js(t.shift())}(Gs),setTimeout((function(){!function(t){for(let e=0,i=t.length;e<i;e++)Js(t.shift())}(Ys)}))}))),Ys.push([t,e,i])
|
|
3378
3378
|
/**
|
|
3379
3379
|
* @license
|
|
3380
3380
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3381
3381
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3382
|
-
*/}const
|
|
3382
|
+
*/}const Ks=t=>t.test(navigator.userAgent),Zs=t=>t.test(navigator.platform);Ks(/Android/u),Ks(/Chrome/u)&&/Google Inc/u.test(navigator.vendor),Ks(/Firefox/u);const Qs=Zs(/^iPad/u)||Zs(/^Mac/u)&&navigator.maxTouchPoints>1,ta=Zs(/^iPhone/u)||Qs,ea=Ks(/^((?!chrome|android).)*safari/iu),ia=(()=>{try{return document.createEvent("TouchEvent"),!0}catch(t){return!1}})();
|
|
3383
3383
|
/**
|
|
3384
3384
|
* @license
|
|
3385
3385
|
* Copyright (c) 2017 Anton Korzunov
|
|
3386
3386
|
* SPDX-License-Identifier: MIT
|
|
3387
|
-
*/let
|
|
3387
|
+
*/let oa=new WeakMap,ra=new WeakMap,na={},sa=0;const aa=t=>t&&t.nodeType===Node.ELEMENT_NODE,la=(...t)=>{console.error(`Error: ${t.join(" ")}. Skip setting aria-hidden.`)},ha=(t,e=document.body,i="data-aria-hidden")=>{const o=Array.from(Array.isArray(t)?t:[t]);return e&&o.push(...Array.from(e.querySelectorAll("[aria-live]"))),((t,e,i,o)=>{const r=((t,e)=>aa(t)?e.map((e=>{if(!aa(e))return la(e,"is not a valid element"),null;let i=e;for(;i&&i!==t;){if(t.contains(i))return e;i=i.getRootNode().host}return la(e,"is not contained inside",t),null})).filter((t=>!!t)):(la(t,"is not a valid element"),[]))(e,Array.isArray(t)?t:[t]);na[i]||(na[i]=new WeakMap);const n=na[i],s=[],a=new Set,l=new Set(r),h=t=>{if(!t||a.has(t))return;a.add(t);const e=t.assignedSlot;e&&h(e),h(t.parentNode||t.host)};r.forEach(h);const c=t=>{if(!t||l.has(t))return;const e=t.shadowRoot;(e?[...t.children,...e.children]:[...t.children]).forEach((t=>{if(!["template","script","style"].includes(t.localName))if(a.has(t))c(t);else{const e=t.getAttribute(o),r=null!==e&&"false"!==e,a=(oa.get(t)||0)+1,l=(n.get(t)||0)+1;oa.set(t,a),n.set(t,l),s.push(t),1===a&&r&&ra.set(t,!0),1===l&&t.setAttribute(i,"true"),r||t.setAttribute(o,"true")}}))};return c(e),a.clear(),sa+=1,()=>{s.forEach((t=>{const e=oa.get(t)-1,r=n.get(t)-1;oa.set(t,e),n.set(t,r),e||(ra.has(t)?ra.delete(t):t.removeAttribute(o)),r||t.removeAttribute(i)})),sa-=1,sa||(oa=new WeakMap,oa=new WeakMap,ra=new WeakMap,na={})}})(o,e,i,"aria-hidden")
|
|
3388
3388
|
/**
|
|
3389
3389
|
* @license
|
|
3390
3390
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3391
3391
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3392
|
-
*/};class
|
|
3392
|
+
*/};class ca{constructor(t,e){this.host=t,this.callback="function"==typeof e?e:()=>t}showModal(){const t=this.callback();this.__showOthers=ha(t)}close(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null)}}
|
|
3393
3393
|
/**
|
|
3394
3394
|
* @license
|
|
3395
3395
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3396
3396
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3397
|
-
*/class
|
|
3397
|
+
*/class da{saveFocus(t){this.focusNode=t||Kn()}restoreFocus(t){const e=this.focusNode;if(!e)return;const i=!!t&&t.preventScroll;Kn()===document.body?setTimeout((()=>e.focus({preventScroll:i}))):e.focus({preventScroll:i}),this.focusNode=null}}
|
|
3398
3398
|
/**
|
|
3399
3399
|
* @license
|
|
3400
3400
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3401
3401
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3402
|
-
*/const
|
|
3402
|
+
*/const ua=[];class pa{constructor(t){this.host=t,this.__trapNode=null,this.__onKeyDown=this.__onKeyDown.bind(this)}get __focusableElements(){return function(t){const e=[];return ns(t,e)?es(e):e}(this.__trapNode)}get __focusedElementIndex(){const t=this.__focusableElements;return t.indexOf(t.filter(rs).pop())}hostConnected(){document.addEventListener("keydown",this.__onKeyDown)}hostDisconnected(){document.removeEventListener("keydown",this.__onKeyDown)}trapFocus(t){if(this.__trapNode=t,0===this.__focusableElements.length)throw this.__trapNode=null,new Error("The trap node should have at least one focusable descendant or be focusable itself.");ua.push(this),-1===this.__focusedElementIndex&&this.__focusableElements[0].focus()}releaseFocus(){this.__trapNode=null,ua.pop()}__onKeyDown(t){this.__trapNode&&this===Array.from(ua).pop()&&"Tab"===t.key&&(t.preventDefault(),this.__focusNextElement(t.shiftKey))}__focusNextElement(t=!1){const e=this.__focusableElements,i=e[(e.length+this.__focusedElementIndex+(t?-1:1))%e.length];i.focus(),"input"===i.localName&&i.select()}}
|
|
3403
3403
|
/**
|
|
3404
3404
|
* @license
|
|
3405
3405
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3406
3406
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3407
|
-
*/const
|
|
3407
|
+
*/const ma=t=>class extends(bs(t)){static get properties(){return{focusTrap:{type:Boolean,value:!1},restoreFocusOnClose:{type:Boolean,value:!1},restoreFocusNode:{type:HTMLElement}}}constructor(){super(),this.__ariaModalController=new ca(this),this.__focusTrapController=new pa(this),this.__focusRestorationController=new da}ready(){super.ready(),this.addController(this.__ariaModalController),this.addController(this.__focusTrapController),this.addController(this.__focusRestorationController)}_resetFocus(){if(this.focusTrap&&(this.__ariaModalController.close(),this.__focusTrapController.releaseFocus()),this.restoreFocusOnClose&&this._shouldRestoreFocus()){const t=!Zn();this.__focusRestorationController.restoreFocus({preventScroll:t})}}_saveFocus(){this.restoreFocusOnClose&&this.__focusRestorationController.saveFocus(this.restoreFocusNode)}_trapFocus(){this.focusTrap&&(this.__ariaModalController.showModal(),this.__focusTrapController.trapFocus(this.$.overlay))}_shouldRestoreFocus(){const t=Kn();return t===document.body||this._deepContains(t)}_deepContains(t){if(this.contains(t))return!0;let e=t;const i=t.ownerDocument;for(;e&&e!==i&&e!==this;)e=e.parentNode||e.host;return e===this}}
|
|
3408
3408
|
/**
|
|
3409
3409
|
* @license
|
|
3410
3410
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3411
3411
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3412
|
-
*/,
|
|
3412
|
+
*/,fa=()=>Array.from(document.body.children).filter((t=>t instanceof HTMLElement&&t._hasOverlayStackMixin&&!t.hasAttribute("closing"))).sort(((t,e)=>t.__zIndex-e.__zIndex||0)),va=()=>fa().filter((t=>t.$.overlay)),ga=t=>class extends t{constructor(){super(),this._hasOverlayStackMixin=!0}get _last(){return(()=>this===va().pop())()}bringToFront(){let t="";const e=fa().filter((t=>t!==this)).pop();e&&(t=e.__zIndex+1),this.style.zIndex=t,this.__zIndex=t||parseFloat(getComputedStyle(this).zIndex)}_enterModalState(){"none"!==document.body.style.pointerEvents&&(this._previousDocumentPointerEvents=document.body.style.pointerEvents,document.body.style.pointerEvents="none"),va().forEach((t=>{t!==this&&(t.$.overlay.style.pointerEvents="none")}))}_exitModalState(){void 0!==this._previousDocumentPointerEvents&&(document.body.style.pointerEvents=this._previousDocumentPointerEvents,delete this._previousDocumentPointerEvents);const t=va();let e;for(;(e=t.pop())&&(e===this||(e.$.overlay.style.removeProperty("pointer-events"),e.modeless)););}}
|
|
3413
3413
|
/**
|
|
3414
3414
|
* @license
|
|
3415
3415
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3416
3416
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3417
|
-
*/,
|
|
3417
|
+
*/,ba=t=>class extends(ma(ga(t))){static get properties(){return{opened:{type:Boolean,notify:!0,observer:"_openedChanged",reflectToAttribute:!0},owner:{type:Object},model:{type:Object},renderer:{type:Object},modeless:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_modelessChanged"},hidden:{type:Boolean,reflectToAttribute:!0,observer:"_hiddenChanged"},withBackdrop:{type:Boolean,value:!1,reflectToAttribute:!0}}}static get observers(){return["_rendererOrDataChanged(renderer, owner, model, opened)"]}constructor(){super(),this._boundMouseDownListener=this._mouseDownListener.bind(this),this._boundMouseUpListener=this._mouseUpListener.bind(this),this._boundOutsideClickListener=this._outsideClickListener.bind(this),this._boundKeydownListener=this._keydownListener.bind(this),ta&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}ready(){super.ready(),this.addEventListener("click",(()=>{})),this.$.backdrop.addEventListener("click",(()=>{})),this.addEventListener("mouseup",(()=>{document.activeElement===document.body&&"0"===this.$.overlay.getAttribute("tabindex")&&this.$.overlay.focus()}))}connectedCallback(){super.connectedCallback(),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))}disconnectedCallback(){super.disconnectedCallback(),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener)}requestContentUpdate(){this.renderer&&this.renderer.call(this.owner,this,this.owner,this.model)}close(t){const e=new CustomEvent("vaadin-overlay-close",{bubbles:!0,cancelable:!0,detail:{sourceEvent:t}});this.dispatchEvent(e),e.defaultPrevented||(this.opened=!1)}_detectIosNavbar(){if(!this.opened)return;const t=window.innerHeight,e=window.innerWidth>t,i=document.documentElement.clientHeight;this.style.setProperty("--vaadin-overlay-viewport-bottom",e&&i>t?i-t+"px":"0")}_addGlobalListeners(){document.addEventListener("mousedown",this._boundMouseDownListener),document.addEventListener("mouseup",this._boundMouseUpListener),document.documentElement.addEventListener("click",this._boundOutsideClickListener,!0)}_removeGlobalListeners(){document.removeEventListener("mousedown",this._boundMouseDownListener),document.removeEventListener("mouseup",this._boundMouseUpListener),document.documentElement.removeEventListener("click",this._boundOutsideClickListener,!0)}_rendererOrDataChanged(t,e,i,o){const r=this._oldOwner!==e||this._oldModel!==i;this._oldModel=i,this._oldOwner=e;const n=this._oldRenderer!==t,s=void 0!==this._oldRenderer;this._oldRenderer=t;const a=this._oldOpened!==o;this._oldOpened=o,n&&s&&(this.innerHTML="",delete this._$litPart$),o&&t&&(n||a||r)&&this.requestContentUpdate()}_modelessChanged(t){t?(this._removeGlobalListeners(),this._exitModalState()):this.opened&&(this._addGlobalListeners(),this._enterModalState())}_openedChanged(t,e){t?(this._saveFocus(),this._animatedOpening(),Xs(this,(()=>{this._trapFocus();const t=new CustomEvent("vaadin-overlay-open",{bubbles:!0});this.dispatchEvent(t)})),document.addEventListener("keydown",this._boundKeydownListener),this.modeless||this._addGlobalListeners()):e&&(this._resetFocus(),this._animatedClosing(),document.removeEventListener("keydown",this._boundKeydownListener),this.modeless||this._removeGlobalListeners())}_hiddenChanged(t){t&&this.hasAttribute("closing")&&this._flushAnimation("closing")}_shouldAnimate(){const t=getComputedStyle(this),e=t.getPropertyValue("animation-name");return!("none"===t.getPropertyValue("display"))&&e&&"none"!==e}_enqueueAnimation(t,e){const i=`__${t}Handler`,o=t=>{t&&t.target!==this||(e(),this.removeEventListener("animationend",o),delete this[i])};this[i]=o,this.addEventListener("animationend",o)}_flushAnimation(t){const e=`__${t}Handler`;"function"==typeof this[e]&&this[e]()}_animatedOpening(){this.parentNode===document.body&&this.hasAttribute("closing")&&this._flushAnimation("closing"),this._attachOverlay(),this.modeless||this._enterModalState(),this.setAttribute("opening",""),this._shouldAnimate()?this._enqueueAnimation("opening",(()=>{this._finishOpening()})):this._finishOpening()}_attachOverlay(){this._placeholder=document.createComment("vaadin-overlay-placeholder"),this.parentNode.insertBefore(this._placeholder,this),document.body.appendChild(this),this.bringToFront()}_finishOpening(){this.removeAttribute("opening")}_finishClosing(){this._detachOverlay(),this.$.overlay.style.removeProperty("pointer-events"),this.removeAttribute("closing"),this.dispatchEvent(new CustomEvent("vaadin-overlay-closed"))}_animatedClosing(){this.hasAttribute("opening")&&this._flushAnimation("opening"),this._placeholder&&(this._exitModalState(),this.setAttribute("closing",""),this.dispatchEvent(new CustomEvent("vaadin-overlay-closing")),this._shouldAnimate()?this._enqueueAnimation("closing",(()=>{this._finishClosing()})):this._finishClosing())}_detachOverlay(){this._placeholder.parentNode.insertBefore(this,this._placeholder),this._placeholder.parentNode.removeChild(this._placeholder)}_mouseDownListener(t){this._mouseDownInside=t.composedPath().indexOf(this.$.overlay)>=0}_mouseUpListener(t){this._mouseUpInside=t.composedPath().indexOf(this.$.overlay)>=0}_shouldCloseOnOutsideClick(t){return this._last}_outsideClickListener(t){if(t.composedPath().includes(this.$.overlay)||this._mouseDownInside||this._mouseUpInside)return this._mouseDownInside=!1,void(this._mouseUpInside=!1);if(!this._shouldCloseOnOutsideClick(t))return;const e=new CustomEvent("vaadin-overlay-outside-click",{bubbles:!0,cancelable:!0,detail:{sourceEvent:t}});this.dispatchEvent(e),this.opened&&!e.defaultPrevented&&this.close(t)}_keydownListener(t){if(this._last&&(!this.modeless||t.composedPath().includes(this.$.overlay))&&"Escape"===t.key){const e=new CustomEvent("vaadin-overlay-escape-press",{bubbles:!0,cancelable:!0,detail:{sourceEvent:t}});this.dispatchEvent(e),this.opened&&!e.defaultPrevented&&this.close(t)}}}
|
|
3418
3418
|
/**
|
|
3419
3419
|
* @license
|
|
3420
3420
|
* Copyright (c) 2024 Vaadin Ltd.
|
|
3421
3421
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3422
|
-
*/,
|
|
3422
|
+
*/,ya={start:"top",end:"bottom"},wa={start:"left",end:"right"},xa=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.__overlay&&t.target.__overlay._updatePosition()}))}))})),_a=t=>class extends t{static get properties(){return{positionTarget:{type:Object,value:null,sync:!0},horizontalAlign:{type:String,value:"start",sync:!0},verticalAlign:{type:String,value:"top",sync:!0},noHorizontalOverlap:{type:Boolean,value:!1,sync:!0},noVerticalOverlap:{type:Boolean,value:!1,sync:!0},requiredVerticalSpace:{type:Number,value:0,sync:!0}}}static get observers(){return["__positionSettingsChanged(horizontalAlign, verticalAlign, noHorizontalOverlap, noVerticalOverlap, requiredVerticalSpace)","__overlayOpenedChanged(opened, positionTarget)"]}constructor(){super(),this.__onScroll=this.__onScroll.bind(this),this._updatePosition=this._updatePosition.bind(this)}connectedCallback(){super.connectedCallback(),this.opened&&this.__addUpdatePositionEventListeners()}disconnectedCallback(){super.disconnectedCallback(),this.__removeUpdatePositionEventListeners()}__addUpdatePositionEventListeners(){window.visualViewport.addEventListener("resize",this._updatePosition),window.visualViewport.addEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes=function(t){const e=[];for(;t;){if(t.nodeType===Node.DOCUMENT_NODE){e.push(t);break}t.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?t=t.assignedSlot?t.assignedSlot:t.parentNode:(e.push(t),t=t.host)}return e}(this.positionTarget),this.__positionTargetAncestorRootNodes.forEach((t=>{t.addEventListener("scroll",this.__onScroll,!0)})),this.positionTarget&&(this.__observePositionTargetMove=function(t,e){let i=null;const o=document.documentElement;function r(){i&&i.disconnect(),i=null}return function n(s=!1,a=1){r();const{left:l,top:h,width:c,height:d}=t.getBoundingClientRect();if(s||e(),!c||!d)return;const u={rootMargin:`${-Math.floor(h)}px ${-Math.floor(o.clientWidth-(l+c))}px ${-Math.floor(o.clientHeight-(h+d))}px ${-Math.floor(l)}px`,threshold:Math.max(0,Math.min(1,a))||1};let p=!0;i=new IntersectionObserver((function(t){let e=t[0].intersectionRatio;if(e!==a){if(!p)return n();0===e&&(e=1e-7),n(!1,e)}p=!1}),u),i.observe(t)}(!0),r}
|
|
3423
3423
|
/**
|
|
3424
3424
|
* @license
|
|
3425
3425
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3426
3426
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3427
|
-
*/(this.positionTarget,(()=>{this._updatePosition()})))}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((t=>{t.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null),this.__observePositionTargetMove&&(this.__observePositionTargetMove(),this.__observePositionTargetMove=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,
|
|
3427
|
+
*/(this.positionTarget,(()=>{this._updatePosition()})))}__removeUpdatePositionEventListeners(){window.visualViewport.removeEventListener("resize",this._updatePosition),window.visualViewport.removeEventListener("scroll",this.__onScroll,!0),this.__positionTargetAncestorRootNodes&&(this.__positionTargetAncestorRootNodes.forEach((t=>{t.removeEventListener("scroll",this.__onScroll,!0)})),this.__positionTargetAncestorRootNodes=null),this.__observePositionTargetMove&&(this.__observePositionTargetMove(),this.__observePositionTargetMove=null)}__overlayOpenedChanged(t,e){if(this.__removeUpdatePositionEventListeners(),e&&(e.__overlay=null,xa.unobserve(e),t&&(this.__addUpdatePositionEventListeners(),e.__overlay=this,xa.observe(e))),t){const t=getComputedStyle(this);this.__margins||(this.__margins={},["top","bottom","left","right"].forEach((e=>{this.__margins[e]=parseInt(t[e],10)}))),this._updatePosition(),requestAnimationFrame((()=>this._updatePosition()))}}__positionSettingsChanged(){this._updatePosition()}__onScroll(t){t.target instanceof Node&&this.contains(t.target)||this._updatePosition()}_updatePosition(){if(!this.positionTarget||!this.opened||!this.__margins)return;const t=this.positionTarget.getBoundingClientRect();if(0===t.width&&0===t.height&&this.opened)return void(this.opened=!1);const e=this.__shouldAlignStartVertically(t);this.style.justifyContent=e?"flex-start":"flex-end";const i=this.__isRTL,o=this.__shouldAlignStartHorizontally(t,i),r=!i&&o||i&&!o;this.style.alignItems=r?"flex-start":"flex-end";const n=this.getBoundingClientRect(),s=this.__calculatePositionInOneDimension(t,n,this.noVerticalOverlap,ya,this,e),a=this.__calculatePositionInOneDimension(t,n,this.noHorizontalOverlap,wa,this,o);Object.assign(this.style,s,a),this.toggleAttribute("bottom-aligned",!e),this.toggleAttribute("top-aligned",e),this.toggleAttribute("end-aligned",!r),this.toggleAttribute("start-aligned",r)}__shouldAlignStartHorizontally(t,e){const i=Math.max(this.__oldContentWidth||0,this.$.overlay.offsetWidth);this.__oldContentWidth=this.$.overlay.offsetWidth;const o=Math.min(window.innerWidth,document.documentElement.clientWidth);return this.__shouldAlignStart(t,i,o,this.__margins,!e&&"start"===this.horizontalAlign||e&&"end"===this.horizontalAlign,this.noHorizontalOverlap,wa)}__shouldAlignStartVertically(t){const e=this.requiredVerticalSpace||Math.max(this.__oldContentHeight||0,this.$.overlay.offsetHeight);this.__oldContentHeight=this.$.overlay.offsetHeight;const i=Math.min(window.innerHeight,document.documentElement.clientHeight);return this.__shouldAlignStart(t,e,i,this.__margins,"top"===this.verticalAlign,this.noVerticalOverlap,ya)}__shouldAlignStart(t,e,i,o,r,n,s){const a=i-t[n?s.end:s.start]-o[s.end],l=t[n?s.start:s.end]-o[s.start],h=r?a:l;return r===(h>(r?l:a)||h>e)}__adjustBottomProperty(t,e,i){let o;if(t===e.end){if(e.end===ya.end){const t=Math.min(window.innerHeight,document.documentElement.clientHeight);i>t&&this.__oldViewportHeight&&(o=i-(this.__oldViewportHeight-t)),this.__oldViewportHeight=t}if(e.end===wa.end){const t=Math.min(window.innerWidth,document.documentElement.clientWidth);i>t&&this.__oldViewportWidth&&(o=i-(this.__oldViewportWidth-t)),this.__oldViewportWidth=t}}return o}__calculatePositionInOneDimension(t,e,i,o,r,n){const s=n?o.start:o.end,a=n?o.end:o.start,l=parseFloat(r.style[s]||getComputedStyle(r)[s]),h=this.__adjustBottomProperty(s,o,l),c=h?`${h}px`:`${l+(e[n?o.start:o.end]-t[i===n?o.end:o.start])*(n?-1:1)}px`;return{[s]:c,[a]:""}}}
|
|
3428
3428
|
/**
|
|
3429
3429
|
* @license
|
|
3430
3430
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
3431
3431
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3432
|
-
*/,
|
|
3432
|
+
*/,ka=t=>class extends(_a(ba(t))){_shouldCloseOnOutsideClick(t){return!t.composedPath().includes(this.positionTarget)}_mouseDownListener(t){super._mouseDownListener(t),this._shouldCloseOnOutsideClick(t)&&!os(t.composedPath()[0])&&t.preventDefault()}}
|
|
3433
3433
|
/**
|
|
3434
3434
|
* @license
|
|
3435
3435
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3440,7 +3440,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
3440
3440
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3441
3441
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3442
3442
|
*/
|
|
3443
|
-
|
|
3443
|
+
fi("vaadin-date-picker-overlay",[Ws,ee`
|
|
3444
3444
|
[part='overlay'] {
|
|
3445
3445
|
display: flex;
|
|
3446
3446
|
flex: auto;
|
|
@@ -3455,20 +3455,20 @@ ci("vaadin-date-picker-overlay",[Fs,Xt`
|
|
|
3455
3455
|
outline: 3px solid;
|
|
3456
3456
|
}
|
|
3457
3457
|
}
|
|
3458
|
-
`],{moduleId:"vaadin-date-picker-overlay-styles"});class
|
|
3458
|
+
`],{moduleId:"vaadin-date-picker-overlay-styles"});class Ca extends(ka(nn(wi(jr)))){static get is(){return"vaadin-date-picker-overlay"}static get template(){return Pr`
|
|
3459
3459
|
<div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
3460
3460
|
<div part="overlay" id="overlay">
|
|
3461
3461
|
<div part="content" id="content">
|
|
3462
3462
|
<slot></slot>
|
|
3463
3463
|
</div>
|
|
3464
3464
|
</div>
|
|
3465
|
-
`}}
|
|
3465
|
+
`}}Yt(Ca);
|
|
3466
3466
|
/**
|
|
3467
3467
|
* @license
|
|
3468
3468
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3469
3469
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3470
3470
|
*/
|
|
3471
|
-
const
|
|
3471
|
+
const Sa=ee`
|
|
3472
3472
|
:host {
|
|
3473
3473
|
display: inline-block;
|
|
3474
3474
|
position: relative;
|
|
@@ -3528,7 +3528,7 @@ const wa=Xt`
|
|
|
3528
3528
|
outline-color: GrayText;
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
3531
|
-
`,
|
|
3531
|
+
`,Ta=t=>class extends(Jn(as(ss(t)))){static get properties(){return{tabindex:{type:Number,value:0,reflectToAttribute:!0}}}get _activeKeys(){return["Enter"," "]}ready(){super.ready(),this.hasAttribute("role")||this.setAttribute("role","button")}_onKeyDown(t){super._onKeyDown(t),!(t.altKey||t.shiftKey||t.ctrlKey||t.metaKey)&&this._activeKeys.includes(t.key)&&(t.preventDefault(),this.click())}}
|
|
3532
3532
|
/**
|
|
3533
3533
|
* @license
|
|
3534
3534
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -3538,7 +3538,7 @@ const wa=Xt`
|
|
|
3538
3538
|
* @license
|
|
3539
3539
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
3540
3540
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3541
|
-
*/
|
|
3541
|
+
*/fi("vaadin-button",Sa,{moduleId:"vaadin-button-styles"});class Aa extends(Ta(ln(wi(bs(jr))))){static get is(){return"vaadin-button"}static get template(){return Pr`
|
|
3542
3542
|
<div class="vaadin-button-container">
|
|
3543
3543
|
<span part="prefix" aria-hidden="true">
|
|
3544
3544
|
<slot name="prefix"></slot>
|
|
@@ -3551,7 +3551,7 @@ const wa=Xt`
|
|
|
3551
3551
|
</span>
|
|
3552
3552
|
</div>
|
|
3553
3553
|
<slot name="tooltip"></slot>
|
|
3554
|
-
`}ready(){super.ready(),this._tooltipController=new
|
|
3554
|
+
`}ready(){super.ready(),this._tooltipController=new gn(this),this.addController(this._tooltipController)}}function za(t){const e=new Date(t);return e.setHours(0,0,0,0),e}function Ia(t,e,i=za){return t instanceof Date&&e instanceof Date&&i(t).getTime()===i(e).getTime()}function Ma(t){return{day:t.getDate(),month:t.getMonth(),year:t.getFullYear()}}function Da(t,e,i,o){let r=!1;return"function"==typeof o&&t&&(r=o(Ma(t))),(!e||t>=e)&&(!i||t<=i)&&!r}function Na(t,e){return e.filter((t=>void 0!==t)).reduce(((e,i)=>i?e?Math.abs(t.getTime()-i.getTime())<Math.abs(e.getTime()-t.getTime())?i:e:i:e))}function Oa(t){const e=new Date,i=new Date(e);return i.setDate(1),i.setMonth(parseInt(t)+e.getMonth()),i}function Ea(t){const e=/^([-+]\d{1}|\d{2,4}|[-+]\d{6})-(\d{1,2})-(\d{1,2})$/u.exec(t);if(!e)return;const i=new Date(0,0);return i.setFullYear(parseInt(e[1],10)),i.setMonth(parseInt(e[2],10)-1),i.setDate(parseInt(e[3],10)),i}Yt(Aa);
|
|
3555
3555
|
/**
|
|
3556
3556
|
@license
|
|
3557
3557
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3561,7 +3561,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3561
3561
|
Code distributed by Google as part of the polymer project is also
|
|
3562
3562
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3563
3563
|
*/
|
|
3564
|
-
class
|
|
3564
|
+
class Pa{constructor(){this._asyncModule=null,this._callback=null,this._timer=null}setConfig(t,e){this._asyncModule=t,this._callback=e,this._timer=this._asyncModule.run((()=>{this._timer=null,Ba.delete(this),this._callback()}))}cancel(){this.isActive()&&(this._cancelAsync(),Ba.delete(this))}_cancelAsync(){this.isActive()&&(this._asyncModule.cancel(this._timer),this._timer=null)}flush(){this.isActive()&&(this.cancel(),this._callback())}isActive(){return null!=this._timer}static debounce(t,e,i){return t instanceof Pa?t._cancelAsync():t=new Pa,t.setConfig(e,i),t}}let Ba=new Set;const ja=function(){const t=!!Ba.size;return Ba.forEach((t=>{try{t.flush()}catch(t){setTimeout((()=>{throw t}))}})),t
|
|
3565
3565
|
/**
|
|
3566
3566
|
@license
|
|
3567
3567
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3570,29 +3570,29 @@ The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
|
|
|
3570
3570
|
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
3571
3571
|
Code distributed by Google as part of the polymer project is also
|
|
3572
3572
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3573
|
-
*/},
|
|
3573
|
+
*/},La=function(){let t,e;do{t=window.ShadyDOM&&ShadyDOM.flush(),window.ShadyCSS&&window.ShadyCSS.ScopingShim&&window.ShadyCSS.ScopingShim.flush(),e=ja()}while(t||e)},$a=document.createElement("template");$a.innerHTML='\n <style>\n :host {\n display: block;\n overflow: hidden;\n height: 500px;\n }\n\n #scroller {\n position: relative;\n height: 100%;\n overflow: auto;\n outline: none;\n margin-right: -40px;\n -webkit-overflow-scrolling: touch;\n overflow-x: hidden;\n }\n\n #scroller.notouchscroll {\n -webkit-overflow-scrolling: auto;\n }\n\n #scroller::-webkit-scrollbar {\n display: none;\n }\n\n .buffer {\n position: absolute;\n width: var(--vaadin-infinite-scroller-buffer-width, 100%);\n box-sizing: border-box;\n padding-right: 40px;\n top: var(--vaadin-infinite-scroller-buffer-offset, 0);\n animation: fadein 0.2s;\n }\n\n @keyframes fadein {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n </style>\n\n <div id="scroller" tabindex="-1">\n <div class="buffer"></div>\n <div class="buffer"></div>\n <div id="fullHeight"></div>\n </div>\n';class Fa extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}).appendChild($a.content.cloneNode(!0)),this.bufferSize=20,this._initialScroll=5e5,this._initialIndex=0,this._activated=!1}get active(){return this._activated}set active(t){t&&!this._activated&&(this._createPool(),this._activated=!0)}get bufferOffset(){return this._buffers[0].offsetTop}get itemHeight(){if(!this._itemHeightVal){const t=getComputedStyle(this).getPropertyValue("--vaadin-infinite-scroller-item-height"),e="background-position";this.$.fullHeight.style.setProperty(e,t);const i=getComputedStyle(this.$.fullHeight).getPropertyValue(e);this.$.fullHeight.style.removeProperty(e),this._itemHeightVal=parseFloat(i)}return this._itemHeightVal}get _bufferHeight(){return this.itemHeight*this.bufferSize}get position(){return(this.$.scroller.scrollTop-this._buffers[0].translateY)/this.itemHeight+this._firstIndex}set position(t){this._preventScrollEvent=!0,t>this._firstIndex&&t<this._firstIndex+2*this.bufferSize?this.$.scroller.scrollTop=this.itemHeight*(t-this._firstIndex)+this._buffers[0].translateY:(this._initialIndex=~~t,this._reset(),this._scrollDisabled=!0,this.$.scroller.scrollTop+=t%1*this.itemHeight,this._scrollDisabled=!1),this._mayHaveMomentum&&(this.$.scroller.classList.add("notouchscroll"),this._mayHaveMomentum=!1,setTimeout((()=>{this.$.scroller.classList.remove("notouchscroll")}),10))}connectedCallback(){this._ready||(this._ready=!0,this.$={},this.shadowRoot.querySelectorAll("[id]").forEach((t=>{this.$[t.id]=t})),this.$.scroller.addEventListener("scroll",(()=>this._scroll())),this._buffers=[...this.shadowRoot.querySelectorAll(".buffer")],this.$.fullHeight.style.height=2*this._initialScroll+"px")}forceUpdate(){this._debouncerScrollFinish&&this._debouncerScrollFinish.flush(),this._debouncerUpdateClones&&(this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(),this._debouncerUpdateClones.cancel()),La()}_createElement(){}_updateElement(t,e){}_finishInit(){this._initDone||(this._buffers.forEach((t=>{[...t.children].forEach((t=>{this._ensureStampedInstance(t._itemWrapper)}))})),this._buffers[0].translateY||this._reset(),this._initDone=!0,this.dispatchEvent(new CustomEvent("init-done")))}_translateBuffer(t){const e=t?1:0;this._buffers[e].translateY=this._buffers[e?0:1].translateY+this._bufferHeight*(e?-1:1),this._buffers[e].style.transform=`translate3d(0, ${this._buffers[e].translateY}px, 0)`,this._buffers[e].updated=!1,this._buffers.reverse()}_scroll(){if(this._scrollDisabled)return;const t=this.$.scroller.scrollTop;(t<this._bufferHeight||t>2*this._initialScroll-this._bufferHeight)&&(this._initialIndex=~~this.position,this._reset());const e=this.itemHeight+this.bufferOffset,i=t<this._buffers[0].translateY+e;(t>this._buffers[1].translateY+e||i)&&(this._translateBuffer(i),this._updateClones()),this._preventScrollEvent||(this.dispatchEvent(new CustomEvent("custom-scroll",{bubbles:!1,composed:!0})),this._mayHaveMomentum=!0),this._preventScrollEvent=!1,this._debouncerScrollFinish=Kr.debounce(this._debouncerScrollFinish,qr.after(200),(()=>{const t=this.$.scroller.getBoundingClientRect();!this._isVisible(this._buffers[0],t)&&!this._isVisible(this._buffers[1],t)&&(this.position=this.position)}))}_reset(){this._scrollDisabled=!0,this.$.scroller.scrollTop=this._initialScroll,this._buffers[0].translateY=this._initialScroll-this._bufferHeight,this._buffers[1].translateY=this._initialScroll,this._buffers.forEach((t=>{t.style.transform=`translate3d(0, ${t.translateY}px, 0)`})),this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones(!0),this._debouncerUpdateClones=Kr.debounce(this._debouncerUpdateClones,qr.after(200),(()=>{this._buffers[0].updated=this._buffers[1].updated=!1,this._updateClones()})),this._scrollDisabled=!1}_createPool(){const t=this.getBoundingClientRect();this._buffers.forEach((e=>{for(let i=0;i<this.bufferSize;i++){const i=document.createElement("div");i.style.height=`${this.itemHeight}px`,i.instance={};const o=`vaadin-infinite-scroller-item-content-${fn()}`,r=document.createElement("slot");r.setAttribute("name",o),r._itemWrapper=i,e.appendChild(r),i.setAttribute("slot",o),this.appendChild(i),this._isVisible(i,t)&&this._ensureStampedInstance(i)}})),requestAnimationFrame((()=>{this._finishInit()}))}_ensureStampedInstance(t){if(t.firstElementChild)return;const e=t.instance;t.instance=this._createElement(),t.appendChild(t.instance),Object.keys(e).forEach((i=>{t.instance[i]=e[i]}))}_updateClones(t){this._firstIndex=Math.round((this._buffers[0].translateY-this._initialScroll)/this.itemHeight)+this._initialIndex;const e=t?this.$.scroller.getBoundingClientRect():void 0;this._buffers.forEach(((i,o)=>{if(!i.updated){const r=this._firstIndex+this.bufferSize*o;[...i.children].forEach(((i,o)=>{const n=i._itemWrapper;(!t||this._isVisible(n,e))&&this._updateElement(n.instance,r+o)})),i.updated=!0}}))}_isVisible(t,e){const i=t.getBoundingClientRect();return i.bottom>e.top&&i.top<e.bottom}}
|
|
3574
3574
|
/**
|
|
3575
3575
|
* @license
|
|
3576
3576
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3577
3577
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3578
|
-
*/const
|
|
3578
|
+
*/const Ra=document.createElement("template");Ra.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 270px;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n }\n </style>\n",Yt(class extends Fa{static get is(){return"vaadin-date-picker-month-scroller"}constructor(){super(),this.bufferSize=3,this.shadowRoot.appendChild(Ra.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-month-calendar")}_updateElement(t,e){t.month=Oa(e)}});
|
|
3579
3579
|
/**
|
|
3580
3580
|
* @license
|
|
3581
3581
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3582
3582
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3583
3583
|
*/
|
|
3584
|
-
const
|
|
3584
|
+
const Ua=document.createElement("template");Ua.innerHTML="\n <style>\n :host {\n --vaadin-infinite-scroller-item-height: 80px;\n width: 50px;\n display: block;\n height: 100%;\n position: absolute;\n right: 0;\n transform: translateX(100%);\n -webkit-tap-highlight-color: transparent;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n /* Center the year scroller position. */\n --vaadin-infinite-scroller-buffer-offset: 50%;\n }\n\n :host::before {\n content: '';\n display: block;\n background: transparent;\n width: 0;\n height: 0;\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n border-width: 6px;\n border-style: solid;\n border-color: transparent;\n border-left-color: #000;\n }\n </style>\n",Yt(class extends Fa{static get is(){return"vaadin-date-picker-year-scroller"}constructor(){super(),this.bufferSize=12,this.shadowRoot.appendChild(Ua.content.cloneNode(!0))}_createElement(){return document.createElement("vaadin-date-picker-year")}_updateElement(t,e){t.year=this._yearAfterXYears(e)}_yearAfterXYears(t){const e=new Date,i=new Date(e);return i.setFullYear(parseInt(t)+e.getFullYear()),i.getFullYear()}});
|
|
3585
3585
|
/**
|
|
3586
3586
|
* @license
|
|
3587
3587
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3588
3588
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3589
3589
|
*/
|
|
3590
|
-
const
|
|
3590
|
+
const Va=t=>class extends t{static get properties(){return{year:{type:String,sync:!0},selectedDate:{type:Object,sync:!0}}}static get observers(){return["__updateSelected(year, selectedDate)"]}__updateSelected(t,e){this.toggleAttribute("selected",e&&e.getFullYear()===t),this.toggleAttribute("current",t===(new Date).getFullYear())}}
|
|
3591
3591
|
/**
|
|
3592
3592
|
* @license
|
|
3593
3593
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3594
3594
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3595
|
-
*/;class
|
|
3595
|
+
*/;class Ha extends(wi(Va(jr))){static get is(){return"vaadin-date-picker-year"}static get template(){return Pr`
|
|
3596
3596
|
<style>
|
|
3597
3597
|
:host {
|
|
3598
3598
|
display: block;
|
|
@@ -3611,7 +3611,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3611
3611
|
Code distributed by Google as part of the polymer project is also
|
|
3612
3612
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3613
3613
|
*/
|
|
3614
|
-
function
|
|
3614
|
+
function Wa(t,e,i,o,r){let n;r&&(n="object"==typeof i&&null!==i,n&&(o=t.__dataTemp[e]));let s=o!==i&&(o==o||i==i);return n&&s&&(t.__dataTemp[e]=i),s}Yt(Ha);const qa=qi((t=>class extends t{_shouldPropertyChange(t,e,i){return Wa(this,t,e,i,!0)}})),Ga=qi((t=>class extends t{static get properties(){return{mutableData:Boolean}}_shouldPropertyChange(t,e,i){return Wa(this,t,e,i,this.mutableData)}}));qa._mutablePropertyChange=Wa;
|
|
3615
3615
|
/**
|
|
3616
3616
|
@license
|
|
3617
3617
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3621,7 +3621,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3621
3621
|
Code distributed by Google as part of the polymer project is also
|
|
3622
3622
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3623
3623
|
*/
|
|
3624
|
-
let
|
|
3624
|
+
let Ya=null;function Ja(){return Ya}Ja.prototype=Object.create(HTMLTemplateElement.prototype,{constructor:{value:Ja,writable:!0}});const Xa=Ar(Ja),Ka=qa(Xa),Za=Ar(class{});class Qa extends Za{constructor(t){super(),this._configureProperties(t),this.root=this._stampTemplate(this.__dataHost);let e=[];this.children=e;for(let t=this.root.firstChild;t;t=t.nextSibling)e.push(t),t.__templatizeInstance=this;this.__templatizeOwner&&this.__templatizeOwner.__hideTemplateChildren__&&this._showHideChildren(!0);let i=this.__templatizeOptions;(t&&i.instanceProps||!i.instanceProps)&&this._enableProperties()}_configureProperties(t){if(this.__templatizeOptions.forwardHostProp)for(let t in this.__hostProps)this._setPendingProperty(t,this.__dataHost["_host_"+t]);for(let e in t)this._setPendingProperty(e,t[e])}forwardHostProp(t,e){this._setPendingPropertyOrPath(t,e,!1,!0)&&this.__dataHost._enqueueClient(this)}_addEventListenerToNode(t,e,i){if(this._methodHost&&this.__templatizeOptions.parentModel)this._methodHost._addEventListenerToNode(t,e,(t=>{t.model=this,i(t)}));else{let o=this.__dataHost.__dataHost;o&&o._addEventListenerToNode(t,e,i)}}_showHideChildren(t){!function(t,e){for(let i=0;i<e.length;i++){let o=e[i];if(!!t!=!!o.__hideTemplateChildren__)if(o.nodeType===Node.TEXT_NODE)t?(o.__polymerTextContent__=o.textContent,o.textContent=""):o.textContent=o.__polymerTextContent__;else if("slot"===o.localName)if(t)o.__polymerReplaced__=document.createComment("hidden-slot"),ao(ao(o).parentNode).replaceChild(o.__polymerReplaced__,o);else{const t=o.__polymerReplaced__;t&&ao(ao(t).parentNode).replaceChild(o,t)}else o.style&&(t?(o.__polymerDisplay__=o.style.display,o.style.display="none"):o.style.display=o.__polymerDisplay__);o.__hideTemplateChildren__=t,o._showHideChildren&&o._showHideChildren(t)}}(t,this.children)}_setUnmanagedPropertyToNode(t,e,i){t.__hideTemplateChildren__&&t.nodeType==Node.TEXT_NODE&&"textContent"==e?t.__polymerTextContent__=i:super._setUnmanagedPropertyToNode(t,e,i)}get parentModel(){let t=this.__parentModel;if(!t){let e;t=this;do{t=t.__dataHost.__dataHost}while((e=t.__templatizeOptions)&&!e.parentModel);this.__parentModel=t}return t}dispatchEvent(t){return!0}}const tl=qa(Qa);function el(t){let e=t.__dataHost;return e&&e._methodHost||e}function il(t,e){return function(t,i,o){e.call(t.__templatizeOwner,i.substring(6),o[i])}}function ol(t,e){return function(t,i,o){e.call(t.__templatizeOwner,t,i,o[i])}}function rl(t,e,i){if(Ei&&!el(t))throw new Error("strictTemplatePolicy: template owner not trusted");if(i=i||{},t.__templatizeOwner)throw new Error("A <template> can only be templatized once");t.__templatizeOwner=e;let o=(e?e.constructor:Qa)._parseTemplate(t),r=o.templatizeInstanceClass;r||(r=function(t,e,i){let o=i.mutableData?tl:Qa;rl.mixin&&(o=rl.mixin(o));let r=class extends o{};return r.prototype.__templatizeOptions=i,r.prototype._bindTemplate(t),function(t,e,i,o){let r=i.hostProps||{};for(let e in o.instanceProps){delete r[e];let i=o.notifyInstanceProp;i&&t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:ol(0,i)})}if(o.forwardHostProp&&e.__dataHost)for(let e in r)i.hasHostProps||(i.hasHostProps=!0),t.prototype._addPropertyEffect(e,t.prototype.PROPERTY_EFFECT_TYPES.NOTIFY,{fn:function(t,e,i){t.__dataHost._setPendingPropertyOrPath("_host_"+e,i[e],!0,!0)}})}(r,t,e,i),r}(t,o,i),o.templatizeInstanceClass=r);const n=el(t);!function(t,e,i,o){let r=i.forwardHostProp;if(r&&e.hasHostProps){const n="template"==t.localName;let s=e.templatizeTemplateClass;if(!s){if(n){let t=i.mutableData?Ka:Xa;class o extends t{}s=e.templatizeTemplateClass=o}else{const i=t.constructor;class o extends i{}s=e.templatizeTemplateClass=o}let a=e.hostProps;for(let t in a)s.prototype._addPropertyEffect("_host_"+t,s.prototype.PROPERTY_EFFECT_TYPES.PROPAGATE,{fn:il(0,r)}),s.prototype._createNotifyingProperty("_host_"+t);ji&&o&&function(t,e,i){const o=i.constructor._properties,{propertyEffects:r}=t,{instanceProps:n}=e;for(let t in r)if(!(o[t]||n&&n[t])){const e=r[t];for(let i=0;i<e.length;i++){const{part:o}=e[i].info;if(!o.signature||!o.signature.static){console.warn(`Property '${t}' used in template but not declared in 'properties'; attribute will not be observed.`);break}}}}(e,i,o)}if(t.__dataProto&&Object.assign(t.__data,t.__dataProto),n)(function(t,e){Ya=t,Object.setPrototypeOf(t,e.prototype),new e,Ya=null})(t,s),t.__dataTemp={},t.__dataPending=null,t.__dataOld=null,t._enableProperties();else{Object.setPrototypeOf(t,s.prototype);const i=e.hostProps;for(let e in i)if(e="_host_"+e,e in t){const i=t[e];delete t[e],t.__data[e]=i}}}}(t,o,i,n);let s=class extends r{};return s.prototype._methodHost=n,s.prototype.__dataHost=t,s.prototype.__templatizeOwner=e,s.prototype.__hostProps=o.hostProps,s}
|
|
3625
3625
|
/**
|
|
3626
3626
|
@license
|
|
3627
3627
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3631,7 +3631,7 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3631
3631
|
Code distributed by Google as part of the polymer project is also
|
|
3632
3632
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3633
3633
|
*/
|
|
3634
|
-
let
|
|
3634
|
+
let nl=!1;
|
|
3635
3635
|
/**
|
|
3636
3636
|
@license
|
|
3637
3637
|
Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -3641,13 +3641,13 @@ The complete set of contributors may be found at http://polymer.github.io/CONTRI
|
|
|
3641
3641
|
Code distributed by Google as part of the polymer project is also
|
|
3642
3642
|
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
3643
3643
|
*/
|
|
3644
|
-
const
|
|
3644
|
+
const sl=Ga(jr);class al extends sl{static get is(){return"dom-repeat"}static get template(){return null}static get properties(){return{items:{type:Array},as:{type:String,value:"item"},indexAs:{type:String,value:"index"},itemsIndexAs:{type:String,value:"itemsIndex"},sort:{type:Function,observer:"__sortChanged"},filter:{type:Function,observer:"__filterChanged"},observe:{type:String,observer:"__observeChanged"},delay:Number,renderedItemCount:{type:Number,notify:!Vi,readOnly:!0},initialCount:{type:Number},targetFramerate:{type:Number,value:20},_targetFrameTime:{type:Number,computed:"__computeFrameTime(targetFramerate)"},notifyDomChange:{type:Boolean},reuseChunkedInstances:{type:Boolean}}}static get observers(){return["__itemsChanged(items.*)"]}constructor(){super(),this.__instances=[],this.__renderDebouncer=null,this.__itemsIdxToInstIdx={},this.__chunkCount=null,this.__renderStartTime=null,this.__itemsArrayChanged=!1,this.__shouldMeasureChunk=!1,this.__shouldContinueChunking=!1,this.__chunkingId=0,this.__sortFn=null,this.__filterFn=null,this.__observePaths=null,this.__ctor=null,this.__isDetached=!0,this.template=null}disconnectedCallback(){super.disconnectedCallback(),this.__isDetached=!0;for(let t=0;t<this.__instances.length;t++)this.__detachInstance(t);this.__chunkingId&&cancelAnimationFrame(this.__chunkingId)}connectedCallback(){if(super.connectedCallback(),function(){if(Bi&&!Mi){if(!nl){nl=!0;const t=document.createElement("style");t.textContent="dom-bind,dom-if,dom-repeat{display:none;}",document.head.appendChild(t)}return!0}return!1}()||(this.style.display="none"),this.__isDetached){this.__isDetached=!1;let t=ao(ao(this).parentNode);for(let e=0;e<this.__instances.length;e++)this.__attachInstance(e,t);this.__chunkingId&&this.__render()}}__ensureTemplatized(){if(!this.__ctor){const t=this;let e=this.template=t._templateInfo?t:this.querySelector("template");if(!e){let t=new MutationObserver((()=>{if(!this.querySelector("template"))throw new Error("dom-repeat requires a <template> child");t.disconnect(),this.__render()}));return t.observe(this,{childList:!0}),!1}let i={};i[this.as]=!0,i[this.indexAs]=!0,i[this.itemsIndexAs]=!0,this.__ctor=rl(e,this,{mutableData:this.mutableData,parentModel:!0,instanceProps:i,forwardHostProp:function(t,e){let i=this.__instances;for(let o,r=0;r<i.length&&(o=i[r]);r++)o.forwardHostProp(t,e)},notifyInstanceProp:function(t,e,i){if(function(t,e){return t===e||co(t,e)||uo(t,e)}(this.as,e)){let o=t[this.itemsIndexAs];e==this.as&&(this.items[o]=i);let r=po(this.as,`${JSCompiler_renameProperty("items",this)}.${o}`,e);this.notifyPath(r,i)}}})}return!0}__getMethodHost(){return this.__dataHost._methodHost||this.__dataHost}__functionFromPropertyValue(t){if("string"==typeof t){let e=t,i=this.__getMethodHost();return function(){return i[e].apply(i,arguments)}}return t}__sortChanged(t){this.__sortFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__filterChanged(t){this.__filterFn=this.__functionFromPropertyValue(t),this.items&&this.__debounceRender(this.__render)}__computeFrameTime(t){return Math.ceil(1e3/t)}__observeChanged(){this.__observePaths=this.observe&&this.observe.replace(".*",".").split(" ")}__handleObservedPaths(t){if(this.__sortFn||this.__filterFn)if(t){if(this.__observePaths){let e=this.__observePaths;for(let i=0;i<e.length;i++)0===t.indexOf(e[i])&&this.__debounceRender(this.__render,this.delay)}}else this.__debounceRender(this.__render,this.delay)}__itemsChanged(t){this.items&&!Array.isArray(this.items)&&console.warn("dom-repeat expected array for `items`, found",this.items),this.__handleItemPath(t.path,t.value)||("items"===t.path&&(this.__itemsArrayChanged=!0),this.__debounceRender(this.__render))}__debounceRender(t,e=0){this.__renderDebouncer=Pa.debounce(this.__renderDebouncer,e>0?Io.after(e):Mo,t.bind(this)),Ba.add(this.__renderDebouncer)}render(){this.__debounceRender(this.__render),La()}__render(){if(!this.__ensureTemplatized())return;let t=this.items||[];const e=this.__sortAndFilterItems(t),i=this.__calculateLimit(e.length);this.__updateInstances(t,i,e),this.initialCount&&(this.__shouldMeasureChunk||this.__shouldContinueChunking)&&(cancelAnimationFrame(this.__chunkingId),this.__chunkingId=requestAnimationFrame((()=>{this.__chunkingId=null,this.__continueChunking()}))),this._setRenderedItemCount(this.__instances.length),(!Vi||this.notifyDomChange)&&this.dispatchEvent(new CustomEvent("dom-change",{bubbles:!0,composed:!0}))}__sortAndFilterItems(t){let e=new Array(t.length);for(let i=0;i<t.length;i++)e[i]=i;return this.__filterFn&&(e=e.filter(((e,i,o)=>this.__filterFn(t[e],i,o)))),this.__sortFn&&e.sort(((e,i)=>this.__sortFn(t[e],t[i]))),e}__calculateLimit(t){let e=t;const i=this.__instances.length;if(this.initialCount){let o;!this.__chunkCount||this.__itemsArrayChanged&&!this.reuseChunkedInstances?(e=Math.min(t,this.initialCount),o=Math.max(e-i,0),this.__chunkCount=o||1):(o=Math.min(Math.max(t-i,0),this.__chunkCount),e=Math.min(i+o,t)),this.__shouldMeasureChunk=o===this.__chunkCount,this.__shouldContinueChunking=e<t,this.__renderStartTime=performance.now()}return this.__itemsArrayChanged=!1,e}__continueChunking(){if(this.__shouldMeasureChunk){const t=performance.now()-this.__renderStartTime;this.__chunkCount=Math.round(this.__chunkCount*(this._targetFrameTime/t))||1}this.__shouldContinueChunking&&this.__debounceRender(this.__render)}__updateInstances(t,e,i){const o=this.__itemsIdxToInstIdx={};let r;for(r=0;r<e;r++){let e=this.__instances[r],n=i[r],s=t[n];o[n]=r,e?(e._setPendingProperty(this.as,s),e._setPendingProperty(this.indexAs,r),e._setPendingProperty(this.itemsIndexAs,n),e._flushProperties()):this.__insertInstance(s,r,n)}for(let t=this.__instances.length-1;t>=r;t--)this.__detachAndRemoveInstance(t)}__detachInstance(t){let e=this.__instances[t];const i=ao(e.root);for(let t=0;t<e.children.length;t++)i.appendChild(e.children[t]);return e}__attachInstance(t,e){e.insertBefore(this.__instances[t].root,this)}__detachAndRemoveInstance(t){this.__detachInstance(t),this.__instances.splice(t,1)}__stampInstance(t,e,i){let o={};return o[this.as]=t,o[this.indexAs]=e,o[this.itemsIndexAs]=i,new this.__ctor(o)}__insertInstance(t,e,i){const o=this.__stampInstance(t,e,i);let r=this.__instances[e+1],n=r?r.children[0]:this;return ao(ao(this).parentNode).insertBefore(o.root,n),this.__instances[e]=o,o}_showHideChildren(t){for(let e=0;e<this.__instances.length;e++)this.__instances[e]._showHideChildren(t)}__handleItemPath(t,e){let i=t.slice(6),o=i.indexOf("."),r=o<0?i:i.substring(0,o);if(r==parseInt(r,10)){let t=o<0?"":i.substring(o+1);this.__handleObservedPaths(t);let n=this.__instances[this.__itemsIdxToInstIdx[r]];return n&&(n._setPendingPropertyOrPath(this.as+(t?"."+t:""),e,!1,!0),n._flushProperties()),!0}}itemForElement(t){let e=this.modelForElement(t);return e&&e[this.as]}indexForElement(t){let e=this.modelForElement(t);return e&&e[this.indexAs]}modelForElement(t){return function(t,e){let i;for(;e;)if(i=e.__dataHost?e:e.__templatizeInstance){if(i.__dataHost==t)return i;e=i.__dataHost}else e=ao(e).parentNode;return null}(this.template,t)}}customElements.define(al.is,al);
|
|
3645
3645
|
/**
|
|
3646
3646
|
* @license
|
|
3647
3647
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3648
3648
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3649
3649
|
*/
|
|
3650
|
-
const
|
|
3650
|
+
const ll=t=>class extends(ss(t)){static get properties(){return{month:{type:Object,value:new Date,sync:!0},selectedDate:{type:Object,notify:!0,sync:!0},focusedDate:{type:Object},showWeekNumbers:{type:Boolean,value:!1},i18n:{type:Object},ignoreTaps:{type:Boolean},minDate:{type:Date,value:null,sync:!0},maxDate:{type:Date,value:null,sync:!0},isDateDisabled:{type:Function,value:()=>!1},disabled:{type:Boolean,reflectToAttribute:!0},_days:{type:Array},_weeks:{type:Array},_notTapping:{type:Boolean}}}static get observers(){return["__focusedDateChanged(focusedDate, _days)"]}get focusableDateElement(){return[...this.shadowRoot.querySelectorAll("[part~=date]")].find((t=>Ia(t.date,this.focusedDate)))}ready(){super.ready(),Ln(this.$.monthGrid,"tap",this._handleTap.bind(this))}_isDisabled(t,e,i){const o=new Date(0,0);o.setFullYear(t.getFullYear()),o.setMonth(t.getMonth()),o.setDate(1);const r=new Date(0,0);return r.setFullYear(t.getFullYear()),r.setMonth(t.getMonth()+1),r.setDate(0),!(e&&i&&e.getMonth()===i.getMonth()&&e.getMonth()===t.getMonth()&&i.getDate()-e.getDate()>=0||Da(o,e,i)||Da(r,e,i))}_getTitle(t,e){if(void 0!==t&&void 0!==e)return e.formatTitle(e.monthNames[t.getMonth()],t.getFullYear())}_onMonthGridTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300)}_dateAdd(t,e){t.setDate(t.getDate()+e)}_applyFirstDayOfWeek(t,e){if(void 0!==t&&void 0!==e)return t.slice(e).concat(t.slice(0,e))}_getWeekDayNames(t,e){if(void 0===t||void 0===e)return[];const{weekdays:i,weekdaysShort:o,firstDayOfWeek:r}=t,n=this._applyFirstDayOfWeek(o,r);return this._applyFirstDayOfWeek(i,r).map(((t,e)=>({weekDay:t,weekDayShort:n[e]}))).slice(0,7)}__focusedDateChanged(t,e){Array.isArray(e)&&e.some((e=>Ia(e,t)))?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")}_getDate(t){return t?t.getDate():""}_showWeekSeparator(t,e){return t&&e&&1===e.firstDayOfWeek}_isToday(t){return Ia(new Date,t)}_getDays(t,e){if(void 0===t||void 0===e)return[];const i=new Date(0,0);for(i.setFullYear(t.getFullYear()),i.setMonth(t.getMonth()),i.setDate(1);i.getDay()!==e.firstDayOfWeek;)this._dateAdd(i,-1);const o=[],r=i.getMonth(),n=t.getMonth();for(;i.getMonth()===n||i.getMonth()===r;)o.push(i.getMonth()===n?new Date(i.getTime()):null),this._dateAdd(i,1);return o}_getWeeks(t){return t.reduce(((t,e,i)=>(i%7==0&&t.push([]),t[t.length-1].push(e),t)),[])}_handleTap(t){!this.ignoreTaps&&!this._notTapping&&t.target.date&&!t.target.hasAttribute("disabled")&&(this.selectedDate=t.target.date,this.dispatchEvent(new CustomEvent("date-tap",{detail:{date:t.target.date},bubbles:!0,composed:!0})))}_preventDefault(t){t.preventDefault()}__getWeekNumber(t){
|
|
3651
3651
|
/**
|
|
3652
3652
|
* @license
|
|
3653
3653
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3663,7 +3663,7 @@ const ol=t=>class extends(es(t)){static get properties(){return{month:{type:Obje
|
|
|
3663
3663
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3664
3664
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3665
3665
|
*/
|
|
3666
|
-
|
|
3666
|
+
fi("vaadin-month-calendar",ee`
|
|
3667
3667
|
:host {
|
|
3668
3668
|
display: block;
|
|
3669
3669
|
}
|
|
@@ -3719,7 +3719,7 @@ ci("vaadin-month-calendar",Xt`
|
|
|
3719
3719
|
outline: 3px solid;
|
|
3720
3720
|
}
|
|
3721
3721
|
}
|
|
3722
|
-
`,{moduleId:"vaadin-month-calendar-styles"});class
|
|
3722
|
+
`,{moduleId:"vaadin-month-calendar-styles"});class hl extends(ll(wi(jr))){static get template(){return Pr`
|
|
3723
3723
|
<div part="month-header" id="month-header" aria-hidden="true">[[_getTitle(month, i18n)]]</div>
|
|
3724
3724
|
<table
|
|
3725
3725
|
id="monthGrid"
|
|
@@ -3761,18 +3761,18 @@ ci("vaadin-month-calendar",Xt`
|
|
|
3761
3761
|
</template>
|
|
3762
3762
|
</tbody>
|
|
3763
3763
|
</table>
|
|
3764
|
-
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,o,r,n){const s=["date"],a=t>
|
|
3764
|
+
`}static get is(){return"vaadin-month-calendar"}static get properties(){return{_days:{type:Array,computed:"_getDays(month, i18n, minDate, maxDate, isDateDisabled)"},_weeks:{type:Array,computed:"_getWeeks(_days)"},disabled:{type:Boolean,reflectToAttribute:!0,computed:"_isDisabled(month, minDate, maxDate)"}}}static get observers(){return["_showWeekNumbersChanged(showWeekNumbers, i18n)"]}_showWeekNumbersChanged(t,e){t&&e&&1===e.firstDayOfWeek?this.setAttribute("week-numbers",""):this.removeAttribute("week-numbers")}__getDatePart(t,e,i,o,r,n){const s=["date"],a=t>za(new Date),l=t<za(new Date);return this.__isDayDisabled(t,o,r,n)&&s.push("disabled"),this.__isDayFocused(t,e)&&s.push("focused"),this.__isDaySelected(t,i)&&s.push("selected"),this._isToday(t)&&s.push("today"),l&&s.push("past"),a&&s.push("future"),s.join(" ")}__isDayFocused(t,e){return Ia(t,e)}__isDaySelected(t,e){return Ia(t,e)}__getDayAriaSelected(t,e){if(this.__isDaySelected(t,e))return"true"}__isDayDisabled(t,e,i,o){return!Da(t,e,i,o)}__getDayAriaDisabled(t,e,i,o){if(void 0!==t&&(void 0!==e||void 0!==i||void 0!==o)&&this.__isDayDisabled(t,e,i,o))return"true"}__getDayTabindex(t,e){return this.__isDayFocused(t,e)?"0":"-1"}}Yt(hl);
|
|
3765
3765
|
/**
|
|
3766
3766
|
* @license
|
|
3767
3767
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3768
3768
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3769
3769
|
*/
|
|
3770
|
-
class
|
|
3770
|
+
class cl{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=this._queryHandler.bind(this)}hostConnected(){this._removeListener(),this._mediaQuery=window.matchMedia(this.query),this._addListener(),this._queryHandler(this._mediaQuery)}hostDisconnected(){this._removeListener()}_addListener(){this._mediaQuery&&this._mediaQuery.addListener(this._boundQueryHandler)}_removeListener(){this._mediaQuery&&this._mediaQuery.removeListener(this._boundQueryHandler),this._mediaQuery=null}_queryHandler(t){"function"==typeof this.callback&&this.callback(t.matches)}}
|
|
3771
3771
|
/**
|
|
3772
3772
|
* @license
|
|
3773
3773
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3774
3774
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3775
|
-
*/const sl=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},isDateDisabled:{type:Function},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme, isDateDisabled)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate, isDateDisabled)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){Pn(this.$.scrollers,"pan-y"),On(this.$.scrollers,"track",this._track.bind(this)),On(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),On(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),On(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new nl(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new dn(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),On(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new dn(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),On(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new dn(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new dn(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),On(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,o,r){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,o,r))}__updateCalendars(t,e,i,o,r,n,s,a,l,h){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=o,t.isDateDisabled=h,t.focusedDate=n,t.selectedDate=r,t.showWeekNumbers=s,t.ignoreTaps=a,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){return!!this._dateAllowed(t)&&(this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0})),!0)}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const o=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+o,e)}const o=this._monthScroller.position>i,r=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,n=this._monthScroller.position+r-1<i;o?this._scrollToPosition(i,e):n&&this._scrollToPosition(i-r+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=qr.debounce(this._debouncer,Rr.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(Sa(t)):i}_onTodayTap(){const t=this._getTodayMidnight();Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._monthScroller.forceUpdate(),this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let o=0;const r=this._monthScroller.position,n=t=>{o||(o=t);const e=t-o;if(e<this.scrollDuration){const t=((t,e,i)=>(t/=this.scrollDuration/2)<1?i/2*t*t+e:-i/2*((t-=1)*(t-2)-1)+e)(e,r,this._targetPosition-r);this._monthScroller.position=t,window.requestAnimationFrame(n)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:r}})),this._monthScroller.position=this._targetPosition,this._monthScroller.forceUpdate(),this._targetPosition=void 0,i(),this._revealPromise=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(n)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10||(Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0),this._translateX=this._limit(this._translateX+t.detail.ddx,{min:0,max:this._yearScrollerWidth}))}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return za(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){Ca(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate)&&(this._close(),e=!0);break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&Ca(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}focusDate(t,e){return Ut(this,null,(function*(){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),yield this.focusDateElement(!1)}))}focusDateElement(t=!0){return Ut(this,null,(function*(){this.__pendingDateFocus=this.focusedDate,this.calendars.length||(yield new Promise((t=>{Ws(this,(()=>{Oa(),t()}))}))),t&&this.revealDate(this.focusedDate),this._revealPromise&&(yield this._revealPromise),this.__tryFocusDate()}))}_focusClosestDate(t){this.focusDate(Aa(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t,void 0,void 0,(()=>!1))?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?this.focusDate(e>0?this.maxDate:this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate,o=this.isDateDisabled){return Ta(t,e,i,o)}_isTodayAllowed(t,e,i){return this._dateAllowed(this._getTodayMidnight(),t,e,i)}_getTodayMidnight(){const t=new Date,e=new Date(0,0);return e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()),e}}
|
|
3775
|
+
*/const dl=t=>class extends t{static get properties(){return{scrollDuration:{type:Number,value:300},selectedDate:{type:Object,value:null,sync:!0},focusedDate:{type:Object,notify:!0,observer:"_focusedDateChanged",sync:!0},_focusedMonthDate:Number,initialPosition:{type:Object,observer:"_initialPositionChanged"},_originDate:{type:Object,value:new Date},_visibleMonthIndex:Number,_desktopMode:{type:Boolean,observer:"_desktopModeChanged"},_desktopMediaQuery:{type:String,value:"(min-width: 375px)"},_translateX:{observer:"_translateXChanged"},_yearScrollerWidth:{value:50},i18n:{type:Object},showWeekNumbers:{type:Boolean,value:!1},_ignoreTaps:Boolean,_notTapping:Boolean,minDate:{type:Object,sync:!0},maxDate:{type:Object,sync:!0},isDateDisabled:{type:Function},label:String,_cancelButton:{type:Object},_todayButton:{type:Object},calendars:{type:Array,value:()=>[]},years:{type:Array,value:()=>[]}}}static get observers(){return["__updateCalendars(calendars, i18n, minDate, maxDate, selectedDate, focusedDate, showWeekNumbers, _ignoreTaps, _theme, isDateDisabled)","__updateCancelButton(_cancelButton, i18n)","__updateTodayButton(_todayButton, i18n, minDate, maxDate, isDateDisabled)","__updateYears(years, selectedDate, _theme)"]}get __useSubMonthScrolling(){return this._monthScroller.clientHeight<this._monthScroller.itemHeight+this._monthScroller.bufferOffset}get focusableDateElement(){return this.calendars.map((t=>t.focusableDateElement)).find(Boolean)}_addListeners(){Fn(this.$.scrollers,"pan-y"),Ln(this.$.scrollers,"track",this._track.bind(this)),Ln(this.shadowRoot.querySelector('[part="clear-button"]'),"tap",this._clear.bind(this)),Ln(this.shadowRoot.querySelector('[part="toggle-button"]'),"tap",this._cancel.bind(this)),Ln(this.shadowRoot.querySelector('[part="years-toggle-button"]'),"tap",this._toggleYearScroller.bind(this))}_initControllers(){this.addController(new cl(this._desktopMediaQuery,(t=>{this._desktopMode=t}))),this.addController(new vn(this,"today-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onTodayButtonKeyDown(t))),Ln(t,"tap",this._onTodayTap.bind(this)),this._todayButton=t}})),this.addController(new vn(this,"cancel-button","vaadin-button",{observe:!1,initializer:t=>{t.setAttribute("theme","tertiary"),t.addEventListener("keydown",(t=>this.__onCancelButtonKeyDown(t))),Ln(t,"tap",this._cancel.bind(this)),this._cancelButton=t}})),this.__initMonthScroller(),this.__initYearScroller()}reset(){this._closeYearScroller(),this._toggleAnimateClass(!0)}focusCancel(){this._cancelButton.focus()}scrollToDate(t,e){const i=this.__useSubMonthScrolling?this._calculateWeekScrollOffset(t):0;this._scrollToPosition(this._differenceInMonths(t,this._originDate)+i,e),this._monthScroller.forceUpdate()}__initMonthScroller(){this.addController(new vn(this,"months","vaadin-date-picker-month-scroller",{observe:!1,initializer:t=>{t.addEventListener("custom-scroll",(()=>{this._onMonthScroll()})),t.addEventListener("touchstart",(()=>{this._onMonthScrollTouchStart()})),t.addEventListener("keydown",(t=>{this.__onMonthCalendarKeyDown(t)})),t.addEventListener("init-done",(()=>{const t=[...this.querySelectorAll("vaadin-month-calendar")];t.forEach((t=>{t.addEventListener("selected-date-changed",(t=>{this.selectedDate=t.detail.value}))})),this.calendars=t})),this._monthScroller=t}}))}__initYearScroller(){this.addController(new vn(this,"years","vaadin-date-picker-year-scroller",{observe:!1,initializer:t=>{t.setAttribute("aria-hidden","true"),Ln(t,"tap",(t=>{this._onYearTap(t)})),t.addEventListener("custom-scroll",(()=>{this._onYearScroll()})),t.addEventListener("touchstart",(()=>{this._onYearScrollTouchStart()})),t.addEventListener("init-done",(()=>{this.years=[...this.querySelectorAll("vaadin-date-picker-year")]})),this._yearScroller=t}}))}__updateCancelButton(t,e){t&&(t.textContent=e&&e.cancel)}__updateTodayButton(t,e,i,o,r){t&&(t.textContent=e&&e.today,t.disabled=!this._isTodayAllowed(i,o,r))}__updateCalendars(t,e,i,o,r,n,s,a,l,h){t&&t.length&&t.forEach((t=>{t.i18n=e,t.minDate=i,t.maxDate=o,t.isDateDisabled=h,t.focusedDate=n,t.selectedDate=r,t.showWeekNumbers=s,t.ignoreTaps=a,l?t.setAttribute("theme",l):t.removeAttribute("theme")}))}__updateYears(t,e,i){t&&t.length&&t.forEach((t=>{t.selectedDate=e,i?t.setAttribute("theme",i):t.removeAttribute("theme")}))}_selectDate(t){return!!this._dateAllowed(t)&&(this.selectedDate=t,this.dispatchEvent(new CustomEvent("date-selected",{detail:{date:t},bubbles:!0,composed:!0})),!0)}_desktopModeChanged(t){this.toggleAttribute("desktop",t)}_focusedDateChanged(t){this.revealDate(t)}revealDate(t,e=!0){if(!t)return;const i=this._differenceInMonths(t,this._originDate);if(this.__useSubMonthScrolling){const o=this._calculateWeekScrollOffset(t);return void this._scrollToPosition(i+o,e)}const o=this._monthScroller.position>i,r=Math.max(this._monthScroller.itemHeight,this._monthScroller.clientHeight-2*this._monthScroller.bufferOffset)/this._monthScroller.itemHeight,n=this._monthScroller.position+r-1<i;o?this._scrollToPosition(i,e):n&&this._scrollToPosition(i-r+1,e)}_calculateWeekScrollOffset(t){const e=new Date(0,0);e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(1);let i=0;for(;e.getDate()<t.getDate();)e.setDate(e.getDate()+1),e.getDay()===this.i18n.firstDayOfWeek&&(i+=1);return i/6}_initialPositionChanged(t){this._monthScroller&&this._yearScroller&&(this._monthScroller.active=!0,this._yearScroller.active=!0),this.scrollToDate(t)}_repositionYearScroller(){const t=this._monthScroller.position;this._visibleMonthIndex=Math.floor(t),this._yearScroller.position=(t+this._originDate.getMonth())/12}_repositionMonthScroller(){this._monthScroller.position=12*this._yearScroller.position-this._originDate.getMonth(),this._visibleMonthIndex=Math.floor(this._monthScroller.position)}_onMonthScroll(){this._repositionYearScroller(),this._doIgnoreTaps()}_onYearScroll(){this._repositionMonthScroller(),this._doIgnoreTaps()}_onYearScrollTouchStart(){this._notTapping=!1,setTimeout((()=>{this._notTapping=!0}),300),this._repositionMonthScroller()}_onMonthScrollTouchStart(){this._repositionYearScroller()}_doIgnoreTaps(){this._ignoreTaps=!0,this._debouncer=Kr.debounce(this._debouncer,qr.after(300),(()=>{this._ignoreTaps=!1}))}_formatDisplayed(t,e,i){return t&&e&&"function"==typeof e.formatDate?e.formatDate(Ma(t)):i}_onTodayTap(){const t=this._getTodayMidnight();Math.abs(this._monthScroller.position-this._differenceInMonths(t,this._originDate))<.001?(this._selectDate(t),this._close()):this._scrollToCurrentMonth()}_scrollToCurrentMonth(){this.focusedDate&&(this.focusedDate=new Date),this.scrollToDate(new Date,!0)}_onYearTap(t){if(!this._ignoreTaps&&!this._notTapping){const e=(t.detail.y-(this._yearScroller.getBoundingClientRect().top+this._yearScroller.clientHeight/2))/this._yearScroller.itemHeight;this._scrollToPosition(this._monthScroller.position+12*e,!0)}}_scrollToPosition(t,e){if(void 0!==this._targetPosition)return void(this._targetPosition=t);if(!e)return this._monthScroller.position=t,this._monthScroller.forceUpdate(),this._targetPosition=void 0,this._repositionYearScroller(),void this.__tryFocusDate();let i;this._targetPosition=t,this._revealPromise=new Promise((t=>{i=t}));let o=0;const r=this._monthScroller.position,n=t=>{o||(o=t);const e=t-o;if(e<this.scrollDuration){const t=((t,e,i)=>(t/=this.scrollDuration/2)<1?i/2*t*t+e:-i/2*((t-=1)*(t-2)-1)+e)(e,r,this._targetPosition-r);this._monthScroller.position=t,window.requestAnimationFrame(n)}else this.dispatchEvent(new CustomEvent("scroll-animation-finished",{bubbles:!0,composed:!0,detail:{position:this._targetPosition,oldPosition:r}})),this._monthScroller.position=this._targetPosition,this._monthScroller.forceUpdate(),this._targetPosition=void 0,i(),this._revealPromise=void 0;setTimeout(this._repositionYearScroller.bind(this),1)};window.requestAnimationFrame(n)}_limit(t,e){return Math.min(e.max,Math.max(e.min,t))}_handleTrack(t){Math.abs(t.detail.dx)<10||Math.abs(t.detail.ddy)>10||(Math.abs(t.detail.ddx)>this._yearScrollerWidth/3&&this._toggleAnimateClass(!0),this._translateX=this._limit(this._translateX+t.detail.ddx,{min:0,max:this._yearScrollerWidth}))}_track(t){if(!this._desktopMode)switch(t.detail.state){case"start":this._toggleAnimateClass(!1);break;case"track":this._handleTrack(t);break;case"end":this._toggleAnimateClass(!0),this._translateX>=this._yearScrollerWidth/2?this._closeYearScroller():this._openYearScroller()}}_toggleAnimateClass(t){t?this.classList.add("animate"):this.classList.remove("animate")}_toggleYearScroller(){this._isYearScrollerVisible()?this._closeYearScroller():this._openYearScroller()}_openYearScroller(){this._translateX=0,this.setAttribute("years-visible","")}_closeYearScroller(){this.removeAttribute("years-visible"),this._translateX=this._yearScrollerWidth}_isYearScrollerVisible(){return this._translateX<this._yearScrollerWidth/2}_translateXChanged(t){this._desktopMode||(this._monthScroller.style.transform=`translateX(${t-this._yearScrollerWidth}px)`,this._yearScroller.style.transform=`translateX(${t}px)`)}_yearAfterXMonths(t){return Oa(t).getFullYear()}_differenceInMonths(t,e){return 12*(t.getFullYear()-e.getFullYear())-e.getMonth()+t.getMonth()}_clear(){this._selectDate("")}_close(){this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}_cancel(){this.focusedDate=this.selectedDate,this._close()}_preventDefault(t){t.preventDefault()}__toggleDate(t){Ia(t,this.selectedDate)?(this._clear(),this.focusedDate=t):this._selectDate(t)}__onMonthCalendarKeyDown(t){let e=!1;switch(t.key){case"ArrowDown":this._moveFocusByDays(7),e=!0;break;case"ArrowUp":this._moveFocusByDays(-7),e=!0;break;case"ArrowRight":this._moveFocusByDays(this.__isRTL?-1:1),e=!0;break;case"ArrowLeft":this._moveFocusByDays(this.__isRTL?1:-1),e=!0;break;case"Enter":this._selectDate(this.focusedDate)&&(this._close(),e=!0);break;case" ":this.__toggleDate(this.focusedDate),e=!0;break;case"Home":this._moveFocusInsideMonth(this.focusedDate,"minDate"),e=!0;break;case"End":this._moveFocusInsideMonth(this.focusedDate,"maxDate"),e=!0;break;case"PageDown":this._moveFocusByMonths(t.shiftKey?12:1),e=!0;break;case"PageUp":this._moveFocusByMonths(t.shiftKey?-12:-1),e=!0;break;case"Tab":this._onTabKeyDown(t,"calendar")}e&&(t.preventDefault(),t.stopPropagation())}_onTabKeyDown(t,e){switch(t.stopPropagation(),e){case"calendar":t.shiftKey&&(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusCancel():this.__focusInput());break;case"today":t.shiftKey&&(t.preventDefault(),this.focusDateElement());break;case"cancel":t.shiftKey||(t.preventDefault(),this.hasAttribute("fullscreen")?this.focusDateElement():this.__focusInput())}}__onTodayButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"today")}__onCancelButtonKeyDown(t){"Tab"===t.key&&this._onTabKeyDown(t,"cancel")}__focusInput(){this.dispatchEvent(new CustomEvent("focus-input",{bubbles:!0,composed:!0}))}__tryFocusDate(){if(this.__pendingDateFocus){const t=this.focusableDateElement;t&&Ia(t.date,this.__pendingDateFocus)&&(delete this.__pendingDateFocus,t.focus())}}focusDate(t,e){return Gt(this,null,(function*(){const i=t||this.selectedDate||this.initialPosition||new Date;this.focusedDate=i,e||(this._focusedMonthDate=i.getDate()),yield this.focusDateElement(!1)}))}focusDateElement(t=!0){return Gt(this,null,(function*(){this.__pendingDateFocus=this.focusedDate,this.calendars.length||(yield new Promise((t=>{Xs(this,(()=>{La(),t()}))}))),t&&this.revealDate(this.focusedDate),this._revealPromise&&(yield this._revealPromise),this.__tryFocusDate()}))}_focusClosestDate(t){this.focusDate(Na(t,[this.minDate,this.maxDate]))}_focusAllowedDate(t,e,i){this._dateAllowed(t,void 0,void 0,(()=>!1))?this.focusDate(t,i):this._dateAllowed(this.focusedDate)?this.focusDate(e>0?this.maxDate:this.minDate):this._focusClosestDate(this.focusedDate)}_getDateDiff(t,e){const i=new Date(0,0);return i.setFullYear(this.focusedDate.getFullYear()),i.setMonth(this.focusedDate.getMonth()+t),e&&i.setDate(this.focusedDate.getDate()+e),i}_moveFocusByDays(t){const e=this._getDateDiff(0,t);this._focusAllowedDate(e,t,!1)}_moveFocusByMonths(t){const e=this._getDateDiff(t),i=e.getMonth();this._focusedMonthDate||(this._focusedMonthDate=this.focusedDate.getDate()),e.setDate(this._focusedMonthDate),e.getMonth()!==i&&e.setDate(0),this._focusAllowedDate(e,t,!0)}_moveFocusInsideMonth(t,e){const i=new Date(0,0);i.setFullYear(t.getFullYear()),"minDate"===e?(i.setMonth(t.getMonth()),i.setDate(1)):(i.setMonth(t.getMonth()+1),i.setDate(0)),this._dateAllowed(i)?this.focusDate(i):this._dateAllowed(t)?this.focusDate(this[e]):this._focusClosestDate(t)}_dateAllowed(t,e=this.minDate,i=this.maxDate,o=this.isDateDisabled){return Da(t,e,i,o)}_isTodayAllowed(t,e,i){return this._dateAllowed(this._getTodayMidnight(),t,e,i)}_getTodayMidnight(){const t=new Date,e=new Date(0,0);return e.setFullYear(t.getFullYear()),e.setMonth(t.getMonth()),e.setDate(t.getDate()),e}}
|
|
3776
3776
|
/**
|
|
3777
3777
|
* @license
|
|
3778
3778
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3783,7 +3783,7 @@ class nl{constructor(t,e){this.query=t,this.callback=e,this._boundQueryHandler=t
|
|
|
3783
3783
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3784
3784
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3785
3785
|
*/
|
|
3786
|
-
|
|
3786
|
+
fi("vaadin-date-picker-overlay-content",ee`
|
|
3787
3787
|
:host {
|
|
3788
3788
|
display: flex;
|
|
3789
3789
|
flex-direction: column;
|
|
@@ -3843,7 +3843,7 @@ ci("vaadin-date-picker-overlay-content",Xt`
|
|
|
3843
3843
|
z-index: 2;
|
|
3844
3844
|
flex-shrink: 0;
|
|
3845
3845
|
}
|
|
3846
|
-
`,{moduleId:"vaadin-date-picker-overlay-content-styles"});class
|
|
3846
|
+
`,{moduleId:"vaadin-date-picker-overlay-content-styles"});class ul extends(dl(bs(wi(nn(jr))))){static get template(){return Pr`
|
|
3847
3847
|
<div part="overlay-header" on-touchend="_preventDefault" aria-hidden="true">
|
|
3848
3848
|
<div part="label">[[_formatDisplayed(selectedDate, i18n, label)]]</div>
|
|
3849
3849
|
<div part="clear-button" hidden$="[[!selectedDate]]"></div>
|
|
@@ -3863,23 +3863,23 @@ ci("vaadin-date-picker-overlay-content",Xt`
|
|
|
3863
3863
|
<slot name="today-button"></slot>
|
|
3864
3864
|
<slot name="cancel-button"></slot>
|
|
3865
3865
|
</div>
|
|
3866
|
-
`}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}
|
|
3866
|
+
`}static get is(){return"vaadin-date-picker-overlay-content"}ready(){super.ready(),this.setAttribute("role","dialog"),this._addListeners(),this._initControllers()}}Yt(ul);
|
|
3867
3867
|
/**
|
|
3868
3868
|
* @license
|
|
3869
3869
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3870
3870
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3871
3871
|
*/
|
|
3872
|
-
const
|
|
3872
|
+
const pl=new WeakMap,ml=qi((t=>class extends t{get slotStyles(){return{}}connectedCallback(){super.connectedCallback(),this.__applySlotStyles()}__applySlotStyles(){const t=this.getRootNode(),e=function(t){return pl.has(t)||pl.set(t,new Set),pl.get(t)}(t);this.slotStyles.forEach((i=>{e.has(i)||(function(t,e){const i=document.createElement("style");i.textContent=t,e===document?document.head.appendChild(i):e.insertBefore(i,e.firstChild)}(i,t),e.add(i))}))}})),fl=t=>class extends(cs(Yn(t))){static get properties(){return{clearButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1}}}get clearElement(){return console.warn(`Please implement the 'clearElement' property in <${this.localName}>`),null}ready(){super.ready(),this.clearElement&&(this.clearElement.addEventListener("mousedown",(t=>this._onClearButtonMouseDown(t))),this.clearElement.addEventListener("click",(t=>this._onClearButtonClick(t))))}_onClearButtonClick(t){t.preventDefault(),this._onClearAction()}_onClearButtonMouseDown(t){t.preventDefault(),ia||this.inputElement.focus()}_onEscape(t){super._onEscape(t),this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_onClearAction(){this._inputElementValue="",this.inputElement.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.inputElement.dispatchEvent(new Event("change",{bubbles:!0}))}}
|
|
3873
3873
|
/**
|
|
3874
3874
|
* @license
|
|
3875
3875
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3876
3876
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3877
|
-
*/,
|
|
3877
|
+
*/,vl=qi((t=>class extends(hs(As(cs(t)))){static get constraints(){return["required"]}static get delegateAttrs(){return[...super.delegateAttrs,"required"]}ready(){super.ready(),this._createConstraintsObserver()}checkValidity(){return this.inputElement&&this._hasValidConstraints(this.constructor.constraints.map((t=>this[t])))?this.inputElement.checkValidity():!this.invalid}_hasValidConstraints(t){return t.some((t=>this.__isValidConstraint(t)))}_createConstraintsObserver(){this._createMethodObserver(`_constraintsChanged(stateTarget, ${this.constructor.constraints.join(", ")})`)}_constraintsChanged(t,...e){if(!t)return;const i=this._hasValidConstraints(e),o=this.__previousHasConstraints&&!i;(this._hasValue||this.invalid)&&i?this.validate():o&&this._setInvalid(!1),this.__previousHasConstraints=i}_onChange(t){t.stopPropagation(),this.validate(),this.dispatchEvent(new CustomEvent("change",{detail:{sourceEvent:t},bubbles:t.bubbles,cancelable:t.cancelable}))}__isValidConstraint(t){return!!t||0===t}})),gl=t=>class extends(ml(ls(vl(zs(fl(Yn(t))))))){static get properties(){return{allowedCharPattern:{type:String,observer:"_allowedCharPatternChanged"},autoselect:{type:Boolean,value:!1},name:{type:String,reflectToAttribute:!0},placeholder:{type:String,reflectToAttribute:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},title:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"name","type","placeholder","readonly","invalid","title"]}constructor(){super(),this._boundOnPaste=this._onPaste.bind(this),this._boundOnDrop=this._onDrop.bind(this),this._boundOnBeforeInput=this._onBeforeInput.bind(this)}get slotStyles(){return["\n :is(input[slot='input'], textarea[slot='textarea'])::placeholder {\n font: inherit;\n color: inherit;\n }\n "]}_onFocus(t){super._onFocus(t),this.autoselect&&this.inputElement&&this.inputElement.select()}_onChange(t){t.stopPropagation(),this.validate(),this.dispatchEvent(new CustomEvent("change",{detail:{sourceEvent:t},bubbles:t.bubbles,cancelable:t.cancelable}))}_addInputListeners(t){super._addInputListeners(t),t.addEventListener("paste",this._boundOnPaste),t.addEventListener("drop",this._boundOnDrop),t.addEventListener("beforeinput",this._boundOnBeforeInput)}_removeInputListeners(t){super._removeInputListeners(t),t.removeEventListener("paste",this._boundOnPaste),t.removeEventListener("drop",this._boundOnDrop),t.removeEventListener("beforeinput",this._boundOnBeforeInput)}_onKeyDown(t){super._onKeyDown(t),this.allowedCharPattern&&!this.__shouldAcceptKey(t)&&t.target===this.inputElement&&(t.preventDefault(),this._markInputPrevented())}_markInputPrevented(){this.setAttribute("input-prevented",""),this._preventInputDebouncer=Kr.debounce(this._preventInputDebouncer,qr.after(200),(()=>{this.removeAttribute("input-prevented")}))}__shouldAcceptKey(t){return t.metaKey||t.ctrlKey||!t.key||1!==t.key.length||this.__allowedCharRegExp.test(t.key)}_onPaste(t){if(this.allowedCharPattern){const e=t.clipboardData.getData("text");this.__allowedTextRegExp.test(e)||(t.preventDefault(),this._markInputPrevented())}}_onDrop(t){if(this.allowedCharPattern){const e=t.dataTransfer.getData("text");this.__allowedTextRegExp.test(e)||(t.preventDefault(),this._markInputPrevented())}}_onBeforeInput(t){this.allowedCharPattern&&t.data&&!this.__allowedTextRegExp.test(t.data)&&(t.preventDefault(),this._markInputPrevented())}_allowedCharPatternChanged(t){if(t)try{this.__allowedCharRegExp=new RegExp(`^${t}$`,"u"),this.__allowedTextRegExp=new RegExp(`^${t}*$`,"u")}catch(t){console.error(t)}}}
|
|
3878
3878
|
/**
|
|
3879
3879
|
* @license
|
|
3880
3880
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
3881
3881
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3882
|
-
*/,
|
|
3882
|
+
*/,bl=ee`
|
|
3883
3883
|
:host {
|
|
3884
3884
|
display: inline-flex;
|
|
3885
3885
|
outline: none;
|
|
@@ -3918,7 +3918,7 @@ const ll=new WeakMap,hl=Ri((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3918
3918
|
* @license
|
|
3919
3919
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
3920
3920
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3921
|
-
*/,
|
|
3921
|
+
*/,yl=ee`
|
|
3922
3922
|
[class$='container'] {
|
|
3923
3923
|
display: flex;
|
|
3924
3924
|
flex-direction: column;
|
|
@@ -3931,7 +3931,7 @@ const ll=new WeakMap,hl=Ri((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3931
3931
|
* @license
|
|
3932
3932
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
3933
3933
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3934
|
-
*/,
|
|
3934
|
+
*/,wl=[bl,yl,ee`
|
|
3935
3935
|
[part='clear-button'] {
|
|
3936
3936
|
display: none;
|
|
3937
3937
|
cursor: default;
|
|
@@ -3949,17 +3949,17 @@ const ll=new WeakMap,hl=Ri((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3949
3949
|
* @license
|
|
3950
3950
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
3951
3951
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3952
|
-
*/],
|
|
3952
|
+
*/],xl=t=>class extends t{static get properties(){return{overlayClass:{type:String},_overlayElement:{type:Object}}}static get observers(){return["__updateOverlayClassNames(overlayClass, _overlayElement)"]}__updateOverlayClassNames(t,e){if(!e||void 0===t)return;const{classList:i}=e;if(this.__initialClasses||(this.__initialClasses=new Set(i)),Array.isArray(this.__previousClasses)){const t=this.__previousClasses.filter((t=>!this.__initialClasses.has(t)));t.length>0&&i.remove(...t)}const o="string"==typeof t?t.split(" ").filter(Boolean):[];o.length>0&&i.add(...o),this.__previousClasses=o}}
|
|
3953
3953
|
/**
|
|
3954
3954
|
* @license
|
|
3955
3955
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
3956
3956
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3957
|
-
*/;class
|
|
3957
|
+
*/;class _l{constructor(t){this.host=t,t.addEventListener("opened-changed",(()=>{t.opened||this.__setVirtualKeyboardEnabled(!1)})),t.addEventListener("blur",(()=>this.__setVirtualKeyboardEnabled(!0))),t.addEventListener("touchstart",(()=>this.__setVirtualKeyboardEnabled(!0)))}__setVirtualKeyboardEnabled(t){this.host.inputElement&&(this.host.inputElement.inputMode=t?"":"none")}}
|
|
3958
3958
|
/**
|
|
3959
3959
|
* @license
|
|
3960
3960
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3961
3961
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3962
|
-
*/const bl=t=>class extends(vl(ps(os(dl(Vn(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let o,r=i.getMonth(),n=i.getFullYear();if(3===e.length?(r=parseInt(e[0])-1,o=parseInt(e[1]),n=parseInt(e[2]),e[2].length<3&&n>=0&&(n=function(t,e,i=0,o=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let r=e+100*Math.floor(t.getFullYear()/100);return t<new Date(r-50,i,o)?r-=100:t>new Date(r+50,i,o)&&(r+=100),r}(this.referenceDate?Ia(this.referenceDate):new Date,n,r,o))):2===e.length?(r=parseInt(e[0])-1,o=parseInt(e[1])):1===e.length&&(o=parseInt(e[0])),void 0!==o)return{day:o,month:r,year:n}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},isDateDisabled:{type:Function},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:Js},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers, isDateDisabled)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&!Gn()&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new nl(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new gl(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=Ia(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(Sa(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||Ta(this._selectedDate,this._minDate,this._maxDate,this.isDateDisabled);let o=!0;return this.inputElement&&(this.inputElement.checkValidity?o=this.inputElement.checkValidity():this.inputElement.validate&&(o=this.inputElement.validate())),e&&i&&o}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!(!this.opened||null===e||e===document.body||this.contains(e)||this._overlayContent.contains(e))||!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,o,r,n){return!t||e&&(!n||r)||i&&r||!o.parseDate}_formatISO(t){return function(t){return t instanceof Date?function(t){const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",o="0000",r=t.year;return r<0?(r=-r,i="-",o="000000"):t.year>=1e4&&(i="+",o="000000"),[i+e(r,o),e(t.month+1),e(t.day)].join("-")}({year:t.getFullYear(),month:t.getMonth(),day:t.getDate()}):""}(t)}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0===t||void 0===e||(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0===t||void 0===e||!this._ignoreFocusedDateChange&&!this._noInput&&this._applyInputValue(t)}_valueChanged(t,e){const i=Ia(t);!t||i?(t?Ca(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,o,r,n,s,a,l){t&&(t.i18n=e,t.label=i,t.minDate=o,t.maxDate=r,t.focusedDate=n,t.selectedDate=s,t.showWeekNumbers=a,t.isDateDisabled=l)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._closedByEscape=!0,this._close(),this._closedByEscape=!1}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const o=this._nativeInput;this._noInput&&o&&(o.blur(),this._overlayContent.focusDateElement()),this.__showOthers=ra(this._noInput?t:[o,t])}_getInitialPosition(){const t=Ia(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||Ta(e,this._minDate,this._maxDate,this.isDateDisabled)?e:this._minDate||this._maxDate?Aa(e,[this._minDate,this._maxDate]):new Date}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this.__parseDate(this._inputElementValue||"");t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this._closedByEscape&&this._applyInputValue(this._selectedDate),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),!this.value&&!this._keyboardActive&&this.validate()}_onScroll(t){(t.target===window||!this._overlayContent.contains(t.target))&&this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){(!this.autoOpenDisabled||this._noInput)&&(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened){if(this.clearButtonVisible&&this.value&&!this.readonly)return t.stopPropagation(),void this._onClearButtonClick(t);""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate)}}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(!this.opened&&this._inputElementValue&&!this.autoOpenDisabled&&this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,Ca(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return Ia(t)}}
|
|
3962
|
+
*/const kl=t=>class extends(xl(bs(ls(vl(Yn(t)))))){static get properties(){return{_selectedDate:{type:Object,sync:!0},_focusedDate:{type:Object,sync:!0},value:{type:String,notify:!0,value:"",sync:!0},initialPosition:String,opened:{type:Boolean,reflectToAttribute:!0,notify:!0,observer:"_openedChanged",sync:!0},autoOpenDisabled:Boolean,showWeekNumbers:{type:Boolean,value:!1,sync:!0},_fullscreen:{type:Boolean,value:!1,sync:!0},_fullscreenMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},i18n:{type:Object,sync:!0,value:()=>({monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],firstDayOfWeek:0,today:"Today",cancel:"Cancel",referenceDate:"",formatDate(t){const e=String(t.year).replace(/\d+/u,(t=>"0000".substr(t.length)+t));return[t.month+1,t.day,e].join("/")},parseDate(t){const e=t.split("/"),i=new Date;let o,r=i.getMonth(),n=i.getFullYear();if(3===e.length?(r=parseInt(e[0])-1,o=parseInt(e[1]),n=parseInt(e[2]),e[2].length<3&&n>=0&&(n=function(t,e,i=0,o=1){if(e>99)throw new Error("The provided year cannot have more than 2 digits.");if(e<0)throw new Error("The provided year cannot be negative.");let r=e+100*Math.floor(t.getFullYear()/100);return t<new Date(r-50,i,o)?r-=100:t>new Date(r+50,i,o)&&(r+=100),r}(this.referenceDate?Ea(this.referenceDate):new Date,n,r,o))):2===e.length?(r=parseInt(e[0])-1,o=parseInt(e[1])):1===e.length&&(o=parseInt(e[0])),void 0!==o)return{day:o,month:r,year:n}},formatTitle:(t,e)=>`${t} ${e}`})},min:{type:String,sync:!0},max:{type:String,sync:!0},isDateDisabled:{type:Function},_minDate:{type:Date,computed:"__computeMinOrMaxDate(min)",sync:!0},_maxDate:{type:Date,computed:"__computeMinOrMaxDate(max)",sync:!0},_noInput:{type:Boolean,computed:"_isNoInput(inputElement, _fullscreen, _ios, i18n, opened, autoOpenDisabled)"},_ios:{type:Boolean,value:ta},_focusOverlayOnOpen:Boolean,_overlayContent:{type:Object,sync:!0},_hasInputValue:{type:Boolean}}}static get observers(){return["_selectedDateChanged(_selectedDate, i18n)","_focusedDateChanged(_focusedDate, i18n)","__updateOverlayContent(_overlayContent, i18n, label, _minDate, _maxDate, _focusedDate, _selectedDate, showWeekNumbers, isDateDisabled)","__updateOverlayContentTheme(_overlayContent, _theme)","__updateOverlayContentFullScreen(_overlayContent, _fullscreen)"]}static get constraints(){return[...super.constraints,"min","max"]}constructor(){super(),this._boundOnClick=this._onClick.bind(this),this._boundOnScroll=this._onScroll.bind(this),this._boundOverlayRenderer=this._overlayRenderer.bind(this)}get _inputElementValue(){return super._inputElementValue}set _inputElementValue(t){super._inputElementValue=t,this._hasInputValue=!1}get clearElement(){return null}get _nativeInput(){return this.inputElement?this.inputElement.focusElement||this.inputElement:null}get __unparsableValue(){return!this._inputElementValue||this.__parseDate(this._inputElementValue)?"":this._inputElementValue}_onFocus(t){super._onFocus(t),this._noInput&&!Zn()&&t.target.blur()}_onBlur(t){super._onBlur(t),this.opened||(this.__commitParsedOrFocusedDate(),document.hasFocus()&&this.validate())}ready(){super.ready(),this.addEventListener("click",this._boundOnClick),this.addController(new cl(this._fullscreenMediaQuery,(t=>{this._fullscreen=t}))),this.addController(new _l(this));const t=this.$.overlay;this._overlayElement=t,t.renderer=this._boundOverlayRenderer,this.addEventListener("mousedown",(()=>this.__bringToFront())),this.addEventListener("touchstart",(()=>this.__bringToFront()))}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.$.overlay.close()}_overlayRenderer(t){if(t.firstChild)return;const e=document.createElement("vaadin-date-picker-overlay-content");t.appendChild(e),this._overlayContent=e,e.addEventListener("close",(()=>{this._close()})),e.addEventListener("focus-input",this._focusAndSelect.bind(this)),e.addEventListener("date-tap",(t=>{this.__commitDate(t.detail.date),this._close()})),e.addEventListener("date-selected",(t=>{this.__commitDate(t.detail.date)})),e.addEventListener("focusin",(()=>{this._keyboardActive&&this._setFocused(!0)})),e.addEventListener("focusout",(t=>{this._shouldRemoveFocus(t)&&this._setFocused(!1)})),e.addEventListener("focused-date-changed",(t=>{this._focusedDate=t.detail.value})),e.addEventListener("click",(t=>t.stopPropagation()))}__parseDate(t){if(!this.i18n.parseDate)return;let e=this.i18n.parseDate(t);return e&&(e=Ea(`${e.year}-${e.month+1}-${e.day}`)),e&&!isNaN(e.getTime())?e:void 0}__formatDate(t){if(this.i18n.formatDate)return this.i18n.formatDate(Ma(t))}checkValidity(){const t=this._inputElementValue,e=!t||!!this._selectedDate&&t===this.__formatDate(this._selectedDate),i=!this._selectedDate||Da(this._selectedDate,this._minDate,this._maxDate,this.isDateDisabled);let o=!0;return this.inputElement&&(this.inputElement.checkValidity?o=this.inputElement.checkValidity():this.inputElement.validate&&(o=this.inputElement.validate())),e&&i&&o}_shouldSetFocus(t){return!this._shouldKeepFocusRing}_shouldRemoveFocus(t){const{relatedTarget:e}=t;return!(!this.opened||null===e||e===document.body||this.contains(e)||this._overlayContent.contains(e))||!this.opened}_setFocused(t){super._setFocused(t),this._shouldKeepFocusRing=t&&this._keyboardActive}__commitValueChange(){const t=this.__unparsableValue;this.__committedValue!==this.value?(this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))):this.__committedUnparsableValue!==t&&(this.validate(),this.dispatchEvent(new CustomEvent("unparsable-change"))),this.__committedValue=this.value,this.__committedUnparsableValue=t}__commitDate(t){this.__keepCommittedValue=!0,this._selectedDate=t,this.__keepCommittedValue=!1,this.__commitValueChange()}_close(){this._focus(),this.close()}__bringToFront(){requestAnimationFrame((()=>{this.$.overlay.bringToFront()}))}_isNoInput(t,e,i,o,r,n){return!t||e&&(!n||r)||i&&r||!o.parseDate}_formatISO(t){return function(t){return t instanceof Date?function(t){const e=(t,e="00")=>(e+t).substr((e+t).length-e.length);let i="",o="0000",r=t.year;return r<0?(r=-r,i="-",o="000000"):t.year>=1e4&&(i="+",o="000000"),[i+e(r,o),e(t.month+1),e(t.day)].join("-")}({year:t.getFullYear(),month:t.getMonth(),day:t.getDate()}):""}(t)}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.autocomplete="off",t.setAttribute("role","combobox"),t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded",!!this.opened),this._applyInputValue(this._selectedDate))}_openedChanged(t){this.inputElement&&this.inputElement.setAttribute("aria-expanded",t)}_selectedDateChanged(t,e){void 0===t||void 0===e||(this.__keepInputValue||this._applyInputValue(t),this.value=this._formatISO(t),this._ignoreFocusedDateChange=!0,this._focusedDate=t,this._ignoreFocusedDateChange=!1)}_focusedDateChanged(t,e){void 0===t||void 0===e||!this._ignoreFocusedDateChange&&!this._noInput&&this._applyInputValue(t)}_valueChanged(t,e){const i=Ea(t);!t||i?(t?Ia(this._selectedDate,i)||(this._selectedDate=i,void 0!==e&&this.validate()):this._selectedDate=null,this.__keepCommittedValue||(this.__committedValue=this.value,this.__committedUnparsableValue=""),this._toggleHasValue(this._hasValue)):this.value=e}__updateOverlayContent(t,e,i,o,r,n,s,a,l){t&&(t.i18n=e,t.label=i,t.minDate=o,t.maxDate=r,t.focusedDate=n,t.selectedDate=s,t.showWeekNumbers=a,t.isDateDisabled=l)}__updateOverlayContentTheme(t,e){t&&(e?t.setAttribute("theme",e):t.removeAttribute("theme"))}__updateOverlayContentFullScreen(t,e){t&&t.toggleAttribute("fullscreen",e)}_onOverlayEscapePress(){this._focusedDate=this._selectedDate,this._closedByEscape=!0,this._close(),this._closedByEscape=!1}_onOverlayOpened(){const t=this._overlayContent;t.reset();const e=this._getInitialPosition();t.initialPosition=e;const i=t.focusedDate||e;t.scrollToDate(i),this._ignoreFocusedDateChange=!0,t.focusedDate=i,this._ignoreFocusedDateChange=!1,window.addEventListener("scroll",this._boundOnScroll,!0),this._focusOverlayOnOpen?(t.focusDateElement(),this._focusOverlayOnOpen=!1):this._focus();const o=this._nativeInput;this._noInput&&o&&(o.blur(),this._overlayContent.focusDateElement()),this.__showOthers=ha(this._noInput?t:[o,t])}_getInitialPosition(){const t=Ea(this.initialPosition),e=this._selectedDate||this._overlayContent.initialPosition||t||new Date;return t||Da(e,this._minDate,this._maxDate,this.isDateDisabled)?e:this._minDate||this._maxDate?Na(e,[this._minDate,this._maxDate]):new Date}__commitParsedOrFocusedDate(){if(this._ignoreFocusedDateChange=!0,this.i18n.parseDate){const t=this.__parseDate(this._inputElementValue||"");t?this.__commitDate(t):(this.__keepInputValue=!0,this.__commitDate(null),this.__keepInputValue=!1)}else this._focusedDate&&this.__commitDate(this._focusedDate);this._ignoreFocusedDateChange=!1}_onOverlayClosed(){this.__showOthers&&(this.__showOthers(),this.__showOthers=null),window.removeEventListener("scroll",this._boundOnScroll,!0),this._closedByEscape&&this._applyInputValue(this._selectedDate),this.__commitParsedOrFocusedDate(),this._nativeInput&&this._nativeInput.selectionStart&&(this._nativeInput.selectionStart=this._nativeInput.selectionEnd),!this.value&&!this._keyboardActive&&this.validate()}_onScroll(t){(t.target===window||!this._overlayContent.contains(t.target))&&this._overlayContent._repositionYearScroller()}_focus(){this._noInput||this.inputElement.focus()}_focusAndSelect(){this._focus(),this._setSelectionRange(0,this._inputElementValue.length)}_applyInputValue(t){this._inputElementValue=t?this.__formatDate(t):""}_setSelectionRange(t,e){this._nativeInput&&this._nativeInput.setSelectionRange&&this._nativeInput.setSelectionRange(t,e)}_onChange(t){t.stopPropagation()}_onClick(t){this._isClearButton(t)||this._onHostClick(t)}_onHostClick(t){(!this.autoOpenDisabled||this._noInput)&&(t.preventDefault(),this.open())}_onClearButtonClick(t){t.preventDefault(),this.__commitDate(null)}_onKeyDown(t){switch(super._onKeyDown(t),this._noInput&&-1===[9].indexOf(t.keyCode)&&t.preventDefault(),t.key){case"ArrowDown":case"ArrowUp":t.preventDefault(),this.opened?this._overlayContent.focusDateElement():(this._focusOverlayOnOpen=!0,this.open());break;case"Tab":this.opened&&(t.preventDefault(),t.stopPropagation(),this._setSelectionRange(0,0),t.shiftKey?this._overlayContent.focusCancel():this._overlayContent.focusDateElement())}}_onEnter(t){this.opened?this.close():this.__commitParsedOrFocusedDate()}_onEscape(t){if(!this.opened){if(this.clearButtonVisible&&this.value&&!this.readonly)return t.stopPropagation(),void this._onClearButtonClick(t);""===this.inputElement.value?this.__commitDate(null):this._applyInputValue(this._selectedDate)}}_isClearButton(t){return t.composedPath()[0]===this.clearElement}_onInput(){if(!this.opened&&this._inputElementValue&&!this.autoOpenDisabled&&this.open(),this._inputElementValue){const t=this.__parseDate(this._inputElementValue);t&&(this._ignoreFocusedDateChange=!0,Ia(t,this._focusedDate)||(this._focusedDate=t),this._ignoreFocusedDateChange=!1)}}__computeMinOrMaxDate(t){return Ea(t)}}
|
|
3963
3963
|
/**
|
|
3964
3964
|
* @license
|
|
3965
3965
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
@@ -3970,7 +3970,7 @@ const ll=new WeakMap,hl=Ri((t=>class extends t{get slotStyles(){return{}}connect
|
|
|
3970
3970
|
* Copyright (c) 2016 - 2024 Vaadin Ltd.
|
|
3971
3971
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
3972
3972
|
*/
|
|
3973
|
-
|
|
3973
|
+
fi("vaadin-date-picker",[wl,ee`
|
|
3974
3974
|
:host([opened]) {
|
|
3975
3975
|
pointer-events: auto;
|
|
3976
3976
|
}
|
|
@@ -3983,7 +3983,7 @@ ci("vaadin-date-picker",[fl,Xt`
|
|
|
3983
3983
|
direction: rtl;
|
|
3984
3984
|
text-align: left;
|
|
3985
3985
|
}
|
|
3986
|
-
`],{moduleId:"vaadin-date-picker-styles"});class
|
|
3986
|
+
`],{moduleId:"vaadin-date-picker-styles"});class Cl extends(kl(gl(wi(ln(jr))))){static get is(){return"vaadin-date-picker"}static get template(){return Pr`
|
|
3987
3987
|
<div class="vaadin-date-picker-container">
|
|
3988
3988
|
<div part="label">
|
|
3989
3989
|
<slot name="label"></slot>
|
|
@@ -4025,29 +4025,29 @@ ci("vaadin-date-picker",[fl,Xt`
|
|
|
4025
4025
|
></vaadin-date-picker-overlay>
|
|
4026
4026
|
|
|
4027
4027
|
<slot name="tooltip"></slot>
|
|
4028
|
-
`}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new
|
|
4028
|
+
`}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new Is(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}),{uniqueIdPrefix:"search-input"})),this.addController(new Ms(this.inputElement,this._labelController)),this._tooltipController=new gn(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this.shadowRoot.querySelector('[part="toggle-button"]').addEventListener("mousedown",(t=>t.preventDefault())),this.$.overlay.addEventListener("vaadin-overlay-close",this._onVaadinOverlayClose.bind(this))}_onVaadinOverlayClose(t){t.detail.sourceEvent&&t.detail.sourceEvent.composedPath().includes(this)&&t.preventDefault()}_toggle(t){t.stopPropagation(),this.$.overlay.opened?this.close():this.open()}_openedChanged(t){super._openedChanged(t),this.$.overlay.positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this.$.overlay.noVerticalOverlap=!0}}Yt(Cl),
|
|
4029
4029
|
/**
|
|
4030
4030
|
* @license
|
|
4031
4031
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
4032
4032
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4033
4033
|
*/
|
|
4034
|
-
|
|
4034
|
+
fi("vaadin-text-field",Us,{moduleId:"lumo-text-field-styles"});
|
|
4035
4035
|
/**
|
|
4036
4036
|
* @license
|
|
4037
4037
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4038
4038
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4039
4039
|
*/
|
|
4040
|
-
const
|
|
4040
|
+
const Sl=t=>class extends(gl(t)){static get properties(){return{autocomplete:{type:String},autocorrect:{type:String},autocapitalize:{type:String,reflectToAttribute:!0}}}static get delegateAttrs(){return[...super.delegateAttrs,"autocapitalize","autocomplete","autocorrect"]}get __data(){return this.__dataValue||{}}set __data(t){this.__dataValue=t}_inputElementChanged(t){super._inputElementChanged(t),t&&(t.value&&t.value!==this.value&&(console.warn(`Please define value on the <${this.localName}> component!`),t.value=""),this.value&&(t.value=this.value))}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}_onInput(t){super._onInput(t),this.invalid&&this.validate()}_valueChanged(t,e){super._valueChanged(t,e),void 0!==e&&this.invalid&&this.validate()}}
|
|
4041
4041
|
/**
|
|
4042
4042
|
* @license
|
|
4043
4043
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4044
4044
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4045
|
-
*/,
|
|
4045
|
+
*/,Tl=t=>class extends(Sl(t)){static get properties(){return{maxlength:{type:Number},minlength:{type:Number},pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"maxlength","minlength","pattern"]}static get constraints(){return[...super.constraints,"maxlength","minlength","pattern"]}constructor(){super(),this._setType("text")}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new Is(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new Ms(this.inputElement,this._labelController))}}
|
|
4046
4046
|
/**
|
|
4047
4047
|
* @license
|
|
4048
4048
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
4049
4049
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4050
|
-
*/;
|
|
4050
|
+
*/;fi("vaadin-text-field",wl,{moduleId:"vaadin-text-field-styles"});class Al extends(Tl(wi(ln(jr)))){static get is(){return"vaadin-text-field"}static get template(){return Pr`
|
|
4051
4051
|
<div class="vaadin-field-container">
|
|
4052
4052
|
<div part="label">
|
|
4053
4053
|
<slot name="label"></slot>
|
|
@@ -4076,7 +4076,7 @@ const wl=t=>class extends(ul(t)){static get properties(){return{autocomplete:{ty
|
|
|
4076
4076
|
</div>
|
|
4077
4077
|
</div>
|
|
4078
4078
|
<slot name="tooltip"></slot>
|
|
4079
|
-
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new
|
|
4079
|
+
`}static get properties(){return{maxlength:{type:Number},minlength:{type:Number}}}ready(){super.ready(),this._tooltipController=new gn(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this.addController(this._tooltipController)}}Yt(Al),fi("vaadin-password-field-button",[Fs,ee`
|
|
4080
4080
|
:host {
|
|
4081
4081
|
position: absolute;
|
|
4082
4082
|
right: 0;
|
|
@@ -4089,7 +4089,7 @@ const wl=t=>class extends(ul(t)){static get properties(){return{autocomplete:{ty
|
|
|
4089
4089
|
background: transparent;
|
|
4090
4090
|
outline: none;
|
|
4091
4091
|
}
|
|
4092
|
-
`],{moduleId:"lumo-password-field-button"}),
|
|
4092
|
+
`],{moduleId:"lumo-password-field-button"}),fi("vaadin-password-field",[Us,ee`
|
|
4093
4093
|
[part='reveal-button']::before {
|
|
4094
4094
|
content: var(--lumo-icons-eye);
|
|
4095
4095
|
}
|
|
@@ -4113,22 +4113,22 @@ const wl=t=>class extends(ul(t)){static get properties(){return{autocomplete:{ty
|
|
|
4113
4113
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4114
4114
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4115
4115
|
*/
|
|
4116
|
-
|
|
4116
|
+
fi("vaadin-password-field-button",Sa,{moduleId:"vaadin-password-field-button-styles"});class zl extends(Ta(nn(wi(jr)))){static get is(){return"vaadin-password-field-button"}static get template(){return Pr``}}Yt(zl);
|
|
4117
4117
|
/**
|
|
4118
4118
|
* @license
|
|
4119
4119
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4120
4120
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4121
4121
|
*/
|
|
4122
|
-
const
|
|
4122
|
+
const Il=t=>class extends(ml(Gn(ss(cs(t))))){static get properties(){return{revealButtonHidden:{type:Boolean,observer:"_revealButtonHiddenChanged",value:!1},passwordVisible:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_passwordVisibleChanged",readOnly:!0},i18n:{type:Object,value:()=>({reveal:"Show password"})}}}static get observers(){return["__i18nChanged(i18n)"]}constructor(){super(),this._setType("password"),this.__boundRevealButtonClick=this._onRevealButtonClick.bind(this),this.__boundRevealButtonMouseDown=this._onRevealButtonMouseDown.bind(this),this.__lastChange=""}get slotStyles(){return[...super.slotStyles,`\n ${this.localName} [slot="input"]::-ms-reveal {\n display: none;\n }\n `]}get _revealNode(){return this._revealButtonController&&this._revealButtonController.node}ready(){super.ready(),this._revealPart=this.shadowRoot.querySelector('[part="reveal-button"]'),this._revealButtonController=new vn(this,"reveal","vaadin-password-field-button",{initializer:t=>{t.disabled=this.disabled,t.addEventListener("click",this.__boundRevealButtonClick),t.addEventListener("mousedown",this.__boundRevealButtonMouseDown)}}),this.addController(this._revealButtonController),this.__updateAriaLabel(this.i18n),this._updateToggleState(!1),this._toggleRevealHidden(this.revealButtonHidden),this.inputElement&&(this.inputElement.autocapitalize="off")}_onChange(t){super._onChange(t),this.__lastChange=this.inputElement.value}_shouldSetFocus(t){return t.target===this.inputElement||t.target===this._revealNode}_shouldRemoveFocus(t){return!(t.relatedTarget===this._revealNode||t.relatedTarget===this.inputElement&&t.target===this._revealNode)}_setFocused(t){if(super._setFocused(t),t){const t=this.getRootNode().activeElement===this._revealNode;this.toggleAttribute("focus-ring",this._keyboardActive&&!t)}else this._setPasswordVisible(!1),this.__lastChange!==this.inputElement.value&&(this.__lastChange=this.inputElement.value,this.dispatchEvent(new CustomEvent("change",{bubbles:!0})))}__updateAriaLabel(t){t&&t.reveal&&this._revealNode&&this._revealNode.setAttribute("aria-label",t.reveal)}__i18nChanged(t){this.__updateAriaLabel(t)}_revealButtonHiddenChanged(t){this._toggleRevealHidden(t)}_togglePasswordVisibility(){this._setPasswordVisible(!this.passwordVisible)}_onRevealButtonClick(){this._togglePasswordVisibility()}_onRevealButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_toggleRevealHidden(t){this._revealNode&&(t?(this._revealPart.setAttribute("hidden",""),this._revealNode.setAttribute("tabindex","-1"),this._revealNode.setAttribute("aria-hidden","true")):(this._revealPart.removeAttribute("hidden"),this._revealNode.setAttribute("tabindex","0"),this._revealNode.removeAttribute("aria-hidden")))}_updateToggleState(t){this._revealNode&&this._revealNode.setAttribute("aria-pressed",t?"true":"false")}_passwordVisibleChanged(t){this._setType(t?"text":"password"),this._updateToggleState(t)}_disabledChanged(t,e){super._disabledChanged(t,e),this._revealNode&&(this._revealNode.disabled=t)}}
|
|
4123
4123
|
/**
|
|
4124
4124
|
* @license
|
|
4125
4125
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4126
4126
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4127
|
-
*/,
|
|
4127
|
+
*/,Ml=Pr`
|
|
4128
4128
|
<div part="reveal-button" slot="suffix">
|
|
4129
4129
|
<slot name="reveal"></slot>
|
|
4130
4130
|
</div>
|
|
4131
|
-
`;let
|
|
4131
|
+
`;let Dl;class Nl extends(Il(Al)){static get is(){return"vaadin-password-field"}static get template(){if(!Dl){Dl=super.template.cloneNode(!0);const t=Ml.content.querySelector('[part="reveal-button"]');Dl.content.querySelector('[part="input-field"]').appendChild(t)}return Dl}}Yt(Nl);const Ol=ee`
|
|
4132
4132
|
:host {
|
|
4133
4133
|
display: flex;
|
|
4134
4134
|
align-items: center;
|
|
@@ -4212,7 +4212,7 @@ const Cl=t=>class extends(hl(Un(es(ns(t))))){static get properties(){return{reve
|
|
|
4212
4212
|
width: var(--lumo-icon-size-m);
|
|
4213
4213
|
height: var(--lumo-icon-size-m);
|
|
4214
4214
|
}
|
|
4215
|
-
`;
|
|
4215
|
+
`;fi("vaadin-item",Ol,{moduleId:"lumo-item"});const El=ee`
|
|
4216
4216
|
:host {
|
|
4217
4217
|
transition: background-color 100ms;
|
|
4218
4218
|
overflow: hidden;
|
|
@@ -4224,13 +4224,13 @@ const Cl=t=>class extends(hl(Un(es(ns(t))))){static get properties(){return{reve
|
|
|
4224
4224
|
:host([focused]:not([disabled])) {
|
|
4225
4225
|
box-shadow: inset 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
4226
4226
|
}
|
|
4227
|
-
`;
|
|
4227
|
+
`;fi("vaadin-combo-box-item",[Ol,El],{moduleId:"lumo-combo-box-item"});
|
|
4228
4228
|
/**
|
|
4229
4229
|
* @license
|
|
4230
4230
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
4231
4231
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4232
4232
|
*/
|
|
4233
|
-
const
|
|
4233
|
+
const Pl=ee`
|
|
4234
4234
|
[part~='loader'] {
|
|
4235
4235
|
box-sizing: border-box;
|
|
4236
4236
|
width: var(--lumo-icon-size-s);
|
|
@@ -4272,7 +4272,7 @@ const Ml=Xt`
|
|
|
4272
4272
|
transform: rotate(360deg);
|
|
4273
4273
|
}
|
|
4274
4274
|
}
|
|
4275
|
-
`,
|
|
4275
|
+
`,Bl=ee`
|
|
4276
4276
|
[part='content'] {
|
|
4277
4277
|
padding: 0;
|
|
4278
4278
|
}
|
|
@@ -4293,7 +4293,7 @@ const Ml=Xt`
|
|
|
4293
4293
|
:host([bottom-aligned]) [part~='overlay'] {
|
|
4294
4294
|
margin-bottom: var(--lumo-space-xs);
|
|
4295
4295
|
}
|
|
4296
|
-
`,
|
|
4296
|
+
`,jl=ee`
|
|
4297
4297
|
[part~='loader'] {
|
|
4298
4298
|
position: absolute;
|
|
4299
4299
|
z-index: 1;
|
|
@@ -4301,12 +4301,12 @@ const Ml=Xt`
|
|
|
4301
4301
|
top: var(--lumo-space-s);
|
|
4302
4302
|
margin-inline: auto 0;
|
|
4303
4303
|
}
|
|
4304
|
-
`;
|
|
4304
|
+
`;fi("vaadin-combo-box-overlay",[js,Ls,Bl,Pl,jl,ee`
|
|
4305
4305
|
:host {
|
|
4306
4306
|
--_vaadin-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
4307
4307
|
--_vaadin-combo-box-items-container-border-style: solid;
|
|
4308
4308
|
}
|
|
4309
|
-
`],{moduleId:"lumo-combo-box-overlay"}),
|
|
4309
|
+
`],{moduleId:"lumo-combo-box-overlay"}),fi("vaadin-combo-box",[Us,ee`
|
|
4310
4310
|
[part='toggle-button']::before {
|
|
4311
4311
|
content: var(--lumo-icons-dropdown);
|
|
4312
4312
|
}
|
|
@@ -4316,12 +4316,12 @@ const Ml=Xt`
|
|
|
4316
4316
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4317
4317
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4318
4318
|
*/
|
|
4319
|
-
const
|
|
4319
|
+
const Ll=t=>class extends t{static get properties(){return{index:{type:Number},item:{type:Object},label:{type:String},selected:{type:Boolean,value:!1,reflectToAttribute:!0},focused:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Function}}}static get observers(){return["__rendererOrItemChanged(renderer, index, item, selected, focused)","__updateLabel(label, renderer)"]}static get observedAttributes(){return[...super.observedAttributes,"hidden"]}attributeChangedCallback(t,e,i){"hidden"===t&&null!==i?this.index=void 0:super.attributeChangedCallback(t,e,i)}connectedCallback(){super.connectedCallback(),this._owner=this.parentNode.owner;const t=this._owner.getAttribute("dir");t&&this.setAttribute("dir",t)}requestContentUpdate(){this.renderer&&!this.hidden&&this.renderer(this,this._owner,{index:this.index,item:this.item,focused:this.focused,selected:this.selected})}__rendererOrItemChanged(t,e,i){void 0===i||void 0===e||(this._oldRenderer!==t&&(this.innerHTML="",delete this._$litPart$),t&&(this._oldRenderer=t,this.requestContentUpdate()))}__updateLabel(t,e){e||(this.textContent=t)}}
|
|
4320
4320
|
/**
|
|
4321
4321
|
* @license
|
|
4322
4322
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4323
4323
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4324
|
-
*/;class
|
|
4324
|
+
*/;class $l extends(Ll(wi(nn(jr)))){static get template(){return Pr`
|
|
4325
4325
|
<style>
|
|
4326
4326
|
:host {
|
|
4327
4327
|
display: block;
|
|
@@ -4335,18 +4335,18 @@ const Ol=t=>class extends t{static get properties(){return{index:{type:Number},i
|
|
|
4335
4335
|
<div part="content">
|
|
4336
4336
|
<slot></slot>
|
|
4337
4337
|
</div>
|
|
4338
|
-
`}static get is(){return"vaadin-combo-box-item"}}
|
|
4338
|
+
`}static get is(){return"vaadin-combo-box-item"}}Yt($l);
|
|
4339
4339
|
/**
|
|
4340
4340
|
* @license
|
|
4341
4341
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4342
4342
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4343
4343
|
*/
|
|
4344
|
-
const
|
|
4344
|
+
const Fl=t=>class extends(_a(t)){static get observers(){return["_setOverlayWidth(positionTarget, opened)"]}constructor(){super(),this.requiredVerticalSpace=200}connectedCallback(){super.connectedCallback();const t=this._comboBox,e=t&&t.getAttribute("dir");e&&this.setAttribute("dir",e)}_shouldCloseOnOutsideClick(t){const e=t.composedPath();return!e.includes(this.positionTarget)&&!e.includes(this)}_mouseDownListener(t){super._mouseDownListener(t),this._shouldCloseOnOutsideClick(t)&&!os(t.composedPath()[0])&&t.preventDefault()}_updateOverlayWidth(){const t=this.localName;this.style.setProperty(`--_${t}-default-width`,`${this.positionTarget.clientWidth}px`);const e=getComputedStyle(this._comboBox).getPropertyValue(`--${t}-width`);""===e?this.style.removeProperty(`--${t}-width`):this.style.setProperty(`--${t}-width`,e)}_setOverlayWidth(t,e){t&&e&&(this._updateOverlayWidth(),this._updatePosition())}}
|
|
4345
4345
|
/**
|
|
4346
4346
|
* @license
|
|
4347
4347
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4348
4348
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4349
|
-
*/;
|
|
4349
|
+
*/;fi("vaadin-combo-box-overlay",[Ws,ee`
|
|
4350
4350
|
#overlay {
|
|
4351
4351
|
width: var(--vaadin-combo-box-overlay-width, var(--_vaadin-combo-box-overlay-default-width, auto));
|
|
4352
4352
|
}
|
|
@@ -4356,7 +4356,7 @@ const Pl=t=>class extends(ga(t)){static get observers(){return["_setOverlayWidth
|
|
|
4356
4356
|
flex-direction: column;
|
|
4357
4357
|
height: 100%;
|
|
4358
4358
|
}
|
|
4359
|
-
`],{moduleId:"vaadin-combo-box-overlay-styles"});class
|
|
4359
|
+
`],{moduleId:"vaadin-combo-box-overlay-styles"});class Rl extends(Fl(ba(nn(wi(jr))))){static get is(){return"vaadin-combo-box-overlay"}static get template(){return Pr`
|
|
4360
4360
|
<div id="backdrop" part="backdrop" hidden></div>
|
|
4361
4361
|
<div part="overlay" id="overlay">
|
|
4362
4362
|
<div part="loader"></div>
|
|
@@ -4368,7 +4368,7 @@ const Pl=t=>class extends(ga(t)){static get observers(){return["_setOverlayWidth
|
|
|
4368
4368
|
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
4369
4369
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4370
4370
|
*/
|
|
4371
|
-
function
|
|
4371
|
+
function Ul(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
4372
4372
|
/**
|
|
4373
4373
|
* @license
|
|
4374
4374
|
* Copyright (c) 2016 The Polymer Project Authors. All rights reserved.
|
|
@@ -4377,17 +4377,17 @@ function jl(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
|
4377
4377
|
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
|
|
4378
4378
|
* Code distributed by Google as part of the polymer project is also
|
|
4379
4379
|
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
|
|
4380
|
-
*/
|
|
4380
|
+
*/Yt(Rl);const Vl=navigator.userAgent.match(/iP(?:hone|ad;(?: U;)? CPU) OS (\d+)/u),Hl=Vl&&Vl[1]>=8,Wl={_ratio:.5,_scrollerPaddingTop:0,_scrollPosition:0,_physicalSize:0,_physicalAverage:0,_physicalAverageCount:0,_physicalTop:0,_virtualCount:0,_estScrollHeight:0,_scrollHeight:0,_viewportHeight:0,_viewportWidth:0,_physicalItems:null,_physicalSizes:null,_firstVisibleIndexVal:null,_lastVisibleIndexVal:null,_maxPages:2,_templateCost:0,get _physicalBottom(){return this._physicalTop+this._physicalSize},get _scrollBottom(){return this._scrollPosition+this._viewportHeight},get _virtualEnd(){return this._virtualStart+this._physicalCount-1},get _hiddenContentSize(){return this._physicalSize-this._viewportHeight},get _maxScrollTop(){return this._estScrollHeight-this._viewportHeight+this._scrollOffset},get _maxVirtualStart(){return Math.max(0,this._virtualCount-this._physicalCount)},get _virtualStart(){return this._virtualStartVal||0},set _virtualStart(t){t=this._clamp(t,0,this._maxVirtualStart),this._virtualStartVal=t},get _physicalStart(){return this._physicalStartVal||0},set _physicalStart(t){(t%=this._physicalCount)<0&&(t=this._physicalCount+t),this._physicalStartVal=t},get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount},get _physicalCount(){return this._physicalCountVal||0},set _physicalCount(t){this._physicalCountVal=t},get _optPhysicalSize(){return 0===this._viewportHeight?1/0:this._viewportHeight*this._maxPages},get _isVisible(){return!(!this.offsetWidth&&!this.offsetHeight)},get firstVisibleIndex(){let t=this._firstVisibleIndexVal;if(null==t){let e=this._physicalTop+this._scrollOffset;t=this._iterateItems(((t,i)=>{if(e+=this._getPhysicalSizeIncrement(t),e>this._scrollPosition)return i}))||0,this._firstVisibleIndexVal=t}return t},get lastVisibleIndex(){let t=this._lastVisibleIndexVal;if(null==t){let e=this._physicalTop+this._scrollOffset;this._iterateItems(((i,o)=>{e<this._scrollBottom&&(t=o),e+=this._getPhysicalSizeIncrement(i)})),this._lastVisibleIndexVal=t}return t},get _scrollOffset(){return this._scrollerPaddingTop+this.scrollOffset},_scrollHandler(){const t=Math.max(0,Math.min(this._maxScrollTop,this._scrollTop));let e=t-this._scrollPosition;const i=e>=0;if(this._scrollPosition=t,this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,Math.abs(e)>this._physicalSize&&this._physicalSize>0){e-=this._scrollOffset;const t=Math.round(e/this._physicalAverage);this._virtualStart+=t,this._physicalStart+=t,this._physicalTop=Math.min(Math.floor(this._virtualStart)*this._physicalAverage,this._scrollPosition),this._update()}else if(this._physicalCount>0){const t=this._getReusables(i);i?(this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length):(this._virtualStart-=t.indexes.length,this._physicalStart-=t.indexes.length),this._update(t.indexes,i?null:t.indexes),this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,0),Jr)}},_getReusables(t){let e,i,o;const r=[],n=this._hiddenContentSize*this._ratio,s=this._virtualStart,a=this._virtualEnd,l=this._physicalCount;let h=this._physicalTop+this._scrollOffset;const c=this._scrollPosition,d=this._scrollBottom;for(t?(e=this._physicalStart,i=c-h):(e=this._physicalEnd,i=this._physicalBottom+this._scrollOffset-d);o=this._getPhysicalSizeIncrement(e),i-=o,!(r.length>=l||i<=n);)if(t){if(a+r.length+1>=this._virtualCount||h+o>=c-this._scrollOffset)break;r.push(e),h+=o,e=(e+1)%l}else{if(s-r.length<=0||h+this._physicalSize-o<=d)break;r.push(e),h-=o,e=0===e?l-1:e-1}return{indexes:r,physicalTop:h-this._scrollOffset}},_update(t,e){if(!(t&&0===t.length||0===this._physicalCount)){if(this._assignModels(t),this._updateMetrics(t),e)for(;e.length;){const t=e.pop();this._physicalTop-=this._getPhysicalSizeIncrement(t)}this._positionItems(),this._updateScrollerSize()}},_isClientFull(){return 0!==this._scrollBottom&&this._physicalBottom-1>=this._scrollBottom&&this._physicalTop<=this._scrollPosition},_increasePoolIfNeeded(t){const e=this._clamp(this._physicalCount+t,3,this._virtualCount-this._virtualStart)-this._physicalCount;let i=Math.round(.5*this._physicalCount);if(!(e<0)){if(e>0){const t=window.performance.now();[].push.apply(this._physicalItems,this._createPool(e));for(let t=0;t<e;t++)this._physicalSizes.push(0);this._physicalCount+=e,this._physicalStart>this._physicalEnd&&this._isIndexRendered(this._focusedVirtualIndex)&&this._getPhysicalIndex(this._focusedVirtualIndex)<this._physicalEnd&&(this._physicalStart+=e),this._update(),this._templateCost=(window.performance.now()-t)/e,i=Math.round(.5*this._physicalCount)}this._virtualEnd>=this._virtualCount-1||0===i||(this._isClientFull()?this._physicalSize<this._optPhysicalSize&&this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,this._clamp(Math.round(50/this._templateCost),1,i)),Yr):this._debounce("_increasePoolIfNeeded",this._increasePoolIfNeeded.bind(this,i),Jr))}},_render(){if(this.isAttached&&this._isVisible)if(0!==this._physicalCount){const t=this._getReusables(!0);this._physicalTop=t.physicalTop,this._virtualStart+=t.indexes.length,this._physicalStart+=t.indexes.length,this._update(t.indexes),this._update(),this._increasePoolIfNeeded(0)}else this._virtualCount>0&&(this.updateViewportBoundaries(),this._increasePoolIfNeeded(3))},_itemsChanged(t){"items"===t.path&&(this._virtualStart=0,this._physicalTop=0,this._virtualCount=this.items?this.items.length:0,this._physicalIndexForKey={},this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._physicalItems||(this._physicalItems=[]),this._physicalSizes||(this._physicalSizes=[]),this._physicalStart=0,this._scrollTop>this._scrollOffset&&this._resetScrollPosition(0),this._debounce("_render",this._render,Gr))},_iterateItems(t,e){let i,o,r,n;if(2===arguments.length&&e){for(n=0;n<e.length;n++)if(i=e[n],o=this._computeVidx(i),null!=(r=t.call(this,i,o)))return r}else{for(i=this._physicalStart,o=this._virtualStart;i<this._physicalCount;i++,o++)if(null!=(r=t.call(this,i,o)))return r;for(i=0;i<this._physicalStart;i++,o++)if(null!=(r=t.call(this,i,o)))return r}},_computeVidx(t){return t>=this._physicalStart?this._virtualStart+(t-this._physicalStart):this._virtualStart+(this._physicalCount-this._physicalStart)+t},_positionItems(){this._adjustScrollPosition();let t=this._physicalTop;this._iterateItems((e=>{this.translate3d(0,`${t}px`,0,this._physicalItems[e]),t+=this._physicalSizes[e]}))},_getPhysicalSizeIncrement(t){return this._physicalSizes[t]},_adjustScrollPosition(){const t=0===this._virtualStart?this._physicalTop:Math.min(this._scrollPosition+this._physicalTop,0);if(0!==t){this._physicalTop-=t;const e=this._scrollPosition;!Hl&&e>0&&this._resetScrollPosition(e-t)}},_resetScrollPosition(t){this.scrollTarget&&t>=0&&(this._scrollTop=t,this._scrollPosition=this._scrollTop)},_updateScrollerSize(t){const e=this._physicalBottom+Math.max(this._virtualCount-this._physicalCount-this._virtualStart,0)*this._physicalAverage;this._estScrollHeight=e,(t||0===this._scrollHeight||this._scrollPosition>=e-this._physicalSize||Math.abs(e-this._scrollHeight)>=this._viewportHeight)&&(this.$.items.style.height=`${e}px`,this._scrollHeight=e)},scrollToIndex(t){if("number"!=typeof t||t<0||t>this.items.length-1||(tn(),0===this._physicalCount))return;t=this._clamp(t,0,this._virtualCount-1),(!this._isIndexRendered(t)||t>=this._maxVirtualStart)&&(this._virtualStart=t-1),this._assignModels(),this._updateMetrics(),this._physicalTop=this._virtualStart*this._physicalAverage;let e=this._physicalStart,i=this._virtualStart,o=0;const r=this._hiddenContentSize;for(;i<t&&o<=r;)o+=this._getPhysicalSizeIncrement(e),e=(e+1)%this._physicalCount,i+=1;this._updateScrollerSize(!0),this._positionItems(),this._resetScrollPosition(this._physicalTop+this._scrollOffset+o),this._increasePoolIfNeeded(0),this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null},_resetAverage(){this._physicalAverage=0,this._physicalAverageCount=0},_resizeHandler(){this._debounce("_render",(()=>{this._firstVisibleIndexVal=null,this._lastVisibleIndexVal=null,this._isVisible?(this.updateViewportBoundaries(),this.toggleScrollListener(!0),this._resetAverage(),this._render()):this.toggleScrollListener(!1)}),Gr)},_isIndexRendered(t){return t>=this._virtualStart&&t<=this._virtualEnd},_getPhysicalIndex(t){return(this._physicalStart+(t-this._virtualStart))%this._physicalCount},_clamp:(t,e,i)=>Math.min(i,Math.max(e,t)),_debounce(t,e,i){this._debouncers||(this._debouncers={}),this._debouncers[t]=Kr.debounce(this._debouncers[t],i,e.bind(this)),Zr(this._debouncers[t])}},ql=1e3;
|
|
4381
4381
|
/**
|
|
4382
4382
|
* @license
|
|
4383
4383
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4384
4384
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4385
|
-
*/class Ul{constructor({createElements:t,updateElement:e,scrollTarget:i,scrollContainer:o,elementsContainer:r,reorderElements:n}){this.isAttached=!0,this._vidxOffset=0,this.createElements=t,this.updateElement=e,this.scrollTarget=i,this.scrollContainer=o,this.elementsContainer=r||o,this.reorderElements=n,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver((()=>this._resizeHandler())),"visible"===getComputedStyle(this.scrollTarget).overflow&&(this.scrollTarget.style.overflow="auto"),"static"===getComputedStyle(this.scrollContainer).position&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",(()=>this._scrollHandler())),new ResizeObserver((([{contentRect:t}])=>{const e=0===t.width&&0===t.height;!e&&this.__scrollTargetHidden&&this.scrollTarget.scrollTop!==this._scrollPosition&&(this.scrollTarget.scrollTop=this._scrollPosition),this.__scrollTargetHidden=e})).observe(this.scrollTarget),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",(t=>this.__onWheel(t))),this.scrollTarget.addEventListener("virtualizer-element-focused",(t=>this.__onElementFocused(t))),this.elementsContainer.addEventListener("focusin",(()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))})),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",(()=>{this.__mouseDown=!0})),this.scrollTarget.addEventListener("mouseup",(()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()})))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some((t=>t.__virtualizerPlaceholder))}scrollToIndex(t){if("number"!=typeof t||isNaN(t)||0===this.size||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),t=this._clamp(t,0,this.size-1);const e=this.__getVisibleElements().length;let i=Math.floor(t/this.size*this._virtualCount);this._virtualCount-i<e?(i=this._virtualCount-(this.size-t),this._vidxOffset=this._maxVirtualIndexOffset):i<e?t<Rl?(i=t,this._vidxOffset=0):(i=Rl,this._vidxOffset=t-i):this._vidxOffset=t-i,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(i),this.adjustedFirstVisibleIndex!==t&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(t)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=t)}flush(){0!==this.scrollTarget.offsetHeight&&(this._resizeHandler(),Jr(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(t=0,e=this.size-1){const i=[];this.__getVisibleElements().forEach((o=>{o.__virtualIndex>=t&&o.__virtualIndex<=e&&(this.__updateElement(o,o.__virtualIndex,!0),i.push(o))})),this.__afterElementsUpdated(i)}_updateMetrics(t){Jr();let e=0,i=0;const o=this._physicalAverageCount,r=this._physicalAverage;this._iterateItems((t=>{i+=this._physicalSizes[t],this._physicalSizes[t]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[t])),e+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0}),t),this._physicalSize=this._physicalSize+e-i,this._physicalAverageCount!==o&&(this._physicalAverage=Math.round((r*o+e)/this._physicalAverageCount))}__getBorderBoxHeight(t){const e=getComputedStyle(t),i=parseFloat(e.height)||0;return"border-box"===e.boxSizing?i:i+(parseFloat(e.paddingBottom)||0)+(parseFloat(e.paddingTop)||0)+(parseFloat(e.borderBottomWidth)||0)+(parseFloat(e.borderTopWidth)||0)}__updateElement(t,e,i){t.__virtualizerPlaceholder&&(t.style.paddingTop="",t.style.opacity="",t.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(t.__lastUpdatedIndex!==e||i)&&(this.updateElement(t,e),t.__lastUpdatedIndex=e)}__afterElementsUpdated(t){t.forEach((t=>{const e=t.offsetHeight;if(0===e)t.style.paddingTop=`${this.__placeholderHeight}px`,t.style.opacity="0",t.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=qr.debounce(this.__placeholderClearDebouncer,Ur,(()=>this._resizeHandler()));else{this.__elementHeightQueue.push(e),this.__elementHeightQueue.shift();const t=this.__elementHeightQueue.filter((t=>void 0!==t));this.__placeholderHeight=Math.round(t.reduce(((t,e)=>t+e),0)/t.length)}})),void 0!==this.__pendingScrollToIndex&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(t){const e=this.__getVisibleElements().find((e=>e.__virtualIndex===t));return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(t){if(t===this.size)return;let e,i;if(this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0,t>0&&(e=this.adjustedFirstVisibleIndex,i=this.__getIndexScrollOffset(e)),this.__size=t,this._itemsChanged({path:"items"}),Jr(),t>0){e=Math.min(e,t-1),this.scrollToIndex(e);const o=this.__getIndexScrollOffset(e);void 0!==i&&void 0!==o&&(this._scrollTop+=i-o)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame((()=>this._resizeHandler())),this._resizeHandler(),Jr(),this._debounce("_update",this._update,Hr)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(t){this.scrollTarget.scrollTop=t}get items(){return{length:Math.min(this.size,1e5)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}updateViewportBoundaries(){const t=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL="rtl"===t.direction,this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(t){const e=this.createElements(t),i=document.createDocumentFragment();return e.forEach((t=>{t.style.position="absolute",i.appendChild(t),this.__resizeObserver.observe(t)})),this.elementsContainer.appendChild(i),e}_assignModels(t){const e=[];this._iterateItems(((t,i)=>{const o=this._physicalItems[t];o.hidden=i>=this.size,o.hidden?delete o.__lastUpdatedIndex:(o.__virtualIndex=i+(this._vidxOffset||0),this.__updateElement(o,o.__virtualIndex),e.push(o))}),t),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout((()=>{this.__clientFull=!0})),this.__clientFull||super._isClientFull()}translate3d(t,e,i,o){o.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(t=this.__getVisibleElements()){return t.find((t=>t.contains(this.elementsContainer.getRootNode().activeElement)||t.contains(this.scrollTarget.getRootNode().activeElement)))}__nextFocusableSiblingMissing(t,e){return e.indexOf(t)===e.length-1&&this.size>t.__virtualIndex+1}__previousFocusableSiblingMissing(t,e){return 0===e.indexOf(t)&&t.__virtualIndex>0}__onElementFocused(t){if(!this.reorderElements)return;const e=t.detail.element;if(!e)return;const i=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,i)||this.__nextFocusableSiblingMissing(e,i))&&this.flush();const o=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,o)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,o)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(0===this.scrollTarget.offsetHeight)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const t=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),0!==this._physicalCount){const e=t>=0,i=this._getReusables(!e);i.indexes.length&&(this._physicalTop=i.physicalTop,e?(this._virtualStart-=i.indexes.length,this._physicalStart-=i.indexes.length):(this._virtualStart+=i.indexes.length,this._physicalStart+=i.indexes.length),this._resizeHandler())}t&&(this.__fixInvalidItemPositioningDebouncer=qr.debounce(this.__fixInvalidItemPositioningDebouncer,Rr.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),(()=>this.__fixInvalidItemPositioning()))),this.reorderElements&&(this.__scrollReorderDebouncer=qr.debounce(this.__scrollReorderDebouncer,Rr.after(this.timeouts.SCROLL_REORDER),(()=>this.__reorderElements()))),this.__previousScrollTop=this._scrollTop,0===this._scrollTop&&0!==this.firstVisibleIndex&&Math.abs(t)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const t=this._physicalBottom<this._scrollBottom;if(this._physicalTop>this._scrollTop&&0!==this.adjustedFirstVisibleIndex||t&&this.adjustedLastVisibleIndex!==this.size-1){const e=t,i=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(e?-1:1),this._scrollHandler(),this._ratio=i}}__onWheel(t){if(t.ctrlKey||this._hasScrolledAncestor(t.target,t.deltaX,t.deltaY))return;let e=t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame)return this._deltaYAcc+=e,void t.preventDefault();e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=qr.debounce(this.__debouncerWheelAnimationFrame,Ur,(()=>{this._wheelAnimationFrame=!1}));const i=Math.abs(t.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,t.deltaX,e)?(t.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=t.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=qr.debounce(this._debouncerIgnoreNewWheel,Rr.after(this.timeouts.IGNORE_WHEEL),(()=>{this._ignoreNewWheel=!1}))):this._hasResidualMomentum&&i<=this._previousMomentum||this._ignoreNewWheel?t.preventDefault():i>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=i}_hasScrolledAncestor(t,e,i){return t!==this.scrollTarget&&t!==this.scrollTarget.getRootNode().host&&(!(!this._canScroll(t,e,i)||-1===["auto","scroll"].indexOf(getComputedStyle(t).overflow))||(t!==this&&t.parentElement?this._hasScrolledAncestor(t.parentElement,e,i):void 0))}_canScroll(t,e,i){return i>0&&t.scrollTop<t.scrollHeight-t.offsetHeight||i<0&&t.scrollTop>0||e>0&&t.scrollLeft<t.scrollWidth-t.offsetWidth||e<0&&t.scrollLeft>0}_increasePoolIfNeeded(t){if(this._physicalCount>2&&t){const e=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(t,Math.min(100,e)))}else super._increasePoolIfNeeded(t)}get _optPhysicalSize(){const t=super._optPhysicalSize;return t<=0||this.__hasPlaceholders()?t:t+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(0===this._physicalCount)return 0;const t=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-t):0}_getScrollLineHeight(){const t=document.createElement("div");t.style.fontSize="initial",t.style.display="none",document.body.appendChild(t);const e=window.getComputedStyle(t).fontSize;return document.body.removeChild(t),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter((t=>!t.hidden))}__reorderElements(){if(this.__mouseDown)return void(this.__pendingReorder=!0);this.__pendingReorder=!1;const t=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),i=this.__getFocusedElement(e)||e[0];if(!i)return;const o=i.__virtualIndex-t,r=e.indexOf(i)-o;if(r>0)for(let t=0;t<r;t++)this.elementsContainer.appendChild(e[t]);else if(r<0)for(let t=e.length+r;t<e.length;t++)this.elementsContainer.insertBefore(e[t],e[0]);if(Xs){const{transform:t}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout((()=>{this.scrollTarget.style.transform=t}))}}_adjustVirtualIndexOffset(t){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(t)>1e4)this._vidxOffset=Math.round(this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight)*e);else{const t=this._vidxOffset,i=Rl,o=100;0===this._scrollTop?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<i&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-i&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(Ul.prototype,Fl);class Vl{constructor(t){this.__adapter=new Ul(t)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(t){this.__adapter.size=t}scrollToIndex(t){this.__adapter.scrollToIndex(t)}update(t=0,e=this.size-1){this.__adapter.update(t,e)}flush(){this.__adapter.flush()}}
|
|
4385
|
+
*/class Gl{constructor({createElements:t,updateElement:e,scrollTarget:i,scrollContainer:o,elementsContainer:r,reorderElements:n}){this.isAttached=!0,this._vidxOffset=0,this.createElements=t,this.updateElement=e,this.scrollTarget=i,this.scrollContainer=o,this.elementsContainer=r||o,this.reorderElements=n,this._maxPages=1.3,this.__placeholderHeight=200,this.__elementHeightQueue=Array(10),this.timeouts={SCROLL_REORDER:500,IGNORE_WHEEL:500,FIX_INVALID_ITEM_POSITIONING:100},this.__resizeObserver=new ResizeObserver((()=>this._resizeHandler())),"visible"===getComputedStyle(this.scrollTarget).overflow&&(this.scrollTarget.style.overflow="auto"),"static"===getComputedStyle(this.scrollContainer).position&&(this.scrollContainer.style.position="relative"),this.__resizeObserver.observe(this.scrollTarget),this.scrollTarget.addEventListener("scroll",(()=>this._scrollHandler())),new ResizeObserver((([{contentRect:t}])=>{const e=0===t.width&&0===t.height;!e&&this.__scrollTargetHidden&&this.scrollTarget.scrollTop!==this._scrollPosition&&(this.scrollTarget.scrollTop=this._scrollPosition),this.__scrollTargetHidden=e})).observe(this.scrollTarget),this._scrollLineHeight=this._getScrollLineHeight(),this.scrollTarget.addEventListener("wheel",(t=>this.__onWheel(t))),this.scrollTarget.addEventListener("virtualizer-element-focused",(t=>this.__onElementFocused(t))),this.elementsContainer.addEventListener("focusin",(()=>{this.scrollTarget.dispatchEvent(new CustomEvent("virtualizer-element-focused",{detail:{element:this.__getFocusedElement()}}))})),this.reorderElements&&(this.scrollTarget.addEventListener("mousedown",(()=>{this.__mouseDown=!0})),this.scrollTarget.addEventListener("mouseup",(()=>{this.__mouseDown=!1,this.__pendingReorder&&this.__reorderElements()})))}get scrollOffset(){return 0}get adjustedFirstVisibleIndex(){return this.firstVisibleIndex+this._vidxOffset}get adjustedLastVisibleIndex(){return this.lastVisibleIndex+this._vidxOffset}get _maxVirtualIndexOffset(){return this.size-this._virtualCount}__hasPlaceholders(){return this.__getVisibleElements().some((t=>t.__virtualizerPlaceholder))}scrollToIndex(t){if("number"!=typeof t||isNaN(t)||0===this.size||!this.scrollTarget.offsetHeight)return;delete this.__pendingScrollToIndex,this._physicalCount<=3&&this.flush(),t=this._clamp(t,0,this.size-1);const e=this.__getVisibleElements().length;let i=Math.floor(t/this.size*this._virtualCount);this._virtualCount-i<e?(i=this._virtualCount-(this.size-t),this._vidxOffset=this._maxVirtualIndexOffset):i<e?t<ql?(i=t,this._vidxOffset=0):(i=ql,this._vidxOffset=t-i):this._vidxOffset=t-i,this.__skipNextVirtualIndexAdjust=!0,super.scrollToIndex(i),this.adjustedFirstVisibleIndex!==t&&this._scrollTop<this._maxScrollTop&&!this.grid&&(this._scrollTop-=this.__getIndexScrollOffset(t)||0),this._scrollHandler(),this.__hasPlaceholders()&&(this.__pendingScrollToIndex=t)}flush(){0!==this.scrollTarget.offsetHeight&&(this._resizeHandler(),tn(),this._scrollHandler(),this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.flush(),this.__scrollReorderDebouncer&&this.__scrollReorderDebouncer.flush(),this.__debouncerWheelAnimationFrame&&this.__debouncerWheelAnimationFrame.flush())}update(t=0,e=this.size-1){const i=[];this.__getVisibleElements().forEach((o=>{o.__virtualIndex>=t&&o.__virtualIndex<=e&&(this.__updateElement(o,o.__virtualIndex,!0),i.push(o))})),this.__afterElementsUpdated(i)}_updateMetrics(t){tn();let e=0,i=0;const o=this._physicalAverageCount,r=this._physicalAverage;this._iterateItems((t=>{i+=this._physicalSizes[t],this._physicalSizes[t]=Math.ceil(this.__getBorderBoxHeight(this._physicalItems[t])),e+=this._physicalSizes[t],this._physicalAverageCount+=this._physicalSizes[t]?1:0}),t),this._physicalSize=this._physicalSize+e-i,this._physicalAverageCount!==o&&(this._physicalAverage=Math.round((r*o+e)/this._physicalAverageCount))}__getBorderBoxHeight(t){const e=getComputedStyle(t),i=parseFloat(e.height)||0;return"border-box"===e.boxSizing?i:i+(parseFloat(e.paddingBottom)||0)+(parseFloat(e.paddingTop)||0)+(parseFloat(e.borderBottomWidth)||0)+(parseFloat(e.borderTopWidth)||0)}__updateElement(t,e,i){t.__virtualizerPlaceholder&&(t.style.paddingTop="",t.style.opacity="",t.__virtualizerPlaceholder=!1),!this.__preventElementUpdates&&(t.__lastUpdatedIndex!==e||i)&&(this.updateElement(t,e),t.__lastUpdatedIndex=e)}__afterElementsUpdated(t){t.forEach((t=>{const e=t.offsetHeight;if(0===e)t.style.paddingTop=`${this.__placeholderHeight}px`,t.style.opacity="0",t.__virtualizerPlaceholder=!0,this.__placeholderClearDebouncer=Kr.debounce(this.__placeholderClearDebouncer,Gr,(()=>this._resizeHandler()));else{this.__elementHeightQueue.push(e),this.__elementHeightQueue.shift();const t=this.__elementHeightQueue.filter((t=>void 0!==t));this.__placeholderHeight=Math.round(t.reduce(((t,e)=>t+e),0)/t.length)}})),void 0!==this.__pendingScrollToIndex&&!this.__hasPlaceholders()&&this.scrollToIndex(this.__pendingScrollToIndex)}__getIndexScrollOffset(t){const e=this.__getVisibleElements().find((e=>e.__virtualIndex===t));return e?this.scrollTarget.getBoundingClientRect().top-e.getBoundingClientRect().top:void 0}get size(){return this.__size}set size(t){if(t===this.size)return;let e,i;if(this.__fixInvalidItemPositioningDebouncer&&this.__fixInvalidItemPositioningDebouncer.cancel(),this._debouncers&&this._debouncers._increasePoolIfNeeded&&this._debouncers._increasePoolIfNeeded.cancel(),this.__preventElementUpdates=!0,t>0&&(e=this.adjustedFirstVisibleIndex,i=this.__getIndexScrollOffset(e)),this.__size=t,this._itemsChanged({path:"items"}),tn(),t>0){e=Math.min(e,t-1),this.scrollToIndex(e);const o=this.__getIndexScrollOffset(e);void 0!==i&&void 0!==o&&(this._scrollTop+=i-o)}this.__preventElementUpdates=!1,this._isVisible||this._assignModels(),this.elementsContainer.children.length||requestAnimationFrame((()=>this._resizeHandler())),this._resizeHandler(),tn(),this._debounce("_update",this._update,Jr)}get _scrollTop(){return this.scrollTarget.scrollTop}set _scrollTop(t){this.scrollTarget.scrollTop=t}get items(){return{length:Math.min(this.size,1e5)}}get offsetHeight(){return this.scrollTarget.offsetHeight}get $(){return{items:this.scrollContainer}}updateViewportBoundaries(){const t=window.getComputedStyle(this.scrollTarget);this._scrollerPaddingTop=this.scrollTarget===this?0:parseInt(t["padding-top"],10),this._isRTL="rtl"===t.direction,this._viewportWidth=this.elementsContainer.offsetWidth,this._viewportHeight=this.scrollTarget.offsetHeight,this._scrollPageHeight=this._viewportHeight-this._scrollLineHeight,this.grid&&this._updateGridMetrics()}setAttribute(){}_createPool(t){const e=this.createElements(t),i=document.createDocumentFragment();return e.forEach((t=>{t.style.position="absolute",i.appendChild(t),this.__resizeObserver.observe(t)})),this.elementsContainer.appendChild(i),e}_assignModels(t){const e=[];this._iterateItems(((t,i)=>{const o=this._physicalItems[t];o.hidden=i>=this.size,o.hidden?delete o.__lastUpdatedIndex:(o.__virtualIndex=i+(this._vidxOffset||0),this.__updateElement(o,o.__virtualIndex),e.push(o))}),t),this.__afterElementsUpdated(e)}_isClientFull(){return setTimeout((()=>{this.__clientFull=!0})),this.__clientFull||super._isClientFull()}translate3d(t,e,i,o){o.style.transform=`translateY(${e})`}toggleScrollListener(){}__getFocusedElement(t=this.__getVisibleElements()){return t.find((t=>t.contains(this.elementsContainer.getRootNode().activeElement)||t.contains(this.scrollTarget.getRootNode().activeElement)))}__nextFocusableSiblingMissing(t,e){return e.indexOf(t)===e.length-1&&this.size>t.__virtualIndex+1}__previousFocusableSiblingMissing(t,e){return 0===e.indexOf(t)&&t.__virtualIndex>0}__onElementFocused(t){if(!this.reorderElements)return;const e=t.detail.element;if(!e)return;const i=this.__getVisibleElements();(this.__previousFocusableSiblingMissing(e,i)||this.__nextFocusableSiblingMissing(e,i))&&this.flush();const o=this.__getVisibleElements();this.__nextFocusableSiblingMissing(e,o)?(this._scrollTop+=Math.ceil(e.getBoundingClientRect().bottom)-Math.floor(this.scrollTarget.getBoundingClientRect().bottom-1),this.flush()):this.__previousFocusableSiblingMissing(e,o)&&(this._scrollTop-=Math.ceil(this.scrollTarget.getBoundingClientRect().top+1)-Math.floor(e.getBoundingClientRect().top),this.flush())}_scrollHandler(){if(0===this.scrollTarget.offsetHeight)return;this._adjustVirtualIndexOffset(this._scrollTop-(this.__previousScrollTop||0));const t=this.scrollTarget.scrollTop-this._scrollPosition;if(super._scrollHandler(),0!==this._physicalCount){const e=t>=0,i=this._getReusables(!e);i.indexes.length&&(this._physicalTop=i.physicalTop,e?(this._virtualStart-=i.indexes.length,this._physicalStart-=i.indexes.length):(this._virtualStart+=i.indexes.length,this._physicalStart+=i.indexes.length),this._resizeHandler())}t&&(this.__fixInvalidItemPositioningDebouncer=Kr.debounce(this.__fixInvalidItemPositioningDebouncer,qr.after(this.timeouts.FIX_INVALID_ITEM_POSITIONING),(()=>this.__fixInvalidItemPositioning()))),this.reorderElements&&(this.__scrollReorderDebouncer=Kr.debounce(this.__scrollReorderDebouncer,qr.after(this.timeouts.SCROLL_REORDER),(()=>this.__reorderElements()))),this.__previousScrollTop=this._scrollTop,0===this._scrollTop&&0!==this.firstVisibleIndex&&Math.abs(t)>0&&this.scrollToIndex(0)}__fixInvalidItemPositioning(){if(!this.scrollTarget.isConnected)return;const t=this._physicalBottom<this._scrollBottom;if(this._physicalTop>this._scrollTop&&0!==this.adjustedFirstVisibleIndex||t&&this.adjustedLastVisibleIndex!==this.size-1){const e=t,i=this._ratio;this._ratio=0,this._scrollPosition=this._scrollTop+(e?-1:1),this._scrollHandler(),this._ratio=i}}__onWheel(t){if(t.ctrlKey||this._hasScrolledAncestor(t.target,t.deltaX,t.deltaY))return;let e=t.deltaY;if(t.deltaMode===WheelEvent.DOM_DELTA_LINE?e*=this._scrollLineHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(e*=this._scrollPageHeight),this._deltaYAcc||(this._deltaYAcc=0),this._wheelAnimationFrame)return this._deltaYAcc+=e,void t.preventDefault();e+=this._deltaYAcc,this._deltaYAcc=0,this._wheelAnimationFrame=!0,this.__debouncerWheelAnimationFrame=Kr.debounce(this.__debouncerWheelAnimationFrame,Gr,(()=>{this._wheelAnimationFrame=!1}));const i=Math.abs(t.deltaX)+Math.abs(e);this._canScroll(this.scrollTarget,t.deltaX,e)?(t.preventDefault(),this.scrollTarget.scrollTop+=e,this.scrollTarget.scrollLeft+=t.deltaX,this._hasResidualMomentum=!0,this._ignoreNewWheel=!0,this._debouncerIgnoreNewWheel=Kr.debounce(this._debouncerIgnoreNewWheel,qr.after(this.timeouts.IGNORE_WHEEL),(()=>{this._ignoreNewWheel=!1}))):this._hasResidualMomentum&&i<=this._previousMomentum||this._ignoreNewWheel?t.preventDefault():i>this._previousMomentum&&(this._hasResidualMomentum=!1),this._previousMomentum=i}_hasScrolledAncestor(t,e,i){return t!==this.scrollTarget&&t!==this.scrollTarget.getRootNode().host&&(!(!this._canScroll(t,e,i)||-1===["auto","scroll"].indexOf(getComputedStyle(t).overflow))||(t!==this&&t.parentElement?this._hasScrolledAncestor(t.parentElement,e,i):void 0))}_canScroll(t,e,i){return i>0&&t.scrollTop<t.scrollHeight-t.offsetHeight||i<0&&t.scrollTop>0||e>0&&t.scrollLeft<t.scrollWidth-t.offsetWidth||e<0&&t.scrollLeft>0}_increasePoolIfNeeded(t){if(this._physicalCount>2&&t){const e=Math.ceil(this._optPhysicalSize/this._physicalAverage)-this._physicalCount;super._increasePoolIfNeeded(Math.max(t,Math.min(100,e)))}else super._increasePoolIfNeeded(t)}get _optPhysicalSize(){const t=super._optPhysicalSize;return t<=0||this.__hasPlaceholders()?t:t+this.__getItemHeightBuffer()}__getItemHeightBuffer(){if(0===this._physicalCount)return 0;const t=Math.ceil(this._viewportHeight*(this._maxPages-1)/2),e=Math.max(...this._physicalSizes);return e>Math.min(...this._physicalSizes)?Math.max(0,e-t):0}_getScrollLineHeight(){const t=document.createElement("div");t.style.fontSize="initial",t.style.display="none",document.body.appendChild(t);const e=window.getComputedStyle(t).fontSize;return document.body.removeChild(t),e?window.parseInt(e):void 0}__getVisibleElements(){return Array.from(this.elementsContainer.children).filter((t=>!t.hidden))}__reorderElements(){if(this.__mouseDown)return void(this.__pendingReorder=!0);this.__pendingReorder=!1;const t=this._virtualStart+(this._vidxOffset||0),e=this.__getVisibleElements(),i=this.__getFocusedElement(e)||e[0];if(!i)return;const o=i.__virtualIndex-t,r=e.indexOf(i)-o;if(r>0)for(let t=0;t<r;t++)this.elementsContainer.appendChild(e[t]);else if(r<0)for(let t=e.length+r;t<e.length;t++)this.elementsContainer.insertBefore(e[t],e[0]);if(ea){const{transform:t}=this.scrollTarget.style;this.scrollTarget.style.transform="translateZ(0)",setTimeout((()=>{this.scrollTarget.style.transform=t}))}}_adjustVirtualIndexOffset(t){const e=this._maxVirtualIndexOffset;if(this._virtualCount>=this.size)this._vidxOffset=0;else if(this.__skipNextVirtualIndexAdjust)this.__skipNextVirtualIndexAdjust=!1;else if(Math.abs(t)>1e4)this._vidxOffset=Math.round(this._scrollTop/(this.scrollTarget.scrollHeight-this.scrollTarget.clientHeight)*e);else{const t=this._vidxOffset,i=ql,o=100;0===this._scrollTop?(this._vidxOffset=0,t!==this._vidxOffset&&super.scrollToIndex(0)):this.firstVisibleIndex<i&&this._vidxOffset>0&&(this._vidxOffset-=Math.min(this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex+(t-this._vidxOffset))),this._scrollTop>=this._maxScrollTop&&this._maxScrollTop>0?(this._vidxOffset=e,t!==this._vidxOffset&&super.scrollToIndex(this._virtualCount-1)):this.firstVisibleIndex>this._virtualCount-i&&this._vidxOffset<e&&(this._vidxOffset+=Math.min(e-this._vidxOffset,o),super.scrollToIndex(this.firstVisibleIndex-(this._vidxOffset-t)))}}}Object.setPrototypeOf(Gl.prototype,Wl);class Yl{constructor(t){this.__adapter=new Gl(t)}get firstVisibleIndex(){return this.__adapter.adjustedFirstVisibleIndex}get lastVisibleIndex(){return this.__adapter.adjustedLastVisibleIndex}get size(){return this.__adapter.size}set size(t){this.__adapter.size=t}scrollToIndex(t){this.__adapter.scrollToIndex(t)}update(t=0,e=this.size-1){this.__adapter.update(t,e)}flush(){this.__adapter.flush()}}
|
|
4386
4386
|
/**
|
|
4387
4387
|
* @license
|
|
4388
4388
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4389
4389
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4390
|
-
*/const
|
|
4390
|
+
*/const Jl=class{toString(){return""}},Xl=t=>class extends t{static get properties(){return{items:{type:Array,sync:!0,observer:"__itemsChanged"},focusedIndex:{type:Number,sync:!0,observer:"__focusedIndexChanged"},loading:{type:Boolean,sync:!0,observer:"__loadingChanged"},opened:{type:Boolean,sync:!0,observer:"__openedChanged"},selectedItem:{type:Object,sync:!0,observer:"__selectedItemChanged"},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemIdPath:{type:String},owner:{type:Object},getItemLabel:{type:Object},renderer:{type:Object,sync:!0,observer:"__rendererChanged"},theme:{type:String}}}constructor(){super(),this.__boundOnItemClick=this.__onItemClick.bind(this)}get _viewportTotalPaddingBottom(){if(void 0===this._cachedViewportTotalPaddingBottom){const t=window.getComputedStyle(this.$.selector);this._cachedViewportTotalPaddingBottom=[t.paddingBottom,t.borderBottomWidth].map((t=>parseInt(t,10))).reduce(((t,e)=>t+e))}return this._cachedViewportTotalPaddingBottom}ready(){super.ready(),this.setAttribute("role","listbox"),this.id=`${this.localName}-${fn()}`,this.__hostTagName=this.constructor.is.replace("-scroller",""),this.addEventListener("click",(t=>t.stopPropagation())),this.__patchWheelOverScrolling()}requestContentUpdate(){this.__virtualizer&&(this.items&&(this.__virtualizer.size=this.items.length),this.opened&&this.__virtualizer.update())}scrollIntoView(t){if(!this.__virtualizer||!(this.opened&&t>=0))return;const e=this._visibleItemsCount();let i=t;t>this.__virtualizer.lastVisibleIndex-1?(this.__virtualizer.scrollToIndex(t),i=t-e+1):t>this.__virtualizer.firstVisibleIndex&&(i=this.__virtualizer.firstVisibleIndex),this.__virtualizer.scrollToIndex(Math.max(0,i));const o=[...this.children].find((t=>!t.hidden&&t.index===this.__virtualizer.lastVisibleIndex));if(!o||t!==o.index)return;const r=o.getBoundingClientRect(),n=this.getBoundingClientRect(),s=r.bottom-n.bottom+this._viewportTotalPaddingBottom;s>0&&(this.scrollTop+=s)}_isItemSelected(t,e,i){return!(t instanceof Jl)&&(i&&void 0!==t&&void 0!==e?Ul(i,t)===Ul(i,e):t===e)}__initVirtualizer(){this.__virtualizer=new Yl({createElements:this.__createElements.bind(this),updateElement:this._updateElement.bind(this),elementsContainer:this,scrollTarget:this,scrollContainer:this.$.selector,reorderElements:!0})}__itemsChanged(t){t&&this.__virtualizer&&this.requestContentUpdate()}__loadingChanged(){this.requestContentUpdate()}__openedChanged(t){t&&(this.__virtualizer||this.__initVirtualizer(),this.requestContentUpdate())}__selectedItemChanged(){this.requestContentUpdate()}__itemClassNameGeneratorChanged(t,e){(t||e)&&this.requestContentUpdate()}__focusedIndexChanged(t,e){t!==e&&this.requestContentUpdate(),t>=0&&!this.loading&&this.scrollIntoView(t)}__rendererChanged(t,e){(t||e)&&this.requestContentUpdate()}__createElements(t){return[...Array(t)].map((()=>{const t=document.createElement(`${this.__hostTagName}-item`);return t.addEventListener("click",this.__boundOnItemClick),t.tabIndex="-1",t.style.width="100%",t}))}_updateElement(t,e){const i=this.items[e],o=this.focusedIndex,r=this._isItemSelected(i,this.selectedItem,this.itemIdPath);t.setProperties({item:i,index:e,label:this.getItemLabel(i),selected:r,renderer:this.renderer,focused:!this.loading&&o===e}),"function"==typeof this.itemClassNameGenerator?t.className=this.itemClassNameGenerator(i):""!==t.className&&(t.className=""),t.performUpdate&&!t.hasUpdated&&t.performUpdate(),t.id=`${this.__hostTagName}-item-${e}`,t.setAttribute("role",void 0!==e&&"option"),t.setAttribute("aria-selected",r.toString()),t.setAttribute("aria-posinset",e+1),t.setAttribute("aria-setsize",this.items.length),this.theme?t.setAttribute("theme",this.theme):t.removeAttribute("theme"),i instanceof Jl&&this.__requestItemByIndex(e)}__onItemClick(t){this.dispatchEvent(new CustomEvent("selection-changed",{detail:{item:t.currentTarget.item}}))}__patchWheelOverScrolling(){this.$.selector.addEventListener("wheel",(t=>{(0===this.scrollTop&&t.deltaY<0||this.scrollHeight-this.scrollTop-this.clientHeight<=1&&t.deltaY>0)&&t.preventDefault()}))}__requestItemByIndex(t){requestAnimationFrame((()=>{this.dispatchEvent(new CustomEvent("index-requested",{detail:{index:t}}))}))}_visibleItemsCount(){return this.__virtualizer.scrollToIndex(this.__virtualizer.firstVisibleIndex),this.__virtualizer.size>0?this.__virtualizer.lastVisibleIndex-this.__virtualizer.firstVisibleIndex+1:0}}
|
|
4391
4391
|
/**
|
|
4392
4392
|
* @license
|
|
4393
4393
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
@@ -4397,7 +4397,7 @@ function jl(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
|
4397
4397
|
* @license
|
|
4398
4398
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4399
4399
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4400
|
-
*/class
|
|
4400
|
+
*/class Kl extends(Xl(jr)){static get is(){return"vaadin-combo-box-scroller"}static get template(){return Pr`
|
|
4401
4401
|
<style>
|
|
4402
4402
|
:host {
|
|
4403
4403
|
display: block;
|
|
@@ -4424,48 +4424,48 @@ function jl(t,e){return t.split(".").reduce(((t,e)=>t?t[e]:void 0),e)}
|
|
|
4424
4424
|
<div id="selector">
|
|
4425
4425
|
<slot></slot>
|
|
4426
4426
|
</div>
|
|
4427
|
-
`}}
|
|
4427
|
+
`}}Yt(Kl);
|
|
4428
4428
|
/**
|
|
4429
4429
|
* @license
|
|
4430
4430
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4431
4431
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4432
4432
|
*/
|
|
4433
|
-
const
|
|
4433
|
+
const Zl=t=>class extends(vl(t)){static get properties(){return{pattern:{type:String}}}static get delegateAttrs(){return[...super.delegateAttrs,"pattern"]}static get constraints(){return[...super.constraints,"pattern"]}}
|
|
4434
4434
|
/**
|
|
4435
4435
|
* @license
|
|
4436
4436
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4437
4437
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4438
|
-
*/;function
|
|
4438
|
+
*/;function Ql(t,e,i=0){let o=e;for(const e of t.subCaches){const t=e.parentCacheIndex;if(o<=t)break;if(o<=t+e.flatSize)return Ql(e,o-t-1,i+1);o-=e.flatSize}return{cache:t,item:t.items[o],index:o,page:Math.floor(o/t.pageSize),level:i}}function th({getItemId:t},e,i,o=0,r=0){for(let n=0;n<e.items.length;n++){const s=e.items[n];if(s&&t(s)===t(i))return{cache:e,level:o,item:s,index:n,page:Math.floor(n/e.pageSize),subCache:e.getSubCache(n),flatIndex:r+e.getFlatIndex(n)}}for(const n of e.subCaches){const s=th({getItemId:t},n,i,o+1,r+e.getFlatIndex(n.parentCacheIndex)+1);if(s)return s}}function eh(t,[e,...i],o=0){e===1/0&&(e=t.size-1);const r=t.getFlatIndex(e),n=t.getSubCache(e);return n&&n.flatSize>0&&i.length?eh(n,i,o+r+1):o+r}
|
|
4439
4439
|
/**
|
|
4440
4440
|
* @license
|
|
4441
4441
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4442
4442
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4443
|
-
*/class
|
|
4443
|
+
*/class ih{constructor(t,e,i,o,r){qt(this,"context"),qt(this,"pageSize"),qt(this,"items",[]),qt(this,"pendingRequests",{}),qt(this,"__subCacheByIndex",{}),qt(this,"__size",0),qt(this,"__flatSize",0),this.context=t,this.pageSize=e,this.size=i,this.parentCache=o,this.parentCacheIndex=r,this.__flatSize=i||0}get parentItem(){return this.parentCache&&this.parentCache.items[this.parentCacheIndex]}get subCaches(){return Object.values(this.__subCacheByIndex)}get isLoading(){return Object.keys(this.pendingRequests).length>0||this.subCaches.some((t=>t.isLoading))}get flatSize(){return this.__flatSize}get effectiveSize(){return console.warn("<vaadin-grid> The `effectiveSize` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.flatSize}get size(){return this.__size}set size(t){var e;if(this.__size!==t){if(this.__size=t,void 0!==this.context.placeholder){this.items.length=t||0;for(let i=0;i<t;i++)(e=this.items)[i]||(e[i]=this.context.placeholder)}Object.keys(this.pendingRequests).forEach((t=>{parseInt(t)*this.pageSize>=this.size&&delete this.pendingRequests[t]}))}}recalculateFlatSize(){this.__flatSize=!this.parentItem||this.context.isExpanded(this.parentItem)?this.size+this.subCaches.reduce(((t,e)=>(e.recalculateFlatSize(),t+e.flatSize)),0):0}setPage(t,e){const i=t*this.pageSize;e.forEach(((t,e)=>{const o=i+e;(void 0===this.size||o<this.size)&&(this.items[o]=t)}))}getSubCache(t){return this.__subCacheByIndex[t]}removeSubCache(t){delete this.__subCacheByIndex[t]}removeSubCaches(){this.__subCacheByIndex={}}createSubCache(t){const e=new ih(this.context,this.pageSize,0,this,t);return this.__subCacheByIndex[t]=e,e}getFlatIndex(t){const e=Math.max(0,Math.min(this.size-1,t));return this.subCaches.reduce(((t,i)=>e>i.parentCacheIndex?t+i.flatSize:t),e)}getItemForIndex(t){console.warn("<vaadin-grid> The `getItemForIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{item:e}=Ql(this,t);return e}getCacheAndIndex(t){console.warn("<vaadin-grid> The `getCacheAndIndex` method of ItemCache is deprecated and will be removed in Vaadin 25.");const{cache:e,index:i}=Ql(this,t);return{cache:e,scaledIndex:i}}updateSize(){console.warn("<vaadin-grid> The `updateSize` method of ItemCache is deprecated and will be removed in Vaadin 25."),this.recalculateFlatSize()}ensureSubCacheForScaledIndex(t){if(console.warn("<vaadin-grid> The `ensureSubCacheForScaledIndex` method of ItemCache is deprecated and will be removed in Vaadin 25."),!this.getSubCache(t)){const e=this.createSubCache(t);this.context.__controller.__loadCachePage(e,0)}}get grid(){return console.warn("<vaadin-grid> The `grid` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.context.__controller.host}get itemCaches(){return console.warn("<vaadin-grid> The `itemCaches` property of ItemCache is deprecated and will be removed in Vaadin 25."),this.__subCacheByIndex
|
|
4444
4444
|
/**
|
|
4445
4445
|
* @license
|
|
4446
4446
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4447
4447
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4448
|
-
*/}}class
|
|
4448
|
+
*/}}class oh extends EventTarget{constructor(t,{size:e,pageSize:i,isExpanded:o,getItemId:r,isPlaceholder:n,placeholder:s,dataProvider:a,dataProviderParams:l}){super(),qt(this,"host"),qt(this,"dataProvider"),qt(this,"dataProviderParams"),qt(this,"pageSize"),qt(this,"isExpanded"),qt(this,"getItemId"),qt(this,"rootCache"),qt(this,"placeholder"),qt(this,"isPlaceholder"),this.host=t,this.pageSize=i,this.getItemId=r,this.isExpanded=o,this.placeholder=s,this.isPlaceholder=n,this.dataProvider=a,this.dataProviderParams=l,this.rootCache=this.__createRootCache(e)}get flatSize(){return this.rootCache.flatSize}get __cacheContext(){return{isExpanded:this.isExpanded,placeholder:this.placeholder,__controller:this}}isLoading(){return this.rootCache.isLoading}setPageSize(t){this.pageSize=t,this.clearCache()}setDataProvider(t){this.dataProvider=t,this.clearCache()}recalculateFlatSize(){this.rootCache.recalculateFlatSize()}clearCache(){this.rootCache=this.__createRootCache(this.rootCache.size)}getFlatIndexContext(t){return Ql(this.rootCache,t)}getItemContext(t){return th({getItemId:this.getItemId},this.rootCache,t)}getFlatIndexByPath(t){return eh(this.rootCache,t)}ensureFlatIndexLoaded(t){const{cache:e,page:i,item:o}=this.getFlatIndexContext(t);this.__isItemLoaded(o)||this.__loadCachePage(e,i)}ensureFlatIndexHierarchy(t){const{cache:e,item:i,index:o}=this.getFlatIndexContext(t);if(this.__isItemLoaded(i)&&this.isExpanded(i)&&!e.getSubCache(o)){const t=e.createSubCache(o);this.__loadCachePage(t,0)}}loadFirstPage(){this.__loadCachePage(this.rootCache,0)}__createRootCache(t){return new ih(this.__cacheContext,this.pageSize,t)}__loadCachePage(t,e){if(!this.dataProvider||t.pendingRequests[e])return;let i={page:e,pageSize:this.pageSize,parentItem:t.parentItem};this.dataProviderParams&&(i=Ht(Ht({},i),this.dataProviderParams()));const o=(r,n)=>{t.pendingRequests[e]===o&&(void 0!==n?t.size=n:i.parentItem&&(t.size=r.length),t.setPage(e,r),this.recalculateFlatSize(),this.dispatchEvent(new CustomEvent("page-received")),delete t.pendingRequests[e],this.dispatchEvent(new CustomEvent("page-loaded")))};t.pendingRequests[e]=o,this.dispatchEvent(new CustomEvent("page-requested")),this.dataProvider(i,o)}__isItemLoaded(t){return this.isPlaceholder?!this.isPlaceholder(t):this.placeholder?t!==this.placeholder:!!t}}
|
|
4449
4449
|
/**
|
|
4450
4450
|
* @license
|
|
4451
4451
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4452
4452
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4453
|
-
*/const
|
|
4453
|
+
*/const rh=t=>class extends t{static get properties(){return{pageSize:{type:Number,value:50,observer:"_pageSizeChanged",sync:!0},size:{type:Number,observer:"_sizeChanged",sync:!0},dataProvider:{type:Object,observer:"_dataProviderChanged",sync:!0},__dataProviderInitialized:{type:Boolean,value:!1},__previousDataProviderFilter:{type:String}}}static get observers(){return["_dataProviderFilterChanged(filter)","_warnDataProviderValue(dataProvider, value)","_ensureFirstPage(opened)"]}constructor(){super(),this.__dataProviderController=new oh(this,{placeholder:new Jl,isPlaceholder:t=>t instanceof Jl,dataProviderParams:()=>({filter:this.filter})}),this.__dataProviderController.addEventListener("page-requested",this.__onDataProviderPageRequested.bind(this)),this.__dataProviderController.addEventListener("page-loaded",this.__onDataProviderPageLoaded.bind(this))}ready(){super.ready(),this._scroller.addEventListener("index-requested",(t=>{if(!this._shouldFetchData())return;const e=t.detail.index;void 0!==e&&this.__dataProviderController.ensureFlatIndexLoaded(e)})),this.__dataProviderInitialized=!0,this.dataProvider&&this.__synchronizeControllerState()}_dataProviderFilterChanged(t){void 0!==this.__previousDataProviderFilter||""!==t?this.__previousDataProviderFilter!==t&&(this.__previousDataProviderFilter=t,this.__keepOverlayOpened=!0,this.size=void 0,this.clearCache(),this.__keepOverlayOpened=!1):this.__previousDataProviderFilter=t}_shouldFetchData(){return!!this.dataProvider&&(this.opened||this.filter&&this.filter.length)}_ensureFirstPage(t){!this._shouldFetchData()||!t||(this._forceNextRequest||void 0===this.size?(this._forceNextRequest=!1,this.__dataProviderController.loadFirstPage()):this.size>0&&this.__dataProviderController.ensureFlatIndexLoaded(0))}__onDataProviderPageRequested(){this.loading=!0}__onDataProviderPageLoaded(){const{rootCache:t}=this.__dataProviderController;t.items=[...t.items],this.__synchronizeControllerState(),!this.opened&&!this._isInputFocused()&&this._commitValue()}clearCache(){this.dataProvider&&(this.__dataProviderController.clearCache(),this.__synchronizeControllerState(),this._shouldFetchData()?(this._forceNextRequest=!1,this.__dataProviderController.loadFirstPage()):this._forceNextRequest=!0)}_sizeChanged(t){const{rootCache:e}=this.__dataProviderController;e.size!==t&&(e.size=t,e.items=[...e.items],this.__synchronizeControllerState())}_filteredItemsChanged(t){if(super._filteredItemsChanged(t),this.dataProvider&&t){const{rootCache:e}=this.__dataProviderController;e.items!==t&&(e.items=t,this.__synchronizeControllerState())}}__synchronizeControllerState(){if(this.__dataProviderInitialized&&this.dataProvider){const{rootCache:t}=this.__dataProviderController;this.size=t.size,this.filteredItems=t.items,this.loading=this.__dataProviderController.isLoading()}}_pageSizeChanged(t,e){if(Math.floor(t)!==t||t<1)throw this.pageSize=e,new Error("`pageSize` value must be an integer > 0");this.__dataProviderController.setPageSize(t),this.clearCache()}_dataProviderChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.dataProvider=e})),this.__dataProviderController.setDataProvider(t),this.clearCache()}_ensureItemsOrDataProvider(t){if(void 0!==this.items&&void 0!==this.dataProvider)throw t(),new Error("Using `items` and `dataProvider` together is not supported")}_warnDataProviderValue(t,e){if(t&&""!==e&&null==this.selectedItem){const t=this.__getItemIndexByValue(this.filteredItems,e);(t<0||!this._getItemLabel(this.filteredItems[t]))&&console.warn("Warning: unable to determine the label for the provided `value`. Nothing to display in the text field. This usually happens when setting an initial `value` before any items are returned from the `dataProvider` callback. Consider setting `selectedItem` instead of `value`")}}}
|
|
4454
4454
|
/**
|
|
4455
4455
|
* @license
|
|
4456
4456
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4457
4457
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4458
|
-
*/;function
|
|
4458
|
+
*/;function nh(t){window.Vaadin&&window.Vaadin.templateRendererCallback?window.Vaadin.templateRendererCallback(t):t.querySelector("template")&&console.warn(`WARNING: <template> inside <${t.localName}> is no longer supported. Import @vaadin/polymer-legacy-adapter/template-renderer.js to enable compatibility.`)}
|
|
4459
4459
|
/**
|
|
4460
4460
|
* @license
|
|
4461
4461
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4462
4462
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4463
|
-
*/function eh(t){return null!=t}function ih(t,e){return t.findIndex((t=>!(t instanceof Hl)&&e(t)))}const oh=t=>class extends(vl(ps(_s(es(Vn(ns(Un(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),th(this),this.addController(new gl(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,o,r,n,s,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:o,selectedItem:r,itemIdPath:n,focusedIndex:s,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,o){this._overlayOpened=t&&(o||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&Qn(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!Ks&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?jl(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?jl(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{Ks&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(eh(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,o=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&o>=0&&(this.selectedItem=t[o]);const r=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=r>-1?r:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&eh(e)?ih(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?ih(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Hl)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Gn())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4463
|
+
*/function sh(t){return null!=t}function ah(t,e){return t.findIndex((t=>!(t instanceof Jl)&&e(t)))}const lh=t=>class extends(xl(bs(As(ss(Yn(cs(Gn(t)))))))){static get properties(){return{opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0,sync:!0,observer:"_openedChanged"},autoOpenDisabled:{type:Boolean,sync:!0},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},renderer:{type:Object,sync:!0},items:{type:Array,sync:!0,observer:"_itemsChanged"},allowCustomValue:{type:Boolean,value:!1},filteredItems:{type:Array,observer:"_filteredItemsChanged",sync:!0},_lastCommittedValue:String,loading:{type:Boolean,value:!1,reflectToAttribute:!0,sync:!0},_focusedIndex:{type:Number,observer:"_focusedIndexChanged",value:-1,sync:!0},filter:{type:String,value:"",notify:!0,sync:!0},selectedItem:{type:Object,notify:!0,sync:!0},itemClassNameGenerator:{type:Object},itemLabelPath:{type:String,value:"label",observer:"_itemLabelPathChanged",sync:!0},itemValuePath:{type:String,value:"value",sync:!0},itemIdPath:{type:String,sync:!0},_toggleElement:{type:Object,observer:"_toggleElementChanged"},_dropdownItems:{type:Array,sync:!0},_closeOnBlurIsPrevented:Boolean,_scroller:{type:Object,sync:!0},_overlayOpened:{type:Boolean,sync:!0,observer:"_overlayOpenedChanged"},__keepOverlayOpened:{type:Boolean,sync:!0}}}static get observers(){return["_selectedItemChanged(selectedItem, itemValuePath, itemLabelPath)","_openedOrItemsChanged(opened, _dropdownItems, loading, __keepOverlayOpened)","_updateScroller(_scroller, _dropdownItems, opened, loading, selectedItem, itemIdPath, _focusedIndex, renderer, _theme, itemClassNameGenerator)"]}constructor(){super(),this._boundOverlaySelectedItemChanged=this._overlaySelectedItemChanged.bind(this),this._boundOnClearButtonMouseDown=this.__onClearButtonMouseDown.bind(this),this._boundOnClick=this._onClick.bind(this),this._boundOnOverlayTouchAction=this._onOverlayTouchAction.bind(this),this._boundOnTouchend=this._onTouchend.bind(this)}get _tagNamePrefix(){return"vaadin-combo-box"}get _nativeInput(){return this.inputElement}_inputElementChanged(t){super._inputElementChanged(t);const e=this._nativeInput;e&&(e.autocomplete="off",e.autocapitalize="off",e.setAttribute("role","combobox"),e.setAttribute("aria-autocomplete","list"),e.setAttribute("aria-expanded",!!this.opened),e.setAttribute("spellcheck","false"),e.setAttribute("autocorrect","off"),this._revertInputValueToValue(),this.clearElement&&this.clearElement.addEventListener("mousedown",this._boundOnClearButtonMouseDown))}ready(){super.ready(),this._initOverlay(),this._initScroller(),this._lastCommittedValue=this.value,this.addEventListener("click",this._boundOnClick),this.addEventListener("touchend",this._boundOnTouchend);const t=()=>{requestAnimationFrame((()=>{this._overlayElement.bringToFront()}))};this.addEventListener("mousedown",t),this.addEventListener("touchstart",t),nh(this),this.addController(new _l(this))}disconnectedCallback(){super.disconnectedCallback(),this.close()}requestContentUpdate(){this._scroller&&(this._scroller.requestContentUpdate(),this._getItemElements().forEach((t=>{t.requestContentUpdate()})))}open(){!this.disabled&&!this.readonly&&(this.opened=!0)}close(){this.opened=!1}_propertiesChanged(t,e,i){super._propertiesChanged(t,e,i),void 0!==e.filter&&this._filterChanged(e.filter)}updated(t){super.updated(t),t.has("filter")&&this._filterChanged(this.filter)}_initOverlay(){const t=this.$.overlay;t._comboBox=this,t.addEventListener("touchend",this._boundOnOverlayTouchAction),t.addEventListener("touchmove",this._boundOnOverlayTouchAction),t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("opened-changed",(t=>{this._overlayOpened=t.detail.value})),this._overlayElement=t}_initScroller(t){const e=document.createElement(`${this._tagNamePrefix}-scroller`);e.owner=t||this,e.getItemLabel=this._getItemLabel.bind(this),e.addEventListener("selection-changed",this._boundOverlaySelectedItemChanged);const i=this._overlayElement;i.renderer=t=>{t.innerHTML||t.appendChild(e)},i.requestContentUpdate(),this._scroller=e}_updateScroller(t,e,i,o,r,n,s,a,l,h){if(t&&(i&&(t.style.maxHeight=getComputedStyle(this).getPropertyValue(`--${this._tagNamePrefix}-overlay-max-height`)||"65vh"),t.setProperties({items:i?e:[],opened:i,loading:o,selectedItem:r,itemIdPath:n,focusedIndex:s,renderer:a,theme:l,itemClassNameGenerator:h}),t.performUpdate&&!t.hasUpdated))try{t.performUpdate()}catch(t){}}_openedOrItemsChanged(t,e,i,o){this._overlayOpened=t&&(o||i||!(!e||!e.length))}_overlayOpenedChanged(t,e){t?(this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-opened",{bubbles:!0,composed:!0})),this._onOpened()):e&&this._dropdownItems&&this._dropdownItems.length&&(this.close(),this.dispatchEvent(new CustomEvent("vaadin-combo-box-dropdown-closed",{bubbles:!0,composed:!0})))}_focusedIndexChanged(t,e){void 0!==e&&this._updateActiveDescendant(t)}_isInputFocused(){return this.inputElement&&rs(this.inputElement)}_updateActiveDescendant(t){const e=this._nativeInput;if(!e)return;const i=this._getItemElements().find((e=>e.index===t));i?e.setAttribute("aria-activedescendant",i.id):e.removeAttribute("aria-activedescendant")}_openedChanged(t,e){if(void 0===e)return;t?!this._isInputFocused()&&!ia&&this.inputElement&&this.inputElement.focus():this._onClosed();const i=this._nativeInput;i&&(i.setAttribute("aria-expanded",!!t),t?i.setAttribute("aria-controls",this._scroller.id):i.removeAttribute("aria-controls"))}_onOverlayTouchAction(){this._closeOnBlurIsPrevented=!0,this.inputElement.blur(),this._closeOnBlurIsPrevented=!1}_isClearButton(t){return t.composedPath()[0]===this.clearElement}__onClearButtonMouseDown(t){t.preventDefault(),this.inputElement.focus()}_onClearButtonClick(t){t.preventDefault(),this._onClearAction(),this.opened&&this.requestContentUpdate()}_onToggleButtonClick(t){t.preventDefault(),this.opened?this.close():this.open()}_onHostClick(t){this.autoOpenDisabled||(t.preventDefault(),this.open())}_onClick(t){this._isClearButton(t)?this._onClearButtonClick(t):t.composedPath().includes(this._toggleElement)?this._onToggleButtonClick(t):this._onHostClick(t)}_onKeyDown(t){super._onKeyDown(t),"ArrowDown"===t.key?(this._onArrowDown(),t.preventDefault()):"ArrowUp"===t.key&&(this._onArrowUp(),t.preventDefault())}_getItemLabel(t){let e=t&&this.itemLabelPath?Ul(this.itemLabelPath,t):void 0;return null==e&&(e=t?t.toString():""),e}_getItemValue(t){let e=t&&this.itemValuePath?Ul(this.itemValuePath,t):void 0;return void 0===e&&(e=t?t.toString():""),e}_onArrowDown(){if(this.opened){const t=this._dropdownItems;t&&(this._focusedIndex=Math.min(t.length-1,this._focusedIndex+1),this._prefillFocusedItemLabel())}else this.open()}_onArrowUp(){if(this.opened){if(this._focusedIndex>-1)this._focusedIndex=Math.max(0,this._focusedIndex-1);else{const t=this._dropdownItems;t&&(this._focusedIndex=t.length-1)}this._prefillFocusedItemLabel()}else this.open()}_prefillFocusedItemLabel(){this._focusedIndex>-1&&(this._inputElementValue=this._getItemLabel(this._dropdownItems[this._focusedIndex]),this._markAllSelectionRange())}_setSelectionRange(t,e){this._isInputFocused()&&this.inputElement.setSelectionRange&&this.inputElement.setSelectionRange(t,e)}_markAllSelectionRange(){void 0!==this._inputElementValue&&this._setSelectionRange(0,this._inputElementValue.length)}_clearSelectionRange(){if(void 0!==this._inputElementValue){const t=this._inputElementValue?this._inputElementValue.length:0;this._setSelectionRange(t,t)}}_closeOrCommit(){this.opened||this.loading?this.close():this._commitValue()}_onEnter(t){if(!this._hasValidInputValue())return t.preventDefault(),void t.stopPropagation();this.opened&&(t.preventDefault(),t.stopPropagation()),this._closeOrCommit()}_hasValidInputValue(){const t=this._focusedIndex<0&&""!==this._inputElementValue&&this._getItemLabel(this.selectedItem)!==this._inputElementValue;return this.allowCustomValue||!t}_onEscape(t){this.autoOpenDisabled&&(this.opened||this.value!==this._inputElementValue&&this._inputElementValue.length>0)?(t.stopPropagation(),this._focusedIndex=-1,this.cancel()):this.opened?(t.stopPropagation(),this._focusedIndex>-1?(this._focusedIndex=-1,this._revertInputValue()):this.cancel()):this.clearButtonVisible&&this.value&&!this.readonly&&(t.stopPropagation(),this._onClearAction())}_toggleElementChanged(t){t&&(t.addEventListener("mousedown",(t=>t.preventDefault())),t.addEventListener("click",(()=>{ia&&!this._isInputFocused()&&document.activeElement.blur()})))}_onClearAction(){this.selectedItem=null,this.allowCustomValue&&(this.value=""),this._detectAndDispatchChange()}_clearFilter(){this.filter=""}cancel(){this._revertInputValueToValue(),this._lastCommittedValue=this.value,this._closeOrCommit()}_onOpened(){this._lastCommittedValue=this.value}_onClosed(){(!this.loading||this.allowCustomValue)&&this._commitValue()}_commitValue(){if(this._focusedIndex>-1){const t=this._dropdownItems[this._focusedIndex];this.selectedItem!==t&&(this.selectedItem=t),this._inputElementValue=this._getItemLabel(this.selectedItem),this._focusedIndex=-1}else if(""===this._inputElementValue||void 0===this._inputElementValue)this.selectedItem=null,this.allowCustomValue&&(this.value="");else{const t=[this.selectedItem,...this._dropdownItems||[]],e=t[this.__getItemIndexByLabel(t,this._inputElementValue)];if(this.allowCustomValue&&!e){const t=this._inputElementValue;this._lastCustomValue=t;const e=new CustomEvent("custom-value-set",{detail:t,composed:!0,cancelable:!0,bubbles:!0});this.dispatchEvent(e),e.defaultPrevented||(this.value=t)}else this.allowCustomValue||this.opened||!e?this._revertInputValueToValue():this.value=this._getItemValue(e)}this._detectAndDispatchChange(),this._clearSelectionRange(),this._clearFilter()}_onInput(t){const e=this._inputElementValue,i={};this.filter===e?this._filterChanged(this.filter):i.filter=e,!this.opened&&!this._isClearButton(t)&&!this.autoOpenDisabled&&(i.opened=!0),this.setProperties(i)}_onChange(t){t.stopPropagation()}_itemLabelPathChanged(t){"string"!=typeof t&&console.error("You should set itemLabelPath to a valid string")}_filterChanged(t){this._scrollIntoView(0),this._focusedIndex=-1,this.items?this.filteredItems=this._filterItems(this.items,t):this._filteredItemsChanged(this.filteredItems)}_revertInputValue(){""!==this.filter?this._inputElementValue=this.filter:this._revertInputValueToValue(),this._clearSelectionRange()}_revertInputValueToValue(){this._inputElementValue=this.allowCustomValue&&!this.selectedItem?this.value:this._getItemLabel(this.selectedItem)}_selectedItemChanged(t){if(null==t)this.filteredItems&&(this.allowCustomValue||(this.value=""),this._toggleHasValue(this._hasValue),this._inputElementValue=this.value);else{const e=this._getItemValue(t);if(this.value!==e&&(this.value=e,this.value!==e))return;this._toggleHasValue(!0),this._inputElementValue=this._getItemLabel(t)}}_valueChanged(t,e){""===t&&void 0===e||(sh(t)?(this._getItemValue(this.selectedItem)!==t&&this._selectItemForValue(t),!this.selectedItem&&this.allowCustomValue&&(this._inputElementValue=t),this._toggleHasValue(this._hasValue)):this.selectedItem=null,this._clearFilter(),this._lastCommittedValue=void 0)}_detectAndDispatchChange(){document.hasFocus()&&this.validate(),this.value!==this._lastCommittedValue&&(this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this._lastCommittedValue=this.value)}_itemsChanged(t,e){this._ensureItemsOrDataProvider((()=>{this.items=e})),t?this.filteredItems=t.slice(0):e&&(this.filteredItems=null)}_filteredItemsChanged(t){this._setDropdownItems(t)}_filterItems(t,e){return t&&t.filter((t=>(e=e?e.toString().toLowerCase():"",this._getItemLabel(t).toString().toLowerCase().indexOf(e)>-1)))}_selectItemForValue(t){const e=this.__getItemIndexByValue(this.filteredItems,t),i=this.selectedItem;this.selectedItem=e>=0?this.filteredItems[e]:this.dataProvider&&void 0===this.selectedItem?void 0:null,null===this.selectedItem&&null===i&&this._selectedItemChanged(this.selectedItem)}_setDropdownItems(t){const e=this._dropdownItems;this._dropdownItems=t;const i=e?e[this._focusedIndex]:null,o=this.__getItemIndexByValue(t,this.value);null==this.selectedItem&&o>=0&&(this.selectedItem=t[o]);const r=this.__getItemIndexByValue(t,this._getItemValue(i));this._focusedIndex=r>-1?r:this.__getItemIndexByLabel(t,this.filter)}_getItemElements(){return Array.from(this._scroller.querySelectorAll(`${this._tagNamePrefix}-item`))}_scrollIntoView(t){this._scroller&&this._scroller.scrollIntoView(t)}__getItemIndexByValue(t,e){return t&&sh(e)?ah(t,(t=>this._getItemValue(t)===e)):-1}__getItemIndexByLabel(t,e){return t&&e?ah(t,(t=>this._getItemLabel(t).toString().toLowerCase()===e.toString().toLowerCase())):-1}_overlaySelectedItemChanged(t){t.stopPropagation(),!(t.detail.item instanceof Jl)&&this.opened&&(this._focusedIndex=this.filteredItems.indexOf(t.detail.item),this.close())}_setFocused(t){if(super._setFocused(t),!t&&!this.readonly&&!this._closeOnBlurIsPrevented){if(!this.opened&&this.allowCustomValue&&this._inputElementValue===this._lastCustomValue)return void delete this._lastCustomValue;if(Zn())return void this._closeOrCommit();this.opened?this._overlayOpened||this.close():this._commitValue()}}_shouldRemoveFocus(t){return!(t.relatedTarget&&t.relatedTarget.localName===`${this._tagNamePrefix}-item`||t.relatedTarget===this._overlayElement&&(t.composedPath()[0].focus(),1))}_onTouchend(t){!this.clearElement||t.composedPath()[0]!==this.clearElement||(t.preventDefault(),this._onClearAction())}}
|
|
4464
4464
|
/**
|
|
4465
4465
|
* @license
|
|
4466
4466
|
* Copyright (c) 2015 - 2024 Vaadin Ltd.
|
|
4467
4467
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4468
|
-
*/;
|
|
4468
|
+
*/;fi("vaadin-combo-box",wl,{moduleId:"vaadin-combo-box-styles"});class hh extends(rh(lh(Zl(gl(wi(ln(jr))))))){static get is(){return"vaadin-combo-box"}static get template(){return Pr`
|
|
4469
4469
|
<style>
|
|
4470
4470
|
:host([opened]) {
|
|
4471
4471
|
pointer-events: auto;
|
|
@@ -4510,7 +4510,7 @@ const Gl=t=>class extends(dl(t)){static get properties(){return{pattern:{type:St
|
|
|
4510
4510
|
></vaadin-combo-box-overlay>
|
|
4511
4511
|
|
|
4512
4512
|
<slot name="tooltip"></slot>
|
|
4513
|
-
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new
|
|
4513
|
+
`}static get properties(){return{_positionTarget:{type:Object}}}get clearElement(){return this.$.clearButton}ready(){super.ready(),this.addController(new Is(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new Ms(this.inputElement,this._labelController)),this._tooltipController=new gn(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._positionTarget=this.shadowRoot.querySelector('[part="input-field"]'),this._toggleElement=this.$.toggleButton}_onClearButtonClick(t){t.stopPropagation(),super._onClearButtonClick(t)}_onHostClick(t){const e=t.composedPath();(e.includes(this._labelNode)||e.includes(this._positionTarget))&&super._onHostClick(t)}}Yt(hh),fi("vaadin-multi-select-combo-box-chip",[Rs,ee`
|
|
4514
4514
|
:host {
|
|
4515
4515
|
font-size: var(--lumo-font-size-xxs);
|
|
4516
4516
|
line-height: 1;
|
|
@@ -4599,23 +4599,23 @@ const Gl=t=>class extends(dl(t)){static get properties(){return{pattern:{type:St
|
|
|
4599
4599
|
-webkit-text-fill-color: var(--lumo-disabled-text-color);
|
|
4600
4600
|
pointer-events: none;
|
|
4601
4601
|
}
|
|
4602
|
-
`],{moduleId:"lumo-multi-select-combo-box-chip"}),
|
|
4602
|
+
`],{moduleId:"lumo-multi-select-combo-box-chip"}),fi("vaadin-multi-select-combo-box-item",[Ol,El,ee`
|
|
4603
4603
|
@media (any-hover: hover) {
|
|
4604
4604
|
:host(:hover[readonly]) {
|
|
4605
4605
|
background-color: transparent;
|
|
4606
4606
|
cursor: default;
|
|
4607
4607
|
}
|
|
4608
4608
|
}
|
|
4609
|
-
`],{moduleId:"lumo-multi-select-combo-box-item"}),
|
|
4609
|
+
`],{moduleId:"lumo-multi-select-combo-box-item"}),fi("vaadin-multi-select-combo-box-overlay",[js,Ls,Bl,Pl,jl,ee`
|
|
4610
4610
|
:host {
|
|
4611
4611
|
--_vaadin-multi-select-combo-box-items-container-border-width: var(--lumo-space-xs);
|
|
4612
4612
|
--_vaadin-multi-select-combo-box-items-container-border-style: solid;
|
|
4613
4613
|
}
|
|
4614
|
-
`],{moduleId:"lumo-multi-select-combo-box-overlay"}),
|
|
4614
|
+
`],{moduleId:"lumo-multi-select-combo-box-overlay"}),fi("vaadin-multi-select-combo-box-container",ee`
|
|
4615
4615
|
:host([auto-expand-vertically]) {
|
|
4616
4616
|
padding-block: var(--lumo-space-xs);
|
|
4617
4617
|
}
|
|
4618
|
-
`,{moduleId:"lumo-multi-select-combo-box-container"}),
|
|
4618
|
+
`,{moduleId:"lumo-multi-select-combo-box-container"}),fi("vaadin-multi-select-combo-box",[Us,ee`
|
|
4619
4619
|
:host([has-value]) {
|
|
4620
4620
|
padding-inline-start: 0;
|
|
4621
4621
|
}
|
|
@@ -4674,7 +4674,7 @@ const Gl=t=>class extends(dl(t)){static get properties(){return{pattern:{type:St
|
|
|
4674
4674
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4675
4675
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4676
4676
|
*/
|
|
4677
|
-
class
|
|
4677
|
+
class ch extends(wi(jr)){static get is(){return"vaadin-multi-select-combo-box-chip"}static get properties(){return{disabled:{type:Boolean,reflectToAttribute:!0},readonly:{type:Boolean,reflectToAttribute:!0},label:{type:String},item:{type:Object}}}static get template(){return Pr`
|
|
4678
4678
|
<style>
|
|
4679
4679
|
:host {
|
|
4680
4680
|
display: inline-flex;
|
|
@@ -4703,13 +4703,13 @@ class nh extends(fi(Nr)){static get is(){return"vaadin-multi-select-combo-box-ch
|
|
|
4703
4703
|
</style>
|
|
4704
4704
|
<div part="label">[[label]]</div>
|
|
4705
4705
|
<div part="remove-button" on-click="_onRemoveClick"></div>
|
|
4706
|
-
`}_onRemoveClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("item-removed",{detail:{item:this.item},bubbles:!0,composed:!0}))}}let
|
|
4706
|
+
`}_onRemoveClick(t){t.stopPropagation(),this.dispatchEvent(new CustomEvent("item-removed",{detail:{item:this.item},bubbles:!0,composed:!0}))}}let dh;Yt(ch),
|
|
4707
4707
|
/**
|
|
4708
4708
|
* @license
|
|
4709
4709
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4710
4710
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4711
4711
|
*/
|
|
4712
|
-
|
|
4712
|
+
fi("vaadin-multi-select-combo-box-container",ee`
|
|
4713
4713
|
#wrapper {
|
|
4714
4714
|
display: flex;
|
|
4715
4715
|
width: 100%;
|
|
@@ -4719,13 +4719,13 @@ ci("vaadin-multi-select-combo-box-container",Xt`
|
|
|
4719
4719
|
:host([auto-expand-vertically]) #wrapper {
|
|
4720
4720
|
flex-wrap: wrap;
|
|
4721
4721
|
}
|
|
4722
|
-
`,{moduleId:"vaadin-multi-select-combo-box-container-styles"}),
|
|
4722
|
+
`,{moduleId:"vaadin-multi-select-combo-box-container-styles"}),Yt(class extends Hs{static get is(){return"vaadin-multi-select-combo-box-container"}static get template(){if(!dh){dh=super.template.cloneNode(!0);const t=dh.content,e=t.querySelectorAll("slot"),i=document.createElement("div");i.setAttribute("id","wrapper"),t.insertBefore(i,e[2]),i.appendChild(e[0]),i.appendChild(e[1])}return dh}static get properties(){return{autoExpandVertically:{type:Boolean,reflectToAttribute:!0}}}});
|
|
4723
4723
|
/**
|
|
4724
4724
|
* @license
|
|
4725
4725
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4726
4726
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4727
4727
|
*/
|
|
4728
|
-
class
|
|
4728
|
+
class uh extends(Ll(wi(nn(jr)))){static get is(){return"vaadin-multi-select-combo-box-item"}static get template(){return Pr`
|
|
4729
4729
|
<style>
|
|
4730
4730
|
:host {
|
|
4731
4731
|
display: block;
|
|
@@ -4739,7 +4739,7 @@ class ah extends(Ol(fi(Qr(Nr)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4739
4739
|
<div part="content">
|
|
4740
4740
|
<slot></slot>
|
|
4741
4741
|
</div>
|
|
4742
|
-
`}}
|
|
4742
|
+
`}}Yt(uh),fi("vaadin-multi-select-combo-box-overlay",[Ws,ee`
|
|
4743
4743
|
#overlay {
|
|
4744
4744
|
width: var(
|
|
4745
4745
|
--vaadin-multi-select-combo-box-overlay-width,
|
|
@@ -4752,19 +4752,19 @@ class ah extends(Ol(fi(Qr(Nr)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4752
4752
|
flex-direction: column;
|
|
4753
4753
|
height: 100%;
|
|
4754
4754
|
}
|
|
4755
|
-
`],{moduleId:"vaadin-multi-select-combo-box-overlay-styles"});class
|
|
4755
|
+
`],{moduleId:"vaadin-multi-select-combo-box-overlay-styles"});class ph extends(Fl(ba(nn(wi(jr))))){static get is(){return"vaadin-multi-select-combo-box-overlay"}static get template(){return Pr`
|
|
4756
4756
|
<div id="backdrop" part="backdrop" hidden></div>
|
|
4757
4757
|
<div part="overlay" id="overlay">
|
|
4758
4758
|
<div part="loader"></div>
|
|
4759
4759
|
<div part="content" id="content"><slot></slot></div>
|
|
4760
4760
|
</div>
|
|
4761
|
-
`}}
|
|
4761
|
+
`}}Yt(ph);
|
|
4762
4762
|
/**
|
|
4763
4763
|
* @license
|
|
4764
4764
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4765
4765
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4766
4766
|
*/
|
|
4767
|
-
class
|
|
4767
|
+
class mh extends(Xl(jr)){static get is(){return"vaadin-multi-select-combo-box-scroller"}static get template(){return Pr`
|
|
4768
4768
|
<style>
|
|
4769
4769
|
:host {
|
|
4770
4770
|
display: block;
|
|
@@ -4791,13 +4791,13 @@ class hh extends(Wl(Nr)){static get is(){return"vaadin-multi-select-combo-box-sc
|
|
|
4791
4791
|
<div id="selector">
|
|
4792
4792
|
<slot></slot>
|
|
4793
4793
|
</div>
|
|
4794
|
-
`}ready(){super.ready(),this.setAttribute("aria-multiselectable","true")}_isItemSelected(t,e,i){return!(t instanceof
|
|
4794
|
+
`}ready(){super.ready(),this.setAttribute("aria-multiselectable","true")}_isItemSelected(t,e,i){return!(t instanceof Jl||this.owner.readonly)&&this.owner._findIndex(t,this.owner.selectedItems,i)>-1}_updateElement(t,e){super._updateElement(t,e),t.toggleAttribute("readonly",this.owner.readonly)}}Yt(mh);
|
|
4795
4795
|
/**
|
|
4796
4796
|
* @license
|
|
4797
4797
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4798
4798
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4799
4799
|
*/
|
|
4800
|
-
class
|
|
4800
|
+
class fh extends(rh(lh(wi(jr)))){static get is(){return"vaadin-multi-select-combo-box-internal"}static get template(){return Pr`
|
|
4801
4801
|
<style>
|
|
4802
4802
|
:host([opened]) {
|
|
4803
4803
|
pointer-events: auto;
|
|
@@ -4815,18 +4815,18 @@ class ch extends(Ql(oh(fi(Nr)))){static get is(){return"vaadin-multi-select-comb
|
|
|
4815
4815
|
no-vertical-overlap
|
|
4816
4816
|
restore-focus-node="[[inputElement]]"
|
|
4817
4817
|
></vaadin-multi-select-combo-box-overlay>
|
|
4818
|
-
`}static get properties(){return{filteredItems:{type:Array,notify:!0},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,notify:!0},size:{type:Number,notify:!0},selectedItems:{type:Array,value:()=>[]},selectedItemsOnTop:{type:Boolean,value:!1},lastFilter:{type:String,notify:!0},topGroup:{type:Array,observer:"_topGroupChanged"},_target:{type:Object}}}static get observers(){return["_readonlyChanged(readonly)"]}get clearElement(){return this.querySelector('[part="clear-button"]')}get _tagNamePrefix(){return"vaadin-multi-select-combo-box"}constructor(){super(),this.addEventListener("custom-value-set",this.__onCustomValueSet.bind(this))}open(){!this.disabled&&(!this.readonly||0!==this.selectedItems.length)&&(this.opened=!0)}ready(){super.ready(),this._target=this,this._toggleElement=this.querySelector(".toggle-button")}_readonlyChanged(){this._setDropdownItems(this.filteredItems)}_setDropdownItems(t){if(this.readonly)super._setDropdownItems(this.selectedItems);else if(!this.filter&&this.selectedItemsOnTop)if(t&&t.length&&this.topGroup&&this.topGroup.length){const e=t.filter((t=>-1===this._comboBox._findIndex(t,this.topGroup,this.itemIdPath)));super._setDropdownItems(this.topGroup.concat(e))}else super._setDropdownItems(t);else super._setDropdownItems(t)}_topGroupChanged(t){t&&this._setDropdownItems(this.filteredItems)}_initScroller(){const t=this.getRootNode().host;this._comboBox=t,super._initScroller(t)}_onEnter(t){if(this.opened){if(t.preventDefault(),t.stopPropagation(),this.readonly)this.close();else if(this._hasValidInputValue()){const t=this._dropdownItems[this._focusedIndex];this._commitValue(),this._focusedIndex=this._dropdownItems.indexOf(t)}}else super._onEnter(t)}_onEscape(t){if(this.readonly)return t.stopPropagation(),void(this.opened&&this.close());super._onEscape(t)}_clearFilter(){(!this.keepFilter||!this.opened)&&super._clearFilter()}_revertInputValueToValue(){super._revertInputValueToValue(),this.filter=""}_commitValue(){this.lastFilter=this.filter,super._commitValue()}_onArrowDown(){this.readonly?this.opened||this.open():super._onArrowDown()}_onArrowUp(){this.readonly?this.opened||this.open():super._onArrowUp()}_setFocused(t){t||(this._ignoreCommitValue=!0),super._setFocused(t),!t&&this.readonly&&!this._closeOnBlurIsPrevented&&this.close()}_onClosed(){this._ignoreCommitValue=!0,super._onClosed()}_detectAndDispatchChange(){if(this._ignoreCommitValue)return this._ignoreCommitValue=!1,this.clear(),void(this._inputElementValue="");super._detectAndDispatchChange()}_overlaySelectedItemChanged(t){t.stopPropagation(),!this.readonly&&(t.detail.item instanceof
|
|
4818
|
+
`}static get properties(){return{filteredItems:{type:Array,notify:!0},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,notify:!0},size:{type:Number,notify:!0},selectedItems:{type:Array,value:()=>[]},selectedItemsOnTop:{type:Boolean,value:!1},lastFilter:{type:String,notify:!0},topGroup:{type:Array,observer:"_topGroupChanged"},_target:{type:Object}}}static get observers(){return["_readonlyChanged(readonly)"]}get clearElement(){return this.querySelector('[part="clear-button"]')}get _tagNamePrefix(){return"vaadin-multi-select-combo-box"}constructor(){super(),this.addEventListener("custom-value-set",this.__onCustomValueSet.bind(this))}open(){!this.disabled&&(!this.readonly||0!==this.selectedItems.length)&&(this.opened=!0)}ready(){super.ready(),this._target=this,this._toggleElement=this.querySelector(".toggle-button")}_readonlyChanged(){this._setDropdownItems(this.filteredItems)}_setDropdownItems(t){if(this.readonly)super._setDropdownItems(this.selectedItems);else if(!this.filter&&this.selectedItemsOnTop)if(t&&t.length&&this.topGroup&&this.topGroup.length){const e=t.filter((t=>-1===this._comboBox._findIndex(t,this.topGroup,this.itemIdPath)));super._setDropdownItems(this.topGroup.concat(e))}else super._setDropdownItems(t);else super._setDropdownItems(t)}_topGroupChanged(t){t&&this._setDropdownItems(this.filteredItems)}_initScroller(){const t=this.getRootNode().host;this._comboBox=t,super._initScroller(t)}_onEnter(t){if(this.opened){if(t.preventDefault(),t.stopPropagation(),this.readonly)this.close();else if(this._hasValidInputValue()){const t=this._dropdownItems[this._focusedIndex];this._commitValue(),this._focusedIndex=this._dropdownItems.indexOf(t)}}else super._onEnter(t)}_onEscape(t){if(this.readonly)return t.stopPropagation(),void(this.opened&&this.close());super._onEscape(t)}_clearFilter(){(!this.keepFilter||!this.opened)&&super._clearFilter()}_revertInputValueToValue(){super._revertInputValueToValue(),this.filter=""}_commitValue(){this.lastFilter=this.filter,super._commitValue()}_onArrowDown(){this.readonly?this.opened||this.open():super._onArrowDown()}_onArrowUp(){this.readonly?this.opened||this.open():super._onArrowUp()}_setFocused(t){t||(this._ignoreCommitValue=!0),super._setFocused(t),!t&&this.readonly&&!this._closeOnBlurIsPrevented&&this.close()}_onClosed(){this._ignoreCommitValue=!0,super._onClosed()}_detectAndDispatchChange(){if(this._ignoreCommitValue)return this._ignoreCommitValue=!1,this.clear(),void(this._inputElementValue="");super._detectAndDispatchChange()}_overlaySelectedItemChanged(t){t.stopPropagation(),!this.readonly&&(t.detail.item instanceof Jl||this.opened&&(this.lastFilter=this.filter,this.dispatchEvent(new CustomEvent("combo-box-item-selected",{detail:{item:t.detail.item}}))))}_shouldFetchData(){return!this.readonly&&super._shouldFetchData()}clearCache(){this.readonly||super.clearCache()}__onCustomValueSet(t){this._ignoreCommitValue&&t.stopImmediatePropagation()}}Yt(fh);
|
|
4819
4819
|
/**
|
|
4820
4820
|
* @license
|
|
4821
4821
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4822
4822
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4823
4823
|
*/
|
|
4824
|
-
const
|
|
4824
|
+
const vh=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resizables?t.target.resizables.forEach((e=>{e._onResize(t.contentRect)})):t.target._onResize(t.contentRect)}))}))})),gh=qi((t=>class extends t{get _observeParent(){return!1}connectedCallback(){if(super.connectedCallback(),vh.observe(this),this._observeParent){const t=this.parentNode instanceof ShadowRoot?this.parentNode.host:this.parentNode;t.resizables||(t.resizables=new Set,vh.observe(t)),t.resizables.add(this),this.__parent=t}}disconnectedCallback(){super.disconnectedCallback(),vh.unobserve(this);const t=this.__parent;if(this._observeParent&&t){const e=t.resizables;e&&(e.delete(this),0===e.size&&vh.unobserve(t)),this.__parent=null}}_onResize(t){}}));
|
|
4825
4825
|
/**
|
|
4826
4826
|
* @license
|
|
4827
4827
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
4828
4828
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
4829
|
-
*/
|
|
4829
|
+
*/fi("vaadin-multi-select-combo-box",[wl,ee`
|
|
4830
4830
|
:host {
|
|
4831
4831
|
--input-min-width: var(--vaadin-multi-select-combo-box-input-min-width, 4em);
|
|
4832
4832
|
--_chip-min-width: var(--vaadin-multi-select-combo-box-chip-min-width, 50px);
|
|
@@ -4864,7 +4864,7 @@ const dh=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resiza
|
|
|
4864
4864
|
:host([auto-expand-horizontally]) [class$='container'] {
|
|
4865
4865
|
width: auto;
|
|
4866
4866
|
}
|
|
4867
|
-
`],{moduleId:"vaadin-multi-select-combo-box-styles"});class
|
|
4867
|
+
`],{moduleId:"vaadin-multi-select-combo-box-styles"});class bh extends(gh(gl(wi(ln(jr))))){static get is(){return"vaadin-multi-select-combo-box"}static get template(){return Pr`
|
|
4868
4868
|
<div class="vaadin-multi-select-combo-box-container">
|
|
4869
4869
|
<div part="label">
|
|
4870
4870
|
<slot name="label"></slot>
|
|
@@ -4935,7 +4935,7 @@ const dh=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resiza
|
|
|
4935
4935
|
</div>
|
|
4936
4936
|
|
|
4937
4937
|
<slot name="tooltip"></slot>
|
|
4938
|
-
`}static get properties(){return{autoExpandHorizontally:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandHorizontallyChanged"},autoExpandVertically:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandVerticallyChanged"},autoOpenDisabled:Boolean,clearButtonVisible:{type:Boolean,reflectToAttribute:!0,observer:"_clearButtonVisibleChanged",value:!1},items:{type:Array},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},itemIdPath:{type:String},i18n:{type:Object,value:()=>({cleared:"Selection cleared",focused:"focused. Press Backspace to remove",selected:"added to selection",deselected:"removed from selection",total:"{count} items selected"})},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,value:!1,reflectToAttribute:!0},overlayClass:{type:String},readonly:{type:Boolean,value:!1,observer:"_readonlyChanged",reflectToAttribute:!0},selectedItems:{type:Array,value:()=>[],notify:!0},opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},size:{type:Number},pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},dataProvider:{type:Object},allowCustomValue:{type:Boolean,value:!1},placeholder:{type:String,observer:"_placeholderChanged"},renderer:Function,filter:{type:String,value:"",notify:!0},filteredItems:Array,selectedItemsOnTop:{type:Boolean,value:!1},value:{type:String},_overflowItems:{type:Array,value:()=>[]},_focusedChipIndex:{type:Number,value:-1,observer:"_focusedChipIndexChanged"},_lastFilter:{type:String},_topGroup:{type:Array}}}static get observers(){return["_selectedItemsChanged(selectedItems, selectedItems.*)","__updateOverflowChip(_overflow, _overflowItems, disabled, readonly)","__updateTopGroup(selectedItemsOnTop, selectedItems, opened)"]}get slotStyles(){return[...super.slotStyles,`\n ${this.localName}[has-value] input::placeholder {\n color: transparent !important;\n forced-color-adjust: none;\n }\n `]}get clearElement(){return this.$.clearButton}get _chips(){return[...this.querySelectorAll('[slot="chip"]')]}get _hasValue(){return this.selectedItems&&this.selectedItems.length>0}ready(){super.ready(),this.addController(new Cs(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new Ss(this.inputElement,this._labelController)),this._tooltipController=new un(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._inputField=this.shadowRoot.querySelector('[part="input-field"]'),this._overflowController=new dn(this,"overflow","vaadin-multi-select-combo-box-chip",{initializer:t=>{t.addEventListener("mousedown",(t=>this._preventBlur(t))),this._overflow=t}}),this.addController(this._overflowController),this.__updateChips(),th(this)}checkValidity(){return!(this.required&&!this.readonly)||this._hasValue}clear(){this.__updateSelection([]),vs(this.i18n.cleared)}clearCache(){this.$&&this.$.comboBox&&this.$.comboBox.clearCache()}requestContentUpdate(){this.$&&this.$.comboBox&&this.$.comboBox.requestContentUpdate()}_disabledChanged(t,e){super._disabledChanged(t,e),(t||e)&&this.__updateChips()}_inputElementChanged(t){super._inputElementChanged(t),t&&this.$.comboBox._setInputElement(t)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&(this._focusedChipIndex=-1,this.validate())}_onResize(){this.__updateChips()}_delegateAttribute(t,e){if(this.stateTarget){if("required"===t)return void this._delegateAttribute("aria-required",!!e&&"true");super._delegateAttribute(t,e)}}_autoExpandHorizontallyChanged(t,e){(t||e)&&this.__updateChips()}_autoExpandVerticallyChanged(t,e){(t||e)&&this.__updateChips()}_clearButtonVisibleChanged(t,e){(t||e)&&this.__updateChips()}_onFilteredItemsChanged(t){const{value:e}=t.detail;(Array.isArray(e)||null==e)&&(this.filteredItems=e)}_readonlyChanged(t,e){(t||e)&&this.__updateChips(),this.dataProvider&&this.clearCache()}__itemClassNameGeneratorChanged(t,e){(t||e)&&this.__updateChips()}_pageSizeChanged(t,e){(Math.floor(t)!==t||t<=0)&&(this.pageSize=e,console.error('"pageSize" value must be an integer > 0')),this.$.comboBox.pageSize=this.pageSize}_placeholderChanged(t){const e=this.__tmpA11yPlaceholder;e!==t&&(this.__savedPlaceholder=t,e&&(this.placeholder=e))}_selectedItemsChanged(t){if(this._toggleHasValue(this._hasValue),this._hasValue){const e=this._mergeItemLabels(t);void 0===this.__tmpA11yPlaceholder&&(this.__savedPlaceholder=this.placeholder),this.__tmpA11yPlaceholder=e,this.placeholder=e}else void 0!==this.__tmpA11yPlaceholder&&(delete this.__tmpA11yPlaceholder,this.placeholder=this.__savedPlaceholder);this.__updateChips(),this.requestContentUpdate(),this.opened&&this.$.comboBox.$.overlay._updateOverlayWidth()}_getItemLabel(t){return this.$.comboBox._getItemLabel(t)}_mergeItemLabels(t){return t.map((t=>this._getItemLabel(t))).join(", ")}_findIndex(t,e,i){if(i&&t){for(let o=0;o<e.length;o++)if(e[o]&&e[o][i]===t[i])return o;return-1}return e.indexOf(t)}__clearInternalValue(t=!1){!this.keepFilter||t?(this.filter="",this.$.comboBox.clear()):(this.$.comboBox.clear(),this._inputElementValue=this.filter)}__announceItem(t,e,i){const o=e?"selected":"deselected",r=this.i18n.total.replace("{count}",i||0);vs(`${t} ${this.i18n[o]} ${r}`)}__removeItem(t){const e=[...this.selectedItems];e.splice(e.indexOf(t),1),this.__updateSelection(e);const i=this._getItemLabel(t);this.__announceItem(i,!1,e.length)}__selectItem(t){const e=[...this.selectedItems],i=this._findIndex(t,e,this.itemIdPath),o=this._getItemLabel(t);let r=!1;if(-1!==i){const t=this._lastFilter;if(t&&t.toLowerCase()===o.toLowerCase())return void this.__clearInternalValue();e.splice(i,1)}else e.push(t),r=!0;this.__updateSelection(e),this.__clearInternalValue(),this.__announceItem(o,r,e.length)}__updateSelection(t){this.selectedItems=t,this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}__updateTopGroup(t,e,i){t?i||(this._topGroup=[...e]):this._topGroup=[]}__createChip(t){const e=document.createElement("vaadin-multi-select-combo-box-chip");e.setAttribute("slot","chip"),e.item=t,e.disabled=this.disabled,e.readonly=this.readonly;const i=this._getItemLabel(t);return e.label=i,e.setAttribute("title",i),"function"==typeof this.itemClassNameGenerator&&(e.className=this.itemClassNameGenerator(t)),e.addEventListener("item-removed",(t=>this._onItemRemoved(t))),e.addEventListener("mousedown",(t=>this._preventBlur(t))),e}__getOverflowWidth(){const t=this._overflow;t.style.visibility="hidden",t.removeAttribute("hidden");const e=t.getAttribute("count");t.setAttribute("count","99");const i=getComputedStyle(t),o=t.clientWidth+parseInt(i.marginInlineStart);return t.setAttribute("count",e),t.setAttribute("hidden",""),t.style.visibility="",o}__updateChips(){if(!this._inputField||!this.inputElement)return;this._chips.forEach((t=>{t.remove()}));const t=[...this.selectedItems],e=this._inputField.$.wrapper.clientWidth,i=parseInt(getComputedStyle(this.inputElement).flexBasis);let o=e-i;t.length>1&&(o-=this.__getOverflowWidth());const r=parseInt(getComputedStyle(this).getPropertyValue("--_chip-min-width"));if(this.autoExpandHorizontally){const e=[];for(let i=t.length-1,o=null;i>=0;i--){const r=this.__createChip(t[i]);this.insertBefore(r,o),o=r,e.unshift(r)}const n=[];if(!this.autoExpandVertically&&this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth<i){for(;e.length>1;){e.pop().remove(),n.unshift(t.pop());const o=n.length>0?i+this.__getOverflowWidth():i;if(this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth>=o)break}1===e.length&&(e[0].style.maxWidth=`${Math.max(r,o)}px`)}this._overflowItems=n}else{for(let e=t.length-1,i=null;e>=0;e--){const n=this.__createChip(t[e]);if(this.insertBefore(n,i),!this.autoExpandVertically&&this.$.chips.clientWidth>o){if(null!==i){n.remove();break}n.style.maxWidth=`${Math.max(r,o)}px`}t.pop(),i=n}this._overflowItems=t}}__updateOverflowChip(t,e,i,o){if(t){const r=e.length;t.label=`${r}`,t.setAttribute("count",`${r}`),t.setAttribute("title",this._mergeItemLabels(e)),t.toggleAttribute("hidden",0===r),t.disabled=i,t.readonly=o}}_onClearButtonTouchend(t){t.preventDefault(),t.stopPropagation(),this.clear()}_onClearButtonClick(t){t.stopPropagation(),this.clear()}_onChange(t){t.stopPropagation()}_onEscape(t){this.clearButtonVisible&&this.selectedItems&&this.selectedItems.length&&(t.stopPropagation(),this.selectedItems=[])}_onKeyDown(t){super._onKeyDown(t);const e=this._chips;if(!this.readonly&&e.length>0)switch(t.key){case"Backspace":this._onBackSpace(e);break;case"ArrowLeft":this._onArrowLeft(e,t);break;case"ArrowRight":this._onArrowRight(e,t);break;default:this._focusedChipIndex=-1}}_onArrowLeft(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let o;-1!==i&&e.preventDefault(),this.__isRTL?i===t.length-1?o=-1:i>-1&&(o=i+1):-1===i?o=t.length-1:i>0&&(o=i-1),void 0!==o&&(this._focusedChipIndex=o)}_onArrowRight(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let o;-1!==i&&e.preventDefault(),this.__isRTL?-1===i?o=t.length-1:i>0&&(o=i-1):i===t.length-1?o=-1:i>-1&&(o=i+1),void 0!==o&&(this._focusedChipIndex=o)}_onBackSpace(t){if(0!==this.inputElement.selectionStart)return;const e=this._focusedChipIndex;-1===e?this._focusedChipIndex=t.length-1:(this.__removeItem(t[e].item),this._focusedChipIndex=-1)}_focusedChipIndexChanged(t,e){if(t>-1||e>-1){const e=this._chips;e.forEach(((e,i)=>{e.toggleAttribute("focused",i===t)})),t>-1&&vs(`${this._getItemLabel(e[t].item)} ${this.i18n.focused}`)}}_onComboBoxChange(){const t=this.$.comboBox.selectedItem;t&&this.__selectItem(t)}_onComboBoxItemSelected(t){this.__selectItem(t.detail.item)}_onCustomValueSet(t){t.preventDefault(),t.stopPropagation(),this.__clearInternalValue(!0),this.dispatchEvent(new CustomEvent("custom-value-set",{detail:t.detail,composed:!0,bubbles:!0}))}_onItemRemoved(t){this.__removeItem(t.detail.item)}_preventBlur(t){t.preventDefault()}}Vt(ph),ci("vaadin-notification-card",Xt`
|
|
4938
|
+
`}static get properties(){return{autoExpandHorizontally:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandHorizontallyChanged"},autoExpandVertically:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_autoExpandVerticallyChanged"},autoOpenDisabled:Boolean,clearButtonVisible:{type:Boolean,reflectToAttribute:!0,observer:"_clearButtonVisibleChanged",value:!1},items:{type:Array},itemClassNameGenerator:{type:Object,observer:"__itemClassNameGeneratorChanged"},itemLabelPath:{type:String,value:"label"},itemValuePath:{type:String,value:"value"},itemIdPath:{type:String},i18n:{type:Object,value:()=>({cleared:"Selection cleared",focused:"focused. Press Backspace to remove",selected:"added to selection",deselected:"removed from selection",total:"{count} items selected"})},keepFilter:{type:Boolean,value:!1},loading:{type:Boolean,value:!1,reflectToAttribute:!0},overlayClass:{type:String},readonly:{type:Boolean,value:!1,observer:"_readonlyChanged",reflectToAttribute:!0},selectedItems:{type:Array,value:()=>[],notify:!0},opened:{type:Boolean,notify:!0,value:!1,reflectToAttribute:!0},size:{type:Number},pageSize:{type:Number,value:50,observer:"_pageSizeChanged"},dataProvider:{type:Object},allowCustomValue:{type:Boolean,value:!1},placeholder:{type:String,observer:"_placeholderChanged"},renderer:Function,filter:{type:String,value:"",notify:!0},filteredItems:Array,selectedItemsOnTop:{type:Boolean,value:!1},value:{type:String},_overflowItems:{type:Array,value:()=>[]},_focusedChipIndex:{type:Number,value:-1,observer:"_focusedChipIndexChanged"},_lastFilter:{type:String},_topGroup:{type:Array}}}static get observers(){return["_selectedItemsChanged(selectedItems, selectedItems.*)","__updateOverflowChip(_overflow, _overflowItems, disabled, readonly)","__updateTopGroup(selectedItemsOnTop, selectedItems, opened)"]}get slotStyles(){return[...super.slotStyles,`\n ${this.localName}[has-value] input::placeholder {\n color: transparent !important;\n forced-color-adjust: none;\n }\n `]}get clearElement(){return this.$.clearButton}get _chips(){return[...this.querySelectorAll('[slot="chip"]')]}get _hasValue(){return this.selectedItems&&this.selectedItems.length>0}ready(){super.ready(),this.addController(new Is(this,(t=>{this._setInputElement(t),this._setFocusElement(t),this.stateTarget=t,this.ariaTarget=t}))),this.addController(new Ms(this.inputElement,this._labelController)),this._tooltipController=new gn(this),this.addController(this._tooltipController),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.inputElement),this._tooltipController.setShouldShow((t=>!t.opened)),this._inputField=this.shadowRoot.querySelector('[part="input-field"]'),this._overflowController=new vn(this,"overflow","vaadin-multi-select-combo-box-chip",{initializer:t=>{t.addEventListener("mousedown",(t=>this._preventBlur(t))),this._overflow=t}}),this.addController(this._overflowController),this.__updateChips(),nh(this)}checkValidity(){return!(this.required&&!this.readonly)||this._hasValue}clear(){this.__updateSelection([]),xs(this.i18n.cleared)}clearCache(){this.$&&this.$.comboBox&&this.$.comboBox.clearCache()}requestContentUpdate(){this.$&&this.$.comboBox&&this.$.comboBox.requestContentUpdate()}_disabledChanged(t,e){super._disabledChanged(t,e),(t||e)&&this.__updateChips()}_inputElementChanged(t){super._inputElementChanged(t),t&&this.$.comboBox._setInputElement(t)}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&(this._focusedChipIndex=-1,this.validate())}_onResize(){this.__updateChips()}_delegateAttribute(t,e){if(this.stateTarget){if("required"===t)return void this._delegateAttribute("aria-required",!!e&&"true");super._delegateAttribute(t,e)}}_autoExpandHorizontallyChanged(t,e){(t||e)&&this.__updateChips()}_autoExpandVerticallyChanged(t,e){(t||e)&&this.__updateChips()}_clearButtonVisibleChanged(t,e){(t||e)&&this.__updateChips()}_onFilteredItemsChanged(t){const{value:e}=t.detail;(Array.isArray(e)||null==e)&&(this.filteredItems=e)}_readonlyChanged(t,e){(t||e)&&this.__updateChips(),this.dataProvider&&this.clearCache()}__itemClassNameGeneratorChanged(t,e){(t||e)&&this.__updateChips()}_pageSizeChanged(t,e){(Math.floor(t)!==t||t<=0)&&(this.pageSize=e,console.error('"pageSize" value must be an integer > 0')),this.$.comboBox.pageSize=this.pageSize}_placeholderChanged(t){const e=this.__tmpA11yPlaceholder;e!==t&&(this.__savedPlaceholder=t,e&&(this.placeholder=e))}_selectedItemsChanged(t){if(this._toggleHasValue(this._hasValue),this._hasValue){const e=this._mergeItemLabels(t);void 0===this.__tmpA11yPlaceholder&&(this.__savedPlaceholder=this.placeholder),this.__tmpA11yPlaceholder=e,this.placeholder=e}else void 0!==this.__tmpA11yPlaceholder&&(delete this.__tmpA11yPlaceholder,this.placeholder=this.__savedPlaceholder);this.__updateChips(),this.requestContentUpdate(),this.opened&&this.$.comboBox.$.overlay._updateOverlayWidth()}_getItemLabel(t){return this.$.comboBox._getItemLabel(t)}_mergeItemLabels(t){return t.map((t=>this._getItemLabel(t))).join(", ")}_findIndex(t,e,i){if(i&&t){for(let o=0;o<e.length;o++)if(e[o]&&e[o][i]===t[i])return o;return-1}return e.indexOf(t)}__clearInternalValue(t=!1){!this.keepFilter||t?(this.filter="",this.$.comboBox.clear()):(this.$.comboBox.clear(),this._inputElementValue=this.filter)}__announceItem(t,e,i){const o=e?"selected":"deselected",r=this.i18n.total.replace("{count}",i||0);xs(`${t} ${this.i18n[o]} ${r}`)}__removeItem(t){const e=[...this.selectedItems];e.splice(e.indexOf(t),1),this.__updateSelection(e);const i=this._getItemLabel(t);this.__announceItem(i,!1,e.length)}__selectItem(t){const e=[...this.selectedItems],i=this._findIndex(t,e,this.itemIdPath),o=this._getItemLabel(t);let r=!1;if(-1!==i){const t=this._lastFilter;if(t&&t.toLowerCase()===o.toLowerCase())return void this.__clearInternalValue();e.splice(i,1)}else e.push(t),r=!0;this.__updateSelection(e),this.__clearInternalValue(),this.__announceItem(o,r,e.length)}__updateSelection(t){this.selectedItems=t,this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}__updateTopGroup(t,e,i){t?i||(this._topGroup=[...e]):this._topGroup=[]}__createChip(t){const e=document.createElement("vaadin-multi-select-combo-box-chip");e.setAttribute("slot","chip"),e.item=t,e.disabled=this.disabled,e.readonly=this.readonly;const i=this._getItemLabel(t);return e.label=i,e.setAttribute("title",i),"function"==typeof this.itemClassNameGenerator&&(e.className=this.itemClassNameGenerator(t)),e.addEventListener("item-removed",(t=>this._onItemRemoved(t))),e.addEventListener("mousedown",(t=>this._preventBlur(t))),e}__getOverflowWidth(){const t=this._overflow;t.style.visibility="hidden",t.removeAttribute("hidden");const e=t.getAttribute("count");t.setAttribute("count","99");const i=getComputedStyle(t),o=t.clientWidth+parseInt(i.marginInlineStart);return t.setAttribute("count",e),t.setAttribute("hidden",""),t.style.visibility="",o}__updateChips(){if(!this._inputField||!this.inputElement)return;this._chips.forEach((t=>{t.remove()}));const t=[...this.selectedItems],e=this._inputField.$.wrapper.clientWidth,i=parseInt(getComputedStyle(this.inputElement).flexBasis);let o=e-i;t.length>1&&(o-=this.__getOverflowWidth());const r=parseInt(getComputedStyle(this).getPropertyValue("--_chip-min-width"));if(this.autoExpandHorizontally){const e=[];for(let i=t.length-1,o=null;i>=0;i--){const r=this.__createChip(t[i]);this.insertBefore(r,o),o=r,e.unshift(r)}const n=[];if(!this.autoExpandVertically&&this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth<i){for(;e.length>1;){e.pop().remove(),n.unshift(t.pop());const o=n.length>0?i+this.__getOverflowWidth():i;if(this._inputField.$.wrapper.clientWidth-this.$.chips.clientWidth>=o)break}1===e.length&&(e[0].style.maxWidth=`${Math.max(r,o)}px`)}this._overflowItems=n}else{for(let e=t.length-1,i=null;e>=0;e--){const n=this.__createChip(t[e]);if(this.insertBefore(n,i),!this.autoExpandVertically&&this.$.chips.clientWidth>o){if(null!==i){n.remove();break}n.style.maxWidth=`${Math.max(r,o)}px`}t.pop(),i=n}this._overflowItems=t}}__updateOverflowChip(t,e,i,o){if(t){const r=e.length;t.label=`${r}`,t.setAttribute("count",`${r}`),t.setAttribute("title",this._mergeItemLabels(e)),t.toggleAttribute("hidden",0===r),t.disabled=i,t.readonly=o}}_onClearButtonTouchend(t){t.preventDefault(),t.stopPropagation(),this.clear()}_onClearButtonClick(t){t.stopPropagation(),this.clear()}_onChange(t){t.stopPropagation()}_onEscape(t){this.clearButtonVisible&&this.selectedItems&&this.selectedItems.length&&(t.stopPropagation(),this.selectedItems=[])}_onKeyDown(t){super._onKeyDown(t);const e=this._chips;if(!this.readonly&&e.length>0)switch(t.key){case"Backspace":this._onBackSpace(e);break;case"ArrowLeft":this._onArrowLeft(e,t);break;case"ArrowRight":this._onArrowRight(e,t);break;default:this._focusedChipIndex=-1}}_onArrowLeft(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let o;-1!==i&&e.preventDefault(),this.__isRTL?i===t.length-1?o=-1:i>-1&&(o=i+1):-1===i?o=t.length-1:i>0&&(o=i-1),void 0!==o&&(this._focusedChipIndex=o)}_onArrowRight(t,e){if(0!==this.inputElement.selectionStart)return;const i=this._focusedChipIndex;let o;-1!==i&&e.preventDefault(),this.__isRTL?-1===i?o=t.length-1:i>0&&(o=i-1):i===t.length-1?o=-1:i>-1&&(o=i+1),void 0!==o&&(this._focusedChipIndex=o)}_onBackSpace(t){if(0!==this.inputElement.selectionStart)return;const e=this._focusedChipIndex;-1===e?this._focusedChipIndex=t.length-1:(this.__removeItem(t[e].item),this._focusedChipIndex=-1)}_focusedChipIndexChanged(t,e){if(t>-1||e>-1){const e=this._chips;e.forEach(((e,i)=>{e.toggleAttribute("focused",i===t)})),t>-1&&xs(`${this._getItemLabel(e[t].item)} ${this.i18n.focused}`)}}_onComboBoxChange(){const t=this.$.comboBox.selectedItem;t&&this.__selectItem(t)}_onComboBoxItemSelected(t){this.__selectItem(t.detail.item)}_onCustomValueSet(t){t.preventDefault(),t.stopPropagation(),this.__clearInternalValue(!0),this.dispatchEvent(new CustomEvent("custom-value-set",{detail:t.detail,composed:!0,bubbles:!0}))}_onItemRemoved(t){this.__removeItem(t.detail.item)}_preventBlur(t){t.preventDefault()}}Yt(bh),fi("vaadin-notification-card",ee`
|
|
4939
4939
|
:host {
|
|
4940
4940
|
position: relative;
|
|
4941
4941
|
margin: var(--lumo-space-s);
|
|
@@ -5155,7 +5155,7 @@ const dh=new ResizeObserver((t=>{setTimeout((()=>{t.forEach((t=>{t.target.resiza
|
|
|
5155
5155
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5156
5156
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5157
5157
|
*/
|
|
5158
|
-
class
|
|
5158
|
+
class yh extends(ga(wi(ln(jr)))){static get template(){return Pr`
|
|
5159
5159
|
<style>
|
|
5160
5160
|
:host {
|
|
5161
5161
|
position: fixed;
|
|
@@ -5222,7 +5222,7 @@ class mh extends(ua(fi(on(Nr)))){static get template(){return Mr`
|
|
|
5222
5222
|
<div region="bottom-end"><slot name="bottom-end"></slot></div>
|
|
5223
5223
|
</div>
|
|
5224
5224
|
<div region="bottom-stretch"><slot name="bottom-stretch"></slot></div>
|
|
5225
|
-
`}static get is(){return"vaadin-notification-container"}static get properties(){return{opened:{type:Boolean,value:!1,observer:"_openedChanged"}}}constructor(){super(),this._boundVaadinOverlayClose=this._onVaadinOverlayClose.bind(this),
|
|
5225
|
+
`}static get is(){return"vaadin-notification-container"}static get properties(){return{opened:{type:Boolean,value:!1,observer:"_openedChanged"}}}constructor(){super(),this._boundVaadinOverlayClose=this._onVaadinOverlayClose.bind(this),ta&&(this._boundIosResizeListener=()=>this._detectIosNavbar())}_openedChanged(t){t?(document.body.appendChild(this),document.addEventListener("vaadin-overlay-close",this._boundVaadinOverlayClose),this._boundIosResizeListener&&(this._detectIosNavbar(),window.addEventListener("resize",this._boundIosResizeListener))):(document.body.removeChild(this),document.removeEventListener("vaadin-overlay-close",this._boundVaadinOverlayClose),this._boundIosResizeListener&&window.removeEventListener("resize",this._boundIosResizeListener))}_detectIosNavbar(){const t=window.innerHeight,e=window.innerWidth>t,i=document.documentElement.clientHeight;this.style.bottom=e&&i>t?i-t+"px":"0"}_onVaadinOverlayClose(t){const e=t.detail.sourceEvent;e&&e.composedPath().indexOf(this)>=0&&t.preventDefault()}}class wh extends(wi(jr)){static get template(){return Pr`
|
|
5226
5226
|
<style>
|
|
5227
5227
|
:host {
|
|
5228
5228
|
display: block;
|
|
@@ -5244,14 +5244,14 @@ class mh extends(ua(fi(on(Nr)))){static get template(){return Mr`
|
|
|
5244
5244
|
<slot></slot>
|
|
5245
5245
|
</div>
|
|
5246
5246
|
</div>
|
|
5247
|
-
`}static get is(){return"vaadin-notification-card"}ready(){super.ready(),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite")}}class
|
|
5247
|
+
`}static get is(){return"vaadin-notification-card"}ready(){super.ready(),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite")}}class xh extends(xl(si(ln(jr)))){static get template(){return Pr`
|
|
5248
5248
|
<style>
|
|
5249
5249
|
:host {
|
|
5250
5250
|
display: none !important;
|
|
5251
5251
|
}
|
|
5252
5252
|
</style>
|
|
5253
5253
|
<vaadin-notification-card theme$="[[_theme]]"> </vaadin-notification-card>
|
|
5254
|
-
`}static get is(){return"vaadin-notification"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function}}static get observers(){return["_durationChanged(duration, opened)","_rendererChanged(renderer, opened, _overlayElement)"]}static show(t,e){return
|
|
5254
|
+
`}static get is(){return"vaadin-notification"}static get properties(){return{duration:{type:Number,value:5e3},opened:{type:Boolean,value:!1,notify:!0,observer:"_openedChanged"},position:{type:String,value:"bottom-start",observer:"_positionChanged"},renderer:Function}}static get observers(){return["_durationChanged(duration, opened)","_rendererChanged(renderer, opened, _overlayElement)"]}static show(t,e){return xh._createAndShowNotification(void 0!==(null==(i=t)?void 0:i._$litType$)?e=>{ti(t,e)}:e=>{e.innerText=t},e);var i}static _createAndShowNotification(t,e){const i=document.createElement(xh.is);return e&&Number.isFinite(e.duration)&&(i.duration=e.duration),e&&e.position&&(i.position=e.position),e&&e.theme&&i.setAttribute("theme",e.theme),i.renderer=t,document.body.appendChild(i),i.opened=!0,i.addEventListener("opened-changed",(t=>{t.detail.value||i.remove()})),i}get _container(){return xh._container||(xh._container=document.createElement("vaadin-notification-container"),document.body.appendChild(xh._container)),xh._container}get _card(){return this._overlayElement}ready(){super.ready(),this._overlayElement=this.shadowRoot.querySelector("vaadin-notification-card"),nh(this)}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask((()=>{this.isConnected||(this.opened=!1)}))}requestContentUpdate(){this.renderer&&this.renderer(this._card,this)}_rendererChanged(t,e,i){if(!i)return;const o=this._oldRenderer!==t;this._oldRenderer=t,o&&(i.innerHTML="",delete i._$litPart$),e&&(this._didAnimateNotificationAppend||this._animatedAppendNotificationCard(),this.requestContentUpdate())}open(){this.opened=!0}close(){this.opened=!1}_openedChanged(t){t?(this._container.opened=!0,this._animatedAppendNotificationCard()):this._card&&this._closeNotificationCard()}__cleanUpOpeningClosingState(){this._card.removeAttribute("opening"),this._card.removeAttribute("closing"),this._card.removeEventListener("animationend",this.__animationEndListener)}_animatedAppendNotificationCard(){this._card?(this.__cleanUpOpeningClosingState(),this._card.setAttribute("opening",""),this._appendNotificationCard(),this.__animationEndListener=()=>this.__cleanUpOpeningClosingState(),this._card.addEventListener("animationend",this.__animationEndListener),this._didAnimateNotificationAppend=!0):this._didAnimateNotificationAppend=!1}_appendNotificationCard(){if(this._card){if(!this._container.shadowRoot.querySelector(`slot[name="${this.position}"]`))return void console.warn(`Invalid alignment parameter provided: position=${this.position}`);this._container.bringToFront(),this._card.slot=this.position,this._container.firstElementChild&&/top/u.test(this.position)?this._container.insertBefore(this._card,this._container.firstElementChild):this._container.appendChild(this._card)}}_removeNotificationCard(){this._card.parentNode&&this._card.parentNode.removeChild(this._card),this._card.removeAttribute("closing"),this._container.opened=!!this._container.firstElementChild,this.dispatchEvent(new CustomEvent("closed"))}_closeNotificationCard(){this._durationTimeoutId&&clearTimeout(this._durationTimeoutId),this._animatedRemoveNotificationCard()}_animatedRemoveNotificationCard(){this.__cleanUpOpeningClosingState(),this._card.setAttribute("closing","");const t=getComputedStyle(this._card).getPropertyValue("animation-name");t&&"none"!==t?(this.__animationEndListener=()=>{this._removeNotificationCard(),this.__cleanUpOpeningClosingState()},this._card.addEventListener("animationend",this.__animationEndListener)):this._removeNotificationCard()}_positionChanged(){this.opened&&this._animatedAppendNotificationCard()}_durationChanged(t,e){e&&(clearTimeout(this._durationTimeoutId),t>0&&(this._durationTimeoutId=setTimeout((()=>this.close()),t)))}}Yt(yh),Yt(wh),Yt(xh);const _h=ee`
|
|
5255
5255
|
:host {
|
|
5256
5256
|
-webkit-tap-highlight-color: transparent;
|
|
5257
5257
|
--_lumo-item-selected-icon-display: var(--_lumo-list-box-item-selected-icon-display, block);
|
|
@@ -5265,13 +5265,13 @@ class mh extends(ua(fi(on(Nr)))){static get template(){return Mr`
|
|
|
5265
5265
|
margin: var(--lumo-space-s) var(--lumo-border-radius-m);
|
|
5266
5266
|
background-color: var(--lumo-contrast-10pct);
|
|
5267
5267
|
}
|
|
5268
|
-
`;
|
|
5268
|
+
`;fi("vaadin-list-box",_h,{moduleId:"lumo-list-box"}),
|
|
5269
5269
|
/**
|
|
5270
5270
|
* @license
|
|
5271
5271
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5272
5272
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5273
5273
|
*/
|
|
5274
|
-
|
|
5274
|
+
fi("vaadin-select-item",Ol,{moduleId:"lumo-select-item"}),fi("vaadin-select-list-box",_h,{moduleId:"lumo-select-list-box"}),fi("vaadin-select",[Us,ee`
|
|
5275
5275
|
:host(:not([theme*='align'])) ::slotted([slot='value']) {
|
|
5276
5276
|
text-align: start;
|
|
5277
5277
|
}
|
|
@@ -5314,7 +5314,7 @@ ci("vaadin-select-item",zl,{moduleId:"lumo-select-item"}),ci("vaadin-select-list
|
|
|
5314
5314
|
--_lumo-selected-item-height: var(--lumo-size-s);
|
|
5315
5315
|
--_lumo-selected-item-padding: 0;
|
|
5316
5316
|
}
|
|
5317
|
-
`],{moduleId:"lumo-select"}),
|
|
5317
|
+
`],{moduleId:"lumo-select"}),fi("vaadin-select-value-button",ee`
|
|
5318
5318
|
:host {
|
|
5319
5319
|
font-family: var(--lumo-font-family);
|
|
5320
5320
|
font-size: var(--vaadin-input-field-value-font-size, var(--lumo-font-size-m));
|
|
@@ -5333,7 +5333,7 @@ ci("vaadin-select-item",zl,{moduleId:"lumo-select-item"}),ci("vaadin-select-list
|
|
|
5333
5333
|
::slotted(*:hover) {
|
|
5334
5334
|
background-color: transparent;
|
|
5335
5335
|
}
|
|
5336
|
-
`,{moduleId:"lumo-select-value-button"}),
|
|
5336
|
+
`,{moduleId:"lumo-select-value-button"}),fi("vaadin-select-overlay",[$s,ee`
|
|
5337
5337
|
:host {
|
|
5338
5338
|
--_lumo-item-selected-icon-display: block;
|
|
5339
5339
|
}
|
|
@@ -5375,12 +5375,12 @@ ci("vaadin-select-item",zl,{moduleId:"lumo-select-item"}),ci("vaadin-select-list
|
|
|
5375
5375
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5376
5376
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5377
5377
|
*/
|
|
5378
|
-
const
|
|
5378
|
+
const kh=t=>class extends(Jn(ss(t))){static get properties(){return{_hasVaadinItemMixin:{value:!0},selected:{type:Boolean,value:!1,reflectToAttribute:!0,observer:"_selectedChanged"},_value:String}}get _activeKeys(){return["Enter"," "]}get value(){return void 0!==this._value?this._value:this.textContent.trim()}set value(t){this._value=t}ready(){super.ready();const t=this.getAttribute("value");null!==t&&(this.value=t)}focus(){this.disabled||(super.focus(),this._setFocused(!0))}_shouldSetActive(t){return!(this.disabled||"keydown"===t.type&&t.defaultPrevented)}_selectedChanged(t){this.setAttribute("aria-selected",t)}_disabledChanged(t){super._disabledChanged(t),t&&(this.selected=!1,this.blur())}_onKeyDown(t){super._onKeyDown(t),this._activeKeys.includes(t.key)&&!t.defaultPrevented&&(t.preventDefault(),this.click())}}
|
|
5379
5379
|
/**
|
|
5380
5380
|
* @license
|
|
5381
5381
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5382
5382
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5383
|
-
*/;class
|
|
5383
|
+
*/;class Ch extends(kh(wi(nn(jr)))){static get is(){return"vaadin-select-item"}static get template(){return Pr`
|
|
5384
5384
|
<style>
|
|
5385
5385
|
:host {
|
|
5386
5386
|
display: inline-block;
|
|
@@ -5400,23 +5400,23 @@ const bh=t=>class extends(Hn(es(t))){static get properties(){return{_hasVaadinIt
|
|
|
5400
5400
|
* Copyright (c) 2021 - 2024 Vaadin Ltd.
|
|
5401
5401
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5402
5402
|
*/
|
|
5403
|
-
function
|
|
5403
|
+
function Sh(t,e){const{scrollLeft:i}=t;return"rtl"!==e?i:t.scrollWidth-t.clientWidth+i}Yt(Ch);
|
|
5404
5404
|
/**
|
|
5405
5405
|
* @license
|
|
5406
5406
|
* Copyright (c) 2022 - 2024 Vaadin Ltd.
|
|
5407
5407
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5408
5408
|
*/
|
|
5409
|
-
const
|
|
5409
|
+
const Th=t=>class extends(Yn(t)){get focused(){return(this._getItems()||[]).find(rs)}get _vertical(){return!0}focus(){const t=this._getItems();if(Array.isArray(t)){const e=this._getAvailableIndex(t,0,null,(t=>!is(t)));e>=0&&this._focus(e)}}_getItems(){return Array.from(this.children)}_onKeyDown(t){if(super._onKeyDown(t),t.metaKey||t.ctrlKey)return;const{key:e}=t,i=this._getItems()||[],o=i.indexOf(this.focused);let r,n;const s=this._vertical||"rtl"!==this.getAttribute("dir")?1:-1;this.__isPrevKey(e)?(n=-s,r=o-s):this.__isNextKey(e)?(n=s,r=o+s):"Home"===e?(n=1,r=0):"End"===e&&(n=-1,r=i.length-1),r=this._getAvailableIndex(i,r,n,(t=>!is(t))),r>=0&&(t.preventDefault(),this._focus(r,!0))}__isPrevKey(t){return this._vertical?"ArrowUp"===t:"ArrowLeft"===t}__isNextKey(t){return this._vertical?"ArrowDown"===t:"ArrowRight"===t}_focus(t,e=!1){const i=this._getItems();this._focusItem(i[t],e)}_focusItem(t){t&&(t.focus(),t.setAttribute("focus-ring",""))}_getAvailableIndex(t,e,i,o){const r=t.length;let n=e;for(let e=0;"number"==typeof n&&e<r;e+=1,n+=i||1){n<0?n=r-1:n>=r&&(n=0);const e=t[n];if(!e.hasAttribute("disabled")&&this.__isMatchingItem(e,o))return n}return-1}__isMatchingItem(t,e){return"function"!=typeof e||e(t)}}
|
|
5410
5410
|
/**
|
|
5411
5411
|
* @license
|
|
5412
5412
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5413
5413
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5414
|
-
*/,
|
|
5414
|
+
*/,Ah=t=>class extends(Th(t)){static get properties(){return{disabled:{type:Boolean,value:!1,reflectToAttribute:!0},selected:{type:Number,reflectToAttribute:!0,notify:!0},orientation:{type:String,reflectToAttribute:!0,value:""},items:{type:Array,readOnly:!0,notify:!0},_searchBuf:{type:String,value:""}}}static get observers(){return["_enhanceItems(items, orientation, selected, disabled)"]}get _isRTL(){return!this._vertical&&"rtl"===this.getAttribute("dir")}get _scrollerElement(){return console.warn(`Please implement the '_scrollerElement' property in <${this.localName}>`),this}get _vertical(){return"horizontal"!==this.orientation}focus(){this._observer&&this._observer.flush();const t=Array.isArray(this.items)?this.items:[],e=this._getAvailableIndex(t,0,null,(t=>0===t.tabIndex&&!is(t)));e>=0?this._focus(e):super.focus()}ready(){super.ready(),this.addEventListener("click",(t=>this._onClick(t)));const t=this.shadowRoot.querySelector("slot:not([name])");this._observer=new pn(t,(()=>{this._setItems(this._filterItems(hn(this)))}))}_getItems(){return this.items}_enhanceItems(t,e,i,o){if(!o&&t){this.setAttribute("aria-orientation",e||"vertical"),t.forEach((t=>{e?t.setAttribute("orientation",e):t.removeAttribute("orientation")})),this._setFocusable(i<0||!i?0:i);const o=t[i];t.forEach((t=>{t.selected=t===o})),o&&!o.disabled&&this._scrollToItem(i)}}_filterItems(t){return t.filter((t=>t._hasVaadinItemMixin))}_onClick(t){if(t.metaKey||t.shiftKey||t.ctrlKey||t.defaultPrevented)return;const e=this._filterItems(t.composedPath())[0];let i;e&&!e.disabled&&(i=this.items.indexOf(e))>=0&&(this.selected=i)}_searchKey(t,e){return this._searchReset=Kr.debounce(this._searchReset,qr.after(500),(()=>{this._searchBuf=""})),this._searchBuf+=e.toLowerCase(),this.items.some((t=>this.__isMatchingKey(t)))||(this._searchBuf=e.toLowerCase()),this._getAvailableIndex(this.items,1===this._searchBuf.length?t+1:t,1,(t=>this.__isMatchingKey(t)&&"none"!==getComputedStyle(t).display))}__isMatchingKey(t){return t.textContent.replace(/[^\p{L}\p{Nd}]/gu,"").toLowerCase().startsWith(this._searchBuf)}_onKeyDown(t){if(t.metaKey||t.ctrlKey)return;const e=t.key,i=this.items.indexOf(this.focused);if(/[\p{L}\p{Nd}]/u.test(e)&&1===e.length){const t=this._searchKey(i,e);t>=0&&this._focus(t)}else super._onKeyDown(t)}_isItemHidden(t){return"none"===getComputedStyle(t).display}_setFocusable(t){t=this._getAvailableIndex(this.items,t,1);const e=this.items[t];this.items.forEach((t=>{t.tabIndex=t===e?0:-1}))}_focus(t){this.items.forEach(((e,i)=>{e.focused=i===t})),this._setFocusable(t),this._scrollToItem(t),super._focus(t)}_scrollToItem(t){const e=this.items[t];if(!e)return;const i=this._vertical?["top","bottom"]:this._isRTL?["right","left"]:["left","right"],o=this._scrollerElement.getBoundingClientRect(),r=(this.items[t+1]||e).getBoundingClientRect(),n=(this.items[t-1]||e).getBoundingClientRect();let s=0;!this._isRTL&&r[i[1]]>=o[i[1]]||this._isRTL&&r[i[1]]<=o[i[1]]?s=r[i[1]]-o[i[1]]:(!this._isRTL&&n[i[0]]<=o[i[0]]||this._isRTL&&n[i[0]]>=o[i[0]])&&(s=n[i[0]]-o[i[0]]),this._scroll(s)}_scroll(t){if(this._vertical)this._scrollerElement.scrollTop+=t;else{const e=this.getAttribute("dir")||"ltr",i=Sh(this._scrollerElement,e)+t;!function(t,e,i){t.scrollLeft="rtl"!==e?i:t.clientWidth-t.scrollWidth+i}(this._scrollerElement,e,i)}}}
|
|
5415
5415
|
/**
|
|
5416
5416
|
* @license
|
|
5417
5417
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5418
5418
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5419
|
-
*/;class
|
|
5419
|
+
*/;class zh extends(Ah(wi(nn(bs(jr))))){static get is(){return"vaadin-select-list-box"}static get template(){return Pr`
|
|
5420
5420
|
<style>
|
|
5421
5421
|
:host {
|
|
5422
5422
|
display: flex;
|
|
@@ -5436,18 +5436,18 @@ const xh=t=>class extends(Vn(t)){get focused(){return(this._getItems()||[]).find
|
|
|
5436
5436
|
<div part="items">
|
|
5437
5437
|
<slot></slot>
|
|
5438
5438
|
</div>
|
|
5439
|
-
`}static get properties(){return{orientation:{readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}ready(){super.ready(),this.setAttribute("role","listbox")}}
|
|
5439
|
+
`}static get properties(){return{orientation:{readOnly:!0}}}get _scrollerElement(){return this.shadowRoot.querySelector('[part="items"]')}ready(){super.ready(),this.setAttribute("role","listbox")}}Yt(zh);
|
|
5440
5440
|
/**
|
|
5441
5441
|
* @license
|
|
5442
5442
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5443
5443
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5444
5444
|
*/
|
|
5445
|
-
const
|
|
5445
|
+
const Ih=t=>class extends(_a(ba(nn(t)))){static get observers(){return["_updateOverlayWidth(opened, owner)"]}ready(){super.ready(),this.restoreFocusOnClose=!0}_getMenuElement(){return Array.from(this.children).find((t=>"style"!==t.localName))}_updateOverlayWidth(t,e){if(t&&e){const t="--vaadin-select-overlay-width",i=getComputedStyle(e).getPropertyValue(t);""===i?this.style.removeProperty(t):this.style.setProperty(t,i)}}}
|
|
5446
5446
|
/**
|
|
5447
5447
|
* @license
|
|
5448
5448
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5449
5449
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5450
|
-
*/;
|
|
5450
|
+
*/;fi("vaadin-select-overlay",[Ws,ee`
|
|
5451
5451
|
:host {
|
|
5452
5452
|
align-items: flex-start;
|
|
5453
5453
|
justify-content: flex-start;
|
|
@@ -5462,20 +5462,20 @@ const Ch=t=>class extends(ga(pa(Qr(t)))){static get observers(){return["_updateO
|
|
|
5462
5462
|
outline: 3px solid;
|
|
5463
5463
|
}
|
|
5464
5464
|
}
|
|
5465
|
-
`],{moduleId:"vaadin-select-overlay-styles"});class
|
|
5465
|
+
`],{moduleId:"vaadin-select-overlay-styles"});class Mh extends(Ih(wi(jr))){static get is(){return"vaadin-select-overlay"}static get template(){return Pr`
|
|
5466
5466
|
<div id="backdrop" part="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
5467
5467
|
<div part="overlay" id="overlay" tabindex="0">
|
|
5468
5468
|
<div part="content" id="content">
|
|
5469
5469
|
<slot></slot>
|
|
5470
5470
|
</div>
|
|
5471
5471
|
</div>
|
|
5472
|
-
`}ready(){super.ready(),this.owner=this.__dataHost,this.owner._overlayElement=this}requestContentUpdate(){if(super.requestContentUpdate(),this.owner){const t=this._getMenuElement();this.owner._assignMenuElement(t)}}}
|
|
5472
|
+
`}ready(){super.ready(),this.owner=this.__dataHost,this.owner._overlayElement=this}requestContentUpdate(){if(super.requestContentUpdate(),this.owner){const t=this._getMenuElement();this.owner._assignMenuElement(t)}}}Yt(Mh),
|
|
5473
5473
|
/**
|
|
5474
5474
|
* @license
|
|
5475
5475
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5476
5476
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5477
5477
|
*/
|
|
5478
|
-
|
|
5478
|
+
fi("vaadin-select-value-button",ee`
|
|
5479
5479
|
:host {
|
|
5480
5480
|
display: inline-block;
|
|
5481
5481
|
position: relative;
|
|
@@ -5517,19 +5517,19 @@ ci("vaadin-select-value-button",Xt`
|
|
|
5517
5517
|
width: 100%;
|
|
5518
5518
|
line-height: inherit;
|
|
5519
5519
|
}
|
|
5520
|
-
`,{moduleId:"vaadin-select-value-button-styles"});class
|
|
5520
|
+
`,{moduleId:"vaadin-select-value-button-styles"});class Dh extends(Ta(wi(jr))){static get is(){return"vaadin-select-value-button"}static get template(){return Pr`
|
|
5521
5521
|
<div class="vaadin-button-container">
|
|
5522
5522
|
<span part="label">
|
|
5523
5523
|
<slot></slot>
|
|
5524
5524
|
</span>
|
|
5525
5525
|
</div>
|
|
5526
|
-
`}}
|
|
5526
|
+
`}}Yt(Dh);
|
|
5527
5527
|
/**
|
|
5528
5528
|
* @license
|
|
5529
5529
|
* Copyright (c) 2021 - 2024 Vaadin Ltd..
|
|
5530
5530
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5531
5531
|
*/
|
|
5532
|
-
const
|
|
5532
|
+
const Nh=ee`
|
|
5533
5533
|
.sr-only {
|
|
5534
5534
|
border: 0 !important;
|
|
5535
5535
|
clip: rect(1px, 1px, 1px, 1px) !important;
|
|
@@ -5548,17 +5548,17 @@ const Ah=Xt`
|
|
|
5548
5548
|
* @license
|
|
5549
5549
|
* Copyright (c) 2023 - 2024 Vaadin Ltd.
|
|
5550
5550
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5551
|
-
*/;class
|
|
5551
|
+
*/;class Oh extends vn{constructor(t){super(t,"value","vaadin-select-value-button",{initializer:(t,e)=>{e._setFocusElement(t),e.ariaTarget=t,e.stateTarget=t,t.setAttribute("aria-haspopup","listbox")}})}}
|
|
5552
5552
|
/**
|
|
5553
5553
|
* @license
|
|
5554
5554
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5555
5555
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5556
|
-
*/const
|
|
5556
|
+
*/const Eh=t=>class extends(xl(ls(hs(Yn(zs(t)))))){static get properties(){return{items:{type:Array,observer:"__itemsChanged"},opened:{type:Boolean,value:!1,notify:!0,reflectToAttribute:!0,sync:!0},renderer:{type:Object},value:{type:String,value:"",notify:!0,observer:"_valueChanged"},name:{type:String},placeholder:{type:String},readonly:{type:Boolean,value:!1,reflectToAttribute:!0},noVerticalOverlap:{type:Boolean,value:!1},_phone:Boolean,_phoneMediaQuery:{value:"(max-width: 450px), (max-height: 450px)"},_inputContainer:Object,_items:Object}}static get delegateAttrs(){return[...super.delegateAttrs,"invalid"]}static get observers(){return["_updateAriaExpanded(opened, focusElement)","_updateSelectedItem(value, _items, placeholder)","_openedChanged(opened, _overlayElement, _inputContainer)"]}constructor(){super(),this._itemId=`value-${this.localName}-${fn()}`,this._srLabelController=new Ss(this),this._srLabelController.slotName="sr-label"}disconnectedCallback(){super.disconnectedCallback(),this.opened=!1}ready(){super.ready(),this._inputContainer=this.shadowRoot.querySelector('[part~="input-field"]'),this._valueButtonController=new Oh(this),this.addController(this._valueButtonController),this.addController(this._srLabelController),this.addController(new cl(this._phoneMediaQuery,(t=>{this._phone=t}))),this._tooltipController=new gn(this),this._tooltipController.setPosition("top"),this._tooltipController.setAriaTarget(this.focusElement),this.addController(this._tooltipController)}requestContentUpdate(){this._overlayElement&&(this._overlayElement.requestContentUpdate(),this._menuElement&&this._menuElement.items&&this._updateSelectedItem(this.value,this._menuElement.items))}_requiredChanged(t){super._requiredChanged(t),!1===t&&this.validate()}__itemsChanged(t,e){(t||e)&&this.requestContentUpdate()}_assignMenuElement(t){t&&t!==this.__lastMenuElement&&(this._menuElement=t,this.__initMenuItems(t),t.addEventListener("items-changed",(()=>{this.__initMenuItems(t)})),t.addEventListener("selected-changed",(()=>this.__updateValueButton())),t.addEventListener("keydown",(t=>this._onKeyDownInside(t)),!0),t.addEventListener("click",(t=>{const e=t.composedPath().find((t=>t._hasVaadinItemMixin));this.__dispatchChangePending=!(!e||void 0===e.value||e.value===this.value),this.opened=!1}),!0),this.__lastMenuElement=t)}__initMenuItems(t){t.items&&(this._items=t.items)}_valueChanged(t,e){this.toggleAttribute("has-value",!!t),void 0!==e&&!this.__dispatchChangePending&&this.validate()}_onClick(t){this.disabled||(t.preventDefault(),this.opened=!this.readonly)}_onToggleMouseDown(t){t.preventDefault()}_onKeyDown(t){if(t.target===this.focusElement&&!this.readonly&&!this.disabled&&!this.opened)if(/^(Enter|SpaceBar|\s|ArrowDown|Down|ArrowUp|Up)$/u.test(t.key))t.preventDefault(),this.opened=!0;else if(/[\p{L}\p{Nd}]/u.test(t.key)&&1===t.key.length){const e=this._menuElement.selected,i=this._menuElement._searchKey(void 0!==e?e:-1,t.key);i>=0&&(this.__dispatchChangePending=!0,this._updateAriaLive(!0),this._menuElement.selected=i)}}_onKeyDownInside(t){/^(Tab)$/u.test(t.key)&&(this.opened=!1)}_openedChanged(t,e,i){if(e&&i){if(t){if(this.disabled||this.readonly)return void(this.opened=!1);this._updateAriaLive(!1),e.style.setProperty("--vaadin-select-text-field-width",`${i.offsetWidth}px`);const t=this.hasAttribute("focus-ring");this._openedWithFocusRing=t,t&&this.removeAttribute("focus-ring")}else this.__oldOpened&&(this._openedWithFocusRing&&this.setAttribute("focus-ring",""),!this.__dispatchChangePending&&!this._keyboardActive&&this.validate());this.__oldOpened=t}}_updateAriaExpanded(t,e){e&&e.setAttribute("aria-expanded",t?"true":"false")}_updateAriaLive(t){this.focusElement&&(t?this.focusElement.setAttribute("aria-live","polite"):this.focusElement.removeAttribute("aria-live"))}__attachSelectedItem(t){let e;const i=t.getAttribute("label");e=i?this.__createItemElement({label:i}):t.cloneNode(!0),e._sourceItem=t,this.__appendValueItemElement(e,this.focusElement),e.selected=!0}__createItemElement(t){const e=document.createElement(t.component||"vaadin-select-item");return t.label&&(e.textContent=t.label),t.value&&(e.value=t.value),t.disabled&&(e.disabled=t.disabled),t.className&&(e.className=t.className),e}__appendValueItemElement(t,e){e.appendChild(t),t.removeAttribute("tabindex"),t.removeAttribute("aria-selected"),t.removeAttribute("role"),t.removeAttribute("focused"),t.removeAttribute("focus-ring"),t.removeAttribute("active"),t.setAttribute("id",this._itemId)}_accessibleNameChanged(t){this._srLabelController.setLabel(t),this._setCustomAriaLabelledBy(t?this._srLabelController.defaultId:null)}_accessibleNameRefChanged(t){this._setCustomAriaLabelledBy(t)}_setCustomAriaLabelledBy(t){const e=this._getLabelIdWithItemId(t);this._fieldAriaController.setLabelId(e,!0)}_getLabelIdWithItemId(t){return t?`${t} ${this._items&&this._items[this._menuElement.selected]||this.placeholder?this._itemId:""}`.trim():null}__updateValueButton(){const t=this.focusElement;if(!t)return;t.innerHTML="";const e=this._items[this._menuElement.selected];if(t.removeAttribute("placeholder"),this._hasContent(e))this.__attachSelectedItem(e);else if(this.placeholder){const e=this.__createItemElement({label:this.placeholder});this.__appendValueItemElement(e,t),t.setAttribute("placeholder","")}!this._valueChanging&&e&&(this._selectedChanging=!0,this.value=e.value||"",this.__dispatchChangePending&&this.__dispatchChange(),delete this._selectedChanging),vs(t,"aria-labelledby",e||this.placeholder?{newId:this._itemId}:{oldId:this._itemId}),(this.accessibleName||this.accessibleNameRef)&&this._setCustomAriaLabelledBy(this.accessibleNameRef||this._srLabelController.defaultId)}_hasContent(t){return!!t&&(!!(t.hasAttribute("label")?t.getAttribute("label"):t.textContent.trim())||t.childElementCount>0)}_updateSelectedItem(t,e){if(e){const i=null==t?t:t.toString();this._menuElement.selected=e.reduce(((t,e,o)=>void 0===t&&e.value===i?o:t),void 0),this._selectedChanging||(this._valueChanging=!0,this.__updateValueButton(),delete this._valueChanging)}}_shouldRemoveFocus(){return!this.opened}_setFocused(t){super._setFocused(t),!t&&document.hasFocus()&&this.validate()}checkValidity(){return!this.required||this.readonly||!!this.value}__defaultRenderer(t,e){if(!this.items||0===this.items.length)return void(t.textContent="");let i=t.firstElementChild;i||(i=document.createElement("vaadin-select-list-box"),t.appendChild(i)),i.textContent="",this.items.forEach((t=>{i.appendChild(this.__createItemElement(t))}))}__dispatchChange(){return Gt(this,null,(function*(){this.updateComplete&&(yield this.updateComplete),this.validate(),this.dispatchEvent(new CustomEvent("change",{bubbles:!0})),this.__dispatchChangePending=!1}))}}
|
|
5557
5557
|
/**
|
|
5558
5558
|
* @license
|
|
5559
5559
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5560
5560
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5561
|
-
*/;
|
|
5561
|
+
*/;fi("vaadin-select",[bl,yl,Nh],{moduleId:"vaadin-select-styles"});class Ph extends(Eh(ln(wi(jr)))){static get is(){return"vaadin-select"}static get template(){return Pr`
|
|
5562
5562
|
<style>
|
|
5563
5563
|
:host {
|
|
5564
5564
|
position: relative;
|
|
@@ -5611,7 +5611,7 @@ const Ah=Xt`
|
|
|
5611
5611
|
<div class="sr-only">
|
|
5612
5612
|
<slot name="sr-label"></slot>
|
|
5613
5613
|
</div>
|
|
5614
|
-
`}static get observers(){return["_rendererChanged(renderer, _overlayElement)"]}ready(){super.ready(),
|
|
5614
|
+
`}static get observers(){return["_rendererChanged(renderer, _overlayElement)"]}ready(){super.ready(),nh(this)}_rendererChanged(t,e){e&&(e.renderer=t||this.__defaultRenderer,this.requestContentUpdate())}_onOverlayOpen(){this._menuElement&&this._menuElement.focus()}}Yt(Ph);const Bh=ee`
|
|
5615
5615
|
/* Optical centering */
|
|
5616
5616
|
:host::before,
|
|
5617
5617
|
:host::after {
|
|
@@ -5711,7 +5711,7 @@ const Ah=Xt`
|
|
|
5711
5711
|
transform: scale(1.02);
|
|
5712
5712
|
}
|
|
5713
5713
|
}
|
|
5714
|
-
`;
|
|
5714
|
+
`;fi("vaadin-dialog-overlay",[js,Bh],{moduleId:"lumo-dialog"}),fi("vaadin-confirm-dialog-overlay",[js,Bh,ee`
|
|
5715
5715
|
[part='header'] ::slotted(h3) {
|
|
5716
5716
|
margin-top: 0 !important;
|
|
5717
5717
|
margin-bottom: 0 !important;
|
|
@@ -5752,12 +5752,12 @@ const Ah=Xt`
|
|
|
5752
5752
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5753
5753
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5754
5754
|
*/
|
|
5755
|
-
const
|
|
5755
|
+
const jh=t=>class extends t{static get properties(){return{opened:{type:Boolean,value:!1,notify:!0},noCloseOnOutsideClick:{type:Boolean,value:!1},noCloseOnEsc:{type:Boolean,value:!1},modeless:{type:Boolean,value:!1},overlayRole:{type:String,value:"dialog"}}}ready(){super.ready();const t=this.$.overlay;t.addEventListener("vaadin-overlay-outside-click",this._handleOutsideClick.bind(this)),t.addEventListener("vaadin-overlay-escape-press",this._handleEscPress.bind(this)),t.addEventListener("vaadin-overlay-closed",this.__handleOverlayClosed.bind(this)),this._overlayElement=t}__handleOverlayClosed(){this.dispatchEvent(new CustomEvent("closed"))}connectedCallback(){super.connectedCallback(),this.__restoreOpened&&(this.opened=!0)}disconnectedCallback(){super.disconnectedCallback(),setTimeout((()=>{this.isConnected||(this.__restoreOpened=this.opened,this.opened=!1)}))}_onOverlayOpened(t){!1===t.detail.value&&(this.opened=!1)}_handleOutsideClick(t){this.noCloseOnOutsideClick&&t.preventDefault()}_handleEscPress(t){this.noCloseOnEsc&&t.preventDefault()}_bringOverlayToFront(){this.modeless&&this._overlayElement.bringToFront()}}
|
|
5756
5756
|
/**
|
|
5757
5757
|
* @license
|
|
5758
5758
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
5759
5759
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5760
|
-
*/,
|
|
5760
|
+
*/,Lh=ee`
|
|
5761
5761
|
[part='header'],
|
|
5762
5762
|
[part='header-content'],
|
|
5763
5763
|
[part='footer'] {
|
|
@@ -5835,7 +5835,7 @@ const Nh=t=>class extends t{static get properties(){return{opened:{type:Boolean,
|
|
|
5835
5835
|
outline: 3px solid !important;
|
|
5836
5836
|
}
|
|
5837
5837
|
}
|
|
5838
|
-
`;
|
|
5838
|
+
`;ee`
|
|
5839
5839
|
[part='overlay'] {
|
|
5840
5840
|
position: relative;
|
|
5841
5841
|
overflow: visible;
|
|
@@ -5933,7 +5933,7 @@ const Nh=t=>class extends t{static get properties(){return{opened:{type:Boolean,
|
|
|
5933
5933
|
* @license
|
|
5934
5934
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
5935
5935
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5936
|
-
*/;const
|
|
5936
|
+
*/;const $h=t=>class extends t{static get properties(){return{ariaLabel:{type:String,value:""},contentHeight:{type:String},contentWidth:{type:String}}}static get observers(){return["__updateContentHeight(contentHeight, _overlayElement)","__updateContentWidth(contentWidth, _overlayElement)"]}__updateDimension(t,e,i){const o=`--_vaadin-confirm-dialog-content-${e}`;i?t.style.setProperty(o,i):t.style.removeProperty(o)}__updateContentHeight(t,e){e&&this.__updateDimension(e,"height",t)}__updateContentWidth(t,e){e&&this.__updateDimension(e,"width",t)}}
|
|
5937
5937
|
/**
|
|
5938
5938
|
* @license
|
|
5939
5939
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
@@ -5944,7 +5944,7 @@ const Nh=t=>class extends t{static get properties(){return{opened:{type:Boolean,
|
|
|
5944
5944
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
5945
5945
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5946
5946
|
*/
|
|
5947
|
-
|
|
5947
|
+
fi("vaadin-confirm-dialog-overlay",[Ws,Lh,ee`
|
|
5948
5948
|
:host {
|
|
5949
5949
|
--_vaadin-confirm-dialog-content-width: auto;
|
|
5950
5950
|
--_vaadin-confirm-dialog-content-height: auto;
|
|
@@ -5963,7 +5963,7 @@ ci("vaadin-confirm-dialog-overlay",[Fs,Oh,Xt`
|
|
|
5963
5963
|
[part='footer'] > * {
|
|
5964
5964
|
pointer-events: all;
|
|
5965
5965
|
}
|
|
5966
|
-
`],{moduleId:"vaadin-confirm-dialog-overlay-styles"});class
|
|
5966
|
+
`],{moduleId:"vaadin-confirm-dialog-overlay-styles"});class Fh extends(ba(nn(wi(jr)))){static get is(){return"vaadin-confirm-dialog-overlay"}static get template(){return Pr`
|
|
5967
5967
|
<div part="backdrop" id="backdrop" hidden$="[[!withBackdrop]]"></div>
|
|
5968
5968
|
<div part="overlay" id="overlay" tabindex="0">
|
|
5969
5969
|
<section id="resizerContainer" class="resizer-container">
|
|
@@ -5984,7 +5984,7 @@ ci("vaadin-confirm-dialog-overlay",[Fs,Oh,Xt`
|
|
|
5984
5984
|
</footer>
|
|
5985
5985
|
</section>
|
|
5986
5986
|
</div>
|
|
5987
|
-
`}ready(){super.ready(),this.setAttribute("has-header",""),this.setAttribute("has-footer","")}}
|
|
5987
|
+
`}ready(){super.ready(),this.setAttribute("has-header",""),this.setAttribute("has-footer","")}}Yt(Fh);class Rh extends($h(jh(xl(si(jr))))){static get is(){return"vaadin-confirm-dialog-dialog"}static get template(){return Pr`
|
|
5988
5988
|
<style>
|
|
5989
5989
|
:host {
|
|
5990
5990
|
display: none;
|
|
@@ -6005,18 +6005,18 @@ ci("vaadin-confirm-dialog-overlay",[Fs,Oh,Xt`
|
|
|
6005
6005
|
restore-focus-on-close
|
|
6006
6006
|
focus-trap
|
|
6007
6007
|
></vaadin-confirm-dialog-overlay>
|
|
6008
|
-
`}}
|
|
6008
|
+
`}}Yt(Rh);
|
|
6009
6009
|
/**
|
|
6010
6010
|
* @license
|
|
6011
6011
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
6012
6012
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6013
6013
|
*/
|
|
6014
|
-
const
|
|
6014
|
+
const Uh=t=>class extends t{static get properties(){return{accessibleDescriptionRef:{type:String},opened:{type:Boolean,value:!1,notify:!0},header:{type:String,value:""},message:{type:String,value:""},confirmText:{type:String,value:"Confirm"},confirmTheme:{type:String,value:"primary"},noCloseOnEsc:{type:Boolean,value:!1},rejectButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1},rejectText:{type:String,value:"Reject"},rejectTheme:{type:String,value:"error tertiary"},cancelButtonVisible:{type:Boolean,reflectToAttribute:!0,value:!1},cancelText:{type:String,value:"Cancel"},cancelTheme:{type:String,value:"tertiary"},overlayClass:{type:String},_cancelButton:{type:Object},_confirmButton:{type:Object},_headerNode:{type:Object},_messageNodes:{type:Array,value:()=>[]},_overlayElement:{type:Object,sync:!0},_rejectButton:{type:Object},_contentHeight:{type:String},_contentWidth:{type:String}}}static get observers(){return["__updateConfirmButton(_confirmButton, confirmText, confirmTheme)","__updateCancelButton(_cancelButton, cancelText, cancelTheme, cancelButtonVisible)","__updateHeaderNode(_headerNode, header)","__updateMessageNodes(_messageNodes, message)","__updateRejectButton(_rejectButton, rejectText, rejectTheme, rejectButtonVisible)","__accessibleDescriptionRefChanged(_overlayElement, _messageNodes, accessibleDescriptionRef)"]}constructor(){super(),this.__cancel=this.__cancel.bind(this),this.__confirm=this.__confirm.bind(this),this.__reject=this.__reject.bind(this)}get __slottedNodes(){return[this._headerNode,...this._messageNodes,this._cancelButton,this._confirmButton,this._rejectButton]}ready(){super.ready(),this._headerController=new vn(this,"header","h3",{initializer:t=>{this._headerNode=t}}),this.addController(this._headerController),this._messageController=new vn(this,"","div",{multiple:!0,observe:!1,initializer:t=>{const e=document.createElement("div");e.style.display="contents";const i=`confirm-dialog-message-${fn()}`;e.id=i,this.appendChild(e),e.appendChild(t),this._messageNodes=[...this._messageNodes,e]}}),this.addController(this._messageController),this._cancelController=new vn(this,"cancel-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("cancel",t)}}),this.addController(this._cancelController),this._rejectController=new vn(this,"reject-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("reject",t)}}),this.addController(this._rejectController),this._confirmController=new vn(this,"confirm-button","vaadin-button",{initializer:t=>{this.__setupSlottedButton("confirm",t)}}),this.addController(this._confirmController)}_initOverlay(t){t.addEventListener("vaadin-overlay-escape-press",this._escPressed.bind(this)),t.addEventListener("vaadin-overlay-open",(()=>this.__onDialogOpened())),t.addEventListener("vaadin-overlay-closed",(()=>this.__onDialogClosed())),t.setAttribute("role","alertdialog")}__onDialogOpened(){const t=this._overlayElement;this.__slottedNodes.forEach((e=>{t.appendChild(e)}));const e=t.querySelector('[slot="confirm-button"]');e&&e.focus()}__onDialogClosed(){this.__slottedNodes.forEach((t=>{this.appendChild(t)})),this.dispatchEvent(new CustomEvent("closed"))}__accessibleDescriptionRefChanged(t,e,i){!t||!e||(void 0!==i?vs(t,"aria-describedby",{newId:i,oldId:this.__oldAccessibleDescriptionRef,fromUser:!0}):e.forEach((e=>{vs(t,"aria-describedby",{newId:e.id})})),this.__oldAccessibleDescriptionRef=i)}__setupSlottedButton(t,e){const i=`_${t}Button`,o=`__${t}`;this[i]&&this[i]!==e&&this[i].remove(),e.addEventListener("click",this[o]),this[i]=e}__updateCancelButton(t,e,i,o){t&&(t===this._cancelController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i)),t.toggleAttribute("hidden",!o))}__updateConfirmButton(t,e,i){t&&t===this._confirmController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i))}__updateHeaderNode(t,e){t&&t===this._headerController.defaultNode&&(t.textContent=e)}__updateMessageNodes(t,e){if(t&&t.length>0){const i=t.find((t=>this._messageController.defaultNode&&t===this._messageController.defaultNode.parentElement));i&&(i.firstChild.textContent=e)}}__updateRejectButton(t,e,i,o){t&&(t===this._rejectController.defaultNode&&(t.textContent=e,t.setAttribute("theme",i)),t.toggleAttribute("hidden",!o))}_escPressed(t){t.defaultPrevented||this.__cancel()}__confirm(){this.dispatchEvent(new CustomEvent("confirm")),this.opened=!1}__cancel(){this.dispatchEvent(new CustomEvent("cancel")),this.opened=!1}__reject(){this.dispatchEvent(new CustomEvent("reject")),this.opened=!1}_getAriaLabel(t){return t||"confirmation"}}
|
|
6015
6015
|
/**
|
|
6016
6016
|
* @license
|
|
6017
6017
|
* Copyright (c) 2018 - 2024 Vaadin Ltd.
|
|
6018
6018
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6019
|
-
*/;class
|
|
6019
|
+
*/;class Vh extends(Uh(ln(si(bs(jr))))){static get template(){return Pr`
|
|
6020
6020
|
<style>
|
|
6021
6021
|
:host,
|
|
6022
6022
|
[hidden] {
|
|
@@ -6043,7 +6043,7 @@ const jh=t=>class extends t{static get properties(){return{accessibleDescription
|
|
|
6043
6043
|
<slot name="reject-button"></slot>
|
|
6044
6044
|
<slot name="confirm-button"></slot>
|
|
6045
6045
|
</div>
|
|
6046
|
-
`}static get is(){return"vaadin-confirm-dialog"}ready(){super.ready(),this._overlayElement=this.$.dialog.$.overlay,this._initOverlay(this._overlayElement)}}
|
|
6046
|
+
`}static get is(){return"vaadin-confirm-dialog"}ready(){super.ready(),this._overlayElement=this.$.dialog.$.overlay,this._initOverlay(this._overlayElement)}}Yt(Vh),fi("vaadin-tab",ee`
|
|
6047
6047
|
:host {
|
|
6048
6048
|
box-sizing: border-box;
|
|
6049
6049
|
padding: 0.5rem 0.75rem;
|
|
@@ -6282,7 +6282,7 @@ const jh=t=>class extends t{static get properties(){return{accessibleDescription
|
|
|
6282
6282
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
6283
6283
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6284
6284
|
*/
|
|
6285
|
-
const
|
|
6285
|
+
const Hh=t=>class extends(kh(t)){ready(){super.ready(),this.setAttribute("role","tab")}_onKeyUp(t){const e=this.hasAttribute("active");if(super._onKeyUp(t),e){const t=this.querySelector("a");t&&t.click()}}}
|
|
6286
6286
|
/**
|
|
6287
6287
|
* @license
|
|
6288
6288
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -6293,7 +6293,7 @@ const $h=t=>class extends(bh(t)){ready(){super.ready(),this.setAttribute("role",
|
|
|
6293
6293
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
6294
6294
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6295
6295
|
*/
|
|
6296
|
-
|
|
6296
|
+
fi("vaadin-tab",ee`
|
|
6297
6297
|
:host {
|
|
6298
6298
|
display: block;
|
|
6299
6299
|
}
|
|
@@ -6312,10 +6312,10 @@ ci("vaadin-tab",Xt`
|
|
|
6312
6312
|
border-bottom: 2px solid;
|
|
6313
6313
|
}
|
|
6314
6314
|
}
|
|
6315
|
-
`,{moduleId:"vaadin-tab-styles"});class
|
|
6315
|
+
`,{moduleId:"vaadin-tab-styles"});class Wh extends(ln(wi(Hh(bs(jr))))){static get template(){return Pr`
|
|
6316
6316
|
<slot></slot>
|
|
6317
6317
|
<slot name="tooltip"></slot>
|
|
6318
|
-
`}static get is(){return"vaadin-tab"}ready(){super.ready(),this._tooltipController=new
|
|
6318
|
+
`}static get is(){return"vaadin-tab"}ready(){super.ready(),this._tooltipController=new gn(this),this.addController(this._tooltipController)}}Yt(Wh),fi("vaadin-tabs",ee`
|
|
6319
6319
|
:host {
|
|
6320
6320
|
-webkit-tap-highlight-color: transparent;
|
|
6321
6321
|
}
|
|
@@ -6559,7 +6559,7 @@ ci("vaadin-tab",Xt`
|
|
|
6559
6559
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
6560
6560
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6561
6561
|
*/
|
|
6562
|
-
const
|
|
6562
|
+
const qh=t=>class extends(gh(Ah(t))){static get properties(){return{orientation:{value:"horizontal",type:String,reflectToAttribute:!0,sync:!0},selected:{value:0,type:Number}}}static get observers(){return["__tabsItemsChanged(items)"]}constructor(){super(),this.__itemsResizeObserver=new ResizeObserver((()=>{setTimeout((()=>this._updateOverflow()))}))}get _scrollOffset(){return this._vertical?this._scrollerElement.offsetHeight:this._scrollerElement.offsetWidth}get _scrollerElement(){return this.$.scroll}get __direction(){return!this._vertical&&this.__isRTL?1:-1}ready(){super.ready(),this._scrollerElement.addEventListener("scroll",(()=>this._updateOverflow())),this.setAttribute("role","tablist"),Xs(this,(()=>{this._updateOverflow()}))}_onResize(){this._updateOverflow()}__tabsItemsChanged(t){this.__itemsResizeObserver.disconnect(),(t||[]).forEach((t=>{this.__itemsResizeObserver.observe(t)})),this._updateOverflow()}_scrollForward(){const t=this._getNavigationButtonVisibleWidth("forward-button"),e=this._getNavigationButtonVisibleWidth("back-button"),i=this._scrollerElement.getBoundingClientRect(),o=[...this.items].reverse().find((o=>this._isItemVisible(o,t,e,i))).getBoundingClientRect(),r=20+this.shadowRoot.querySelector('[part="back-button"]').clientWidth;let n;n=this.__isRTL?o.right-(i.right-r):o.left-(i.left+r),-this.__direction*n<1&&(n=-this.__direction*(this._scrollOffset-r)),this._scroll(n)}_scrollBack(){const t=this._getNavigationButtonVisibleWidth("forward-button"),e=this._getNavigationButtonVisibleWidth("back-button"),i=this._scrollerElement.getBoundingClientRect(),o=this.items.find((o=>this._isItemVisible(o,t,e,i))).getBoundingClientRect(),r=20+this.shadowRoot.querySelector('[part="forward-button"]').clientWidth;let n;n=this.__isRTL?o.left-(i.left+r):o.right-(i.right-r),this.__direction*n<1&&(n=this.__direction*(this._scrollOffset-r)),this._scroll(n)}_isItemVisible(t,e,i,o){if(this._vertical)throw new Error("Visibility check is only supported for horizontal tabs.");const r=o.right-(this.__isRTL?i:e),n=o.left+(this.__isRTL?e:i),s=t.getBoundingClientRect();return r>Math.floor(s.left)&&n<Math.ceil(s.right)}_getNavigationButtonVisibleWidth(t){const e=this.shadowRoot.querySelector(`[part="${t}"]`);return"0"===window.getComputedStyle(e).opacity?0:e.clientWidth}_updateOverflow(){const t=this._vertical?this._scrollerElement.scrollTop:Sh(this._scrollerElement,this.getAttribute("dir")),e=this._vertical?this._scrollerElement.scrollHeight:this._scrollerElement.scrollWidth;let i=Math.floor(t)>1?"start":"";Math.ceil(t)<Math.ceil(e-this._scrollOffset)&&(i+=" end"),1===this.__direction&&(i=i.replace(/start|end/giu,(t=>"start"===t?"end":"start"))),i?this.setAttribute("overflow",i.trim()):this.removeAttribute("overflow")}}
|
|
6563
6563
|
/**
|
|
6564
6564
|
* @license
|
|
6565
6565
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
@@ -6570,7 +6570,7 @@ const Rh=t=>class extends(uh(_h(t))){static get properties(){return{orientation:
|
|
|
6570
6570
|
* Copyright (c) 2017 - 2024 Vaadin Ltd.
|
|
6571
6571
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
6572
6572
|
*/
|
|
6573
|
-
|
|
6573
|
+
fi("vaadin-tabs",ee`
|
|
6574
6574
|
:host {
|
|
6575
6575
|
display: flex;
|
|
6576
6576
|
align-items: center;
|
|
@@ -6646,7 +6646,7 @@ ci("vaadin-tabs",Xt`
|
|
|
6646
6646
|
:host([dir='rtl']) [part='forward-button']::after {
|
|
6647
6647
|
content: '\\25C0';
|
|
6648
6648
|
}
|
|
6649
|
-
`,{moduleId:"vaadin-tabs-styles"});class
|
|
6649
|
+
`,{moduleId:"vaadin-tabs-styles"});class Gh extends(qh(ln(wi(jr)))){static get template(){return Pr`
|
|
6650
6650
|
<div on-click="_scrollBack" part="back-button" aria-hidden="true"></div>
|
|
6651
6651
|
|
|
6652
6652
|
<div id="scroll" part="tabs">
|
|
@@ -6654,7 +6654,7 @@ ci("vaadin-tabs",Xt`
|
|
|
6654
6654
|
</div>
|
|
6655
6655
|
|
|
6656
6656
|
<div on-click="_scrollForward" part="forward-button" aria-hidden="true"></div>
|
|
6657
|
-
`}static get is(){return"vaadin-tabs"}}Vt(Uh);const Vh=["ro","en","fr","ar","hr"],Hh={en:{totalItems:"Total {total} items",perPage:"{size} / page",goTo:"Go to",filter:"Filter",clear:"Clear",searchByTicketId:"Search by Ticket ID",enterTicketId:"Enter Ticket ID",searchByTicketType:"Search by Ticket Type",selectTicketType:"Select Ticket Type",searchByDate:"Search by Date",from:"From",to:"To",normal:"Normal",subscription:"Subscription",ticketsHistory:"Tickets History",settled:"Settled",purchased:"Purchased",canceled:"Canceled",noData:"No data Avaliable.",ticketId:"Ticket ID:",ticketType:"Ticket Type:",ticketAmount:"Ticket Amount:",lineDetail:"Line Detail:",seeDetails:"See Details",numberOfDraw:"Number of Draw:",ticketResult:"Ticket Result:",drawId:"Draw ID:",drawDate:"Draw Date:",result:"Result:",prize:"Prize:",bettingType:"Betting Type:"},ro:{},fr:{},ar:{},hr:{}},Wh=(t,e,i)=>{const o=e;let r=Hh[void 0!==o&&Vh.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r},qh=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])Hh[e][i]=t[e][i]}))},Gh=class{constructor(i){t(this,i),this.filterChange=e(this,"filterChange",7),this.filterClear=e(this,"filterClear",7),this.handleTicketType=t=>{t.detail&&t.detail.length&&(this.filterData.ticketType=t.detail)},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterFromCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterToCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.quickFiltersActive=!1,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl=void 0,this.isOpen=!1,this.filterData={filterFromCalendar:"",filterToCalendar:"",ticketId:"",ticketType:[]},this.ticketTypeList=void 0,this.showClearButton=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&qh(JSON.parse(this.translationUrl)),this.ticketTypeList=[{label:Wh("normal",this.language),value:"NORMAL"},{label:Wh("subscription",this.language),value:"SUBSCRIPTION"}]}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleModalClose(){this.isOpen=!1}changeFormate(t){const[e,i,o]=t.split("/");return`${o}-${i}-${e}`}formateDate(t){const{year:e,month:i,day:o}=t;return ht(new Date(e,i,o),"dd/MM/yyyy")}parseDate(t){const[e,i,o]=t.split("/");return{year:o,month:parseInt(i)-1,day:e}}setDateFormate(t){t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate})}clearSelection(){this.comboBox.clear()}resetSearch(){this.showClearButton=!1,this.clearSelection(),this.filterData={filterFromCalendar:"",filterToCalendar:"",ticketId:"",ticketType:[]},this.filterClear.emit()}handleDialogConfirm(){if(this.filterData.filterFromCalendar&&this.filterData.filterToCalendar){let t=this.filterData.filterFromCalendar.split("/"),e=this.filterData.filterToCalendar.split("/");const i={filterFromCalendar:new Date(Date.UTC(Number(t[2]),Number(t[1])-1,Number(t[0]),0,0,0)).toISOString(),filterToCalendar:new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),23,59,59)).toISOString()};this.filterData=Object.assign(Object.assign({},this.filterData),i)}this.filterChange.emit(this.filterData),this.isOpen=!1,this.showClearButton=!0}render(){return o("div",{key:"74aa590f6f92b9df971fd17cb3f573cc6a0a68e9",class:"lottery-tipping-filter",ref:t=>this.stylingContainer=t},o("div",{key:"ebf385371627466c5eb06a5ef75a14a467b1badd",class:"operate-btns"},!this.showClearButton&&o("div",{key:"55c709034e124b51e8b9057980f5a3c3b8c6d5ce",class:"operate-btn",onClick:()=>{this.isOpen=!0}},Wh("filter",this.language)),(this.showClearButton||this.quickFiltersActive)&&o("div",{key:"aa747af2461e72fbacc16decd7fc75cd6f640c47",class:"operate-btn",onClick:()=>this.resetSearch()},Wh("clear",this.language))),o("lottery-tipping-dialog",{key:"9a9472dee498db7acc83fd96db89b635be07a837","dialog-title":Wh("ticketResult",this.language),visible:this.isOpen,onCancel:()=>{this.isOpen=!1},onConfirm:this.handleDialogConfirm.bind(this),animationDuration:300,language:this.language,"translation-url":this.translationUrl},o("div",{key:"a7bfe435c8f7a43abf2c2d500d7e31fe62123787",class:"dialog-content"},o("div",{key:"4fcf5f1d3da61ba5e3e8c09b4a97339c1eafaf64",class:"filter-item"},o("div",{key:"397bb60af15071331c46c0b83366475ef66205fd",class:"filter-item-label"},Wh("searchByTicketId",this.language)),o("div",{key:"657e0014bb0d8af52ed273149bad534b2cd035b6",class:"filter-item-val"},o("div",{key:"7e49aab4b087a1e077cc03d4331df52be03a79c2",class:"general-multi-select-container"},o("vaadin-text-field",{key:"9d810aac3959e689cefed434d7c5569b18e4c0ec",placeholder:Wh("enterTicketId",this.language),value:this.filterData.ticketId,onInput:t=>{this.filterData.ticketId=t.target.value}})))),o("div",{key:"8b9fda151a493c920797e4c7e2a8693c84ea5620",class:"filter-item"},o("div",{key:"23439a0cad69db2ddafc8c131d5e1f5a019c3805",class:"filter-item-label"},Wh("searchByTicketType",this.language)),o("div",{key:"ffe8de6c8acb7ecb92301d417e5d3cddb9941601",class:"general-multi-select-container"},o("general-multi-select",{key:"90b2b967b17830a22ea08aa0f22e155e42922f21",ref:t=>this.comboBox=t,placeholder:Wh("selectTicketType",this.language),"max-visible-chips":"2",options:this.ticketTypeList.map((t=>({text:t.label,value:t.value}))),onChange:this.handleTicketType,"client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,"mb-source":this.mbSource}))),o("div",{key:"b8dc91b5337a8f4064160c50c20f213fbb1649bd",class:"filter-item"},o("div",{key:"476fb4074ad41ce1a014eb9355504aa4a53161ca",class:"filter-item-label"},Wh("searchByDate",this.language)),o("div",{key:"d4498509f769af6cd5d008dc8433a61b9c9c5487",class:"filter-item-val"},o("vaadin-date-picker",{key:"bd525309eb193cd2e12fc87aee172d423397d22e",value:this.filterData.filterFromCalendar,max:void 0===this.filterData.filterToCalendar?void 0:this.changeFormate(this.filterData.filterToCalendar),onChange:this.handleFilterFrom,placeholder:Wh("from",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}),o("vaadin-date-picker",{key:"50eb713df259a2d0fce36b90d81d1ea388c8545d",value:this.filterData.filterToCalendar,min:void 0===this.filterData.filterFromCalendar?void 0:this.changeFormate(this.filterData.filterFromCalendar),onChange:this.handleFilterTo,placeholder:Wh("to",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};function Yh(t,e="GET",i=null,o={}){return new Promise(((r,n)=>{const s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a=Object.assign({"Content-Type":"application/json"},o);"GET"!==e&&"HEAD"!==e&&(a["X-Idempotency-Key"]=s);const l={method:e,headers:a,body:null};i&&"GET"!==e&&"HEAD"!==e?l.body=JSON.stringify(i):delete l.body,fetch(t,l).then((t=>t.ok?t.json():n(t))).then((t=>r(t))).catch((t=>n(t)))}))}function Jh(t,e){return null==t||""===t||(0!==t||!e)&&(Array.isArray(t)?function(t){if(0===t.length)return!0;const e=t.length;let i=0;for(let o=0;o<e;o++){if(!Jh(t[o]))return!1;i++}return i===e}(t):"[object Object]"===Object.prototype.toString.call(t)?function(t){if(0===Object.keys(t).length)return!0;const e=Object.keys(t).length;let i=0;for(const e of Object.values(t)){if(!Jh(e))return!1;i++}return i===e}(t):!t)}Gh.style=".lottery-tipping-filter .operate-btns{display:flex;gap:10px}.lottery-tipping-filter .operate-btns .operate-btn{background:var(--emw--color-primary, #fed275);border:1px solid var(--emw--color-primary, #fed275);border-radius:16px;padding:8px 10px;font-size:14px;color:var(--emw--color-typography, #000);font-weight:600;cursor:pointer;transition:0.2s linear}.dialog-content{display:flex;flex-direction:column;align-items:center}.dialog-content .filter-item{margin-bottom:12px}.dialog-content .filter-item-label{text-align:center;color:var(--emw--color-typography, #000)}.dialog-content .filter-item-val{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}@media screen and (max-width: 480px){.lottery-tipping-filter .operate-btns{gap:4px}}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}";const Xh={0:"1",1:"X",2:"2"};function Kh(t){const e=[],i=[];for(let e=0;e<t.length;e+=2){const[o,r]=[t[e],t[e+1]];i[r]?i[r].push(o):i[r]=[o]}return i.forEach((t=>{e.push(function(t){const e=[];return Object.keys(Xh).forEach((i=>{e.push({isSelected:t.includes(Number(i)),value:Xh[i]})})),e}(t))})),e}const Zh=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),Qh=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},tc=class{constructor(i){t(this,i),this.pageChange=e(this,"pageChange",7),this.pageSizeChange=e(this,"pageSizeChange",7),this.userAgent=window.navigator.userAgent,this.total=0,this.pageSizeOptions=[10,20,50],this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl=void 0,this.current=1,this.pageSize=10,this.totalPages=1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&qh(JSON.parse(this.translationUrl)),this.pageSize=this.pageSizeOptions[0],this.updateTotalPages()}updateTotalPages(){this.totalPages=Math.max(Math.ceil(this.total/this.pageSize),1),this.current>this.totalPages&&(this.current=this.totalPages,this.pageChange.emit(this.current))}goToPage(t){t<1||t>this.totalPages||t===this.current||(this.current=t,this.pageChange.emit(t))}changePageSize(t){this.pageSize=t,this.pageSizeChange.emit(t),this.updateTotalPages(),this.goToPage(1)}getPagesToShow(){const t=[],e=Zh(this.userAgent)?1:2,{totalPages:i,current:o}=this;if(i<=7)for(let e=1;e<=i;e++)t.push({type:"page",value:e});else{t.push({type:"page",value:1}),o>e+2&&t.push({type:"jump",direction:"prev"});const r=Math.max(2,o-e),n=Math.min(i-1,o+e);for(let e=r;e<=n;e++)t.push({type:"page",value:e});o<i-e-1&&t.push({type:"jump",direction:"next"}),t.push({type:"page",value:i})}return t}jumpTo(t){this.goToPage("prev"===t?Math.max(1,this.current-5):Math.min(this.totalPages,this.current+5))}render(){const t=this.getPagesToShow();return o("div",{key:"daa1bf4cd3031ae3f908bd2638424cbf82b81021",class:"paginator",ref:t=>this.stylingContainer=t},o("div",{key:"93841d6094df6f52b24e277b66d92158aabd2955",class:"total-num"},Wh("totalItems",this.language,{total:this.total})),o("button",{key:"205e1dcc5e5c1b18f2dbbb61e127d13e4adaa79f",class:"arrow-btn",disabled:this.current<=1,onClick:()=>this.goToPage(this.current-1)},"<"),t.map((t=>"page"===t.type?o("button",{class:{page:!0,active:this.current===t.value},onClick:()=>this.goToPage(t.value)},t.value):o("button",{class:"ellipsis",onClick:()=>this.jumpTo(t.direction)},"..."))),o("button",{key:"3213a6519702b4215e66afadf8dc6e44839455e7",class:"arrow-btn",disabled:this.current>=this.totalPages,onClick:()=>this.goToPage(this.current+1)},">"),o("select",{key:"da36befb97834a7d3ca212f724306cbe57f76167",onInput:t=>this.changePageSize(parseInt(t.target.value))},this.pageSizeOptions.map((t=>o("option",{value:t},Wh("perPage",this.language,{size:t}))))),o("div",{key:"063ca0f31a3ab170a697af945414602f95748dac",class:"jump-box"},Wh("goTo",this.language),o("input",{key:"1ec1cbf62de505ea6770c59536c41f3bbb241261",type:"number",min:"1",max:this.totalPages,value:this.current,onKeyDown:t=>{if("Enter"===t.key){const e=parseInt(t.target.value);isNaN(e)||this.goToPage(e)}},onInput:t=>{const e=t.target;parseInt(e.value)>this.totalPages&&(e.value=this.totalPages.toString()),parseInt(e.value)<1&&(e.value="1")}})))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],total:["updateTotalPages"],pageSize:["updateTotalPages"]}}};tc.style=".paginator{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.paginator .page{color:var(--emw--color-typography, #000)}button{padding:4px 8px;font-size:14px;background:var(--emw--color-background, #fff);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);cursor:pointer;min-width:28px;transition:all 0.2s ease}.arrow-btn{color:var(--emw--color-typography, #000)}button.active{color:#333;background:var(--emw--color-primary, #fed275);border-color:var(--emw--color-primary, #fed275);font-weight:bold}button:not(.arrow-btn):hover{background:var(--emw--color-secondary, #fff3b9);border-color:var(--emw--color-secondary, #fff3b9)}button:disabled{cursor:not-allowed;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));user-select:none}.ellipsis{font-weight:bold;color:var(--emw--color-typography, #000);border:none}select{padding:4px 8px;border-radius:4px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));font-size:14px}.jump-box{display:flex;align-items:center;gap:4px;margin-left:8px;color:var(--emw--color-typography, #000)}.jump-box input{width:50px;padding:2px 6px;font-size:14px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:4px;text-align:center}.total-num{user-select:none;font-size:14px;color:var(--emw--color-typography, #333)}";var ec=function(){return ec=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},ec.apply(this,arguments)},ic={primaryColor:"#333",secondaryColor:"#E6E6E6"};function oc(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var i=e.placeholders||ic;return rc(t.icon(i.primaryColor,i.secondaryColor),e)}return rc(t.icon,e)}function rc(t,e){var i="svg"===t.tag?ec(ec({},t.attrs),e.extraSVGAttrs||{}):t.attrs,o=Object.keys(i).reduce((function(t,e){var o=i[e],r="".concat(e,'="').concat(o,'"');return t.push(r),t}),[]),r=o.length?" "+o.join(" "):"",n=(t.children||[]).map((function(t){return rc(t,e)})).join("");return n&&n.length?"<".concat(t.tag).concat(r,">").concat(n,"</").concat(t.tag,">"):"<".concat(t.tag).concat(r," />")}const nc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),sc=class{constructor(e){t(this,e),this.togglePanel=()=>{this.expanded=!this.expanded},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.headerTitle=void 0,this.expanded=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return o("div",{key:"3a7acb79544c31ac93d82a2ea62ca7d343901b3f",class:"panel-container",ref:t=>this.stylingContainer=t},o("div",{key:"1c4f38f5c8df2e08dd3a33f9af45b7bc0cc1f025",class:{"panel-header":!0,active:this.expanded},onClick:this.togglePanel},o("div",{key:"6e08ac8f744bb3abbfb0148d4cc82843f13b1ea5",class:"header-content"},o("slot",{key:"b58eee18d78117db3638ed71800b40e626de7d63",name:"header"},o("span",{key:"cfc3586117731014a1511f9df19d53132580e2ac"},this.headerTitle))),o("span",{key:"41a8fb02bb96acd842668cd717909f07d02bdad2",class:"arrow "+(this.expanded?"expanded":""),innerHTML:nc})),o("div",{key:"5deb75348843b6cf12bba4c03a5defeaa82760f8",class:"panel-body "+(this.expanded?"open":"closed")},o("slot",{key:"0191d8c751a6fecaaeae237cba17e125df42b6d4",name:"content"})))}get el(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};sc.style=".panel-container{border:1px solid var(--emw--color-typography, #000);border-radius:8px;overflow:hidden;font-family:sans-serif;width:calc(100% - 4px)}.panel-header{background-color:var(--emw--color-background, #fff);padding:8px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:14px}.panel-header .header-content{color:var(--emw--color-typography, #000)}.panel-header:hover{background-color:var(--emw--color-primary, #fed275)}.panel-header.active{background-color:var(--emw--color-primary, #fed275)}.header-content{white-space:nowrap;user-select:none}.arrow{transition:transform 0.3s ease;font-size:16px;display:inline-flex}.arrow.expanded{transform:rotate(180deg)}.panel-body{overflow:hidden;max-height:0;transition:max-height 0.3s ease, padding 0.3s ease;background-color:var(--emw--color-background, #fff);padding:0 12px;font-size:14px}.panel-body.open{max-height:500px;padding:10px 12px}.panel-body.closed{max-height:0;padding-top:0;padding-bottom:0}";const ac=["ro","en","fr","ar","hr"],lc={en:{homeTeam:"Home team:",awayTeam:"Away team:",selectionCleared:"Your selection has been cleared.",selectionOnLineCleared:"Your selection on this line will be cleared.",loading:"Loading...",error:"Error!",noData:"No data available.",lineInfo:"Line {currentPage} of {totalPages}",clearAll:"Clear All",cancel:"Cancel",confirm:"Confirm"},ro:{homeTeam:"Echipa gazdă:",awayTeam:"Echipa oaspete:",selectionCleared:"Selecția dvs. a fost ștearsă.",selectionOnLineCleared:"Selecția dvs. de pe această linie va fi ștearsă.",loading:"Se încarcă...',n error: 'Eroare!",noData:"Nu sunt date disponibile.",lineInfo:"Linia {currentPage} din {totalPages}",clearAll:"Șterge tot",cancel:"Anulează",confirm:"Confirmă"},fr:{homeTeam:"Équipe à domicile:",awayTeam:"Équipe à l'extérieur:",selectionCleared:"Votre sélection a été effacée.",selectionOnLineCleared:"Votre sélection sur cette ligne sera effacée.",loading:"Chargement...',n error: 'Erreur!",noData:"Aucune donnée disponible.",lineInfo:"Ligne {currentPage} sur {totalPages}",clearAll:"Tout effacer",cancel:"Annuler",confirm:"Confirmer"},ar:{homeTeam:"الفريق المضيف:",awayTeam:"الفريق الضيف:",selectionCleared:"تم مسح اختيارك.",selectionOnLineCleared:"سيتم مسح اختيارك في هذا السطر.",loading:"جار التحميل...',n error: 'خطأ!",noData:"لا توجد بيانات متاحة.",lineInfo:"السطر {currentPage} من {totalPages}",clearAll:"مسح الكل",cancel:"إلغاء",confirm:"تأكيد"},hr:{homeTeam:"Domaći tim:",awayTeam:"Gostujući tim:",selectionCleared:"Vaš odabir je obrisan.",selectionOnLineCleared:"Vaš odabir na ovoj liniji bit će obrisan.",loading:"Učitavanje...',n error: 'Greška!",noData:"Nema dostupnih podataka.",lineInfo:"Linija {currentPage} od {totalPages}",clearAll:"Očisti sve",cancel:"Odustani",confirm:"Potvrdi"}},hc=(t,e,i)=>{const o=e;let r=lc[void 0!==o&&ac.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r},cc=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])lc[e][i]=t[e][i]}))},dc=[{value:"1"},{value:"X"},{value:"2"}],uc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),pc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),mc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),fc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),vc=oc({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),gc=class{constructor(i){t(this,i),this.lotteryTippingBulletBetEvent=e(this,"lotteryTippingBulletBetSelect",7),this.lotteryTippingCurrentPageChangeEvent=e(this,"lotteryTippingCurrentPageChange",7),this.eventNameRender=(t,e)=>o("div",{class:"flex gap-1 eventNameContainer__item"},o("span",{class:"eventNameContainer__item--title"},e),o("general-tooltip",null,o("span",{slot:"trigger",class:"icon info-icon",innerHTML:mc,style:{width:"18px"}}),o("div",{slot:"content"},o("div",{class:"match-info"},o("div",{class:"match-info-item"},o("div",{class:"match-info-item-label"},hc("homeTeam",this.language)),o("div",{class:"match-info-item-value"},t.homeName)),o("div",{class:"match-info-item"},o("div",{class:"match-info-item-label"},hc("awayTeam",this.language)),o("div",{class:"match-info-item-value"},t.awayName)))))),this.columns=[{title:"",value:"index",width:3},{title:"",value:"eventName",width:70,render:this.eventNameRender},{title:"",value:"startTime",width:22,align:"right",nowrap:!0,render:(t,e)=>(({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}})({date:e,format:"ccc HH:mm"})},{title:()=>o("lottery-tipping-bullet-group",{theme:"text",bulletConfigContent:JSON.stringify(dc)}),value:"results",width:5,render:(t,e,i)=>{var r,n;return o("lottery-tipping-bullet-group",{mode:this.mode,bulletConfigContent:JSON.stringify(null===(n=null===(r=this.bulletConfigLineGroup)||void 0===r?void 0:r[this.currentPage-1])||void 0===n?void 0:n[i]),"position-idx":`${this.currentPage-1}-${i}`})}}],this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.translationData=void 0,this.clientStylingUrlContent="",this.sessionId=void 0,this.endpoint="",this.gameId=void 0,this.drawId=void 0,this.totalPages=void 0,this.minTotalPages=0,this.maxTotalPages=0,this.mode="multi",this.readPretty=!1,this.defaultBulletConfigLineGroup=void 0,this.bulletConfigLineGroup=[[[]]],this.currentPage=1,this.isLoading=!1,this.hasErrors=!1,this.dialogConfig={visible:!1},this.ticketDataSource=[]}handleNewTranslations(){this.isLoading=!0,cc(JSON.parse(this.translationUrl)),this.isLoading=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){this.translationUrl&&cc(JSON.parse(this.translationUrl))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}get parsedDefaultBulletConfigLineGroup(){if("string"==typeof this.defaultBulletConfigLineGroup&&this.defaultBulletConfigLineGroup)try{const t=JSON.parse(this.defaultBulletConfigLineGroup);return this.readPrettyHandler(t)}catch(t){return void console.error("Error parsing defaultBulletConfigLineGroup:",t)}}readPrettyHandler(t){return this.readPretty?(this.currentPage=1,this.minTotalPages=1,this.maxTotalPages=this.totalPages,null==t?void 0:t.map((t=>null==t?void 0:t.map((t=>null==t?void 0:t.map((t=>Object.assign(Object.assign({},t),{disabled:!0})))))))):t}initLineForBulletConfig(){var t;return Array.from({length:null===(t=this.ticketDataSource)||void 0===t?void 0:t.length},(()=>[...dc]))}_resetBulletConfig(){this.bulletConfigLineGroup=Array.from({length:this.totalPages}).map(this.initLineForBulletConfig.bind(this))}fetchMatchData(){let t=new URL(`${this.endpoint}/poolgames/${this.gameId}/draws/${this.drawId}/matchConfig`);this.gameId&&this.drawId&&(this.isLoading=!0,(t=>fetch(t).then((t=>t.json())))(t.href).then((t=>{this.ticketDataSource=t||[],this.isLoading=!1,this.updateBulletConfigLineGroup()})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)})))}updateBulletConfigLineGroup(){this.parsedDefaultBulletConfigLineGroup&&this.parsedDefaultBulletConfigLineGroup.length>0?this.bulletConfigLineGroup=this.parsedDefaultBulletConfigLineGroup:this._resetBulletConfig()}connectedCallback(){this.fetchMatchData()}handleClearAll(){this._resetBulletConfig(),(({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})})({message:hc("selectionCleared",this.language)}),this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!1})}async resetBulletConfig({minLineNumber:t,maxLineNumber:e,defaultBoards:i}){this.totalPages=i,this.minTotalPages=t,this.maxTotalPages=e,this.currentPage=1,this._resetBulletConfig(),this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!1})}lotteryTippingBulletGroupSelectionHandler(t){const{bulletConfigArr:e,positionIdx:i}=t.detail,[o,r]=i.split("-");this.bulletConfigLineGroup[o][r]=e,this.bulletConfigLineGroup=[...this.bulletConfigLineGroup],this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!0})}async getData(){return await this.validateBulletConfigLineGroup(),this.bulletConfigLineGroup}validateBulletConfigLineGroup(){if("[[[]]]"===JSON.stringify(this.bulletConfigLineGroup))return Promise.resolve(this.bulletConfigLineGroup);const t=this.bulletConfigLineGroup.length;return t!==this.totalPages||t<this.minTotalPages||t>this.maxTotalPages?(this._resetBulletConfig(),Promise.reject(new Error("Invalid bullet config line group length"))):Promise.resolve(this.bulletConfigLineGroup)}prevPage(){this.swapCard("prev",(()=>{this.currentPage>1&&this.currentPage--}))}nextPage(){this.swapCard("next",(()=>{this.currentPage<this.totalPages&&this.currentPage++}))}handleAddLine(){this.swapCard("add",(()=>{this.totalPages<=this.maxTotalPages-1&&(this.bulletConfigLineGroup.push(this.initLineForBulletConfig()),this.totalPages++,this.currentPage++,this.lotteryTippingBulletBetEvent.emit())}))}handleRemoveLine(){(()=>{if(this.totalPages>=this.minTotalPages+1){const t=()=>{this.dialogConfig={visible:!1}},e=()=>{this.bulletConfigLineGroup.splice(this.currentPage-1,1),this.totalPages--,1!==this.currentPage&&this.currentPage--,this.lotteryTippingBulletBetEvent.emit(),this.swapCard("remove",t)};this.dialogConfig={visible:!0,content:hc("selectionOnLineCleared",this.language),onConfirm:e,onCancel:t}}})()}swapCard(t,e){const i=this.mainContainer;if(!i)return;const{out:o,in:r}={next:{out:"card-out-left",in:"card-in-left"},prev:{out:"card-out-right",in:"card-in-right"},remove:{out:"card-out-down",in:"card-in-right"},add:{out:"card-out-left",in:"card-in-up"}}[t];i.classList.add(o),i.addEventListener("animationend",(()=>{i.classList.remove(o),e();const t=this.mainContainer;t&&(t.classList.add(r),t.addEventListener("animationend",(()=>t.classList.remove(r)),{once:!0}))}),{once:!0})}handleCurrentPageChange(){this.lotteryTippingCurrentPageChangeEvent.emit({currentPage:this.currentPage})}renderLoading(){return o("div",{class:"loading-wrap"},o("section",{class:"dots-container"},o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"})))}render(){var t,e,i,r;if(this.isLoading)return this.renderLoading();if(this.hasErrors)return o("div",{ref:t=>this.stylingContainer=t,class:"LotteryTippingTicketBet__container"},o("p",null,hc("error",this.language)));const n=({columns:t,dataSource:e,hideHead:i=!1,grid:r=!0,bordered:n=!0})=>o("table",{class:{bordered:n,grid:r,"my-table-component":!0}},!i&&o("thead",null,o("tr",null,t.map((t=>{var e;return o("th",{key:t.value,style:{width:t.width+"%",textAlign:t.align}},"string"==typeof t.title?t.title:null===(e=t.title)||void 0===e?void 0:e.call(t))})))),o("tbody",null,e.map(((e,i)=>o("tr",{key:i},t.map((t=>o("td",{key:t.value,style:{width:t.width+"%",textAlign:t.align},class:{"no-wrap":t.nowrap}},t.render?t.render(e,e[t.value],i):e[t.value])))))))),s=this.totalPages<this.maxTotalPages&&this.currentPage===this.totalPages,a=this.totalPages>this.minTotalPages;return 0===this.ticketDataSource.length||0===this.minTotalPages||0===this.maxTotalPages?o("div",{class:"LotteryTippingTicketBet__container",ref:t=>this.stylingContainer=t},o("div",{class:"LotteryTippingTicketBet__empty"},o("p",null,hc("noData",this.language)))):this.readPretty?o("div",{class:"LotteryTippingTicketBet__container",ref:t=>this.stylingContainer=t},o("div",{class:"LotteryTippingTicketBet__main",ref:t=>this.mainContainer=t},o(n,{columns:this.columns,dataSource:(null===(t=this.ticketDataSource)||void 0===t?void 0:t.map(((t,e)=>Object.assign(Object.assign({},t),{index:e+1}))))||[],hideHead:!1,grid:!1,bordered:!1}),this.totalPages>1&&o("div",null,o("div",{class:"border-line"}),o("div",{class:"LotteryTippingTicketBet__footer"},o("div",{class:"my-pagination flex justify-between"},o("span",null,hc("lineInfo",this.language,{currentPage:this.currentPage,totalPages:this.totalPages})),o("div",{class:"flex gap-1"},o("span",{class:"btn "+(1===this.currentPage?"disabled":""),onClick:this.prevPage.bind(this)},o("span",{class:"icon",innerHTML:fc})),o("span",{class:"btn "+(this.currentPage===this.totalPages?"disabled":""),onClick:this.nextPage.bind(this)},o("span",{class:"icon",innerHTML:vc})))))))):o("div",{ref:t=>this.stylingContainer=t,class:"LotteryTippingTicketBet__container"},o("div",{class:"LotteryTippingTicketBet__tableToolbar flex justify-end gap-1"},o("button",{class:{"LotteryTippingTicketBet__tableToolbar--item":!0,"mr-0":!(s||a)},onClick:this.handleClearAll.bind(this)},hc("clearAll",this.language))),o("div",{class:"flex align-center LotteryTippingTicketBet__main",ref:t=>this.mainContainer=t},o(n,{columns:this.columns,dataSource:(null===(e=this.ticketDataSource)||void 0===e?void 0:e.map(((t,e)=>Object.assign(Object.assign({},t),{index:e+1}))))||[],hideHead:!1,grid:!1,bordered:!1}),(s||a)&&o("div",{class:"LotteryTippingTicketBet__lineOperatorGroup"},s&&o("div",{class:{"LotteryTippingTicketBet__lineOperatorGroup--item":!0},onClick:this.handleAddLine.bind(this)},o("span",{class:"icon",innerHTML:uc})),a&&o("div",{class:{"LotteryTippingTicketBet__lineOperatorGroup--item":!0},onClick:this.handleRemoveLine.bind(this)},o("span",{class:"icon",innerHTML:pc})))),o("div",{class:"border-line"}),o("div",{class:"LotteryTippingTicketBet__footer"},o("div",{class:"my-pagination flex justify-between"},o("span",null,hc("lineInfo",this.language,{currentPage:this.currentPage,totalPages:this.totalPages})),o("div",{class:"flex gap-1"},o("span",{class:"btn "+(1===this.currentPage?"disabled":""),onClick:this.prevPage.bind(this)},o("span",{class:"icon",innerHTML:fc})),o("span",{class:"btn "+(this.currentPage===this.totalPages?"disabled":""),onClick:this.nextPage.bind(this)},o("span",{class:"icon",innerHTML:vc}))))),this.dialogConfig.visible&&o("vaadin-confirm-dialog",{rejectButtonVisible:!0,rejectText:hc("cancel",this.language),confirmText:hc("confirm",this.language),opened:null===(i=this.dialogConfig)||void 0===i?void 0:i.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(r=this.dialogConfig)||void 0===r?void 0:r.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],gameId:["fetchMatchData"],sessionId:["fetchMatchData"],drawId:["fetchMatchData"],defaultBulletConfigLineGroup:["fetchMatchData"],currentPage:["handleCurrentPageChange"]}}};var bc,yc,wc,xc;gc.style=".LotteryTippingTicketBet__container {\n display: block; /* Or inline-block, depending on desired layout flow */\n font-size: 14px;\n line-height: 1.5715;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n overflow: hidden;\n min-width: 300px;\n container-type: inline-size;\n}\n@container (max-width: 375px) {\n .LotteryTippingTicketBet__container {\n font-size: 12px;\n }\n}\n\n.table-wrapper {\n overflow-x: auto; /* Handle horizontal scroll if content overflows */\n}\n\n.my-table-component {\n width: 100%;\n border-collapse: collapse; /* Important for borders */\n text-align: left;\n border-radius: 0.1rem; /* Ant Design like subtle rounding */\n border-spacing: 0;\n}\n\n/* Header */\n.my-table-component th {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-weight: 500;\n padding: 0.4rem 0.5rem;\n transition: background 0.3s ease;\n}\n\n/* Cells */\n.my-table-component td {\n padding: 0.4rem 0.5rem;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n transition: background 0.3s;\n}\n@container (max-width: 400px) {\n .my-table-component td {\n padding: 0.3rem 0.3rem;\n }\n}\n\n.my-table-component.bordered th,\n.my-table-component.bordered td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Bordered style */\n.my-table-component.grid th,\n.my-table-component.grid td {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid th {\n border-bottom-width: 1px; /* Ensure bottom border is consistent */\n}\n\n.my-table-component.grid {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6); /* Outer border */\n border-right-width: 0;\n border-bottom-width: 0;\n}\n\n.my-table-component.grid th:last-child,\n.my-table-component.grid td:last-child {\n border-right: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid tr:last-child td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Striped style */\n.my-table-component.striped tbody tr:nth-child(even) td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n/* Hover (optional, but nice) */\n.my-table-component tbody tr:hover td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.flex {\n display: flex;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 0.5rem;\n}\n\n.btn {\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n font-size: 14px;\n transition: all 0.2s ease;\n}\n.btn:hover {\n cursor: pointer;\n}\n\n.btn:hover {\n background-color: var(--emw--color-gray-100, #e6e6e6);\n}\n\n.btn.disabled {\n opacity: 0.5;\n pointer-events: none;\n}\n.btn.disabled:hover {\n cursor: not-allowed !important;\n}\n\n.LotteryTippingTicketBet__tableToolbar {\n width: 100%;\n margin-bottom: 1rem;\n}\n\n.LotteryTippingTicketBet__tableToolbar--item {\n background-color: transparent;\n cursor: pointer;\n font-weight: 500;\n white-space: nowrap;\n display: inline-flex;\n border-radius: 1.6rem;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 1rem;\n padding-right: 1rem;\n margin-right: 2rem;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketBet__tableToolbar--item.mr-0 {\n margin-right: 0rem !important;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup {\n flex-basis: 2rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n border-radius: 8px;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 2rem;\n height: 2rem;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n border-radius: 8px;\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 14px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item .icon {\n width: 20px;\n height: 20px;\n transition: filter 0.2s ease-in-out;\n filter: grayscale(0.3);\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item:hover .icon {\n filter: grayscale(0);\n transform: rotate(3deg);\n}\n\ndiv.border-line {\n margin-top: 1rem;\n height: 1px;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n transition: all 0.3s ease;\n}\n\n.LotteryTippingTicketBet__footer {\n padding: 0.5rem;\n}\n\n.my-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n font-size: 0.8rem;\n color: var(--emw--color-typography-secondary, #333);\n}\n\n.my-pagination span {\n font-weight: 500;\n user-select: none;\n}\n\n.my-pagination .btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n transition: all 0.3s ease;\n cursor: pointer;\n opacity: 0.9;\n color: var(--emw--color-typography, #000);\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.my-pagination .btn .icon {\n width: 20px;\n height: 20px;\n transition: transform 0.2s ease;\n}\n\n.my-pagination .btn:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 14px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));\n}\n\n.my-pagination .btn.disabled {\n background-color: var(--emw--color-background-tertiary, #ccc);\n cursor: not-allowed;\n opacity: 0.5;\n transform: scale(1);\n}\n\n.match-info-item {\n display: flex;\n}\n\n.match-info-item-label {\n margin-right: 6px;\n}\n\n.info-icon:hover {\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__empty p {\n text-align: center;\n}\n\n.no-wrap {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.eventNameContainer__item--title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 300px;\n}\n@container (max-width: 600px) {\n .eventNameContainer__item--title {\n max-width: 180px;\n }\n}\n@container (max-width: 500px) {\n .eventNameContainer__item--title {\n max-width: 150px;\n }\n}\n@container (max-width: 400px) {\n .eventNameContainer__item--title {\n max-width: 100px;\n }\n}\n@container (max-width: 330px) {\n .eventNameContainer__item--title {\n max-width: 70px;\n }\n}\n\n.LotteryTippingTicketBet__main {\n perspective: 800px;\n will-change: transform, opacity;\n backface-visibility: hidden;\n}\n\n@container (max-width: 520px) {\n .LotteryTippingTicketBet__main {\n flex-wrap: wrap;\n justify-content: center;\n }\n .LotteryTippingTicketBet__tableToolbar--item {\n margin-right: 0 !important;\n }\n}\n/* Fade-In Keyframes */\n@keyframes fadeInLeft {\n from {\n opacity: 0;\n transform: translateX(100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n/* Fade-Out Keyframes */\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n@keyframes fadeInRight {\n from {\n opacity: 0;\n transform: translateX(-100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@-webkit-keyframes slide-left {\n 0% {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n }\n 100% {\n -webkit-transform: translateX(-100px);\n transform: translateX(-100px);\n }\n}\n@keyframes slide-left {\n 0% {\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n }\n 100% {\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n }\n}\n@-webkit-keyframes slide-right {\n 0% {\n -webkit-transform: translateX(-100%);\n transform: translateX(-100%);\n }\n 100% {\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n }\n}\n@keyframes slide-right {\n 0% {\n -webkit-transform: translateX(-100px);\n transform: translateX(-100px);\n }\n 100% {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n }\n}\n@-webkit-keyframes slide-top {\n 0% {\n -webkit-transform: translateY(-100px);\n transform: translateY(-100px);\n }\n 100% {\n -webkit-transform: translateY(0px);\n transform: translateY(0px);\n }\n}\n@keyframes slide-top {\n 0% {\n -webkit-transform: translateY(-100px);\n transform: translateY(-100px);\n }\n 100% {\n -webkit-transform: translateY(0px);\n transform: translateY(0px);\n }\n}\n/* Apply to your card classes */\n.card-in-left {\n -webkit-animation: slide-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-left {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.card-in-right {\n -webkit-animation: slide-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-right {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.card-in-up {\n -webkit-animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-down {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 40vh;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}",function(t){t.SingleBet="SingleBet",t.SystemBet="SystemBet"}(bc||(bc={})),function(t){t.FullTime="FullTime",t.HalfTime="HalfTime",t.Both="Both"}(yc||(yc={})),function(t){t.OPEN="OPEN"}(wc||(wc={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(xc||(xc={}));const _c=["ro","en","fr","ar","hr"],kc={en:{stop:"Stop",at:"at",turnover:"Turnover: ",selectionCleared:"Your selection will be cleared.",ticketSubmitted:"Ticket submitted successfully.",ticketFailed:"Failed to submit tickets.",lines:"Lines",line:"Line",bettingType:"Betting Type",playingMode:"Playing Mode",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Tickets",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",cancel:"Cancel",confirm:"Confirm",stakePerLine:"Stake per Line:"},ro:{selectionCleared:"Selecția dvs. va fi ștearsă.",ticketSubmitted:"Bilet trimis cu succes.",ticketFailed:"Nu s-a putut achiziționa biletul. Vă rugăm să încercați din nou.",lines:"Linii",line:"Linie",bettingType:"Tip de pariu",playingMode:"Mod de joc",orderSummaryTitle:"Sumar comandă",orderSummaryTickets:"Bilete",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",cancel:"Anulează",confirm:"Confirmă"},fr:{selectionCleared:"Votre sélection sera effacée.",ticketSubmitted:"Billet soumis avec succès.",ticketFailed:"Échec de l'achat du billet. Veuillez réessayer.",lines:"Lignes",line:"Ligne",bettingType:"Type de pari",playingMode:"Mode de jeu",orderSummaryTitle:"Résumé de la commande",orderSummaryTickets:"Billets",orderSummaryTotal:"Total",orderSummarySubmit:"Soumettre",cancel:"Annuler",confirm:"Confirmer"},ar:{selectionCleared:"سيتم مسح اختيارك.",ticketSubmitted:"تم إرسال التذكرة بنجاح.",ticketFailed:"فشل شراء التذكرة. يرجى المحاولة مرة أخرى.",lines:"خطوط",line:"خط",bettingType:"نوع الرهان",playingMode:"وضع اللعب",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"التذاكر",orderSummaryTotal:"المجموع",orderSummarySubmit:"إرسال",cancel:"إلغاء",confirm:"تأكيد"},hr:{selectionCleared:"Vaš odabir bit će obrisan.",ticketSubmitted:"Listić je uspješno predan.",ticketFailed:"Kupnja listića nije uspjela. Molimo pokušajte ponovo.",lines:"Linije",line:"Linija",bettingType:"Vrsta oklade",playingMode:"Način igranja",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listići",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Pošalji",cancel:"Odustani",confirm:"Potvrdi"}},Cc=(t,e)=>{const i=e;return kc[void 0!==i&&_c.includes(i)?i:"en"][t]};function Sc(t,e="GET",i=null,o={}){return new Promise(((r,n)=>{const s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a=Object.assign({"Content-Type":"application/json"},o);"GET"!==e&&"HEAD"!==e&&(a["X-Idempotency-Key"]=s);const l={method:e,headers:a};i&&"GET"!==e&&"HEAD"!==e&&(l.body=JSON.stringify(i)),fetch(t,l).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>n(t)))}))}const Tc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},Ac=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},zc=["H","D","A"],Ic=(t=[])=>t.filter((t=>t.enabled)),Mc=({rawData:t,selectedBettingType:e,selectedPlayingMode:i})=>{var o,r,n,s,a,l;const h=null===(s=null===(n=null===(r=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===r?void 0:r.playTypes)||void 0===n?void 0:n.find((t=>t.bettingType===e&&t.playMode===i)))||void 0===s?void 0:s.betTypeId,c=null===(l=null===(a=null==t?void 0:t.rules)||void 0===a?void 0:a.betTypes)||void 0===l?void 0:l.find((t=>t.id===h));return{betTypeId:h,betType:c}};function Dc(t,e="€"){return null==t?"":`${e}${t?Ac(t):0}`}function Nc(t){if(!t)return"";const e=(({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}})({date:t,format:"EEEE"});return["saturday","sunday"].includes(e.toLowerCase())?e.toUpperCase():"MIDWEEK"}const Oc="TICKET_INVALID_TOKEN",Ec=class{constructor(i){t(this,i),this.logoutEventHandler=e(this,"logout",7),this.bothBettingTypeMultiplier=2,this.onStakeChange=t=>{this.currentStake=this.getCurrentStakeByValue(t.detail.value)},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.endpoint="",this.sessionId=void 0,this.gameId=void 0,this.playerId="",this.drawId=void 0,this.isLoading=!0,this.bettingTypeOptions=[],this.playingModeOptions=[],this.selectedBettingType=void 0,this.selectedPlayingMode=void 0,this.hasSelectBullet=void 0,this.hasSelectAllBullet=void 0,this.totalLineCombination=0,this.submitLoading=void 0,this.drawSubmitAvailable=!1,this.rawData={},this.saleStatisticsInfo={},this.currentStake=void 0,this.dialogConfig={visible:!1}}async getLotteryTippingBulletResults(){return await this.childRef.getData()}get lineNumberRange(){const{betType:t}=Mc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),e=(null==t?void 0:t.boardsAllowed)||[0],[i,o]=[Math.min(...e),Math.max(...e)];return{minLineNumber:i,maxLineNumber:o,defaultBoards:(null==t?void 0:t.defaultBoards)||i}}get playTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.playTypes}get betTypeConfig(){var t,e;return null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.betTypes}get isBothBettingType(){return this.selectedBettingType===yc.Both}get stakeOptions(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.stakes)||void 0===i?void 0:i.map((t=>{var e;return{value:null===(e=t.value)||void 0===e?void 0:e.toString(),label:t.value,currency:t.currency}}))}getCurrentStakeByValue(t){var e;return null===(e=this.stakeOptions)||void 0===e?void 0:e.find((e=>+e.value==+t))}initiateCurrentStake(){var t,e,i;if(1===(null===(t=this.stakeOptions)||void 0===t?void 0:t.length))this.currentStake=this.stakeOptions[0];else{const t=(i=(null===(e=this.stakeOptions)||void 0===e?void 0:e.map((t=>t.value)))||[]).length?Math.min.apply(null,i):void 0;this.currentStake=this.getCurrentStakeByValue(t)}}handleBettingTypeChange(t){var e,i,o,r;if(t===this.selectedBettingType)return;this.selectedBettingType=t;const n=(({bettingType:t,playTypeConfig:e,betTypeConfig:i,enabledPlayingModeOptions:o})=>{const r=i.filter((t=>t.enabled)).map((t=>t.id)),n=e.filter((t=>r.includes(t.betTypeId))).filter((e=>e.bettingType===t)).map((t=>t.playMode));return o.filter((t=>n.includes(t.code)))})({bettingType:this.selectedBettingType,playTypeConfig:this.playTypeConfig,betTypeConfig:this.betTypeConfig,enabledPlayingModeOptions:Ic((null===(o=null===(i=null===(e=this.rawData)||void 0===e?void 0:e.rules)||void 0===i?void 0:i.poolGame)||void 0===o?void 0:o.playModes)||[])});this.playingModeOptions=n,n.length?n.map((t=>t.code)).includes(this.selectedPlayingMode)||(this.hasSelectBullet=!1,this.handlePlayingModeChange(null===(r=n[0])||void 0===r?void 0:r.code)):this.selectedPlayingMode=void 0,this.clearBulletConfig()}async clearBulletConfig(){return await this.childRef.resetBulletConfig(this.lineNumberRange)}handlePlayingModeChange(t){if(t===this.selectedPlayingMode)return;const e=e=>{this.selectedPlayingMode=t,this.clearBulletConfig().then((()=>{null==e||e()}))};if(this.hasSelectBullet){const t=()=>{this.dialogConfig={visible:!1}},i=()=>{e(t)};this.dialogConfig={visible:!0,content:Cc("selectionCleared",this.language),onConfirm:i,onCancel:t}}else e()}lotteryTippingBulletGroupSelectionHandler(t){var e;const i=null===(e=t.detail)||void 0===e?void 0:e.hasSelectBullet;void 0!==i&&(this.hasSelectBullet=i),this.bulletBetSelectChecker()}calculateCombinationInLine(t){return t.reduce(((t,e)=>t*e),1)}calculateTotalAmount(){const t=this.currentStake;if(!t)return 0;let e=+t.value*this.totalLineCombination;return this.isBothBettingType&&(e*=this.bothBettingTypeMultiplier),e}get totalAmountFormatted(){var t;const e=this.calculateTotalAmount();return Ac(e)+" "+((null===(t=this.currentStake)||void 0===t?void 0:t.currency)||"")}get currentStakeFormatted(){const{value:t="",currency:e=""}=this.currentStake||{};return`${t} ${e}`}bulletBetSelectChecker(){(async()=>{const t=await this.getLotteryTippingBulletResults();this.hasSelectAllBullet=!(({rawResults:t})=>{const e=(({rawResults:t})=>{const e=t=>t.filter((t=>t.isSelected)).length;return t.map((t=>t.length>0?t.map(e):[0]))})({rawResults:t});this.totalLineCombination=e.reduce(((t,e)=>t+this.calculateCombinationInLine(e)),0);const{combinations:i=1,maxCombinations:o=1}=Mc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}).betType||{};return e.some((t=>{const e=this.calculateCombinationInLine(t);return e<i||e>o}))})({rawResults:t})})()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleTimerStop(){this.drawSubmitAvailable=!0}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])kc[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){(()=>{let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isLoading=!0,Sc(t.href,"GET").then((t=>{var e,i,o,r,n,s,a;this.rawData=t,this.bettingTypeOptions=Ic((null===(i=null===(e=null==t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.bettingTypes)||[]),this.playingModeOptions=Ic((null===(r=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===r?void 0:r.playModes)||[]),this.initiateCurrentStake();const{bettingType:l,playMode:h}=(({playTypeConfig:t=[],betTypeConfig:e=[],enabledBettingTypeOptions:i=[],enabledPlayingModeOptions:o=[]})=>{const r=e.filter((t=>t.enabled));for(const e of r){const{bettingType:r,playMode:n}=null==t?void 0:t.find((t=>t.betTypeId===e.id));if(i.map((t=>t.code)).includes(r)&&o.map((t=>t.code)).includes(n))return{bettingType:r,playMode:n}}return{}})({playTypeConfig:null===(s=null===(n=null==t?void 0:t.rules)||void 0===n?void 0:n.poolGame)||void 0===s?void 0:s.playTypes,betTypeConfig:null===(a=null==t?void 0:t.rules)||void 0===a?void 0:a.betTypes,enabledBettingTypeOptions:this.bettingTypeOptions,enabledPlayingModeOptions:this.playingModeOptions});return this.handleBettingTypeChange(l),this.selectedPlayingMode=h,this.updateSaleStatistics()})).catch((t=>{console.error("Error!",t)})).finally((()=>{this.isLoading=!1}))})()}updateSaleStatistics(){var t;return async function({endpoint:t,gameId:e,drawId:i}){try{return await Sc(`${t}/games/${e}/draws/${i}/saleStatistics`)}catch(t){return Promise.reject(t)}}({endpoint:this.endpoint,gameId:null===(t=this.rawData)||void 0===t?void 0:t.type,drawId:this.drawId}).then((t=>{this.saleStatisticsInfo=t}))}async handleSubmit(){const t=await this.getLotteryTippingBulletResults(),{betTypeId:e,betType:i}=Mc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),o=new URL(`${this.endpoint}/tickets`),r=(({playerId:t,rawResults:e,gameId:i,rawData:o,amount:r,currentStake:n,betTypeId:s,betType:a})=>{var l;const h={playerId:t,tickets:[]},c=(t=>{const e=t=>t.map((t=>t.isSelected?1:0)),i=t.map((t=>t.map(e))),o=[];return i.forEach(((t,e)=>{const i=[];t.forEach(((t,e)=>{const o=t.map(((t,e)=>t?zc[e]:null)).filter(Boolean);i[e]=[o]})),o[e]=i})),o})(e),d=n||{};return h.tickets.push({startingDrawId:null===(l=null==o?void 0:o.currentDraw)||void 0===l?void 0:l.id,amount:r,gameId:i,gameName:o.name,currency:d.currency,selection:c.map((t=>({betType:s,stake:+d.value,poolGameSelections:t,quickPick:!1,betName:a.name}))),multiplier:!1,drawCount:1,quickPick:!1}),h})({playerId:this.playerId,rawResults:t,gameId:this.gameId,rawData:this.rawData,amount:this.calculateTotalAmount().toString(),currentStake:this.currentStake,betTypeId:e,betType:i});this.submitLoading=!0,(({body:t,sessionId:e,url:i})=>{const o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},body:JSON.stringify(t)};return fetch(i,o).then((t=>{if(401===t.status)throw new Error(Oc);if(t.status>300)throw new Error(t.statusText);return t.json().then((e=>{if(!(i=e.tickets)||!i.length||i.some((t=>t.state!==xc.Purchased)))throw new Error(t.statusText);var i;return e}))}))})({body:r,sessionId:this.sessionId,url:o.href}).then((()=>{Tc({message:Cc("ticketSubmitted",this.language)}),this.clearBulletConfig(),this.updateSaleStatistics()})).catch((t=>{if(t.message===Oc)return this.logoutEventHandler.emit(),void Tc({message:Oc,theme:"error"});Tc({message:Cc("ticketFailed",this.language),theme:"error"})})).finally((()=>{this.submitLoading=!1}))}get lineCountRender(){const t=Ac(this.totalLineCombination);let e=Cc("lines",this.language);return[0,1].includes(+t)&&(e=Cc("line",this.language)),t+" "+e}renderBettingControls(){var t,e;const i=()=>o("div",{class:"skeleton-content"},o("div",{class:"skeleton-item skeleton-animated"})),r=()=>{var t;return o("div",null,o("vaadin-select",{items:this.stakeOptions||[],value:(null===(t=this.currentStake)||void 0===t?void 0:t.value)||"","on-value-changed":this.onStakeChange.bind(this),"no-vertical-overlap":!0}))};return o("div",{class:"LotteryTippingTicketController__top"},o("div",{class:"LotteryTippingTicketController__row"},o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Cc("bettingType",this.language)),this.bettingTypeOptions.length?(()=>o("div",{class:"LotteryTippingTicketController__segmented-control"},this.bettingTypeOptions.map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedBettingType===t.code},onClick:this.handleBettingTypeChange.bind(this,t.code)},t.name)))))():i()),o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Cc("playingMode",this.language)),this.playingModeOptions.length?(()=>o("div",{class:"LotteryTippingTicketController__segmented-control"},this.playingModeOptions.map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedPlayingMode===t.code},onClick:this.handlePlayingModeChange.bind(this,t.code)},t.name)))))():i()),(null===(t=this.stakeOptions)||void 0===t?void 0:t.length)>1&&o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Cc("stakePerLine",this.language)),r()),(null===(e=this.stakeOptions)||void 0===e?void 0:e.length)>1&&o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Cc("stakePerLine",this.language)),r())))}renderOrderSummary(){var t;return o("div",{class:"LotteryTippingTicketController__main--right order-summary"},o("h3",{class:"order-summary__title"},Cc("orderSummaryTitle",this.language)),o("div",{class:"order-summary__ticket-info"},o("div",{class:"order-summary__ticket"},Cc("orderSummaryTickets",this.language),":"),o("div",{class:"order-summary__details"},o("span",{class:"order-summary__line-count"},this.lineCountRender),o("div",null,this.currentStake&&o("span",{class:"order-summary__multiplier"},"x"),o("span",{class:"order-summary__stake"},this.currentStakeFormatted)),this.isBothBettingType&&o("div",null,o("span",{class:"order-summary__multiplier"},"x"),o("span",{class:"order-summary__stake"},this.bothBettingTypeMultiplier)))),o("hr",{class:"order-summary__divider"}),o("div",{class:"order-summary__ticket-info"},o("div",{class:"order-summary__ticket"},Cc("orderSummaryTotal",this.language),":"),o("span",{class:"order-summary__details"},this.totalAmountFormatted)),o("div",{class:"order-summary__button-wrapper"},o("lottery-button",{onClick:this.handleSubmit.bind(this),loading:this.submitLoading,disabled:!this.hasSelectAllBullet||this.submitLoading||void 0===(null===(t=this.currentStake)||void 0===t?void 0:t.value)||!this.drawSubmitAvailable,text:Cc("orderSummarySubmit",this.language)})))}render(){var t,e,i,r,n,s,a,l,h,c,d;return o("div",{key:"71d1e6567f13267094ca2bdc32caa02891ad8540",class:"lottery-tipping-ticket-controller__container",ref:t=>this.stylingContainer=t},o("lottery-banner",{key:"4393c6b8cf885f3aa6df61e0283172f99d22fd12","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,stopTime:null===(e=null===(t=this.rawData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.wagerCloseTime,startTime:null===(r=null===(i=this.rawData)||void 0===i?void 0:i.currentDraw)||void 0===r?void 0:r.wagerStartTime,"banner-title":Nc(null===(s=null===(n=this.rawData)||void 0===n?void 0:n.currentDraw)||void 0===s?void 0:s.date),turnover:Dc(null===(l=null===(a=this.saleStatisticsInfo)||void 0===a?void 0:a.wagerSegment)||void 0===l?void 0:l.totalSalesCrossDraw),language:this.language,"translation-url":this.translationUrl,"logo-url":this.logoUrl,onLotteryBannerTimerStop:this.handleTimerStop.bind(this)}),this.renderBettingControls(),o("div",{key:"d054f3970388474745f6e92e7aa028d4509e6250",class:"flex flex-wrap LotteryTippingTicketController__main"},o("div",{key:"736a9c1c2ff1d5c88252b64e6a90a08d185574a0",class:"LotteryTippingTicketController__main--left"},o("lottery-tipping-ticket-bet",{key:"3976fecaa6e049c6d3b7521e58c8fcdf37fa9db4",ref:t=>this.childRef=t,endpoint:this.endpoint,"session-id":this.sessionId,"game-id":null===(h=this.rawData)||void 0===h?void 0:h.type,"draw-id":this.drawId,language:this.language,"translation-url":this.translationUrl,"max-total-pages":this.lineNumberRange.maxLineNumber,"min-total-pages":this.lineNumberRange.minLineNumber,"total-pages":this.lineNumberRange.defaultBoards,mode:this.selectedPlayingMode===bc.SingleBet?"single":"multi","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl})),this.renderOrderSummary()),this.dialogConfig.visible&&o("vaadin-confirm-dialog",{key:"60415251900e4e1c12c14b78314d8085bfbc4c5b",rejectButtonVisible:!0,rejectText:Cc("cancel",this.language),confirmText:Cc("confirm",this.language),opened:null===(c=this.dialogConfig)||void 0===c?void 0:c.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(d=this.dialogConfig)||void 0===d?void 0:d.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Ec.style=".lottery-tipping-ticket-controller__container {\n display: block;\n box-sizing: border-box;\n font-size: 14px;\n container-type: inline-size;\n background: var(--emw--color-background, #fff);\n}\n@container (max-width: 375px) {\n .lottery-tipping-ticket-controller__container {\n font-size: 12px;\n }\n}\n\n.LotteryTippingTicketController__top {\n padding: 1.8rem;\n display: flex;\n flex-direction: column;\n gap: 2rem;\n margin: 0 auto;\n max-width: 800px;\n}\n.LotteryTippingTicketController__row {\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__section {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.LotteryTippingTicketController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n color: var(--emw--color-typography-secondary, #333);\n}\n.LotteryTippingTicketController__segmented-control {\n height: 2.2rem;\n display: inline-flex;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 2rem;\n padding: 0.2rem;\n}\n.LotteryTippingTicketController__segment {\n background-color: transparent;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n transition: background-color 0.25s ease, color 0.25s ease;\n white-space: nowrap;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketController__segment--active {\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n}\n.LotteryTippingTicketController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.flex {\n display: flex;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.LotteryTippingTicketController__main {\n align-items: flex-start;\n justify-content: center;\n gap: 2rem;\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 20px;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__main--left {\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n padding: 1rem;\n border-radius: 1rem;\n flex: 1.5;\n}\n.LotteryTippingTicketController__main--right {\n padding: 1rem;\n border-radius: 1rem;\n flex: 1;\n}\n\n.order-summary {\n max-width: 360px;\n width: 100%;\n background: var(--emw--color-background, #fff);\n}\n\n.order-summary__title {\n margin-bottom: 16px;\n text-align: center;\n color: var(--emw--color-typography, #000);\n text-transform: uppercase;\n}\n\n.order-summary__ticket-info {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 10px;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__ticket {\n font-weight: 500;\n width: 50px;\n text-align: right;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__details {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__multiplier {\n color: var(--emw--color-typography-secondary, #333);\n margin: 0 8px;\n}\n\n.order-summary__divider {\n border: none;\n border-top: 1px solid var(--emw--color-gray-100, #e6e6e6);\n margin: 20px 0;\n}\n\n.order-summary__button-wrapper {\n display: flex;\n justify-content: center;\n}\n\n.order-summary__button {\n cursor: pointer;\n padding: 0.8rem 4rem;\n background: var(--emw--color-primary, #fed275);\n color: var(--emw--color-typography, #000);\n border-radius: var(--emw--button-border-radius, 4px);\n border: none;\n position: relative;\n}\n\n.loading-icon {\n position: absolute;\n right: 40px;\n top: 10px;\n}\n\n.order-summary__button:not(.order-summary__button--disabled):not(.order-summary__button--loading):hover {\n transform: translateY(-1px);\n background: var(--emw--color-primary-variant, #ffe66f);\n}\n\n.order-summary__button--loading {\n background: var(--emw--color-primary-variant, #ffe66f);\n cursor: not-allowed;\n}\n\n.order-summary__button--disabled {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n cursor: not-allowed;\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}";var Pc,Bc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},jc={exports:{}};Pc=jc,function(t){
|
|
6657
|
+
`}static get is(){return"vaadin-tabs"}}Yt(Gh);const Yh=["ro","en","fr","ar","hr"],Jh={en:{totalItems:"Total {total} items",perPage:"{size} / page",goTo:"Go to",filter:"Filter",clear:"Clear",searchByTicketId:"Search by Ticket ID",enterTicketId:"Enter Ticket ID",searchByTicketType:"Search by Ticket Type",selectTicketType:"Select Ticket Type",searchByDate:"Search by Date",from:"From",to:"To",normal:"Normal",subscription:"Subscription",ticketsHistory:"Tickets History",settled:"Settled",purchased:"Purchased",canceled:"Canceled",noData:"No data Avaliable.",ticketId:"Ticket ID:",ticketType:"Ticket Type:",ticketAmount:"Ticket Amount:",lineDetail:"Line Detail:",seeDetails:"See Details",numberOfDraw:"Number of Draw:",ticketResult:"Ticket Result:",drawId:"Draw ID:",drawDate:"Draw Date:",result:"Result:",prize:"Prize:",bettingType:"Betting Type:"},ro:{},fr:{},ar:{},hr:{}},Xh=(t,e,i)=>{const o=e;let r=Jh[void 0!==o&&Yh.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r},Kh=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])Jh[e][i]=t[e][i]}))},Zh=class{constructor(i){t(this,i),this.filterChange=e(this,"filterChange",7),this.filterClear=e(this,"filterClear",7),this.handleTicketType=t=>{t.detail&&t.detail.length&&(this.filterData.ticketType=t.detail)},this.handleFilterFrom=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterFromCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.handleFilterTo=t=>{let e=t.target.value.split("-");3===e.length&&(this.filterData=Object.assign(Object.assign({},this.filterData),{filterToCalendar:`${e[2]}/${e[1]}/${e[0]}`}))},this.quickFiltersActive=!1,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl=void 0,this.isOpen=!1,this.filterData={filterFromCalendar:"",filterToCalendar:"",ticketId:"",ticketType:[]},this.ticketTypeList=void 0,this.showClearButton=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentWillLoad(){this.translationUrl&&Kh(JSON.parse(this.translationUrl)),this.ticketTypeList=[{label:Xh("normal",this.language),value:"NORMAL"},{label:Xh("subscription",this.language),value:"SUBSCRIPTION"}]}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleModalClose(){this.isOpen=!1}changeFormate(t){const[e,i,o]=t.split("/");return`${o}-${i}-${e}`}formateDate(t){const{year:e,month:i,day:o}=t;return ht(new Date(e,i,o),"dd/MM/yyyy")}parseDate(t){const[e,i,o]=t.split("/");return{year:o,month:parseInt(i)-1,day:e}}setDateFormate(t){t.i18n=Object.assign(Object.assign({},t.i18n),{formatDate:this.formateDate,parseDate:this.parseDate})}clearSelection(){this.comboBox.clear()}resetSearch(){this.showClearButton=!1,this.clearSelection(),this.filterData={filterFromCalendar:"",filterToCalendar:"",ticketId:"",ticketType:[]},this.filterClear.emit()}handleDialogConfirm(){if(this.filterData.filterFromCalendar&&this.filterData.filterToCalendar){let t=this.filterData.filterFromCalendar.split("/"),e=this.filterData.filterToCalendar.split("/");const i={filterFromCalendar:new Date(Date.UTC(Number(t[2]),Number(t[1])-1,Number(t[0]),0,0,0)).toISOString(),filterToCalendar:new Date(Date.UTC(Number(e[2]),Number(e[1])-1,Number(e[0]),23,59,59)).toISOString()};this.filterData=Object.assign(Object.assign({},this.filterData),i)}this.filterChange.emit(this.filterData),this.isOpen=!1,this.showClearButton=!0}render(){return o("div",{key:"74aa590f6f92b9df971fd17cb3f573cc6a0a68e9",class:"lottery-tipping-filter",ref:t=>this.stylingContainer=t},o("div",{key:"ebf385371627466c5eb06a5ef75a14a467b1badd",class:"operate-btns"},!this.showClearButton&&o("div",{key:"55c709034e124b51e8b9057980f5a3c3b8c6d5ce",class:"operate-btn",onClick:()=>{this.isOpen=!0}},Xh("filter",this.language)),(this.showClearButton||this.quickFiltersActive)&&o("div",{key:"aa747af2461e72fbacc16decd7fc75cd6f640c47",class:"operate-btn",onClick:()=>this.resetSearch()},Xh("clear",this.language))),o("lottery-tipping-dialog",{key:"9a9472dee498db7acc83fd96db89b635be07a837","dialog-title":Xh("ticketResult",this.language),visible:this.isOpen,onCancel:()=>{this.isOpen=!1},onConfirm:this.handleDialogConfirm.bind(this),animationDuration:300,language:this.language,"translation-url":this.translationUrl},o("div",{key:"a7bfe435c8f7a43abf2c2d500d7e31fe62123787",class:"dialog-content"},o("div",{key:"4fcf5f1d3da61ba5e3e8c09b4a97339c1eafaf64",class:"filter-item"},o("div",{key:"397bb60af15071331c46c0b83366475ef66205fd",class:"filter-item-label"},Xh("searchByTicketId",this.language)),o("div",{key:"657e0014bb0d8af52ed273149bad534b2cd035b6",class:"filter-item-val"},o("div",{key:"7e49aab4b087a1e077cc03d4331df52be03a79c2",class:"general-multi-select-container"},o("vaadin-text-field",{key:"9d810aac3959e689cefed434d7c5569b18e4c0ec",placeholder:Xh("enterTicketId",this.language),value:this.filterData.ticketId,onInput:t=>{this.filterData.ticketId=t.target.value}})))),o("div",{key:"8b9fda151a493c920797e4c7e2a8693c84ea5620",class:"filter-item"},o("div",{key:"23439a0cad69db2ddafc8c131d5e1f5a019c3805",class:"filter-item-label"},Xh("searchByTicketType",this.language)),o("div",{key:"ffe8de6c8acb7ecb92301d417e5d3cddb9941601",class:"general-multi-select-container"},o("general-multi-select",{key:"90b2b967b17830a22ea08aa0f22e155e42922f21",ref:t=>this.comboBox=t,placeholder:Xh("selectTicketType",this.language),"max-visible-chips":"2",options:this.ticketTypeList.map((t=>({text:t.label,value:t.value}))),onChange:this.handleTicketType,"client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,"mb-source":this.mbSource}))),o("div",{key:"b8dc91b5337a8f4064160c50c20f213fbb1649bd",class:"filter-item"},o("div",{key:"476fb4074ad41ce1a014eb9355504aa4a53161ca",class:"filter-item-label"},Xh("searchByDate",this.language)),o("div",{key:"d4498509f769af6cd5d008dc8433a61b9c9c5487",class:"filter-item-val"},o("vaadin-date-picker",{key:"bd525309eb193cd2e12fc87aee172d423397d22e",value:this.filterData.filterFromCalendar,max:void 0===this.filterData.filterToCalendar?void 0:this.changeFormate(this.filterData.filterToCalendar),onChange:this.handleFilterFrom,placeholder:Xh("from",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}),o("vaadin-date-picker",{key:"50eb713df259a2d0fce36b90d81d1ea388c8545d",value:this.filterData.filterToCalendar,min:void 0===this.filterData.filterFromCalendar?void 0:this.changeFormate(this.filterData.filterFromCalendar),onChange:this.handleFilterTo,placeholder:Xh("to",this.language),ref:t=>this.setDateFormate(t),class:"VaadinDatePicker"}))))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};function Qh(t,e="GET",i=null,o={}){return new Promise(((r,n)=>{const s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a=Object.assign({"Content-Type":"application/json"},o);"GET"!==e&&"HEAD"!==e&&(a["X-Idempotency-Key"]=s);const l={method:e,headers:a,body:null};i&&"GET"!==e&&"HEAD"!==e?l.body=JSON.stringify(i):delete l.body,fetch(t,l).then((t=>t.ok?t.json():n(t))).then((t=>r(t))).catch((t=>n(t)))}))}function tc(t,e){return null==t||""===t||(0!==t||!e)&&(Array.isArray(t)?function(t){if(0===t.length)return!0;const e=t.length;let i=0;for(let o=0;o<e;o++){if(!tc(t[o]))return!1;i++}return i===e}(t):"[object Object]"===Object.prototype.toString.call(t)?function(t){if(0===Object.keys(t).length)return!0;const e=Object.keys(t).length;let i=0;for(const e of Object.values(t)){if(!tc(e))return!1;i++}return i===e}(t):!t)}Zh.style=".lottery-tipping-filter .operate-btns{display:flex;gap:10px}.lottery-tipping-filter .operate-btns .operate-btn{background:var(--emw--color-primary, #fed275);border:1px solid var(--emw--color-primary, #fed275);border-radius:16px;padding:8px 10px;font-size:14px;color:var(--emw--color-typography, #000);font-weight:600;cursor:pointer;transition:0.2s linear}.dialog-content{display:flex;flex-direction:column;align-items:center}.dialog-content .filter-item{margin-bottom:12px}.dialog-content .filter-item-label{text-align:center;color:var(--emw--color-typography, #000)}.dialog-content .filter-item-val{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}@media screen and (max-width: 480px){.lottery-tipping-filter .operate-btns{gap:4px}}.general-multi-select-container{width:var(--vaadin-field-default-width, 16em)}.general-multi-select-container vaadin-text-field{width:100%}";const ec={0:"1",1:"X",2:"2"},ic={H:0,D:1,A:2},oc=t=>{const e=t.map((t=>{const e=[0,0,0];return t[0].forEach((t=>{const i=ic[t];void 0!==i&&(e[i]=1)})),e.map(((t,e)=>({isSelected:1===t,value:ec[e]})))}));return e},rc=t=>!!(t.toLowerCase().match(/android/i)||t.toLowerCase().match(/blackberry|bb/i)||t.toLowerCase().match(/iphone|ipad|ipod/i)||t.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)),nc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},sc=class{constructor(i){t(this,i),this.pageChange=e(this,"pageChange",7),this.pageSizeChange=e(this,"pageSizeChange",7),this.userAgent=window.navigator.userAgent,this.total=0,this.pageSizeOptions=[10,20,50],this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl=void 0,this.current=1,this.pageSize=10,this.totalPages=1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&Kh(JSON.parse(this.translationUrl)),this.pageSize=this.pageSizeOptions[0],this.updateTotalPages()}updateTotalPages(){this.totalPages=Math.max(Math.ceil(this.total/this.pageSize),1),this.current>this.totalPages&&(this.current=this.totalPages,this.pageChange.emit(this.current))}goToPage(t){t<1||t>this.totalPages||t===this.current||(this.current=t,this.pageChange.emit(t))}changePageSize(t){this.pageSize=t,this.pageSizeChange.emit(t),this.updateTotalPages(),this.goToPage(1)}getPagesToShow(){const t=[],e=rc(this.userAgent)?1:2,{totalPages:i,current:o}=this;if(i<=7)for(let e=1;e<=i;e++)t.push({type:"page",value:e});else{t.push({type:"page",value:1}),o>e+2&&t.push({type:"jump",direction:"prev"});const r=Math.max(2,o-e),n=Math.min(i-1,o+e);for(let e=r;e<=n;e++)t.push({type:"page",value:e});o<i-e-1&&t.push({type:"jump",direction:"next"}),t.push({type:"page",value:i})}return t}jumpTo(t){this.goToPage("prev"===t?Math.max(1,this.current-5):Math.min(this.totalPages,this.current+5))}render(){const t=this.getPagesToShow();return o("div",{key:"daa1bf4cd3031ae3f908bd2638424cbf82b81021",class:"paginator",ref:t=>this.stylingContainer=t},o("div",{key:"93841d6094df6f52b24e277b66d92158aabd2955",class:"total-num"},Xh("totalItems",this.language,{total:this.total})),o("button",{key:"205e1dcc5e5c1b18f2dbbb61e127d13e4adaa79f",class:"arrow-btn",disabled:this.current<=1,onClick:()=>this.goToPage(this.current-1)},"<"),t.map((t=>"page"===t.type?o("button",{class:{page:!0,active:this.current===t.value},onClick:()=>this.goToPage(t.value)},t.value):o("button",{class:"ellipsis",onClick:()=>this.jumpTo(t.direction)},"..."))),o("button",{key:"3213a6519702b4215e66afadf8dc6e44839455e7",class:"arrow-btn",disabled:this.current>=this.totalPages,onClick:()=>this.goToPage(this.current+1)},">"),o("select",{key:"da36befb97834a7d3ca212f724306cbe57f76167",onInput:t=>this.changePageSize(parseInt(t.target.value))},this.pageSizeOptions.map((t=>o("option",{value:t},Xh("perPage",this.language,{size:t}))))),o("div",{key:"063ca0f31a3ab170a697af945414602f95748dac",class:"jump-box"},Xh("goTo",this.language),o("input",{key:"1ec1cbf62de505ea6770c59536c41f3bbb241261",type:"number",min:"1",max:this.totalPages,value:this.current,onKeyDown:t=>{if("Enter"===t.key){const e=parseInt(t.target.value);isNaN(e)||this.goToPage(e)}},onInput:t=>{const e=t.target;parseInt(e.value)>this.totalPages&&(e.value=this.totalPages.toString()),parseInt(e.value)<1&&(e.value="1")}})))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],total:["updateTotalPages"],pageSize:["updateTotalPages"]}}};sc.style=".paginator{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.paginator .page{color:var(--emw--color-typography, #000)}button{padding:4px 8px;font-size:14px;background:var(--emw--color-background, #fff);border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:var(--emw--border-radius-small, 4px);cursor:pointer;min-width:28px;transition:all 0.2s ease}.arrow-btn{color:var(--emw--color-typography, #000)}button.active{color:#333;background:var(--emw--color-primary, #fed275);border-color:var(--emw--color-primary, #fed275);font-weight:bold}button:not(.arrow-btn):hover{background:var(--emw--color-secondary, #fff3b9);border-color:var(--emw--color-secondary, #fff3b9)}button:disabled{cursor:not-allowed;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));user-select:none}.ellipsis{font-weight:bold;color:var(--emw--color-typography, #000);border:none}select{padding:4px 8px;border-radius:4px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));font-size:14px}.jump-box{display:flex;align-items:center;gap:4px;margin-left:8px;color:var(--emw--color-typography, #000)}.jump-box input{width:50px;padding:2px 6px;font-size:14px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:4px;text-align:center}.total-num{user-select:none;font-size:14px;color:var(--emw--color-typography, #333)}";const ac=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),lc=class{constructor(e){t(this,e),this.togglePanel=()=>{this.expanded=!this.expanded},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.headerTitle=void 0,this.expanded=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}render(){return o("div",{key:"3a7acb79544c31ac93d82a2ea62ca7d343901b3f",class:"panel-container",ref:t=>this.stylingContainer=t},o("div",{key:"1c4f38f5c8df2e08dd3a33f9af45b7bc0cc1f025",class:{"panel-header":!0,active:this.expanded},onClick:this.togglePanel},o("div",{key:"6e08ac8f744bb3abbfb0148d4cc82843f13b1ea5",class:"header-content"},o("slot",{key:"b58eee18d78117db3638ed71800b40e626de7d63",name:"header"},o("span",{key:"cfc3586117731014a1511f9df19d53132580e2ac"},this.headerTitle))),o("span",{key:"41a8fb02bb96acd842668cd717909f07d02bdad2",class:"arrow "+(this.expanded?"expanded":""),innerHTML:ac})),o("div",{key:"5deb75348843b6cf12bba4c03a5defeaa82760f8",class:"panel-body "+(this.expanded?"open":"closed")},o("slot",{key:"0191d8c751a6fecaaeae237cba17e125df42b6d4",name:"content"})))}get el(){return r(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};lc.style=".panel-container{border:1px solid var(--emw--color-typography, #000);border-radius:8px;overflow:hidden;font-family:sans-serif;width:calc(100% - 4px)}.panel-header{background-color:var(--emw--color-background, #fff);padding:8px;display:flex;align-items:center;justify-content:space-between;cursor:pointer;font-size:14px}.panel-header .header-content{color:var(--emw--color-typography, #000)}.panel-header:hover{background-color:var(--emw--color-primary, #fed275)}.panel-header.active{background-color:var(--emw--color-primary, #fed275)}.header-content{white-space:nowrap;user-select:none}.arrow{transition:transform 0.3s ease;font-size:16px;display:inline-flex}.arrow.expanded{transform:rotate(180deg)}.panel-body{overflow:hidden;max-height:0;transition:max-height 0.3s ease, padding 0.3s ease;background-color:var(--emw--color-background, #fff);padding:0 12px;font-size:14px}.panel-body.open{max-height:500px;padding:10px 12px}.panel-body.closed{max-height:0;padding-top:0;padding-bottom:0}";const hc=["ro","en","fr","ar","hr"],cc={en:{homeTeam:"Home team:",awayTeam:"Away team:",selectionCleared:"Your selection has been cleared.",selectionOnLineCleared:"Your selection on this line will be cleared.",loading:"Loading...",error:"Error!",noData:"No data available.",lineInfo:"Line {currentPage} of {totalPages}",clearAll:"Clear All",cancel:"Cancel",confirm:"Confirm"},ro:{homeTeam:"Echipa gazdă:",awayTeam:"Echipa oaspete:",selectionCleared:"Selecția dvs. a fost ștearsă.",selectionOnLineCleared:"Selecția dvs. de pe această linie va fi ștearsă.",loading:"Se încarcă...',n error: 'Eroare!",noData:"Nu sunt date disponibile.",lineInfo:"Linia {currentPage} din {totalPages}",clearAll:"Șterge tot",cancel:"Anulează",confirm:"Confirmă"},fr:{homeTeam:"Équipe à domicile:",awayTeam:"Équipe à l'extérieur:",selectionCleared:"Votre sélection a été effacée.",selectionOnLineCleared:"Votre sélection sur cette ligne sera effacée.",loading:"Chargement...',n error: 'Erreur!",noData:"Aucune donnée disponible.",lineInfo:"Ligne {currentPage} sur {totalPages}",clearAll:"Tout effacer",cancel:"Annuler",confirm:"Confirmer"},ar:{homeTeam:"الفريق المضيف:",awayTeam:"الفريق الضيف:",selectionCleared:"تم مسح اختيارك.",selectionOnLineCleared:"سيتم مسح اختيارك في هذا السطر.",loading:"جار التحميل...',n error: 'خطأ!",noData:"لا توجد بيانات متاحة.",lineInfo:"السطر {currentPage} من {totalPages}",clearAll:"مسح الكل",cancel:"إلغاء",confirm:"تأكيد"},hr:{homeTeam:"Domaći tim:",awayTeam:"Gostujući tim:",selectionCleared:"Vaš odabir je obrisan.",selectionOnLineCleared:"Vaš odabir na ovoj liniji bit će obrisan.",loading:"Učitavanje...',n error: 'Greška!",noData:"Nema dostupnih podataka.",lineInfo:"Linija {currentPage} od {totalPages}",clearAll:"Očisti sve",cancel:"Odustani",confirm:"Potvrdi"}},dc=(t,e,i)=>{const o=e;let r=cc[void 0!==o&&hc.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r},uc=t=>{Object.keys(t).forEach((e=>{for(let i in t[e])cc[e][i]=t[e][i]}))},pc=[{value:"1"},{value:"X"},{value:"2"}],mc=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M328 544h152v152c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V544h152c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8H544V328c0-4.4-3.6-8-8-8h-48c-4.4 0-8 3.6-8 8v152H328c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8z"}},{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z"}}]},name:"plus-square",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),fc=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"}}]},name:"delete",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),vc=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z"}},{tag:"path",attrs:{d:"M464 336a48 48 0 1096 0 48 48 0 10-96 0zm72 112h-48c-4.4 0-8 3.6-8 8v272c0 4.4 3.6 8 8 8h48c4.4 0 8-3.6 8-8V456c0-4.4-3.6-8-8-8z"}}]},name:"info-circle",theme:"outlined"},{extraSVGAttrs:{width:"16px",height:"16px",fill:"currentColor"}}),gc=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),bc=Dt({icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"},{extraSVGAttrs:{width:"20px",height:"20px",fill:"currentColor"}}),yc=class{constructor(i){t(this,i),this.lotteryTippingBulletBetEvent=e(this,"lotteryTippingBulletBetSelect",7),this.lotteryTippingCurrentPageChangeEvent=e(this,"lotteryTippingCurrentPageChange",7),this.eventNameRender=(t,e)=>o("div",{class:"flex gap-1 eventNameContainer__item"},o("span",{class:"eventNameContainer__item--title"},e),o("general-tooltip",null,o("span",{slot:"trigger",class:"icon info-icon",innerHTML:vc,style:{width:"18px"}}),o("div",{slot:"content"},o("div",{class:"match-info"},o("div",{class:"match-info-item"},o("div",{class:"match-info-item-label"},dc("homeTeam",this.language)),o("div",{class:"match-info-item-value"},t.homeName)),o("div",{class:"match-info-item"},o("div",{class:"match-info-item-label"},dc("awayTeam",this.language)),o("div",{class:"match-info-item-value"},t.awayName)))))),this.columns=[{title:"",value:"index",width:3},{title:"",value:"eventName",width:70,render:this.eventNameRender},{title:"",value:"startTime",width:22,align:"right",nowrap:!0,render:(t,e)=>(({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}})({date:e,format:"ccc HH:mm"})},{title:()=>o("lottery-tipping-bullet-group",{theme:"text",bulletConfigContent:JSON.stringify(pc)}),value:"results",width:5,render:(t,e,i)=>{var r,n;return o("lottery-tipping-bullet-group",{mode:this.mode,bulletConfigContent:JSON.stringify(null===(n=null===(r=this.bulletConfigLineGroup)||void 0===r?void 0:r[this.currentPage-1])||void 0===n?void 0:n[i]),"position-idx":`${this.currentPage-1}-${i}`})}}],this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.translationData=void 0,this.clientStylingUrlContent="",this.sessionId=void 0,this.endpoint="",this.gameId=void 0,this.drawId=void 0,this.totalPages=void 0,this.minTotalPages=0,this.maxTotalPages=0,this.mode="multi",this.readPretty=!1,this.defaultBulletConfigLineGroup=void 0,this.bulletConfigLineGroup=[[[]]],this.currentPage=1,this.isLoading=!1,this.hasErrors=!1,this.dialogConfig={visible:!1},this.ticketDataSource=[]}handleNewTranslations(){this.isLoading=!0,uc(JSON.parse(this.translationUrl)),this.isLoading=!1}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentWillLoad(){this.translationUrl&&uc(JSON.parse(this.translationUrl))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}get parsedDefaultBulletConfigLineGroup(){if("string"==typeof this.defaultBulletConfigLineGroup&&this.defaultBulletConfigLineGroup)try{const t=JSON.parse(this.defaultBulletConfigLineGroup);return this.readPrettyHandler(t)}catch(t){return void console.error("Error parsing defaultBulletConfigLineGroup:",t)}}readPrettyHandler(t){return this.readPretty?(this.currentPage=1,this.minTotalPages=1,this.maxTotalPages=this.totalPages,null==t?void 0:t.map((t=>null==t?void 0:t.map((t=>null==t?void 0:t.map((t=>Object.assign(Object.assign({},t),{disabled:!0})))))))):t}initLineForBulletConfig(){var t;return Array.from({length:null===(t=this.ticketDataSource)||void 0===t?void 0:t.length},(()=>[...pc]))}_resetBulletConfig(){this.bulletConfigLineGroup=Array.from({length:this.totalPages}).map(this.initLineForBulletConfig.bind(this))}fetchMatchData(){let t=new URL(`${this.endpoint}/poolgames/${this.gameId}/draws/${this.drawId}/matchConfig`);this.gameId&&this.drawId&&(this.isLoading=!0,(t=>fetch(t).then((t=>t.json())))(t.href).then((t=>{this.ticketDataSource=t||[],this.isLoading=!1,this.updateBulletConfigLineGroup()})).catch((t=>{this.isLoading=!1,this.hasErrors=!0,console.error("Error!",t)})))}updateBulletConfigLineGroup(){this.parsedDefaultBulletConfigLineGroup&&this.parsedDefaultBulletConfigLineGroup.length>0?this.bulletConfigLineGroup=this.parsedDefaultBulletConfigLineGroup:this._resetBulletConfig()}connectedCallback(){this.fetchMatchData()}handleClearAll(){this._resetBulletConfig(),(({message:t,theme:e="success",renderOne:i=!1})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e,renderOne:i})})({message:dc("selectionCleared",this.language),renderOne:!0}),this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!1})}async resetBulletConfig({minLineNumber:t,maxLineNumber:e,defaultBoards:i}){this.totalPages=i,this.minTotalPages=t,this.maxTotalPages=e,this.currentPage=1,this._resetBulletConfig(),this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!1})}lotteryTippingBulletGroupSelectionHandler(t){const{bulletConfigArr:e,positionIdx:i}=t.detail,[o,r]=i.split("-");this.bulletConfigLineGroup[o][r]=e,this.bulletConfigLineGroup=[...this.bulletConfigLineGroup],this.lotteryTippingBulletBetEvent.emit({hasSelectBullet:!0})}async getData(){return await this.validateBulletConfigLineGroup(),this.bulletConfigLineGroup}validateBulletConfigLineGroup(){if("[[[]]]"===JSON.stringify(this.bulletConfigLineGroup))return Promise.resolve(this.bulletConfigLineGroup);const t=this.bulletConfigLineGroup.length;return t!==this.totalPages||t<this.minTotalPages||t>this.maxTotalPages?(this._resetBulletConfig(),Promise.reject(new Error("Invalid bullet config line group length"))):Promise.resolve(this.bulletConfigLineGroup)}prevPage(){this.swapCard("prev",(()=>{this.currentPage>1&&this.currentPage--}))}nextPage(){this.swapCard("next",(()=>{this.currentPage<this.totalPages&&this.currentPage++}))}handleAddLine(){this.swapCard("add",(()=>{this.totalPages<=this.maxTotalPages-1&&(this.bulletConfigLineGroup.push(this.initLineForBulletConfig()),this.totalPages++,this.currentPage++,this.lotteryTippingBulletBetEvent.emit())}))}handleRemoveLine(){(()=>{if(this.totalPages>=this.minTotalPages+1){const t=()=>{this.dialogConfig={visible:!1}},e=()=>{this.bulletConfigLineGroup.splice(this.currentPage-1,1),this.totalPages--,1!==this.currentPage&&this.currentPage--,this.lotteryTippingBulletBetEvent.emit(),this.swapCard("remove",t)};this.dialogConfig={visible:!0,content:dc("selectionOnLineCleared",this.language),onConfirm:e,onCancel:t}}})()}swapCard(t,e){const i=this.mainContainer;if(!i)return;const{out:o,in:r}={next:{out:"card-out-left",in:"card-in-left"},prev:{out:"card-out-right",in:"card-in-right"},remove:{out:"card-out-down",in:"card-in-right"},add:{out:"card-out-left",in:"card-in-up"}}[t];i.classList.add(o),i.addEventListener("animationend",(()=>{i.classList.remove(o),e();const t=this.mainContainer;t&&(t.classList.add(r),t.addEventListener("animationend",(()=>t.classList.remove(r)),{once:!0}))}),{once:!0})}handleCurrentPageChange(){this.lotteryTippingCurrentPageChangeEvent.emit({currentPage:this.currentPage})}renderLoading(){return o("div",{class:"loading-wrap"},o("section",{class:"dots-container"},o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"}),o("div",{class:"dot"})))}render(){var t,e,i,r;if(this.isLoading)return this.renderLoading();if(this.hasErrors)return o("div",{ref:t=>this.stylingContainer=t,class:"LotteryTippingTicketBet__container"},o("p",null,dc("error",this.language)));const n=({columns:t,dataSource:e,hideHead:i=!1,grid:r=!0,bordered:n=!0})=>o("table",{class:{bordered:n,grid:r,"my-table-component":!0}},!i&&o("thead",null,o("tr",null,t.map((t=>{var e;return o("th",{key:t.value,style:{width:t.width+"%",textAlign:t.align}},"string"==typeof t.title?t.title:null===(e=t.title)||void 0===e?void 0:e.call(t))})))),o("tbody",null,e.map(((e,i)=>o("tr",{key:i},t.map((t=>o("td",{key:t.value,style:{width:t.width+"%",textAlign:t.align},class:{"no-wrap":t.nowrap}},t.render?t.render(e,e[t.value],i):e[t.value])))))))),s=this.totalPages<this.maxTotalPages&&this.currentPage===this.totalPages,a=this.totalPages>this.minTotalPages;return 0===this.ticketDataSource.length||0===this.minTotalPages||0===this.maxTotalPages?o("div",{class:"LotteryTippingTicketBet__container",ref:t=>this.stylingContainer=t},o("div",{class:"LotteryTippingTicketBet__empty"},o("p",null,dc("noData",this.language)))):this.readPretty?o("div",{class:"LotteryTippingTicketBet__container",ref:t=>this.stylingContainer=t},o("div",{class:"LotteryTippingTicketBet__main",ref:t=>this.mainContainer=t},o(n,{columns:this.columns,dataSource:(null===(t=this.ticketDataSource)||void 0===t?void 0:t.map(((t,e)=>Object.assign(Object.assign({},t),{index:e+1}))))||[],hideHead:!1,grid:!1,bordered:!1}),this.totalPages>1&&o("div",null,o("div",{class:"border-line"}),o("div",{class:"LotteryTippingTicketBet__footer"},o("div",{class:"my-pagination flex justify-between"},o("span",null,dc("lineInfo",this.language,{currentPage:this.currentPage,totalPages:this.totalPages})),o("div",{class:"flex gap-1"},o("span",{class:"btn "+(1===this.currentPage?"disabled":""),onClick:this.prevPage.bind(this)},o("span",{class:"icon",innerHTML:gc})),o("span",{class:"btn "+(this.currentPage===this.totalPages?"disabled":""),onClick:this.nextPage.bind(this)},o("span",{class:"icon",innerHTML:bc})))))))):o("div",{ref:t=>this.stylingContainer=t,class:"LotteryTippingTicketBet__container"},o("div",{class:"LotteryTippingTicketBet__tableToolbar flex justify-end gap-1"},o("button",{class:{"LotteryTippingTicketBet__tableToolbar--item":!0,"mr-0":!(s||a)},onClick:this.handleClearAll.bind(this)},dc("clearAll",this.language))),o("div",{class:"flex align-center LotteryTippingTicketBet__main",ref:t=>this.mainContainer=t},o(n,{columns:this.columns,dataSource:(null===(e=this.ticketDataSource)||void 0===e?void 0:e.map(((t,e)=>Object.assign(Object.assign({},t),{index:e+1}))))||[],hideHead:!1,grid:!1,bordered:!1}),(s||a)&&o("div",{class:"LotteryTippingTicketBet__lineOperatorGroup"},s&&o("div",{class:{"LotteryTippingTicketBet__lineOperatorGroup--item":!0},onClick:this.handleAddLine.bind(this)},o("span",{class:"icon",innerHTML:mc})),a&&o("div",{class:{"LotteryTippingTicketBet__lineOperatorGroup--item":!0},onClick:this.handleRemoveLine.bind(this)},o("span",{class:"icon",innerHTML:fc})))),o("div",{class:"border-line"}),o("div",{class:"LotteryTippingTicketBet__footer"},o("div",{class:"my-pagination flex justify-between"},o("span",null,dc("lineInfo",this.language,{currentPage:this.currentPage,totalPages:this.totalPages})),o("div",{class:"flex gap-1"},o("span",{class:"btn "+(1===this.currentPage?"disabled":""),onClick:this.prevPage.bind(this)},o("span",{class:"icon",innerHTML:gc})),o("span",{class:"btn "+(this.currentPage===this.totalPages?"disabled":""),onClick:this.nextPage.bind(this)},o("span",{class:"icon",innerHTML:bc}))))),this.dialogConfig.visible&&o("vaadin-confirm-dialog",{rejectButtonVisible:!0,rejectText:dc("cancel",this.language),confirmText:dc("confirm",this.language),opened:null===(i=this.dialogConfig)||void 0===i?void 0:i.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(r=this.dialogConfig)||void 0===r?void 0:r.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{translationUrl:["handleNewTranslations"],clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],gameId:["fetchMatchData"],sessionId:["fetchMatchData"],drawId:["fetchMatchData"],defaultBulletConfigLineGroup:["fetchMatchData"],currentPage:["handleCurrentPageChange"]}}};var wc,xc,_c,kc;yc.style=".LotteryTippingTicketBet__container {\n display: block; /* Or inline-block, depending on desired layout flow */\n font-size: 14px;\n line-height: 1.5715;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n overflow: hidden;\n min-width: 300px;\n container-type: inline-size;\n}\n@container (max-width: 375px) {\n .LotteryTippingTicketBet__container {\n font-size: 12px;\n }\n}\n\n.table-wrapper {\n overflow-x: auto; /* Handle horizontal scroll if content overflows */\n}\n\n.my-table-component {\n width: 100%;\n border-collapse: collapse; /* Important for borders */\n text-align: left;\n border-radius: 0.1rem; /* Ant Design like subtle rounding */\n border-spacing: 0;\n}\n\n/* Header */\n.my-table-component th {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n font-weight: 500;\n padding: 0.4rem 0.5rem;\n transition: background 0.3s ease;\n}\n\n/* Cells */\n.my-table-component td {\n padding: 0.4rem 0.5rem;\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n transition: background 0.3s;\n}\n@container (max-width: 400px) {\n .my-table-component td {\n padding: 0.3rem 0.3rem;\n }\n}\n\n.my-table-component.bordered th,\n.my-table-component.bordered td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Bordered style */\n.my-table-component.grid th,\n.my-table-component.grid td {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid th {\n border-bottom-width: 1px; /* Ensure bottom border is consistent */\n}\n\n.my-table-component.grid {\n border: 1px solid var(--emw--color-gray-100, #e6e6e6); /* Outer border */\n border-right-width: 0;\n border-bottom-width: 0;\n}\n\n.my-table-component.grid th:last-child,\n.my-table-component.grid td:last-child {\n border-right: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n.my-table-component.grid tr:last-child td {\n border-bottom: 1px solid var(--emw--color-gray-100, #e6e6e6);\n}\n\n/* Striped style */\n.my-table-component.striped tbody tr:nth-child(even) td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n/* Hover (optional, but nice) */\n.my-table-component tbody tr:hover td {\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.flex {\n display: flex;\n}\n\n.justify-end {\n justify-content: flex-end;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.justify-between {\n justify-content: space-between;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 0.5rem;\n}\n\n.btn {\n color: var(--emw--color-typography, #000);\n background: var(--emw--color-background, #fff);\n font-size: 14px;\n transition: all 0.2s ease;\n}\n.btn:hover {\n cursor: pointer;\n}\n\n.btn:hover {\n background-color: var(--emw--color-gray-100, #e6e6e6);\n}\n\n.btn.disabled {\n opacity: 0.5;\n pointer-events: none;\n}\n.btn.disabled:hover {\n cursor: not-allowed !important;\n}\n\n.LotteryTippingTicketBet__tableToolbar {\n width: 100%;\n margin-bottom: 1rem;\n}\n\n.LotteryTippingTicketBet__tableToolbar--item {\n background-color: transparent;\n cursor: pointer;\n font-weight: 500;\n white-space: nowrap;\n display: inline-flex;\n border-radius: 1.6rem;\n border: 1px solid var(--emw--color-gray-100, #e6e6e6);\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n padding-left: 1rem;\n padding-right: 1rem;\n margin-right: 2rem;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketBet__tableToolbar--item.mr-0 {\n margin-right: 0rem !important;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup {\n flex-basis: 2rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n border-radius: 8px;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item {\n display: flex;\n justify-content: center;\n align-items: center;\n width: 2rem;\n height: 2rem;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n border-radius: 8px;\n transition: all 0.2s ease-in-out;\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 14px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item .icon {\n width: 20px;\n height: 20px;\n transition: filter 0.2s ease-in-out;\n filter: grayscale(0.3);\n}\n\n.LotteryTippingTicketBet__lineOperatorGroup--item:hover .icon {\n filter: grayscale(0);\n transform: rotate(3deg);\n}\n\ndiv.border-line {\n margin-top: 1rem;\n height: 1px;\n width: 100%;\n box-sizing: border-box;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n transition: all 0.3s ease;\n}\n\n.LotteryTippingTicketBet__footer {\n padding: 0.5rem;\n}\n\n.my-pagination {\n display: flex;\n justify-content: space-between;\n align-items: center;\n gap: 1rem;\n font-size: 0.8rem;\n color: var(--emw--color-typography-secondary, #333);\n}\n\n.my-pagination span {\n font-weight: 500;\n user-select: none;\n}\n\n.my-pagination .btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 2rem;\n height: 2rem;\n border-radius: 50%;\n transition: all 0.3s ease;\n cursor: pointer;\n opacity: 0.9;\n color: var(--emw--color-typography, #000);\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n}\n\n.my-pagination .btn .icon {\n width: 20px;\n height: 20px;\n transition: transform 0.2s ease;\n}\n\n.my-pagination .btn:hover {\n transform: scale(1.1);\n box-shadow: 0 6px 14px var(--emw-calender-curday-box-shadow, rgba(0, 0, 0, 0.09));\n}\n\n.my-pagination .btn.disabled {\n background-color: var(--emw--color-background-tertiary, #ccc);\n cursor: not-allowed;\n opacity: 0.5;\n transform: scale(1);\n}\n\n.match-info-item {\n display: flex;\n}\n\n.match-info-item-label {\n margin-right: 6px;\n}\n\n.info-icon:hover {\n cursor: pointer;\n}\n\n.LotteryTippingTicketBet__empty p {\n text-align: center;\n}\n\n.no-wrap {\n white-space: nowrap;\n overflow: hidden;\n}\n\n.eventNameContainer__item--title {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 300px;\n}\n@container (max-width: 600px) {\n .eventNameContainer__item--title {\n max-width: 180px;\n }\n}\n@container (max-width: 500px) {\n .eventNameContainer__item--title {\n max-width: 150px;\n }\n}\n@container (max-width: 400px) {\n .eventNameContainer__item--title {\n max-width: 100px;\n }\n}\n@container (max-width: 330px) {\n .eventNameContainer__item--title {\n max-width: 70px;\n }\n}\n\n.LotteryTippingTicketBet__main {\n perspective: 800px;\n will-change: transform, opacity;\n backface-visibility: hidden;\n}\n\n@container (max-width: 520px) {\n .LotteryTippingTicketBet__main {\n flex-wrap: wrap;\n justify-content: center;\n }\n .LotteryTippingTicketBet__tableToolbar--item {\n margin-right: 0 !important;\n }\n}\n/* Fade-In Keyframes */\n@keyframes fadeInLeft {\n from {\n opacity: 0;\n transform: translateX(100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n/* Fade-Out Keyframes */\n@keyframes fadeOut {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n}\n@keyframes fadeInRight {\n from {\n opacity: 0;\n transform: translateX(-100%);\n }\n to {\n opacity: 1;\n transform: translateX(0);\n }\n}\n@keyframes fadeInUp {\n from {\n opacity: 0;\n transform: translateY(100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n}\n@-webkit-keyframes slide-left {\n 0% {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n }\n 100% {\n -webkit-transform: translateX(-100px);\n transform: translateX(-100px);\n }\n}\n@keyframes slide-left {\n 0% {\n -webkit-transform: translateX(100%);\n transform: translateX(100%);\n }\n 100% {\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n }\n}\n@-webkit-keyframes slide-right {\n 0% {\n -webkit-transform: translateX(-100%);\n transform: translateX(-100%);\n }\n 100% {\n -webkit-transform: translateX(0px);\n transform: translateX(0px);\n }\n}\n@keyframes slide-right {\n 0% {\n -webkit-transform: translateX(-100px);\n transform: translateX(-100px);\n }\n 100% {\n -webkit-transform: translateX(0);\n transform: translateX(0);\n }\n}\n@-webkit-keyframes slide-top {\n 0% {\n -webkit-transform: translateY(-100px);\n transform: translateY(-100px);\n }\n 100% {\n -webkit-transform: translateY(0px);\n transform: translateY(0px);\n }\n}\n@keyframes slide-top {\n 0% {\n -webkit-transform: translateY(-100px);\n transform: translateY(-100px);\n }\n 100% {\n -webkit-transform: translateY(0px);\n transform: translateY(0px);\n }\n}\n/* Apply to your card classes */\n.card-in-left {\n -webkit-animation: slide-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-left 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-left {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.card-in-right {\n -webkit-animation: slide-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-right 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-right {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.card-in-up {\n -webkit-animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n animation: slide-top 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;\n}\n\n.card-out-down {\n animation: fadeOut 0.2s ease-out both;\n}\n\n.loading-wrap {\n margin: 20px 0;\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 40vh;\n}\n.loading-wrap .dots-container {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n width: 100%;\n}\n.loading-wrap .dot {\n height: 14px;\n width: 14px;\n margin-right: 14px;\n border-radius: 14px;\n background-color: var(--emw--color-gray-300, #333);\n animation: pulse 1.5s infinite ease-in-out;\n}\n.loading-wrap .dot:last-child {\n margin-right: 0;\n}\n.loading-wrap .dot:nth-child(1) {\n animation-delay: -0.3s;\n}\n.loading-wrap .dot:nth-child(2) {\n animation-delay: -0.1s;\n}\n.loading-wrap .dot:nth-child(3) {\n animation-delay: 0.1s;\n}\n@keyframes pulse {\n 0% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-300, #333);\n }\n 50% {\n transform: scale(1.2);\n background-color: var(--emw--color-gray-100, #e6e6e6);\n }\n 100% {\n transform: scale(0.8);\n background-color: var(--emw--color-gray-150, #6f6f6f);\n }\n}",function(t){t.SingleBet="SingleBet",t.SystemBet="SystemBet"}(wc||(wc={})),function(t){t.FullTime="FullTime",t.HalfTime="HalfTime",t.Both="Both"}(xc||(xc={})),function(t){t.OPEN="OPEN"}(_c||(_c={})),function(t){t.Settled="Settled",t.Purchased="Purchased",t.Canceled="Canceled"}(kc||(kc={}));const Cc=["ro","en","fr","ar","hr"],Sc={en:{stop:"Stop",at:"at",turnover:"Turnover: ",selectionCleared:"Your selection will be cleared.",ticketSubmitted:"Ticket submitted successfully.",ticketFailed:"Failed to submit tickets.",lines:"Lines",line:"Line",bettingType:"Betting Type",playingMode:"Playing Mode",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Tickets",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",cancel:"Cancel",confirm:"Confirm",stakePerLine:"Stake per Line:"},ro:{selectionCleared:"Selecția dvs. va fi ștearsă.",ticketSubmitted:"Bilet trimis cu succes.",ticketFailed:"Nu s-a putut achiziționa biletul. Vă rugăm să încercați din nou.",lines:"Linii",line:"Linie",bettingType:"Tip de pariu",playingMode:"Mod de joc",orderSummaryTitle:"Sumar comandă",orderSummaryTickets:"Bilete",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",cancel:"Anulează",confirm:"Confirmă"},fr:{selectionCleared:"Votre sélection sera effacée.",ticketSubmitted:"Billet soumis avec succès.",ticketFailed:"Échec de l'achat du billet. Veuillez réessayer.",lines:"Lignes",line:"Ligne",bettingType:"Type de pari",playingMode:"Mode de jeu",orderSummaryTitle:"Résumé de la commande",orderSummaryTickets:"Billets",orderSummaryTotal:"Total",orderSummarySubmit:"Soumettre",cancel:"Annuler",confirm:"Confirmer"},ar:{selectionCleared:"سيتم مسح اختيارك.",ticketSubmitted:"تم إرسال التذكرة بنجاح.",ticketFailed:"فشل شراء التذكرة. يرجى المحاولة مرة أخرى.",lines:"خطوط",line:"خط",bettingType:"نوع الرهان",playingMode:"وضع اللعب",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"التذاكر",orderSummaryTotal:"المجموع",orderSummarySubmit:"إرسال",cancel:"إلغاء",confirm:"تأكيد"},hr:{selectionCleared:"Vaš odabir bit će obrisan.",ticketSubmitted:"Listić je uspješno predan.",ticketFailed:"Kupnja listića nije uspjela. Molimo pokušajte ponovo.",lines:"Linije",line:"Linija",bettingType:"Vrsta oklade",playingMode:"Način igranja",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listići",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Pošalji",cancel:"Odustani",confirm:"Potvrdi"}},Tc=(t,e)=>{const i=e;return Sc[void 0!==i&&Cc.includes(i)?i:"en"][t]};function Ac(t,e="GET",i=null,o={}){return new Promise(((r,n)=>{const s="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),a=Object.assign({"Content-Type":"application/json"},o);"GET"!==e&&"HEAD"!==e&&(a["X-Idempotency-Key"]=s);const l={method:e,headers:a};i&&"GET"!==e&&"HEAD"!==e&&(l.body=JSON.stringify(i)),fetch(t,l).then((t=>{if(!t.ok)throw new Error(`HTTP error! Status: ${t.status}`);return t.json()})).then((t=>r(t))).catch((t=>n(t)))}))}const zc=({message:t,theme:e="success"})=>{window.postMessage({type:"ShowNotificationToast",message:t,theme:e})},Ic=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},Mc=["H","D","A"],Dc=(t=[])=>t.filter((t=>t.enabled)),Nc=({rawData:t,selectedBettingType:e,selectedPlayingMode:i})=>{var o,r,n,s,a,l;const h=null===(s=null===(n=null===(r=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===r?void 0:r.playTypes)||void 0===n?void 0:n.find((t=>t.bettingType===e&&t.playMode===i)))||void 0===s?void 0:s.betTypeId,c=null===(l=null===(a=null==t?void 0:t.rules)||void 0===a?void 0:a.betTypes)||void 0===l?void 0:l.find((t=>t.id===h));return{betTypeId:h,betType:c}};function Oc(t,e="€"){return null==t?"":`${e}${t?Ic(t):0}`}function Ec(t){if(!t)return"";const e=(({date:t,type:e="date",format:i})=>{try{const o=ct(t);if(isNaN(o.getTime()))throw new Error(`Invalid date: ${t}`);if(i)return ht(o,i);let r="dd/MM/yyyy";return"time"===e?r="dd/MM/yyyy HH:mm:ss":"week"===e&&(r="ccc dd/MM/yyyy HH:mm:ss"),ht(o,r)}catch(t){return console.error("Error formatting date:",t.message),""}})({date:t,format:"EEEE"});return["saturday","sunday"].includes(e.toLowerCase())?e.toUpperCase():"MIDWEEK"}const Pc="TICKET_INVALID_TOKEN",Bc=class{constructor(i){t(this,i),this.logoutEventHandler=e(this,"logout",7),this.bothBettingTypeMultiplier=2,this.onStakeChange=t=>{this.currentStake=this.getCurrentStakeByValue(t.detail.value)},this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.language="en",this.logoUrl=void 0,this.endpoint="",this.sessionId=void 0,this.gameId=void 0,this.playerId="",this.drawId=void 0,this.isLoading=!0,this.bettingTypeOptions=[],this.playingModeOptions=[],this.selectedBettingType=void 0,this.selectedPlayingMode=void 0,this.hasSelectBullet=void 0,this.hasSelectAllBullet=void 0,this.totalLineCombination=0,this.submitLoading=void 0,this.drawSubmitAvailable=!1,this.rawData={},this.saleStatisticsInfo={},this.currentStake=void 0,this.dialogConfig={visible:!1}}async getLotteryTippingBulletResults(){return await this.childRef.getData()}get lineNumberRange(){const{betType:t}=Nc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),e=(null==t?void 0:t.boardsAllowed)||[0],[i,o]=[Math.min(...e),Math.max(...e)];return{minLineNumber:i,maxLineNumber:o,defaultBoards:(null==t?void 0:t.defaultBoards)||i}}get playTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.playTypes}get betTypeConfig(){var t,e;return null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.betTypes}get isBothBettingType(){return this.selectedBettingType===xc.Both}get stakeOptions(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.stakes)||void 0===i?void 0:i.map((t=>{var e;return{value:null===(e=t.value)||void 0===e?void 0:e.toString(),label:t.value,currency:t.currency}}))}getCurrentStakeByValue(t){var e;return null===(e=this.stakeOptions)||void 0===e?void 0:e.find((e=>+e.value==+t))}initiateCurrentStake(){var t,e,i;if(1===(null===(t=this.stakeOptions)||void 0===t?void 0:t.length))this.currentStake=this.stakeOptions[0];else{const t=(i=(null===(e=this.stakeOptions)||void 0===e?void 0:e.map((t=>t.value)))||[]).length?Math.min.apply(null,i):void 0;this.currentStake=this.getCurrentStakeByValue(t)}}handleBettingTypeChange(t){var e,i,o,r;if(t===this.selectedBettingType)return;this.selectedBettingType=t;const n=(({bettingType:t,playTypeConfig:e,betTypeConfig:i,enabledPlayingModeOptions:o})=>{const r=i.filter((t=>t.enabled)).map((t=>t.id)),n=e.filter((t=>r.includes(t.betTypeId))).filter((e=>e.bettingType===t)).map((t=>t.playMode));return o.filter((t=>n.includes(t.code)))})({bettingType:this.selectedBettingType,playTypeConfig:this.playTypeConfig,betTypeConfig:this.betTypeConfig,enabledPlayingModeOptions:Dc((null===(o=null===(i=null===(e=this.rawData)||void 0===e?void 0:e.rules)||void 0===i?void 0:i.poolGame)||void 0===o?void 0:o.playModes)||[])});this.playingModeOptions=n,n.length?n.map((t=>t.code)).includes(this.selectedPlayingMode)||(this.hasSelectBullet=!1,this.handlePlayingModeChange(null===(r=n[0])||void 0===r?void 0:r.code)):this.selectedPlayingMode=void 0,this.clearBulletConfig()}async clearBulletConfig(){return await this.childRef.resetBulletConfig(this.lineNumberRange)}handlePlayingModeChange(t){if(t===this.selectedPlayingMode)return;const e=e=>{this.selectedPlayingMode=t,this.clearBulletConfig().then((()=>{null==e||e()}))};if(this.hasSelectBullet){const t=()=>{this.dialogConfig={visible:!1}},i=()=>{e(t)};this.dialogConfig={visible:!0,content:Tc("selectionCleared",this.language),onConfirm:i,onCancel:t}}else e()}lotteryTippingBulletGroupSelectionHandler(t){var e;const i=null===(e=t.detail)||void 0===e?void 0:e.hasSelectBullet;void 0!==i&&(this.hasSelectBullet=i),this.bulletBetSelectChecker()}calculateCombinationInLine(t){return t.reduce(((t,e)=>t*e),1)}calculateTotalAmount(){const t=this.currentStake;if(!t)return 0;let e=+t.value*this.totalLineCombination;return this.isBothBettingType&&(e*=this.bothBettingTypeMultiplier),e}get totalAmountFormatted(){var t;const e=this.calculateTotalAmount();return Ic(e)+" "+((null===(t=this.currentStake)||void 0===t?void 0:t.currency)||"")}get currentStakeFormatted(){const{value:t="",currency:e=""}=this.currentStake||{};return`${t} ${e}`}bulletBetSelectChecker(){(async()=>{const t=await this.getLotteryTippingBulletResults();this.hasSelectAllBullet=!(({rawResults:t})=>{const e=(({rawResults:t})=>{const e=t=>t.filter((t=>t.isSelected)).length;return t.map((t=>t.length>0?t.map(e):[0]))})({rawResults:t});this.totalLineCombination=e.reduce(((t,e)=>t+this.calculateCombinationInLine(e)),0);const{combinations:i=1,maxCombinations:o=1}=Nc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}).betType||{};return e.some((t=>{const e=this.calculateCombinationInLine(t);return e<i||e>o}))})({rawResults:t})})()}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}handleTimerStop(){this.drawSubmitAvailable=!0}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])Sc[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}connectedCallback(){(()=>{let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isLoading=!0,Ac(t.href,"GET").then((t=>{var e,i,o,r,n,s,a;this.rawData=t,this.bettingTypeOptions=Dc((null===(i=null===(e=null==t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.bettingTypes)||[]),this.playingModeOptions=Dc((null===(r=null===(o=null==t?void 0:t.rules)||void 0===o?void 0:o.poolGame)||void 0===r?void 0:r.playModes)||[]),this.initiateCurrentStake();const{bettingType:l,playMode:h}=(({playTypeConfig:t=[],betTypeConfig:e=[],enabledBettingTypeOptions:i=[],enabledPlayingModeOptions:o=[]})=>{const r=e.filter((t=>t.enabled));for(const e of r){const{bettingType:r,playMode:n}=null==t?void 0:t.find((t=>t.betTypeId===e.id));if(i.map((t=>t.code)).includes(r)&&o.map((t=>t.code)).includes(n))return{bettingType:r,playMode:n}}return{}})({playTypeConfig:null===(s=null===(n=null==t?void 0:t.rules)||void 0===n?void 0:n.poolGame)||void 0===s?void 0:s.playTypes,betTypeConfig:null===(a=null==t?void 0:t.rules)||void 0===a?void 0:a.betTypes,enabledBettingTypeOptions:this.bettingTypeOptions,enabledPlayingModeOptions:this.playingModeOptions});return this.handleBettingTypeChange(l),this.selectedPlayingMode=h,this.updateSaleStatistics()})).catch((t=>{console.error("Error!",t)})).finally((()=>{this.isLoading=!1}))})()}updateSaleStatistics(){var t;return async function({endpoint:t,gameId:e,drawId:i}){try{return await Ac(`${t}/games/${e}/draws/${i}/saleStatistics`)}catch(t){return Promise.reject(t)}}({endpoint:this.endpoint,gameId:null===(t=this.rawData)||void 0===t?void 0:t.type,drawId:this.drawId}).then((t=>{this.saleStatisticsInfo=t}))}async handleSubmit(){const t=await this.getLotteryTippingBulletResults(),{betTypeId:e,betType:i}=Nc({rawData:this.rawData,selectedBettingType:this.selectedBettingType,selectedPlayingMode:this.selectedPlayingMode}),o=new URL(`${this.endpoint}/tickets`),r=(({playerId:t,rawResults:e,gameId:i,rawData:o,amount:r,currentStake:n,betTypeId:s,betType:a})=>{var l;const h={playerId:t,tickets:[]},c=(t=>{const e=t=>t.map((t=>t.isSelected?1:0)),i=t.map((t=>t.map(e))),o=[];return i.forEach(((t,e)=>{const i=[];t.forEach(((t,e)=>{const o=t.map(((t,e)=>t?Mc[e]:null)).filter(Boolean);i[e]=[o]})),o[e]=i})),o})(e),d=n||{};return h.tickets.push({startingDrawId:null===(l=null==o?void 0:o.currentDraw)||void 0===l?void 0:l.id,amount:r,gameId:i,gameName:o.name,currency:d.currency,selection:c.map((t=>({betType:s,stake:+d.value,poolGameSelections:t,quickPick:!1,betName:a.name}))),multiplier:!1,drawCount:1,quickPick:!1}),h})({playerId:this.playerId,rawResults:t,gameId:this.gameId,rawData:this.rawData,amount:this.calculateTotalAmount().toString(),currentStake:this.currentStake,betTypeId:e,betType:i});this.submitLoading=!0,(({body:t,sessionId:e,url:i})=>{const o={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${e}`,"X-Idempotency-Key":"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))},body:JSON.stringify(t)};return fetch(i,o).then((t=>{if(401===t.status)throw new Error(Pc);if(t.status>300)throw new Error(t.statusText);return t.json().then((e=>{if(!(i=e.tickets)||!i.length||i.some((t=>t.state!==kc.Purchased)))throw new Error(t.statusText);var i;return e}))}))})({body:r,sessionId:this.sessionId,url:o.href}).then((()=>{zc({message:Tc("ticketSubmitted",this.language)}),this.clearBulletConfig(),this.updateSaleStatistics()})).catch((t=>{if(t.message===Pc)return this.logoutEventHandler.emit(),void zc({message:Pc,theme:"error"});zc({message:Tc("ticketFailed",this.language),theme:"error"})})).finally((()=>{this.submitLoading=!1}))}get lineCountRender(){const t=Ic(this.totalLineCombination);let e=Tc("lines",this.language);return[0,1].includes(+t)&&(e=Tc("line",this.language)),t+" "+e}renderBettingControls(){var t,e;const i=()=>o("div",{class:"skeleton-content"},o("div",{class:"skeleton-item skeleton-animated"})),r=()=>{var t;return o("div",null,o("vaadin-select",{items:this.stakeOptions||[],value:(null===(t=this.currentStake)||void 0===t?void 0:t.value)||"","on-value-changed":this.onStakeChange.bind(this),"no-vertical-overlap":!0}))};return o("div",{class:"LotteryTippingTicketController__top"},o("div",{class:"LotteryTippingTicketController__row"},o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Tc("bettingType",this.language)),this.bettingTypeOptions.length?(()=>o("div",{class:"LotteryTippingTicketController__segmented-control"},this.bettingTypeOptions.map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedBettingType===t.code},onClick:this.handleBettingTypeChange.bind(this,t.code)},t.name)))))():i()),o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Tc("playingMode",this.language)),this.playingModeOptions.length?(()=>o("div",{class:"LotteryTippingTicketController__segmented-control"},this.playingModeOptions.map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.selectedPlayingMode===t.code},onClick:this.handlePlayingModeChange.bind(this,t.code)},t.name)))))():i()),(null===(t=this.stakeOptions)||void 0===t?void 0:t.length)>1&&o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Tc("stakePerLine",this.language)),r()),(null===(e=this.stakeOptions)||void 0===e?void 0:e.length)>1&&o("div",{class:"LotteryTippingTicketController__section"},o("span",{class:"LotteryTippingTicketController__label"},Tc("stakePerLine",this.language)),r())))}renderOrderSummary(){var t;return o("div",{class:"LotteryTippingTicketController__main--right order-summary"},o("h3",{class:"order-summary__title"},Tc("orderSummaryTitle",this.language)),o("div",{class:"order-summary__ticket-info"},o("div",{class:"order-summary__ticket"},Tc("orderSummaryTickets",this.language),":"),o("div",{class:"order-summary__details"},o("span",{class:"order-summary__line-count"},this.lineCountRender),o("div",null,this.currentStake&&o("span",{class:"order-summary__multiplier"},"x"),o("span",{class:"order-summary__stake"},this.currentStakeFormatted)),this.isBothBettingType&&o("div",null,o("span",{class:"order-summary__multiplier"},"x"),o("span",{class:"order-summary__stake"},this.bothBettingTypeMultiplier)))),o("hr",{class:"order-summary__divider"}),o("div",{class:"order-summary__ticket-info"},o("div",{class:"order-summary__ticket"},Tc("orderSummaryTotal",this.language),":"),o("span",{class:"order-summary__details"},this.totalAmountFormatted)),o("div",{class:"order-summary__button-wrapper"},o("lottery-button",{onClick:this.handleSubmit.bind(this),loading:this.submitLoading,disabled:!this.hasSelectAllBullet||this.submitLoading||void 0===(null===(t=this.currentStake)||void 0===t?void 0:t.value)||!this.drawSubmitAvailable,text:Tc("orderSummarySubmit",this.language)})))}render(){var t,e,i,r,n,s,a,l,h,c,d;return o("div",{key:"fe8bfb6644f45cc594f600d71f1f1f587e8b8b3a",class:"lottery-tipping-ticket-controller__container",ref:t=>this.stylingContainer=t},o("lottery-banner",{key:"5cae10f59f4395d9cf18090c3f8186672b5939be","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl,stopTime:null===(e=null===(t=this.rawData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.wagerCloseTime,startTime:null===(r=null===(i=this.rawData)||void 0===i?void 0:i.currentDraw)||void 0===r?void 0:r.wagerStartTime,"banner-title":Ec(null===(s=null===(n=this.rawData)||void 0===n?void 0:n.currentDraw)||void 0===s?void 0:s.date),turnover:Oc(null===(l=null===(a=this.saleStatisticsInfo)||void 0===a?void 0:a.wagerSegment)||void 0===l?void 0:l.totalSalesCrossDraw),language:this.language,"translation-url":this.translationUrl,"logo-url":this.logoUrl,onLotteryBannerTimerStop:this.handleTimerStop.bind(this)}),this.renderBettingControls(),o("div",{key:"ee895e3c508c0271165fae39285db9e1ec7465a0",class:"flex flex-wrap LotteryTippingTicketController__main"},o("div",{key:"e605083e867607e4fd606c2144eb7dd8bab1b3cf",class:"LotteryTippingTicketController__main--left"},o("lottery-tipping-ticket-bet",{key:"955218a174ee29b217e89fcf1248ba5614999823",ref:t=>this.childRef=t,endpoint:this.endpoint,"session-id":this.sessionId,"game-id":null===(h=this.rawData)||void 0===h?void 0:h.type,"draw-id":this.drawId,language:this.language,"translation-url":this.translationUrl,"max-total-pages":this.lineNumberRange.maxLineNumber,"min-total-pages":this.lineNumberRange.minLineNumber,"total-pages":this.lineNumberRange.defaultBoards,mode:this.selectedPlayingMode===wc.SingleBet?"single":"multi","client-styling":this.clientStyling,"client-styling-Url":this.clientStylingUrl})),this.renderOrderSummary()),this.dialogConfig.visible&&o("vaadin-confirm-dialog",{key:"ee05caa2dc238aed34c55ff9e66f05aeb7c61456",rejectButtonVisible:!0,rejectText:Tc("cancel",this.language),confirmText:Tc("confirm",this.language),opened:null===(c=this.dialogConfig)||void 0===c?void 0:c.visible,onConfirm:this.dialogConfig.onConfirm,onReject:this.dialogConfig.onCancel},null===(d=this.dialogConfig)||void 0===d?void 0:d.content))}static get assetsDirs(){return["../static"]}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};Bc.style=".lottery-tipping-ticket-controller__container {\n display: block;\n box-sizing: border-box;\n font-size: 14px;\n container-type: inline-size;\n background: var(--emw--color-background, #fff);\n}\n@container (max-width: 375px) {\n .lottery-tipping-ticket-controller__container {\n font-size: 12px;\n }\n}\n\n.LotteryTippingTicketController__top {\n padding: 1.8rem;\n display: flex;\n flex-direction: column;\n gap: 2rem;\n margin: 0 auto;\n max-width: 800px;\n}\n.LotteryTippingTicketController__row {\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__section {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.LotteryTippingTicketController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n color: var(--emw--color-typography-secondary, #333);\n}\n.LotteryTippingTicketController__segmented-control {\n height: 2.2rem;\n display: inline-flex;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 2rem;\n padding: 0.2rem;\n}\n.LotteryTippingTicketController__segment {\n background-color: transparent;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n transition: background-color 0.25s ease, color 0.25s ease;\n white-space: nowrap;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketController__segment--active {\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n}\n.LotteryTippingTicketController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.flex {\n display: flex;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.LotteryTippingTicketController__main {\n align-items: flex-start;\n justify-content: center;\n gap: 2rem;\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 20px;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__main--left {\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n padding: 1rem;\n border-radius: 1rem;\n flex: 1.5;\n}\n.LotteryTippingTicketController__main--right {\n padding: 1rem;\n border-radius: 1rem;\n flex: 1;\n}\n\n.order-summary {\n max-width: 360px;\n width: 100%;\n background: var(--emw--color-background, #fff);\n}\n\n.order-summary__title {\n margin-bottom: 16px;\n text-align: center;\n color: var(--emw--color-typography, #000);\n text-transform: uppercase;\n}\n\n.order-summary__ticket-info {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 10px;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__ticket {\n font-weight: 500;\n width: 50px;\n text-align: right;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__details {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__multiplier {\n color: var(--emw--color-typography-secondary, #333);\n margin: 0 8px;\n}\n\n.order-summary__divider {\n border: none;\n border-top: 1px solid var(--emw--color-gray-100, #e6e6e6);\n margin: 20px 0;\n}\n\n.order-summary__button-wrapper {\n display: flex;\n justify-content: center;\n}\n\n.order-summary__button {\n cursor: pointer;\n padding: 0.8rem 4rem;\n background: var(--emw--color-primary, #fed275);\n color: var(--emw--color-typography, #000);\n border-radius: var(--emw--button-border-radius, 4px);\n border: none;\n position: relative;\n}\n\n.loading-icon {\n position: absolute;\n right: 40px;\n top: 10px;\n}\n\n.order-summary__button:not(.order-summary__button--disabled):not(.order-summary__button--loading):hover {\n transform: translateY(-1px);\n background: var(--emw--color-primary-variant, #ffe66f);\n}\n\n.order-summary__button--loading {\n background: var(--emw--color-primary-variant, #ffe66f);\n cursor: not-allowed;\n}\n\n.order-summary__button--disabled {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n cursor: not-allowed;\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}";var jc,Lc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},$c={exports:{}};jc=$c,function(t){
|
|
6658
6658
|
/*!
|
|
6659
6659
|
* decimal.js v10.6.0
|
|
6660
6660
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
@@ -6662,4 +6662,4 @@ ci("vaadin-tabs",Xt`
|
|
|
6662
6662
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
6663
6663
|
* MIT Licence
|
|
6664
6664
|
*/
|
|
6665
|
-
var e,i,o,r,n=9e15,s=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-n,maxE:n,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",g=Math.floor,b=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,k=1e7,C=7,S=l.length-1,T=h.length-1,A={toStringTag:v};function z(t){var e,i,o,r=t.length-1,n="",s=t[0];if(r>0){for(n+=s,e=1;e<r;e++)(i=C-(o=t[e]+"").length)&&(n+=$(i)),n+=o;(i=C-(o=(s=t[e])+"").length)&&(n+=$(i))}else if(0===s)return"0";for(;s%10==0;)s/=10;return n+s}function I(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function M(t,e,i,o){var r,n,s,a;for(n=t[0];n>=10;n/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),n=b(10,C-e),a=t[r]%n|0,null==o?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):s=(i<4&&a+1==n||i>3&&a+1==n/2)&&(t[r+1]/n/100|0)==b(10,e-2)-1||(a==n/2||0==a)&&!(t[r+1]/n/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(o||i<4)&&9999==a||!o&&i>3&&4999==a):s=((o||i<4)&&a+1==n||!o&&i>3&&a+1==n/2)&&(t[r+1]/n/1e3|0)==b(10,e-3)-1,s}function D(t,e,i){for(var o,r,n=[0],s=0,l=t.length;s<l;){for(r=n.length;r--;)n[r]*=e;for(n[0]+=a.indexOf(t.charAt(s++)),o=0;o<n.length;o++)n[o]>i-1&&(void 0===n[o+1]&&(n[o+1]=0),n[o+1]+=n[o]/i|0,n[o]%=i)}return n.reverse()}A.absoluteValue=A.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),O(t)},A.ceil=function(){return O(new this.constructor(this),this.e+1,2)},A.clampedTo=A.clamp=function(t,e){var i=this,o=i.constructor;if(t=new o(t),e=new o(e),!t.s||!e.s)return new o(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new o(i)},A.comparedTo=A.cmp=function(t){var e,i,o,r,n=this,s=n.d,a=(t=new n.constructor(t)).d,l=n.s,h=t.s;if(!s||!a)return l&&h?l!==h?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-h:0;if(l!==h)return l;if(n.e!==t.e)return n.e>t.e^l<0?1:-1;for(e=0,i=(o=s.length)<(r=a.length)?o:r;e<i;++e)if(s[e]!==a[e])return s[e]>a[e]^l<0?1:-1;return o===r?0:o>r^l<0?1:-1},A.cosine=A.cos=function(){var t,e,i=this,o=i.constructor;return i.d?i.d[0]?(e=o.rounding,o.precision=(t=o.precision)+Math.max(i.e,i.sd())+C,o.rounding=1,i=function(t,e){var i,o,r;if(e.isZero())return e;(o=e.d.length)<32?r=(1/J(4,i=Math.ceil(o/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var n=i;n--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=i,e}(o,X(o,i)),o.precision=t,o.rounding=e,O(2==r||3==r?i.neg():i,t,e,!0)):new o(1):new o(NaN)},A.cubeRoot=A.cbrt=function(){var t,e,i,o,r,n,s,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(n=c.s*b(c.s*c,1/3))&&Math.abs(n)!=1/0?o=new u(n.toString()):(i=z(c.d),(n=((t=c.e)-i.length+1)%3)&&(i+=1==n||-2==n?"0":"00"),n=b(i,1/3),t=g((t+1)/3)-(t%3==(t<0?-1:2)),(o=new u(i=n==1/0?"5e"+t:(i=n.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),s=(t=u.precision)+3;;)if(h=(l=(a=o).times(a).times(a)).plus(c),o=N(h.plus(c).times(a),h.plus(l),s+2,1),z(a.d).slice(0,s)===(i=z(o.d)).slice(0,s)){if("9999"!=(i=i.slice(s-3,s+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(O(o,t+1,1),e=!o.times(o).times(o).eq(c));break}if(!r&&(O(a,t+1,0),a.times(a).times(a).eq(c))){o=a;break}s+=4,r=1}return d=!0,O(o,t,u.rounding,e)},A.decimalPlaces=A.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-g(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},A.dividedBy=A.div=function(t){return N(this,new this.constructor(t))},A.dividedToIntegerBy=A.divToInt=function(t){var e=this.constructor;return O(N(this,new e(t),0,1,1),e.precision,e.rounding)},A.equals=A.eq=function(t){return 0===this.cmp(t)},A.floor=function(){return O(new this.constructor(this),this.e+1,3)},A.greaterThan=A.gt=function(t){return this.cmp(t)>0},A.greaterThanOrEqualTo=A.gte=function(t){var e=this.cmp(t);return 1==e||0===e},A.hyperbolicCosine=A.cosh=function(){var t,e,i,o,r,n=this,s=n.constructor,a=new s(1);if(!n.isFinite())return new s(n.s?1/0:NaN);if(n.isZero())return a;o=s.rounding,s.precision=(i=s.precision)+Math.max(n.e,n.sd())+4,s.rounding=1,(r=n.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),n=Y(s,1,n.times(e),new s(1),!0);for(var l,h=t,c=new s(8);h--;)l=n.times(n),n=a.minus(l.times(c.minus(l.times(c))));return O(n,s.precision=i,s.rounding=o,!0)},A.hyperbolicSine=A.sinh=function(){var t,e,i,o,r=this,n=r.constructor;if(!r.isFinite()||r.isZero())return new n(r);if(i=n.rounding,n.precision=(e=n.precision)+Math.max(r.e,r.sd())+4,n.rounding=1,(o=r.d.length)<3)r=Y(n,2,r,r,!0);else{t=1.4*Math.sqrt(o),r=Y(n,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var s,a=new n(5),l=new n(16),h=new n(20);t--;)s=r.times(r),r=r.times(a.plus(s.times(l.times(s).plus(h))))}return n.precision=e,n.rounding=i,O(r,e,i,!0)},A.hyperbolicTangent=A.tanh=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+7,o.rounding=1,N(i.sinh(),i.cosh(),o.precision=t,o.rounding=e)):new o(i.s)},A.inverseCosine=A.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),o=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?j(e,o,r):new e(0):new e(NaN):t.isZero()?j(e,o+4,r).times(.5):(e.precision=o+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=o,e.rounding=r,t.times(2))},A.inverseHyperbolicCosine=A.acosh=function(){var t,e,i=this,o=i.constructor;return i.lte(1)?new o(i.eq(1)?0:NaN):i.isFinite()?(e=o.rounding,o.precision=(t=o.precision)+Math.max(Math.abs(i.e),i.sd())+4,o.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,o.precision=t,o.rounding=e,i.ln()):new o(i)},A.inverseHyperbolicSine=A.asinh=function(){var t,e,i=this,o=i.constructor;return!i.isFinite()||i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,o.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,o.precision=t,o.rounding=e,i.ln())},A.inverseHyperbolicTangent=A.atanh=function(){var t,e,i,o,r=this,n=r.constructor;return r.isFinite()?r.e>=0?new n(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=n.precision,e=n.rounding,o=r.sd(),Math.max(o,t)<2*-r.e-1?O(new n(r),t,e,!0):(n.precision=i=o-r.e,r=N(r.plus(1),new n(1).minus(r),i+t,1),n.precision=t+4,n.rounding=1,r=r.ln(),n.precision=t,n.rounding=e,r.times(.5))):new n(NaN)},A.inverseSine=A.asin=function(){var t,e,i,o,r=this,n=r.constructor;return r.isZero()?new n(r):(e=r.abs().cmp(1),i=n.precision,o=n.rounding,-1!==e?0===e?((t=j(n,i+4,o).times(.5)).s=r.s,t):new n(NaN):(n.precision=i+6,n.rounding=1,r=r.div(new n(1).minus(r.times(r)).sqrt().plus(1)).atan(),n.precision=i,n.rounding=o,r.times(2)))},A.inverseTangent=A.atan=function(){var t,e,i,o,r,n,s,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(s=j(c,u+4,p).times(.25)).s=h.s,s}else{if(!h.s)return new c(NaN);if(u+4<=T)return(s=j(c,u+4,p).times(.5)).s=h.s,s}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),o=1,l=h.times(h),s=new c(h),r=h;-1!==t;)if(r=r.times(l),n=s.minus(r.div(o+=2)),r=r.times(l),void 0!==(s=n.plus(r.div(o+=2))).d[e])for(t=e;s.d[t]===n.d[t]&&t--;);return i&&(s=s.times(2<<i-1)),d=!0,O(s,c.precision=u,c.rounding=p,!0)},A.isFinite=function(){return!!this.d},A.isInteger=A.isInt=function(){return!!this.d&&g(this.e/C)>this.d.length-2},A.isNaN=function(){return!this.s},A.isNegative=A.isNeg=function(){return this.s<0},A.isPositive=A.isPos=function(){return this.s>0},A.isZero=function(){return!!this.d&&0===this.d[0]},A.lessThan=A.lt=function(t){return this.cmp(t)<0},A.lessThanOrEqualTo=A.lte=function(t){return this.cmp(t)<1},A.logarithm=A.log=function(t){var e,i,o,r,n,s,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)n=!0;else{for(r=i[0];r%10==0;)r/=10;n=1!==r}if(d=!1,s=H(h,a=u+5),o=e?B(c,a+10):H(t,a),M((l=N(s,o,a,1)).d,r=u,p))do{if(s=H(h,a+=10),o=e?B(c,a+10):H(t,a),l=N(s,o,a,1),!n){+z(l.d).slice(r+1,r+15)+1==1e14&&(l=O(l,u+1,0));break}}while(M(l.d,r+=10,p));return d=!0,O(l,u,p)},A.minus=A.sub=function(t){var e,i,o,r,n,s,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?O(t,a,l):t}if(i=g(t.e/C),c=g(m.e/C),h=h.slice(),n=c-i){for((u=n<0)?(e=h,n=-n,s=p.length):(e=p,i=c,s=h.length),n>(o=Math.max(Math.ceil(a/C),s)+2)&&(n=o,e.length=1),e.reverse(),o=n;o--;)e.push(0);e.reverse()}else{for((u=(o=h.length)<(s=p.length))&&(s=o),o=0;o<s;o++)if(h[o]!=p[o]){u=h[o]<p[o];break}n=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),o=p.length-(s=h.length);o>0;--o)h[s++]=0;for(o=p.length;o>n;){if(h[--o]<p[o]){for(r=o;r&&0===h[--r];)h[r]=k-1;--h[r],h[o]+=k}h[o]-=p[o]}for(;0===h[--s];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=P(h,i),d?O(t,a,l):t):new f(3===l?-0:0)},A.modulo=A.mod=function(t){var e,i=this,o=i.constructor;return t=new o(t),!i.d||!t.s||t.d&&!t.d[0]?new o(NaN):!t.d||i.d&&!i.d[0]?O(new o(i),o.precision,o.rounding):(d=!1,9==o.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,o.modulo,1),e=e.times(t),d=!0,i.minus(e))},A.naturalExponential=A.exp=function(){return V(this)},A.naturalLogarithm=A.ln=function(){return H(this)},A.negated=A.neg=function(){var t=new this.constructor(this);return t.s=-t.s,O(t)},A.plus=A.add=function(t){var e,i,o,r,n,s,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?O(t,a,l):t;if(n=g(u.e/C),o=g(t.e/C),h=h.slice(),r=n-o){for(r<0?(i=h,r=-r,s=c.length):(i=c,o=n,s=h.length),r>(s=(n=Math.ceil(a/C))>s?n+1:s+1)&&(r=s,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((s=h.length)-(r=c.length)<0&&(r=s,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/k|0,h[r]%=k;for(e&&(h.unshift(e),++o),s=h.length;0==h[--s];)h.pop();return t.d=h,t.e=P(h,o),d?O(t,a,l):t},A.precision=A.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=L(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},A.round=function(){var t=this,e=t.constructor;return O(new e(t),t.e+1,e.rounding)},A.sine=A.sin=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+Math.max(i.e,i.sd())+C,o.rounding=1,i=function(t,e){var i,o=e.d.length;if(o<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(o),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,n=new t(5),s=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(n.plus(r.times(s.times(r).minus(a))));return e}(o,X(o,i)),o.precision=t,o.rounding=e,O(r>2?i.neg():i,t,e,!0)):new o(NaN)},A.squareRoot=A.sqrt=function(){var t,e,i,o,r,n,s=this,a=s.d,l=s.e,h=s.s,c=s.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?s:1/0);for(d=!1,0==(h=Math.sqrt(+s))||h==1/0?(((e=z(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=g((l+1)/2)-(l<0||l%2),o=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):o=new c(h.toString()),i=(l=c.precision)+3;;)if(o=(n=o).plus(N(s,n,i+2,1)).times(.5),z(n.d).slice(0,i)===(e=z(o.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(O(o,l+1,1),t=!o.times(o).eq(s));break}if(!r&&(O(n,l+1,0),n.times(n).eq(s))){o=n;break}i+=4,r=1}return d=!0,O(o,l,c.rounding,t)},A.tangent=A.tan=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+10,o.rounding=1,(i=i.sin()).s=1,i=N(i,new o(1).minus(i.times(i)).sqrt(),t+10,0),o.precision=t,o.rounding=e,O(2==r||4==r?i.neg():i,t,e,!0)):new o(NaN)},A.times=A.mul=function(t){var e,i,o,r,n,s,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=g(c.e/C)+g(t.e/C),(l=p.length)<(h=m.length)&&(n=p,p=m,m=n,s=l,l=h,h=s),n=[],o=s=l+h;o--;)n.push(0);for(o=h;--o>=0;){for(e=0,r=l+o;r>o;)a=n[r]+m[o]*p[r-o-1]+e,n[r--]=a%k|0,e=a/k|0;n[r]=(n[r]+e)%k|0}for(;!n[--s];)n.pop();return e?++i:n.shift(),t.d=n,t.e=P(n,i),d?O(t,u.precision,u.rounding):t},A.toBinary=function(t,e){return K(this,2,t,e)},A.toDecimalPlaces=A.toDP=function(t,e){var i=this,o=i.constructor;return i=new o(i),void 0===t?i:(I(t,0,s),void 0===e?e=o.rounding:I(e,0,8),O(i,t+i.e+1,e))},A.toExponential=function(t,e){var i,o=this,r=o.constructor;return void 0===t?i=E(o,!0):(I(t,0,s),void 0===e?e=r.rounding:I(e,0,8),i=E(o=O(new r(o),t+1,e),!0,t+1)),o.isNeg()&&!o.isZero()?"-"+i:i},A.toFixed=function(t,e){var i,o,r=this,n=r.constructor;return void 0===t?i=E(r):(I(t,0,s),void 0===e?e=n.rounding:I(e,0,8),i=E(o=O(new n(r),t+r.e+1,e),!1,t+o.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},A.toFraction=function(t){var e,i,o,r,n,s,a,l,h,c,u,m,f=this,v=f.d,g=f.constructor;if(!v)return new g(f);if(h=i=new g(1),o=l=new g(0),n=(e=new g(o)).e=L(v)-f.e-1,e.d[0]=b(10,(s=n%C)<0?C+s:s),null==t)t=n>0?e:h;else{if(!(a=new g(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?n>0?e:h:a}for(d=!1,a=new g(z(v)),c=g.precision,g.precision=n=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(o))).cmp(t);)i=o,o=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),o,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(o)),l.s=h.s=f.s,m=N(h,o,n,1).minus(f).abs().cmp(N(l,i,n,1).minus(f).abs())<1?[h,o]:[l,i],g.precision=c,d=!0,m},A.toHexadecimal=A.toHex=function(t,e){return K(this,16,t,e)},A.toNearest=function(t,e){var i=this,o=i.constructor;if(i=new o(i),null==t){if(!i.d)return i;t=new o(1),e=o.rounding}else{if(t=new o(t),void 0===e?e=o.rounding:I(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,O(i)):(t.s=i.s,i=t),i},A.toNumber=function(){return+this},A.toOctal=function(t,e){return K(this,8,t,e)},A.toPower=A.pow=function(t){var e,i,o,r,n,s,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(b(+a,h));if((a=new l(a)).eq(1))return a;if(o=l.precision,n=l.rounding,t.eq(1))return O(a,o,n);if((e=g(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=F(l,a,i,o),t.s<0?new l(1).div(r):O(r,o,n);if((s=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(e=0!=(i=b(+a,h))&&isFinite(i)?new l(i+"").e:g(h*(Math.log("0."+z(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=V(t.times(H(a,o+i)),o)).d&&M((r=O(r,o+5,1)).d,o,n)&&+z((r=O(V(t.times(H(a,(e=o+10)+i)),e),e+5,1)).d).slice(o+1,o+15)+1==1e14&&(r=O(r,o+1,0)),r.s=s,d=!0,l.rounding=n,O(r,o,n))},A.toPrecision=function(t,e){var i,o=this,r=o.constructor;return void 0===t?i=E(o,o.e<=r.toExpNeg||o.e>=r.toExpPos):(I(t,1,s),void 0===e?e=r.rounding:I(e,0,8),i=E(o=O(new r(o),t,e),t<=o.e||o.e<=r.toExpNeg,t)),o.isNeg()&&!o.isZero()?"-"+i:i},A.toSignificantDigits=A.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(I(t,1,s),void 0===e?e=i.rounding:I(e,0,8)),O(new i(this),t,e)},A.toString=function(){var t=this,e=t.constructor,i=E(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},A.truncated=A.trunc=function(){return O(new this.constructor(this),this.e+1,1)},A.valueOf=A.toJSON=function(){var t=this,e=t.constructor,i=E(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var o,r=0,n=t.length;for(t=t.slice();n--;)t[n]=(o=t[n]*e+r)%i|0,r=o/i|0;return r&&t.unshift(r),t}function e(t,e,i,o){var r,n;if(i!=o)n=i>o?1:-1;else for(r=n=0;r<i;r++)if(t[r]!=e[r]){n=t[r]>e[r]?1:-1;break}return n}function o(t,e,i,o){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*o+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,n,s,a,l,h){var c,d,u,p,m,f,v,b,y,w,x,_,S,T,A,z,I,M,D,N,E=r.constructor,P=r.s==n.s?1:-1,B=r.d,j=n.d;if(!(B&&B[0]&&j&&j[0]))return new E(r.s&&n.s&&(B?!j||B[0]!=j[0]:j)?B&&0==B[0]||!j?0*P:P/0:NaN);for(h?(m=1,d=r.e-n.e):(h=k,d=g(r.e/(m=C))-g(n.e/m)),D=j.length,I=B.length,w=(y=new E(P)).d=[],u=0;j[u]==(B[u]||0);u++);if(j[u]>(B[u]||0)&&d--,null==s?(T=s=E.precision,a=E.rounding):T=l?s+(r.e-n.e)+1:s,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==D){for(p=0,j=j[0],T++;(u<I||p)&&T--;u++)w[u]=(A=p*h+(B[u]||0))/j|0,p=A%j|0;f=p||u<I}else{for((p=h/(j[0]+1)|0)>1&&(j=t(j,p,h),B=t(B,p,h),D=j.length,I=B.length),z=D,_=(x=B.slice(0,D)).length;_<D;)x[_++]=0;(N=j.slice()).unshift(0),M=j[0],j[1]>=h/2&&++M;do{p=0,(c=e(j,x,D,_))<0?(S=x[0],D!=_&&(S=S*h+(x[1]||0)),(p=S/M|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(j,p,h),x,b=v.length,_=x.length))&&(p--,o(v,D<b?N:j,b,h))):(0==p&&(c=p=1),v=j.slice()),(b=v.length)<_&&v.unshift(0),o(x,v,_,h),-1==c&&(c=e(j,x,D,_=x.length))<1&&(p++,o(x,D<_?N:j,_,h)),_=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[_++]=B[z]||0:(x=[B[z]],_=1)}while((z++<I||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,O(y,l?s+y.e+1:s,a,f)}return y}}();function O(t,e,i,o){var r,n,s,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((n=e-r)<0)n+=C,l=(c=u[p=0])/b(10,r-(s=e)-1)%10|0;else if((p=Math.ceil((n+1)/C))>=(a=u.length)){if(!o)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,s=(n%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(s=(n%=C)-C+r)<0?0:c/b(10,r-s-1)%10|0}if(o=o||e<0||void 0!==u[p+1]||(s<0?c:c%b(10,r-s-1)),h=i<4?(l||o)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||o||6==i&&(n>0?s>0?c/b(10,r-s):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=b(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==n?(u.length=p,a=1,p--):(u.length=p+1,a=b(10,C-n),u[p]=s>0?(c/b(10,r-s)%b(10,s)|0)*a:0),h)for(;;){if(0==p){for(n=1,s=u[0];s>=10;s/=10)n++;for(s=u[0]+=a,a=1;s>=10;s/=10)a++;n!=a&&(t.e++,u[0]==k&&(u[0]=1));break}if(u[p]+=a,u[p]!=k)break;u[p--]=0,a=1}for(n=u.length;0===u[--n];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function E(t,e,i){if(!t.isFinite())return W(t);var o,r=t.e,n=z(t.d),s=n.length;return e?(i&&(o=i-s)>0?n=n.charAt(0)+"."+n.slice(1)+$(o):s>1&&(n=n.charAt(0)+"."+n.slice(1)),n=n+(t.e<0?"e":"e+")+t.e):r<0?(n="0."+$(-r-1)+n,i&&(o=i-s)>0&&(n+=$(o))):r>=s?(n+=$(r+1-s),i&&(o=i-r-1)>0&&(n=n+"."+$(o))):((o=r+1)<s&&(n=n.slice(0,o)+"."+n.slice(o)),i&&(o=i-s)>0&&(r+1===s&&(n+="."),n+=$(o))),n}function P(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function B(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return O(new t(l),e,1,!0)}function j(t,e,i){if(e>T)throw Error(m);return O(new t(h),e,i,!0)}function L(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function $(t){for(var e="";t--;)e+="0";return e}function F(t,e,i,o){var r,n=new t(1),s=Math.ceil(o/C+4);for(d=!1;;){if(i%2&&Z((n=n.times(e)).d,s)&&(r=!0),0===(i=g(i/2))){i=n.d.length-1,r&&0===n.d[i]&&++n.d[i];break}Z((e=e.times(e)).d,s)}return d=!0,n}function R(t){return 1&t.d[t.d.length-1]}function U(t,e,i){for(var o,r,n=new t(e[0]),s=0;++s<e.length;){if(!(r=new t(e[s])).s){n=r;break}((o=n.cmp(r))===i||0===o&&n.s===i)&&(n=r)}return n}function V(t,e){var i,o,r,n,s,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=o=Math.log(b(2,u))/Math.LN10*2+5|0,i=n=s=new p(1),p.precision=l;;){if(n=O(n.times(t),l,1),i=i.times(++c),z((a=s.plus(N(n,i,l,1))).d).slice(0,l)===z(s.d).slice(0,l)){for(r=u;r--;)s=O(s.times(s),l,1);if(null!=e)return p.precision=f,s;if(!(h<3&&M(s.d,l-o,m,h)))return O(s,p.precision=f,m,d=!0);p.precision=l+=10,i=n=a=new p(1),c=0,h++}s=a}}function H(t,e){var i,o,r,n,s,a,l,h,c,u,p,m=1,f=t,v=f.d,g=f.constructor,b=g.rounding,y=g.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new g(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,g.precision=c+=10,o=(i=z(v)).charAt(0),!(Math.abs(n=f.e)<15e14))return h=B(g,c+2,y).times(n+""),f=H(new g(o+"."+i.slice(1)),c-10).plus(h),g.precision=y,null==e?O(f,y,b,d=!0):f;for(;o<7&&1!=o||1==o&&i.charAt(1)>3;)o=(i=z((f=f.times(t)).d)).charAt(0),m++;for(n=f.e,o>1?(f=new g("0."+i),n++):f=new g(o+"."+i.slice(1)),u=f,l=s=f=N(f.minus(1),f.plus(1),c,1),p=O(f.times(f),c,1),r=3;;){if(s=O(s.times(p),c,1),z((h=l.plus(N(s,new g(r),c,1))).d).slice(0,c)===z(l.d).slice(0,c)){if(l=l.times(2),0!==n&&(l=l.plus(B(g,c+2,y).times(n+""))),l=N(l,new g(m),c,1),null!=e)return g.precision=y,l;if(!M(l.d,c-10,b,a))return O(l,g.precision=y,b,d=!0);g.precision=c+=10,h=s=f=N(u.minus(1),u.plus(1),c,1),p=O(f.times(f),c,1),r=a=1}l=h,r+=2}}function W(t){return String(t.s*t.s/0)}function q(t,e){var i,o,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(i<0&&(i=o),i+=+e.slice(o+1),e=e.substring(0,o)):i<0&&(i=e.length),o=0;48===e.charCodeAt(o);o++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(o,r)){if(r-=o,t.e=i=i-o-1,t.d=[],o=(i+1)%C,i<0&&(o+=C),o<r){for(o&&t.d.push(+e.slice(0,o)),r-=C;o<r;)t.d.push(+e.slice(o,o+=C));e=e.slice(o),o=C-e.length}else o-=r;for(;o--;)e+="0";t.d.push(+e),d&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function G(t,i){var o,r,n,s,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),_.test(i))return q(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))o=16,i=i.toLowerCase();else if(y.test(i))o=2;else{if(!x.test(i))throw Error(p+i);o=8}for((s=i.search(/p/i))>0?(h=+i.slice(s+1),i=i.substring(2,s)):i=i.slice(2),s=i.indexOf("."),r=t.constructor,(a=s>=0)&&(s=(l=(i=i.replace(".","")).length)-s,n=F(r,new r(o),s,2*s)),s=u=(c=D(i,o,k)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=P(c,u),t.d=c,d=!1,a&&(t=N(t,n,4*l)),h&&(t=t.times(Math.abs(h)<54?b(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,o,r){var n,s,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(o);;){if(s=N(a.times(l),new t(e++*e++),h,1),a=r?o.plus(s):o.minus(s),o=N(s.times(l),new t(e++*e++),h,1),void 0!==(s=a.plus(o)).d[c]){for(n=c;s.d[n]===a.d[n]&&n--;);if(-1==n)break}n=a,a=o,o=s,s=n}return d=!0,s.d.length=c+1,s}function J(t,e){for(var i=t;--e;)i*=t;return i}function X(t,e){var i,o=e.s<0,n=j(t,t.precision,1),s=n.times(.5);if((e=e.abs()).lte(s))return r=o?4:1,e;if((i=e.divToInt(n)).isZero())r=o?3:2;else{if((e=e.minus(i.times(n))).lte(s))return r=R(i)?o?2:3:o?4:1,e;r=R(i)?o?1:4:o?3:2}return e.minus(n).abs()}function K(t,e,o,r){var n,l,h,c,d,u,p,m,f,v=t.constructor,g=void 0!==o;if(g?(I(o,1,s),void 0===r?r=v.rounding:I(r,0,8)):(o=v.precision,r=v.rounding),t.isFinite()){for(g?(n=2,16==e?o=4*o-3:8==e&&(o=3*o-2)):n=e,(h=(p=E(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=D(E(f),10,n),f.e=f.d.length),l=d=(m=D(p,10,n)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,o,r,0,n)).d,l=t.e,u=i),h=m[o],c=n/2,u=u||void 0!==m[o+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[o-1]||r===(t.s<0?8:7)),m.length=o,u)for(;++m[--o]>n-1;)m[o]=0,o||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(g){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=D(p,n,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=g?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=W(t);return t.s<0?"-"+p:p}function Z(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function ot(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function nt(t){return new this(t).atan()}function st(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,o=this.precision,r=this.rounding,n=o+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?j(this,o,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=j(this,n,1).times(.5)).s=t.s:e.s<0?(this.precision=n,this.rounding=1,i=this.atan(N(t,e,n,1)),e=j(this,n,1),this.precision=o,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,n,1)):(i=j(this,n,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return O(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,o,r=!0===t.defaults,a=["precision",1,s,"rounding",0,8,"toExpNeg",-n,0,"toExpPos",0,n,"maxE",0,n,"minE",-n,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(o=t[i])){if(!(g(o)===o&&o>=a[e+1]&&o<=a[e+2]))throw Error(p+i+": "+o);this[i]=o}if(i="crypto",r&&(this[i]=c[i]),void 0!==(o=t[i])){if(!0!==o&&!1!==o&&0!==o&&1!==o)throw Error(p+i+": "+o);if(o){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return O(t=new this(t),t.e+1,3)}function gt(){var t,e,i=new this(0);for(d=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function bt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function _t(t){return new this(t).log(10)}function kt(){return U(this,arguments,-1)}function Ct(){return U(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function At(t,e){return new this(t).pow(e)}function zt(t){var e,i,o,r,n=0,a=new this(1),l=[];if(void 0===t?t=this.precision:I(t,1,s),o=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(o));n<o;)(r=e[n])>=429e7?e[n]=crypto.getRandomValues(new Uint32Array(1))[0]:l[n++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(o*=4);n<o;)(r=e[n]+(e[n+1]<<8)+(e[n+2]<<16)+((127&e[n+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,n):(l.push(r%1e7),n+=4);n=o/4}else for(;n<o;)l[n++]=1e7*Math.random()|0;for(o=l[--n],t%=C,o&&t&&(r=b(10,C-t),l[n]=(o/r|0)*r);0===l[n];n--)l.pop();if(n<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(o=1,r=l[0];r>=10;r/=10)o++;o<C&&(i-=C-o)}return a.e=i,a.d=l,a}function It(t){return O(t=new this(t),t.e+1,this.rounding)}function Mt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Dt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Ot(t){return new this(t).sqrt()}function Et(t,e){return new this(t).sub(e)}function Pt(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,O(i,this.precision,this.rounding)}function Bt(t){return new this(t).tan()}function jt(t){return new this(t).tanh()}function Lt(t){return O(t=new this(t),t.e+1,1)}e=function t(e){var i,o,r;function n(t){var e,i,o,r=this;if(!(r instanceof n))return new n(t);if(r.constructor=n,bt(t))return r.s=t.s,void(d?!t.d||t.e>n.maxE?(r.e=NaN,r.d=null):t.e<n.minE?(r.e=0,r.d=[0]):(r.e=t.e,r.d=t.d.slice()):(r.e=t.e,r.d=t.d?t.d.slice():t.d));if("number"==(o=typeof t)){if(0===t)return r.s=1/t<0?-1:1,r.e=0,void(r.d=[0]);if(t<0?(t=-t,r.s=-1):r.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(d?e>n.maxE?(r.e=NaN,r.d=null):e<n.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[t]):(r.e=e,r.d=[t]))}return 0*t!=0?(t||(r.s=NaN),r.e=NaN,void(r.d=null)):q(r,t.toString())}if("string"===o)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),_.test(t)?q(r,t):G(r,t);if("bigint"===o)return t<0?(t=-t,r.s=-1):r.s=1,q(r,t.toString());throw Error(p+t)}if(n.prototype=A,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=dt,n.clone=t,n.isDecimal=bt,n.abs=Q,n.acos=tt,n.acosh=et,n.add=it,n.asin=ot,n.asinh=rt,n.atan=nt,n.atanh=st,n.atan2=at,n.cbrt=lt,n.ceil=ht,n.clamp=ct,n.cos=ut,n.cosh=pt,n.div=mt,n.exp=ft,n.floor=vt,n.hypot=gt,n.ln=yt,n.log=wt,n.log10=_t,n.log2=xt,n.max=kt,n.min=Ct,n.mod=St,n.mul=Tt,n.pow=At,n.random=zt,n.round=It,n.sign=Mt,n.sin=Dt,n.sinh=Nt,n.sqrt=Ot,n.sub=Et,n.sum=Pt,n.tan=Bt,n.tanh=jt,n.trunc=Lt,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(o=r[i++])||(e[o]=this[o]);return n.config(e),n}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),Pc.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(A[Symbol.for("nodejs.util.inspect.custom")]=A.toString,A[Symbol.toStringTag]="Decimal"),Pc.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),o=t.Decimal,e.noConflict=function(){return t.Decimal=o,e},t.Decimal=e)}(Bc);const Lc=jc.exports;var $c;!function(t){t.WON="Won",t.LOST="Lost"}($c||($c={}));const Fc=class{constructor(i){t(this,i),this.logout=e(this,"logout",7),this.ticketTypeMap={NORMAL:"Normal",SYNDICATE:"Syndicate",SUBSCRIPTION:"Subscription"},this.resultMap={[$c.WON]:"Win",[$c.LOST]:"Lose"},this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,o=t.currency;if(i&&"None"!==i){const r=new Lc(t.amount);if(e.has(i)){const t=e.get(i),n=t.amount.plus(r);e.set(i,{amount:n,currency:o,times:t.times+1})}else e.set(i,{amount:r,currency:o,times:1})}}));const i=[];for(let[t,o]of e.entries()){const e=o.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:o.currency,times:o.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId="",this.drawId=void 0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.ticketHistory=[],this.activeStatus="",this.statusOptions=void 0,this.isLoading=!0,this.rawData={},this.filterData={offset:0,limit:10,state:"",from:"",to:"",wagerType:"",vendorGameType:"PoolGame",vendorGameBettingObject:"HomeDrawAway",id:""},this.paginationInfo={current:1,total:0,pageSize:10},this.quickFiltersActive=!1,this.showCurrentTicketLine=!1,this.curTicketItem=void 0,this.curSelection=[],this.curSelectionIdx=0,this.showCurrentDrawResult=!1,this.curDrawItem=void 0,this.curDrawSelection=[],this.curDrawSelectionBettingType=void 0,this.curDrawSelectionMap={}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}async fetchGameData(){var t;try{let t=new URL(`${this.endpoint}/games/${this.gameId}`);const e=await Yh(t.href,"GET");this.rawData=e}catch(e){Qh({message:null!==(t=e.message)&&void 0!==t?t:e,theme:"error"})}}connectedCallback(){this.endpoint&&this.gameId&&this.fetchGameData()}handleGameInfoChange(t,e){t&&t!=e&&this.fetchGameData()}handleTicketInfoChange(t,e){t&&t!=e&&this.fetchTicketList()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async fetchTicketList(){this.isLoading=!0;try{const{items:t,total:e}=await Yh(`${this.endpoint}/tickets${function(t){const e={};Object.entries(t).forEach((([t,i])=>{Jh(i,!0)||(e[t]=i)}));const i=Object.entries(e).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&");return i?`?${i}`:""}(this.filterData)}`,"GET",null,{Authorization:`Bearer ${this.sessionId}`});this.ticketHistory=t,this.paginationInfo.total=e,t.length>0&&this.getDrawResult()}catch(t){console.log("in fetchTicketList error is: ",t),401===t.status&&(Qh({message:t.message,theme:"error"}),this.logout.emit())}finally{this.isLoading=!1}}async fetchDrawResult(t,e){try{return await Yh(`${this.endpoint}/games/${t}/draws/${e}`,"GET",{})}catch(t){console.log(t)}}getDivision(t,e){var i;let o=t.division,r=null===(i=e.prizes)||void 0===i?void 0:i.filter((t=>t.order===o));return r&&r.length?r[0].division:null}async getDrawResult(){const t=new Map;this.ticketHistory.forEach(((e,i)=>{e.drawResults.forEach(((o,r)=>{const n=`${o.drawId}-${e.gameId}`;t.has(n)?t.get(n).indices.push({ticketIndex:i,drawIndex:r}):t.set(n,{drawId:o.drawId,gameId:e.gameId,indices:[{ticketIndex:i,drawIndex:r}]})}))}));let e=[...this.ticketHistory];await Promise.all(Array.from(t.values()).map((async({gameId:t,drawId:i,indices:o})=>{try{const r=await this.fetchDrawResult(t,i);r&&o.forEach((({ticketIndex:t,drawIndex:i})=>{const o=Object.assign(Object.assign({},e[t].drawResults[i]),{tempDrawData:Object.assign(Object.assign({},r),{vendorGameId:e[t].vendorGameId}),prizeDetails:this.displayPrizeCategory(e[t].drawResults[i].details)}),n=[...e[t].drawResults];n[i]=o,e[t]=Object.assign(Object.assign({},e[t]),{drawResults:n})}))}catch(e){console.error(`failed to fetch draw result (gameId: ${t}, drawId: ${i}):`,e)}}))),this.ticketHistory=e}componentWillLoad(){this.translationUrl&&qh(JSON.parse(this.translationUrl)),this.statusOptions=[{label:Wh("settled",this.language),value:"Settled"},{label:Wh("purchased",this.language),value:"Purchased"},{label:Wh("canceled",this.language),value:"Canceled"}],this.fetchTicketList()}changeStatus(t){this.activeStatus=t,this.filterData.state=t,this.quickFiltersActive=!0,this.fetchTicketList()}handlePageSizeChange(t){this.filterData.limit=t.detail,this.fetchTicketList()}handlePageChange(t){this.filterData.offset=(t.detail-1)*this.filterData.limit,this.fetchTicketList()}handleShowTicketLineDetial(t){this.curSelectionIdx=0,this.showCurrentTicketLine=!0,this.curTicketItem=t,this.curSelection=this.parseSelection()}handleShowCurrentDraw(t){this.showCurrentDrawResult=!0,this.curDrawItem=t,this.curDrawSelectionBettingType=t.winningNumbers[0].winning_type,this.curDrawItem.winningNumbers.forEach((t=>{this.curDrawSelectionMap[t.winning_type]=[Kh(t.numbers)]})),this.curDrawSelection=this.curDrawSelectionMap[this.curDrawSelectionBettingType]}parseSelection(){const t=[];return this.curTicketItem.selection.forEach(((e,i)=>{t[i]=Kh(e.selections)})),t}handleFilterChange(t){const e=t.detail;this.filterData.from=e.filterFromCalendar,this.filterData.to=e.filterToCalendar,this.filterData.id=e.ticketId,this.filterData.wagerType=e.ticketType,this.fetchTicketList()}handleFilterClear(){this.activeStatus="",this.quickFiltersActive=!1,this.filterData={offset:0,limit:10,state:"",from:"",to:"",wagerType:"",vendorGameType:"PoolGame",vendorGameBettingObject:"HomeDrawAway",id:""},this.fetchTicketList()}get playTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.playTypes}get bettingTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.bettingTypes}getBettingType(t){var e;return null!==(e=this.playTypeConfig.find((e=>e.betTypeId===t)).bettingType)&&void 0!==e?e:""}handlePoolGameCurrentPageChange(t){const{currentPage:e}=t.detail;this.curSelectionIdx=e-1}handleDrawBettingTypeChange(t){this.curDrawSelectionBettingType=t,this.curDrawSelection=this.curDrawSelectionMap[this.curDrawSelectionBettingType]}getBettingTypeName(t){var e,i;const o=null===(i=null===(e=this.bettingTypeConfig)||void 0===e?void 0:e.find((e=>e.code===t)))||void 0===i?void 0:i.name;return null!=o?o:t}render(){return o("div",{key:"8b5cf7b807d86f60585333f6e1ad908c27e69d2d",class:"lottery-tipping-ticket-history",ref:t=>this.stylingContainer=t},o("div",{key:"5d5b27c8663171c205fa542fa8cabaf43a8e9868",class:"ticket-history-title"},Wh("ticketsHistory",this.language)),o("div",{key:"80a725f121d8ae43918655645b539386523f2c5b",class:"filter-wrap"},o("div",{key:"ddfbecf52c2b34ff65a0a1eb1c4461e2ec4adb83",class:"filter-status"},this.statusOptions.map((t=>o("div",{class:"filter-status-btn"+(this.activeStatus==t.value?" active":""),onClick:()=>this.changeStatus(t.value)},t.label)))),o("div",{key:"d7af5f48131401c38ed5e47526cf8a0b66bf7ed5",class:"filter-operation"},o("lottery-tipping-filter",{key:"6cb80e892227bb0cca2231dbd01c967e39f00057","quick-filters-active":this.quickFiltersActive,language:this.language,"translation-url":this.translationUrl}))),this.isLoading&&o("div",{key:"9b1ded95022c5eff5963d81eea67c3f6a915033e",class:"loading-wrap"},o("section",{key:"731d40f195f1cba224b792d250e9f9e4b86b61ae",class:"dots-container"},o("div",{key:"0b5c88b5c231045760c8951e02b828f8539168ac",class:"dot"}),o("div",{key:"e534a45e4b666ec35cefc3a709cc0b9bcb6ddd56",class:"dot"}),o("div",{key:"4adae575af1bcaa438f50fe0fa9ca1a5c8ea8c73",class:"dot"}),o("div",{key:"27c4cc688611722d858436bb857d2435d3bb57f9",class:"dot"}),o("div",{key:"acd88b2c9756ef9c7dff629fd9d238d63128e63c",class:"dot"}))),!this.isLoading&&this.paginationInfo.total>0&&o("div",{key:"9afe2101cbafb68c1d0a648ccf85d7df497ea5bc",class:"ticket-list-wrap"},this.ticketHistory.map((t=>o("lottery-tipping-panel",{"header-title":ht(new Date(t.createdAt),"dd/MM/yyyy HH:mm:ss")+" "+t.state},o("div",{class:"panel-content",slot:"content"},o("div",{class:"ticket-info"},o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Wh("ticketId",this.language)),o("div",{class:"ticket-info-val"},t.id," ")),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Wh("ticketType",this.language)),o("div",{class:"ticket-info-val"},this.ticketTypeMap[t.wagerType]," ")),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Wh("ticketAmount",this.language)),o("div",{class:"ticket-info-val"},`${t.amount} ${t.currency}`)),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Wh("lineDetail",this.language)),o("div",{class:"ticket-info-val"},o("span",{class:"show-detail-link",onClick:()=>this.handleShowTicketLineDetial(t)},Wh("seeDetails",this.language)))),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Wh("numberOfDraw",this.language)),o("div",{class:"ticket-info-val"},t.drawCount))),"Settled"==t.state&&t.drawResults.map((t=>o("div",{class:"draw-info-container"},t.tempDrawData?o("div",{class:"draw-info"},o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Wh("ticketResult",this.language)),o("div",{class:"draw-info-val"},this.resultMap[t.state])),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Wh("drawId",this.language)),o("div",{class:"draw-info-val"},t.drawId)),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Wh("drawDate",this.language)),o("div",{class:"draw-info-val"},ht(new Date(t.tempDrawData.date),"dd/MM/yyyy"))),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Wh("result",this.language)),o("div",{class:"draw-info-val"},o("span",{class:"show-detail-link",onClick:()=>this.handleShowCurrentDraw(t.tempDrawData)},Wh("seeDetails",this.language)))),t.state===$c.WON&&o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Wh("prize",this.language)),o("div",{class:"draw-info-val1"},o("div",{style:{height:"20px"}}),t.prizeDetails.map((t=>o("span",null,o("div",null,o("span",{style:{color:"rgb(85, 85, 85)"}},t.prizeName,t.times>1?" x "+t.times:"",":"," "),o("span",{style:{"margin-right":"4px",color:"rgb(85, 85, 85)"}},function(t){if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}(t.amount)),o("span",{style:{color:"rgb(85, 85, 85)"}},t.currency)))))))):o("div",{class:"draw-info-skeleton"},[...Array(5)].map((()=>o("div",{class:"skeleton-line"})))))))))))),!this.isLoading&&0===this.paginationInfo.total&&o("div",{key:"5de413a3747c7928d9dae3a817337a6f014f0b17",class:"empty-wrap"},Wh("noData",this.language)),o("lottery-tipping-dialog",{key:"f11f915d619c10d836427105090e861b74931d56",visible:this.showCurrentTicketLine,width:Zh(window.navigator.userAgent)?void 0:"720px",fullscreen:Zh(window.navigator.userAgent),closable:!0,showFooter:!1,onCancel:()=>{this.showCurrentTicketLine=!1},language:this.language,"translation-url":this.translationUrl},this.curSelection&&this.curSelection.length&&this.showCurrentTicketLine&&o("div",{key:"899c2830647dcee4be611199a4bc42af78588894"},o("div",{key:"5671d9815195d631026f6ed43400a0b79b43f828",class:"betting-type"},o("div",{key:"842a5226b1f304ad23ab26081428e5bbd814671f",class:"betting-type-title"},Wh("bettingType",this.language)),o("div",{key:"9028c66fca47e8ca7e7d054154361fcca56a9b22",class:"betting-type-text"},this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))),o("lottery-tipping-ticket-bet",{key:"3df8c748aeb165eadf68ec631ede5ef6a11ae42a",endpoint:this.endpoint,"session-id":this.sessionId,"game-id":this.curTicketItem.vendorGameId,"draw-id":this.curTicketItem.startingDrawId,"default-bullet-config-line-group":JSON.stringify(this.curSelection),"read-pretty":!0,"total-pages":this.curSelection.length,language:this.language,"translation-url":this.translationUrl}))),o("lottery-tipping-dialog",{key:"3f3dc5b9922890c11104ca55120b3fa029378f78",visible:this.showCurrentDrawResult,width:Zh(window.navigator.userAgent)?void 0:"720px",fullscreen:Zh(window.navigator.userAgent),closable:!0,showFooter:!1,onCancel:()=>{this.showCurrentDrawResult=!1},language:this.language,"translation-url":this.translationUrl},this.curDrawSelection&&this.curDrawSelection.length&&this.showCurrentDrawResult&&o("div",{key:"348359e4256d86c47f0cb2cfe936a669f6f7c0e8"},o("div",{key:"98ed4f468d1a1a4b237c1cfc776fcb990f69fdcf",class:"betting-type"},o("div",{key:"2ba8e6723d1259aefd74900d82dbf3968325f944",class:"betting-type-title"},Wh("bettingType",this.language)),o("div",{key:"7ae55771416badb3c4746bd37353d956362241f8",class:"betting-type-text"},o("div",{key:"998242980ce53ff0ca9ef509bb45e62d3680fd73",class:"LotteryTippingTicketController__segmented-control"},Object.keys(this.curDrawSelectionMap).map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.curDrawSelectionBettingType===t},onClick:()=>this.handleDrawBettingTypeChange(t)},this.getBettingTypeName(t))))))),o("lottery-tipping-ticket-bet",{key:"57c44eb7624411a20dade3b41251285a214e4b8c",endpoint:this.endpoint,"session-id":this.sessionId,"game-id":this.curDrawItem.vendorGameId,"draw-id":this.curDrawItem.id,"default-bullet-config-line-group":JSON.stringify(this.curDrawSelection),"read-pretty":!0,"total-pages":this.curDrawSelection.length,language:this.language,"translation-url":this.translationUrl}))),o("div",{key:"296c91bff848ca5f2ab5fe9df414ffd3b03aef58",class:"pagination-wrap"},o("lottery-tipping-pagination",{key:"3495c8c81cf96dd28aad9a79b963d94877c8db01",total:this.paginationInfo.total,current:this.paginationInfo.current,"page-size":this.paginationInfo.pageSize,language:this.language,"translation-url":this.translationUrl})))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],gameId:["handleGameInfoChange"],endpoint:["handleGameInfoChange"],playerId:["handleTicketInfoChange"],sessionId:["handleTicketInfoChange"]}}};Fc.style="@keyframes skeleton-loading{0%{background-position:200% 0}100%{background-position:-200% 0}}.lottery-tipping-ticket-history{padding:12px}.lottery-tipping-ticket-history .ticket-history-title{margin:20px 0;text-align:center;font-size:20px;font-weight:700;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .ticket-info{display:flex;flex-direction:column;gap:12px}.lottery-tipping-ticket-history .ticket-info-item{display:flex;align-items:center;user-select:none}.lottery-tipping-ticket-history .ticket-info-label{margin-right:12px;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .ticket-info-val{color:var(--emw--color-typography-secondary, #555)}.lottery-tipping-ticket-history .ticket-list-wrap{display:flex;flex-direction:column;gap:12px}.lottery-tipping-ticket-history .draw-info-skeleton{width:30%;min-width:300px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:5px;display:flex;flex-direction:column;gap:10px;padding:10px}.lottery-tipping-ticket-history .skeleton-line{height:16px;border-radius:4px;background:linear-gradient(90deg, var(--emw--color-gray-100, #e6e6e6) 25%, var(--emw--color-gray-50, #f5f5f5) 50%, var(--emw--color-gray-100, #e6e6e6) 75%);background-size:200% 100%;animation:skeleton-loading 1.2s infinite}.lottery-tipping-ticket-history .draw-info{width:30%;min-width:300px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:5px;padding:12px;margin-top:20px;display:flex;flex-direction:column;gap:8px;user-select:none}.lottery-tipping-ticket-history .draw-info-item{display:flex}.lottery-tipping-ticket-history .draw-info-label{margin-right:6px;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .draw-info-val{color:var(--emw--color-typography-secondary, #555)}.lottery-tipping-ticket-history .show-detail-link{color:var(--emw-pool-game-acition-normal, #4a90e2);text-decoration:underline;cursor:pointer}.lottery-tipping-ticket-history .filter-wrap{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center}.lottery-tipping-ticket-history .filter-wrap .filter-status{display:flex;gap:12px;align-items:center}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn{background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #fed275);border-radius:4px;padding:10px 8px;font-size:12px;text-transform:uppercase;color:var(--emw--color-typography, #000);cursor:pointer;transition:all 0.2s linear}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn:hover{background-color:var(--emw--color-secondary, #fff3b9)}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn.active{background:var(--emw--color-secondary, #fff3b9);color:var(--emw--color-typography, #000);border:2px solid var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .pagination-wrap{margin-top:20px;display:flex;justify-content:flex-end}@media screen and (min-width: 1200px){.lottery-tipping-ticket-history{padding:24px;width:60%;margin:0 auto}}@media screen and (max-width: 480px){.lottery-tipping-ticket-history{padding:2px}.lottery-tipping-ticket-history .filter-wrap .filter-status{gap:4px}}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:40vh}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);box-shadow:0 0 0 0 var(--emw-pool-game-ticket-history-loading-box-shadow-normal, rgba(178, 212, 252, 0.7))}50%{transform:scale(1.2);background-color:var(--emw-pool-game-ticket-history-loading-active, #6793fb);box-shadow:0 0 0 10px var(--emw-pool-game-ticket-history-loading-box-shadow-active, rgba(178, 212, 252, 0))}100%{transform:scale(0.8);background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);box-shadow:0 0 0 0 rgba(178, 212, 252, 0.7)}}.empty-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:40vh;color:var(--emw--color-typography, #000)}.betting-type{margin-bottom:16px;display:flex;align-items:center;gap:20px}.betting-type-title{font-weight:600;font-size:16px}.betting-type-text{font-size:16px}.LotteryTippingTicketController__label{font-weight:500;white-space:nowrap;width:6rem;color:var(--emw--color-typography-secondary, #333)}.LotteryTippingTicketController__segmented-control{height:2.2rem;display:inline-flex;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:2rem;padding:0.2rem}.LotteryTippingTicketController__segment{background-color:transparent;border:none;padding:0.3rem 0.8rem;cursor:pointer;font-weight:500;border-radius:2rem;outline:none;transition:background-color 0.25s ease, color 0.25s ease;white-space:nowrap;color:var(--emw--color-typography, #000)}.LotteryTippingTicketController__segment--active{background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-weight:600}.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover{background-color:var(--emw--color-background-tertiary, #ccc)}";export{l as general_multi_select,h as general_tooltip,_t as lottery_banner,St as lottery_button,Tt as lottery_tipping_bullet,At as lottery_tipping_bullet_group,Dt as lottery_tipping_dialog,Gh as lottery_tipping_filter,tc as lottery_tipping_pagination,sc as lottery_tipping_panel,gc as lottery_tipping_ticket_bet,Ec as lottery_tipping_ticket_controller,Fc as lottery_tipping_ticket_history}
|
|
6665
|
+
var e,i,o,r,n=9e15,s=1e9,a="0123456789abcdef",l="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",h="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",c={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-n,maxE:n,crypto:!1},d=!0,u="[DecimalError] ",p=u+"Invalid argument: ",m=u+"Precision limit exceeded",f=u+"crypto unavailable",v="[object Decimal]",g=Math.floor,b=Math.pow,y=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,w=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,x=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,_=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,k=1e7,C=7,S=l.length-1,T=h.length-1,A={toStringTag:v};function z(t){var e,i,o,r=t.length-1,n="",s=t[0];if(r>0){for(n+=s,e=1;e<r;e++)(i=C-(o=t[e]+"").length)&&(n+=$(i)),n+=o;(i=C-(o=(s=t[e])+"").length)&&(n+=$(i))}else if(0===s)return"0";for(;s%10==0;)s/=10;return n+s}function I(t,e,i){if(t!==~~t||t<e||t>i)throw Error(p+t)}function M(t,e,i,o){var r,n,s,a;for(n=t[0];n>=10;n/=10)--e;return--e<0?(e+=C,r=0):(r=Math.ceil((e+1)/C),e%=C),n=b(10,C-e),a=t[r]%n|0,null==o?e<3?(0==e?a=a/100|0:1==e&&(a=a/10|0),s=i<4&&99999==a||i>3&&49999==a||5e4==a||0==a):s=(i<4&&a+1==n||i>3&&a+1==n/2)&&(t[r+1]/n/100|0)==b(10,e-2)-1||(a==n/2||0==a)&&!(t[r+1]/n/100|0):e<4?(0==e?a=a/1e3|0:1==e?a=a/100|0:2==e&&(a=a/10|0),s=(o||i<4)&&9999==a||!o&&i>3&&4999==a):s=((o||i<4)&&a+1==n||!o&&i>3&&a+1==n/2)&&(t[r+1]/n/1e3|0)==b(10,e-3)-1,s}function D(t,e,i){for(var o,r,n=[0],s=0,l=t.length;s<l;){for(r=n.length;r--;)n[r]*=e;for(n[0]+=a.indexOf(t.charAt(s++)),o=0;o<n.length;o++)n[o]>i-1&&(void 0===n[o+1]&&(n[o+1]=0),n[o+1]+=n[o]/i|0,n[o]%=i)}return n.reverse()}A.absoluteValue=A.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),O(t)},A.ceil=function(){return O(new this.constructor(this),this.e+1,2)},A.clampedTo=A.clamp=function(t,e){var i=this,o=i.constructor;if(t=new o(t),e=new o(e),!t.s||!e.s)return new o(NaN);if(t.gt(e))throw Error(p+e);return i.cmp(t)<0?t:i.cmp(e)>0?e:new o(i)},A.comparedTo=A.cmp=function(t){var e,i,o,r,n=this,s=n.d,a=(t=new n.constructor(t)).d,l=n.s,h=t.s;if(!s||!a)return l&&h?l!==h?l:s===a?0:!s^l<0?1:-1:NaN;if(!s[0]||!a[0])return s[0]?l:a[0]?-h:0;if(l!==h)return l;if(n.e!==t.e)return n.e>t.e^l<0?1:-1;for(e=0,i=(o=s.length)<(r=a.length)?o:r;e<i;++e)if(s[e]!==a[e])return s[e]>a[e]^l<0?1:-1;return o===r?0:o>r^l<0?1:-1},A.cosine=A.cos=function(){var t,e,i=this,o=i.constructor;return i.d?i.d[0]?(e=o.rounding,o.precision=(t=o.precision)+Math.max(i.e,i.sd())+C,o.rounding=1,i=function(t,e){var i,o,r;if(e.isZero())return e;(o=e.d.length)<32?r=(1/J(4,i=Math.ceil(o/3))).toString():(i=16,r="2.3283064365386962890625e-10"),t.precision+=i,e=Y(t,1,e.times(r),new t(1));for(var n=i;n--;){var s=e.times(e);e=s.times(s).minus(s).times(8).plus(1)}return t.precision-=i,e}(o,X(o,i)),o.precision=t,o.rounding=e,O(2==r||3==r?i.neg():i,t,e,!0)):new o(1):new o(NaN)},A.cubeRoot=A.cbrt=function(){var t,e,i,o,r,n,s,a,l,h,c=this,u=c.constructor;if(!c.isFinite()||c.isZero())return new u(c);for(d=!1,(n=c.s*b(c.s*c,1/3))&&Math.abs(n)!=1/0?o=new u(n.toString()):(i=z(c.d),(n=((t=c.e)-i.length+1)%3)&&(i+=1==n||-2==n?"0":"00"),n=b(i,1/3),t=g((t+1)/3)-(t%3==(t<0?-1:2)),(o=new u(i=n==1/0?"5e"+t:(i=n.toExponential()).slice(0,i.indexOf("e")+1)+t)).s=c.s),s=(t=u.precision)+3;;)if(h=(l=(a=o).times(a).times(a)).plus(c),o=N(h.plus(c).times(a),h.plus(l),s+2,1),z(a.d).slice(0,s)===(i=z(o.d)).slice(0,s)){if("9999"!=(i=i.slice(s-3,s+1))&&(r||"4999"!=i)){+i&&(+i.slice(1)||"5"!=i.charAt(0))||(O(o,t+1,1),e=!o.times(o).times(o).eq(c));break}if(!r&&(O(a,t+1,0),a.times(a).times(a).eq(c))){o=a;break}s+=4,r=1}return d=!0,O(o,t,u.rounding,e)},A.decimalPlaces=A.dp=function(){var t,e=this.d,i=NaN;if(e){if(i=((t=e.length-1)-g(this.e/C))*C,t=e[t])for(;t%10==0;t/=10)i--;i<0&&(i=0)}return i},A.dividedBy=A.div=function(t){return N(this,new this.constructor(t))},A.dividedToIntegerBy=A.divToInt=function(t){var e=this.constructor;return O(N(this,new e(t),0,1,1),e.precision,e.rounding)},A.equals=A.eq=function(t){return 0===this.cmp(t)},A.floor=function(){return O(new this.constructor(this),this.e+1,3)},A.greaterThan=A.gt=function(t){return this.cmp(t)>0},A.greaterThanOrEqualTo=A.gte=function(t){var e=this.cmp(t);return 1==e||0===e},A.hyperbolicCosine=A.cosh=function(){var t,e,i,o,r,n=this,s=n.constructor,a=new s(1);if(!n.isFinite())return new s(n.s?1/0:NaN);if(n.isZero())return a;o=s.rounding,s.precision=(i=s.precision)+Math.max(n.e,n.sd())+4,s.rounding=1,(r=n.d.length)<32?e=(1/J(4,t=Math.ceil(r/3))).toString():(t=16,e="2.3283064365386962890625e-10"),n=Y(s,1,n.times(e),new s(1),!0);for(var l,h=t,c=new s(8);h--;)l=n.times(n),n=a.minus(l.times(c.minus(l.times(c))));return O(n,s.precision=i,s.rounding=o,!0)},A.hyperbolicSine=A.sinh=function(){var t,e,i,o,r=this,n=r.constructor;if(!r.isFinite()||r.isZero())return new n(r);if(i=n.rounding,n.precision=(e=n.precision)+Math.max(r.e,r.sd())+4,n.rounding=1,(o=r.d.length)<3)r=Y(n,2,r,r,!0);else{t=1.4*Math.sqrt(o),r=Y(n,2,r=r.times(1/J(5,t=t>16?16:0|t)),r,!0);for(var s,a=new n(5),l=new n(16),h=new n(20);t--;)s=r.times(r),r=r.times(a.plus(s.times(l.times(s).plus(h))))}return n.precision=e,n.rounding=i,O(r,e,i,!0)},A.hyperbolicTangent=A.tanh=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+7,o.rounding=1,N(i.sinh(),i.cosh(),o.precision=t,o.rounding=e)):new o(i.s)},A.inverseCosine=A.acos=function(){var t=this,e=t.constructor,i=t.abs().cmp(1),o=e.precision,r=e.rounding;return-1!==i?0===i?t.isNeg()?j(e,o,r):new e(0):new e(NaN):t.isZero()?j(e,o+4,r).times(.5):(e.precision=o+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=o,e.rounding=r,t.times(2))},A.inverseHyperbolicCosine=A.acosh=function(){var t,e,i=this,o=i.constructor;return i.lte(1)?new o(i.eq(1)?0:NaN):i.isFinite()?(e=o.rounding,o.precision=(t=o.precision)+Math.max(Math.abs(i.e),i.sd())+4,o.rounding=1,d=!1,i=i.times(i).minus(1).sqrt().plus(i),d=!0,o.precision=t,o.rounding=e,i.ln()):new o(i)},A.inverseHyperbolicSine=A.asinh=function(){var t,e,i=this,o=i.constructor;return!i.isFinite()||i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+2*Math.max(Math.abs(i.e),i.sd())+6,o.rounding=1,d=!1,i=i.times(i).plus(1).sqrt().plus(i),d=!0,o.precision=t,o.rounding=e,i.ln())},A.inverseHyperbolicTangent=A.atanh=function(){var t,e,i,o,r=this,n=r.constructor;return r.isFinite()?r.e>=0?new n(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=n.precision,e=n.rounding,o=r.sd(),Math.max(o,t)<2*-r.e-1?O(new n(r),t,e,!0):(n.precision=i=o-r.e,r=N(r.plus(1),new n(1).minus(r),i+t,1),n.precision=t+4,n.rounding=1,r=r.ln(),n.precision=t,n.rounding=e,r.times(.5))):new n(NaN)},A.inverseSine=A.asin=function(){var t,e,i,o,r=this,n=r.constructor;return r.isZero()?new n(r):(e=r.abs().cmp(1),i=n.precision,o=n.rounding,-1!==e?0===e?((t=j(n,i+4,o).times(.5)).s=r.s,t):new n(NaN):(n.precision=i+6,n.rounding=1,r=r.div(new n(1).minus(r.times(r)).sqrt().plus(1)).atan(),n.precision=i,n.rounding=o,r.times(2)))},A.inverseTangent=A.atan=function(){var t,e,i,o,r,n,s,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(h.isFinite()){if(h.isZero())return new c(h);if(h.abs().eq(1)&&u+4<=T)return(s=j(c,u+4,p).times(.25)).s=h.s,s}else{if(!h.s)return new c(NaN);if(u+4<=T)return(s=j(c,u+4,p).times(.5)).s=h.s,s}for(c.precision=a=u+10,c.rounding=1,t=i=Math.min(28,a/C+2|0);t;--t)h=h.div(h.times(h).plus(1).sqrt().plus(1));for(d=!1,e=Math.ceil(a/C),o=1,l=h.times(h),s=new c(h),r=h;-1!==t;)if(r=r.times(l),n=s.minus(r.div(o+=2)),r=r.times(l),void 0!==(s=n.plus(r.div(o+=2))).d[e])for(t=e;s.d[t]===n.d[t]&&t--;);return i&&(s=s.times(2<<i-1)),d=!0,O(s,c.precision=u,c.rounding=p,!0)},A.isFinite=function(){return!!this.d},A.isInteger=A.isInt=function(){return!!this.d&&g(this.e/C)>this.d.length-2},A.isNaN=function(){return!this.s},A.isNegative=A.isNeg=function(){return this.s<0},A.isPositive=A.isPos=function(){return this.s>0},A.isZero=function(){return!!this.d&&0===this.d[0]},A.lessThan=A.lt=function(t){return this.cmp(t)<0},A.lessThanOrEqualTo=A.lte=function(t){return this.cmp(t)<1},A.logarithm=A.log=function(t){var e,i,o,r,n,s,a,l,h=this,c=h.constructor,u=c.precision,p=c.rounding;if(null==t)t=new c(10),e=!0;else{if(i=(t=new c(t)).d,t.s<0||!i||!i[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(i=h.d,h.s<0||!i||!i[0]||h.eq(1))return new c(i&&!i[0]?-1/0:1!=h.s?NaN:i?0:1/0);if(e)if(i.length>1)n=!0;else{for(r=i[0];r%10==0;)r/=10;n=1!==r}if(d=!1,s=H(h,a=u+5),o=e?B(c,a+10):H(t,a),M((l=N(s,o,a,1)).d,r=u,p))do{if(s=H(h,a+=10),o=e?B(c,a+10):H(t,a),l=N(s,o,a,1),!n){+z(l.d).slice(r+1,r+15)+1==1e14&&(l=O(l,u+1,0));break}}while(M(l.d,r+=10,p));return d=!0,O(l,u,p)},A.minus=A.sub=function(t){var e,i,o,r,n,s,a,l,h,c,u,p,m=this,f=m.constructor;if(t=new f(t),!m.d||!t.d)return m.s&&t.s?m.d?t.s=-t.s:t=new f(t.d||m.s!==t.s?m:NaN):t=new f(NaN),t;if(m.s!=t.s)return t.s=-t.s,m.plus(t);if(p=t.d,a=f.precision,l=f.rounding,!(h=m.d)[0]||!p[0]){if(p[0])t.s=-t.s;else{if(!h[0])return new f(3===l?-0:0);t=new f(m)}return d?O(t,a,l):t}if(i=g(t.e/C),c=g(m.e/C),h=h.slice(),n=c-i){for((u=n<0)?(e=h,n=-n,s=p.length):(e=p,i=c,s=h.length),n>(o=Math.max(Math.ceil(a/C),s)+2)&&(n=o,e.length=1),e.reverse(),o=n;o--;)e.push(0);e.reverse()}else{for((u=(o=h.length)<(s=p.length))&&(s=o),o=0;o<s;o++)if(h[o]!=p[o]){u=h[o]<p[o];break}n=0}for(u&&(e=h,h=p,p=e,t.s=-t.s),o=p.length-(s=h.length);o>0;--o)h[s++]=0;for(o=p.length;o>n;){if(h[--o]<p[o]){for(r=o;r&&0===h[--r];)h[r]=k-1;--h[r],h[o]+=k}h[o]-=p[o]}for(;0===h[--s];)h.pop();for(;0===h[0];h.shift())--i;return h[0]?(t.d=h,t.e=P(h,i),d?O(t,a,l):t):new f(3===l?-0:0)},A.modulo=A.mod=function(t){var e,i=this,o=i.constructor;return t=new o(t),!i.d||!t.s||t.d&&!t.d[0]?new o(NaN):!t.d||i.d&&!i.d[0]?O(new o(i),o.precision,o.rounding):(d=!1,9==o.modulo?(e=N(i,t.abs(),0,3,1)).s*=t.s:e=N(i,t,0,o.modulo,1),e=e.times(t),d=!0,i.minus(e))},A.naturalExponential=A.exp=function(){return V(this)},A.naturalLogarithm=A.ln=function(){return H(this)},A.negated=A.neg=function(){var t=new this.constructor(this);return t.s=-t.s,O(t)},A.plus=A.add=function(t){var e,i,o,r,n,s,a,l,h,c,u=this,p=u.constructor;if(t=new p(t),!u.d||!t.d)return u.s&&t.s?u.d||(t=new p(t.d||u.s===t.s?u:NaN)):t=new p(NaN),t;if(u.s!=t.s)return t.s=-t.s,u.minus(t);if(c=t.d,a=p.precision,l=p.rounding,!(h=u.d)[0]||!c[0])return c[0]||(t=new p(u)),d?O(t,a,l):t;if(n=g(u.e/C),o=g(t.e/C),h=h.slice(),r=n-o){for(r<0?(i=h,r=-r,s=c.length):(i=c,o=n,s=h.length),r>(s=(n=Math.ceil(a/C))>s?n+1:s+1)&&(r=s,i.length=1),i.reverse();r--;)i.push(0);i.reverse()}for((s=h.length)-(r=c.length)<0&&(r=s,i=c,c=h,h=i),e=0;r;)e=(h[--r]=h[r]+c[r]+e)/k|0,h[r]%=k;for(e&&(h.unshift(e),++o),s=h.length;0==h[--s];)h.pop();return t.d=h,t.e=P(h,o),d?O(t,a,l):t},A.precision=A.sd=function(t){var e,i=this;if(void 0!==t&&t!==!!t&&1!==t&&0!==t)throw Error(p+t);return i.d?(e=L(i.d),t&&i.e+1>e&&(e=i.e+1)):e=NaN,e},A.round=function(){var t=this,e=t.constructor;return O(new e(t),t.e+1,e.rounding)},A.sine=A.sin=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+Math.max(i.e,i.sd())+C,o.rounding=1,i=function(t,e){var i,o=e.d.length;if(o<3)return e.isZero()?e:Y(t,2,e,e);i=1.4*Math.sqrt(o),e=Y(t,2,e=e.times(1/J(5,i=i>16?16:0|i)),e);for(var r,n=new t(5),s=new t(16),a=new t(20);i--;)r=e.times(e),e=e.times(n.plus(r.times(s.times(r).minus(a))));return e}(o,X(o,i)),o.precision=t,o.rounding=e,O(r>2?i.neg():i,t,e,!0)):new o(NaN)},A.squareRoot=A.sqrt=function(){var t,e,i,o,r,n,s=this,a=s.d,l=s.e,h=s.s,c=s.constructor;if(1!==h||!a||!a[0])return new c(!h||h<0&&(!a||a[0])?NaN:a?s:1/0);for(d=!1,0==(h=Math.sqrt(+s))||h==1/0?(((e=z(a)).length+l)%2==0&&(e+="0"),h=Math.sqrt(e),l=g((l+1)/2)-(l<0||l%2),o=new c(e=h==1/0?"5e"+l:(e=h.toExponential()).slice(0,e.indexOf("e")+1)+l)):o=new c(h.toString()),i=(l=c.precision)+3;;)if(o=(n=o).plus(N(s,n,i+2,1)).times(.5),z(n.d).slice(0,i)===(e=z(o.d)).slice(0,i)){if("9999"!=(e=e.slice(i-3,i+1))&&(r||"4999"!=e)){+e&&(+e.slice(1)||"5"!=e.charAt(0))||(O(o,l+1,1),t=!o.times(o).eq(s));break}if(!r&&(O(n,l+1,0),n.times(n).eq(s))){o=n;break}i+=4,r=1}return d=!0,O(o,l,c.rounding,t)},A.tangent=A.tan=function(){var t,e,i=this,o=i.constructor;return i.isFinite()?i.isZero()?new o(i):(e=o.rounding,o.precision=(t=o.precision)+10,o.rounding=1,(i=i.sin()).s=1,i=N(i,new o(1).minus(i.times(i)).sqrt(),t+10,0),o.precision=t,o.rounding=e,O(2==r||4==r?i.neg():i,t,e,!0)):new o(NaN)},A.times=A.mul=function(t){var e,i,o,r,n,s,a,l,h,c=this,u=c.constructor,p=c.d,m=(t=new u(t)).d;if(t.s*=c.s,!(p&&p[0]&&m&&m[0]))return new u(!t.s||p&&!p[0]&&!m||m&&!m[0]&&!p?NaN:p&&m?0*t.s:t.s/0);for(i=g(c.e/C)+g(t.e/C),(l=p.length)<(h=m.length)&&(n=p,p=m,m=n,s=l,l=h,h=s),n=[],o=s=l+h;o--;)n.push(0);for(o=h;--o>=0;){for(e=0,r=l+o;r>o;)a=n[r]+m[o]*p[r-o-1]+e,n[r--]=a%k|0,e=a/k|0;n[r]=(n[r]+e)%k|0}for(;!n[--s];)n.pop();return e?++i:n.shift(),t.d=n,t.e=P(n,i),d?O(t,u.precision,u.rounding):t},A.toBinary=function(t,e){return K(this,2,t,e)},A.toDecimalPlaces=A.toDP=function(t,e){var i=this,o=i.constructor;return i=new o(i),void 0===t?i:(I(t,0,s),void 0===e?e=o.rounding:I(e,0,8),O(i,t+i.e+1,e))},A.toExponential=function(t,e){var i,o=this,r=o.constructor;return void 0===t?i=E(o,!0):(I(t,0,s),void 0===e?e=r.rounding:I(e,0,8),i=E(o=O(new r(o),t+1,e),!0,t+1)),o.isNeg()&&!o.isZero()?"-"+i:i},A.toFixed=function(t,e){var i,o,r=this,n=r.constructor;return void 0===t?i=E(r):(I(t,0,s),void 0===e?e=n.rounding:I(e,0,8),i=E(o=O(new n(r),t+r.e+1,e),!1,t+o.e+1)),r.isNeg()&&!r.isZero()?"-"+i:i},A.toFraction=function(t){var e,i,o,r,n,s,a,l,h,c,u,m,f=this,v=f.d,g=f.constructor;if(!v)return new g(f);if(h=i=new g(1),o=l=new g(0),n=(e=new g(o)).e=L(v)-f.e-1,e.d[0]=b(10,(s=n%C)<0?C+s:s),null==t)t=n>0?e:h;else{if(!(a=new g(t)).isInt()||a.lt(h))throw Error(p+a);t=a.gt(e)?n>0?e:h:a}for(d=!1,a=new g(z(v)),c=g.precision,g.precision=n=v.length*C*2;u=N(a,e,0,1,1),1!=(r=i.plus(u.times(o))).cmp(t);)i=o,o=r,h=l.plus(u.times(r=h)),l=r,e=a.minus(u.times(r=e)),a=r;return r=N(t.minus(i),o,0,1,1),l=l.plus(r.times(h)),i=i.plus(r.times(o)),l.s=h.s=f.s,m=N(h,o,n,1).minus(f).abs().cmp(N(l,i,n,1).minus(f).abs())<1?[h,o]:[l,i],g.precision=c,d=!0,m},A.toHexadecimal=A.toHex=function(t,e){return K(this,16,t,e)},A.toNearest=function(t,e){var i=this,o=i.constructor;if(i=new o(i),null==t){if(!i.d)return i;t=new o(1),e=o.rounding}else{if(t=new o(t),void 0===e?e=o.rounding:I(e,0,8),!i.d)return t.s?i:t;if(!t.d)return t.s&&(t.s=i.s),t}return t.d[0]?(d=!1,i=N(i,t,0,e,1).times(t),d=!0,O(i)):(t.s=i.s,i=t),i},A.toNumber=function(){return+this},A.toOctal=function(t,e){return K(this,8,t,e)},A.toPower=A.pow=function(t){var e,i,o,r,n,s,a=this,l=a.constructor,h=+(t=new l(t));if(!(a.d&&t.d&&a.d[0]&&t.d[0]))return new l(b(+a,h));if((a=new l(a)).eq(1))return a;if(o=l.precision,n=l.rounding,t.eq(1))return O(a,o,n);if((e=g(t.e/C))>=t.d.length-1&&(i=h<0?-h:h)<=9007199254740991)return r=F(l,a,i,o),t.s<0?new l(1).div(r):O(r,o,n);if((s=a.s)<0){if(e<t.d.length-1)return new l(NaN);if(1&t.d[e]||(s=1),0==a.e&&1==a.d[0]&&1==a.d.length)return a.s=s,a}return(e=0!=(i=b(+a,h))&&isFinite(i)?new l(i+"").e:g(h*(Math.log("0."+z(a.d))/Math.LN10+a.e+1)))>l.maxE+1||e<l.minE-1?new l(e>0?s/0:0):(d=!1,l.rounding=a.s=1,i=Math.min(12,(e+"").length),(r=V(t.times(H(a,o+i)),o)).d&&M((r=O(r,o+5,1)).d,o,n)&&+z((r=O(V(t.times(H(a,(e=o+10)+i)),e),e+5,1)).d).slice(o+1,o+15)+1==1e14&&(r=O(r,o+1,0)),r.s=s,d=!0,l.rounding=n,O(r,o,n))},A.toPrecision=function(t,e){var i,o=this,r=o.constructor;return void 0===t?i=E(o,o.e<=r.toExpNeg||o.e>=r.toExpPos):(I(t,1,s),void 0===e?e=r.rounding:I(e,0,8),i=E(o=O(new r(o),t,e),t<=o.e||o.e<=r.toExpNeg,t)),o.isNeg()&&!o.isZero()?"-"+i:i},A.toSignificantDigits=A.toSD=function(t,e){var i=this.constructor;return void 0===t?(t=i.precision,e=i.rounding):(I(t,1,s),void 0===e?e=i.rounding:I(e,0,8)),O(new i(this),t,e)},A.toString=function(){var t=this,e=t.constructor,i=E(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+i:i},A.truncated=A.trunc=function(){return O(new this.constructor(this),this.e+1,1)},A.valueOf=A.toJSON=function(){var t=this,e=t.constructor,i=E(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+i:i};var N=function(){function t(t,e,i){var o,r=0,n=t.length;for(t=t.slice();n--;)t[n]=(o=t[n]*e+r)%i|0,r=o/i|0;return r&&t.unshift(r),t}function e(t,e,i,o){var r,n;if(i!=o)n=i>o?1:-1;else for(r=n=0;r<i;r++)if(t[r]!=e[r]){n=t[r]>e[r]?1:-1;break}return n}function o(t,e,i,o){for(var r=0;i--;)t[i]-=r,t[i]=(r=t[i]<e[i]?1:0)*o+t[i]-e[i];for(;!t[0]&&t.length>1;)t.shift()}return function(r,n,s,a,l,h){var c,d,u,p,m,f,v,b,y,w,x,_,S,T,A,z,I,M,D,N,E=r.constructor,P=r.s==n.s?1:-1,B=r.d,j=n.d;if(!(B&&B[0]&&j&&j[0]))return new E(r.s&&n.s&&(B?!j||B[0]!=j[0]:j)?B&&0==B[0]||!j?0*P:P/0:NaN);for(h?(m=1,d=r.e-n.e):(h=k,d=g(r.e/(m=C))-g(n.e/m)),D=j.length,I=B.length,w=(y=new E(P)).d=[],u=0;j[u]==(B[u]||0);u++);if(j[u]>(B[u]||0)&&d--,null==s?(T=s=E.precision,a=E.rounding):T=l?s+(r.e-n.e)+1:s,T<0)w.push(1),f=!0;else{if(T=T/m+2|0,u=0,1==D){for(p=0,j=j[0],T++;(u<I||p)&&T--;u++)w[u]=(A=p*h+(B[u]||0))/j|0,p=A%j|0;f=p||u<I}else{for((p=h/(j[0]+1)|0)>1&&(j=t(j,p,h),B=t(B,p,h),D=j.length,I=B.length),z=D,_=(x=B.slice(0,D)).length;_<D;)x[_++]=0;(N=j.slice()).unshift(0),M=j[0],j[1]>=h/2&&++M;do{p=0,(c=e(j,x,D,_))<0?(S=x[0],D!=_&&(S=S*h+(x[1]||0)),(p=S/M|0)>1?(p>=h&&(p=h-1),1==(c=e(v=t(j,p,h),x,b=v.length,_=x.length))&&(p--,o(v,D<b?N:j,b,h))):(0==p&&(c=p=1),v=j.slice()),(b=v.length)<_&&v.unshift(0),o(x,v,_,h),-1==c&&(c=e(j,x,D,_=x.length))<1&&(p++,o(x,D<_?N:j,_,h)),_=x.length):0===c&&(p++,x=[0]),w[u++]=p,c&&x[0]?x[_++]=B[z]||0:(x=[B[z]],_=1)}while((z++<I||void 0!==x[0])&&T--);f=void 0!==x[0]}w[0]||w.shift()}if(1==m)y.e=d,i=f;else{for(u=1,p=w[0];p>=10;p/=10)u++;y.e=u+d*m-1,O(y,l?s+y.e+1:s,a,f)}return y}}();function O(t,e,i,o){var r,n,s,a,l,h,c,u,p,m=t.constructor;t:if(null!=e){if(!(u=t.d))return t;for(r=1,a=u[0];a>=10;a/=10)r++;if((n=e-r)<0)n+=C,l=(c=u[p=0])/b(10,r-(s=e)-1)%10|0;else if((p=Math.ceil((n+1)/C))>=(a=u.length)){if(!o)break t;for(;a++<=p;)u.push(0);c=l=0,r=1,s=(n%=C)-C+1}else{for(c=a=u[p],r=1;a>=10;a/=10)r++;l=(s=(n%=C)-C+r)<0?0:c/b(10,r-s-1)%10|0}if(o=o||e<0||void 0!==u[p+1]||(s<0?c:c%b(10,r-s-1)),h=i<4?(l||o)&&(0==i||i==(t.s<0?3:2)):l>5||5==l&&(4==i||o||6==i&&(n>0?s>0?c/b(10,r-s):0:u[p-1])%10&1||i==(t.s<0?8:7)),e<1||!u[0])return u.length=0,h?(u[0]=b(10,(C-(e-=t.e+1)%C)%C),t.e=-e||0):u[0]=t.e=0,t;if(0==n?(u.length=p,a=1,p--):(u.length=p+1,a=b(10,C-n),u[p]=s>0?(c/b(10,r-s)%b(10,s)|0)*a:0),h)for(;;){if(0==p){for(n=1,s=u[0];s>=10;s/=10)n++;for(s=u[0]+=a,a=1;s>=10;s/=10)a++;n!=a&&(t.e++,u[0]==k&&(u[0]=1));break}if(u[p]+=a,u[p]!=k)break;u[p--]=0,a=1}for(n=u.length;0===u[--n];)u.pop()}return d&&(t.e>m.maxE?(t.d=null,t.e=NaN):t.e<m.minE&&(t.e=0,t.d=[0])),t}function E(t,e,i){if(!t.isFinite())return W(t);var o,r=t.e,n=z(t.d),s=n.length;return e?(i&&(o=i-s)>0?n=n.charAt(0)+"."+n.slice(1)+$(o):s>1&&(n=n.charAt(0)+"."+n.slice(1)),n=n+(t.e<0?"e":"e+")+t.e):r<0?(n="0."+$(-r-1)+n,i&&(o=i-s)>0&&(n+=$(o))):r>=s?(n+=$(r+1-s),i&&(o=i-r-1)>0&&(n=n+"."+$(o))):((o=r+1)<s&&(n=n.slice(0,o)+"."+n.slice(o)),i&&(o=i-s)>0&&(r+1===s&&(n+="."),n+=$(o))),n}function P(t,e){var i=t[0];for(e*=C;i>=10;i/=10)e++;return e}function B(t,e,i){if(e>S)throw d=!0,i&&(t.precision=i),Error(m);return O(new t(l),e,1,!0)}function j(t,e,i){if(e>T)throw Error(m);return O(new t(h),e,i,!0)}function L(t){var e=t.length-1,i=e*C+1;if(e=t[e]){for(;e%10==0;e/=10)i--;for(e=t[0];e>=10;e/=10)i++}return i}function $(t){for(var e="";t--;)e+="0";return e}function F(t,e,i,o){var r,n=new t(1),s=Math.ceil(o/C+4);for(d=!1;;){if(i%2&&Z((n=n.times(e)).d,s)&&(r=!0),0===(i=g(i/2))){i=n.d.length-1,r&&0===n.d[i]&&++n.d[i];break}Z((e=e.times(e)).d,s)}return d=!0,n}function R(t){return 1&t.d[t.d.length-1]}function U(t,e,i){for(var o,r,n=new t(e[0]),s=0;++s<e.length;){if(!(r=new t(e[s])).s){n=r;break}((o=n.cmp(r))===i||0===o&&n.s===i)&&(n=r)}return n}function V(t,e){var i,o,r,n,s,a,l,h=0,c=0,u=0,p=t.constructor,m=p.rounding,f=p.precision;if(!t.d||!t.d[0]||t.e>17)return new p(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(null==e?(d=!1,l=f):l=e,a=new p(.03125);t.e>-2;)t=t.times(a),u+=5;for(l+=o=Math.log(b(2,u))/Math.LN10*2+5|0,i=n=s=new p(1),p.precision=l;;){if(n=O(n.times(t),l,1),i=i.times(++c),z((a=s.plus(N(n,i,l,1))).d).slice(0,l)===z(s.d).slice(0,l)){for(r=u;r--;)s=O(s.times(s),l,1);if(null!=e)return p.precision=f,s;if(!(h<3&&M(s.d,l-o,m,h)))return O(s,p.precision=f,m,d=!0);p.precision=l+=10,i=n=a=new p(1),c=0,h++}s=a}}function H(t,e){var i,o,r,n,s,a,l,h,c,u,p,m=1,f=t,v=f.d,g=f.constructor,b=g.rounding,y=g.precision;if(f.s<0||!v||!v[0]||!f.e&&1==v[0]&&1==v.length)return new g(v&&!v[0]?-1/0:1!=f.s?NaN:v?0:f);if(null==e?(d=!1,c=y):c=e,g.precision=c+=10,o=(i=z(v)).charAt(0),!(Math.abs(n=f.e)<15e14))return h=B(g,c+2,y).times(n+""),f=H(new g(o+"."+i.slice(1)),c-10).plus(h),g.precision=y,null==e?O(f,y,b,d=!0):f;for(;o<7&&1!=o||1==o&&i.charAt(1)>3;)o=(i=z((f=f.times(t)).d)).charAt(0),m++;for(n=f.e,o>1?(f=new g("0."+i),n++):f=new g(o+"."+i.slice(1)),u=f,l=s=f=N(f.minus(1),f.plus(1),c,1),p=O(f.times(f),c,1),r=3;;){if(s=O(s.times(p),c,1),z((h=l.plus(N(s,new g(r),c,1))).d).slice(0,c)===z(l.d).slice(0,c)){if(l=l.times(2),0!==n&&(l=l.plus(B(g,c+2,y).times(n+""))),l=N(l,new g(m),c,1),null!=e)return g.precision=y,l;if(!M(l.d,c-10,b,a))return O(l,g.precision=y,b,d=!0);g.precision=c+=10,h=s=f=N(u.minus(1),u.plus(1),c,1),p=O(f.times(f),c,1),r=a=1}l=h,r+=2}}function W(t){return String(t.s*t.s/0)}function q(t,e){var i,o,r;for((i=e.indexOf("."))>-1&&(e=e.replace(".","")),(o=e.search(/e/i))>0?(i<0&&(i=o),i+=+e.slice(o+1),e=e.substring(0,o)):i<0&&(i=e.length),o=0;48===e.charCodeAt(o);o++);for(r=e.length;48===e.charCodeAt(r-1);--r);if(e=e.slice(o,r)){if(r-=o,t.e=i=i-o-1,t.d=[],o=(i+1)%C,i<0&&(o+=C),o<r){for(o&&t.d.push(+e.slice(0,o)),r-=C;o<r;)t.d.push(+e.slice(o,o+=C));e=e.slice(o),o=C-e.length}else o-=r;for(;o--;)e+="0";t.d.push(+e),d&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function G(t,i){var o,r,n,s,a,l,h,c,u;if(i.indexOf("_")>-1){if(i=i.replace(/(\d)_(?=\d)/g,"$1"),_.test(i))return q(t,i)}else if("Infinity"===i||"NaN"===i)return+i||(t.s=NaN),t.e=NaN,t.d=null,t;if(w.test(i))o=16,i=i.toLowerCase();else if(y.test(i))o=2;else{if(!x.test(i))throw Error(p+i);o=8}for((s=i.search(/p/i))>0?(h=+i.slice(s+1),i=i.substring(2,s)):i=i.slice(2),s=i.indexOf("."),r=t.constructor,(a=s>=0)&&(s=(l=(i=i.replace(".","")).length)-s,n=F(r,new r(o),s,2*s)),s=u=(c=D(i,o,k)).length-1;0===c[s];--s)c.pop();return s<0?new r(0*t.s):(t.e=P(c,u),t.d=c,d=!1,a&&(t=N(t,n,4*l)),h&&(t=t.times(Math.abs(h)<54?b(2,h):e.pow(2,h))),d=!0,t)}function Y(t,e,i,o,r){var n,s,a,l,h=t.precision,c=Math.ceil(h/C);for(d=!1,l=i.times(i),a=new t(o);;){if(s=N(a.times(l),new t(e++*e++),h,1),a=r?o.plus(s):o.minus(s),o=N(s.times(l),new t(e++*e++),h,1),void 0!==(s=a.plus(o)).d[c]){for(n=c;s.d[n]===a.d[n]&&n--;);if(-1==n)break}n=a,a=o,o=s,s=n}return d=!0,s.d.length=c+1,s}function J(t,e){for(var i=t;--e;)i*=t;return i}function X(t,e){var i,o=e.s<0,n=j(t,t.precision,1),s=n.times(.5);if((e=e.abs()).lte(s))return r=o?4:1,e;if((i=e.divToInt(n)).isZero())r=o?3:2;else{if((e=e.minus(i.times(n))).lte(s))return r=R(i)?o?2:3:o?4:1,e;r=R(i)?o?1:4:o?3:2}return e.minus(n).abs()}function K(t,e,o,r){var n,l,h,c,d,u,p,m,f,v=t.constructor,g=void 0!==o;if(g?(I(o,1,s),void 0===r?r=v.rounding:I(r,0,8)):(o=v.precision,r=v.rounding),t.isFinite()){for(g?(n=2,16==e?o=4*o-3:8==e&&(o=3*o-2)):n=e,(h=(p=E(t)).indexOf("."))>=0&&(p=p.replace(".",""),(f=new v(1)).e=p.length-h,f.d=D(E(f),10,n),f.e=f.d.length),l=d=(m=D(p,10,n)).length;0==m[--d];)m.pop();if(m[0]){if(h<0?l--:((t=new v(t)).d=m,t.e=l,m=(t=N(t,f,o,r,0,n)).d,l=t.e,u=i),h=m[o],c=n/2,u=u||void 0!==m[o+1],u=r<4?(void 0!==h||u)&&(0===r||r===(t.s<0?3:2)):h>c||h===c&&(4===r||u||6===r&&1&m[o-1]||r===(t.s<0?8:7)),m.length=o,u)for(;++m[--o]>n-1;)m[o]=0,o||(++l,m.unshift(1));for(d=m.length;!m[d-1];--d);for(h=0,p="";h<d;h++)p+=a.charAt(m[h]);if(g){if(d>1)if(16==e||8==e){for(h=16==e?4:3,--d;d%h;d++)p+="0";for(d=(m=D(p,n,e)).length;!m[d-1];--d);for(h=1,p="1.";h<d;h++)p+=a.charAt(m[h])}else p=p.charAt(0)+"."+p.slice(1);p=p+(l<0?"p":"p+")+l}else if(l<0){for(;++l;)p="0"+p;p="0."+p}else if(++l>d)for(l-=d;l--;)p+="0";else l<d&&(p=p.slice(0,l)+"."+p.slice(l))}else p=g?"0p+0":"0";p=(16==e?"0x":2==e?"0b":8==e?"0o":"")+p}else p=W(t);return t.s<0?"-"+p:p}function Z(t,e){if(t.length>e)return t.length=e,!0}function Q(t){return new this(t).abs()}function tt(t){return new this(t).acos()}function et(t){return new this(t).acosh()}function it(t,e){return new this(t).plus(e)}function ot(t){return new this(t).asin()}function rt(t){return new this(t).asinh()}function nt(t){return new this(t).atan()}function st(t){return new this(t).atanh()}function at(t,e){t=new this(t),e=new this(e);var i,o=this.precision,r=this.rounding,n=o+4;return t.s&&e.s?t.d||e.d?!e.d||t.isZero()?(i=e.s<0?j(this,o,r):new this(0)).s=t.s:!t.d||e.isZero()?(i=j(this,n,1).times(.5)).s=t.s:e.s<0?(this.precision=n,this.rounding=1,i=this.atan(N(t,e,n,1)),e=j(this,n,1),this.precision=o,this.rounding=r,i=t.s<0?i.minus(e):i.plus(e)):i=this.atan(N(t,e,n,1)):(i=j(this,n,1).times(e.s>0?.25:.75)).s=t.s:i=new this(NaN),i}function lt(t){return new this(t).cbrt()}function ht(t){return O(t=new this(t),t.e+1,2)}function ct(t,e,i){return new this(t).clamp(e,i)}function dt(t){if(!t||"object"!=typeof t)throw Error(u+"Object expected");var e,i,o,r=!0===t.defaults,a=["precision",1,s,"rounding",0,8,"toExpNeg",-n,0,"toExpPos",0,n,"maxE",0,n,"minE",-n,0,"modulo",0,9];for(e=0;e<a.length;e+=3)if(i=a[e],r&&(this[i]=c[i]),void 0!==(o=t[i])){if(!(g(o)===o&&o>=a[e+1]&&o<=a[e+2]))throw Error(p+i+": "+o);this[i]=o}if(i="crypto",r&&(this[i]=c[i]),void 0!==(o=t[i])){if(!0!==o&&!1!==o&&0!==o&&1!==o)throw Error(p+i+": "+o);if(o){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(f);this[i]=!0}else this[i]=!1}return this}function ut(t){return new this(t).cos()}function pt(t){return new this(t).cosh()}function mt(t,e){return new this(t).div(e)}function ft(t){return new this(t).exp()}function vt(t){return O(t=new this(t),t.e+1,3)}function gt(){var t,e,i=new this(0);for(d=!1,t=0;t<arguments.length;)if((e=new this(arguments[t++])).d)i.d&&(i=i.plus(e.times(e)));else{if(e.s)return d=!0,new this(1/0);i=e}return d=!0,i.sqrt()}function bt(t){return t instanceof e||t&&t.toStringTag===v||!1}function yt(t){return new this(t).ln()}function wt(t,e){return new this(t).log(e)}function xt(t){return new this(t).log(2)}function _t(t){return new this(t).log(10)}function kt(){return U(this,arguments,-1)}function Ct(){return U(this,arguments,1)}function St(t,e){return new this(t).mod(e)}function Tt(t,e){return new this(t).mul(e)}function At(t,e){return new this(t).pow(e)}function zt(t){var e,i,o,r,n=0,a=new this(1),l=[];if(void 0===t?t=this.precision:I(t,1,s),o=Math.ceil(t/C),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(o));n<o;)(r=e[n])>=429e7?e[n]=crypto.getRandomValues(new Uint32Array(1))[0]:l[n++]=r%1e7;else{if(!crypto.randomBytes)throw Error(f);for(e=crypto.randomBytes(o*=4);n<o;)(r=e[n]+(e[n+1]<<8)+(e[n+2]<<16)+((127&e[n+3])<<24))>=214e7?crypto.randomBytes(4).copy(e,n):(l.push(r%1e7),n+=4);n=o/4}else for(;n<o;)l[n++]=1e7*Math.random()|0;for(o=l[--n],t%=C,o&&t&&(r=b(10,C-t),l[n]=(o/r|0)*r);0===l[n];n--)l.pop();if(n<0)i=0,l=[0];else{for(i=-1;0===l[0];i-=C)l.shift();for(o=1,r=l[0];r>=10;r/=10)o++;o<C&&(i-=C-o)}return a.e=i,a.d=l,a}function It(t){return O(t=new this(t),t.e+1,this.rounding)}function Mt(t){return(t=new this(t)).d?t.d[0]?t.s:0*t.s:t.s||NaN}function Dt(t){return new this(t).sin()}function Nt(t){return new this(t).sinh()}function Ot(t){return new this(t).sqrt()}function Et(t,e){return new this(t).sub(e)}function Pt(){var t=0,e=arguments,i=new this(e[t]);for(d=!1;i.s&&++t<e.length;)i=i.plus(e[t]);return d=!0,O(i,this.precision,this.rounding)}function Bt(t){return new this(t).tan()}function jt(t){return new this(t).tanh()}function Lt(t){return O(t=new this(t),t.e+1,1)}e=function t(e){var i,o,r;function n(t){var e,i,o,r=this;if(!(r instanceof n))return new n(t);if(r.constructor=n,bt(t))return r.s=t.s,void(d?!t.d||t.e>n.maxE?(r.e=NaN,r.d=null):t.e<n.minE?(r.e=0,r.d=[0]):(r.e=t.e,r.d=t.d.slice()):(r.e=t.e,r.d=t.d?t.d.slice():t.d));if("number"==(o=typeof t)){if(0===t)return r.s=1/t<0?-1:1,r.e=0,void(r.d=[0]);if(t<0?(t=-t,r.s=-1):r.s=1,t===~~t&&t<1e7){for(e=0,i=t;i>=10;i/=10)e++;return void(d?e>n.maxE?(r.e=NaN,r.d=null):e<n.minE?(r.e=0,r.d=[0]):(r.e=e,r.d=[t]):(r.e=e,r.d=[t]))}return 0*t!=0?(t||(r.s=NaN),r.e=NaN,void(r.d=null)):q(r,t.toString())}if("string"===o)return 45===(i=t.charCodeAt(0))?(t=t.slice(1),r.s=-1):(43===i&&(t=t.slice(1)),r.s=1),_.test(t)?q(r,t):G(r,t);if("bigint"===o)return t<0?(t=-t,r.s=-1):r.s=1,q(r,t.toString());throw Error(p+t)}if(n.prototype=A,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=dt,n.clone=t,n.isDecimal=bt,n.abs=Q,n.acos=tt,n.acosh=et,n.add=it,n.asin=ot,n.asinh=rt,n.atan=nt,n.atanh=st,n.atan2=at,n.cbrt=lt,n.ceil=ht,n.clamp=ct,n.cos=ut,n.cosh=pt,n.div=mt,n.exp=ft,n.floor=vt,n.hypot=gt,n.ln=yt,n.log=wt,n.log10=_t,n.log2=xt,n.max=kt,n.min=Ct,n.mod=St,n.mul=Tt,n.pow=At,n.random=zt,n.round=It,n.sign=Mt,n.sin=Dt,n.sinh=Nt,n.sqrt=Ot,n.sub=Et,n.sum=Pt,n.tan=Bt,n.tanh=jt,n.trunc=Lt,void 0===e&&(e={}),e&&!0!==e.defaults)for(r=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],i=0;i<r.length;)e.hasOwnProperty(o=r[i++])||(e[o]=this[o]);return n.config(e),n}(c),e.prototype.constructor=e,e.default=e.Decimal=e,l=new e(l),h=new e(h),jc.exports?("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(A[Symbol.for("nodejs.util.inspect.custom")]=A.toString,A[Symbol.toStringTag]="Decimal"),jc.exports=e):(t||(t="undefined"!=typeof self&&self&&self.self==self?self:window),o=t.Decimal,e.noConflict=function(){return t.Decimal=o,e},t.Decimal=e)}(Lc);const Fc=$c.exports;var Rc;!function(t){t.WON="Won",t.LOST="Lost"}(Rc||(Rc={}));const Uc=class{constructor(i){t(this,i),this.logout=e(this,"logout",7),this.ticketTypeMap={NORMAL:"Normal",SYNDICATE:"Syndicate",SUBSCRIPTION:"Subscription"},this.resultMap={[Rc.WON]:"Win",[Rc.LOST]:"Lose"},this.displayPrizeCategory=t=>{const e=new Map;t.forEach((t=>{let i=t.divisionDisplayName,o=t.currency;if(i&&"None"!==i){const r=new Fc(t.amount);if(e.has(i)){const t=e.get(i),n=t.amount.plus(r);e.set(i,{amount:n,currency:o,times:t.times+1})}else e.set(i,{amount:r,currency:o,times:1})}}));const i=[];for(let[t,o]of e.entries()){const e=o.amount.times(100).floor().dividedBy(100);i.push({prizeName:t,amount:e.toNumber(),currency:o.currency,times:o.times})}return i.sort(((t,e)=>e.prizeName.localeCompare(t.prizeName))),i},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId="",this.drawId=void 0,this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.ticketHistory=[],this.activeStatus="",this.statusOptions=void 0,this.isLoading=!0,this.rawData={},this.filterData={offset:0,limit:10,state:"",from:"",to:"",wagerType:"",vendorGameType:"PoolGame",vendorGameBettingObject:"HomeDrawAway",id:""},this.paginationInfo={current:1,total:0,pageSize:10},this.quickFiltersActive=!1,this.showCurrentTicketLine=!1,this.curTicketItem=void 0,this.curSelection=[],this.curSelectionIdx=0,this.showCurrentDrawResult=!1,this.curDrawItem=void 0,this.curDrawSelection=[],this.curDrawSelectionBettingType=void 0,this.curDrawSelectionMap={}}handleClientStylingChange(t,e){t!=e&&n(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&s(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`,this.stylingSubscription),this.clientStyling&&n(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&s(this.stylingContainer,this.clientStylingUrl))}async fetchGameData(){var t;try{let t=new URL(`${this.endpoint}/games/${this.gameId}`);const e=await Qh(t.href,"GET");this.rawData=e}catch(e){nc({message:null!==(t=e.message)&&void 0!==t?t:e,theme:"error"})}}connectedCallback(){this.endpoint&&this.gameId&&this.fetchGameData()}handleGameInfoChange(t,e){t&&t!=e&&this.fetchGameData()}handleTicketInfoChange(t,e){t&&t!=e&&this.fetchTicketList()}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async fetchTicketList(){this.isLoading=!0;try{const{items:t,total:e}=await Qh(`${this.endpoint}/tickets${function(t){const e={};Object.entries(t).forEach((([t,i])=>{tc(i,!0)||(e[t]=i)}));const i=Object.entries(e).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&");return i?`?${i}`:""}(this.filterData)}`,"GET",null,{Authorization:`Bearer ${this.sessionId}`});this.ticketHistory=t,this.paginationInfo.total=e,t.length>0&&this.getDrawResult()}catch(t){console.log("in fetchTicketList error is: ",t),401===t.status&&(nc({message:t.message,theme:"error"}),this.logout.emit())}finally{this.isLoading=!1}}async fetchDrawResult(t,e){try{return await Qh(`${this.endpoint}/games/${t}/draws/${e}`,"GET",{})}catch(t){console.log(t)}}getDivision(t,e){var i;let o=t.division,r=null===(i=e.prizes)||void 0===i?void 0:i.filter((t=>t.order===o));return r&&r.length?r[0].division:null}async getDrawResult(){const t=new Map;this.ticketHistory.forEach(((e,i)=>{e.drawResults.forEach(((o,r)=>{const n=`${o.drawId}-${e.gameId}`;t.has(n)?t.get(n).indices.push({ticketIndex:i,drawIndex:r}):t.set(n,{drawId:o.drawId,gameId:e.gameId,indices:[{ticketIndex:i,drawIndex:r}]})}))}));let e=[...this.ticketHistory];await Promise.all(Array.from(t.values()).map((async({gameId:t,drawId:i,indices:o})=>{try{const r=await this.fetchDrawResult(t,i);r&&o.forEach((({ticketIndex:t,drawIndex:i})=>{const o=Object.assign(Object.assign({},e[t].drawResults[i]),{tempDrawData:Object.assign(Object.assign({},r),{vendorGameId:e[t].vendorGameId}),prizeDetails:this.displayPrizeCategory(e[t].drawResults[i].details)}),n=[...e[t].drawResults];n[i]=o,e[t]=Object.assign(Object.assign({},e[t]),{drawResults:n})}))}catch(e){console.error(`failed to fetch draw result (gameId: ${t}, drawId: ${i}):`,e)}}))),this.ticketHistory=e}componentWillLoad(){this.translationUrl&&Kh(JSON.parse(this.translationUrl)),this.statusOptions=[{label:Xh("settled",this.language),value:"Settled"},{label:Xh("purchased",this.language),value:"Purchased"},{label:Xh("canceled",this.language),value:"Canceled"}],this.fetchTicketList()}changeStatus(t){this.activeStatus=t,this.filterData.state=t,this.quickFiltersActive=!0,this.fetchTicketList()}handlePageSizeChange(t){this.filterData.limit=t.detail,this.fetchTicketList()}handlePageChange(t){this.filterData.offset=(t.detail-1)*this.filterData.limit,this.fetchTicketList()}handleShowTicketLineDetial(t){this.curSelectionIdx=0,this.showCurrentTicketLine=!0,this.curTicketItem=t,this.curSelection=this.parseSelection()}handleShowCurrentDraw(t){this.showCurrentDrawResult=!0,this.curDrawItem=t,this.curDrawSelectionBettingType=t.winningNumbers[0].winning_type,this.curDrawItem.winningNumbers.forEach((t=>{this.curDrawSelectionMap[t.winning_type]=[oc(t.poolGameOutcomes)]})),this.curDrawSelection=this.curDrawSelectionMap[this.curDrawSelectionBettingType]}parseSelection(){const t=[];return this.curTicketItem.selection.forEach(((e,i)=>{t[i]=oc(e.poolGameSelections)})),t}handleFilterChange(t){const e=t.detail;this.filterData.from=e.filterFromCalendar,this.filterData.to=e.filterToCalendar,this.filterData.id=e.ticketId,this.filterData.wagerType=e.ticketType,this.fetchTicketList()}handleFilterClear(){this.activeStatus="",this.quickFiltersActive=!1,this.filterData={offset:0,limit:10,state:"",from:"",to:"",wagerType:"",vendorGameType:"PoolGame",vendorGameBettingObject:"HomeDrawAway",id:""},this.fetchTicketList()}get playTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.playTypes}get bettingTypeConfig(){var t,e,i;return null===(i=null===(e=null===(t=this.rawData)||void 0===t?void 0:t.rules)||void 0===e?void 0:e.poolGame)||void 0===i?void 0:i.bettingTypes}getBettingType(t){var e;return null!==(e=this.playTypeConfig.find((e=>e.betTypeId===t)).bettingType)&&void 0!==e?e:""}handlePoolGameCurrentPageChange(t){const{currentPage:e}=t.detail;this.curSelectionIdx=e-1}handleDrawBettingTypeChange(t){this.curDrawSelectionBettingType=t,this.curDrawSelection=this.curDrawSelectionMap[this.curDrawSelectionBettingType]}getBettingTypeName(t){var e,i;const o=null===(i=null===(e=this.bettingTypeConfig)||void 0===e?void 0:e.find((e=>e.code===t)))||void 0===i?void 0:i.name;return null!=o?o:t}render(){return o("div",{key:"b02e16006ef81857aca03cf33faad9bac810ba43",class:"lottery-tipping-ticket-history",ref:t=>this.stylingContainer=t},o("div",{key:"2b706639cc4dd178079435fbc5104e5b1c958192",class:"ticket-history-title"},Xh("ticketsHistory",this.language)),o("div",{key:"aff2bd75b280e67fe1e5be5703658006f6864d9a",class:"filter-wrap"},o("div",{key:"73706288e67206eb5b4a4c17f0511f3f9b7c8f47",class:"filter-status"},this.statusOptions.map((t=>o("div",{class:"filter-status-btn"+(this.activeStatus==t.value?" active":""),onClick:()=>this.changeStatus(t.value)},t.label)))),o("div",{key:"109ba27a6c3ec93b51afc9d2e580c93f36ca300f",class:"filter-operation"},o("lottery-tipping-filter",{key:"794dd4052e54e2ced8fa930569332187da08850f","quick-filters-active":this.quickFiltersActive,language:this.language,"translation-url":this.translationUrl}))),this.isLoading&&o("div",{key:"abf12999f0113eafbf3d9f1966d64c5a386fbdd0",class:"loading-wrap"},o("section",{key:"c630b5a0669002fd3a59c5203ec2c7f26ef414ae",class:"dots-container"},o("div",{key:"5b56f0c9eb26ca5ea7cbf3cb6404b5651a445f57",class:"dot"}),o("div",{key:"38181cef9fa97c878c2be843b0190cbebf4c357e",class:"dot"}),o("div",{key:"aa1d884538b858c7cf63b86a249fa4a7ebfedbfc",class:"dot"}),o("div",{key:"b05c4e61eae3febab733a21dbc233a2e504cd06f",class:"dot"}),o("div",{key:"fa35a7a561e9dcee914918d310684c4dfccbb2c3",class:"dot"}))),!this.isLoading&&this.paginationInfo.total>0&&o("div",{key:"ed4c56668d6c35d1dfeae31b00d477e2385d09cd",class:"ticket-list-wrap"},this.ticketHistory.map((t=>o("lottery-tipping-panel",{"header-title":ht(new Date(t.createdAt),"dd/MM/yyyy HH:mm:ss")+" "+t.state},o("div",{class:"panel-content",slot:"content"},o("div",{class:"ticket-info"},o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Xh("ticketId",this.language)),o("div",{class:"ticket-info-val"},t.id," ")),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Xh("ticketType",this.language)),o("div",{class:"ticket-info-val"},this.ticketTypeMap[t.wagerType]," ")),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Xh("ticketAmount",this.language)),o("div",{class:"ticket-info-val"},`${t.amount} ${t.currency}`)),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Xh("lineDetail",this.language)),o("div",{class:"ticket-info-val"},o("span",{class:"show-detail-link",onClick:()=>this.handleShowTicketLineDetial(t)},Xh("seeDetails",this.language)))),o("div",{class:"ticket-info-item"},o("div",{class:"ticket-info-label"},Xh("numberOfDraw",this.language)),o("div",{class:"ticket-info-val"},t.drawCount))),"Settled"==t.state&&t.drawResults.map((t=>o("div",{class:"draw-info-container"},t.tempDrawData?o("div",{class:"draw-info"},o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Xh("ticketResult",this.language)),o("div",{class:"draw-info-val"},this.resultMap[t.state])),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Xh("drawId",this.language)),o("div",{class:"draw-info-val"},t.drawId)),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Xh("drawDate",this.language)),o("div",{class:"draw-info-val"},ht(new Date(t.tempDrawData.date),"dd/MM/yyyy"))),o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Xh("result",this.language)),o("div",{class:"draw-info-val"},o("span",{class:"show-detail-link",onClick:()=>this.handleShowCurrentDraw(t.tempDrawData)},Xh("seeDetails",this.language)))),t.state===Rc.WON&&o("div",{class:"draw-info-item"},o("div",{class:"draw-info-label"},Xh("prize",this.language)),o("div",{class:"draw-info-val1"},o("div",{style:{height:"20px"}}),t.prizeDetails.map((t=>o("span",null,o("div",null,o("span",{style:{color:"rgb(85, 85, 85)"}},t.prizeName,t.times>1?" x "+t.times:"",":"," "),o("span",{style:{"margin-right":"4px",color:"rgb(85, 85, 85)"}},function(t){if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")}(t.amount)),o("span",{style:{color:"rgb(85, 85, 85)"}},t.currency)))))))):o("div",{class:"draw-info-skeleton"},[...Array(5)].map((()=>o("div",{class:"skeleton-line"})))))))))))),!this.isLoading&&0===this.paginationInfo.total&&o("div",{key:"cfc0d7ac1b6c9889a1c506c4c4c619edd090ed00",class:"empty-wrap"},Xh("noData",this.language)),o("lottery-tipping-dialog",{key:"a14a317cffd4610bcbff55921e269c745126d022",visible:this.showCurrentTicketLine,width:rc(window.navigator.userAgent)?void 0:"720px",fullscreen:rc(window.navigator.userAgent),closable:!0,showFooter:!1,onCancel:()=>{this.showCurrentTicketLine=!1},language:this.language,"translation-url":this.translationUrl},this.curSelection&&this.curSelection.length&&this.showCurrentTicketLine&&o("div",{key:"9d4a8cbb7ae6ef0fcb4fbcbe319536af5f2f0d61"},o("div",{key:"e2be8d66a0b0c8685f2f4c25a4c1a636559a173b",class:"betting-type"},o("div",{key:"55679755750f29adbda546b4fee562738dcad2ea",class:"betting-type-title"},Xh("bettingType",this.language)),o("div",{key:"6c2515cc5d387b1536725def1327de0c2663e533",class:"betting-type-text"},this.getBettingTypeName(this.getBettingType(this.curTicketItem.selection[this.curSelectionIdx].betType)))),o("lottery-tipping-ticket-bet",{key:"cc1b2ad744b29b0cae220fec69da53ded46c953e",endpoint:this.endpoint,"session-id":this.sessionId,"game-id":this.curTicketItem.vendorGameId,"draw-id":this.curTicketItem.startingDrawId,"default-bullet-config-line-group":JSON.stringify(this.curSelection),"read-pretty":!0,"total-pages":this.curSelection.length,language:this.language,"translation-url":this.translationUrl}))),o("lottery-tipping-dialog",{key:"575831b309b2c3b43e813483e9064803cdbc0463",visible:this.showCurrentDrawResult,width:rc(window.navigator.userAgent)?void 0:"720px",fullscreen:rc(window.navigator.userAgent),closable:!0,showFooter:!1,onCancel:()=>{this.showCurrentDrawResult=!1},language:this.language,"translation-url":this.translationUrl},this.curDrawSelection&&this.curDrawSelection.length&&this.showCurrentDrawResult&&o("div",{key:"cdf73ca5a7263941b935525f18fd39b1d6034d49"},o("div",{key:"ac5cd287a42677779903b6ead9c73848a150cd26",class:"betting-type"},o("div",{key:"86310f6933002c9af336a712d2f29af258e88181",class:"betting-type-title"},Xh("bettingType",this.language)),o("div",{key:"6c13ff903cbcb05c51c57a2691ac9b8658131221",class:"betting-type-text"},o("div",{key:"826113f7035e8ef5561bf7aea1e55b021eb316ae",class:"LotteryTippingTicketController__segmented-control"},Object.keys(this.curDrawSelectionMap).map((t=>o("button",{class:{LotteryTippingTicketController__segment:!0,"LotteryTippingTicketController__segment--active":this.curDrawSelectionBettingType===t},onClick:()=>this.handleDrawBettingTypeChange(t)},this.getBettingTypeName(t))))))),o("lottery-tipping-ticket-bet",{key:"367642bb4fc8ad2c00a3b796d5a1feda6435e0d6",endpoint:this.endpoint,"session-id":this.sessionId,"game-id":this.curDrawItem.vendorGameId,"draw-id":this.curDrawItem.id,"default-bullet-config-line-group":JSON.stringify(this.curDrawSelection),"read-pretty":!0,"total-pages":this.curDrawSelection.length,language:this.language,"translation-url":this.translationUrl}))),o("div",{key:"886648a3e69f2508c1296dde6ce36e5b33190a8b",class:"pagination-wrap"},o("lottery-tipping-pagination",{key:"91141bf75596923734a49f9550cb9abed9846917",total:this.paginationInfo.total,current:this.paginationInfo.current,"page-size":this.paginationInfo.pageSize,language:this.language,"translation-url":this.translationUrl})))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],gameId:["handleGameInfoChange"],endpoint:["handleGameInfoChange"],playerId:["handleTicketInfoChange"],sessionId:["handleTicketInfoChange"]}}};Uc.style="@keyframes skeleton-loading{0%{background-position:200% 0}100%{background-position:-200% 0}}.lottery-tipping-ticket-history{padding:12px}.lottery-tipping-ticket-history .ticket-history-title{margin:20px 0;text-align:center;font-size:20px;font-weight:700;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .ticket-info{display:flex;flex-direction:column;gap:12px}.lottery-tipping-ticket-history .ticket-info-item{display:flex;align-items:center;user-select:none}.lottery-tipping-ticket-history .ticket-info-label{margin-right:12px;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .ticket-info-val{color:var(--emw--color-typography-secondary, #555)}.lottery-tipping-ticket-history .ticket-list-wrap{display:flex;flex-direction:column;gap:12px}.lottery-tipping-ticket-history .draw-info-skeleton{width:30%;min-width:300px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:5px;display:flex;flex-direction:column;gap:10px;padding:10px}.lottery-tipping-ticket-history .skeleton-line{height:16px;border-radius:4px;background:linear-gradient(90deg, var(--emw--color-gray-100, #e6e6e6) 25%, var(--emw--color-gray-50, #f5f5f5) 50%, var(--emw--color-gray-100, #e6e6e6) 75%);background-size:200% 100%;animation:skeleton-loading 1.2s infinite}.lottery-tipping-ticket-history .draw-info{width:30%;min-width:300px;border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));border-radius:5px;padding:12px;margin-top:20px;display:flex;flex-direction:column;gap:8px;user-select:none}.lottery-tipping-ticket-history .draw-info-item{display:flex}.lottery-tipping-ticket-history .draw-info-label{margin-right:6px;color:var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .draw-info-val{color:var(--emw--color-typography-secondary, #555)}.lottery-tipping-ticket-history .show-detail-link{color:var(--emw-pool-game-acition-normal, #4a90e2);text-decoration:underline;cursor:pointer}.lottery-tipping-ticket-history .filter-wrap{margin-bottom:20px;display:flex;justify-content:space-between;align-items:center}.lottery-tipping-ticket-history .filter-wrap .filter-status{display:flex;gap:12px;align-items:center}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn{background:var(--emw--color-background, #fff);border:2px solid var(--emw--color-primary, #fed275);border-radius:4px;padding:10px 8px;font-size:12px;text-transform:uppercase;color:var(--emw--color-typography, #000);cursor:pointer;transition:all 0.2s linear}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn:hover{background-color:var(--emw--color-secondary, #fff3b9)}.lottery-tipping-ticket-history .filter-wrap .filter-status-btn.active{background:var(--emw--color-secondary, #fff3b9);color:var(--emw--color-typography, #000);border:2px solid var(--emw--color-typography, #000)}.lottery-tipping-ticket-history .pagination-wrap{margin-top:20px;display:flex;justify-content:flex-end}@media screen and (min-width: 1200px){.lottery-tipping-ticket-history{padding:24px;width:60%;margin:0 auto}}@media screen and (max-width: 480px){.lottery-tipping-ticket-history{padding:2px}.lottery-tipping-ticket-history .filter-wrap .filter-status{gap:4px}}.loading-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:40vh}.loading-wrap .dots-container{display:flex;align-items:center;justify-content:center;height:100%;width:100%}.loading-wrap .dot{height:14px;width:14px;margin-right:14px;border-radius:14px;background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);animation:pulse 1.5s infinite ease-in-out}.loading-wrap .dot:last-child{margin-right:0}.loading-wrap .dot:nth-child(1){animation-delay:-0.3s}.loading-wrap .dot:nth-child(2){animation-delay:-0.1s}.loading-wrap .dot:nth-child(3){animation-delay:0.1s}@keyframes pulse{0%{transform:scale(0.8);background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);box-shadow:0 0 0 0 var(--emw-pool-game-ticket-history-loading-box-shadow-normal, rgba(178, 212, 252, 0.7))}50%{transform:scale(1.2);background-color:var(--emw-pool-game-ticket-history-loading-active, #6793fb);box-shadow:0 0 0 10px var(--emw-pool-game-ticket-history-loading-box-shadow-active, rgba(178, 212, 252, 0))}100%{transform:scale(0.8);background-color:var(--emw-pool-game-ticket-history-loading-normal, #b3d4fc);box-shadow:0 0 0 0 rgba(178, 212, 252, 0.7)}}.empty-wrap{margin:20px 0;display:flex;align-items:center;justify-content:center;min-height:40vh;color:var(--emw--color-typography, #000)}.betting-type{margin-bottom:16px;display:flex;align-items:center;gap:20px}.betting-type-title{font-weight:600;font-size:16px}.betting-type-text{font-size:16px}.LotteryTippingTicketController__label{font-weight:500;white-space:nowrap;width:6rem;color:var(--emw--color-typography-secondary, #333)}.LotteryTippingTicketController__segmented-control{height:2.2rem;display:inline-flex;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:2rem;padding:0.2rem}.LotteryTippingTicketController__segment{background-color:transparent;border:none;padding:0.3rem 0.8rem;cursor:pointer;font-weight:500;border-radius:2rem;outline:none;transition:background-color 0.25s ease, color 0.25s ease;white-space:nowrap;color:var(--emw--color-typography, #000)}.LotteryTippingTicketController__segment--active{background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000);font-weight:600}.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover{background-color:var(--emw--color-background-tertiary, #ccc)}";export{l as general_multi_select,h as general_tooltip,_t as lottery_banner,St as lottery_button,Tt as lottery_tipping_bullet,At as lottery_tipping_bullet_group,Bt as lottery_tipping_dialog,Zh as lottery_tipping_filter,sc as lottery_tipping_pagination,lc as lottery_tipping_panel,yc as lottery_tipping_ticket_bet,Bc as lottery_tipping_ticket_controller,Uc as lottery_tipping_ticket_history}
|