maz-ui 3.44.0 → 3.44.2
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/components/MazAccordion.mjs +25 -25
- package/components/MazAvatar.mjs +1 -1
- package/components/MazBottomSheet.mjs +1 -1
- package/components/MazBtn.mjs +1 -1
- package/components/MazCard.mjs +1 -1
- package/components/MazCardSpotlight.mjs +9 -9
- package/components/MazCarousel.mjs +1 -1
- package/components/MazDialog.mjs +1 -1
- package/components/MazDialogPromise.mjs +1 -1
- package/components/MazDrawer.mjs +1 -1
- package/components/MazDropdown.mjs +1 -1
- package/components/MazDropzone.mjs +1 -1
- package/components/MazGallery.mjs +1 -1
- package/components/MazInput.mjs +1 -1
- package/components/MazInputNumber.mjs +1 -1
- package/components/MazInputPrice.mjs +1 -1
- package/components/MazInputTags.mjs +1 -1
- package/components/MazLazyImg.mjs +1 -1
- package/components/MazLink.mjs +22 -22
- package/components/MazPagination.mjs +1 -1
- package/components/MazPhoneNumberInput.mjs +1 -1
- package/components/MazPicker.mjs +1 -1
- package/components/MazReadingProgressBar.mjs +1 -2
- package/components/MazSelect.mjs +1 -1
- package/components/MazTable.mjs +1 -1
- package/components/MazTextarea.mjs +1 -1
- package/components/assets/MazPhoneNumberInput.css +1 -1
- package/components/assets/MazSelect.css +1 -1
- package/components/assets/MazTable.css +1 -1
- package/components/assets/MazTabsBar.css +1 -1
- package/components/chunks/{MazAvatar-BU1nJFcV.mjs → MazAvatar-CoT6WIl0.mjs} +1 -1
- package/components/chunks/{MazBottomSheet-DUOIusEi.mjs → MazBottomSheet-DpI8wFgc.mjs} +1 -1
- package/components/chunks/MazBtn-BIVlttu0.mjs +150 -0
- package/components/chunks/MazBtn-BQ7aH6Qe.mjs +158 -0
- package/components/chunks/{MazBtn-5BSKOcqG.mjs → MazBtn-BXDpaXn1.mjs} +44 -44
- package/components/chunks/MazBtn-C7RDTnn-.mjs +150 -0
- package/components/chunks/{MazBtn-BY8WCtM7.mjs → MazBtn-CPkNymJj.mjs} +44 -44
- package/components/chunks/{MazBtn-C5G78zLg.mjs → MazBtn-CQSo596y.mjs} +44 -44
- package/components/chunks/MazBtn-D2tIsob2.mjs +150 -0
- package/components/chunks/MazBtn-DRTBFUgW.mjs +150 -0
- package/components/chunks/{MazBtn-f1mBXJeU.mjs → MazBtn-Dfz-5FeI.mjs} +23 -26
- package/components/chunks/{MazBtn-CeVwyYR5.mjs → MazBtn-Vas62hFD.mjs} +44 -44
- package/components/chunks/MazBtn-gE-drZkE.mjs +150 -0
- package/components/chunks/{MazCard-BWxV_Z-i.mjs → MazCard-BBwohtCJ.mjs} +1 -1
- package/components/chunks/{MazCarousel-D5EmW7Sa.mjs → MazCarousel-DJ_nQfy4.mjs} +1 -1
- package/components/chunks/{MazCheckbox-D3PXkt75.mjs → MazCheckbox-BK1MX0uq.mjs} +1 -1
- package/components/chunks/{MazCheckbox-BWiMbecz.mjs → MazCheckbox-D3Fm-BFu.mjs} +1 -1
- package/components/chunks/{MazDialog-CLWKCphI.mjs → MazDialog-DXaeCp-b.mjs} +1 -1
- package/components/chunks/{MazDialogPromise-DVOJwdVp.mjs → MazDialogPromise-Bgxjg9ss.mjs} +2 -2
- package/components/chunks/{MazDropzone-Dm2IirHm.mjs → MazDropzone-D0W0dlgY.mjs} +2 -3
- package/components/chunks/{MazGallery-Bn9p1gNb.mjs → MazGallery-CBE4wD7D.mjs} +3 -4
- package/components/chunks/{MazGallery-BlfPe8WG.mjs → MazGallery-Din0Z37d.mjs} +4 -5
- package/components/chunks/{MazIcon-D3umgnku.mjs → MazIcon-CTjWIkTp.mjs} +1 -1
- package/components/chunks/{MazIcon-B8A0hQAH.mjs → MazIcon-CUOwXGOK.mjs} +1 -1
- package/components/chunks/{MazInput-BpsE-mdg.mjs → MazInput-D177bUMh.mjs} +44 -44
- package/components/chunks/{MazInputNumber-DGBYbDSX.mjs → MazInputNumber-CstQGS8u.mjs} +121 -121
- package/components/chunks/{MazInputPrice-j2BNMeFp.mjs → MazInputPrice-Bp7ie9jm.mjs} +48 -48
- package/components/chunks/{MazInputTags-CJofVaj5.mjs → MazInputTags-C7nZucYu.mjs} +63 -63
- package/components/chunks/{MazLazyImg-Dboc6Xfz.mjs → MazLazyImg-DADMg49z.mjs} +3 -4
- package/components/chunks/{MazLazyImg-BFG6FIJZ.mjs → MazLazyImg-xLPMdfif.mjs} +4 -5
- package/components/chunks/{MazPagination-C6ZehQSZ.mjs → MazPagination-NbHR41CQ.mjs} +44 -44
- package/components/chunks/{MazPhoneNumberInput-DpWoNQfx.mjs → MazPhoneNumberInput-BGo-vcnD.mjs} +61 -61
- package/components/chunks/{MazPicker-ia2BEmm5.mjs → MazPicker-CJBezF2t.mjs} +173 -198
- package/components/chunks/{MazPickerMonthSwitcher-CKtfZ_m-.mjs → MazPickerMonthSwitcher-DZPHWTJt.mjs} +1 -1
- package/components/chunks/{MazPickerShortcuts-Cc9VoqBw.mjs → MazPickerShortcuts-CBEmYjPG.mjs} +1 -1
- package/components/chunks/{MazPickerYearSwitcher-0b5Wrem9.mjs → MazPickerYearSwitcher-Ynp2qf3F.mjs} +1 -1
- package/components/chunks/{MazSelect-COJoKXbV.mjs → MazSelect-D4TuCHwj.mjs} +29 -29
- package/components/chunks/{MazSpinner-BaAMq7LI.mjs → MazSpinner--h9DYpGx.mjs} +1 -1
- package/components/chunks/{MazSpinner-BZOjTZBN.mjs → MazSpinner-6pxbKImG.mjs} +1 -1
- package/components/chunks/{MazSpinner-RvDGcBng.mjs → MazSpinner-BVd7-OTu.mjs} +1 -1
- package/components/chunks/MazSpinner-C6T_enKo.mjs +37 -0
- package/components/chunks/{MazSpinner-DkXequnp.mjs → MazSpinner-C8x7LsHq.mjs} +1 -1
- package/components/chunks/{MazSpinner-V-bFi71W.mjs → MazSpinner-CLz4ccD0.mjs} +1 -1
- package/components/chunks/MazSpinner-CmJlBqgH.mjs +37 -0
- package/components/chunks/MazSpinner-D4gpZ7vL.mjs +37 -0
- package/components/chunks/{MazSpinner-CNIlbDfg.mjs → MazSpinner-D8k_MENa.mjs} +1 -1
- package/components/chunks/MazSpinner-DGxqly6h.mjs +37 -0
- package/components/chunks/{MazSpinner-9Jue6cel.mjs → MazSpinner-DVkxyBoy.mjs} +1 -1
- package/components/chunks/{MazSpinner-BGPOws6a.mjs → MazSpinner-DjR5FVqo.mjs} +1 -1
- package/components/chunks/MazSpinner-DnVHWljy.mjs +37 -0
- package/components/chunks/{MazSpinner-C41VyUup.mjs → MazSpinner-DneKNmrs.mjs} +1 -1
- package/components/chunks/MazSpinner-Q02SOFkL.mjs +37 -0
- package/components/chunks/{MazSpinner-EA5ejB8F.mjs → MazSpinner-T1t1bpbm.mjs} +1 -1
- package/components/chunks/{MazSpinner-BWYdqSMP.mjs → MazSpinner-dFnsq52G.mjs} +1 -1
- package/components/chunks/MazSpinner-iA4Rz7K5.mjs +37 -0
- package/components/chunks/{MazSpinner-DHQH6Bhz.mjs → MazSpinner-rAqBu92m.mjs} +1 -1
- package/components/chunks/MazSpinner-va5G9enA.mjs +37 -0
- package/components/chunks/{MazTable-DRUj_PZp.mjs → MazTable-BPMuTZbS.mjs} +305 -305
- package/components/chunks/{MazTransitionExpand-B08cSrmL.mjs → MazTransitionExpand-CYyEf_hd.mjs} +1 -1
- package/css/main.css +2 -1
- package/modules/assets/index.css +1 -1
- package/modules/chunks/MazBtn-1g7UvzQ_.mjs +150 -0
- package/modules/chunks/{MazBtn-BbCGGxkK.cjs → MazBtn-BKk3IsoH.cjs} +2 -2
- package/modules/chunks/{MazIcon-BDSXZYZ8.cjs → MazIcon-BEnQqDG6.cjs} +1 -1
- package/modules/chunks/{MazIcon-C2ch3jUS.mjs → MazIcon-BdDO3aVl.mjs} +1 -1
- package/modules/chunks/{MazSpinner-C9_xSbZZ.mjs → MazSpinner--BVvGFIO.mjs} +1 -1
- package/modules/chunks/{MazSpinner-BiyFRA4w.cjs → MazSpinner-PMlxvkWb.cjs} +1 -1
- package/modules/chunks/index-D5F2dSFa.cjs +124 -0
- package/modules/chunks/{index-Cwbjspv3.mjs → index-D7R1dvsf.mjs} +347 -347
- package/modules/index.cjs +1 -1
- package/modules/index.mjs +1 -1
- package/nuxt/index.json +3 -3
- package/nuxt/index.mjs +1 -1
- package/nuxt/types.d.mts +6 -12
- package/nuxt/types.d.ts +6 -12
- package/package.json +10 -10
- package/types/modules/composables/use-timer.d.ts +6 -1
- package/types/modules/plugins/toaster/MazToast.vue.d.ts +2 -2
- package/components/chunks/MazBtn-B1-sTc7F.mjs +0 -155
- package/components/chunks/MazBtn-ColLVUca.mjs +0 -150
- package/components/chunks/MazBtn-DJhQqzja.mjs +0 -150
- package/components/chunks/MazBtn-DuY28-0U.mjs +0 -150
- package/components/chunks/MazBtn-h3WmmaEO.mjs +0 -150
- package/components/chunks/MazBtn-zyRLUViT.mjs +0 -150
- package/components/chunks/MazSpinner-Bad2n-0k.mjs +0 -37
- package/components/chunks/MazSpinner-C6StE-Mb.mjs +0 -37
- package/components/chunks/MazSpinner-Cz2DHV6g.mjs +0 -37
- package/components/chunks/MazSpinner-D4CdHpP2.mjs +0 -37
- package/components/chunks/MazSpinner-DRj2VpGA.mjs +0 -37
- package/components/chunks/MazSpinner-aPFlrc5E.mjs +0 -37
- package/components/chunks/MazSpinner-nOD-7_sU.mjs +0 -37
- package/components/chunks/MazSpinner-yZGK-AQe.mjs +0 -37
- package/modules/chunks/MazBtn-UBHTKqaN.mjs +0 -150
- package/modules/chunks/index-tnjajVkX.cjs +0 -124
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";require('../assets/index.css');var nt=Object.defineProperty;var ot=(s,e,t)=>e in s?nt(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t;var l=(s,e,t)=>ot(s,typeof e!="symbol"?e+"":e,t);const o=require("vue");function te(s,e){const t=o.inject(s,e);if(!t)throw new TypeError(`[maz-ui](injectStrict) Could not resolve ${s}`);return t}function it(s,e){let t;return function(...n){clearTimeout(t),t=setTimeout(()=>{s.apply(this,n)},e)}}function be(s){return!!s}function he(s,e){let t=e==null?void 0:e.element;function n(){t&&o.render(null,t)}const i=o.createVNode(s,{...e==null?void 0:e.props,...e!=null&&e.addDestroyInProps?{destroy:n}:{}},e==null?void 0:e.children);return e!=null&&e.app?(i.appContext=e.app._context,t?o.render(i,t):typeof document<"u"&&(t=document.createElement("div"),o.render(i,t))):(t=t??document.body,o.render(i,t)),{vNode:i,destroy:n,el:t}}function w(){return typeof document<"u"}class we{constructor(e,t){l(this,"defaultOptions",{element:void 0,timeout:60*1e3*5,once:!1,immediate:!0});l(this,"options");l(this,"timeoutHandler");l(this,"isIdle",!1);l(this,"isDestroy",!1);l(this,"startTime",0);l(this,"remainingTime",0);l(this,"lastClientX",-1);l(this,"lastClientY",-1);l(this,"eventNames",["DOMMouseScroll","mousedown","mousemove","mousewheel","MSPointerDown","MSPointerMove","keydown","touchmove","touchstart","wheel","click"]);l(this,"handleEvent",e=>{try{if(this.remainingTime>0)return;if(e.type==="mousemove"){const{clientX:t,clientY:n}=e;if(t===void 0&&n===void 0||t===this.lastClientX&&n===this.lastClientY)return;this.lastClientX=t,this.lastClientY=n}this.resetTimeout(),this.callback({isIdle:this.isIdle,eventType:e.type})}catch(t){throw new Error(`[IdleTimeout](handleEvent) ${t}`)}});this.callback=e,this.options={...this.defaultOptions,...t},w()&&this.start()}get element(){return this.options.element??document.body}start(){if(!w()){console.warn("[IdleTimeout](start) you should run this method on client side");return}for(const e of this.eventNames)this.element.addEventListener(e,this.handleEvent);this.resetTimeout(),this.options.immediate&&this.callback({isIdle:!1})}pause(){const e=this.startTime+this.options.timeout-Date.now();e<=0||(this.remainingTime=e,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0))}resume(){this.remainingTime<=0||(this.resetTimeout(),this.callback({isIdle:this.isIdle}),this.remainingTime=0)}reset(){this.isDestroy=!1,this.isIdle=!1,this.remainingTime=0,this.resetTimeout(),this.callback({isIdle:this.isIdle})}destroy(){if(!w()){console.warn("[IdleTimeout](destroy) you should run this method on client side");return}this.isDestroy=!0;for(const e of this.eventNames)this.element.removeEventListener(e,this.handleEvent);this.timeoutHandler&&clearTimeout(this.timeoutHandler)}resetTimeout(){this.isIdle=!1,this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0),this.timeoutHandler=setTimeout(this.handleTimeout.bind(this),this.remainingTime||this.options.timeout),this.startTime=Date.now()}handleTimeout(){this.isIdle=!0,this.callback({isIdle:this.isIdle}),this.options.once&&this.destroy()}get destroyed(){return this.isDestroy}get timeout(){return this.options.timeout}set timeout(e){this.options.timeout=e}get idle(){return this.isIdle}set idle(e){e?this.handleTimeout():this.reset(),this.callback({isIdle:this.isIdle})}}class Ee{constructor(e,t){l(this,"eventHandlerFunction");l(this,"event","visibilitychange");l(this,"timeoutHandler");l(this,"options");l(this,"defaultOptions",{timeout:5e3,once:!1,immediate:!0});l(this,"isVisible",!1);this.callback=e,this.options={...this.defaultOptions,...t},this.eventHandlerFunction=this.eventHandler.bind(this),w()&&this.start()}start(){if(!w()){console.warn("[UserVisibility](start) you should run this method on client side");return}this.options.immediate&&this.emitCallback(),this.addEventListener()}emitCallback(){this.isVisible=document.visibilityState==="visible",this.callback({isVisible:this.isVisible}),this.options.once&&this.destroy()}eventHandler(){document.visibilityState==="visible"&&!this.isVisible?(this.clearTimeout(),this.emitCallback()):document.visibilityState==="hidden"&&this.initTimeout()}clearTimeout(){this.timeoutHandler&&(clearTimeout(this.timeoutHandler),this.timeoutHandler=void 0)}initTimeout(){this.clearTimeout(),this.timeoutHandler=setTimeout(this.emitCallback.bind(this),this.options.timeout)}addEventListener(){document.addEventListener(this.event,this.eventHandlerFunction)}removeEventListener(){document.removeEventListener(this.event,this.eventHandlerFunction)}destroy(){this.removeEventListener(),this.timeoutHandler&&clearTimeout(this.timeoutHandler)}}function ze(s){return new Promise(e=>setTimeout(e,s))}class rt{constructor({src:e,identifier:t,once:n=!0,async:i=!0,defer:r=!0}){l(this,"src");l(this,"script");l(this,"once");l(this,"async");l(this,"defer");l(this,"identifier");if(typeof window>"u")throw new TypeError("[ScriptLoader]: Is supported only on browser side");if(!e)throw new Error('[ScriptLoader]: You should provide the attribut "src"');if(!t)throw new Error('[ScriptLoader]: You should provide the attribut "identifier"');this.src=e,this.identifier=t,this.once=n,this.async=i,this.defer=r}removeTag(e){var t;typeof e=="string"?(t=document.head.querySelector(`[data-identifier="${e}"]`))==null||t.remove():e.remove()}load(){const e=window,t=document.head.querySelectorAll(`[data-identifier="${this.identifier}"]`);if(this.once&&e[this.identifier]&&t.length>0)return this.script=e[this.identifier],Promise.resolve(this.script);if(!this.once&&t.length>0)for(const n of t)this.removeTag(n);return this.injectScript()}injectScript(){const e=window;return new Promise((t,n)=>{try{const i=document.createElement("script");i.src=this.src,i.async=this.async,i.defer=this.defer,i.dataset.identifier=this.identifier,i.addEventListener("error",r=>n(new Error(`[ScriptLoader](injectScript) ${r.message}`))),i.addEventListener("load",r=>(this.script=r,e[this.identifier]=r,t(r))),document.head.append(i)}catch(i){throw new Error(`[ScriptLoader](init) ${i}`)}})}}function at(s){return[...s].map(e=>{const t=e.codePointAt(0);return t?t%32+127461:void 0}).filter(be).map(e=>String.fromCodePoint(e)).join("")}class Te{constructor(e){l(this,"defaultOptions",{preventDefaultOnTouchMove:!1,preventDefaultOnMouseWheel:!1,threshold:50,immediate:!1,triggerOnEnd:!1});l(this,"element");l(this,"xStart");l(this,"yStart");l(this,"xEnd");l(this,"yEnd");l(this,"xDiff");l(this,"yDiff");l(this,"onToucheStartCallback");l(this,"onToucheMoveCallback");l(this,"onToucheEndCallback");l(this,"onMouseWheelCallback");l(this,"options");if(this.inputOption=e,this.options={...this.defaultOptions,...e},!this.options.element)throw new Error("[SwipeHandler] Element should be provided. Its can be a string selector or an HTMLElement");if(typeof this.options.element=="string"){const t=document.querySelector(this.options.element);if(!(t instanceof HTMLElement))throw new TypeError("[SwipeHandler] String selector for element is not found");this.element=t}else this.element=this.options.element;this.onToucheStartCallback=this.toucheStartHandler.bind(this),this.onToucheMoveCallback=this.handleTouchMove.bind(this),this.onToucheEndCallback=this.handleTouchEnd.bind(this),this.onMouseWheelCallback=this.handleMouseWheel.bind(this),this.options.immediate&&this.start()}start(){this.element.addEventListener("touchstart",this.onToucheStartCallback,{passive:!0}),this.element.addEventListener("touchmove",this.onToucheMoveCallback,{passive:!0}),this.options.triggerOnEnd&&this.element.addEventListener("touchend",this.onToucheEndCallback,{passive:!0}),this.options.preventDefaultOnMouseWheel&&this.element.addEventListener("mousewheel",this.onMouseWheelCallback,{passive:!1})}stop(){this.element.removeEventListener("touchstart",this.onToucheStartCallback),this.element.removeEventListener("touchmove",this.onToucheMoveCallback),this.element.removeEventListener("touchend",this.onToucheEndCallback),this.options.preventDefaultOnMouseWheel&&this.element.removeEventListener("mousewheel",this.onMouseWheelCallback)}handleMouseWheel(e){e.preventDefault()}toucheStartHandler(e){this.xStart=e.touches[0].clientX,this.yStart=e.touches[0].clientY,this.emitValuesChanged()}emitValuesChanged(){var e,t;(t=(e=this.options).onValuesChanged)==null||t.call(e,{xStart:this.xStart,yStart:this.yStart,xEnd:this.xEnd,yEnd:this.yEnd,xDiff:this.xDiff,yDiff:this.yDiff})}handleTouchMove(e){this.options.preventDefaultOnTouchMove&&e.cancelable&&e.preventDefault(),this.xEnd=e.touches[0].clientX,this.yEnd=e.touches[0].clientY,!(!this.xStart||!this.yStart)&&(this.xDiff=this.xStart-this.xEnd,this.yDiff=this.yStart-this.yEnd,this.emitValuesChanged(),this.options.triggerOnEnd||this.runCallbacks(e))}handleTouchEnd(e){this.runCallbacks(e),this.emitValuesChanged()}runCallbacks(e){var t,n,i,r,a,u,d,f;typeof this.xDiff!="number"||typeof this.yDiff!="number"||Math.abs(this.xDiff)<this.options.threshold&&Math.abs(this.yDiff)<this.options.threshold||(Math.abs(this.xDiff)>Math.abs(this.yDiff)?this.xDiff>0?(n=(t=this.options).onLeft)==null||n.call(t,e):(r=(i=this.options).onRight)==null||r.call(i,e):this.yDiff>0?(u=(a=this.options).onUp)==null||u.call(a,e):(f=(d=this.options).onDown)==null||f.call(d,e),this.resetValues())}resetValues(){this.xStart=void 0,this.yStart=void 0,this.xEnd=void 0,this.yEnd=void 0,this.xDiff=void 0,this.yDiff=void 0,this.emitValuesChanged()}}function lt(s,e){let t=0;return async function(){const n=Date.now();n-t>=e&&(await s(),t=n)}}const ct={removeAccents:!0,caseSensitive:!1,replaceSpaces:!0,removeSpecialCharacters:!1,trim:!0,normalizeSpaces:!0,removeNumbers:!1,customNormalizationForms:["NFC","NFKD"]};function ce(s,e){const t={...ct,...e},n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Î:"I",Ï:"I",í:"I",î:"i",ï:"i",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ç:"C",ç:"c",ÿ:"y",Ñ:"N",ñ:"n",ó:"o"};let i=s.toString();if(t.trim&&(i=i.trim()),t.normalizeSpaces&&(i=i.replaceAll(/\s+/g," ")),t.replaceSpaces&&(i=i.replaceAll(" ","-")),t.removeNumbers&&(i=i.replaceAll(/\d/g,"")),t.removeAccents&&(i=i.replaceAll(/[ÀÁÂÃÄÅÇÈÉÊËÎÏÑÔÕÖØÙÚÛÜàáâãäåçèéêëíîïñóôõöøùúûüÿ]/g,r=>n[r]||r),i=i.replaceAll(/[\u0300-\u036F]/g,"")),t.caseSensitive===!1&&(i=i.toLowerCase()),t.removeSpecialCharacters&&(i=i.replaceAll(/[^\dA-Z-]/gi,"")),t.trim&&(i=i.trim()),t.customNormalizationForms)for(const r of t.customNormalizationForms)i=i.normalize(r);return i}const ee="__maz-click-outside__";function Le(){return document.ontouchstart===null?"touchstart":"click"}async function Ie(s,e){try{ke(s);const t=e.instance,n=e.value,i=typeof n=="function";if(!i)throw new Error("[maz-ui](vClickOutside) the callback should be a function");await o.nextTick(),s[ee]=a=>{if((!s||a.target&&!s.contains(a.target))&&n&&i)return n.call(t,a)};const r=Le();document.addEventListener(r,s[ee],{passive:!0})}catch(t){console.error("[maz-ui](vClickOutside)",t)}}function ke(s){try{const e=Le();document.removeEventListener(e,s[ee],!1),delete s[ee]}catch(e){console.error("[maz-ui](vClickOutside)",e)}}function ut(s,e){try{if(e.value===e.oldValue)return;Ie(s,e)}catch(t){console.error("[maz-ui](vClickOutside)",t)}}const Ce={mounted:Ie,updated:ut,unmounted:ke},Se={install:s=>{s.directive("click-outside",Ce)}};function Ae(s,e,t){var a;s.stopPropagation();const n=typeof t.value=="function"?t.value:t.value.handler,i=typeof t.value=="object"?t.value.exclude:void 0;let r=!1;if(i&&i.length>0){for(const u of i)if(!r&&s.target instanceof HTMLElement){const d=(a=document.querySelector(u))==null?void 0:a.getAttribute("id");r=s.target.getAttribute("id")===d}}!e.contains(s.target)&&!r&&(n==null||n())}function xe(){return document.ontouchstart===null?"touchstart":"click"}function mt(s,e){const t=xe();document.removeEventListener(t,n=>Ae(n,s,e))}function dt(s,e){if(typeof e.value!="function"&&typeof e.value=="object"&&typeof e.value.handler!="function"){console.error("[maz-ui](vClosable) v-closable directive requires a handler function");return}const t=xe();document.addEventListener(t,n=>Ae(n,s,e))}const Oe={mounted:dt,unmounted:mt},Me={install:s=>{s.directive("closable",Oe)}},ue={position:"top"};class He{constructor(e={}){l(this,"options");this.options={...ue,...e}}getPosition({modifiers:e,value:t}){return e.top?"top":e.bottom?"bottom":e.left?"left":e.right?"right":typeof t=="string"?"top":t.position??this.options.position}getText({value:e}){return typeof e=="string"?e:e.text}getOpen({value:e}){return typeof e=="string"?!1:e.open??!1}getColor({value:e}){return typeof e=="string"?"default":e.color??"default"}create(e,t){e.setAttribute("data-tooltip",this.getText(t)),e.classList.add("m-tooltip");const n=this.getPosition(t);e.classList.add(`m-tooltip--${n}`),e.classList.add(`m-tooltip--${this.getColor(t)}`),this.getOpen(t)&&e.classList.add("m-tooltip--open")}update(e,t){this.remove(e,t),this.create(e,t)}remove(e,t){e.removeAttribute("data-tooltip"),e.classList.remove("m-tooltip"),e.classList.remove("m-tooltip--top"),e.classList.remove("m-tooltip--bottom"),e.classList.remove("m-tooltip--left"),e.classList.remove("m-tooltip--right"),e.classList.remove("m-tooltip--open"),e.classList.remove(`m-tooltip--${this.getColor(t)}`)}}let Z;const ht={beforeMount(s,e){const t=typeof e.value=="object"?e.value:{};return Z=new He(t),Z.create(s,e)},updated(s,e){return Z.update(s,e)},unmounted(s,e){return Z.remove(s,e)}},Pe={install:(s,e=ue)=>{const t={...ue,...e},n=new He(t);s.directive("tooltip",{beforeMount:n.create.bind(n),updated:n.update.bind(n),unmounted:n.remove.bind(n)})}},ft=`
|
|
2
|
+
.maz-zoom-img {
|
|
3
|
+
position: fixed;
|
|
4
|
+
top: 0;
|
|
5
|
+
bottom: 0;
|
|
6
|
+
left: 0;
|
|
7
|
+
right: 0;
|
|
8
|
+
padding: 1rem;
|
|
9
|
+
z-index: 1050;
|
|
10
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.maz-zoom-img,
|
|
18
|
+
.maz-zoom-img * {
|
|
19
|
+
box-sizing: border-box;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.maz-zoom-img .maz-zoom-img__wrapper {
|
|
23
|
+
position: relative;
|
|
24
|
+
display: flex;
|
|
25
|
+
justify-content: center;
|
|
26
|
+
align-items: center;
|
|
27
|
+
min-width: 0;
|
|
28
|
+
min-height: 0;
|
|
29
|
+
max-width: 100%;
|
|
30
|
+
max-height: 100%;
|
|
31
|
+
transition: all 300ms ease-in-out;
|
|
32
|
+
opacity: 0;
|
|
33
|
+
transform: scale(0.5);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__wrapper {
|
|
37
|
+
opacity: 1;
|
|
38
|
+
transform: scale(1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader {
|
|
42
|
+
position: absolute;
|
|
43
|
+
top: 0;
|
|
44
|
+
bottom: 0;
|
|
45
|
+
left: 0;
|
|
46
|
+
right: 0;
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
justify-content: center;
|
|
50
|
+
background-color: hsla(238, 15%, 40%, 0.7);
|
|
51
|
+
border-radius: 1rem;
|
|
52
|
+
z-index: 2;
|
|
53
|
+
min-width: 60px;
|
|
54
|
+
min-height: 60px;
|
|
55
|
+
}
|
|
56
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader[hidden] {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@-webkit-keyframes spin {
|
|
61
|
+
0% { transform: rotate(0deg); }
|
|
62
|
+
100% { transform: rotate(360deg); }
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
@keyframes spin {
|
|
66
|
+
0% { transform: rotate(0deg); }
|
|
67
|
+
100% { transform: rotate(360deg); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.maz-zoom-img.maz-animate .maz-zoom-img__loader__svg {
|
|
71
|
+
animation: spin .6s linear infinite;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.maz-zoom-img img {
|
|
75
|
+
max-width: 100%;
|
|
76
|
+
max-height: 100%;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
border-radius: 1rem;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.maz-zoom-img .maz-zoom-btn {
|
|
82
|
+
margin: 0 auto;
|
|
83
|
+
border: none;
|
|
84
|
+
background-color: hsla(0, 0%, 7%, 0.5);
|
|
85
|
+
box-shadow: 0 0 0.5rem 0 hsla(0, 0%, 0%, 0.2);
|
|
86
|
+
height: 2.2rem;
|
|
87
|
+
min-height: 2.2rem;
|
|
88
|
+
width: 2.2rem;
|
|
89
|
+
min-width: 2.2rem;
|
|
90
|
+
display: flex;
|
|
91
|
+
align-items: center;
|
|
92
|
+
justify-content: center;
|
|
93
|
+
border-radius: 2.2rem;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
flex: 0 0 auto;
|
|
96
|
+
outline: none;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.maz-zoom-img .maz-zoom-btn svg {
|
|
100
|
+
fill: white;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--close {
|
|
104
|
+
position: absolute;
|
|
105
|
+
top: 0.5rem;
|
|
106
|
+
right: 0.5rem;
|
|
107
|
+
z-index: 1;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--previous {
|
|
111
|
+
position: absolute;
|
|
112
|
+
left: 0.5rem;
|
|
113
|
+
z-index: 1;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.maz-zoom-img .maz-zoom-btn.maz-zoom-btn--next {
|
|
117
|
+
position: absolute;
|
|
118
|
+
right: 0.5rem;
|
|
119
|
+
z-index: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.maz-zoom-img .maz-zoom-btn:hover {
|
|
123
|
+
background-color: hsl(0, 0%, 0%);
|
|
124
|
+
}`,pe={close:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"/></svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"/></svg>',previous:'<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24"><path d="M0 0h24v24H0z" fill="none"/><path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z"/></svg>',spinner:'<svg width="40px" height="40px" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor" x="0px" y="0px" viewBox="0 0 50 50" xml:space="preserve" class="maz-zoom-img__loader__svg" data-v-6d1cb50c=""><path d="M43.935,25.145c0-10.318-8.364-18.683-18.683-18.683c-10.318,0-18.683,8.365-18.683,18.683h4.068c0-8.071,6.543-14.615,14.615-14.615c8.072,0,14.615,6.543,14.615,14.615H43.935z"></path></svg>'};class vt{constructor(e){l(this,"options");l(this,"loader");l(this,"wrapper");l(this,"img");l(this,"keydownHandler");l(this,"onImgLoadedCallback");l(this,"buttonsAdded");l(this,"defaultOptions",{scale:!0,blur:!0,disabled:!1});l(this,"mouseEnterListener");l(this,"mouseLeaveListener");l(this,"renderPreviewListener");if(!e.value)throw new Error('[MazUI](zoom-img) Image path must be defined. Ex: `v-zoom-img="<PATH_TO_IMAGE>"`');if(typeof e.value=="object"&&!e.value.src)throw new Error("[maz-ui](zoom-img) src of image must be provided");this.buttonsAdded=!1,this.options=this.buildOptions(e),this.keydownHandler=this.keydownLister.bind(this),this.loader=this.getLoader(),this.wrapper=document.createElement("div"),this.wrapper.classList.add("maz-zoom-img__wrapper"),this.wrapper.prepend(this.loader),this.img=document.createElement("img"),this.onImgLoadedCallback=this.onImgLoaded.bind(this),this.imgEventHandler(!0)}buildOptions(e){return{...this.defaultOptions,...typeof e.value=="object"?e.value:{src:e.value}}}get allInstances(){return[...document.querySelectorAll(".maz-zoom-img-instance")]}create(e){this.options.disabled||(e.style.cursor="pointer",setTimeout(()=>e.classList.add("maz-zoom-img-instance")),e.setAttribute("data-zoom-src",this.options.src),this.options.alt&&e.setAttribute("data-zoom-alt",this.options.alt),e.style.transition="all 300ms ease-in-out",this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e,this.options),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener))}update(e){this.options=this.buildOptions(e)}remove(e){this.imgEventHandler(!1),e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("maz-zoom-img-instance"),e.removeAttribute("data-zoom-src"),e.removeAttribute("data-zoom-alt"),e.style.cursor=""}renderPreview(e,t){e.classList.add("maz-is-open"),this.addStyle(ft);const n=document.createElement("div");n.classList.add("maz-zoom-img"),n.setAttribute("id","MazImgPreviewFullsize"),n.addEventListener("click",i=>{n.isEqualNode(i.target)&&this.closePreview()}),typeof t=="object"&&(this.img.setAttribute("src",t.src),t.alt&&this.img.setAttribute("alt",t.alt),this.img.id="MazImgElement"),this.wrapper.append(this.img),n.append(this.wrapper),document.body.append(n),this.keyboardEventHandler(!0),setTimeout(()=>{n&&n.classList.add("maz-animate")},100)}onImgLoaded(){this.wrapper.style.width=`${this.img.width}px`,this.wrapper.style.minWidth="200px",this.loader.hidden=!0;const e=this.getButton(),t=[],n=this.allInstances.length>1;if(!this.buttonsAdded){if(this.buttonsAdded=!0,n){const i=this.getButton("previous"),r=this.getButton("next");t.push(i,r)}this.wrapper.append(e),n&&(this.wrapper.prepend(t[0]),this.wrapper.append(t[1]))}}getLoader(){const e=document.createElement("div");return e.classList.add("maz-zoom-img__loader"),e.innerHTML=pe.spinner,e}mouseLeave(e){this.options.scale&&(e.style.transform=""),this.options.blur&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scale&&(e.style.transform="scale(1.1)"),this.options.blur&&(e.style.filter="blur(2px)")}keydownLister(e){e.preventDefault(),(e.key==="Escape"||e.key===" ")&&this.closePreview(),(e.key==="ArrowLeft"||e.key==="ArrowRight")&&this.nextPreviousImage(e.key==="ArrowRight")}getButton(e="close"){const t=document.createElement("button");t.innerHTML=pe[e];const n=e==="close"?this.closePreview():this.allInstances?this.nextPreviousImage(e==="next"):null;return t.addEventListener("click",()=>n),t.classList.add("maz-zoom-btn"),t.classList.add(`maz-zoom-btn--${e}`),t}closePreview(){const e=document.querySelector("#MazImgPreviewFullsize"),t=document.querySelector("#MazPreviewStyle"),n=document.querySelector(".maz-zoom-img-instance.maz-is-open");n&&n.classList.remove("maz-is-open"),e&&e.classList.remove("maz-animate"),this.keyboardEventHandler(!1),setTimeout(()=>{e&&e.remove(),t&&t.remove()},300)}getNewInstanceIndex(e){return e<0?this.allInstances.length-1:e>=this.allInstances.length?0:e}nextPreviousImage(e){const t=e,n=document.querySelector(".maz-zoom-img-instance.maz-is-open");if(n){const i=this.allInstances.indexOf(n),r=t?i+1:i-1,a=this.allInstances[this.getNewInstanceIndex(r)];a&&this.useNextInstance(n,a)}}useNextInstance(e,t){e.classList.remove("maz-is-open"),t.classList.add("maz-is-open");const n=t.getAttribute("data-zoom-src"),i=t.getAttribute("data-zoom-alt");this.wrapper.style.width="",this.loader.hidden=!1,n&&this.img.setAttribute("src",n),i&&this.img.setAttribute("alt",i)}addStyle(e){const t=document.createElement("style");t.id="MazPreviewStyle",t.textContent=e,document.head.append(t)}keyboardEventHandler(e){if(e)return document.addEventListener("keydown",this.keydownHandler);document.removeEventListener("keydown",this.keydownHandler)}imgEventHandler(e){if(e)return this.img.addEventListener("load",this.onImgLoadedCallback);this.img.removeEventListener("load",this.onImgLoadedCallback)}}let Q;const De={created(s,e){Q=new vt(e),Q.create(s)},updated(s,e){Q.update(e)},unmounted(s){Q.remove(s)}},$e={install(s){s.directive("zoom-img",De)}},pt="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",me={baseClass:"m-lazy-img",loadedClass:"m-lazy-loaded",loadingClass:"m-lazy-loading",errorClass:"m-lazy-error",noPhotoClass:"m-lazy-no-photo",noPhoto:!1,observerOnce:!0,loadOnce:!1,noUseErrorPhoto:!1,observerOptions:{threshold:.1}};class Ne{constructor(e={}){l(this,"observers",[]);l(this,"defaultOptions",me);l(this,"options");l(this,"onImgLoadedCallback");l(this,"onImgErrorCallback");l(this,"hasImgLoaded",!1);this.options=this.buildOptions(e),this.onImgLoadedCallback=this.imageIsLoaded.bind(this),this.onImgErrorCallback=this.imageHasError.bind(this)}async loadErrorPhoto(){const{default:e}=await Promise.resolve().then(()=>require("./no-photography-CLNgmzDi.cjs"));return e}buildOptions(e){return{...this.defaultOptions,...e,observerOptions:{...this.defaultOptions.observerOptions,...e.observerOptions}}}removeClass(e,t){e.classList.remove(t)}addClass(e,t){e.classList.add(t)}removeAllStateClasses(e){this.removeClass(e,this.options.loadedClass),this.removeClass(e,this.options.loadingClass),this.removeClass(e,this.options.errorClass),this.removeClass(e,this.options.noPhotoClass)}setBaseClass(e){this.addClass(e,this.options.baseClass)}imageIsLoading(e){var t,n;this.addClass(e,this.options.loadingClass),(n=(t=this.options).onLoading)==null||n.call(t,e)}imageHasNoPhoto(e){this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.noPhotoClass),this.setDefaultPhoto(e)}imageIsLoaded(e){var t,n;this.hasImgLoaded=!0,this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.loadedClass),(n=(t=this.options).onLoaded)==null||n.call(t,e)}imageHasError(e){var t,n;this.removeClass(e,this.options.loadingClass),this.addClass(e,this.options.errorClass),(n=(t=this.options).onError)==null||n.call(t,e),this.setDefaultPhoto(e)}getSrc(e){return typeof e.value=="object"?e.value.src:e.value}getImageUrl(e,t){const n=this.getImgElement(e).getAttribute("data-lazy-src");return n||this.getSrc(t)}async setPictureSourceUrls(e){const t=e.querySelectorAll("source");if(t.length>0)for await(const n of t){const i=n.getAttribute("data-lazy-srcset");if(i)n.srcset=i;else return this.imageHasError(e)}else this.imageHasError(e)}hasBgImgMode(e){return e.arg==="bg-image"}isPictureElement(e){return e instanceof HTMLPictureElement}getImgElement(e){return this.isPictureElement(e)?e.querySelector("img"):e}async setDefaultPhoto(e){if(this.options.noUseErrorPhoto)return;const t=this.options.fallbackSrc??this.options.errorPhoto;typeof t=="string"&&this.addClass(e,this.options.noPhotoClass);const n=t??await this.loadErrorPhoto(),i=e.querySelectorAll("source");if(i.length>0)for await(const r of i)r.srcset=n;else this.setImgSrc(e,n)}addEventListenerToImg(e){const t=this.getImgElement(e);t.addEventListener("load",()=>this.onImgLoadedCallback(e),{once:!0}),t.addEventListener("error",n=>this.onImgErrorCallback(e,n),{once:!0})}async loadImage(e,t){if(this.imageIsLoading(e),this.isPictureElement(e))this.addEventListenerToImg(e),await this.setPictureSourceUrls(e);else{const n=this.getImageUrl(e,t);if(!n)return this.imageHasError(e);this.hasBgImgMode(t)?(e.style.backgroundImage=`url('${n}')`,this.imageIsLoaded(e)):(this.addEventListenerToImg(e),this.setImgSrc(e,n))}}setImgSrc(e,t){const n=this.getImgElement(e);n.src=t}handleIntersectionObserver(e,t,n,i){var r,a;this.observers.push(i);for(const u of n)if(u.isIntersecting){if((a=(r=this.options).onIntersecting)==null||a.call(r,u.target),this.options.observerOnce&&i.unobserve(e),this.options.loadOnce&&this.hasImgLoaded)return;this.loadImage(e,t)}}createObserver(e,t){const n=(a,u)=>{this.handleIntersectionObserver(e,t,a,u)},i=this.options.observerOptions;new IntersectionObserver(n,i).observe(e)}async imageHandler(e,t,n){if(n==="update")for await(const i of this.observers)i.unobserve(e);window.IntersectionObserver?this.createObserver(e,t):this.loadImage(e,t)}async bindUpdateHandler(e,t,n){if(this.options.noPhoto)return this.imageHasNoPhoto(e);await this.imageHandler(e,t,n)}async add(e,t){if(this.hasBgImgMode(t)&&this.isPictureElement(e))throw new Error(`[MazLazyImg] You can't use the "bg-image" mode with "<picture />" element`);setTimeout(()=>this.setBaseClass(e),0),e.getAttribute("src")||this.setImgSrc(e,pt),await this.bindUpdateHandler(e,t,"bind")}async update(e,t){t.value!==t.oldValue&&(this.hasImgLoaded=!1,this.removeAllStateClasses(e),await this.bindUpdateHandler(e,t,"update"))}remove(e,t){this.hasImgLoaded=!1,this.hasBgImgMode(t)&&(e.style.backgroundImage=""),this.removeAllStateClasses(e);for(const n of this.observers)n.unobserve(e);this.observers=[]}}let G;const gt={created(s,e){const t=typeof e.value=="object"?e.value:{};G=new Ne(t),G.add(s,e)},updated(s,e){G.update(s,e)},unmounted(s,e){G.remove(s,e)}},_e={install(s,e={}){const t={...me,...e,observerOptions:{...me.observerOptions,...e.observerOptions}},n=new Ne(t);s.directive("lazy-img",{created:n.add.bind(n),updated:n.update.bind(n),unmounted:n.remove.bind(n)})}},yt=["onKeypress"],bt={class:"m-fullscreen-img-scroller"},wt=["src","alt"],Et=o.defineComponent({__name:"MazFullscreenImg",props:{src:{},clickedElementBounds:{default:void 0},offset:{default:void 0},animation:{default:()=>({duration:300,easing:"ease-in-out"})},openInstanceClass:{default:"m-fullscreen-img-instance"},clickedElement:{},destroy:{type:Function,default:void 0},alt:{default:void 0},zoom:{type:Boolean,default:!0}},emits:["close","previous","next","before-close"],setup(s,{emit:e}){const t=s,n=e,i=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazSpinner-PMlxvkWb.cjs"))),r=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-BETcRuRC.cjs"))),a=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./chevron-left-D2bYJFWX.cjs"))),u=o.ref(!1),d=o.ref(!1),f=o.ref(!1),E=o.ref(!1),y=o.ref(!1),g=o.ref(t.clickedElement),z=o.computed(()=>t.clickedElement.getBoundingClientRect()),W=o.computed(()=>z.value.height<z.value.width),x=o.ref(t.src),C=o.ref(t.alt),j=o.ref(),L=o.ref(),$=o.computed(()=>y.value?"--is-zoomed maz-cursor-zoom-out":"maz-cursor-zoom-in");function N(){u.value=!0,d.value=!1,f.value=!0}o.watch(()=>f.value,c=>{c&&oe()});function S(){n("before-close"),m()}function A(c){c.key==="Escape"&&(c.preventDefault(),S()),(c.key==="ArrowLeft"||c.key==="ArrowRight")&&(c.preventDefault(),_(c.key==="ArrowRight"?"next":"previous"))}function O(){document.documentElement.classList.add("--m-fullscreen-open")}function se(){document.documentElement.classList.remove("--m-fullscreen-open")}function R(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}function Y(c,h){return h<0?c.length-1:h>=c.length?0:h}async function K(c,h){c.classList.remove(t.openInstanceClass),h.classList.add(t.openInstanceClass);const p=h.getAttribute("data-src"),b=h.getAttribute("data-alt");C.value=b,p&&(x.value=p),u.value=!1,u.value||(d.value=!0)}function _(c){const h=document.querySelector(`.m-fullscreen-img-instance.${t.openInstanceClass}`);if(h){const p=R(),b=p.indexOf(h),I=c==="next"?b+1:b-1,T=p[Y(p,I)];g.value=T,T&&K(h,T),n(c),y.value?M(L.value):P()}}function M(c){W.value?(c.style.width=`${window.innerWidth}px`,c.style.removeProperty("height")):(c.style.height=`${window.innerHeight}px`,c.style.removeProperty("width")),c.style.removeProperty("top"),c.style.removeProperty("left")}async function ne(){const c=L.value;y.value?(y.value=!y.value,P()):(y.value=!y.value,M(c))}function B(c){var h;return(h=L.value)==null?void 0:h.animate(c,{duration:t.animation.duration,easing:t.animation.easing})}function X(c=t.offset??0){const h=(g.value instanceof HTMLImageElement?g.value.naturalWidth:g.value.clientWidth)||1,p=(g.value instanceof HTMLImageElement?g.value.naturalHeight:g.value.clientHeight)||1,b=window.innerWidth,I=window.innerHeight,T=Math.min((b-2*c)/h,(I-2*c)/p),ie=(b-h*T)/2,re=(I-p*T)/2;return{centerX:ie,centerY:re,originalWidth:h,originalHeight:p,scale:T}}function H({trigger:c}){const{originalWidth:h,originalHeight:p,scale:b,centerX:I,centerY:T}=X(),{top:ie,left:re,width:tt,height:st}=z.value,ve=[{top:`${ie}px`,left:`${re}px`,width:`${tt}px`,height:`${st}px`,opacity:0},{top:`${T}px`,left:`${I}px`,width:`${h*b}px`,height:`${p*b}px`,opacity:1}];return{frames:c==="open"?ve:ve.reverse()}}function P(){const{centerX:c,centerY:h,originalHeight:p,originalWidth:b,scale:I}=X(),T={top:`${h}px`,left:`${c}px`,width:`${b*I}px`,height:`${p*I}px`};if(!L.value)throw console.error("[maz-ui](vFullscreenImg) ImgElement is not defined");Object.assign(L.value.style,T)}function oe(){const{frames:c}=H({trigger:"open"}),h=B(c);if(!h)throw console.error("[maz-ui](vFullscreenImg) open animation is not defined");h.onfinish=()=>{P()}}function m(){const{frames:c}=H({trigger:"close"}),h=B(c);if(!h)throw console.error("[maz-ui](vFullscreenImg) close animation is not defined");h.onfinish=()=>{var p,b;n("close"),(p=j.value)==null||p.remove(),(b=t.destroy)==null||b.call(t)}}function v(){y.value||P()}return o.onMounted(()=>{d.value=!0,document.addEventListener("keydown",A),window.addEventListener("resize",v),O(),E.value=R().length>1}),o.onBeforeUnmount(()=>{document.removeEventListener("keydown",A),window.removeEventListener("resize",v),se()}),(c,h)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"FullscreenImgElement",ref:j,role:"button",class:"m-fullscreen-img",tabindex:"0",onClick:o.withModifiers(S,["stop"]),onKeypress:o.withKeys(o.withModifiers(S,["prevent"]),["esc"])},[o.withDirectives(o.createVNode(o.unref(i),{class:"m-fullscreen-img-loader maz-h-16"},null,512),[[o.vShow,d.value]]),f.value&&E.value?(o.openBlock(),o.createElementBlock("button",{key:0,type:"button",class:"m-fullscreen-btn --next",onClick:h[0]||(h[0]=o.withModifiers(p=>_("next"),["stop"]))},[o.createVNode(o.unref(a),{class:"maz-rotate-180 maz-text-3xl"})])):o.createCommentVNode("v-if",!0),f.value&&E.value?(o.openBlock(),o.createElementBlock("button",{key:1,type:"button",class:"m-fullscreen-btn --previous",onClick:h[1]||(h[1]=o.withModifiers(p=>_("previous"),["stop"]))},[o.createVNode(o.unref(a),{class:"maz-text-3xl"})])):o.createCommentVNode("v-if",!0),o.createElementVNode("button",{type:"button",class:"m-fullscreen-btn --close",onClick:S},[o.createVNode(o.unref(r),{class:"maz-text-3xl"})]),o.createElementVNode("div",bt,[o.createCommentVNode(" eslint-disable-next-line vuejs-accessibility/no-static-element-interactions, vuejs-accessibility/click-events-have-key-events "),o.createElementVNode("img",{ref_key:"ImgElement",ref:L,src:x.value,alt:C.value??void 0,tabindex:"0",class:o.normalizeClass([$.value]),onLoad:N,onClick:h[2]||(h[2]=o.withModifiers(p=>c.zoom?ne():void 0,["stop"]))},null,42,wt)])],40,yt))}}),fe=(s,e)=>{const t=s.__vccOpts||s;for(const[n,i]of e)t[n]=i;return t},zt=fe(Et,[["__scopeId","data-v-884a2c57"]]),ge="m-fullscreen-is-open";class Tt{constructor(){l(this,"options");l(this,"defaultOptions",{scaleOnHover:!1,blurOnHover:!1,disabled:!1,zoom:!0,offset:80,animation:{duration:300,easing:"ease-in-out"}});l(this,"mouseEnterListener");l(this,"mouseLeaveListener");l(this,"renderPreviewListener")}buildOptions(e,t){const n=typeof t.value=="object"?t.value:{src:t.value,alt:void 0},i=(n==null?void 0:n.src)??this.getImgSrc(e),r=(n==null?void 0:n.alt)??this.getImgAlt(e);return{...this.defaultOptions,...n,src:i,alt:r}}get allInstances(){return[...document.querySelectorAll(".m-fullscreen-img-instance")]}getImgSrc(e){var n;const t=((n=this.options)==null?void 0:n.src)||e.getAttribute("src")||e.getAttribute("data-src");if(!t)throw new Error('[maz-ui](fullscreen-img) src of image must be provided by `v-fullscreen=""`, `v-fullscreen="{ src: "" }"`, `src=""` or `data-src=""` atributes');return t}getImgAlt(e){var t;return((t=this.options)==null?void 0:t.alt)||e.getAttribute("alt")||e.getAttribute("data-alt")}create(e,t){if(this.options=this.buildOptions(e,t),this.options.disabled)return;e.style.cursor="move",(this.options.scaleOnHover||this.options.blurOnHover)&&(e.style.transition="all 200ms ease-in-out"),e.classList.add("m-fullscreen-img-instance"),e.setAttribute("data-src",this.getImgSrc(e));const n=this.getImgAlt(e);n&&e.setAttribute("data-alt",n),this.mouseEnterListener=()=>this.mouseEnter(e),this.mouseLeaveListener=()=>this.mouseLeave(e),this.renderPreviewListener=()=>this.renderPreview(e),e.addEventListener("mouseenter",this.mouseEnterListener),e.addEventListener("mouseleave",this.mouseLeaveListener),e.addEventListener("click",this.renderPreviewListener)}update(e,t){this.options=this.buildOptions(e,t)}remove(e){e.removeEventListener("mouseenter",this.mouseEnterListener),e.removeEventListener("mouseleave",this.mouseLeaveListener),e.removeEventListener("click",this.renderPreviewListener),e.classList.remove("m-fullscreen-img-instance"),e.style.cursor=""}renderPreview(e){return e.classList.add(ge),he(zt,{props:{...this.options,openInstanceClass:ge,clickedElement:e,clickedElementBounds:e.getBoundingClientRect()},addDestroyInProps:!0})}mouseLeave(e){this.options.scaleOnHover&&(e.style.transform=""),this.options.blurOnHover&&(e.style.filter=""),e.style.zIndex=""}mouseEnter(e){e.style.zIndex="1",this.options.scaleOnHover&&(e.style.transform="scale(1.04)"),this.options.blurOnHover&&(e.style.filter="blur(3px)")}}let J;const Be={mounted(s,e){return J=new Tt,J.create(s,e)},updated(s,e){return J.update(s,e)},unmounted(s){return J.remove(s)}},Fe={install(s){s.directive("fullscreen-img",Be)}},Lt=[Me,$e,_e,Se,Fe,Pe],It={install(s){for(const e of Lt)e.install(s,{})}};function Ve(s){return s?(s=s.toString(),s.charAt(0).toUpperCase()+s.slice(1)):""}const kt={style:"currency",minimumFractionDigits:2,round:!1};function Ct(s,e,t){let n=Number(s);return t.round&&(n=Math.floor(n),t.minimumFractionDigits=0),new Intl.NumberFormat(e,t).format(n)}function St(s,e,t){if(s===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterCurrency) The `locale` attribute must be a string.");if(t.currency===void 0)throw new TypeError("[maz-ui](FilterCurrency) The `options.currency` attribute is required.")}function qe(s,e,t){const n={...kt,...t};St(s,e,n);try{return Ct(s,e,n)}catch(i){throw new Error(`[maz-ui](FilterCurrency) ${i}`)}}const At={month:"short",day:"numeric",year:"numeric"};function Ue(s,e,t){if(e===void 0)throw new TypeError("[maz-ui](FilterDate) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterDate) The `locale` attribute must be a string.");const n=t??At;try{const i=s instanceof Date?s:new Date(s);return new Intl.DateTimeFormat(e,n).format(i)}catch(i){throw new Error(`[maz-ui](FilterDate) ${i}`)}}const xt={minimumFractionDigits:2};function We(s,e,t){const n={...xt,...t};if(s===void 0)throw new TypeError("[maz-ui](FilterNumber) The `number` attribute is required.");if(e===void 0)throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute is required.");if(typeof e!="string")throw new TypeError("[maz-ui](FilterNumber) The `locale` attribute must be a string.");try{return new Intl.NumberFormat(e,n).format(Number(s))}catch(i){throw new Error(`[maz-ui](FilterNumber) ${i}`)}}const Ot={capitalize:Ve,currency:qe,date:Ue,number:We},Mt={install(s){s.provide("filters",Ot)}};function je({timeout:s=1e3,callback:e,remainingTimeUpdate:t=200,callbackOffsetTime:n=0}){const i=o.ref(s),r=o.ref(s);let a;function u(g){typeof g=="number"&&(r.value=g),typeof g=="number"&&(i.value=g),d()}function d(){a||(a=setInterval(()=>{r.value-=t,r.value<=0&&(y(),setTimeout(()=>e==null?void 0:e(),n))},t))}function f(){a&&(clearInterval(a),a=void 0)}function E(){!a&&r.value>0&&d()}function y(){setTimeout(()=>r.value=i.value,n*2),f()}return{remainingTime:r,start:u,pause:f,resume:E,stop:y}}const Ht={class:"m-toast__message-wrapper"},Pt={class:"m-toast__message"},Dt={class:"maz-flex maz-items-center maz-gap-2"},$t={key:0},Nt={key:4,class:"progress-bar maz-absolute maz-inset-x-0 maz-bottom-0 maz-h-1"},_t=o.defineComponent({__name:"MazToast",props:{message:{default:void 0},position:{default:"bottom-right"},maxToasts:{type:[Number,Boolean],default:!1},timeout:{type:[Number,Boolean],default:1e4},queue:{type:Boolean},noPauseOnHover:{type:Boolean},type:{default:"info"},link:{default:void 0},action:{default:void 0},persistent:{type:Boolean},icon:{type:Boolean,default:!0}},emits:["close","click","open"],setup(s,{expose:e,emit:t}){const n=s,i=t,r=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./MazBtn-BKk3IsoH.cjs"))),a=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./x-mark-BETcRuRC.cjs"))),u=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./arrow-top-right-on-square-Kw3b5yYN.cjs"))),d=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-triangle-BhBdL4E2.cjs"))),f=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./exclamation-circle-Cw7wlH9H.cjs"))),E=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./information-circle-i_xlqw0y.cjs"))),y=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./check-circle-Bm2TJi5n.cjs"))),g=o.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./link-BbXTqAk3.cjs"))),z=o.ref(),W=o.computed(()=>{if(n.icon)switch(n.type){case"danger":return d;case"info":return E;case"success":return y;case"warning":return f;default:return}}),x=o.computed(()=>n.position.includes("top")?"top":"bottom"),C=o.computed(()=>n.position.includes("left")?"left":n.position.includes("right")?"right":"center"),j=o.computed(()=>C.value!=="center"?C.value==="right"?"m-slide-right":"m-slide-left":x.value==="top"?"m-slide-top":"m-slide-bottom"),L=o.ref(!1),$=o.ref(!1),N=o.ref(),S=`m-toast-container --${x.value} --${C.value}`,A=`.${S.replaceAll(" ",".")}`,O=je({callback:H,timeout:typeof n.timeout=="number"?n.timeout:0,callbackOffsetTime:200});function se(){const m=document.querySelector(A);if(!m&&!m){const v=document.body,c=document.createElement("div");c.className=S,v.append(c)}}function R(){const m=document.querySelector(A);return!n.queue&&n.maxToasts===!1?!1:typeof n.maxToasts=="number"&&m?n.maxToasts<=m.childElementCount:m&&m.childElementCount>0}function Y(){if(R()){N.value=setTimeout(Y,250);return}const m=document.querySelector(A);z.value&&m&&m.prepend(z.value),$.value=!0,typeof n.timeout=="number"&&n.timeout>0&&O.start()}const K=o.ref("100%");function _(){switch(n.type){case"danger":return"maz-bg-danger-700";case"info":return"maz-bg-info-700";case"success":return"maz-bg-success-700";case"warning":return"maz-bg-warning-700";default:return"maz-bg-secondary"}}o.watch(O.remainingTime,m=>{if(typeof n.timeout=="number"){const v=100*m/n.timeout;K.value=`${v}%`}});function M(m){i("click",m),n.persistent||H()}async function ne(m,v){var c;L.value=!0,await m(),L.value=!1,(c=n.action)!=null&&c.closeToast&&M(v)}function B(m){n.noPauseOnHover||(m?O.pause():O.resume())}function X(){stop(),N.value&&clearTimeout(N.value)}function H(){X(),$.value=!1}e({closeToast:H});function P(){i("open")}function oe(){var v;i("close"),(v=z.value)==null||v.remove();const m=document.querySelector(A);m&&!(m!=null&&m.hasChildNodes())&&m.remove()}return o.onMounted(()=>{se(),Y()}),(m,v)=>(o.openBlock(),o.createBlock(o.Transition,{name:j.value,onAfterLeave:oe,onAfterEnter:P,persisted:""},{default:o.withCtx(()=>[o.withDirectives(o.createElementVNode("button",{ref_key:"Toaster",ref:z,class:o.normalizeClass(["m-toast",[`--${m.type}`,`--${x.value}`,`--${C.value}`,{"maz-pb-1":typeof m.timeout=="number"&&m.timeout>0,"--persistent":m.persistent}]]),role:"alert",onMouseover:v[2]||(v[2]=c=>B(!0)),onMouseleave:v[3]||(v[3]=c=>B(!1)),onClick:v[4]||(v[4]=o.withModifiers(c=>{var h;return m.link&&!((h=m.link)!=null&&h.closeToast)?void 0:M(c)},["stop"]))},[W.value?(o.openBlock(),o.createBlock(o.resolveDynamicComponent(W.value),{key:0,class:"maz-text-2xl"})):o.createCommentVNode("v-if",!0),o.createElementVNode("div",Ht,[o.createElementVNode("p",Pt,o.toDisplayString(m.message),1)]),m.action?(o.openBlock(),o.createBlock(o.unref(r),{key:1,"data-test":"action-btn",color:m.type,pastel:"",loading:L.value,size:"sm",onClick:v[0]||(v[0]=o.withModifiers(c=>m.action?ne(m.action.func,c):void 0,["stop"]))},{default:o.withCtx(()=>[o.createTextVNode(o.toDisplayString(m.action.text),1)]),_:1},8,["color","loading"])):o.createCommentVNode("v-if",!0),m.link?(o.openBlock(),o.createBlock(o.unref(r),{key:2,"data-test":"link-btn",color:m.type,pastel:"",size:"xs",href:m.link.href,target:m.link.target??"_self"},{default:o.withCtx(()=>{var c;return[o.createElementVNode("div",Dt,[m.link.text?(o.openBlock(),o.createElementBlock("span",$t,o.toDisplayString(m.link.text),1)):o.createCommentVNode("v-if",!0),((c=m.link)==null?void 0:c.target)==="_blank"?(o.openBlock(),o.createBlock(o.unref(u),{key:1,class:"maz-text-xl"})):(o.openBlock(),o.createBlock(o.unref(g),{key:2,class:"maz-text-xl"}))])]}),_:1},8,["color","href","target"])):o.createCommentVNode("v-if",!0),m.persistent?o.createCommentVNode("v-if",!0):(o.openBlock(),o.createElementBlock("button",{key:3,class:"--close",onClick:v[1]||(v[1]=o.withModifiers(c=>M(c),["stop"]))},[o.createVNode(o.unref(a),{class:"--icon maz-text-xl"})])),typeof m.timeout=="number"&&m.timeout>0?(o.openBlock(),o.createElementBlock("div",Nt,[o.createElementVNode("div",{style:o.normalizeStyle({width:K.value}),class:o.normalizeClass(["maz-h-full !maz-transition-all !maz-duration-200 !maz-ease-linear",_()])},null,6)])):o.createCommentVNode("v-if",!0)],34),[[o.vShow,$.value]])]),_:1},8,["name"]))}}),Bt=fe(_t,[["__scopeId","data-v-cdb80f1f"]]),Ft={position:"bottom-right",timeout:1e4,persistent:!1,icon:!0};class Re{constructor(e,t){this.app=e,this.globalOptions=t}show(e,t){const n={...Ft,...this.globalOptions,...t,message:e},{destroy:i,vNode:r}=he(Bt,{props:n,app:this.app});return{destroy:i,close:()=>{var a,u;return(u=(a=r.component)==null?void 0:a.exposed)==null?void 0:u.closeToast()}}}getLocalOptions(e,t){return{type:e,...t}}message(e,t){return this.show(e,this.getLocalOptions("theme",t))}success(e,t){return this.show(e,this.getLocalOptions("success",t))}error(e,t){return this.show(e,this.getLocalOptions("danger",t))}info(e,t){return this.show(e,this.getLocalOptions("info",t))}warning(e,t){return this.show(e,this.getLocalOptions("warning",t))}}function Vt(s,e){return new Re(s,e)}const qt={install(s,e){s.provide("toast",Vt(s,e))}},D="";function Ut(s){return s.filter((e,t,n)=>t===n.indexOf(e))}function Wt(s){return(e=D)=>typeof e=="function"?s.findIndex((...t)=>e(...t))>-1:s.includes(e)}const jt=s=>s.length>0;function Rt(s){return(e=D)=>Ut([...s,e])}function Yt(s){return(e=D)=>s.filter(t=>t!==e)}class Ye{constructor(){l(this,"_loaders",o.ref([]))}get loaders(){return o.computed(()=>this._loaders.value)}stop(e=D){this._loaders.value=Yt(this._loaders.value)(e)}start(e=D){return this._loaders.value=Rt(this._loaders.value)(e),()=>this.stop(e)}get anyLoading(){return o.computed(()=>jt(this._loaders.value))}isLoading(e=D){return o.computed(()=>Wt(this._loaders.value)(e)).value}}const Ke=new Ye,Kt={install:s=>{s.provide("wait",Ke)}},ae={delay:100,observer:{root:void 0,rootMargin:"0px",threshold:.2},animation:{once:!0,duration:300,delay:0}};class Xe{constructor(e){l(this,"options");this.options={delay:(e==null?void 0:e.delay)??ae.delay,observer:{...ae.observer,...e==null?void 0:e.observer},animation:{...ae.animation,...e==null?void 0:e.animation}}}handleIntersect(e,t){for(const n of e){const r=n.target.getAttribute("data-maz-aos-children")==="true",a=n.target.getAttribute("data-maz-aos")?[n.target]:[];if(r){const u=[...document.querySelectorAll("[data-maz-aos-anchor]")].map(d=>d.getAttribute("data-maz-aos-anchor")===`#${n.target.id}`?d:void 0);for(const d of u)d&&a.push(d)}for(const u of a){const d=u.getAttribute("data-maz-aos-once"),f=typeof d=="string"?d==="true":this.options.animation.once;if(typeof this.options.observer.threshold=="number"&&n.intersectionRatio>this.options.observer.threshold){const E=u.getAttribute("data-maz-aos-duration"),y=u.getAttribute("data-maz-aos-delay");if(E||(u.style.transitionDuration=`${this.options.animation.duration}ms`,setTimeout(()=>{u.style.transitionDuration="0"},1e3)),y||(u.style.transitionDelay=`${this.options.animation.delay}ms`,setTimeout(()=>{u.style.transitionDelay="0"},1e3)),u.classList.add("maz-aos-animate"),f){const g=u.getAttribute("data-maz-aos-anchor");if(g){const z=document.querySelector(g);z&&t.unobserve(z)}t.unobserve(u)}}else u.classList.remove("maz-aos-animate")}}}async handleObserver(){await ze(this.options.delay);const e=new IntersectionObserver(this.handleIntersect.bind(this),{...this.options.observer});for(const t of document.querySelectorAll("[data-maz-aos]")){const n=t.getAttribute("data-maz-aos-anchor");if(n){const i=document.querySelector(n);i?(i.setAttribute("data-maz-aos-children","true"),e.observe(i)):console.warn(`[maz-ui](aos) no element found with selector "${n}"`)}else e.observe(t)}}runAnimations(){if(w())return this.handleObserver();console.warn("[MazAos](runAnimations) should be executed on client side")}}let F;const Xt={install:(s,e)=>{F=new Xe(e),s.provide("aos",F),w()&&(e!=null&&e.router?e.router.afterEach(async()=>{F.runAnimations()}):F.runAnimations())}};function Zt(){return F}const Qt={darkClass:"dark",lightClass:"light",storageThemeKey:"theme",storageThemeValueDark:"dark",storageThemeValueLight:"light",storageThemeValueSystem:"system",watchChanges:!0},V=o.ref("system"),k=o.ref("system");function ye(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function q({darkClass:s,lightClass:e,storageThemeKey:t,storageThemeValueDark:n,setLocalStorageValue:i=!0,setSelectedTheme:r=!0}){w()&&(document.documentElement.classList.remove(e),document.documentElement.classList.add(s),V.value=n,r&&(k.value=n),i&&(localStorage[t]=n))}function U({darkClass:s,lightClass:e,storageThemeKey:t,storageThemeValueLight:n,setLocalStorageValue:i=!0,setSelectedTheme:r=!0}){w()&&(document.documentElement.classList.remove(s),document.documentElement.classList.add(e),V.value=n,r&&(k.value=n),i&&(localStorage[t]=n))}function Ze({setLocalStorageValue:s=!0,...e}){if(w())return document.documentElement.classList.remove(e.darkClass),document.documentElement.classList.remove(e.lightClass),V.value=e.storageThemeValueSystem,k.value=e.storageThemeValueSystem,s&&(localStorage[e.storageThemeKey]=e.storageThemeValueSystem),de(e)}function Qe(s){if(!s.defaultTheme)return console.error("[maz-ui](useThemeHandler) No default theme set");if(!["light","dark"].includes(s.defaultTheme))return console.error('[maz-ui](useThemeHandler) Default theme must be "light" or "dark"');switch(s.defaultTheme){case"dark":return q({...s,setLocalStorageValue:!1,setSelectedTheme:!0});case"light":return U({...s,setLocalStorageValue:!1,setSelectedTheme:!0})}}function de(s){return w()?!localStorage[s.storageThemeKey]&&s.defaultTheme?Qe(s):localStorage[s.storageThemeKey]===s.storageThemeValueDark||!localStorage[s.storageThemeKey]&&ye()||localStorage[s.storageThemeKey]===s.storageThemeValueSystem&&ye()?q({...s,setLocalStorageValue:!1,setSelectedTheme:!1}):U({...s,setLocalStorageValue:!1,setSelectedTheme:!1}):void 0}function le({theme:s,...e}){return s==="system"?Ze(e):s==="dark"?q(e):U(e)}function Gt(s){return V.value===s.storageThemeValueDark?U(s):q(s)}function Jt(s){const e={...Qt,...s};function t(){de(e)}return o.onMounted(()=>{localStorage[e.storageThemeKey]&&(k.value=localStorage[e.storageThemeKey]),e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t)}),o.onBeforeUnmount(()=>{e.watchChanges&&window.matchMedia("(prefers-color-scheme: dark)").removeEventListener("change",t)}),o.watch(k,n=>{switch(localStorage[e.storageThemeKey]=n,n){case e.storageThemeValueDark:{q(e);break}case e.storageThemeValueLight:{U(e);break}case e.storageThemeValueSystem:{Ze(e);break}}}),{autoSetTheme:()=>de(e),toggleTheme:()=>Gt(e),setSystemTheme:()=>le({...e,theme:"system"}),setDarkTheme:()=>le({...e,theme:"dark"}),setLightTheme:()=>le({...e,theme:"light"}),setDefaultTheme:()=>Qe(e),hasDarkTheme:o.computed(()=>k.value===e.storageThemeValueDark),hasLightTheme:o.computed(()=>k.value===e.storageThemeValueLight),hasSystemTheme:o.computed(()=>k.value===e.storageThemeValueSystem),theme:V,selectedTheme:k}}function es({componentName:s,providedId:e}){const t=o.getCurrentInstance();return o.computed(()=>e??`${s}-${t==null?void 0:t.uid}`)}function ts(){return te("aos")}function ss(){return te("wait")}function ns(){return te("toast")}function os({callback:s,options:e}){return new we(s,e)}function is({callback:s,options:e}){return new Ee(s,e)}function rs(s){const e={};for(const[t,n]of Object.entries(s))e[t]=Number.parseInt(n,10);return e}function Ge(s={}){const{internalWindow:e=w()?window:void 0,initialWidth:t=Number.POSITIVE_INFINITY,initialHeight:n=Number.POSITIVE_INFINITY,includeScrollbar:i=!0}=s,r=o.ref(t),a=o.ref(n);function u(){e&&(i?(r.value=e.innerWidth,a.value=e.innerHeight):(r.value=e.document.documentElement.clientWidth,a.value=e.document.documentElement.clientHeight))}return u(),o.onMounted(()=>{e&&window.addEventListener("resize",u,{passive:!0})}),o.onUnmounted(()=>{e&&window.removeEventListener("resize",u)}),{width:r,height:a}}function as({initialWidth:s=0,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:i,breakpoints:r,mediumBreakPoint:a="md",largeBreakPoint:u="lg"}){const{width:d}=Ge({initialWidth:s,initialHeight:e,includeScrollbar:t,internalWindow:n,listenOrientation:i}),f=rs(r),E=o.computed(()=>d.value>=f[u]),y=o.computed(()=>d.value>=f[a]&&d.value<f[u]),g=o.computed(()=>d.value>=0&&d.value<f[a]);return{width:d,numericBreakpoints:f,isSmallScreen:g,isLargeScreen:E,isMediumScreen:y,breakpoints:r}}function ls(s){const e=o.ref(),t=o.ref(),n=o.ref(),i=o.ref(),r=o.ref(),a=o.ref(),u=new Te({...s,element:s.element,onValuesChanged(d){e.value=d.xDiff,t.value=d.yDiff,n.value=d.xStart,i.value=d.xEnd,r.value=d.yStart,a.value=d.yEnd}});return{xDiff:e,yDiff:t,xStart:n,xEnd:i,yStart:r,yEnd:a,start:u.start,stop:u.stop}}function Je(s){const e=s.join(", ").match(/\b\w+\b/g);return e?e.length:0}function cs(s,e=150){const t=Je([s]);return Math.ceil(t/e)}function us(s){const e=o.computed(()=>{var a;return typeof s.velocity=="number"?s.velocity:((a=s.velocity)==null?void 0:a.value)??150}),t=o.computed(()=>{var a;return typeof s.contentSelector=="string"?s.contentSelector:(a=s.contentSelector)==null?void 0:a.value}),n=o.computed(()=>{var a,u,d;if(typeof((a=s.contentRef)==null?void 0:a.value)=="object")return(u=s.contentRef.value)==null?void 0:u.textContent;if(t.value&&typeof document<"u"){const f=document.querySelector(t.value);if(f)return f.textContent}return typeof s.content=="string"?s.content:(d=s.content)==null?void 0:d.value}),i=o.computed(()=>cs(n.value,e.value)),r=o.computed(()=>Je([n.value]));return{content:n,wordCount:r,velocity:e,duration:i}}function ms(s,e){const t=s.length,n=e.length,i=[];for(let r=0;r<=t;r++)i[r]=[r];for(let r=0;r<=n;r++)i[0][r]=r;for(let r=1;r<=t;r++)for(let a=1;a<=n;a++){const u=s[r-1]===e[a-1]?0:1;i[r][a]=Math.min(i[r-1][a]+1,i[r][a-1]+1,i[r-1][a-1]+u)}return i[t][n]}function et(s,e){const t=ms(s,e),n=Math.max(s.length,e.length);return 1-t/n}function ds(s,e,t=.75){return et(s,e)>=t}function hs(s,e,t=.75){const n=o.computed(()=>ce(typeof s=="string"?s:s.value)),i=o.computed(()=>ce(typeof e=="string"?e:e.value)),r=o.computed(()=>typeof t=="number"?t:t.value),a=o.computed(()=>et(n.value,i.value));return{isMatching:o.computed(()=>ds(n.value,i.value,r.value)),score:a}}exports.AosHandler=Xe;exports.IdleTimeout=we;exports.ScriptLoader=rt;exports.Swipe=Te;exports.ToasterHandler=Re;exports.UserVisibility=Ee;exports.WaitHandler=Ye;exports._export_sfc=fe;exports.capitalize=Ve;exports.countryCodeToUnicodeFlag=at;exports.currency=qe;exports.date=Ue;exports.debounce=it;exports.directive=Ce;exports.directive$1=gt;exports.directive$2=Be;exports.directive$3=Oe;exports.directive$4=ht;exports.getInstance=Zt;exports.injectStrict=te;exports.installFilters=Mt;exports.installToaster=qt;exports.instance=Ke;exports.isClient=w;exports.mount=he;exports.normalizeString=ce;exports.number=We;exports.plugin=It;exports.plugin$1=Se;exports.plugin$2=_e;exports.plugin$3=$e;exports.plugin$4=Fe;exports.plugin$5=Me;exports.plugin$6=Pe;exports.plugin$7=Kt;exports.plugin$8=Xt;exports.sleep=ze;exports.throttle=lt;exports.truthyFilter=be;exports.useAos=ts;exports.useBreakpoints=as;exports.useIdleTimeout=os;exports.useInstanceUniqId=es;exports.useReadingTime=us;exports.useStringMatching=hs;exports.useSwipe=ls;exports.useThemeHandler=Jt;exports.useTimer=je;exports.useToast=ns;exports.useUserVisibility=is;exports.useWait=ss;exports.useWindowSize=Ge;exports.vZoomImg=De;
|