@quandis/qbo4.ui 4.0.1-CI-20250107-002248 → 4.0.1-CI-20250107-190636
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/package.json +2 -2
- package/src/qbo/qbo-paginate.js +10 -8
- package/src/qbo/qbo-paginate.ts +12 -11
- package/wwwroot/js/esm/qbo4.ui.js +30 -12
- package/wwwroot/js/esm/qbo4.ui.min.js +1 -1
- package/wwwroot/js/esm/qbo4.ui.min.js.map +1 -1
- package/wwwroot/js/qbo4.ui.js +30 -12
- package/wwwroot/js/qbo4.ui.min.js +1 -1
- package/wwwroot/js/qbo4.ui.min.js.map +1 -1
|
@@ -89,7 +89,7 @@ ${Array.from(co.keys()).map((t=>Ve`<div class="col-3">
|
|
|
89
89
|
</li>
|
|
90
90
|
</div>
|
|
91
91
|
`))}
|
|
92
|
-
</div>`}renderIcon(e){null!=e.icon&&void 0!==e.icon||(console.warn("qbo-icon: icon attribute is required"),e.icon="warning");const t=co.has(e.icon)?co.get(e.icon):e.icon;return Ve`<svg width="${e.width}" height="${e.width}" fill="${e.fill}" ?class=${e.getAttribute("class")}><use href="${e.sprite??ao.spriteUrl}#${t}"></use></svg>`}render(){switch(this.type){case"icon":case"button":case"toggle":default:return this.renderIcon(this);case"standard":return this.renderStandard(this);case"all":return Ve`${io(this.renderAll(this),Ve`Loading...`)}`}}};so([mt(),lo("design:type",String)],bo.prototype,"type",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"sprite",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"icon",void 0),so([mt(),lo("design:type",String)],bo.prototype,"height",void 0),so([mt(),lo("design:type",String)],bo.prototype,"width",void 0),so([mt(),lo("design:type",String)],bo.prototype,"viewbox",void 0),so([mt(),lo("design:type",String)],bo.prototype,"fill",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"backgroundColor",void 0),so([mt(),lo("design:type",Boolean)],bo.prototype,"disabled",void 0),so([mt({type:Boolean,reflect:!0}),lo("design:type",Object)],bo.prototype,"renderInHost",void 0),so([mt({type:Boolean,reflect:!0}),lo("design:type",Boolean)],bo.prototype,"selected",void 0),bo=ao=so([bt("qbo-icon")],bo);const uo=Math.min,po=Math.max,mo=Math.round,ho=(Math.floor,e=>({x:e,y:e})),fo={left:"right",right:"left",bottom:"top",top:"bottom"},go={start:"end",end:"start"};function vo(e,t,o){return po(e,uo(t,o))}function yo(e,t){return"function"==typeof e?e(t):e}function qo(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function xo(e){return"x"===e?"y":"x"}function ko(e){return"y"===e?"height":"width"}function Co(e){return["top","bottom"].includes(qo(e))?"y":"x"}function Eo(e){return xo(Co(e))}function $o(e){return e.replace(/start|end/g,(e=>go[e]))}function So(e){return e.replace(/left|right|bottom|top/g,(e=>fo[e]))}function Oo(e){const{x:t,y:o,width:n,height:r}=e;return{width:n,height:r,top:o,left:t,right:t+n,bottom:o+r,x:t,y:o}}function _o(e,t,o){let{reference:n,floating:r}=e;const i=Co(t),a=Eo(t),s=ko(a),l=qo(t),d="y"===i,c=n.x+n.width/2-r.width/2,b=n.y+n.height/2-r.height/2,u=n[s]/2-r[s]/2;let p;switch(l){case"top":p={x:c,y:n.y-r.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:b};break;case"left":p={x:n.x-r.width,y:b};break;default:p={x:n.x,y:n.y}}switch(wo(t)){case"start":p[a]-=u*(o&&d?-1:1);break;case"end":p[a]+=u*(o&&d?-1:1)}return p}async function Ao(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:b="floating",altBoundary:u=!1,padding:p=0}=yo(t,e),m=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(p),h=s[u?"floating"===b?"reference":"floating":b],f=Oo(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(h)))||o?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),g="floating"===b?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},q=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(f.top-q.top+m.top)/y.y,bottom:(q.bottom-f.bottom+m.bottom)/y.y,left:(f.left-q.left+m.left)/y.x,right:(q.right-f.right+m.right)/y.x}}function Ro(){return"undefined"!=typeof window}function Uo(e){return To(e)?(e.nodeName||"").toLowerCase():"#document"}function jo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Po(e){var t;return null==(t=(To(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function To(e){return!!Ro()&&(e instanceof Node||e instanceof jo(e).Node)}function Mo(e){return!!Ro()&&(e instanceof Element||e instanceof jo(e).Element)}function zo(e){return!!Ro()&&(e instanceof HTMLElement||e instanceof jo(e).HTMLElement)}function Do(e){return!(!Ro()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof jo(e).ShadowRoot)}function Lo(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Fo(e){return["table","td","th"].includes(Uo(e))}function Io(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ho(e){const t=Bo(),o=Mo(e)?Vo(e):e;return"none"!==o.transform||"none"!==o.perspective||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function Bo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function No(e){return["html","body","#document"].includes(Uo(e))}function Vo(e){return jo(e).getComputedStyle(e)}function Wo(e){return Mo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ko(e){if("html"===Uo(e))return e;const t=e.assignedSlot||e.parentNode||Do(e)&&e.host||Po(e);return Do(t)?t.host:t}function Jo(e){const t=Ko(e);return No(t)?e.ownerDocument?e.ownerDocument.body:e.body:zo(t)&&Lo(t)?t:Jo(t)}function Qo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Jo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=jo(r);if(i){const e=Yo(a);return t.concat(a,a.visualViewport||[],Lo(r)?r:[],e&&o?Qo(e):[])}return t.concat(r,Qo(r,[],o))}function Yo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xo(e){const t=Vo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=zo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,s=mo(o)!==i||mo(n)!==a;return s&&(o=i,n=a),{width:o,height:n,$:s}}function Zo(e){return Mo(e)?e:e.contextElement}function Go(e){const t=Zo(e);if(!zo(t))return ho(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=Xo(t);let a=(i?mo(o.width):o.width)/n,s=(i?mo(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const en=ho(0);function tn(e){const t=jo(e);return Bo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:en}function on(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Zo(e);let a=ho(1);t&&(n?Mo(n)&&(a=Go(n)):a=Go(e));const s=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==jo(e))&&t}(i,o,n)?tn(i):ho(0);let l=(r.left+s.x)/a.x,d=(r.top+s.y)/a.y,c=r.width/a.x,b=r.height/a.y;if(i){const e=jo(i),t=n&&Mo(n)?jo(n):n;let o=e,r=Yo(o);for(;r&&n&&t!==o;){const e=Go(r),t=r.getBoundingClientRect(),n=Vo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,d*=e.y,c*=e.x,b*=e.y,l+=i,d+=a,o=jo(r),r=Yo(o)}}return Oo({width:c,height:b,x:l,y:d})}function nn(e,t){const o=Wo(e).scrollLeft;return t?t.left+o:on(Po(e)).left+o}function rn(e,t,o){void 0===o&&(o=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(o?0:nn(e,n)),y:n.top+t.scrollTop}}function an(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=jo(e),n=Po(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=Bo();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,o);else if("document"===t)n=function(e){const t=Po(e),o=Wo(e),n=e.ownerDocument.body,r=po(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=po(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+nn(e);const s=-o.scrollTop;return"rtl"===Vo(n).direction&&(a+=po(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:s}}(Po(e));else if(Mo(t))n=function(e,t){const o=on(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=zo(e)?Go(e):ho(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=tn(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oo(n)}function sn(e,t){const o=Ko(e);return!(o===t||!Mo(o)||No(o))&&("fixed"===Vo(o).position||sn(o,t))}function ln(e,t,o){const n=zo(t),r=Po(t),i="fixed"===o,a=on(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ho(0);if(n||!n&&!i)if(("body"!==Uo(t)||Lo(r))&&(s=Wo(t)),n){const e=on(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&(l.x=nn(r));const d=!r||n||i?ho(0):rn(r,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function dn(e){return"static"===Vo(e).position}function cn(e,t){if(!zo(e)||"fixed"===Vo(e).position)return null;if(t)return t(e);let o=e.offsetParent;return Po(e)===o&&(o=o.ownerDocument.body),o}function bn(e,t){const o=jo(e);if(Io(e))return o;if(!zo(e)){let t=Ko(e);for(;t&&!No(t);){if(Mo(t)&&!dn(t))return t;t=Ko(t)}return o}let n=cn(e,t);for(;n&&Fo(n)&&dn(n);)n=cn(n,t);return n&&No(n)&&dn(n)&&!Ho(n)?o:n||function(e){let t=Ko(e);for(;zo(t)&&!No(t);){if(Ho(t))return t;if(Io(t))return null;t=Ko(t)}return null}(e)||o}const un={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Po(n),s=!!t&&Io(t.floating);if(n===a||s&&i)return o;let l={scrollLeft:0,scrollTop:0},d=ho(1);const c=ho(0),b=zo(n);if((b||!b&&!i)&&(("body"!==Uo(n)||Lo(a))&&(l=Wo(n)),zo(n))){const e=on(n);d=Go(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}const u=!a||b||i?ho(0):rn(a,l,!0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:o.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Po,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?Io(t)?[]:function(e,t){const o=t.get(e);if(o)return o;let n=Qo(e,[],!1).filter((e=>Mo(e)&&"body"!==Uo(e))),r=null;const i="fixed"===Vo(e).position;let a=i?Ko(e):e;for(;Mo(a)&&!No(a);){const t=Vo(a),o=Ho(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Lo(a)&&!o&&sn(e,a))?n=n.filter((e=>e!==a)):r=t,a=Ko(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],s=i.reduce(((e,o)=>{const n=an(t,o,r);return e.top=po(n.top,e.top),e.right=uo(n.right,e.right),e.bottom=uo(n.bottom,e.bottom),e.left=po(n.left,e.left),e}),an(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:bn,getElementRects:async function(e){const t=this.getOffsetParent||bn,o=this.getDimensions,n=await o(e.floating);return{reference:ln(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=Xo(e);return{width:t,height:o}},getScale:Go,isElement:Mo,isRTL:function(e){return"rtl"===Vo(e).direction}},pn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=yo(e,t),d={x:o,y:n},c=await Ao(t,l),b=Co(qo(r)),u=xo(b);let p=d[u],m=d[b];if(i){const e="y"===u?"bottom":"right";p=vo(p+c["y"===u?"top":"left"],p,p-c[e])}if(a){const e="y"===b?"bottom":"right";m=vo(m+c["y"===b?"top":"left"],m,m-c[e])}const h=s.fn({...t,[u]:p,[b]:m});return{...h,data:{x:h.x-o,y:h.y-n,enabled:{[u]:i,[b]:a}}}}}},mn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:d}=t,{mainAxis:c=!0,crossAxis:b=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...f}=yo(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const g=qo(r),v=Co(s),y=qo(s)===s,q=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!h?[So(s)]:function(e){const t=So(e);return[$o(e),t,$o(t)]}(s)),x="none"!==m;!u&&x&&w.push(...function(e,t,o,n){const r=wo(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(qo(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map($o)))),i}(s,h,m,q));const k=[s,...w],C=await Ao(t,f),E=[];let $=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&E.push(C[g]),b){const e=function(e,t,o){void 0===o&&(o=!1);const n=wo(e),r=Eo(e),i=ko(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=So(a)),[a,So(a)]}(r,a,q);E.push(C[e[0]],C[e[1]])}if($=[...$,{placement:r,overflows:E}],!E.every((e=>e<=0))){var S,O;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=k[e];if(t)return{data:{index:e,overflows:$},reset:{placement:t}};let o=null==(O=$.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=$.filter((e=>{if(x){const t=Co(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=s}if(r!==o)return{reset:{placement:o}}}return{}}}},hn=(e,t,o)=>{const n=new Map,r={platform:un,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:b}=_o(d,n,l),u=n,p={},m=0;for(let o=0;o<s.length;o++){const{name:i,fn:h}=s[o],{x:f,y:g,data:v,reset:y}=await h({x:c,y:b,initialPlacement:n,placement:u,strategy:r,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});c=null!=f?f:c,b=null!=g?g:b,p={...p,[i]:{...p[i],...v}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:c,y:b}=_o(d,u,l))),o=-1)}return{x:c,y:b,placement:u,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var fn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},gn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class vn extends dt{constructor(){super(...arguments),this.placement="bottom-start",this.type="dropdown",this.target=null,this.isOpen=!1,this.middleware=[mn(),pn()],this.handleMenuOpen=e=>{e.preventDefault(),e.stopPropagation(),e.detail.menu!==this&&this.isOpen&&this.closeMenu()},this.handleOutsideClick=e=>{e.target,e.composedPath().includes(this)||this.closeMenu()},this.showContextMenu=e=>{const t=e;e.preventDefault(),e.stopPropagation(),this.isOpen=!0,this.menuContainer.classList.toggle("open",this.isOpen);const o={getBoundingClientRect:()=>({x:t.clientX,y:t.clientY,width:0,height:0,top:t.clientY,left:t.clientX,right:t.clientX,bottom:t.clientY})};this.updateMenuPosition(o)},this.toggleMenu=e=>{e.target;const t=e.composedPath();t.includes(this.triggerButton)&&!t.includes(this.menuContainer)&&(this.isOpen=!this.isOpen,this.menuContainer.classList.toggle("open",this.isOpen),this.isOpen&&(this.updateMenuPosition(this.triggerButton),document.dispatchEvent(new CustomEvent("qbo-menu-open",{bubbles:!0,composed:!0,detail:{menu:this}}))))}}static{this.styles=ae``}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick),"context"===this.type?this.triggerButton.removeEventListener("contextmenu",this.showContextMenu):this.triggerButton.removeEventListener("click",this.toggleMenu)}firstUpdated(e){super.firstUpdated(e),this.triggerButton=this.querySelector("*[data-trigger]")||this.querySelector("button")||this.parentElement,this.menuContainer=this.querySelector("*[data-content]")||this.querySelector("aside")||this.querySelector("menu"),"context"===this.type?(this.target&&(this.triggerButton=this.closest(this.target)||(()=>{const e=this.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e.querySelector(this.target):null})()||document.querySelector(this.target)||document),this.triggerButton.addEventListener("contextmenu",this.showContextMenu)):null!=this.triggerButton&&this.triggerButton.addEventListener("click",this.toggleMenu)}closeMenu(){this.isOpen=!1,this.menuContainer.classList.remove("open")}async updateMenuPosition(e){console.log(e,typeof e);const{x:t,y:o}=await hn(e,this.menuContainer,{placement:this.placement,middleware:this.middleware,strategy:"fixed"});Object.assign(this.menuContainer.style,{left:`${t}px`,top:`${o}px`})}render(){return Ve`<slot></slot>`}}fn([mt({type:String}),gn("design:type",String)],vn.prototype,"placement",void 0),fn([mt(),gn("design:type",String)],vn.prototype,"type",void 0),fn([mt(),gn("design:type",Object)],vn.prototype,"target",void 0),fn([ht(),gn("design:type",Object)],vn.prototype,"isOpen",void 0),customElements.get("qbo-menu")||customElements.define("qbo-menu",vn);var yn,qn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},wn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let xn=class extends dt{constructor(){super(...arguments),this.renderInHost=!0,this.continuous=!1,this.interimResults=!1,this.maxAlternatives=1,this.for="input",this.class="input-group-text bi bi-headset",this.activeClass="bg-primary-subtle",this._recognition=null,this.target=null,this.listening=!1}static{yn=this}static{this.activeInstance=null}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.listen);const e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=this.continuous,e.interimResults=this.interimResults,e.maxAlternatives=this.maxAlternatives,e.onresult=e=>{this.onResult(e)},e.onspeechend=e=>{this.stop(e)},e.onerror=e=>{this.error(e)},this._recognition=e,this.target=document.getElementById(this.for)||this.querySelector(this.for)||this.parentElement?.querySelector(this.for),null==this.target&&console.log(`qbo-microphone: no target found for ${this.for}`)}disconnectedCallback(){this.removeEventListener("click",this.listen),super.disconnectedCallback()}onResult(e){const t=e.results[e.results.length-1][0].transcript;if(console.log("Result: "+t),null==this.target)return;const o=this.target;if(o instanceof HTMLInputElement)"radio"===o.type?o.value===t&&(o.checked=!0):this.continuous?o.value+=t:o.value=t;else if(o instanceof HTMLTextAreaElement)this.continuous?o.value+=t:o.value=t;else if(o instanceof HTMLSelectElement)for(let e=0;e<o.options.length;e++)if(o.options[e].value===t||o.options[e].text===t){o.selectedIndex=e;break}}listen(e){this.listening?this.stop(e):this.start()}start(){this.listening=!0,yn.activeInstance=this,this.activeClass&&this.classList.add(this.activeClass),console.log("listening"),this._recognition.start()}stop(e){this.listening=!1,yn.activeInstance=null,this.activeClass&&this.classList.remove(this.activeClass),console.log("stopped listening"),this._recognition.stop(),this._recognition.abort()}error(e){console.log("Error during speech recognition:",e)}render(){return Ve`<slot></slot>`}};qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"renderInHost",void 0),qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"continuous",void 0),qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"interimResults",void 0),qn([mt({type:Number}),wn("design:type",Object)],xn.prototype,"maxAlternatives",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"for",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"class",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"activeClass",void 0),xn=yn=qn([bt("qbo-microphone")],xn);var kn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},Cn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let En=class extends dt{constructor(){super(...arguments),this.display=25,this.start=0,this.count=0,this.pageLimit=10,this.currentPage=1,this.rollingView=!0,this.editSize=!0,this.displayCountText="Results per page:"}get maxPage(){return Math.floor(this.count/this.display)+(this.count%this.display==0?0:1)}static{this.styles=[kt,ae``]}goToPage(e){e!=this.currentPage&&e>0&&e<=this.maxPage&&(this.currentPage=e,this.dispatchEvent(new CustomEvent("change",{detail:{start:(e-1)*this.display,display:this.display,page:e},bubbles:!0,composed:!0})))}renderPage(e){return Ve`<li class="${this.currentPage===e?"active":""}">
|
|
92
|
+
</div>`}renderIcon(e){null!=e.icon&&void 0!==e.icon||(console.warn("qbo-icon: icon attribute is required"),e.icon="warning");const t=co.has(e.icon)?co.get(e.icon):e.icon;return Ve`<svg width="${e.width}" height="${e.width}" fill="${e.fill}" ?class=${e.getAttribute("class")}><use href="${e.sprite??ao.spriteUrl}#${t}"></use></svg>`}render(){switch(this.type){case"icon":case"button":case"toggle":default:return this.renderIcon(this);case"standard":return this.renderStandard(this);case"all":return Ve`${io(this.renderAll(this),Ve`Loading...`)}`}}};so([mt(),lo("design:type",String)],bo.prototype,"type",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"sprite",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"icon",void 0),so([mt(),lo("design:type",String)],bo.prototype,"height",void 0),so([mt(),lo("design:type",String)],bo.prototype,"width",void 0),so([mt(),lo("design:type",String)],bo.prototype,"viewbox",void 0),so([mt(),lo("design:type",String)],bo.prototype,"fill",void 0),so([mt(),lo("design:type",Object)],bo.prototype,"backgroundColor",void 0),so([mt(),lo("design:type",Boolean)],bo.prototype,"disabled",void 0),so([mt({type:Boolean,reflect:!0}),lo("design:type",Object)],bo.prototype,"renderInHost",void 0),so([mt({type:Boolean,reflect:!0}),lo("design:type",Boolean)],bo.prototype,"selected",void 0),bo=ao=so([bt("qbo-icon")],bo);const uo=Math.min,po=Math.max,mo=Math.round,ho=(Math.floor,e=>({x:e,y:e})),fo={left:"right",right:"left",bottom:"top",top:"bottom"},go={start:"end",end:"start"};function vo(e,t,o){return po(e,uo(t,o))}function yo(e,t){return"function"==typeof e?e(t):e}function qo(e){return e.split("-")[0]}function wo(e){return e.split("-")[1]}function xo(e){return"x"===e?"y":"x"}function ko(e){return"y"===e?"height":"width"}function Co(e){return["top","bottom"].includes(qo(e))?"y":"x"}function Eo(e){return xo(Co(e))}function $o(e){return e.replace(/start|end/g,(e=>go[e]))}function So(e){return e.replace(/left|right|bottom|top/g,(e=>fo[e]))}function Oo(e){const{x:t,y:o,width:n,height:r}=e;return{width:n,height:r,top:o,left:t,right:t+n,bottom:o+r,x:t,y:o}}function _o(e,t,o){let{reference:n,floating:r}=e;const i=Co(t),a=Eo(t),s=ko(a),l=qo(t),d="y"===i,c=n.x+n.width/2-r.width/2,b=n.y+n.height/2-r.height/2,u=n[s]/2-r[s]/2;let p;switch(l){case"top":p={x:c,y:n.y-r.height};break;case"bottom":p={x:c,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:b};break;case"left":p={x:n.x-r.width,y:b};break;default:p={x:n.x,y:n.y}}switch(wo(t)){case"start":p[a]-=u*(o&&d?-1:1);break;case"end":p[a]+=u*(o&&d?-1:1)}return p}async function Ao(e,t){var o;void 0===t&&(t={});const{x:n,y:r,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:b="floating",altBoundary:u=!1,padding:p=0}=yo(t,e),m=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(p),h=s[u?"floating"===b?"reference":"floating":b],f=Oo(await i.getClippingRect({element:null==(o=await(null==i.isElement?void 0:i.isElement(h)))||o?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),g="floating"===b?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),y=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},q=Oo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(f.top-q.top+m.top)/y.y,bottom:(q.bottom-f.bottom+m.bottom)/y.y,left:(f.left-q.left+m.left)/y.x,right:(q.right-f.right+m.right)/y.x}}function Ro(){return"undefined"!=typeof window}function Uo(e){return To(e)?(e.nodeName||"").toLowerCase():"#document"}function jo(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Po(e){var t;return null==(t=(To(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function To(e){return!!Ro()&&(e instanceof Node||e instanceof jo(e).Node)}function Mo(e){return!!Ro()&&(e instanceof Element||e instanceof jo(e).Element)}function zo(e){return!!Ro()&&(e instanceof HTMLElement||e instanceof jo(e).HTMLElement)}function Do(e){return!(!Ro()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof jo(e).ShadowRoot)}function Lo(e){const{overflow:t,overflowX:o,overflowY:n,display:r}=Vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+o)&&!["inline","contents"].includes(r)}function Fo(e){return["table","td","th"].includes(Uo(e))}function Io(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(e){return!1}}))}function Ho(e){const t=Bo(),o=Mo(e)?Vo(e):e;return["transform","translate","scale","rotate","perspective"].some((e=>!!o[e]&&"none"!==o[e]))||!!o.containerType&&"normal"!==o.containerType||!t&&!!o.backdropFilter&&"none"!==o.backdropFilter||!t&&!!o.filter&&"none"!==o.filter||["transform","translate","scale","rotate","perspective","filter"].some((e=>(o.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(o.contain||"").includes(e)))}function Bo(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function No(e){return["html","body","#document"].includes(Uo(e))}function Vo(e){return jo(e).getComputedStyle(e)}function Wo(e){return Mo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ko(e){if("html"===Uo(e))return e;const t=e.assignedSlot||e.parentNode||Do(e)&&e.host||Po(e);return Do(t)?t.host:t}function Jo(e){const t=Ko(e);return No(t)?e.ownerDocument?e.ownerDocument.body:e.body:zo(t)&&Lo(t)?t:Jo(t)}function Qo(e,t,o){var n;void 0===t&&(t=[]),void 0===o&&(o=!0);const r=Jo(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),a=jo(r);if(i){const e=Yo(a);return t.concat(a,a.visualViewport||[],Lo(r)?r:[],e&&o?Qo(e):[])}return t.concat(r,Qo(r,[],o))}function Yo(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xo(e){const t=Vo(e);let o=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=zo(e),i=r?e.offsetWidth:o,a=r?e.offsetHeight:n,s=mo(o)!==i||mo(n)!==a;return s&&(o=i,n=a),{width:o,height:n,$:s}}function Zo(e){return Mo(e)?e:e.contextElement}function Go(e){const t=Zo(e);if(!zo(t))return ho(1);const o=t.getBoundingClientRect(),{width:n,height:r,$:i}=Xo(t);let a=(i?mo(o.width):o.width)/n,s=(i?mo(o.height):o.height)/r;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const en=ho(0);function tn(e){const t=jo(e);return Bo()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:en}function on(e,t,o,n){void 0===t&&(t=!1),void 0===o&&(o=!1);const r=e.getBoundingClientRect(),i=Zo(e);let a=ho(1);t&&(n?Mo(n)&&(a=Go(n)):a=Go(e));const s=function(e,t,o){return void 0===t&&(t=!1),!(!o||t&&o!==jo(e))&&t}(i,o,n)?tn(i):ho(0);let l=(r.left+s.x)/a.x,d=(r.top+s.y)/a.y,c=r.width/a.x,b=r.height/a.y;if(i){const e=jo(i),t=n&&Mo(n)?jo(n):n;let o=e,r=Yo(o);for(;r&&n&&t!==o;){const e=Go(r),t=r.getBoundingClientRect(),n=Vo(r),i=t.left+(r.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(r.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,d*=e.y,c*=e.x,b*=e.y,l+=i,d+=a,o=jo(r),r=Yo(o)}}return Oo({width:c,height:b,x:l,y:d})}function nn(e,t){const o=Wo(e).scrollLeft;return t?t.left+o:on(Po(e)).left+o}function rn(e,t,o){void 0===o&&(o=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(o?0:nn(e,n)),y:n.top+t.scrollTop}}function an(e,t,o){let n;if("viewport"===t)n=function(e,t){const o=jo(e),n=Po(e),r=o.visualViewport;let i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(r){i=r.width,a=r.height;const e=Bo();(!e||e&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,o);else if("document"===t)n=function(e){const t=Po(e),o=Wo(e),n=e.ownerDocument.body,r=po(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=po(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let a=-o.scrollLeft+nn(e);const s=-o.scrollTop;return"rtl"===Vo(n).direction&&(a+=po(t.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:s}}(Po(e));else if(Mo(t))n=function(e,t){const o=on(e,!0,"fixed"===t),n=o.top+e.clientTop,r=o.left+e.clientLeft,i=zo(e)?Go(e):ho(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:n*i.y}}(t,o);else{const o=tn(e);n={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oo(n)}function sn(e,t){const o=Ko(e);return!(o===t||!Mo(o)||No(o))&&("fixed"===Vo(o).position||sn(o,t))}function ln(e,t,o){const n=zo(t),r=Po(t),i="fixed"===o,a=on(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=ho(0);if(n||!n&&!i)if(("body"!==Uo(t)||Lo(r))&&(s=Wo(t)),n){const e=on(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else r&&(l.x=nn(r));const d=!r||n||i?ho(0):rn(r,s);return{x:a.left+s.scrollLeft-l.x-d.x,y:a.top+s.scrollTop-l.y-d.y,width:a.width,height:a.height}}function dn(e){return"static"===Vo(e).position}function cn(e,t){if(!zo(e)||"fixed"===Vo(e).position)return null;if(t)return t(e);let o=e.offsetParent;return Po(e)===o&&(o=o.ownerDocument.body),o}function bn(e,t){const o=jo(e);if(Io(e))return o;if(!zo(e)){let t=Ko(e);for(;t&&!No(t);){if(Mo(t)&&!dn(t))return t;t=Ko(t)}return o}let n=cn(e,t);for(;n&&Fo(n)&&dn(n);)n=cn(n,t);return n&&No(n)&&dn(n)&&!Ho(n)?o:n||function(e){let t=Ko(e);for(;zo(t)&&!No(t);){if(Ho(t))return t;if(Io(t))return null;t=Ko(t)}return null}(e)||o}const un={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:o,offsetParent:n,strategy:r}=e;const i="fixed"===r,a=Po(n),s=!!t&&Io(t.floating);if(n===a||s&&i)return o;let l={scrollLeft:0,scrollTop:0},d=ho(1);const c=ho(0),b=zo(n);if((b||!b&&!i)&&(("body"!==Uo(n)||Lo(a))&&(l=Wo(n)),zo(n))){const e=on(n);d=Go(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}const u=!a||b||i?ho(0):rn(a,l,!0);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-l.scrollLeft*d.x+c.x+u.x,y:o.y*d.y-l.scrollTop*d.y+c.y+u.y}},getDocumentElement:Po,getClippingRect:function(e){let{element:t,boundary:o,rootBoundary:n,strategy:r}=e;const i=[..."clippingAncestors"===o?Io(t)?[]:function(e,t){const o=t.get(e);if(o)return o;let n=Qo(e,[],!1).filter((e=>Mo(e)&&"body"!==Uo(e))),r=null;const i="fixed"===Vo(e).position;let a=i?Ko(e):e;for(;Mo(a)&&!No(a);){const t=Vo(a),o=Ho(a);o||"fixed"!==t.position||(r=null),(i?!o&&!r:!o&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||Lo(a)&&!o&&sn(e,a))?n=n.filter((e=>e!==a)):r=t,a=Ko(a)}return t.set(e,n),n}(t,this._c):[].concat(o),n],a=i[0],s=i.reduce(((e,o)=>{const n=an(t,o,r);return e.top=po(n.top,e.top),e.right=uo(n.right,e.right),e.bottom=uo(n.bottom,e.bottom),e.left=po(n.left,e.left),e}),an(t,a,r));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:bn,getElementRects:async function(e){const t=this.getOffsetParent||bn,o=this.getDimensions,n=await o(e.floating);return{reference:ln(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:o}=Xo(e);return{width:t,height:o}},getScale:Go,isElement:Mo,isRTL:function(e){return"rtl"===Vo(e).direction}},pn=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:o,y:n,placement:r}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:o}=e;return{x:t,y:o}}},...l}=yo(e,t),d={x:o,y:n},c=await Ao(t,l),b=Co(qo(r)),u=xo(b);let p=d[u],m=d[b];if(i){const e="y"===u?"bottom":"right";p=vo(p+c["y"===u?"top":"left"],p,p-c[e])}if(a){const e="y"===b?"bottom":"right";m=vo(m+c["y"===b?"top":"left"],m,m-c[e])}const h=s.fn({...t,[u]:p,[b]:m});return{...h,data:{x:h.x-o,y:h.y-n,enabled:{[u]:i,[b]:a}}}}}},mn=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var o,n;const{placement:r,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:d}=t,{mainAxis:c=!0,crossAxis:b=!0,fallbackPlacements:u,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...f}=yo(e,t);if(null!=(o=i.arrow)&&o.alignmentOffset)return{};const g=qo(r),v=Co(s),y=qo(s)===s,q=await(null==l.isRTL?void 0:l.isRTL(d.floating)),w=u||(y||!h?[So(s)]:function(e){const t=So(e);return[$o(e),t,$o(t)]}(s)),x="none"!==m;!u&&x&&w.push(...function(e,t,o,n){const r=wo(e);let i=function(e,t,o){const n=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return o?t?r:n:t?n:r;case"left":case"right":return t?i:a;default:return[]}}(qo(e),"start"===o,n);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map($o)))),i}(s,h,m,q));const k=[s,...w],C=await Ao(t,f),E=[];let $=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&E.push(C[g]),b){const e=function(e,t,o){void 0===o&&(o=!1);const n=wo(e),r=Eo(e),i=ko(r);let a="x"===r?n===(o?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=So(a)),[a,So(a)]}(r,a,q);E.push(C[e[0]],C[e[1]])}if($=[...$,{placement:r,overflows:E}],!E.every((e=>e<=0))){var S,O;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=k[e];if(t)return{data:{index:e,overflows:$},reset:{placement:t}};let o=null==(O=$.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:O.placement;if(!o)switch(p){case"bestFit":{var _;const e=null==(_=$.filter((e=>{if(x){const t=Co(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:_[0];e&&(o=e);break}case"initialPlacement":o=s}if(r!==o)return{reset:{placement:o}}}return{}}}},hn=(e,t,o)=>{const n=new Map,r={platform:un,...o},i={...r.platform,_c:n};return(async(e,t,o)=>{const{placement:n="bottom",strategy:r="absolute",middleware:i=[],platform:a}=o,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let d=await a.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:b}=_o(d,n,l),u=n,p={},m=0;for(let o=0;o<s.length;o++){const{name:i,fn:h}=s[o],{x:f,y:g,data:v,reset:y}=await h({x:c,y:b,initialPlacement:n,placement:u,strategy:r,middlewareData:p,rects:d,platform:a,elements:{reference:e,floating:t}});c=null!=f?f:c,b=null!=g?g:b,p={...p,[i]:{...p[i],...v}},y&&m<=50&&(m++,"object"==typeof y&&(y.placement&&(u=y.placement),y.rects&&(d=!0===y.rects?await a.getElementRects({reference:e,floating:t,strategy:r}):y.rects),({x:c,y:b}=_o(d,u,l))),o=-1)}return{x:c,y:b,placement:u,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})};var fn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},gn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};class vn extends dt{constructor(){super(...arguments),this.placement="bottom-start",this.type="dropdown",this.target=null,this.isOpen=!1,this.middleware=[mn(),pn()],this.handleMenuOpen=e=>{e.preventDefault(),e.stopPropagation(),e.detail.menu!==this&&this.isOpen&&this.closeMenu()},this.handleOutsideClick=e=>{e.target,e.composedPath().includes(this)||this.closeMenu()},this.showContextMenu=e=>{const t=e;e.preventDefault(),e.stopPropagation(),this.isOpen=!0,this.menuContainer.classList.toggle("open",this.isOpen);const o={getBoundingClientRect:()=>({x:t.clientX,y:t.clientY,width:0,height:0,top:t.clientY,left:t.clientX,right:t.clientX,bottom:t.clientY})};this.updateMenuPosition(o)},this.toggleMenu=e=>{e.target;const t=e.composedPath();t.includes(this.triggerButton)&&!t.includes(this.menuContainer)&&(this.isOpen=!this.isOpen,this.menuContainer.classList.toggle("open",this.isOpen),this.isOpen&&(this.updateMenuPosition(this.triggerButton),document.dispatchEvent(new CustomEvent("qbo-menu-open",{bubbles:!0,composed:!0,detail:{menu:this}}))))}}static{this.styles=ae``}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.handleOutsideClick)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.handleOutsideClick),"context"===this.type?this.triggerButton.removeEventListener("contextmenu",this.showContextMenu):this.triggerButton.removeEventListener("click",this.toggleMenu)}firstUpdated(e){super.firstUpdated(e),this.triggerButton=this.querySelector("*[data-trigger]")||this.querySelector("button")||this.parentElement,this.menuContainer=this.querySelector("*[data-content]")||this.querySelector("aside")||this.querySelector("menu"),"context"===this.type?(this.target&&(this.triggerButton=this.closest(this.target)||(()=>{const e=this.getRootNode();return e instanceof ShadowRoot||e instanceof Document?e.querySelector(this.target):null})()||document.querySelector(this.target)||document),this.triggerButton.addEventListener("contextmenu",this.showContextMenu)):null!=this.triggerButton&&this.triggerButton.addEventListener("click",this.toggleMenu)}closeMenu(){this.isOpen=!1,this.menuContainer.classList.remove("open")}async updateMenuPosition(e){console.log(e,typeof e);const{x:t,y:o}=await hn(e,this.menuContainer,{placement:this.placement,middleware:this.middleware,strategy:"fixed"});Object.assign(this.menuContainer.style,{left:`${t}px`,top:`${o}px`})}render(){return Ve`<slot></slot>`}}fn([mt({type:String}),gn("design:type",String)],vn.prototype,"placement",void 0),fn([mt(),gn("design:type",String)],vn.prototype,"type",void 0),fn([mt(),gn("design:type",Object)],vn.prototype,"target",void 0),fn([ht(),gn("design:type",Object)],vn.prototype,"isOpen",void 0),customElements.get("qbo-menu")||customElements.define("qbo-menu",vn);var yn,qn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},wn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let xn=class extends dt{constructor(){super(...arguments),this.renderInHost=!0,this.continuous=!1,this.interimResults=!1,this.maxAlternatives=1,this.for="input",this.class="input-group-text bi bi-headset",this.activeClass="bg-primary-subtle",this._recognition=null,this.target=null,this.listening=!1}static{yn=this}static{this.activeInstance=null}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.listen);const e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=this.continuous,e.interimResults=this.interimResults,e.maxAlternatives=this.maxAlternatives,e.onresult=e=>{this.onResult(e)},e.onspeechend=e=>{this.stop(e)},e.onerror=e=>{this.error(e)},this._recognition=e,this.target=document.getElementById(this.for)||this.querySelector(this.for)||this.parentElement?.querySelector(this.for),null==this.target&&console.log(`qbo-microphone: no target found for ${this.for}`)}disconnectedCallback(){this.removeEventListener("click",this.listen),super.disconnectedCallback()}onResult(e){const t=e.results[e.results.length-1][0].transcript;if(console.log("Result: "+t),null==this.target)return;const o=this.target;if(o instanceof HTMLInputElement)"radio"===o.type?o.value===t&&(o.checked=!0):this.continuous?o.value+=t:o.value=t;else if(o instanceof HTMLTextAreaElement)this.continuous?o.value+=t:o.value=t;else if(o instanceof HTMLSelectElement)for(let e=0;e<o.options.length;e++)if(o.options[e].value===t||o.options[e].text===t){o.selectedIndex=e;break}}listen(e){this.listening?this.stop(e):this.start()}start(){this.listening=!0,yn.activeInstance=this,this.activeClass&&this.classList.add(this.activeClass),console.log("listening"),this._recognition.start()}stop(e){this.listening=!1,yn.activeInstance=null,this.activeClass&&this.classList.remove(this.activeClass),console.log("stopped listening"),this._recognition.stop(),this._recognition.abort()}error(e){console.log("Error during speech recognition:",e)}render(){return Ve`<slot></slot>`}};qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"renderInHost",void 0),qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"continuous",void 0),qn([mt({type:Boolean}),wn("design:type",Object)],xn.prototype,"interimResults",void 0),qn([mt({type:Number}),wn("design:type",Object)],xn.prototype,"maxAlternatives",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"for",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"class",void 0),qn([mt({type:String}),wn("design:type",Object)],xn.prototype,"activeClass",void 0),xn=yn=qn([bt("qbo-microphone")],xn);var kn=function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>3&&a&&Object.defineProperty(t,o,a),a},Cn=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};let En=class extends dt{constructor(){super(...arguments),this.display=25,this.start=0,this.count=0,this.pageLimit=10,this.currentPage=1,this.rollingView=!0,this.editSize=!0,this.displayCountText="Results per page:"}get maxPage(){return Math.floor(this.count/this.display)+(this.count%this.display==0?0:1)}static{this.styles=[kt,ae``]}goToPage(e){e<1?e=1:e>this.maxPage&&(e=this.maxPage),this.currentPage=e,this.dispatchEvent(new CustomEvent("change",{detail:{start:(e-1)*this.display,display:this.display,page:e},bubbles:!0,composed:!0}))}renderPage(e){return Ve`<li class="${this.currentPage===e?"active":""}">
|
|
93
93
|
<a @click="${t=>this.goToPage(e)}">${e}</a>
|
|
94
94
|
</li>`}renderSpacer(){return Ve`<li class="disabled"><a>...</a></li>`}renderPageNumbers(){const e=[];let t=this.maxPage>this.pageLimit?this.currentPage-Math.floor(this.pageLimit/2):1;t<1&&(t=1),t+this.pageLimit>this.maxPage&&(t=this.maxPage-this.pageLimit+1),t<1&&(t=1);let o=this.maxPage>this.pageLimit?t+this.pageLimit-1:this.maxPage;o<=1&&(o=1),t>1&&(e.push(this.renderPage(1)),e.push(this.renderSpacer()));for(let n=t;n<=o;n++)e.push(this.renderPage(n));return o<this.maxPage&&(e.push(this.renderSpacer()),e.push(this.renderPage(this.maxPage))),e}setDisplaySize(e){const t=e.target,o=parseInt(t.value);isNaN(o)||(this.display=o,this.start=0,this.goToPage(1))}renderPageSize(){return Ve`<li class="pageSize">
|
|
95
95
|
<span>${this.displayCountText}</span>
|