@quandis/qbo4.configuration 4.0.1-CI-20250717-191830 → 4.0.1-CI-20250822-164104
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 +5 -5
- package/wwwroot/js/esm/qbo4.configuration.js +29 -12
- package/wwwroot/js/esm/qbo4.configuration.min.js +2 -2
- package/wwwroot/js/esm/qbo4.configuration.min.js.map +1 -1
- package/wwwroot/js/qbo4.configuration.js +29 -12
- package/wwwroot/js/qbo4.configuration.min.js +1 -1
- package/wwwroot/js/qbo4.configuration.min.js.map +1 -1
|
@@ -89,7 +89,7 @@ ${Array.from(to.keys()).map(e=>_t`<div class="col-3">
|
|
|
89
89
|
</li>
|
|
90
90
|
</div>
|
|
91
91
|
`)}
|
|
92
|
-
</div>`}renderIcon(t){null!=t.icon&&void 0!==t.icon||(console.warn("qbo-icon: icon attribute is required"),t.icon="warning");const e=to.has(t.icon)?to.get(t.icon):t.icon;return _t`<svg width="${t.width}" height="${t.width}" fill="${t.fill}" ?class=${t.getAttribute("class")}><use href="${t.sprite??He.spriteUrl}#${e}"></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 _t`${Fe(this.renderAll(this),_t`Loading...`)}`}}};Ke([se(),Je("design:type",String)],eo.prototype,"type",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"sprite",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"icon",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"height",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"width",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"viewbox",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"fill",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"backgroundColor",void 0),Ke([se(),Je("design:type",Boolean)],eo.prototype,"disabled",void 0),Ke([se({type:Boolean,reflect:!0}),Je("design:type",Object)],eo.prototype,"renderInHost",void 0),Ke([se({type:Boolean,reflect:!0}),Je("design:type",Boolean)],eo.prototype,"selected",void 0),eo=He=Ke([ie("qbo-icon")],eo);const oo=Math.min,ro=Math.max,io=Math.round,no=Math.floor,ao=t=>({x:t,y:t}),so={left:"right",right:"left",bottom:"top",top:"bottom"},lo={start:"end",end:"start"};function co(t,e,o){return ro(t,oo(e,o))}function ho(t,e){return"function"==typeof t?t(e):t}function po(t){return t.split("-")[0]}function uo(t){return t.split("-")[1]}function mo(t){return"x"===t?"y":"x"}function fo(t){return"y"===t?"height":"width"}const bo=new Set(["top","bottom"]);function go(t){return bo.has(po(t))?"y":"x"}function vo(t){return mo(go(t))}function Oo(t){return t.replace(/start|end/g,t=>lo[t])}const xo=["left","right"],yo=["right","left"],wo=["top","bottom"],ko=["bottom","top"];function qo(t){return t.replace(/left|right|bottom|top/g,t=>so[t])}function So(t){const{x:e,y:o,width:r,height:i}=t;return{width:r,height:i,top:o,left:e,right:e+r,bottom:o+i,x:e,y:o}}function Qo(t,e,o){let{reference:r,floating:i}=t;const n=go(e),a=vo(e),s=fo(a),l=po(e),d="y"===n,c=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let u;switch(l){case"top":u={x:c,y:r.y-i.height};break;case"bottom":u={x:c,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:h};break;case"left":u={x:r.x-i.width,y:h};break;default:u={x:r.x,y:r.y}}switch(uo(e)){case"start":u[a]-=p*(o&&d?-1:1);break;case"end":u[a]+=p*(o&&d?-1:1)}return u}async function $o(t,e){var o;void 0===e&&(e={});const{x:r,y:i,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:p=!1,padding:u=0}=ho(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(u),f=s[p?"floating"===h?"reference":"floating":h],b=So(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(f)))||o?f:f.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),g="floating"===h?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),O=await(null==n.isElement?void 0:n.isElement(v))&&await(null==n.getScale?void 0:n.getScale(v))||{x:1,y:1},x=So(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-x.top+m.top)/O.y,bottom:(x.bottom-b.bottom+m.bottom)/O.y,left:(b.left-x.left+m.left)/O.x,right:(x.right-b.right+m.right)/O.x}}function Po(){return"undefined"!=typeof window}function Co(t){return Ao(t)?(t.nodeName||"").toLowerCase():"#document"}function To(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ro(t){var e;return null==(e=(Ao(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ao(t){return!!Po()&&(t instanceof Node||t instanceof To(t).Node)}function Mo(t){return!!Po()&&(t instanceof Element||t instanceof To(t).Element)}function Eo(t){return!!Po()&&(t instanceof HTMLElement||t instanceof To(t).HTMLElement)}function zo(t){return!(!Po()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof To(t).ShadowRoot)}const Xo=new Set(["inline","contents"]);function _o(t){const{overflow:e,overflowX:o,overflowY:r,display:i}=No(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+o)&&!Xo.has(i)}const Zo=new Set(["table","td","th"]);function jo(t){return Zo.has(Co(t))}const Do=[":popover-open",":modal"];function Vo(t){return Do.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Yo=["transform","translate","scale","rotate","perspective"],Lo=["transform","translate","scale","rotate","perspective","filter"],Uo=["paint","layout","strict","content"];function Bo(t){const e=Io(),o=Mo(t)?No(t):t;return Yo.some(t=>!!o[t]&&"none"!==o[t])||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||Lo.some(t=>(o.willChange||"").includes(t))||Uo.some(t=>(o.contain||"").includes(t))}function Io(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Wo=new Set(["html","body","#document"]);function Go(t){return Wo.has(Co(t))}function No(t){return To(t).getComputedStyle(t)}function Fo(t){return Mo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ho(t){if("html"===Co(t))return t;const e=t.assignedSlot||t.parentNode||zo(t)&&t.host||Ro(t);return zo(e)?e.host:e}function Ko(t){const e=Ho(t);return Go(e)?t.ownerDocument?t.ownerDocument.body:t.body:Eo(e)&&_o(e)?e:Ko(e)}function Jo(t,e,o){var r;void 0===e&&(e=[]),void 0===o&&(o=!0);const i=Ko(t),n=i===(null==(r=t.ownerDocument)?void 0:r.body),a=To(i);if(n){const t=tr(a);return e.concat(a,a.visualViewport||[],_o(i)?i:[],t&&o?Jo(t):[])}return e.concat(i,Jo(i,[],o))}function tr(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function er(t){const e=No(t);let o=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Eo(t),n=i?t.offsetWidth:o,a=i?t.offsetHeight:r,s=io(o)!==n||io(r)!==a;return s&&(o=n,r=a),{width:o,height:r,$:s}}function or(t){return Mo(t)?t:t.contextElement}function rr(t){const e=or(t);if(!Eo(e))return ao(1);const o=e.getBoundingClientRect(),{width:r,height:i,$:n}=er(e);let a=(n?io(o.width):o.width)/r,s=(n?io(o.height):o.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ir=ao(0);function nr(t){const e=To(t);return Io()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ir}function ar(t,e,o,r){void 0===e&&(e=!1),void 0===o&&(o=!1);const i=t.getBoundingClientRect(),n=or(t);let a=ao(1);e&&(r?Mo(r)&&(a=rr(r)):a=rr(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==To(t))&&e}(n,o,r)?nr(n):ao(0);let l=(i.left+s.x)/a.x,d=(i.top+s.y)/a.y,c=i.width/a.x,h=i.height/a.y;if(n){const t=To(n),e=r&&Mo(r)?To(r):r;let o=t,i=tr(o);for(;i&&r&&e!==o;){const t=rr(i),e=i.getBoundingClientRect(),r=No(i),n=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=n,d+=a,o=To(i),i=tr(o)}}return So({width:c,height:h,x:l,y:d})}function sr(t,e){const o=Fo(t).scrollLeft;return e?e.left+o:ar(Ro(t)).left+o}function lr(t,e,o){void 0===o&&(o=!1);const r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-(o?0:sr(t,r)),y:r.top+e.scrollTop}}const dr=new Set(["absolute","fixed"]);function cr(t,e,o){let r;if("viewport"===e)r=function(t,e){const o=To(t),r=Ro(t),i=o.visualViewport;let n=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){n=i.width,a=i.height;const t=Io();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)r=function(t){const e=Ro(t),o=Fo(t),r=t.ownerDocument.body,i=ro(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),n=ro(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-o.scrollLeft+sr(t);const s=-o.scrollTop;return"rtl"===No(r).direction&&(a+=ro(e.clientWidth,r.clientWidth)-i),{width:i,height:n,x:a,y:s}}(Ro(t));else if(Mo(e))r=function(t,e){const o=ar(t,!0,"fixed"===e),r=o.top+t.clientTop,i=o.left+t.clientLeft,n=Eo(t)?rr(t):ao(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:i*n.x,y:r*n.y}}(e,o);else{const o=nr(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return So(r)}function hr(t,e){const o=Ho(t);return!(o===e||!Mo(o)||Go(o))&&("fixed"===No(o).position||hr(o,e))}function pr(t,e,o){const r=Eo(e),i=Ro(e),n="fixed"===o,a=ar(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=ao(0);function d(){l.x=sr(i)}if(r||!r&&!n)if(("body"!==Co(e)||_o(i))&&(s=Fo(e)),r){const t=ar(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&d();n&&!r&&i&&d();const c=!i||r||n?ao(0):lr(i,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function ur(t){return"static"===No(t).position}function mr(t,e){if(!Eo(t)||"fixed"===No(t).position)return null;if(e)return e(t);let o=t.offsetParent;return Ro(t)===o&&(o=o.ownerDocument.body),o}function fr(t,e){const o=To(t);if(Vo(t))return o;if(!Eo(t)){let e=Ho(t);for(;e&&!Go(e);){if(Mo(e)&&!ur(e))return e;e=Ho(e)}return o}let r=mr(t,e);for(;r&&jo(r)&&ur(r);)r=mr(r,e);return r&&Go(r)&&ur(r)&&!Bo(r)?o:r||function(t){let e=Ho(t);for(;Eo(e)&&!Go(e);){if(Bo(e))return e;if(Vo(e))return null;e=Ho(e)}return null}(t)||o}const br={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:r,strategy:i}=t;const n="fixed"===i,a=Ro(r),s=!!e&&Vo(e.floating);if(r===a||s&&n)return o;let l={scrollLeft:0,scrollTop:0},d=ao(1);const c=ao(0),h=Eo(r);if((h||!h&&!n)&&(("body"!==Co(r)||_o(a))&&(l=Fo(r)),Eo(r))){const t=ar(r);d=rr(r),c.x=t.x+r.clientLeft,c.y=t.y+r.clientTop}const p=!a||h||n?ao(0):lr(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+p.x,y:o.y*d.y-l.scrollTop*d.y+c.y+p.y}},getDocumentElement:Ro,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:i}=t;const n="clippingAncestors"===o?Vo(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let r=Jo(t,[],!1).filter(t=>Mo(t)&&"body"!==Co(t)),i=null;const n="fixed"===No(t).position;let a=n?Ho(t):t;for(;Mo(a)&&!Go(a);){const e=No(a),o=Bo(a);o||"fixed"!==e.position||(i=null),(n?!o&&!i:!o&&"static"===e.position&&i&&dr.has(i.position)||_o(a)&&!o&&hr(t,a))?r=r.filter(t=>t!==a):i=e,a=Ho(a)}return e.set(t,r),r}(e,this._c):[].concat(o),a=[...n,r],s=a[0],l=a.reduce((t,o)=>{const r=cr(e,o,i);return t.top=ro(r.top,t.top),t.right=oo(r.right,t.right),t.bottom=oo(r.bottom,t.bottom),t.left=ro(r.left,t.left),t},cr(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:fr,getElementRects:async function(t){const e=this.getOffsetParent||fr,o=this.getDimensions,r=await o(t.floating);return{reference:pr(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=er(t);return{width:e,height:o}},getScale:rr,isElement:Mo,isRTL:function(t){return"rtl"===No(t).direction}};function gr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const vr=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:r,placement:i}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=ho(t,e),d={x:o,y:r},c=await $o(e,l),h=go(po(i)),p=mo(h);let u=d[p],m=d[h];if(n){const t="y"===p?"bottom":"right";u=co(u+c["y"===p?"top":"left"],u,u-c[t])}if(a){const t="y"===h?"bottom":"right";m=co(m+c["y"===h?"top":"left"],m,m-c[t])}const f=s.fn({...e,[p]:u,[h]:m});return{...f,data:{x:f.x-o,y:f.y-r,enabled:{[p]:n,[h]:a}}}}}},Or=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,r;const{placement:i,middlewareData:n,rects:a,initialPlacement:s,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...b}=ho(t,e);if(null!=(o=n.arrow)&&o.alignmentOffset)return{};const g=po(i),v=go(s),O=po(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(d.floating)),y=p||(O||!f?[qo(s)]:function(t){const e=qo(t);return[Oo(t),e,Oo(e)]}(s)),w="none"!==m;!p&&w&&y.push(...function(t,e,o,r){const i=uo(t);let n=function(t,e,o){switch(t){case"top":case"bottom":return o?e?yo:xo:e?xo:yo;case"left":case"right":return e?wo:ko;default:return[]}}(po(t),"start"===o,r);return i&&(n=n.map(t=>t+"-"+i),e&&(n=n.concat(n.map(Oo)))),n}(s,f,m,x));const k=[s,...y],q=await $o(e,b),S=[];let Q=(null==(r=n.flip)?void 0:r.overflows)||[];if(c&&S.push(q[g]),h){const t=function(t,e,o){void 0===o&&(o=!1);const r=uo(t),i=vo(t),n=fo(i);let a="x"===i?r===(o?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=qo(a)),[a,qo(a)]}(i,a,x);S.push(q[t[0]],q[t[1]])}if(Q=[...Q,{placement:i,overflows:S}],!S.every(t=>t<=0)){var $,P;const t=((null==($=n.flip)?void 0:$.index)||0)+1,e=k[t];if(e&&("alignment"!==h||v===go(e)||Q.every(t=>t.overflows[0]>0&&go(t.placement)===v)))return{data:{index:t,overflows:Q},reset:{placement:e}};let o=null==(P=Q.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!o)switch(u){case"bestFit":{var C;const t=null==(C=Q.filter(t=>{if(w){const e=go(t.placement);return e===v||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:C[0];t&&(o=t);break}case"initialPlacement":o=s}if(i!==o)return{reset:{placement:o}}}return{}}}},xr=(t,e,o)=>{const r=new Map,i={platform:br,...o},n={...i.platform,_c:r};return(async(t,e,o)=>{const{placement:r="bottom",strategy:i="absolute",middleware:n=[],platform:a}=o,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:h}=Qo(d,r,l),p=r,u={},m=0;for(let o=0;o<s.length;o++){const{name:n,fn:f}=s[o],{x:b,y:g,data:v,reset:O}=await f({x:c,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:u,rects:d,platform:a,elements:{reference:t,floating:e}});c=null!=b?b:c,h=null!=g?g:h,u={...u,[n]:{...u[n],...v}},O&&m<=50&&(m++,"object"==typeof O&&(O.placement&&(p=O.placement),O.rects&&(d=!0===O.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):O.rects),({x:c,y:h}=Qo(d,p,l))),o=-1)}return{x:c,y:h,placement:p,strategy:i,middlewareData:u}})(t,e,{...i,platform:n})};var yr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},wr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class kr extends oe{constructor(){super(...arguments),this.placement="bottom-start",this.type="dropdown",this.target=null,this.isOpen=!1,this.middleware=[Or(),vr()],this.handleMenuOpen=t=>{t.preventDefault(),t.stopPropagation(),t.detail.menu!==this&&this.isOpen&&this.closeMenu()},this.handleOutsideClick=t=>{t.target,t.composedPath().includes(this)||this.closeMenu()},this.showContextMenu=t=>{const e=t;t.preventDefault(),t.stopPropagation(),this.isOpen=!0,this.menuContainer.classList.toggle("open",this.isOpen);const o={getBoundingClientRect:()=>({x:e.clientX,y:e.clientY,width:0,height:0,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY})};this.updateMenuPosition(o)},this.toggleMenu=t=>{t.target;const e=t.composedPath();e.includes(this.triggerButton)&&!e.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=K``}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(t){super.firstUpdated(t),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 t=this.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t.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(t){console.log(t,typeof t);const{x:e,y:o}=await xr(t,this.menuContainer,{placement:this.placement,middleware:this.middleware,strategy:"fixed"});Object.assign(this.menuContainer.style,{left:`${e}px`,top:`${o}px`})}render(){return _t`<slot></slot>`}}yr([se({type:String}),wr("design:type",String)],kr.prototype,"placement",void 0),yr([se(),wr("design:type",String)],kr.prototype,"type",void 0),yr([se(),wr("design:type",Object)],kr.prototype,"target",void 0),yr([le(),wr("design:type",Object)],kr.prototype,"isOpen",void 0),customElements.get("qbo-menu")||customElements.define("qbo-menu",kr);var qr,Sr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Qr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let $r=class extends oe{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{qr=this}static{this.activeInstance=null}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.listen);const t=new(window.SpeechRecognition||window.webkitSpeechRecognition);t.continuous=this.continuous,t.interimResults=this.interimResults,t.maxAlternatives=this.maxAlternatives,t.onresult=t=>{this.onResult(t)},t.onspeechend=t=>{this.stop(t)},t.onerror=t=>{this.error(t)},this._recognition=t,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(t){const e=t.results[t.results.length-1][0].transcript;if(console.log("Result: "+e),null==this.target)return;const o=this.target;if(o instanceof HTMLInputElement)"radio"===o.type?o.value===e&&(o.checked=!0):this.continuous?o.value+=e:o.value=e;else if(o instanceof HTMLTextAreaElement)this.continuous?o.value+=e:o.value=e;else if(o instanceof HTMLSelectElement)for(let t=0;t<o.options.length;t++)if(o.options[t].value===e||o.options[t].text===e){o.selectedIndex=t;break}}listen(t){this.listening?this.stop(t):this.start()}start(){this.listening=!0,qr.activeInstance=this,this.activeClass&&this.classList.add(this.activeClass),console.log("listening"),this._recognition.start()}stop(t){this.listening=!1,qr.activeInstance=null,this.activeClass&&this.classList.remove(this.activeClass),console.log("stopped listening"),this._recognition.stop(),this._recognition.abort()}error(t){console.log("Error during speech recognition:",t)}render(){return _t`<slot></slot>`}};Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"renderInHost",void 0),Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"continuous",void 0),Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"interimResults",void 0),Sr([se({type:Number}),Qr("design:type",Object)],$r.prototype,"maxAlternatives",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"for",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"class",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"activeClass",void 0),$r=qr=Sr([ie("qbo-microphone")],$r);var Pr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Cr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Tr=class extends oe{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=[fe,K``]}goToPage(t){t<1?t=1:t>this.maxPage&&(t=this.maxPage),this.currentPage=t,this.dispatchEvent(new CustomEvent("change",{detail:{start:(t-1)*this.display,display:this.display,page:t},bubbles:!0,composed:!0}))}renderPage(t){return _t`<li class="${this.currentPage===t?"active":""}">
|
|
92
|
+
</div>`}renderIcon(t){null!=t.icon&&void 0!==t.icon||(console.warn("qbo-icon: icon attribute is required"),t.icon="warning");const e=to.has(t.icon)?to.get(t.icon):t.icon;return _t`<svg width="${t.width}" height="${t.width}" fill="${t.fill}" ?class=${t.getAttribute("class")}><use href="${t.sprite??He.spriteUrl}#${e}"></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 _t`${Fe(this.renderAll(this),_t`Loading...`)}`}}};Ke([se(),Je("design:type",String)],eo.prototype,"type",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"sprite",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"icon",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"height",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"width",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"viewbox",void 0),Ke([se(),Je("design:type",String)],eo.prototype,"fill",void 0),Ke([se(),Je("design:type",Object)],eo.prototype,"backgroundColor",void 0),Ke([se(),Je("design:type",Boolean)],eo.prototype,"disabled",void 0),Ke([se({type:Boolean,reflect:!0}),Je("design:type",Object)],eo.prototype,"renderInHost",void 0),Ke([se({type:Boolean,reflect:!0}),Je("design:type",Boolean)],eo.prototype,"selected",void 0),eo=He=Ke([ie("qbo-icon")],eo);const oo=Math.min,ro=Math.max,io=Math.round,no=Math.floor,ao=t=>({x:t,y:t}),so={left:"right",right:"left",bottom:"top",top:"bottom"},lo={start:"end",end:"start"};function co(t,e,o){return ro(t,oo(e,o))}function ho(t,e){return"function"==typeof t?t(e):t}function po(t){return t.split("-")[0]}function uo(t){return t.split("-")[1]}function mo(t){return"x"===t?"y":"x"}function fo(t){return"y"===t?"height":"width"}const bo=new Set(["top","bottom"]);function go(t){return bo.has(po(t))?"y":"x"}function vo(t){return mo(go(t))}function Oo(t){return t.replace(/start|end/g,t=>lo[t])}const xo=["left","right"],yo=["right","left"],wo=["top","bottom"],ko=["bottom","top"];function qo(t){return t.replace(/left|right|bottom|top/g,t=>so[t])}function So(t){const{x:e,y:o,width:r,height:i}=t;return{width:r,height:i,top:o,left:e,right:e+r,bottom:o+i,x:e,y:o}}function Qo(t,e,o){let{reference:r,floating:i}=t;const n=go(e),a=vo(e),s=fo(a),l=po(e),d="y"===n,c=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[s]/2-i[s]/2;let u;switch(l){case"top":u={x:c,y:r.y-i.height};break;case"bottom":u={x:c,y:r.y+r.height};break;case"right":u={x:r.x+r.width,y:h};break;case"left":u={x:r.x-i.width,y:h};break;default:u={x:r.x,y:r.y}}switch(uo(e)){case"start":u[a]-=p*(o&&d?-1:1);break;case"end":u[a]+=p*(o&&d?-1:1)}return u}async function $o(t,e){var o;void 0===e&&(e={});const{x:r,y:i,platform:n,rects:a,elements:s,strategy:l}=t,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:p=!1,padding:u=0}=ho(e,t),m=function(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}(u),f=s[p?"floating"===h?"reference":"floating":h],b=So(await n.getClippingRect({element:null==(o=await(null==n.isElement?void 0:n.isElement(f)))||o?f:f.contextElement||await(null==n.getDocumentElement?void 0:n.getDocumentElement(s.floating)),boundary:d,rootBoundary:c,strategy:l})),g="floating"===h?{x:r,y:i,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==n.getOffsetParent?void 0:n.getOffsetParent(s.floating)),O=await(null==n.isElement?void 0:n.isElement(v))&&await(null==n.getScale?void 0:n.getScale(v))||{x:1,y:1},x=So(n.convertOffsetParentRelativeRectToViewportRelativeRect?await n.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:g,offsetParent:v,strategy:l}):g);return{top:(b.top-x.top+m.top)/O.y,bottom:(x.bottom-b.bottom+m.bottom)/O.y,left:(b.left-x.left+m.left)/O.x,right:(x.right-b.right+m.right)/O.x}}function Po(){return"undefined"!=typeof window}function Co(t){return Ao(t)?(t.nodeName||"").toLowerCase():"#document"}function To(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function Ro(t){var e;return null==(e=(Ao(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function Ao(t){return!!Po()&&(t instanceof Node||t instanceof To(t).Node)}function Mo(t){return!!Po()&&(t instanceof Element||t instanceof To(t).Element)}function Eo(t){return!!Po()&&(t instanceof HTMLElement||t instanceof To(t).HTMLElement)}function zo(t){return!(!Po()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof To(t).ShadowRoot)}const Xo=new Set(["inline","contents"]);function _o(t){const{overflow:e,overflowX:o,overflowY:r,display:i}=No(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+o)&&!Xo.has(i)}const Zo=new Set(["table","td","th"]);function jo(t){return Zo.has(Co(t))}const Do=[":popover-open",":modal"];function Vo(t){return Do.some(e=>{try{return t.matches(e)}catch(t){return!1}})}const Yo=["transform","translate","scale","rotate","perspective"],Lo=["transform","translate","scale","rotate","perspective","filter"],Uo=["paint","layout","strict","content"];function Bo(t){const e=Io(),o=Mo(t)?No(t):t;return Yo.some(t=>!!o[t]&&"none"!==o[t])||!!o.containerType&&"normal"!==o.containerType||!e&&!!o.backdropFilter&&"none"!==o.backdropFilter||!e&&!!o.filter&&"none"!==o.filter||Lo.some(t=>(o.willChange||"").includes(t))||Uo.some(t=>(o.contain||"").includes(t))}function Io(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Wo=new Set(["html","body","#document"]);function Go(t){return Wo.has(Co(t))}function No(t){return To(t).getComputedStyle(t)}function Fo(t){return Mo(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ho(t){if("html"===Co(t))return t;const e=t.assignedSlot||t.parentNode||zo(t)&&t.host||Ro(t);return zo(e)?e.host:e}function Ko(t){const e=Ho(t);return Go(e)?t.ownerDocument?t.ownerDocument.body:t.body:Eo(e)&&_o(e)?e:Ko(e)}function Jo(t,e,o){var r;void 0===e&&(e=[]),void 0===o&&(o=!0);const i=Ko(t),n=i===(null==(r=t.ownerDocument)?void 0:r.body),a=To(i);if(n){const t=tr(a);return e.concat(a,a.visualViewport||[],_o(i)?i:[],t&&o?Jo(t):[])}return e.concat(i,Jo(i,[],o))}function tr(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function er(t){const e=No(t);let o=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Eo(t),n=i?t.offsetWidth:o,a=i?t.offsetHeight:r,s=io(o)!==n||io(r)!==a;return s&&(o=n,r=a),{width:o,height:r,$:s}}function or(t){return Mo(t)?t:t.contextElement}function rr(t){const e=or(t);if(!Eo(e))return ao(1);const o=e.getBoundingClientRect(),{width:r,height:i,$:n}=er(e);let a=(n?io(o.width):o.width)/r,s=(n?io(o.height):o.height)/i;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const ir=ao(0);function nr(t){const e=To(t);return Io()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ir}function ar(t,e,o,r){void 0===e&&(e=!1),void 0===o&&(o=!1);const i=t.getBoundingClientRect(),n=or(t);let a=ao(1);e&&(r?Mo(r)&&(a=rr(r)):a=rr(t));const s=function(t,e,o){return void 0===e&&(e=!1),!(!o||e&&o!==To(t))&&e}(n,o,r)?nr(n):ao(0);let l=(i.left+s.x)/a.x,d=(i.top+s.y)/a.y,c=i.width/a.x,h=i.height/a.y;if(n){const t=To(n),e=r&&Mo(r)?To(r):r;let o=t,i=tr(o);for(;i&&r&&e!==o;){const t=rr(i),e=i.getBoundingClientRect(),r=No(i),n=e.left+(i.clientLeft+parseFloat(r.paddingLeft))*t.x,a=e.top+(i.clientTop+parseFloat(r.paddingTop))*t.y;l*=t.x,d*=t.y,c*=t.x,h*=t.y,l+=n,d+=a,o=To(i),i=tr(o)}}return So({width:c,height:h,x:l,y:d})}function sr(t,e){const o=Fo(t).scrollLeft;return e?e.left+o:ar(Ro(t)).left+o}function lr(t,e){const o=t.getBoundingClientRect();return{x:o.left+e.scrollLeft-sr(t,o),y:o.top+e.scrollTop}}const dr=new Set(["absolute","fixed"]);function cr(t,e,o){let r;if("viewport"===e)r=function(t,e){const o=To(t),r=Ro(t),i=o.visualViewport;let n=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){n=i.width,a=i.height;const t=Io();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,l=i.offsetTop)}const d=sr(r);if(d<=0){const t=r.ownerDocument,e=t.body,o=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(o.marginLeft)+parseFloat(o.marginRight)||0,a=Math.abs(r.clientWidth-e.clientWidth-i);a<=25&&(n-=a)}else d<=25&&(n+=d);return{width:n,height:a,x:s,y:l}}(t,o);else if("document"===e)r=function(t){const e=Ro(t),o=Fo(t),r=t.ownerDocument.body,i=ro(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),n=ro(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let a=-o.scrollLeft+sr(t);const s=-o.scrollTop;return"rtl"===No(r).direction&&(a+=ro(e.clientWidth,r.clientWidth)-i),{width:i,height:n,x:a,y:s}}(Ro(t));else if(Mo(e))r=function(t,e){const o=ar(t,!0,"fixed"===e),r=o.top+t.clientTop,i=o.left+t.clientLeft,n=Eo(t)?rr(t):ao(1);return{width:t.clientWidth*n.x,height:t.clientHeight*n.y,x:i*n.x,y:r*n.y}}(e,o);else{const o=nr(t);r={x:e.x-o.x,y:e.y-o.y,width:e.width,height:e.height}}return So(r)}function hr(t,e){const o=Ho(t);return!(o===e||!Mo(o)||Go(o))&&("fixed"===No(o).position||hr(o,e))}function pr(t,e,o){const r=Eo(e),i=Ro(e),n="fixed"===o,a=ar(t,!0,n,e);let s={scrollLeft:0,scrollTop:0};const l=ao(0);function d(){l.x=sr(i)}if(r||!r&&!n)if(("body"!==Co(e)||_o(i))&&(s=Fo(e)),r){const t=ar(e,!0,n,e);l.x=t.x+e.clientLeft,l.y=t.y+e.clientTop}else i&&d();n&&!r&&i&&d();const c=!i||r||n?ao(0):lr(i,s);return{x:a.left+s.scrollLeft-l.x-c.x,y:a.top+s.scrollTop-l.y-c.y,width:a.width,height:a.height}}function ur(t){return"static"===No(t).position}function mr(t,e){if(!Eo(t)||"fixed"===No(t).position)return null;if(e)return e(t);let o=t.offsetParent;return Ro(t)===o&&(o=o.ownerDocument.body),o}function fr(t,e){const o=To(t);if(Vo(t))return o;if(!Eo(t)){let e=Ho(t);for(;e&&!Go(e);){if(Mo(e)&&!ur(e))return e;e=Ho(e)}return o}let r=mr(t,e);for(;r&&jo(r)&&ur(r);)r=mr(r,e);return r&&Go(r)&&ur(r)&&!Bo(r)?o:r||function(t){let e=Ho(t);for(;Eo(e)&&!Go(e);){if(Bo(e))return e;if(Vo(e))return null;e=Ho(e)}return null}(t)||o}const br={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:o,offsetParent:r,strategy:i}=t;const n="fixed"===i,a=Ro(r),s=!!e&&Vo(e.floating);if(r===a||s&&n)return o;let l={scrollLeft:0,scrollTop:0},d=ao(1);const c=ao(0),h=Eo(r);if((h||!h&&!n)&&(("body"!==Co(r)||_o(a))&&(l=Fo(r)),Eo(r))){const t=ar(r);d=rr(r),c.x=t.x+r.clientLeft,c.y=t.y+r.clientTop}const p=!a||h||n?ao(0):lr(a,l);return{width:o.width*d.x,height:o.height*d.y,x:o.x*d.x-l.scrollLeft*d.x+c.x+p.x,y:o.y*d.y-l.scrollTop*d.y+c.y+p.y}},getDocumentElement:Ro,getClippingRect:function(t){let{element:e,boundary:o,rootBoundary:r,strategy:i}=t;const n="clippingAncestors"===o?Vo(e)?[]:function(t,e){const o=e.get(t);if(o)return o;let r=Jo(t,[],!1).filter(t=>Mo(t)&&"body"!==Co(t)),i=null;const n="fixed"===No(t).position;let a=n?Ho(t):t;for(;Mo(a)&&!Go(a);){const e=No(a),o=Bo(a);o||"fixed"!==e.position||(i=null),(n?!o&&!i:!o&&"static"===e.position&&i&&dr.has(i.position)||_o(a)&&!o&&hr(t,a))?r=r.filter(t=>t!==a):i=e,a=Ho(a)}return e.set(t,r),r}(e,this._c):[].concat(o),a=[...n,r],s=a[0],l=a.reduce((t,o)=>{const r=cr(e,o,i);return t.top=ro(r.top,t.top),t.right=oo(r.right,t.right),t.bottom=oo(r.bottom,t.bottom),t.left=ro(r.left,t.left),t},cr(e,s,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:fr,getElementRects:async function(t){const e=this.getOffsetParent||fr,o=this.getDimensions,r=await o(t.floating);return{reference:pr(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:o}=er(t);return{width:e,height:o}},getScale:rr,isElement:Mo,isRTL:function(t){return"rtl"===No(t).direction}};function gr(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}const vr=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:o,y:r,placement:i}=e,{mainAxis:n=!0,crossAxis:a=!1,limiter:s={fn:t=>{let{x:e,y:o}=t;return{x:e,y:o}}},...l}=ho(t,e),d={x:o,y:r},c=await $o(e,l),h=go(po(i)),p=mo(h);let u=d[p],m=d[h];if(n){const t="y"===p?"bottom":"right";u=co(u+c["y"===p?"top":"left"],u,u-c[t])}if(a){const t="y"===h?"bottom":"right";m=co(m+c["y"===h?"top":"left"],m,m-c[t])}const f=s.fn({...e,[p]:u,[h]:m});return{...f,data:{x:f.x-o,y:f.y-r,enabled:{[p]:n,[h]:a}}}}}},Or=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var o,r;const{placement:i,middlewareData:n,rects:a,initialPlacement:s,platform:l,elements:d}=e,{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:f=!0,...b}=ho(t,e);if(null!=(o=n.arrow)&&o.alignmentOffset)return{};const g=po(i),v=go(s),O=po(s)===s,x=await(null==l.isRTL?void 0:l.isRTL(d.floating)),y=p||(O||!f?[qo(s)]:function(t){const e=qo(t);return[Oo(t),e,Oo(e)]}(s)),w="none"!==m;!p&&w&&y.push(...function(t,e,o,r){const i=uo(t);let n=function(t,e,o){switch(t){case"top":case"bottom":return o?e?yo:xo:e?xo:yo;case"left":case"right":return e?wo:ko;default:return[]}}(po(t),"start"===o,r);return i&&(n=n.map(t=>t+"-"+i),e&&(n=n.concat(n.map(Oo)))),n}(s,f,m,x));const k=[s,...y],q=await $o(e,b),S=[];let Q=(null==(r=n.flip)?void 0:r.overflows)||[];if(c&&S.push(q[g]),h){const t=function(t,e,o){void 0===o&&(o=!1);const r=uo(t),i=vo(t),n=fo(i);let a="x"===i?r===(o?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[n]>e.floating[n]&&(a=qo(a)),[a,qo(a)]}(i,a,x);S.push(q[t[0]],q[t[1]])}if(Q=[...Q,{placement:i,overflows:S}],!S.every(t=>t<=0)){var $,P;const t=((null==($=n.flip)?void 0:$.index)||0)+1,e=k[t];if(e&&("alignment"!==h||v===go(e)||Q.every(t=>go(t.placement)!==v||t.overflows[0]>0)))return{data:{index:t,overflows:Q},reset:{placement:e}};let o=null==(P=Q.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:P.placement;if(!o)switch(u){case"bestFit":{var C;const t=null==(C=Q.filter(t=>{if(w){const e=go(t.placement);return e===v||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:C[0];t&&(o=t);break}case"initialPlacement":o=s}if(i!==o)return{reset:{placement:o}}}return{}}}},xr=(t,e,o)=>{const r=new Map,i={platform:br,...o},n={...i.platform,_c:r};return(async(t,e,o)=>{const{placement:r="bottom",strategy:i="absolute",middleware:n=[],platform:a}=o,s=n.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(e));let d=await a.getElementRects({reference:t,floating:e,strategy:i}),{x:c,y:h}=Qo(d,r,l),p=r,u={},m=0;for(let o=0;o<s.length;o++){const{name:n,fn:f}=s[o],{x:b,y:g,data:v,reset:O}=await f({x:c,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:u,rects:d,platform:a,elements:{reference:t,floating:e}});c=null!=b?b:c,h=null!=g?g:h,u={...u,[n]:{...u[n],...v}},O&&m<=50&&(m++,"object"==typeof O&&(O.placement&&(p=O.placement),O.rects&&(d=!0===O.rects?await a.getElementRects({reference:t,floating:e,strategy:i}):O.rects),({x:c,y:h}=Qo(d,p,l))),o=-1)}return{x:c,y:h,placement:p,strategy:i,middlewareData:u}})(t,e,{...i,platform:n})};var yr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},wr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};class kr extends oe{constructor(){super(...arguments),this.placement="bottom-start",this.type="dropdown",this.target=null,this.isOpen=!1,this.middleware=[Or(),vr()],this.handleMenuOpen=t=>{t.preventDefault(),t.stopPropagation(),t.detail.menu!==this&&this.isOpen&&this.closeMenu()},this.handleOutsideClick=t=>{t.target,t.composedPath().includes(this)||this.closeMenu()},this.showContextMenu=t=>{const e=t;t.preventDefault(),t.stopPropagation(),this.isOpen=!0,this.menuContainer.classList.toggle("open",this.isOpen);const o={getBoundingClientRect:()=>({x:e.clientX,y:e.clientY,width:0,height:0,top:e.clientY,left:e.clientX,right:e.clientX,bottom:e.clientY})};this.updateMenuPosition(o)},this.toggleMenu=t=>{t.target;const e=t.composedPath();e.includes(this.triggerButton)&&!e.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=K``}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(t){super.firstUpdated(t),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 t=this.getRootNode();return t instanceof ShadowRoot||t instanceof Document?t.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(t){console.log(t,typeof t);const{x:e,y:o}=await xr(t,this.menuContainer,{placement:this.placement,middleware:this.middleware,strategy:"fixed"});Object.assign(this.menuContainer.style,{left:`${e}px`,top:`${o}px`})}render(){return _t`<slot></slot>`}}yr([se({type:String}),wr("design:type",String)],kr.prototype,"placement",void 0),yr([se(),wr("design:type",String)],kr.prototype,"type",void 0),yr([se(),wr("design:type",Object)],kr.prototype,"target",void 0),yr([le(),wr("design:type",Object)],kr.prototype,"isOpen",void 0),customElements.get("qbo-menu")||customElements.define("qbo-menu",kr);var qr,Sr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Qr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let $r=class extends oe{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{qr=this}static{this.activeInstance=null}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.listen);const t=new(window.SpeechRecognition||window.webkitSpeechRecognition);t.continuous=this.continuous,t.interimResults=this.interimResults,t.maxAlternatives=this.maxAlternatives,t.onresult=t=>{this.onResult(t)},t.onspeechend=t=>{this.stop(t)},t.onerror=t=>{this.error(t)},this._recognition=t,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(t){const e=t.results[t.results.length-1][0].transcript;if(console.log("Result: "+e),null==this.target)return;const o=this.target;if(o instanceof HTMLInputElement)"radio"===o.type?o.value===e&&(o.checked=!0):this.continuous?o.value+=e:o.value=e;else if(o instanceof HTMLTextAreaElement)this.continuous?o.value+=e:o.value=e;else if(o instanceof HTMLSelectElement)for(let t=0;t<o.options.length;t++)if(o.options[t].value===e||o.options[t].text===e){o.selectedIndex=t;break}}listen(t){this.listening?this.stop(t):this.start()}start(){this.listening=!0,qr.activeInstance=this,this.activeClass&&this.classList.add(this.activeClass),console.log("listening"),this._recognition.start()}stop(t){this.listening=!1,qr.activeInstance=null,this.activeClass&&this.classList.remove(this.activeClass),console.log("stopped listening"),this._recognition.stop(),this._recognition.abort()}error(t){console.log("Error during speech recognition:",t)}render(){return _t`<slot></slot>`}};Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"renderInHost",void 0),Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"continuous",void 0),Sr([se({type:Boolean}),Qr("design:type",Object)],$r.prototype,"interimResults",void 0),Sr([se({type:Number}),Qr("design:type",Object)],$r.prototype,"maxAlternatives",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"for",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"class",void 0),Sr([se({type:String}),Qr("design:type",Object)],$r.prototype,"activeClass",void 0),$r=qr=Sr([ie("qbo-microphone")],$r);var Pr=function(t,e,o,r){var i,n=arguments.length,a=n<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(a=(n<3?i(a):n>3?i(e,o,a):i(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a},Cr=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};let Tr=class extends oe{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=[fe,K``]}goToPage(t){t<1?t=1:t>this.maxPage&&(t=this.maxPage),this.currentPage=t,this.dispatchEvent(new CustomEvent("change",{detail:{start:(t-1)*this.display,display:this.display,page:t},bubbles:!0,composed:!0}))}renderPage(t){return _t`<li class="${this.currentPage===t?"active":""}">
|
|
93
93
|
<a @click="${e=>this.goToPage(t)}">${t}</a>
|
|
94
94
|
</li>`}renderSpacer(){return _t`<li class="disabled"><a>...</a></li>`}renderPageNumbers(){const t=[];let e=this.maxPage>this.pageLimit?this.currentPage-Math.floor(this.pageLimit/2):1;e<1&&(e=1),e+this.pageLimit>this.maxPage&&(e=this.maxPage-this.pageLimit+1),e<1&&(e=1);let o=this.maxPage>this.pageLimit?e+this.pageLimit-1:this.maxPage;o<=1&&(o=1),e>1&&(t.push(this.renderPage(1)),t.push(this.renderSpacer()));for(let r=e;r<=o;r++)t.push(this.renderPage(r));return o<this.maxPage&&(t.push(this.renderSpacer()),t.push(this.renderPage(this.maxPage))),t}setDisplaySize(t){const e=t.target,o=parseInt(e.value);isNaN(o)||(this.display=o,this.start=0,this.goToPage(1))}renderPageSize(){return _t`<li class="pageSize">
|
|
95
95
|
<span>${this.displayCountText}</span>
|