BossBey File Manager
PHP:
8.2.30
OS:
Linux
User:
imagivibe
Root
/
home
/
imagivibe
/
www
/
app.imagivibe.com
/
public
/
build
/
assets
📤 Upload
📝 New File
📁 New Folder
Close
Editing: app-Bep2fVH4.js
import{e as N,L as Sv}from"./livewire.esm-C819BCfU.js";import{f as Av,m as Cv}from"./fetch-Bv7pIKk9.js";import{c as Ev}from"./clipboard-CBCTDmBy.js";import{R as hu,f as xv}from"./lib.modern-DHFPEOLP.js";const Tv="modulepreload",Iv=function(s){return"/build/"+s},jl={},tu=function(r,n,o){let l=Promise.resolve();if(n&&n.length>0){let d=function(v){return Promise.all(v.map(A=>Promise.resolve(A).then(S=>({status:"fulfilled",value:S}),S=>({status:"rejected",reason:S}))))};document.getElementsByTagName("link");const g=document.querySelector("meta[property=csp-nonce]"),y=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));l=d(n.map(v=>{if(v=Iv(v),v in jl)return;jl[v]=!0;const A=v.endsWith(".css"),S=A?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${v}"]${S}`))return;const M=document.createElement("link");if(M.rel=A?"stylesheet":Tv,A||(M.as="script"),M.crossOrigin="",M.href=v,y&&M.setAttribute("nonce",y),document.head.appendChild(M),A)return new Promise((R,O)=>{M.addEventListener("load",R),M.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${v}`)))})}))}function c(d){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=d,window.dispatchEvent(g),!g.defaultPrevented)throw d}return l.then(d=>{for(const g of d||[])g.status==="rejected"&&c(g.reason);return r().catch(c)})};typeof window.pusherConfig<"u"?tu(async()=>{const{default:s}=await import("./echo-DL0QqwGZ.js");return{default:s}},[]).then(({default:s})=>{tu(async()=>{const{default:r}=await import("./pusher-B7WI7KhQ.js").then(n=>n.p);return{default:r}},[]).then(({default:r})=>{window.Pusher=r;let n=window.pusherConfig;window.Echo=new s({broadcaster:"pusher",key:n.key,cluster:n.cluster,wsHost:n.wsHost??`ws-${n.cluster}.pusher.com`,wsPort:n.port??80,wssPort:n.port??443,forceTLS:(n.scheme??"https")==="https",enabledTransports:["ws","wss"]})}).catch(r=>console.log("Failed to load Pusher:",r))}).catch(s=>console.log("Failed to load Echo:",s)):console.log("window.pusherConfig is not defined.");function eu(s,r){var n=Object.keys(s);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);r&&(o=o.filter(function(l){return Object.getOwnPropertyDescriptor(s,l).enumerable})),n.push.apply(n,o)}return n}function Me(s){for(var r=1;r<arguments.length;r++){var n=arguments[r]!=null?arguments[r]:{};r%2?eu(Object(n),!0).forEach(function(o){Mv(s,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach(function(o){Object.defineProperty(s,o,Object.getOwnPropertyDescriptor(n,o))})}return s}function bi(s){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?bi=function(r){return typeof r}:bi=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},bi(s)}function Mv(s,r,n){return r in s?Object.defineProperty(s,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):s[r]=n,s}function ze(){return ze=Object.assign||function(s){for(var r=1;r<arguments.length;r++){var n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(s[o]=n[o])}return s},ze.apply(this,arguments)}function Pv(s,r){if(s==null)return{};var n={},o=Object.keys(s),l,c;for(c=0;c<o.length;c++)l=o[c],!(r.indexOf(l)>=0)&&(n[l]=s[l]);return n}function Rv(s,r){if(s==null)return{};var n=Pv(s,r),o,l;if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(s);for(l=0;l<c.length;l++)o=c[l],!(r.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(s,o)&&(n[o]=s[o])}return n}var Dv="1.15.2";function He(s){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(s)}var Ve=He(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),br=He(/Edge/i),nu=He(/firefox/i),gr=He(/safari/i)&&!He(/chrome/i)&&!He(/android/i),du=He(/iP(ad|od|hone)/i),pu=He(/chrome/i)&&He(/android/i),gu={capture:!1,passive:!1};function rt(s,r,n){s.addEventListener(r,n,!Ve&&gu)}function tt(s,r,n){s.removeEventListener(r,n,!Ve&&gu)}function Ei(s,r){if(r){if(r[0]===">"&&(r=r.substring(1)),s)try{if(s.matches)return s.matches(r);if(s.msMatchesSelector)return s.msMatchesSelector(r);if(s.webkitMatchesSelector)return s.webkitMatchesSelector(r)}catch{return!1}return!1}}function Lv(s){return s.host&&s!==document&&s.host.nodeType?s.host:s.parentNode}function Ce(s,r,n,o){if(s){n=n||document;do{if(r!=null&&(r[0]===">"?s.parentNode===n&&Ei(s,r):Ei(s,r))||o&&s===n)return s;if(s===n)break}while(s=Lv(s))}return null}var ru=/\s+/g;function ne(s,r,n){if(s&&r)if(s.classList)s.classList[n?"add":"remove"](r);else{var o=(" "+s.className+" ").replace(ru," ").replace(" "+r+" "," ");s.className=(o+(n?" "+r:"")).replace(ru," ")}}function U(s,r,n){var o=s&&s.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(s,""):s.currentStyle&&(n=s.currentStyle),r===void 0?n:n[r];!(r in o)&&r.indexOf("webkit")===-1&&(r="-webkit-"+r),o[r]=n+(typeof n=="string"?"":"px")}}function Wn(s,r){var n="";if(typeof s=="string")n=s;else do{var o=U(s,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!r&&(s=s.parentNode));var l=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return l&&new l(n)}function mu(s,r,n){if(s){var o=s.getElementsByTagName(r),l=0,c=o.length;if(n)for(;l<c;l++)n(o[l],l);return o}return[]}function Ie(){var s=document.scrollingElement;return s||document.documentElement}function St(s,r,n,o,l){if(!(!s.getBoundingClientRect&&s!==window)){var c,d,g,y,v,A,S;if(s!==window&&s.parentNode&&s!==Ie()?(c=s.getBoundingClientRect(),d=c.top,g=c.left,y=c.bottom,v=c.right,A=c.height,S=c.width):(d=0,g=0,y=window.innerHeight,v=window.innerWidth,A=window.innerHeight,S=window.innerWidth),(r||n)&&s!==window&&(l=l||s.parentNode,!Ve))do if(l&&l.getBoundingClientRect&&(U(l,"transform")!=="none"||n&&U(l,"position")!=="static")){var M=l.getBoundingClientRect();d-=M.top+parseInt(U(l,"border-top-width")),g-=M.left+parseInt(U(l,"border-left-width")),y=d+c.height,v=g+c.width;break}while(l=l.parentNode);if(o&&s!==window){var R=Wn(l||s),O=R&&R.a,B=R&&R.d;R&&(d/=B,g/=O,S/=O,A/=B,y=d+A,v=g+S)}return{top:d,left:g,bottom:y,right:v,width:S,height:A}}}function iu(s,r,n){for(var o=rn(s,!0),l=St(s)[r];o;){var c=St(o)[n],d=void 0;if(d=l>=c,!d)return o;if(o===Ie())break;o=rn(o,!1)}return!1}function $n(s,r,n,o){for(var l=0,c=0,d=s.children;c<d.length;){if(d[c].style.display!=="none"&&d[c]!==H.ghost&&(o||d[c]!==H.dragged)&&Ce(d[c],n.draggable,s,!1)){if(l===r)return d[c];l++}c++}return null}function _s(s,r){for(var n=s.lastElementChild;n&&(n===H.ghost||U(n,"display")==="none"||r&&!Ei(n,r));)n=n.previousElementSibling;return n||null}function me(s,r){var n=0;if(!s||!s.parentNode)return-1;for(;s=s.previousElementSibling;)s.nodeName.toUpperCase()!=="TEMPLATE"&&s!==H.clone&&(!r||Ei(s,r))&&n++;return n}function ou(s){var r=0,n=0,o=Ie();if(s)do{var l=Wn(s),c=l.a,d=l.d;r+=s.scrollLeft*c,n+=s.scrollTop*d}while(s!==o&&(s=s.parentNode));return[r,n]}function Ov(s,r){for(var n in s)if(s.hasOwnProperty(n)){for(var o in r)if(r.hasOwnProperty(o)&&r[o]===s[n][o])return Number(n)}return-1}function rn(s,r){if(!s||!s.getBoundingClientRect)return Ie();var n=s,o=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var l=U(n);if(n.clientWidth<n.scrollWidth&&(l.overflowX=="auto"||l.overflowX=="scroll")||n.clientHeight<n.scrollHeight&&(l.overflowY=="auto"||l.overflowY=="scroll")){if(!n.getBoundingClientRect||n===document.body)return Ie();if(o||r)return n;o=!0}}while(n=n.parentNode);return Ie()}function Fv(s,r){if(s&&r)for(var n in r)r.hasOwnProperty(n)&&(s[n]=r[n]);return s}function es(s,r){return Math.round(s.top)===Math.round(r.top)&&Math.round(s.left)===Math.round(r.left)&&Math.round(s.height)===Math.round(r.height)&&Math.round(s.width)===Math.round(r.width)}var mr;function vu(s,r){return function(){if(!mr){var n=arguments,o=this;n.length===1?s.call(o,n[0]):s.apply(o,n),mr=setTimeout(function(){mr=void 0},r)}}}function Bv(){clearTimeout(mr),mr=void 0}function yu(s,r,n){s.scrollLeft+=r,s.scrollTop+=n}function _u(s){var r=window.Polymer,n=window.jQuery||window.Zepto;return r&&r.dom?r.dom(s).cloneNode(!0):n?n(s).clone(!0)[0]:s.cloneNode(!0)}function bu(s,r,n){var o={};return Array.from(s.children).forEach(function(l){var c,d,g,y;if(!(!Ce(l,r.draggable,s,!1)||l.animated||l===n)){var v=St(l);o.left=Math.min((c=o.left)!==null&&c!==void 0?c:1/0,v.left),o.top=Math.min((d=o.top)!==null&&d!==void 0?d:1/0,v.top),o.right=Math.max((g=o.right)!==null&&g!==void 0?g:-1/0,v.right),o.bottom=Math.max((y=o.bottom)!==null&&y!==void 0?y:-1/0,v.bottom)}}),o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}var ie="Sortable"+new Date().getTime();function kv(){var s=[],r;return{captureAnimationState:function(){if(s=[],!!this.options.animation){var o=[].slice.call(this.el.children);o.forEach(function(l){if(!(U(l,"display")==="none"||l===H.ghost)){s.push({target:l,rect:St(l)});var c=Me({},s[s.length-1].rect);if(l.thisAnimationDuration){var d=Wn(l,!0);d&&(c.top-=d.f,c.left-=d.e)}l.fromRect=c}})}},addAnimationState:function(o){s.push(o)},removeAnimationState:function(o){s.splice(Ov(s,{target:o}),1)},animateAll:function(o){var l=this;if(!this.options.animation){clearTimeout(r),typeof o=="function"&&o();return}var c=!1,d=0;s.forEach(function(g){var y=0,v=g.target,A=v.fromRect,S=St(v),M=v.prevFromRect,R=v.prevToRect,O=g.rect,B=Wn(v,!0);B&&(S.top-=B.f,S.left-=B.e),v.toRect=S,v.thisAnimationDuration&&es(M,S)&&!es(A,S)&&(O.top-S.top)/(O.left-S.left)===(A.top-S.top)/(A.left-S.left)&&(y=qv(O,M,R,l.options)),es(S,A)||(v.prevFromRect=A,v.prevToRect=S,y||(y=l.options.animation),l.animate(v,O,S,y)),y&&(c=!0,d=Math.max(d,y),clearTimeout(v.animationResetTimer),v.animationResetTimer=setTimeout(function(){v.animationTime=0,v.prevFromRect=null,v.fromRect=null,v.prevToRect=null,v.thisAnimationDuration=null},y),v.thisAnimationDuration=y)}),clearTimeout(r),c?r=setTimeout(function(){typeof o=="function"&&o()},d):typeof o=="function"&&o(),s=[]},animate:function(o,l,c,d){if(d){U(o,"transition",""),U(o,"transform","");var g=Wn(this.el),y=g&&g.a,v=g&&g.d,A=(l.left-c.left)/(y||1),S=(l.top-c.top)/(v||1);o.animatingX=!!A,o.animatingY=!!S,U(o,"transform","translate3d("+A+"px,"+S+"px,0)"),this.forRepaintDummy=Wv(o),U(o,"transition","transform "+d+"ms"+(this.options.easing?" "+this.options.easing:"")),U(o,"transform","translate3d(0,0,0)"),typeof o.animated=="number"&&clearTimeout(o.animated),o.animated=setTimeout(function(){U(o,"transition",""),U(o,"transform",""),o.animated=!1,o.animatingX=!1,o.animatingY=!1},d)}}}}function Wv(s){return s.offsetWidth}function qv(s,r,n,o){return Math.sqrt(Math.pow(r.top-s.top,2)+Math.pow(r.left-s.left,2))/Math.sqrt(Math.pow(r.top-n.top,2)+Math.pow(r.left-n.left,2))*o.animation}var On=[],ns={initializeByDefault:!0},wr={mount:function(r){for(var n in ns)ns.hasOwnProperty(n)&&!(n in r)&&(r[n]=ns[n]);On.forEach(function(o){if(o.pluginName===r.pluginName)throw"Sortable: Cannot mount plugin ".concat(r.pluginName," more than once")}),On.push(r)},pluginEvent:function(r,n,o){var l=this;this.eventCanceled=!1,o.cancel=function(){l.eventCanceled=!0};var c=r+"Global";On.forEach(function(d){n[d.pluginName]&&(n[d.pluginName][c]&&n[d.pluginName][c](Me({sortable:n},o)),n.options[d.pluginName]&&n[d.pluginName][r]&&n[d.pluginName][r](Me({sortable:n},o)))})},initializePlugins:function(r,n,o,l){On.forEach(function(g){var y=g.pluginName;if(!(!r.options[y]&&!g.initializeByDefault)){var v=new g(r,n,r.options);v.sortable=r,v.options=r.options,r[y]=v,ze(o,v.defaults)}});for(var c in r.options)if(r.options.hasOwnProperty(c)){var d=this.modifyOption(r,c,r.options[c]);typeof d<"u"&&(r.options[c]=d)}},getEventProperties:function(r,n){var o={};return On.forEach(function(l){typeof l.eventProperties=="function"&&ze(o,l.eventProperties.call(n[l.pluginName],r))}),o},modifyOption:function(r,n,o){var l;return On.forEach(function(c){r[c.pluginName]&&c.optionListeners&&typeof c.optionListeners[n]=="function"&&(l=c.optionListeners[n].call(r[c.pluginName],o))}),l}};function Nv(s){var r=s.sortable,n=s.rootEl,o=s.name,l=s.targetEl,c=s.cloneEl,d=s.toEl,g=s.fromEl,y=s.oldIndex,v=s.newIndex,A=s.oldDraggableIndex,S=s.newDraggableIndex,M=s.originalEvent,R=s.putSortable,O=s.extraEventProperties;if(r=r||n&&n[ie],!!r){var B,G=r.options,at="on"+o.charAt(0).toUpperCase()+o.substr(1);window.CustomEvent&&!Ve&&!br?B=new CustomEvent(o,{bubbles:!0,cancelable:!0}):(B=document.createEvent("Event"),B.initEvent(o,!0,!0)),B.to=d||n,B.from=g||n,B.item=l||n,B.clone=c,B.oldIndex=y,B.newIndex=v,B.oldDraggableIndex=A,B.newDraggableIndex=S,B.originalEvent=M,B.pullMode=R?R.lastPutMode:void 0;var it=Me(Me({},O),wr.getEventProperties(o,r));for(var lt in it)B[lt]=it[lt];n&&n.dispatchEvent(B),G[at]&&G[at].call(r,B)}}var $v=["evt"],Gt=function(r,n){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=o.evt,c=Rv(o,$v);wr.pluginEvent.bind(H)(r,n,Me({dragEl:P,parentEl:yt,ghostEl:V,rootEl:dt,nextEl:mn,lastDownEl:wi,cloneEl:mt,cloneHidden:nn,dragStarted:fr,putSortable:Lt,activeSortable:H.active,originalEvent:l,oldIndex:kn,oldDraggableIndex:vr,newIndex:re,newDraggableIndex:en,hideGhostForTarget:Cu,unhideGhostForTarget:Eu,cloneNowHidden:function(){nn=!0},cloneNowShown:function(){nn=!1},dispatchSortableEvent:function(g){$t({sortable:n,name:g,originalEvent:l})}},c))};function $t(s){Nv(Me({putSortable:Lt,cloneEl:mt,targetEl:P,rootEl:dt,oldIndex:kn,oldDraggableIndex:vr,newIndex:re,newDraggableIndex:en},s))}var P,yt,V,dt,mn,wi,mt,nn,kn,re,vr,en,pi,Lt,Bn=!1,xi=!1,Ti=[],pn,Ae,rs,is,su,au,fr,Fn,yr,_r=!1,gi=!1,Si,kt,os=[],fs=!1,Ii=[],Pi=typeof document<"u",mi=du,lu=br||Ve?"cssFloat":"float",Uv=Pi&&!pu&&!du&&"draggable"in document.createElement("div"),wu=function(){if(Pi){if(Ve)return!1;var s=document.createElement("x");return s.style.cssText="pointer-events:auto",s.style.pointerEvents==="auto"}}(),Su=function(r,n){var o=U(r),l=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),c=$n(r,0,n),d=$n(r,1,n),g=c&&U(c),y=d&&U(d),v=g&&parseInt(g.marginLeft)+parseInt(g.marginRight)+St(c).width,A=y&&parseInt(y.marginLeft)+parseInt(y.marginRight)+St(d).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(c&&g.float&&g.float!=="none"){var S=g.float==="left"?"left":"right";return d&&(y.clear==="both"||y.clear===S)?"vertical":"horizontal"}return c&&(g.display==="block"||g.display==="flex"||g.display==="table"||g.display==="grid"||v>=l&&o[lu]==="none"||d&&o[lu]==="none"&&v+A>l)?"vertical":"horizontal"},Hv=function(r,n,o){var l=o?r.left:r.top,c=o?r.right:r.bottom,d=o?r.width:r.height,g=o?n.left:n.top,y=o?n.right:n.bottom,v=o?n.width:n.height;return l===g||c===y||l+d/2===g+v/2},zv=function(r,n){var o;return Ti.some(function(l){var c=l[ie].options.emptyInsertThreshold;if(!(!c||_s(l))){var d=St(l),g=r>=d.left-c&&r<=d.right+c,y=n>=d.top-c&&n<=d.bottom+c;if(g&&y)return o=l}}),o},Au=function(r){function n(c,d){return function(g,y,v,A){var S=g.options.group.name&&y.options.group.name&&g.options.group.name===y.options.group.name;if(c==null&&(d||S))return!0;if(c==null||c===!1)return!1;if(d&&c==="clone")return c;if(typeof c=="function")return n(c(g,y,v,A),d)(g,y,v,A);var M=(d?g:y).options.group.name;return c===!0||typeof c=="string"&&c===M||c.join&&c.indexOf(M)>-1}}var o={},l=r.group;(!l||bi(l)!="object")&&(l={name:l}),o.name=l.name,o.checkPull=n(l.pull,!0),o.checkPut=n(l.put),o.revertClone=l.revertClone,r.group=o},Cu=function(){!wu&&V&&U(V,"display","none")},Eu=function(){!wu&&V&&U(V,"display","")};Pi&&!pu&&document.addEventListener("click",function(s){if(xi)return s.preventDefault(),s.stopPropagation&&s.stopPropagation(),s.stopImmediatePropagation&&s.stopImmediatePropagation(),xi=!1,!1},!0);var gn=function(r){if(P){r=r.touches?r.touches[0]:r;var n=zv(r.clientX,r.clientY);if(n){var o={};for(var l in r)r.hasOwnProperty(l)&&(o[l]=r[l]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[ie]._onDragOver(o)}}},Vv=function(r){P&&P.parentNode[ie]._isOutsideThisEl(r.target)};function H(s,r){if(!(s&&s.nodeType&&s.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(s));this.el=s,this.options=r=ze({},r),s[ie]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(s.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Su(s,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(d,g){d.setData("Text",g.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:H.supportPointer!==!1&&"PointerEvent"in window&&!gr,emptyInsertThreshold:5};wr.initializePlugins(this,s,n);for(var o in n)!(o in r)&&(r[o]=n[o]);Au(r);for(var l in this)l.charAt(0)==="_"&&typeof this[l]=="function"&&(this[l]=this[l].bind(this));this.nativeDraggable=r.forceFallback?!1:Uv,this.nativeDraggable&&(this.options.touchStartThreshold=1),r.supportPointer?rt(s,"pointerdown",this._onTapStart):(rt(s,"mousedown",this._onTapStart),rt(s,"touchstart",this._onTapStart)),this.nativeDraggable&&(rt(s,"dragover",this),rt(s,"dragenter",this)),Ti.push(this.el),r.store&&r.store.get&&this.sort(r.store.get(this)||[]),ze(this,kv())}H.prototype={constructor:H,_isOutsideThisEl:function(r){!this.el.contains(r)&&r!==this.el&&(Fn=null)},_getDirection:function(r,n){return typeof this.options.direction=="function"?this.options.direction.call(this,r,n,P):this.options.direction},_onTapStart:function(r){if(r.cancelable){var n=this,o=this.el,l=this.options,c=l.preventOnFilter,d=r.type,g=r.touches&&r.touches[0]||r.pointerType&&r.pointerType==="touch"&&r,y=(g||r).target,v=r.target.shadowRoot&&(r.path&&r.path[0]||r.composedPath&&r.composedPath()[0])||y,A=l.filter;if(jv(o),!P&&!(/mousedown|pointerdown/.test(d)&&r.button!==0||l.disabled)&&!v.isContentEditable&&!(!this.nativeDraggable&&gr&&y&&y.tagName.toUpperCase()==="SELECT")&&(y=Ce(y,l.draggable,o,!1),!(y&&y.animated)&&wi!==y)){if(kn=me(y),vr=me(y,l.draggable),typeof A=="function"){if(A.call(this,r,y,this)){$t({sortable:n,rootEl:v,name:"filter",targetEl:y,toEl:o,fromEl:o}),Gt("filter",n,{evt:r}),c&&r.cancelable&&r.preventDefault();return}}else if(A&&(A=A.split(",").some(function(S){if(S=Ce(v,S.trim(),o,!1),S)return $t({sortable:n,rootEl:S,name:"filter",targetEl:y,fromEl:o,toEl:o}),Gt("filter",n,{evt:r}),!0}),A)){c&&r.cancelable&&r.preventDefault();return}l.handle&&!Ce(v,l.handle,o,!1)||this._prepareDragStart(r,g,y)}}},_prepareDragStart:function(r,n,o){var l=this,c=l.el,d=l.options,g=c.ownerDocument,y;if(o&&!P&&o.parentNode===c){var v=St(o);if(dt=c,P=o,yt=P.parentNode,mn=P.nextSibling,wi=o,pi=d.group,H.dragged=P,pn={target:P,clientX:(n||r).clientX,clientY:(n||r).clientY},su=pn.clientX-v.left,au=pn.clientY-v.top,this._lastX=(n||r).clientX,this._lastY=(n||r).clientY,P.style["will-change"]="all",y=function(){if(Gt("delayEnded",l,{evt:r}),H.eventCanceled){l._onDrop();return}l._disableDelayedDragEvents(),!nu&&l.nativeDraggable&&(P.draggable=!0),l._triggerDragStart(r,n),$t({sortable:l,name:"choose",originalEvent:r}),ne(P,d.chosenClass,!0)},d.ignore.split(",").forEach(function(A){mu(P,A.trim(),ss)}),rt(g,"dragover",gn),rt(g,"mousemove",gn),rt(g,"touchmove",gn),rt(g,"mouseup",l._onDrop),rt(g,"touchend",l._onDrop),rt(g,"touchcancel",l._onDrop),nu&&this.nativeDraggable&&(this.options.touchStartThreshold=4,P.draggable=!0),Gt("delayStart",this,{evt:r}),d.delay&&(!d.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(br||Ve))){if(H.eventCanceled){this._onDrop();return}rt(g,"mouseup",l._disableDelayedDrag),rt(g,"touchend",l._disableDelayedDrag),rt(g,"touchcancel",l._disableDelayedDrag),rt(g,"mousemove",l._delayedDragTouchMoveHandler),rt(g,"touchmove",l._delayedDragTouchMoveHandler),d.supportPointer&&rt(g,"pointermove",l._delayedDragTouchMoveHandler),l._dragStartTimer=setTimeout(y,d.delay)}else y()}},_delayedDragTouchMoveHandler:function(r){var n=r.touches?r.touches[0]:r;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){P&&ss(P),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var r=this.el.ownerDocument;tt(r,"mouseup",this._disableDelayedDrag),tt(r,"touchend",this._disableDelayedDrag),tt(r,"touchcancel",this._disableDelayedDrag),tt(r,"mousemove",this._delayedDragTouchMoveHandler),tt(r,"touchmove",this._delayedDragTouchMoveHandler),tt(r,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(r,n){n=n||r.pointerType=="touch"&&r,!this.nativeDraggable||n?this.options.supportPointer?rt(document,"pointermove",this._onTouchMove):n?rt(document,"touchmove",this._onTouchMove):rt(document,"mousemove",this._onTouchMove):(rt(P,"dragend",this),rt(dt,"dragstart",this._onDragStart));try{document.selection?Ai(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(r,n){if(Bn=!1,dt&&P){Gt("dragStarted",this,{evt:n}),this.nativeDraggable&&rt(document,"dragover",Vv);var o=this.options;!r&&ne(P,o.dragClass,!1),ne(P,o.ghostClass,!0),H.active=this,r&&this._appendGhost(),$t({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(Ae){this._lastX=Ae.clientX,this._lastY=Ae.clientY,Cu();for(var r=document.elementFromPoint(Ae.clientX,Ae.clientY),n=r;r&&r.shadowRoot&&(r=r.shadowRoot.elementFromPoint(Ae.clientX,Ae.clientY),r!==n);)n=r;if(P.parentNode[ie]._isOutsideThisEl(r),n)do{if(n[ie]){var o=void 0;if(o=n[ie]._onDragOver({clientX:Ae.clientX,clientY:Ae.clientY,target:r,rootEl:n}),o&&!this.options.dragoverBubble)break}r=n}while(n=n.parentNode);Eu()}},_onTouchMove:function(r){if(pn){var n=this.options,o=n.fallbackTolerance,l=n.fallbackOffset,c=r.touches?r.touches[0]:r,d=V&&Wn(V,!0),g=V&&d&&d.a,y=V&&d&&d.d,v=mi&&kt&&ou(kt),A=(c.clientX-pn.clientX+l.x)/(g||1)+(v?v[0]-os[0]:0)/(g||1),S=(c.clientY-pn.clientY+l.y)/(y||1)+(v?v[1]-os[1]:0)/(y||1);if(!H.active&&!Bn){if(o&&Math.max(Math.abs(c.clientX-this._lastX),Math.abs(c.clientY-this._lastY))<o)return;this._onDragStart(r,!0)}if(V){d?(d.e+=A-(rs||0),d.f+=S-(is||0)):d={a:1,b:0,c:0,d:1,e:A,f:S};var M="matrix(".concat(d.a,",").concat(d.b,",").concat(d.c,",").concat(d.d,",").concat(d.e,",").concat(d.f,")");U(V,"webkitTransform",M),U(V,"mozTransform",M),U(V,"msTransform",M),U(V,"transform",M),rs=A,is=S,Ae=c}r.cancelable&&r.preventDefault()}},_appendGhost:function(){if(!V){var r=this.options.fallbackOnBody?document.body:dt,n=St(P,!0,mi,!0,r),o=this.options;if(mi){for(kt=r;U(kt,"position")==="static"&&U(kt,"transform")==="none"&&kt!==document;)kt=kt.parentNode;kt!==document.body&&kt!==document.documentElement?(kt===document&&(kt=Ie()),n.top+=kt.scrollTop,n.left+=kt.scrollLeft):kt=Ie(),os=ou(kt)}V=P.cloneNode(!0),ne(V,o.ghostClass,!1),ne(V,o.fallbackClass,!0),ne(V,o.dragClass,!0),U(V,"transition",""),U(V,"transform",""),U(V,"box-sizing","border-box"),U(V,"margin",0),U(V,"top",n.top),U(V,"left",n.left),U(V,"width",n.width),U(V,"height",n.height),U(V,"opacity","0.8"),U(V,"position",mi?"absolute":"fixed"),U(V,"zIndex","100000"),U(V,"pointerEvents","none"),H.ghost=V,r.appendChild(V),U(V,"transform-origin",su/parseInt(V.style.width)*100+"% "+au/parseInt(V.style.height)*100+"%")}},_onDragStart:function(r,n){var o=this,l=r.dataTransfer,c=o.options;if(Gt("dragStart",this,{evt:r}),H.eventCanceled){this._onDrop();return}Gt("setupClone",this),H.eventCanceled||(mt=_u(P),mt.removeAttribute("id"),mt.draggable=!1,mt.style["will-change"]="",this._hideClone(),ne(mt,this.options.chosenClass,!1),H.clone=mt),o.cloneId=Ai(function(){Gt("clone",o),!H.eventCanceled&&(o.options.removeCloneOnHide||dt.insertBefore(mt,P),o._hideClone(),$t({sortable:o,name:"clone"}))}),!n&&ne(P,c.dragClass,!0),n?(xi=!0,o._loopId=setInterval(o._emulateDragOver,50)):(tt(document,"mouseup",o._onDrop),tt(document,"touchend",o._onDrop),tt(document,"touchcancel",o._onDrop),l&&(l.effectAllowed="move",c.setData&&c.setData.call(o,l,P)),rt(document,"drop",o),U(P,"transform","translateZ(0)")),Bn=!0,o._dragStartId=Ai(o._dragStarted.bind(o,n,r)),rt(document,"selectstart",o),fr=!0,gr&&U(document.body,"user-select","none")},_onDragOver:function(r){var n=this.el,o=r.target,l,c,d,g=this.options,y=g.group,v=H.active,A=pi===y,S=g.sort,M=Lt||v,R,O=this,B=!1;if(fs)return;function G(ae,Ri){Gt(ae,O,Me({evt:r,isOwner:A,axis:R?"vertical":"horizontal",revert:d,dragRect:l,targetRect:c,canSort:S,fromSortable:M,target:o,completed:it,onMove:function(Xt,Di){return vi(dt,n,P,l,Xt,St(Xt),r,Di)},changed:lt},Ri))}function at(){G("dragOverAnimationCapture"),O.captureAnimationState(),O!==M&&M.captureAnimationState()}function it(ae){return G("dragOverCompleted",{insertion:ae}),ae&&(A?v._hideClone():v._showClone(O),O!==M&&(ne(P,Lt?Lt.options.ghostClass:v.options.ghostClass,!1),ne(P,g.ghostClass,!0)),Lt!==O&&O!==H.active?Lt=O:O===H.active&&Lt&&(Lt=null),M===O&&(O._ignoreWhileAnimating=o),O.animateAll(function(){G("dragOverAnimationComplete"),O._ignoreWhileAnimating=null}),O!==M&&(M.animateAll(),M._ignoreWhileAnimating=null)),(o===P&&!P.animated||o===n&&!o.animated)&&(Fn=null),!g.dragoverBubble&&!r.rootEl&&o!==document&&(P.parentNode[ie]._isOutsideThisEl(r.target),!ae&&gn(r)),!g.dragoverBubble&&r.stopPropagation&&r.stopPropagation(),B=!0}function lt(){re=me(P),en=me(P,g.draggable),$t({sortable:O,name:"change",toEl:n,newIndex:re,newDraggableIndex:en,originalEvent:r})}if(r.preventDefault!==void 0&&r.cancelable&&r.preventDefault(),o=Ce(o,g.draggable,n,!0),G("dragOver"),H.eventCanceled)return B;if(P.contains(r.target)||o.animated&&o.animatingX&&o.animatingY||O._ignoreWhileAnimating===o)return it(!1);if(xi=!1,v&&!g.disabled&&(A?S||(d=yt!==dt):Lt===this||(this.lastPutMode=pi.checkPull(this,v,P,r))&&y.checkPut(this,v,P,r))){if(R=this._getDirection(r,o)==="vertical",l=St(P),G("dragOverValid"),H.eventCanceled)return B;if(d)return yt=dt,at(),this._hideClone(),G("revert"),H.eventCanceled||(mn?dt.insertBefore(P,mn):dt.appendChild(P)),it(!0);var pt=_s(n,g.draggable);if(!pt||Xv(r,R,this)&&!pt.animated){if(pt===P)return it(!1);if(pt&&n===r.target&&(o=pt),o&&(c=St(o)),vi(dt,n,P,l,o,c,r,!!o)!==!1)return at(),pt&&pt.nextSibling?n.insertBefore(P,pt.nextSibling):n.appendChild(P),yt=n,lt(),it(!0)}else if(pt&&Yv(r,R,this)){var At=$n(n,0,g,!0);if(At===P)return it(!1);if(o=At,c=St(o),vi(dt,n,P,l,o,c,r,!1)!==!1)return at(),n.insertBefore(P,At),yt=n,lt(),it(!0)}else if(o.parentNode===n){c=St(o);var It=0,Ct,Kt=P.parentNode!==n,Et=!Hv(P.animated&&P.toRect||l,o.animated&&o.toRect||c,R),Pe=R?"top":"left",oe=iu(o,"top","top")||iu(P,"top","top"),Re=oe?oe.scrollTop:void 0;Fn!==o&&(Ct=c[Pe],_r=!1,gi=!Et&&g.invertSwap||Kt),It=Zv(r,o,c,R,Et?1:g.swapThreshold,g.invertedSwapThreshold==null?g.swapThreshold:g.invertedSwapThreshold,gi,Fn===o);var Yt;if(It!==0){var se=me(P);do se-=It,Yt=yt.children[se];while(Yt&&(U(Yt,"display")==="none"||Yt===V))}if(It===0||Yt===o)return it(!1);Fn=o,yr=It;var De=o.nextElementSibling,Ot=!1;Ot=It===1;var Mt=vi(dt,n,P,l,o,c,r,Ot);if(Mt!==!1)return(Mt===1||Mt===-1)&&(Ot=Mt===1),fs=!0,setTimeout(Kv,30),at(),Ot&&!De?n.appendChild(P):o.parentNode.insertBefore(P,Ot?De:o),oe&&yu(oe,0,Re-oe.scrollTop),yt=P.parentNode,Ct!==void 0&&!gi&&(Si=Math.abs(Ct-St(o)[Pe])),lt(),it(!0)}if(n.contains(P))return it(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){tt(document,"mousemove",this._onTouchMove),tt(document,"touchmove",this._onTouchMove),tt(document,"pointermove",this._onTouchMove),tt(document,"dragover",gn),tt(document,"mousemove",gn),tt(document,"touchmove",gn)},_offUpEvents:function(){var r=this.el.ownerDocument;tt(r,"mouseup",this._onDrop),tt(r,"touchend",this._onDrop),tt(r,"pointerup",this._onDrop),tt(r,"touchcancel",this._onDrop),tt(document,"selectstart",this)},_onDrop:function(r){var n=this.el,o=this.options;if(re=me(P),en=me(P,o.draggable),Gt("drop",this,{evt:r}),yt=P&&P.parentNode,re=me(P),en=me(P,o.draggable),H.eventCanceled){this._nulling();return}Bn=!1,gi=!1,_r=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hs(this.cloneId),hs(this._dragStartId),this.nativeDraggable&&(tt(document,"drop",this),tt(n,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),gr&&U(document.body,"user-select",""),U(P,"transform",""),r&&(fr&&(r.cancelable&&r.preventDefault(),!o.dropBubble&&r.stopPropagation()),V&&V.parentNode&&V.parentNode.removeChild(V),(dt===yt||Lt&&Lt.lastPutMode!=="clone")&&mt&&mt.parentNode&&mt.parentNode.removeChild(mt),P&&(this.nativeDraggable&&tt(P,"dragend",this),ss(P),P.style["will-change"]="",fr&&!Bn&&ne(P,Lt?Lt.options.ghostClass:this.options.ghostClass,!1),ne(P,this.options.chosenClass,!1),$t({sortable:this,name:"unchoose",toEl:yt,newIndex:null,newDraggableIndex:null,originalEvent:r}),dt!==yt?(re>=0&&($t({rootEl:yt,name:"add",toEl:yt,fromEl:dt,originalEvent:r}),$t({sortable:this,name:"remove",toEl:yt,originalEvent:r}),$t({rootEl:yt,name:"sort",toEl:yt,fromEl:dt,originalEvent:r}),$t({sortable:this,name:"sort",toEl:yt,originalEvent:r})),Lt&&Lt.save()):re!==kn&&re>=0&&($t({sortable:this,name:"update",toEl:yt,originalEvent:r}),$t({sortable:this,name:"sort",toEl:yt,originalEvent:r})),H.active&&((re==null||re===-1)&&(re=kn,en=vr),$t({sortable:this,name:"end",toEl:yt,originalEvent:r}),this.save()))),this._nulling()},_nulling:function(){Gt("nulling",this),dt=P=yt=V=mn=mt=wi=nn=pn=Ae=fr=re=en=kn=vr=Fn=yr=Lt=pi=H.dragged=H.ghost=H.clone=H.active=null,Ii.forEach(function(r){r.checked=!0}),Ii.length=rs=is=0},handleEvent:function(r){switch(r.type){case"drop":case"dragend":this._onDrop(r);break;case"dragenter":case"dragover":P&&(this._onDragOver(r),Gv(r));break;case"selectstart":r.preventDefault();break}},toArray:function(){for(var r=[],n,o=this.el.children,l=0,c=o.length,d=this.options;l<c;l++)n=o[l],Ce(n,d.draggable,this.el,!1)&&r.push(n.getAttribute(d.dataIdAttr)||Jv(n));return r},sort:function(r,n){var o={},l=this.el;this.toArray().forEach(function(c,d){var g=l.children[d];Ce(g,this.options.draggable,l,!1)&&(o[c]=g)},this),n&&this.captureAnimationState(),r.forEach(function(c){o[c]&&(l.removeChild(o[c]),l.appendChild(o[c]))}),n&&this.animateAll()},save:function(){var r=this.options.store;r&&r.set&&r.set(this)},closest:function(r,n){return Ce(r,n||this.options.draggable,this.el,!1)},option:function(r,n){var o=this.options;if(n===void 0)return o[r];var l=wr.modifyOption(this,r,n);typeof l<"u"?o[r]=l:o[r]=n,r==="group"&&Au(o)},destroy:function(){Gt("destroy",this);var r=this.el;r[ie]=null,tt(r,"mousedown",this._onTapStart),tt(r,"touchstart",this._onTapStart),tt(r,"pointerdown",this._onTapStart),this.nativeDraggable&&(tt(r,"dragover",this),tt(r,"dragenter",this)),Array.prototype.forEach.call(r.querySelectorAll("[draggable]"),function(n){n.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),Ti.splice(Ti.indexOf(this.el),1),this.el=r=null},_hideClone:function(){if(!nn){if(Gt("hideClone",this),H.eventCanceled)return;U(mt,"display","none"),this.options.removeCloneOnHide&&mt.parentNode&&mt.parentNode.removeChild(mt),nn=!0}},_showClone:function(r){if(r.lastPutMode!=="clone"){this._hideClone();return}if(nn){if(Gt("showClone",this),H.eventCanceled)return;P.parentNode==dt&&!this.options.group.revertClone?dt.insertBefore(mt,P):mn?dt.insertBefore(mt,mn):dt.appendChild(mt),this.options.group.revertClone&&this.animate(P,mt),U(mt,"display",""),nn=!1}}};function Gv(s){s.dataTransfer&&(s.dataTransfer.dropEffect="move"),s.cancelable&&s.preventDefault()}function vi(s,r,n,o,l,c,d,g){var y,v=s[ie],A=v.options.onMove,S;return window.CustomEvent&&!Ve&&!br?y=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(y=document.createEvent("Event"),y.initEvent("move",!0,!0)),y.to=r,y.from=s,y.dragged=n,y.draggedRect=o,y.related=l||r,y.relatedRect=c||St(r),y.willInsertAfter=g,y.originalEvent=d,s.dispatchEvent(y),A&&(S=A.call(v,y,d)),S}function ss(s){s.draggable=!1}function Kv(){fs=!1}function Yv(s,r,n){var o=St($n(n.el,0,n.options,!0)),l=bu(n.el,n.options,V),c=10;return r?s.clientX<l.left-c||s.clientY<o.top&&s.clientX<o.right:s.clientY<l.top-c||s.clientY<o.bottom&&s.clientX<o.left}function Xv(s,r,n){var o=St(_s(n.el,n.options.draggable)),l=bu(n.el,n.options,V),c=10;return r?s.clientX>l.right+c||s.clientY>o.bottom&&s.clientX>o.left:s.clientY>l.bottom+c||s.clientX>o.right&&s.clientY>o.top}function Zv(s,r,n,o,l,c,d,g){var y=o?s.clientY:s.clientX,v=o?n.height:n.width,A=o?n.top:n.left,S=o?n.bottom:n.right,M=!1;if(!d){if(g&&Si<v*l){if(!_r&&(yr===1?y>A+v*c/2:y<S-v*c/2)&&(_r=!0),_r)M=!0;else if(yr===1?y<A+Si:y>S-Si)return-yr}else if(y>A+v*(1-l)/2&&y<S-v*(1-l)/2)return Qv(r)}return M=M||d,M&&(y<A+v*c/2||y>S-v*c/2)?y>A+v/2?1:-1:0}function Qv(s){return me(P)<me(s)?1:-1}function Jv(s){for(var r=s.tagName+s.className+s.src+s.href+s.textContent,n=r.length,o=0;n--;)o+=r.charCodeAt(n);return o.toString(36)}function jv(s){Ii.length=0;for(var r=s.getElementsByTagName("input"),n=r.length;n--;){var o=r[n];o.checked&&Ii.push(o)}}function Ai(s){return setTimeout(s,0)}function hs(s){return clearTimeout(s)}Pi&&rt(document,"touchmove",function(s){(H.active||Bn)&&s.cancelable&&s.preventDefault()});H.utils={on:rt,off:tt,css:U,find:mu,is:function(r,n){return!!Ce(r,n,r,!1)},extend:Fv,throttle:vu,closest:Ce,toggleClass:ne,clone:_u,index:me,nextTick:Ai,cancelNextTick:hs,detectDirection:Su,getChild:$n};H.get=function(s){return s[ie]};H.mount=function(){for(var s=arguments.length,r=new Array(s),n=0;n<s;n++)r[n]=arguments[n];r[0].constructor===Array&&(r=r[0]),r.forEach(function(o){if(!o.prototype||!o.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(o));o.utils&&(H.utils=Me(Me({},H.utils),o.utils)),wr.mount(o)})};H.create=function(s,r){return new H(s,r)};H.version=Dv;var wt=[],hr,ds,ps=!1,as,ls,Mi,dr;function t0(){function s(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var r in this)r.charAt(0)==="_"&&typeof this[r]=="function"&&(this[r]=this[r].bind(this))}return s.prototype={dragStarted:function(n){var o=n.originalEvent;this.sortable.nativeDraggable?rt(document,"dragover",this._handleAutoScroll):this.options.supportPointer?rt(document,"pointermove",this._handleFallbackAutoScroll):o.touches?rt(document,"touchmove",this._handleFallbackAutoScroll):rt(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(n){var o=n.originalEvent;!this.options.dragOverBubble&&!o.rootEl&&this._handleAutoScroll(o)},drop:function(){this.sortable.nativeDraggable?tt(document,"dragover",this._handleAutoScroll):(tt(document,"pointermove",this._handleFallbackAutoScroll),tt(document,"touchmove",this._handleFallbackAutoScroll),tt(document,"mousemove",this._handleFallbackAutoScroll)),uu(),Ci(),Bv()},nulling:function(){Mi=ds=hr=ps=dr=as=ls=null,wt.length=0},_handleFallbackAutoScroll:function(n){this._handleAutoScroll(n,!0)},_handleAutoScroll:function(n,o){var l=this,c=(n.touches?n.touches[0]:n).clientX,d=(n.touches?n.touches[0]:n).clientY,g=document.elementFromPoint(c,d);if(Mi=n,o||this.options.forceAutoScrollFallback||br||Ve||gr){us(n,this.options,g,o);var y=rn(g,!0);ps&&(!dr||c!==as||d!==ls)&&(dr&&uu(),dr=setInterval(function(){var v=rn(document.elementFromPoint(c,d),!0);v!==y&&(y=v,Ci()),us(n,l.options,v,o)},10),as=c,ls=d)}else{if(!this.options.bubbleScroll||rn(g,!0)===Ie()){Ci();return}us(n,this.options,rn(g,!1),!1)}}},ze(s,{pluginName:"scroll",initializeByDefault:!0})}function Ci(){wt.forEach(function(s){clearInterval(s.pid)}),wt=[]}function uu(){clearInterval(dr)}var us=vu(function(s,r,n,o){if(r.scroll){var l=(s.touches?s.touches[0]:s).clientX,c=(s.touches?s.touches[0]:s).clientY,d=r.scrollSensitivity,g=r.scrollSpeed,y=Ie(),v=!1,A;ds!==n&&(ds=n,Ci(),hr=r.scroll,A=r.scrollFn,hr===!0&&(hr=rn(n,!0)));var S=0,M=hr;do{var R=M,O=St(R),B=O.top,G=O.bottom,at=O.left,it=O.right,lt=O.width,pt=O.height,At=void 0,It=void 0,Ct=R.scrollWidth,Kt=R.scrollHeight,Et=U(R),Pe=R.scrollLeft,oe=R.scrollTop;R===y?(At=lt<Ct&&(Et.overflowX==="auto"||Et.overflowX==="scroll"||Et.overflowX==="visible"),It=pt<Kt&&(Et.overflowY==="auto"||Et.overflowY==="scroll"||Et.overflowY==="visible")):(At=lt<Ct&&(Et.overflowX==="auto"||Et.overflowX==="scroll"),It=pt<Kt&&(Et.overflowY==="auto"||Et.overflowY==="scroll"));var Re=At&&(Math.abs(it-l)<=d&&Pe+lt<Ct)-(Math.abs(at-l)<=d&&!!Pe),Yt=It&&(Math.abs(G-c)<=d&&oe+pt<Kt)-(Math.abs(B-c)<=d&&!!oe);if(!wt[S])for(var se=0;se<=S;se++)wt[se]||(wt[se]={});(wt[S].vx!=Re||wt[S].vy!=Yt||wt[S].el!==R)&&(wt[S].el=R,wt[S].vx=Re,wt[S].vy=Yt,clearInterval(wt[S].pid),(Re!=0||Yt!=0)&&(v=!0,wt[S].pid=setInterval((function(){o&&this.layer===0&&H.active._onTouchMove(Mi);var De=wt[this.layer].vy?wt[this.layer].vy*g:0,Ot=wt[this.layer].vx?wt[this.layer].vx*g:0;typeof A=="function"&&A.call(H.dragged.parentNode[ie],Ot,De,s,Mi,wt[this.layer].el)!=="continue"||yu(wt[this.layer].el,Ot,De)}).bind({layer:S}),24))),S++}while(r.bubbleScroll&&M!==y&&(M=rn(M,!1)));ps=v}},30),xu=function(r){var n=r.originalEvent,o=r.putSortable,l=r.dragEl,c=r.activeSortable,d=r.dispatchSortableEvent,g=r.hideGhostForTarget,y=r.unhideGhostForTarget;if(n){var v=o||c;g();var A=n.changedTouches&&n.changedTouches.length?n.changedTouches[0]:n,S=document.elementFromPoint(A.clientX,A.clientY);y(),v&&!v.el.contains(S)&&(d("spill"),this.onSpill({dragEl:l,putSortable:o}))}};function bs(){}bs.prototype={startIndex:null,dragStart:function(r){var n=r.oldDraggableIndex;this.startIndex=n},onSpill:function(r){var n=r.dragEl,o=r.putSortable;this.sortable.captureAnimationState(),o&&o.captureAnimationState();var l=$n(this.sortable.el,this.startIndex,this.options);l?this.sortable.el.insertBefore(n,l):this.sortable.el.appendChild(n),this.sortable.animateAll(),o&&o.animateAll()},drop:xu};ze(bs,{pluginName:"revertOnSpill"});function ws(){}ws.prototype={onSpill:function(r){var n=r.dragEl,o=r.putSortable,l=o||this.sortable;l.captureAnimationState(),n.parentNode&&n.parentNode.removeChild(n),l.animateAll()},drop:xu};ze(ws,{pluginName:"removeOnSpill"});H.mount(new t0);H.mount(ws,bs);var e0=H;function n0(s){s.directive("sort",(r,{value:n,modifiers:o,expression:l},{effect:c,evaluate:d,evaluateLater:g,cleanup:y})=>{if(n==="config"||n==="handle"||n==="group")return;if(n==="key"||n==="item"){if([void 0,null,""].includes(l))return;r._x_sort_key=d(l);return}let v={hideGhost:!o.includes("ghost"),useHandles:!!r.querySelector("[x-sort\\:handle]"),group:a0(r,o)},A=r0(l,g),S=i0(r,o,d),M=o0(r,S,v,(R,O)=>{A(R,O)});y(()=>M.destroy())})}function r0(s,r){if([void 0,null,""].includes(s))return()=>{};let n=r(s);return(o,l)=>{Alpine.dontAutoEvaluateFunctions(()=>{n(c=>{typeof c=="function"&&c(o,l)},{scope:{$key:o,$item:o,$position:l}})})}}function i0(s,r,n){return s.hasAttribute("x-sort:config")?n(s.getAttribute("x-sort:config")):{}}function o0(s,r,n,o){let l,c={animation:150,handle:n.useHandles?"[x-sort\\:handle]":null,group:n.group,filter(d){return s.querySelector("[x-sort\\:item]")?!d.target.closest("[x-sort\\:item]"):!1},onSort(d){if(d.from!==d.to&&d.to!==d.target)return;let g=d.item._x_sort_key,y=d.newIndex;(g!==void 0||g!==null)&&o(g,y)},onStart(){document.body.classList.add("sorting"),l=document.querySelector(".sortable-ghost"),n.hideGhost&&l&&(l.style.opacity="0")},onEnd(){document.body.classList.remove("sorting"),n.hideGhost&&l&&(l.style.opacity="1"),l=void 0,s0(s)}};return new e0(s,{...c,...r})}function s0(s){let r=s.firstChild;for(;r.nextSibling;){if(r.textContent.trim()==="[if ENDBLOCK]><![endif]"){s.append(r);break}r=r.nextSibling}}function a0(s,r){return s.hasAttribute("x-sort:group")?s.getAttribute("x-sort:group"):r.indexOf("group")!==-1?r[r.indexOf("group")+1]:null}var l0=n0;/*! Bundled license information: sortablejs/modular/sortable.esm.js: (**! * Sortable 1.15.2 * @author RubaXa <trash@rubaxa.org> * @author owenm <owen23355@gmail.com> * @license MIT *) */function u0(s){s.directive("intersect",s.skipDuringClone((r,{value:n,expression:o,modifiers:l},{evaluateLater:c,cleanup:d})=>{let g=c(o),y={rootMargin:h0(l),threshold:c0(l)},v=new IntersectionObserver(A=>{A.forEach(S=>{S.isIntersecting!==(n==="leave")&&(g(),l.includes("once")&&v.disconnect())})},y);v.observe(r),d(()=>{v.disconnect()})}))}function c0(s){if(s.includes("full"))return .99;if(s.includes("half"))return .5;if(!s.includes("threshold"))return 0;let r=s[s.indexOf("threshold")+1];return r==="100"?1:r==="0"?0:+`.${r}`}function f0(s){let r=s.match(/^(-?[0-9]+)(px|%)?$/);return r?r[1]+(r[2]||"px"):void 0}function h0(s){const r="margin",n="0px 0px 0px 0px",o=s.indexOf(r);if(o===-1)return n;let l=[];for(let c=1;c<5;c++)l.push(f0(s[o+c]||""));return l=l.filter(c=>c!==void 0),l.length?l.join(" ").trim():n}var d0=u0;function p0(s={show:!1,focusable:!1}){return{show:s.show,focusable:s.focusable,closeModal(){this.show=!1},openModal(){this.show=!0},focusables(){return[...this.$el.querySelectorAll("a, button, input:not([type='hidden']), textarea, select, details, [tabindex]:not([tabindex='-1'])")].filter(n=>!n.hasAttribute("disabled"))},firstFocusable(){return this.focusables()[0]},lastFocusable(){return this.focusables().slice(-1)[0]},nextFocusable(){return this.focusables()[this.nextFocusableIndex()]||this.firstFocusable()},prevFocusable(){return this.focusables()[this.prevFocusableIndex()]||this.lastFocusable()},nextFocusableIndex(){return(this.focusables().indexOf(document.activeElement)+1)%(this.focusables().length+1)},prevFocusableIndex(){return Math.max(0,this.focusables().indexOf(document.activeElement))-1},init(){this.$watch("show",r=>{r?(document.body.classList.add("overflow-y-hidden"),this.focusable!==!1&&setTimeout(()=>this.firstFocusable().focus(),100)):document.body.classList.remove("overflow-y-hidden")})}}}function g0(s={}){return{isShared:s.isShared??!1,limits:s.limits??{},init(){},pushToAiEngines(r){this.aiEngines.push(r)}}}class Tu{constructor(){this.playbackNode=null}async init(r){this.audioContext=new AudioContext({sampleRate:r}),await this.audioContext.audioWorklet.addModule("/themes/default/assets/js/audio/playback-worklet.js"),this.playbackNode=new AudioWorkletNode(this.audioContext,"playback-worklet"),this.playbackNode.connect(this.audioContext.destination)}play(r){this.playbackNode&&this.playbackNode.port.postMessage(r)}clear(){this.playbackNode&&this.playbackNode.port.postMessage(null)}}function qn(s,r,n,o){function l(c){return c instanceof n?c:new n(function(d){d(c)})}return new(n||(n=Promise))(function(c,d){function g(A){try{v(o.next(A))}catch(S){d(S)}}function y(A){try{v(o.throw(A))}catch(S){d(S)}}function v(A){A.done?c(A.value):l(A.value).then(g,y)}v((o=o.apply(s,[])).next())})}function vn(s,r){var n={label:0,sent:function(){if(c[0]&1)throw c[1];return c[1]},trys:[],ops:[]},o,l,c,d=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return d.next=g(0),d.throw=g(1),d.return=g(2),typeof Symbol=="function"&&(d[Symbol.iterator]=function(){return this}),d;function g(v){return function(A){return y([v,A])}}function y(v){if(o)throw new TypeError("Generator is already executing.");for(;d&&(d=0,v[0]&&(n=0)),n;)try{if(o=1,l&&(c=v[0]&2?l.return:v[0]?l.throw||((c=l.return)&&c.call(l),0):l.next)&&!(c=c.call(l,v[1])).done)return c;switch(l=0,c&&(v=[v[0]&2,c.value]),v[0]){case 0:case 1:c=v;break;case 4:return n.label++,{value:v[1],done:!1};case 5:n.label++,l=v[1],v=[0];continue;case 7:v=n.ops.pop(),n.trys.pop();continue;default:if(c=n.trys,!(c=c.length>0&&c[c.length-1])&&(v[0]===6||v[0]===2)){n=0;continue}if(v[0]===3&&(!c||v[1]>c[0]&&v[1]<c[3])){n.label=v[1];break}if(v[0]===6&&n.label<c[1]){n.label=c[1],c=v;break}if(c&&n.label<c[2]){n.label=c[2],n.ops.push(v);break}c[2]&&n.ops.pop(),n.trys.pop();continue}v=r.call(s,n)}catch(A){v=[6,A],l=0}finally{o=c=0}if(v[0]&5)throw v[1];return{value:v[0]?v[1]:void 0,done:!0}}}function cu(s){var r=typeof Symbol=="function"&&Symbol.iterator,n=r&&s[r],o=0;if(n)return n.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&o>=s.length&&(s=void 0),{value:s&&s[o++],done:!s}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")}function cs(s,r){var n=typeof Symbol=="function"&&s[Symbol.iterator];if(!n)return s;var o=n.call(s),l,c=[],d;try{for(;(r===void 0||r-- >0)&&!(l=o.next()).done;)c.push(l.value)}catch(g){d={error:g}}finally{try{l&&!l.done&&(n=o.return)&&n.call(o)}finally{if(d)throw d.error}}return c}function Nn(s){return this instanceof Nn?(this.v=s,this):new Nn(s)}function m0(s,r,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n.apply(s,r||[]),l,c=[];return l=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),g("next"),g("throw"),g("return",d),l[Symbol.asyncIterator]=function(){return this},l;function d(R){return function(O){return Promise.resolve(O).then(R,S)}}function g(R,O){o[R]&&(l[R]=function(B){return new Promise(function(G,at){c.push([R,B,G,at])>1||y(R,B)})},O&&(l[R]=O(l[R])))}function y(R,O){try{v(o[R](O))}catch(B){M(c[0][3],B)}}function v(R){R.value instanceof Nn?Promise.resolve(R.value.v).then(A,S):M(c[0][2],R)}function A(R){y("next",R)}function S(R){y("throw",R)}function M(R,O){R(O),c.shift(),c.length&&y(c[0][0],c[0][1])}}function v0(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=s[Symbol.asyncIterator],n;return r?r.call(s):(s=typeof cu=="function"?cu(s):s[Symbol.iterator](),n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n);function o(c){n[c]=s[c]&&function(d){return new Promise(function(g,y){d=s[c](d),l(g,y,d.done,d.value)})}}function l(c,d,g,y){Promise.resolve(y).then(function(v){c({value:v,done:g})},d)}}var y0=function(s){return typeof s=="object"&&s!==null&&"type"in s},_0=function(s){return y0(s)&&["error","message","conversation.item.input_audio_transcription.delta","session.created","session.updated","input_audio_buffer.committed","input_audio_buffer.cleared","input_audio_buffer.speech_started","input_audio_buffer.speech_stopped","conversation.item.created","conversation.item.truncated","conversation.item.deleted","conversation.item.input_audio_transcription.completed","conversation.item.input_audio_transcription.failed","response.created","response.done","response.output_item.added","response.output_item.done","response.content_part.added","response.content_part.done","response.text.delta","response.text.done","response.audio_transcript.delta","response.audio_transcript.done","response.audio.delta","response.audio.done","response.function_call_arguments.delta","response.function_call_arguments.done","rate_limits.updated"].includes(s.type)},b0=WebSocket,w0=function(s,r){return s.readyState!==WebSocket.OPEN?Promise.reject(new Error("Socket is not open")):(s.send(r),Promise.resolve())},S0=function(s){return{success:!0,message:s}},A0=function(s){return{success:!1,error:s}},C0=function(s){return s.success},E0=function(){function s(r,n){var o=this;this.closedPromise=void 0,this.messageQueue=[],this.receiverQueue=[],this.done=!1,this.validate=n.validate,this.serialize=n.serialize,this.connectedPromise=new Promise(function(l,c){return qn(o,void 0,void 0,function(){var d,g,y,v,A=this;return vn(this,function(S){switch(S.label){case 0:return r.policy!==void 0?[3,1]:(v=r,[3,3]);case 1:return[4,r.policy(r)];case 2:v=S.sent(),S.label=3;case 3:return d=v,g=d.uri,y=d.protocols,this.socket=new b0(g.toString(),y),this.socket.onopen=function(){A.socket.onmessage=A.getMessageHandler(),A.closedPromise=new Promise(function(M){A.socket.onclose=A.getClosedHandler(M)}),A.socket.onerror=A.handleError,l()},this.socket.onerror=function(M){A.error=M.error,c(M)},[2]}})})})}return s.prototype.handleError=function(r){for(this.error=r.error;this.receiverQueue.length>0;){var n=cs(this.receiverQueue.shift(),2);n[0];var o=n[1];o(r.error)}},s.prototype.getClosedHandler=function(r){var n=this;return function(o){for(n.done=!0;n.receiverQueue.length>0;){var l=cs(n.receiverQueue.shift(),2),c=l[0],d=l[1];n.error?d(n.error):c({value:void 0,done:!0})}r()}},s.prototype.getMessageHandler=function(){var r=this;return function(n){var o=r.validate(n);if(C0(o)){var l=o.message;if(r.receiverQueue.length>0){var c=cs(r.receiverQueue.shift(),2),d=c[0];c[1],d({value:l,done:!1})}else r.messageQueue.push(l)}else r.error=o.error,r.socket.close(1e3,"Unexpected message received")}},s.prototype[Symbol.asyncIterator]=function(){var r=this;return{next:function(){if(r.error)return Promise.reject(r.error);if(r.done)return Promise.resolve({value:void 0,done:!0});if(r.messageQueue.length>0){var n=r.messageQueue.shift();return Promise.resolve({value:n,done:!1})}else return new Promise(function(o,l){r.receiverQueue.push([o,l])})}}},s.prototype.send=function(r){return qn(this,void 0,void 0,function(){var n;return vn(this,function(o){switch(o.label){case 0:return[4,this.connectedPromise];case 1:if(o.sent(),this.error)throw this.error;return n=this.serialize(r),[2,w0(this.socket,n)]}})})},s.prototype.close=function(){return qn(this,void 0,void 0,function(){return vn(this,function(r){switch(r.label){case 0:return[4,this.connectedPromise];case 1:return r.sent(),this.done?[2]:(this.socket.close(),[4,this.closedPromise]);case 2:return r.sent(),[2]}})})},s}();function gs(s){return typeof s=="object"&&s!==null&&"key"in s&&typeof s.key=="string"}function x0(s){return typeof s=="object"&&s!==null&&"getToken"in s&&typeof s.getToken=="function"}var T0=function(s){return gs(s)||x0(s)},I0=function(s){return typeof s=="object"&&s!==null&&"model"in s&&typeof s.model=="string"},M0=function(s){return typeof s=="object"&&s!==null&&"deployment"in s&&typeof s.deployment=="string"},P0=function(){function s(r,n,o){var l=this,c=function(){if(gs(r)&&I0(n))return l.openAISettings(r,n);if(T0(n)&&M0(o))return l.azureOpenAISettings(r,n,o);throw new Error("Invalid combination of arguments to initialize the Realtime client")}();this.client=this.getWebsocket(c)}return s.prototype.azureOpenAISettings=function(r,n,o){var l=this,c=["https://cognitiveservices.azure.com/.default"];return this.requestId=crypto.randomUUID(),r.searchParams.set("api-version","2024-10-01-preview"),r.searchParams.set("x-ms-client-request-id",this.requestId),r.searchParams.set("deployment",o.deployment),r.pathname="openai/realtime",{uri:r,policy:function(d){return qn(l,void 0,void 0,function(){var g;return vn(this,function(y){switch(y.label){case 0:return gs(n)?(d.uri.searchParams.set("api-key",n.key),[3,3]):[3,1];case 1:return[4,n.getToken(c)];case 2:g=y.sent(),d.uri.searchParams.set("Authorization","Bearer ".concat(g.token)),y.label=3;case 3:return[2,d]}})})}}},s.prototype.openAISettings=function(r,n){var o=new URL("wss://api.openai.com/v1/realtime");return o.searchParams.set("model",n.model),{uri:o,protocols:["realtime","openai-insecure-api-key.".concat(r.key),"openai-beta.realtime-v1"]}},s.prototype.getWebsocket=function(r){var n={validate:function(o){o.data;try{var l=JSON.parse(o.data);if(_0(l))return S0(l)}catch{return A0(new Error("Invalid JSON message"))}},serialize:function(o){return JSON.stringify(o)}};return new E0(r,n)},s.prototype.messages=function(){return m0(this,arguments,function(){var n,o,l,c,d,g,y,v,A;return vn(this,function(S){switch(S.label){case 0:S.trys.push([0,7,8,13]),n=!0,o=v0(this.client),S.label=1;case 1:return[4,Nn(o.next())];case 2:return l=S.sent(),g=l.done,!g?(A=l.value,n=!1,c=A,[4,Nn(c)]):[3,6];case 3:return[4,S.sent()];case 4:S.sent(),S.label=5;case 5:return n=!0,[3,1];case 6:return[3,13];case 7:return d=S.sent(),y={error:d},[3,13];case 8:return S.trys.push([8,,11,12]),!n&&!g&&(v=o.return)?[4,Nn(v.call(o))]:[3,10];case 9:S.sent(),S.label=10;case 10:return[3,12];case 11:if(y)throw y.error;return[7];case 12:return[7];case 13:return[2]}})})},s.prototype.send=function(r){return qn(this,void 0,void 0,function(){return vn(this,function(n){switch(n.label){case 0:return[4,this.client.send(r)];case 1:return n.sent(),[2]}})})},s.prototype.close=function(){return qn(this,void 0,void 0,function(){return vn(this,function(r){switch(r.label){case 0:return[4,this.client.close()];case 1:return r.sent(),[2]}})})},s}();N.store("realtimeChatStatus",{active:!1,conversationStarted:!1,setActive(s){this.active=s,this.onActiveChange()},setConversationStarted(s){this.conversationStarted=s,this.onConversationStartedChange()},onActiveChange(){var s,r;document.querySelectorAll(".lqd-realtime-chat-button").forEach(n=>n.classList.toggle("active",this.active)),(r=(s=document.querySelector(".lqd-audio-vis-wrap"))==null?void 0:s.classList)==null||r.toggle("active",this.active)},onConversationStartedChange(){const s=document.querySelector(".chats-wrap");s.classList.toggle("conversation-started",this.conversationStarted),s.classList.toggle("conversation-not-started",!this.conversationStarted),document.querySelectorAll(".lqd-realtime-chat-button").forEach(r=>{r.classList.toggle("conversation-started",this.conversationStarted),r.classList.toggle("conversation-not-started",!this.conversationStarted)})}});const R0=(s,r,n)=>({apiKey:"",recordingActive:!1,buffer:new Uint8Array,wsConnection:null,audioRecorder:null,audioPlayer:null,activeVisulaizer:"idle",audioVisWrap:null,audioVisBars:null,audioVisDotWrap:null,audioVisLoader:null,conversationArea:document.querySelector(".conversation-area"),chatsContainer:document.querySelector(".chats-container"),userBubbleTemplate:document.querySelector("#chat_user_bubble"),aiBubbleTemplate:document.querySelector("#chat_ai_bubble"),lastAiBubble:null,lastUserBubble:null,lastUserQuestion:"",lastAiResponse:"",lastResponseSaved:!1,init(){var o,l,c;this.audioVisWrap=document.querySelector(".lqd-audio-vis-wrap"),this.audioVisBars=(o=this.audioVisWrap)==null?void 0:o.querySelectorAll(".lqd-audio-vis-bar"),this.audioVisDotWrap=(l=this.audioVisWrap)==null?void 0:l.querySelector(".lqd-audio-vis-dot-wrap"),this.audioVisLoader=(c=this.audioVisWrap)==null?void 0:c.querySelector(".lqd-audio-vis-loader"),this.processAudioRecordingBuffer=this.processAudioRecordingBuffer.bind(this)},async start(){if(this.checkBalanceRealtime(!0).then(o=>{o.shouldStop&&(toastr.error(o.errorMsg),this.stop())}),!N.store("realtimeChatStatus").isActive){N.store("realtimeChatStatus").setActive(!0),this.switchVisualizers("waiting"),this.wsConnection=new P0({key:atob(s)+atob(r)+atob(n)},{model:"gpt-4o-realtime-preview-2024-12-17"});try{await this.wsConnection.send(this.createConfigMessage())}catch(o){this.stop(),console.error("Error sending initial config message:",o),this.appendToChatBubble("ai","[Connection error]: Unable to send initial config message. Please check your endpoint and authentication details.");return}await Promise.all([this.startRecorder(),this.startPlayer()]).then(()=>{this.handleRealtimeMessages(),this.startBarsVisualizer(),this.startDotVisualizer(),this.switchVisualizers("idle")}).catch(o=>{this.stop(),console.error("Error starting recorder and player:",o),this.appendToChatBubble("ai","[Error]: Unable to start audio recorder and player. Please check your microphone permissions and refresh the page.")})}},stop(){!this.lastResponseSaved&&"saveResponseAsync"in window&&this.lastUserQuestion.trim()!==""&&this.lastAiResponse.trim()!==""&&saveResponseAsync(this.lastUserQuestion.trim(),this.lastAiResponse.trim(),document.querySelector("#chat_id").value,"","","","","gpt-4o-realtime-preview-2024-12-17"),this.resetPlayers(),this.wsConnection&&this.wsConnection.close(),this.switchVisualizers(""),N.store("realtimeChatStatus").setActive(!1)},async startPlayer(){try{this.audioPlayer=new Tu,await this.audioPlayer.init(24e3)}catch(o){console.error("Error starting audio player:",o)}},async startRecorder(){try{this.audioRecorder=new hu(this.processAudioRecordingBuffer);const o=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1});await this.audioRecorder.start(o),this.recordingActive=!0}catch(o){console.error("Error starting audio recorder:",o)}},createConfigMessage(){let o={type:"session.update",session:{turn_detection:{type:"server_vad",silence_duration_ms:500},input_audio_transcription:{model:"whisper-1"}}};const l=this.getSystemMessage(),c=this.getTemperature(),d=this.getVoice();return l&&(o.session.instructions=l),isNaN(c)||(o.session.temperature=c),d&&(o.session.voice=d),o},async handleRealtimeMessages(){for await(const o of this.wsConnection.messages())switch(""+o.type,o.type){case"session.created":this.switchVisualizers("idle");break;case"response.content_part.added":this.checkBalanceRealtime(!0).then(l=>{l.shouldStop&&(toastr.error(l.errorMsg),this.stop())}),this.lastAiResponse="",N.store("realtimeChatStatus").setConversationStarted(!0),this.createChatBubble("ai");break;case"response.audio_transcript.delta":this.lastAiResponse+=o.delta,this.appendToChatBubble("ai",o.delta);break;case"response.audio.delta":{this.switchVisualizers("playing");const l=atob(o.delta),c=Uint8Array.from(l,g=>g.charCodeAt(0)),d=new Int16Array(c.buffer);this.audioPlayer.play(d);break}case"input_audio_buffer.speech_started":{this.createChatBubble("user"),this.switchVisualizers("recording"),this.audioPlayer.clear(),this.lastResponseSaved=!1,setTimeout(()=>{this.lastUserQuestion=""},0);break}case"conversation.item.input_audio_transcription.completed":this.lastUserQuestion+=o.transcript,this.appendToChatBubble("user",o.transcript);break;case"response.output_item.done":break;case"conversation.item.truncated":this.appendToChatBubble("ai","...");break;case"conversation.item.deleted":break;case"response.done":"saveResponseAsync"in window&&(saveResponseAsync(this.lastUserQuestion.trim(),this.lastAiResponse.trim(),document.querySelector("#chat_id").value,"","","","","gpt-4o-realtime-preview-2024-12-17"),this.lastResponseSaved=!0),"formatString"in window&&this.lastAiBubble&&(this.lastAiBubble.innerHTML=formatString(this.lastAiResponse));break;default:JSON.stringify(o,null,2);break}this.resetPlayers()},combineArray(o){const l=new Uint8Array(this.buffer.length+o.length);l.set(this.buffer),l.set(o,this.buffer.length),this.buffer=l},processAudioRecordingBuffer(o){const l=new Uint8Array(o);if(this.combineArray(l),this.buffer.length>=4800){const c=new Uint8Array(this.buffer.slice(0,4800));this.buffer=new Uint8Array(this.buffer.slice(4800));const d=String.fromCharCode(...c),g=btoa(d);this.recordingActive&&this.wsConnection.send({type:"input_audio_buffer.append",audio:g})}},async resetPlayers(){var o,l;this.recordingActive=!1,(o=this.audioRecorder)==null||o.stop(),(l=this.audioPlayer)==null||l.clear()},getSystemMessage(){return""},getTemperature(){return parseFloat(.8)},getVoice(){return"alloy"},switchVisualizers(o){var l;this.activeVisulaizer=o,(l=this.audioVisWrap)==null||l.setAttribute("data-state",this.activeVisulaizer)},createChatBubble(o){const c=(o==="user"?this.userBubbleTemplate:this.aiBubbleTemplate).content.cloneNode(!0),d=c.querySelector(".chat-content");this.chatsContainer.appendChild(c),o==="user"?this.lastUserBubble=d:this.lastAiBubble=d,this.scrollConversationAreaToBottom()},appendToChatBubble(o,l){const c=o==="user"?this.lastUserBubble:this.lastAiBubble;c?(c.textContent+=l,this.scrollConversationAreaToBottom()):(this.createChatBubble(o),this.appendToChatBubble(o,l))},scrollConversationAreaToBottom(){this.conversationArea.scrollTo({top:this.conversationArea.scrollHeight+200,left:0})},startBarsVisualizer(){var v;if(!((v=this.audioVisBars)!=null&&v.length))return;const o=this.audioPlayer.audioContext.createAnalyser();o.fftSize=4096;const l=o.frequencyBinCount,c=new Uint8Array(l),d=this.audioVisBars.length;this.audioPlayer.playbackNode.connect(o);const g=[[85,150],[150,250],[250,400],[400,600],[600,1e3]];this.barHeights=this.barHeights||new Array(d).fill(0);const y=()=>{o.getByteFrequencyData(c),this.audioVisBars.forEach((A,S)=>{const[M,R]=g[S],O=Math.floor(M/(this.audioPlayer.audioContext.sampleRate/o.fftSize)),B=Math.ceil(R/(this.audioPlayer.audioContext.sampleRate/o.fftSize));let G=0;for(let it=O;it<=B&&it<c.length;it++)c[it]>G&&(G=c[it]);let at=G/255*80;this.barHeights[S]+=(at-this.barHeights[S])*.4,this.barHeights[S]+=(Math.random()-.5)*2,this.barHeights[S]=Math.max(5,Math.min(100,this.barHeights[S])),A.animate([{height:A.style.height},{height:`${this.barHeights[S]}%`}],{duration:30,fill:"forwards",easing:"linear"})}),requestAnimationFrame(y)};y()},startDotVisualizer(){if(!this.audioRecorder||!this.audioVisDotWrap)return;const o=this.audioRecorder.audioContext.createAnalyser();o.fftSize=256;const l=o.frequencyBinCount,c=new Uint8Array(l);this.audioRecorder.getMediaStreamSource().connect(o);const d=this.audioVisDotWrap.querySelector(".lqd-audio-vis-dot");if(!d)return;const g=()=>{o.getByteFrequencyData(c);let y=0;for(let M=0;M<l;M++)y+=c[M];const A=1+y/l/256*1.5,S=Math.max(.2,1-(A-1)/1.5);d.style.transform=`scale(${A})`,d.style.opacity=S.toFixed(2),requestAnimationFrame(g)};g()},checkBalanceRealtime(o=!1){return new Promise(l=>{$.ajax({url:"/dashboard/user/realtime/chat/checkBalanceRealtime",type:"POST",data:{onStart:o},dataType:"json",success:c=>{const d=c.status!=="success",g=c.message||"";l({shouldStop:d,errorMsg:g})},error:()=>{l({shouldStop:!0,errorMsg:"An error occurred."})}})})}}),D0=(s={})=>({prevViews:[],task:!1,currentView:"home",sidebarCollapsed:!1,modalShow:!1,activeModal:null,activeModalId:null,activeModalIdPrefix:null,currentToolsCat:"primary",tools:s.tools||[],primaryToolKeys:s.primaryToolKeys||[],showImageDetails:!1,zoomLevel:1,reachedMinZoom:!1,reachedMaxZoom:!1,newItems:[],showNotif:!1,editingImageDimensions:{width:0,height:0},painting:!1,brushSize:40,canvasCtx:null,lastUploadingImages:[],uploadingImages:[],promptLibraryShow:!1,promptFilter:"all",searchPromptStr:"",supportMultipleImageTools:["reimagine"],_busy:!1,_template:"",_prompt:"",_selectedTemplateDescription:"",_selectedPromptDescription:"",_selectedTool:"",aiModel:"",_prevEditingImage:{},_editingImage:{},get busy(){return this._busy},set busy(r){this._busy=r},get selectedTemplate(){return this._template.trim()},set selectedTemplate(r){var n;this._template=r,(n=this.$refs.promptInput)==null||n.focus()},get prompt(){return this._prompt},set prompt(r){var n;this._prompt=r.trim(),(n=this.$refs.promptInput)==null||n.focus()},get selectedTemplateDescription(){return this._selectedTemplateDescription},set selectedTemplateDescription(r){this._selectedTemplateDescription!==r&&(this._selectedTemplateDescription=r)},get selectedPromptDescription(){return this._selectedPromptDescription},set selectedPromptDescription(r){this._selectedPromptDescription!==r&&(this._selectedPromptDescription=r)},get selectedTool(){return this._selectedTool},set selectedTool(r){this.aiModel=AIModelsforTool[r],this._selectedTool!==r&&(this._selectedTool=r,this.makeCanvasEditable(this._selectedTool==="sketch_to_image"?{width:1024,height:1024}:{}),!this.selectedToolSupportMultiImagesUpload()&&this.$refs.editorFileInput.files.length&&this.clearImageInputs())},get prevEditingImage(){return this._prevEditingImage},get editingImage(){return this._editingImage},set editingImage(r){this._prevEditingImage=this._editingImage,this._editingImage=r,this.showImageDetails=!1,this.zoomLevel=1,r!=null&&r.output&&fetch(r.output).then(n=>n.blob()).then(n=>{var c,d;const o=new File([n],((d=(c=r.title)==null?void 0:c.split("."))==null?void 0:d.at(0))||"image",{type:n.type}),l=new DataTransfer;l.items.add(o),this.$refs.uploadedImageInput.files=l.files}).catch(n=>{toastr.error("Failed to load image"),console.error("Error creating file from URL:",n)})},init(){this.onViewChange=this.onViewChange.bind(this),this.onZoomLevelChange=this.onZoomLevelChange.bind(this),this.makeCanvasEditable=this.makeCanvasEditable.bind(this),this.startPainting=this.startPainting.bind(this),this.stopPainting=this.stopPainting.bind(this),this.paint=this.paint.bind(this),document.documentElement.style.scrollbarGutter="stable",this.$watch("currentView",this.onViewChange),this.$watch("zoomLevel",this.onZoomLevelChange);const r=new URLSearchParams(window.location.search);if(r.has("action")){const n=r.get("action");["merge_face","uncrop","reimagine","remove_background","cleanup","upscale","replace_background","sketch_to_image","remove_text","inpainting","style_transfer","image_relight"].includes(n)&&(this.currentView="editor",this.switchToolsCat({toolKey:n}),this.selectedTool=n)}},switchView(r){if(r==="<"){this.currentView=this.prevViews.pop()||"home";return}this.prevViews.push(this.currentView),this.currentView=r||"home"},switchSidebarCollapsed(r){if(r!=null){this.sidebarCollapsed=r;return}this.sidebarCollapsed=!this.sidebarCollapsed,this.$nextTick(()=>{this.zoomLevel>1&&this.fitToScreen()}),this.$refs.imageEditorSidebar.addEventListener("transitionend",n=>{n.target!==this.$refs.imageEditorSidebar&&n.propertyName!=="transform"||this.reachedMaxZoom&&this.fitToScreen()})},onViewChange(r){const n=r==="editor";document.documentElement.style.overflow=n?"hidden":""},setActiveModal(r,n="modal"){this.activeModal=r,this.activeModalId=r.id,this.activeModalIdPrefix=n},prevImageModal(){const r=document.querySelector(`.image-result[data-id='${this.activeModalId}'][data-id-prefix=${this.activeModalIdPrefix}]`),n=r==null?void 0:r.previousElementSibling;if(!n)return;const o=JSON.parse(n.getAttribute("data-payload")||{});this.setActiveModal(o,r.getAttribute("data-id-prefix"))},nextImageModal(){const r=document.querySelector(`.image-result[data-id='${this.activeModalId}'][data-id-prefix=${this.activeModalIdPrefix}]`),n=r==null?void 0:r.nextElementSibling;if(!n)return;const o=JSON.parse(n.getAttribute("data-payload")||{});this.setActiveModal(o,r.getAttribute("data-id-prefix"))},getSelectedToolCat(){return this.getToolCat(this.selectedTool)},switchToolsCat(r={}){if(r.cat)return this.currentToolsCat=r.cat;if(r.toolKey)return this.currentToolsCat=this.getToolCat(r.toolKey);if(!r.cat&&!r.toolKey)return this.currentToolsCat=this.currentToolsCat==="primary"?"secondary":"primary"},getToolCat(r){return this.primaryToolKeys.findIndex(n=>n===r)>=0?"primary":"secondary"},selectedToolSupportMultiImagesUpload(){return this.supportMultipleImageTools.includes(this.selectedTool)&&this.aiModel==="openai"},handleDragOver(){this.$refs.dropArea.classList.add("drag-over")},handleDragLeave(){this.$refs.dropArea.classList.remove("drag-over")},handleUploadingMultiImages(r){if(!this.selectedToolSupportMultiImagesUpload())return;const n=Array.from(r),o=Array.from(this.lastUploadingImages),l=new DataTransfer;return o.forEach(c=>{l.items.add(c)}),n.forEach(c=>{if(!c.type.startsWith("image/")){toastr.error("Please upload a valid image file."),this.clearImageInputs();return}o.findIndex(d=>d.name===c.name&&d.size===c.size)===-1&&l.items.add(c)}),this.$refs.editorFileInput.files=l.files,this.$refs.uploadedImageInput.files=l.files,this.lastUploadingImages=l.files,this.uploadingImages=Array.from(l.files).map(c=>({src:URL.createObjectURL(c),name:c.name})),l.files},handleFileChange(r){var o;let n=r.dataTransfer?r.dataTransfer.files:(o=r.target)==null?void 0:o.files;if(this.$refs.dropArea.classList.remove("drag-over"),!!n){if(r.dataTransfer&&(this.$refs.editorFileInput.files=n),n&&!n.length){this.handleUploadingMultiImages(this.lastUploadingImages);return}this.selectedToolSupportMultiImagesUpload()&&(n=this.handleUploadingMultiImages(n)),this.handleFiles(n)}},handleFiles(r){if(!r[0])return;this.selectedToolSupportMultiImagesUpload()||(this.editingImage={output:URL.createObjectURL(r[0]),name:r[0].name});const n=new FormData;n.append("image",r[0]),n.append("reimagine",r[0]),["reimagine"].includes(this.selectedTool)&&(this.$refs.promptInput&&(this.$refs.promptInput.disabled=!0,this.$refs.promptInput.placeholder="Analyzing image... Please wait..."),fetch("/dashboard/user/image-to-prompt",{method:"POST",headers:{"X-CSRF-TOKEN":"{{ csrf_token() }}"},body:n}).then(o=>o.json()).then(o=>{o.status==="success"?this.prompt=o.prompt:toastr.error(o.prompt)}).catch(o=>{console.log("Error:",o)}).finally(()=>{this.$refs.promptInput&&(this.$refs.promptInput.disabled=!1,this.$refs.promptInput.placeholder="Describe your idea or select a pre-defined prompt")}))},resetUploadedImageInput(){this.zoomLevel=1,this.clearImageInputs(),this.selectedTool==="sketch_to_image"&&this.makeCanvasEditable({width:1024,height:1024})},clearImageInputs(){this.lastUploadingImages=[],this.uploadingImages=[],this.editingImage={},this.$refs.editorFileInput.value="",this.$refs.uploadedImageInput.value=""},downloadImage(r,n){const o=document.createElement("a");o.href=r,o.download=n?n.replaceAll(" ","-"):"image",o.click(),o.remove()},getMaxZoom(){const r=this.$refs.editorCanvas,n=r.offsetWidth,o=window.getComputedStyle(r);return 1+(parseFloat(o.marginLeft)+parseFloat(o.marginRight)-20)/n},setZoomLevel(r){const n=this.getMaxZoom();this.zoomLevel=Math.max(.1,Math.min(n,r)),this.reachedMinZoom=this.zoomLevel===.1,this.reachedMaxZoom=this.zoomLevel>=n},zoomIn(){this.setZoomLevel(this.zoomLevel+.1)},zoomOut(){this.setZoomLevel(this.zoomLevel-.1)},fitToScreen(){const r=this.getMaxZoom();this.setZoomLevel(r)},onZoomLevelChange(){const r=this.$refs.editorCanvas;r.style.setProperty("--zoom-level",this.zoomLevel.toFixed(3)),r.style.setProperty("--zoom-offset","0px");const n=window.getComputedStyle(r),o=parseFloat(n.getPropertyValue("--header-h")),c=r.getBoundingClientRect().top+this.$refs.editorCanvasWrap.scrollTop;c<o&&r.style.setProperty("--zoom-offset",`${(c>=0?o-c:o+Math.abs(c)).toFixed(0)}px`)},submitEditorForm(r){this.busy=!0,console.log(r.target);const n=new FormData(r.target);fetch(r.target.action,{method:"POST",body:n,headers:{Accept:"application/json"}}).then(o=>o.ok?o.json():o.json().then(l=>{throw new Error(l.message||"An unknown error occurred")})).then(o=>{var l,c;if(o.type==="error"){toastr.error(o.message);return}if(((l=o==null?void 0:o.data)==null?void 0:l.status)==="CREATED"||((c=o==null?void 0:o.data)==null?void 0:c.status)==="IN_PROGRESS")this.task=!0,this.getStatus(o.data);else{this.editingImage=o.data,this.newItems.push(o.data),this.showNotif=!0,this.uploadingImages=[],this.selectedTool==="sketch_to_image"&&(this.switchToolsCat({toolKey:this.primaryToolKeys[0]}),this.selectedTool=this.primaryToolKeys[0]);const d=setTimeout(()=>{this.showNotif=!1,clearTimeout(d)},3e3)}}).catch(o=>{console.log(o),toastr.error(o)}).finally(()=>{this.task||(this.busy=!1)})},async getStatus(r={}){this.busy=!0,fetch("/dashboard/user/advanced-image/editor/"+r.id+"/status",{method:"GET",headers:{Accept:"application/json"}}).then(n=>n.ok?n.json():n.json().then(o=>{throw new Error(o.message||"An unknown error occurred")})).then(n=>{if(n.status==="error")throw new Error(n.message);if(n.data.status==="COMPLETED"){this.task=!1,this.editingImage=n.data,this.newItems.push(n.data),this.showNotif=!0;const o=setTimeout(()=>{this.showNotif=!1,clearTimeout(o)},3e3);this.busy=!1}else setTimeout(()=>{this.getStatus(n.data)},1e3)}).catch(n=>{toastr.error(n)})},async makeCanvasEditable(r={}){var o;this.editingImageDimensions={width:r.width||this.$refs.editorImagePreview.naturalWidth,height:r.height||this.$refs.editorImagePreview.naturalHeight},await this.$nextTick();const n=this.$refs.editorMaskCanvas;(o=this.canvasCtx)==null||o.reset(),this.canvasCtx=n.getContext("2d"),this.canvasCtx.fillStyle="black",this.canvasCtx.fillRect(0,0,n.width,n.height)},startPainting(r){this.painting=!0,this.painted=!1,this.paint(r)},stopPainting(){if(!this.painted)return;this.painting=!1,this.canvasCtx.beginPath();const r=this.$refs.editorMaskCanvas,n=document.createElement("canvas");n.width=this.editingImageDimensions.width,n.height=this.editingImageDimensions.height,n.getContext("2d").drawImage(r,0,0,n.width,n.height),n.toBlob(l=>{const c=new File([l],"mask.png",{type:"image/png"}),d=new DataTransfer;d.items.add(c),this.$refs[this.selectedTool==="sketch_to_image"?"sketchFileInput":"maskFileInput"].files=d.files,n.remove()},"image/png"),this.painted=!1},paint(r){if(!this.painting)return;const n=this.$refs.editorMaskCanvas,o=n.getBoundingClientRect(),l=(r.clientX-o.left)*(n.width/o.width),c=(r.clientY-o.top)*(n.height/o.height);this.canvasCtx.lineWidth=this.brushSize,this.canvasCtx.opacityTo=7,this.canvasCtx.lineCap="round",this.canvasCtx.strokeStyle="yellow",this.canvasCtx.lineTo(l,c),this.canvasCtx.stroke(),this.canvasCtx.beginPath(),this.canvasCtx.moveTo(l,c),this.painted=!0},setBrushSize(r){r==="-"?r=Math.max(this.brushSize-10,10):r==="+"&&(r=Math.min(this.brushSize+10,100)),this.brushSize=parseInt(r,10)},togglePromptLibraryShow(){this.promptLibraryShow=!this.promptLibraryShow},changePromptFilter(r){r!==this.promptFilter&&(this.promptFilter=r)},setSearchPromptStr(r){this.searchPromptStr=r.trim().toLowerCase()},setPrompt(r){this.prompt=r},focusOnPrompt(){this.$nextTick(()=>this.$refs.promptInput.focus())}});var yi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ny(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var pr={exports:{}};/** * @license * Lodash <https://lodash.com/> * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> * Released under MIT license <https://lodash.com/license> * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */var L0=pr.exports,fu;function O0(){return fu||(fu=1,function(s,r){(function(){var n,o="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",g="Invalid `variable` option passed into `_.template`",y="__lodash_hash_undefined__",v=500,A="__lodash_placeholder__",S=1,M=2,R=4,O=1,B=2,G=1,at=2,it=4,lt=8,pt=16,At=32,It=64,Ct=128,Kt=256,Et=512,Pe=30,oe="...",Re=800,Yt=16,se=1,De=2,Ot=3,Mt=1/0,ae=9007199254740991,Ri=17976931348623157e292,Un=NaN,Xt=4294967295,Di=Xt-1,Ou=Xt>>>1,Fu=[["ary",Ct],["bind",G],["bindKey",at],["curry",lt],["curryRight",pt],["flip",Et],["partial",At],["partialRight",It],["rearg",Kt]],yn="[object Arguments]",Sr="[object Array]",Bu="[object AsyncFunction]",Hn="[object Boolean]",zn="[object Date]",ku="[object DOMException]",Ar="[object Error]",Cr="[object Function]",Ss="[object GeneratorFunction]",ve="[object Map]",Vn="[object Number]",Wu="[object Null]",Le="[object Object]",As="[object Promise]",qu="[object Proxy]",Gn="[object RegExp]",ye="[object Set]",Kn="[object String]",Er="[object Symbol]",Nu="[object Undefined]",Yn="[object WeakMap]",$u="[object WeakSet]",Xn="[object ArrayBuffer]",_n="[object DataView]",Li="[object Float32Array]",Oi="[object Float64Array]",Fi="[object Int8Array]",Bi="[object Int16Array]",ki="[object Int32Array]",Wi="[object Uint8Array]",qi="[object Uint8ClampedArray]",Ni="[object Uint16Array]",$i="[object Uint32Array]",Uu=/\b__p \+= '';/g,Hu=/\b(__p \+=) '' \+/g,zu=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Cs=/&(?:amp|lt|gt|quot|#39);/g,Es=/[&<>"']/g,Vu=RegExp(Cs.source),Gu=RegExp(Es.source),Ku=/<%-([\s\S]+?)%>/g,Yu=/<%([\s\S]+?)%>/g,xs=/<%=([\s\S]+?)%>/g,Xu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Zu=/^\w*$/,Qu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ui=/[\\^$.*+?()[\]{}|]/g,Ju=RegExp(Ui.source),Hi=/^\s+/,ju=/\s/,tc=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ec=/\{\n\/\* \[wrapped with (.+)\] \*/,nc=/,? & /,rc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ic=/[()=,{}\[\]\/\s]/,oc=/\\(\\)?/g,sc=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ts=/\w*$/,ac=/^[-+]0x[0-9a-f]+$/i,lc=/^0b[01]+$/i,uc=/^\[object .+?Constructor\]$/,cc=/^0o[0-7]+$/i,fc=/^(?:0|[1-9]\d*)$/,hc=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,xr=/($^)/,dc=/['\n\r\u2028\u2029\\]/g,Tr="\\ud800-\\udfff",pc="\\u0300-\\u036f",gc="\\ufe20-\\ufe2f",mc="\\u20d0-\\u20ff",Is=pc+gc+mc,Ms="\\u2700-\\u27bf",Ps="a-z\\xdf-\\xf6\\xf8-\\xff",vc="\\xac\\xb1\\xd7\\xf7",yc="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",_c="\\u2000-\\u206f",bc=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Rs="A-Z\\xc0-\\xd6\\xd8-\\xde",Ds="\\ufe0e\\ufe0f",Ls=vc+yc+_c+bc,zi="['’]",wc="["+Tr+"]",Os="["+Ls+"]",Ir="["+Is+"]",Fs="\\d+",Sc="["+Ms+"]",Bs="["+Ps+"]",ks="[^"+Tr+Ls+Fs+Ms+Ps+Rs+"]",Vi="\\ud83c[\\udffb-\\udfff]",Ac="(?:"+Ir+"|"+Vi+")",Ws="[^"+Tr+"]",Gi="(?:\\ud83c[\\udde6-\\uddff]){2}",Ki="[\\ud800-\\udbff][\\udc00-\\udfff]",bn="["+Rs+"]",qs="\\u200d",Ns="(?:"+Bs+"|"+ks+")",Cc="(?:"+bn+"|"+ks+")",$s="(?:"+zi+"(?:d|ll|m|re|s|t|ve))?",Us="(?:"+zi+"(?:D|LL|M|RE|S|T|VE))?",Hs=Ac+"?",zs="["+Ds+"]?",Ec="(?:"+qs+"(?:"+[Ws,Gi,Ki].join("|")+")"+zs+Hs+")*",xc="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Tc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Vs=zs+Hs+Ec,Ic="(?:"+[Sc,Gi,Ki].join("|")+")"+Vs,Mc="(?:"+[Ws+Ir+"?",Ir,Gi,Ki,wc].join("|")+")",Pc=RegExp(zi,"g"),Rc=RegExp(Ir,"g"),Yi=RegExp(Vi+"(?="+Vi+")|"+Mc+Vs,"g"),Dc=RegExp([bn+"?"+Bs+"+"+$s+"(?="+[Os,bn,"$"].join("|")+")",Cc+"+"+Us+"(?="+[Os,bn+Ns,"$"].join("|")+")",bn+"?"+Ns+"+"+$s,bn+"+"+Us,Tc,xc,Fs,Ic].join("|"),"g"),Lc=RegExp("["+qs+Tr+Is+Ds+"]"),Oc=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Bc=-1,ft={};ft[Li]=ft[Oi]=ft[Fi]=ft[Bi]=ft[ki]=ft[Wi]=ft[qi]=ft[Ni]=ft[$i]=!0,ft[yn]=ft[Sr]=ft[Xn]=ft[Hn]=ft[_n]=ft[zn]=ft[Ar]=ft[Cr]=ft[ve]=ft[Vn]=ft[Le]=ft[Gn]=ft[ye]=ft[Kn]=ft[Yn]=!1;var ct={};ct[yn]=ct[Sr]=ct[Xn]=ct[_n]=ct[Hn]=ct[zn]=ct[Li]=ct[Oi]=ct[Fi]=ct[Bi]=ct[ki]=ct[ve]=ct[Vn]=ct[Le]=ct[Gn]=ct[ye]=ct[Kn]=ct[Er]=ct[Wi]=ct[qi]=ct[Ni]=ct[$i]=!0,ct[Ar]=ct[Cr]=ct[Yn]=!1;var kc={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Wc={"&":"&","<":"<",">":">",'"':""","'":"'"},qc={"&":"&","<":"<",">":">",""":'"',"'":"'"},Nc={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},$c=parseFloat,Uc=parseInt,Gs=typeof yi=="object"&&yi&&yi.Object===Object&&yi,Hc=typeof self=="object"&&self&&self.Object===Object&&self,Rt=Gs||Hc||Function("return this")(),Xi=r&&!r.nodeType&&r,on=Xi&&!0&&s&&!s.nodeType&&s,Ks=on&&on.exports===Xi,Zi=Ks&&Gs.process,le=function(){try{var b=on&&on.require&&on.require("util").types;return b||Zi&&Zi.binding&&Zi.binding("util")}catch{}}(),Ys=le&&le.isArrayBuffer,Xs=le&&le.isDate,Zs=le&&le.isMap,Qs=le&&le.isRegExp,Js=le&&le.isSet,js=le&&le.isTypedArray;function Zt(b,E,C){switch(C.length){case 0:return b.call(E);case 1:return b.call(E,C[0]);case 2:return b.call(E,C[0],C[1]);case 3:return b.call(E,C[0],C[1],C[2])}return b.apply(E,C)}function zc(b,E,C,L){for(var z=-1,et=b==null?0:b.length;++z<et;){var xt=b[z];E(L,xt,C(xt),b)}return L}function ue(b,E){for(var C=-1,L=b==null?0:b.length;++C<L&&E(b[C],C,b)!==!1;);return b}function Vc(b,E){for(var C=b==null?0:b.length;C--&&E(b[C],C,b)!==!1;);return b}function ta(b,E){for(var C=-1,L=b==null?0:b.length;++C<L;)if(!E(b[C],C,b))return!1;return!0}function Ge(b,E){for(var C=-1,L=b==null?0:b.length,z=0,et=[];++C<L;){var xt=b[C];E(xt,C,b)&&(et[z++]=xt)}return et}function Mr(b,E){var C=b==null?0:b.length;return!!C&&wn(b,E,0)>-1}function Qi(b,E,C){for(var L=-1,z=b==null?0:b.length;++L<z;)if(C(E,b[L]))return!0;return!1}function ht(b,E){for(var C=-1,L=b==null?0:b.length,z=Array(L);++C<L;)z[C]=E(b[C],C,b);return z}function Ke(b,E){for(var C=-1,L=E.length,z=b.length;++C<L;)b[z+C]=E[C];return b}function Ji(b,E,C,L){var z=-1,et=b==null?0:b.length;for(L&&et&&(C=b[++z]);++z<et;)C=E(C,b[z],z,b);return C}function Gc(b,E,C,L){var z=b==null?0:b.length;for(L&&z&&(C=b[--z]);z--;)C=E(C,b[z],z,b);return C}function ji(b,E){for(var C=-1,L=b==null?0:b.length;++C<L;)if(E(b[C],C,b))return!0;return!1}var Kc=to("length");function Yc(b){return b.split("")}function Xc(b){return b.match(rc)||[]}function ea(b,E,C){var L;return C(b,function(z,et,xt){if(E(z,et,xt))return L=et,!1}),L}function Pr(b,E,C,L){for(var z=b.length,et=C+(L?1:-1);L?et--:++et<z;)if(E(b[et],et,b))return et;return-1}function wn(b,E,C){return E===E?lf(b,E,C):Pr(b,na,C)}function Zc(b,E,C,L){for(var z=C-1,et=b.length;++z<et;)if(L(b[z],E))return z;return-1}function na(b){return b!==b}function ra(b,E){var C=b==null?0:b.length;return C?no(b,E)/C:Un}function to(b){return function(E){return E==null?n:E[b]}}function eo(b){return function(E){return b==null?n:b[E]}}function ia(b,E,C,L,z){return z(b,function(et,xt,ut){C=L?(L=!1,et):E(C,et,xt,ut)}),C}function Qc(b,E){var C=b.length;for(b.sort(E);C--;)b[C]=b[C].value;return b}function no(b,E){for(var C,L=-1,z=b.length;++L<z;){var et=E(b[L]);et!==n&&(C=C===n?et:C+et)}return C}function ro(b,E){for(var C=-1,L=Array(b);++C<b;)L[C]=E(C);return L}function Jc(b,E){return ht(E,function(C){return[C,b[C]]})}function oa(b){return b&&b.slice(0,ua(b)+1).replace(Hi,"")}function Qt(b){return function(E){return b(E)}}function io(b,E){return ht(E,function(C){return b[C]})}function Zn(b,E){return b.has(E)}function sa(b,E){for(var C=-1,L=b.length;++C<L&&wn(E,b[C],0)>-1;);return C}function aa(b,E){for(var C=b.length;C--&&wn(E,b[C],0)>-1;);return C}function jc(b,E){for(var C=b.length,L=0;C--;)b[C]===E&&++L;return L}var tf=eo(kc),ef=eo(Wc);function nf(b){return"\\"+Nc[b]}function rf(b,E){return b==null?n:b[E]}function Sn(b){return Lc.test(b)}function of(b){return Oc.test(b)}function sf(b){for(var E,C=[];!(E=b.next()).done;)C.push(E.value);return C}function oo(b){var E=-1,C=Array(b.size);return b.forEach(function(L,z){C[++E]=[z,L]}),C}function la(b,E){return function(C){return b(E(C))}}function Ye(b,E){for(var C=-1,L=b.length,z=0,et=[];++C<L;){var xt=b[C];(xt===E||xt===A)&&(b[C]=A,et[z++]=C)}return et}function Rr(b){var E=-1,C=Array(b.size);return b.forEach(function(L){C[++E]=L}),C}function af(b){var E=-1,C=Array(b.size);return b.forEach(function(L){C[++E]=[L,L]}),C}function lf(b,E,C){for(var L=C-1,z=b.length;++L<z;)if(b[L]===E)return L;return-1}function uf(b,E,C){for(var L=C+1;L--;)if(b[L]===E)return L;return L}function An(b){return Sn(b)?ff(b):Kc(b)}function _e(b){return Sn(b)?hf(b):Yc(b)}function ua(b){for(var E=b.length;E--&&ju.test(b.charAt(E)););return E}var cf=eo(qc);function ff(b){for(var E=Yi.lastIndex=0;Yi.test(b);)++E;return E}function hf(b){return b.match(Yi)||[]}function df(b){return b.match(Dc)||[]}var pf=function b(E){E=E==null?Rt:Cn.defaults(Rt.Object(),E,Cn.pick(Rt,Fc));var C=E.Array,L=E.Date,z=E.Error,et=E.Function,xt=E.Math,ut=E.Object,so=E.RegExp,gf=E.String,ce=E.TypeError,Dr=C.prototype,mf=et.prototype,En=ut.prototype,Lr=E["__core-js_shared__"],Or=mf.toString,st=En.hasOwnProperty,vf=0,ca=function(){var t=/[^.]+$/.exec(Lr&&Lr.keys&&Lr.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),Fr=En.toString,yf=Or.call(ut),_f=Rt._,bf=so("^"+Or.call(st).replace(Ui,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Br=Ks?E.Buffer:n,Xe=E.Symbol,kr=E.Uint8Array,fa=Br?Br.allocUnsafe:n,Wr=la(ut.getPrototypeOf,ut),ha=ut.create,da=En.propertyIsEnumerable,qr=Dr.splice,pa=Xe?Xe.isConcatSpreadable:n,Qn=Xe?Xe.iterator:n,sn=Xe?Xe.toStringTag:n,Nr=function(){try{var t=fn(ut,"defineProperty");return t({},"",{}),t}catch{}}(),wf=E.clearTimeout!==Rt.clearTimeout&&E.clearTimeout,Sf=L&&L.now!==Rt.Date.now&&L.now,Af=E.setTimeout!==Rt.setTimeout&&E.setTimeout,$r=xt.ceil,Ur=xt.floor,ao=ut.getOwnPropertySymbols,Cf=Br?Br.isBuffer:n,ga=E.isFinite,Ef=Dr.join,xf=la(ut.keys,ut),Tt=xt.max,Ft=xt.min,Tf=L.now,If=E.parseInt,ma=xt.random,Mf=Dr.reverse,lo=fn(E,"DataView"),Jn=fn(E,"Map"),uo=fn(E,"Promise"),xn=fn(E,"Set"),jn=fn(E,"WeakMap"),tr=fn(ut,"create"),Hr=jn&&new jn,Tn={},Pf=hn(lo),Rf=hn(Jn),Df=hn(uo),Lf=hn(xn),Of=hn(jn),zr=Xe?Xe.prototype:n,er=zr?zr.valueOf:n,va=zr?zr.toString:n;function f(t){if(vt(t)&&!K(t)&&!(t instanceof J)){if(t instanceof fe)return t;if(st.call(t,"__wrapped__"))return yl(t)}return new fe(t)}var In=function(){function t(){}return function(e){if(!gt(e))return{};if(ha)return ha(e);t.prototype=e;var i=new t;return t.prototype=n,i}}();function Vr(){}function fe(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=n}f.templateSettings={escape:Ku,evaluate:Yu,interpolate:xs,variable:"",imports:{_:f}},f.prototype=Vr.prototype,f.prototype.constructor=f,fe.prototype=In(Vr.prototype),fe.prototype.constructor=fe;function J(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Xt,this.__views__=[]}function Ff(){var t=new J(this.__wrapped__);return t.__actions__=Ut(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=Ut(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=Ut(this.__views__),t}function Bf(){if(this.__filtered__){var t=new J(this);t.__dir__=-1,t.__filtered__=!0}else t=this.clone(),t.__dir__*=-1;return t}function kf(){var t=this.__wrapped__.value(),e=this.__dir__,i=K(t),a=e<0,u=i?t.length:0,h=Xh(0,u,this.__views__),p=h.start,m=h.end,w=m-p,x=a?m:p-1,T=this.__iteratees__,I=T.length,D=0,F=Ft(w,this.__takeCount__);if(!i||!a&&u==w&&F==w)return $a(t,this.__actions__);var W=[];t:for(;w--&&D<F;){x+=e;for(var X=-1,q=t[x];++X<I;){var Q=T[X],j=Q.iteratee,te=Q.type,Nt=j(q);if(te==De)q=Nt;else if(!Nt){if(te==se)continue t;break t}}W[D++]=q}return W}J.prototype=In(Vr.prototype),J.prototype.constructor=J;function an(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function Wf(){this.__data__=tr?tr(null):{},this.size=0}function qf(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function Nf(t){var e=this.__data__;if(tr){var i=e[t];return i===y?n:i}return st.call(e,t)?e[t]:n}function $f(t){var e=this.__data__;return tr?e[t]!==n:st.call(e,t)}function Uf(t,e){var i=this.__data__;return this.size+=this.has(t)?0:1,i[t]=tr&&e===n?y:e,this}an.prototype.clear=Wf,an.prototype.delete=qf,an.prototype.get=Nf,an.prototype.has=$f,an.prototype.set=Uf;function Oe(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function Hf(){this.__data__=[],this.size=0}function zf(t){var e=this.__data__,i=Gr(e,t);if(i<0)return!1;var a=e.length-1;return i==a?e.pop():qr.call(e,i,1),--this.size,!0}function Vf(t){var e=this.__data__,i=Gr(e,t);return i<0?n:e[i][1]}function Gf(t){return Gr(this.__data__,t)>-1}function Kf(t,e){var i=this.__data__,a=Gr(i,t);return a<0?(++this.size,i.push([t,e])):i[a][1]=e,this}Oe.prototype.clear=Hf,Oe.prototype.delete=zf,Oe.prototype.get=Vf,Oe.prototype.has=Gf,Oe.prototype.set=Kf;function Fe(t){var e=-1,i=t==null?0:t.length;for(this.clear();++e<i;){var a=t[e];this.set(a[0],a[1])}}function Yf(){this.size=0,this.__data__={hash:new an,map:new(Jn||Oe),string:new an}}function Xf(t){var e=ii(this,t).delete(t);return this.size-=e?1:0,e}function Zf(t){return ii(this,t).get(t)}function Qf(t){return ii(this,t).has(t)}function Jf(t,e){var i=ii(this,t),a=i.size;return i.set(t,e),this.size+=i.size==a?0:1,this}Fe.prototype.clear=Yf,Fe.prototype.delete=Xf,Fe.prototype.get=Zf,Fe.prototype.has=Qf,Fe.prototype.set=Jf;function ln(t){var e=-1,i=t==null?0:t.length;for(this.__data__=new Fe;++e<i;)this.add(t[e])}function jf(t){return this.__data__.set(t,y),this}function th(t){return this.__data__.has(t)}ln.prototype.add=ln.prototype.push=jf,ln.prototype.has=th;function be(t){var e=this.__data__=new Oe(t);this.size=e.size}function eh(){this.__data__=new Oe,this.size=0}function nh(t){var e=this.__data__,i=e.delete(t);return this.size=e.size,i}function rh(t){return this.__data__.get(t)}function ih(t){return this.__data__.has(t)}function oh(t,e){var i=this.__data__;if(i instanceof Oe){var a=i.__data__;if(!Jn||a.length<l-1)return a.push([t,e]),this.size=++i.size,this;i=this.__data__=new Fe(a)}return i.set(t,e),this.size=i.size,this}be.prototype.clear=eh,be.prototype.delete=nh,be.prototype.get=rh,be.prototype.has=ih,be.prototype.set=oh;function ya(t,e){var i=K(t),a=!i&&dn(t),u=!i&&!a&&tn(t),h=!i&&!a&&!u&&Dn(t),p=i||a||u||h,m=p?ro(t.length,gf):[],w=m.length;for(var x in t)(e||st.call(t,x))&&!(p&&(x=="length"||u&&(x=="offset"||x=="parent")||h&&(x=="buffer"||x=="byteLength"||x=="byteOffset")||qe(x,w)))&&m.push(x);return m}function _a(t){var e=t.length;return e?t[wo(0,e-1)]:n}function sh(t,e){return oi(Ut(t),un(e,0,t.length))}function ah(t){return oi(Ut(t))}function co(t,e,i){(i!==n&&!we(t[e],i)||i===n&&!(e in t))&&Be(t,e,i)}function nr(t,e,i){var a=t[e];(!(st.call(t,e)&&we(a,i))||i===n&&!(e in t))&&Be(t,e,i)}function Gr(t,e){for(var i=t.length;i--;)if(we(t[i][0],e))return i;return-1}function lh(t,e,i,a){return Ze(t,function(u,h,p){e(a,u,i(u),p)}),a}function ba(t,e){return t&&xe(e,Pt(e),t)}function uh(t,e){return t&&xe(e,zt(e),t)}function Be(t,e,i){e=="__proto__"&&Nr?Nr(t,e,{configurable:!0,enumerable:!0,value:i,writable:!0}):t[e]=i}function fo(t,e){for(var i=-1,a=e.length,u=C(a),h=t==null;++i<a;)u[i]=h?n:Go(t,e[i]);return u}function un(t,e,i){return t===t&&(i!==n&&(t=t<=i?t:i),e!==n&&(t=t>=e?t:e)),t}function he(t,e,i,a,u,h){var p,m=e&S,w=e&M,x=e&R;if(i&&(p=u?i(t,a,u,h):i(t)),p!==n)return p;if(!gt(t))return t;var T=K(t);if(T){if(p=Qh(t),!m)return Ut(t,p)}else{var I=Bt(t),D=I==Cr||I==Ss;if(tn(t))return za(t,m);if(I==Le||I==yn||D&&!u){if(p=w||D?{}:ul(t),!m)return w?Nh(t,uh(p,t)):qh(t,ba(p,t))}else{if(!ct[I])return u?t:{};p=Jh(t,I,m)}}h||(h=new be);var F=h.get(t);if(F)return F;h.set(t,p),Wl(t)?t.forEach(function(q){p.add(he(q,e,i,q,t,h))}):Bl(t)&&t.forEach(function(q,Q){p.set(Q,he(q,e,i,Q,t,h))});var W=x?w?Do:Ro:w?zt:Pt,X=T?n:W(t);return ue(X||t,function(q,Q){X&&(Q=q,q=t[Q]),nr(p,Q,he(q,e,i,Q,t,h))}),p}function ch(t){var e=Pt(t);return function(i){return wa(i,t,e)}}function wa(t,e,i){var a=i.length;if(t==null)return!a;for(t=ut(t);a--;){var u=i[a],h=e[u],p=t[u];if(p===n&&!(u in t)||!h(p))return!1}return!0}function Sa(t,e,i){if(typeof t!="function")throw new ce(d);return ur(function(){t.apply(n,i)},e)}function rr(t,e,i,a){var u=-1,h=Mr,p=!0,m=t.length,w=[],x=e.length;if(!m)return w;i&&(e=ht(e,Qt(i))),a?(h=Qi,p=!1):e.length>=l&&(h=Zn,p=!1,e=new ln(e));t:for(;++u<m;){var T=t[u],I=i==null?T:i(T);if(T=a||T!==0?T:0,p&&I===I){for(var D=x;D--;)if(e[D]===I)continue t;w.push(T)}else h(e,I,a)||w.push(T)}return w}var Ze=Xa(Ee),Aa=Xa(po,!0);function fh(t,e){var i=!0;return Ze(t,function(a,u,h){return i=!!e(a,u,h),i}),i}function Kr(t,e,i){for(var a=-1,u=t.length;++a<u;){var h=t[a],p=e(h);if(p!=null&&(m===n?p===p&&!jt(p):i(p,m)))var m=p,w=h}return w}function hh(t,e,i,a){var u=t.length;for(i=Y(i),i<0&&(i=-i>u?0:u+i),a=a===n||a>u?u:Y(a),a<0&&(a+=u),a=i>a?0:Nl(a);i<a;)t[i++]=e;return t}function Ca(t,e){var i=[];return Ze(t,function(a,u,h){e(a,u,h)&&i.push(a)}),i}function Dt(t,e,i,a,u){var h=-1,p=t.length;for(i||(i=td),u||(u=[]);++h<p;){var m=t[h];e>0&&i(m)?e>1?Dt(m,e-1,i,a,u):Ke(u,m):a||(u[u.length]=m)}return u}var ho=Za(),Ea=Za(!0);function Ee(t,e){return t&&ho(t,e,Pt)}function po(t,e){return t&&Ea(t,e,Pt)}function Yr(t,e){return Ge(e,function(i){return Ne(t[i])})}function cn(t,e){e=Je(e,t);for(var i=0,a=e.length;t!=null&&i<a;)t=t[Te(e[i++])];return i&&i==a?t:n}function xa(t,e,i){var a=e(t);return K(t)?a:Ke(a,i(t))}function Wt(t){return t==null?t===n?Nu:Wu:sn&&sn in ut(t)?Yh(t):ad(t)}function go(t,e){return t>e}function dh(t,e){return t!=null&&st.call(t,e)}function ph(t,e){return t!=null&&e in ut(t)}function gh(t,e,i){return t>=Ft(e,i)&&t<Tt(e,i)}function mo(t,e,i){for(var a=i?Qi:Mr,u=t[0].length,h=t.length,p=h,m=C(h),w=1/0,x=[];p--;){var T=t[p];p&&e&&(T=ht(T,Qt(e))),w=Ft(T.length,w),m[p]=!i&&(e||u>=120&&T.length>=120)?new ln(p&&T):n}T=t[0];var I=-1,D=m[0];t:for(;++I<u&&x.length<w;){var F=T[I],W=e?e(F):F;if(F=i||F!==0?F:0,!(D?Zn(D,W):a(x,W,i))){for(p=h;--p;){var X=m[p];if(!(X?Zn(X,W):a(t[p],W,i)))continue t}D&&D.push(W),x.push(F)}}return x}function mh(t,e,i,a){return Ee(t,function(u,h,p){e(a,i(u),h,p)}),a}function ir(t,e,i){e=Je(e,t),t=dl(t,e);var a=t==null?t:t[Te(pe(e))];return a==null?n:Zt(a,t,i)}function Ta(t){return vt(t)&&Wt(t)==yn}function vh(t){return vt(t)&&Wt(t)==Xn}function yh(t){return vt(t)&&Wt(t)==zn}function or(t,e,i,a,u){return t===e?!0:t==null||e==null||!vt(t)&&!vt(e)?t!==t&&e!==e:_h(t,e,i,a,or,u)}function _h(t,e,i,a,u,h){var p=K(t),m=K(e),w=p?Sr:Bt(t),x=m?Sr:Bt(e);w=w==yn?Le:w,x=x==yn?Le:x;var T=w==Le,I=x==Le,D=w==x;if(D&&tn(t)){if(!tn(e))return!1;p=!0,T=!1}if(D&&!T)return h||(h=new be),p||Dn(t)?sl(t,e,i,a,u,h):Gh(t,e,w,i,a,u,h);if(!(i&O)){var F=T&&st.call(t,"__wrapped__"),W=I&&st.call(e,"__wrapped__");if(F||W){var X=F?t.value():t,q=W?e.value():e;return h||(h=new be),u(X,q,i,a,h)}}return D?(h||(h=new be),Kh(t,e,i,a,u,h)):!1}function bh(t){return vt(t)&&Bt(t)==ve}function vo(t,e,i,a){var u=i.length,h=u,p=!a;if(t==null)return!h;for(t=ut(t);u--;){var m=i[u];if(p&&m[2]?m[1]!==t[m[0]]:!(m[0]in t))return!1}for(;++u<h;){m=i[u];var w=m[0],x=t[w],T=m[1];if(p&&m[2]){if(x===n&&!(w in t))return!1}else{var I=new be;if(a)var D=a(x,T,w,t,e,I);if(!(D===n?or(T,x,O|B,a,I):D))return!1}}return!0}function Ia(t){if(!gt(t)||nd(t))return!1;var e=Ne(t)?bf:uc;return e.test(hn(t))}function wh(t){return vt(t)&&Wt(t)==Gn}function Sh(t){return vt(t)&&Bt(t)==ye}function Ah(t){return vt(t)&&fi(t.length)&&!!ft[Wt(t)]}function Ma(t){return typeof t=="function"?t:t==null?Vt:typeof t=="object"?K(t)?Da(t[0],t[1]):Ra(t):Ql(t)}function yo(t){if(!lr(t))return xf(t);var e=[];for(var i in ut(t))st.call(t,i)&&i!="constructor"&&e.push(i);return e}function Ch(t){if(!gt(t))return sd(t);var e=lr(t),i=[];for(var a in t)a=="constructor"&&(e||!st.call(t,a))||i.push(a);return i}function _o(t,e){return t<e}function Pa(t,e){var i=-1,a=Ht(t)?C(t.length):[];return Ze(t,function(u,h,p){a[++i]=e(u,h,p)}),a}function Ra(t){var e=Oo(t);return e.length==1&&e[0][2]?fl(e[0][0],e[0][1]):function(i){return i===t||vo(i,t,e)}}function Da(t,e){return Bo(t)&&cl(e)?fl(Te(t),e):function(i){var a=Go(i,t);return a===n&&a===e?Ko(i,t):or(e,a,O|B)}}function Xr(t,e,i,a,u){t!==e&&ho(e,function(h,p){if(u||(u=new be),gt(h))Eh(t,e,p,i,Xr,a,u);else{var m=a?a(Wo(t,p),h,p+"",t,e,u):n;m===n&&(m=h),co(t,p,m)}},zt)}function Eh(t,e,i,a,u,h,p){var m=Wo(t,i),w=Wo(e,i),x=p.get(w);if(x){co(t,i,x);return}var T=h?h(m,w,i+"",t,e,p):n,I=T===n;if(I){var D=K(w),F=!D&&tn(w),W=!D&&!F&&Dn(w);T=w,D||F||W?K(m)?T=m:_t(m)?T=Ut(m):F?(I=!1,T=za(w,!0)):W?(I=!1,T=Va(w,!0)):T=[]:cr(w)||dn(w)?(T=m,dn(m)?T=$l(m):(!gt(m)||Ne(m))&&(T=ul(w))):I=!1}I&&(p.set(w,T),u(T,w,a,h,p),p.delete(w)),co(t,i,T)}function La(t,e){var i=t.length;if(i)return e+=e<0?i:0,qe(e,i)?t[e]:n}function Oa(t,e,i){e.length?e=ht(e,function(h){return K(h)?function(p){return cn(p,h.length===1?h[0]:h)}:h}):e=[Vt];var a=-1;e=ht(e,Qt(k()));var u=Pa(t,function(h,p,m){var w=ht(e,function(x){return x(h)});return{criteria:w,index:++a,value:h}});return Qc(u,function(h,p){return Wh(h,p,i)})}function xh(t,e){return Fa(t,e,function(i,a){return Ko(t,a)})}function Fa(t,e,i){for(var a=-1,u=e.length,h={};++a<u;){var p=e[a],m=cn(t,p);i(m,p)&&sr(h,Je(p,t),m)}return h}function Th(t){return function(e){return cn(e,t)}}function bo(t,e,i,a){var u=a?Zc:wn,h=-1,p=e.length,m=t;for(t===e&&(e=Ut(e)),i&&(m=ht(t,Qt(i)));++h<p;)for(var w=0,x=e[h],T=i?i(x):x;(w=u(m,T,w,a))>-1;)m!==t&&qr.call(m,w,1),qr.call(t,w,1);return t}function Ba(t,e){for(var i=t?e.length:0,a=i-1;i--;){var u=e[i];if(i==a||u!==h){var h=u;qe(u)?qr.call(t,u,1):Co(t,u)}}return t}function wo(t,e){return t+Ur(ma()*(e-t+1))}function Ih(t,e,i,a){for(var u=-1,h=Tt($r((e-t)/(i||1)),0),p=C(h);h--;)p[a?h:++u]=t,t+=i;return p}function So(t,e){var i="";if(!t||e<1||e>ae)return i;do e%2&&(i+=t),e=Ur(e/2),e&&(t+=t);while(e);return i}function Z(t,e){return qo(hl(t,e,Vt),t+"")}function Mh(t){return _a(Ln(t))}function Ph(t,e){var i=Ln(t);return oi(i,un(e,0,i.length))}function sr(t,e,i,a){if(!gt(t))return t;e=Je(e,t);for(var u=-1,h=e.length,p=h-1,m=t;m!=null&&++u<h;){var w=Te(e[u]),x=i;if(w==="__proto__"||w==="constructor"||w==="prototype")return t;if(u!=p){var T=m[w];x=a?a(T,w,m):n,x===n&&(x=gt(T)?T:qe(e[u+1])?[]:{})}nr(m,w,x),m=m[w]}return t}var ka=Hr?function(t,e){return Hr.set(t,e),t}:Vt,Rh=Nr?function(t,e){return Nr(t,"toString",{configurable:!0,enumerable:!1,value:Xo(e),writable:!0})}:Vt;function Dh(t){return oi(Ln(t))}function de(t,e,i){var a=-1,u=t.length;e<0&&(e=-e>u?0:u+e),i=i>u?u:i,i<0&&(i+=u),u=e>i?0:i-e>>>0,e>>>=0;for(var h=C(u);++a<u;)h[a]=t[a+e];return h}function Lh(t,e){var i;return Ze(t,function(a,u,h){return i=e(a,u,h),!i}),!!i}function Zr(t,e,i){var a=0,u=t==null?a:t.length;if(typeof e=="number"&&e===e&&u<=Ou){for(;a<u;){var h=a+u>>>1,p=t[h];p!==null&&!jt(p)&&(i?p<=e:p<e)?a=h+1:u=h}return u}return Ao(t,e,Vt,i)}function Ao(t,e,i,a){var u=0,h=t==null?0:t.length;if(h===0)return 0;e=i(e);for(var p=e!==e,m=e===null,w=jt(e),x=e===n;u<h;){var T=Ur((u+h)/2),I=i(t[T]),D=I!==n,F=I===null,W=I===I,X=jt(I);if(p)var q=a||W;else x?q=W&&(a||D):m?q=W&&D&&(a||!F):w?q=W&&D&&!F&&(a||!X):F||X?q=!1:q=a?I<=e:I<e;q?u=T+1:h=T}return Ft(h,Di)}function Wa(t,e){for(var i=-1,a=t.length,u=0,h=[];++i<a;){var p=t[i],m=e?e(p):p;if(!i||!we(m,w)){var w=m;h[u++]=p===0?0:p}}return h}function qa(t){return typeof t=="number"?t:jt(t)?Un:+t}function Jt(t){if(typeof t=="string")return t;if(K(t))return ht(t,Jt)+"";if(jt(t))return va?va.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Qe(t,e,i){var a=-1,u=Mr,h=t.length,p=!0,m=[],w=m;if(i)p=!1,u=Qi;else if(h>=l){var x=e?null:zh(t);if(x)return Rr(x);p=!1,u=Zn,w=new ln}else w=e?[]:m;t:for(;++a<h;){var T=t[a],I=e?e(T):T;if(T=i||T!==0?T:0,p&&I===I){for(var D=w.length;D--;)if(w[D]===I)continue t;e&&w.push(I),m.push(T)}else u(w,I,i)||(w!==m&&w.push(I),m.push(T))}return m}function Co(t,e){return e=Je(e,t),t=dl(t,e),t==null||delete t[Te(pe(e))]}function Na(t,e,i,a){return sr(t,e,i(cn(t,e)),a)}function Qr(t,e,i,a){for(var u=t.length,h=a?u:-1;(a?h--:++h<u)&&e(t[h],h,t););return i?de(t,a?0:h,a?h+1:u):de(t,a?h+1:0,a?u:h)}function $a(t,e){var i=t;return i instanceof J&&(i=i.value()),Ji(e,function(a,u){return u.func.apply(u.thisArg,Ke([a],u.args))},i)}function Eo(t,e,i){var a=t.length;if(a<2)return a?Qe(t[0]):[];for(var u=-1,h=C(a);++u<a;)for(var p=t[u],m=-1;++m<a;)m!=u&&(h[u]=rr(h[u]||p,t[m],e,i));return Qe(Dt(h,1),e,i)}function Ua(t,e,i){for(var a=-1,u=t.length,h=e.length,p={};++a<u;){var m=a<h?e[a]:n;i(p,t[a],m)}return p}function xo(t){return _t(t)?t:[]}function To(t){return typeof t=="function"?t:Vt}function Je(t,e){return K(t)?t:Bo(t,e)?[t]:vl(ot(t))}var Oh=Z;function je(t,e,i){var a=t.length;return i=i===n?a:i,!e&&i>=a?t:de(t,e,i)}var Ha=wf||function(t){return Rt.clearTimeout(t)};function za(t,e){if(e)return t.slice();var i=t.length,a=fa?fa(i):new t.constructor(i);return t.copy(a),a}function Io(t){var e=new t.constructor(t.byteLength);return new kr(e).set(new kr(t)),e}function Fh(t,e){var i=e?Io(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.byteLength)}function Bh(t){var e=new t.constructor(t.source,Ts.exec(t));return e.lastIndex=t.lastIndex,e}function kh(t){return er?ut(er.call(t)):{}}function Va(t,e){var i=e?Io(t.buffer):t.buffer;return new t.constructor(i,t.byteOffset,t.length)}function Ga(t,e){if(t!==e){var i=t!==n,a=t===null,u=t===t,h=jt(t),p=e!==n,m=e===null,w=e===e,x=jt(e);if(!m&&!x&&!h&&t>e||h&&p&&w&&!m&&!x||a&&p&&w||!i&&w||!u)return 1;if(!a&&!h&&!x&&t<e||x&&i&&u&&!a&&!h||m&&i&&u||!p&&u||!w)return-1}return 0}function Wh(t,e,i){for(var a=-1,u=t.criteria,h=e.criteria,p=u.length,m=i.length;++a<p;){var w=Ga(u[a],h[a]);if(w){if(a>=m)return w;var x=i[a];return w*(x=="desc"?-1:1)}}return t.index-e.index}function Ka(t,e,i,a){for(var u=-1,h=t.length,p=i.length,m=-1,w=e.length,x=Tt(h-p,0),T=C(w+x),I=!a;++m<w;)T[m]=e[m];for(;++u<p;)(I||u<h)&&(T[i[u]]=t[u]);for(;x--;)T[m++]=t[u++];return T}function Ya(t,e,i,a){for(var u=-1,h=t.length,p=-1,m=i.length,w=-1,x=e.length,T=Tt(h-m,0),I=C(T+x),D=!a;++u<T;)I[u]=t[u];for(var F=u;++w<x;)I[F+w]=e[w];for(;++p<m;)(D||u<h)&&(I[F+i[p]]=t[u++]);return I}function Ut(t,e){var i=-1,a=t.length;for(e||(e=C(a));++i<a;)e[i]=t[i];return e}function xe(t,e,i,a){var u=!i;i||(i={});for(var h=-1,p=e.length;++h<p;){var m=e[h],w=a?a(i[m],t[m],m,i,t):n;w===n&&(w=t[m]),u?Be(i,m,w):nr(i,m,w)}return i}function qh(t,e){return xe(t,Fo(t),e)}function Nh(t,e){return xe(t,al(t),e)}function Jr(t,e){return function(i,a){var u=K(i)?zc:lh,h=e?e():{};return u(i,t,k(a,2),h)}}function Mn(t){return Z(function(e,i){var a=-1,u=i.length,h=u>1?i[u-1]:n,p=u>2?i[2]:n;for(h=t.length>3&&typeof h=="function"?(u--,h):n,p&&qt(i[0],i[1],p)&&(h=u<3?n:h,u=1),e=ut(e);++a<u;){var m=i[a];m&&t(e,m,a,h)}return e})}function Xa(t,e){return function(i,a){if(i==null)return i;if(!Ht(i))return t(i,a);for(var u=i.length,h=e?u:-1,p=ut(i);(e?h--:++h<u)&&a(p[h],h,p)!==!1;);return i}}function Za(t){return function(e,i,a){for(var u=-1,h=ut(e),p=a(e),m=p.length;m--;){var w=p[t?m:++u];if(i(h[w],w,h)===!1)break}return e}}function $h(t,e,i){var a=e&G,u=ar(t);function h(){var p=this&&this!==Rt&&this instanceof h?u:t;return p.apply(a?i:this,arguments)}return h}function Qa(t){return function(e){e=ot(e);var i=Sn(e)?_e(e):n,a=i?i[0]:e.charAt(0),u=i?je(i,1).join(""):e.slice(1);return a[t]()+u}}function Pn(t){return function(e){return Ji(Xl(Yl(e).replace(Pc,"")),t,"")}}function ar(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var i=In(t.prototype),a=t.apply(i,e);return gt(a)?a:i}}function Uh(t,e,i){var a=ar(t);function u(){for(var h=arguments.length,p=C(h),m=h,w=Rn(u);m--;)p[m]=arguments[m];var x=h<3&&p[0]!==w&&p[h-1]!==w?[]:Ye(p,w);if(h-=x.length,h<i)return nl(t,e,jr,u.placeholder,n,p,x,n,n,i-h);var T=this&&this!==Rt&&this instanceof u?a:t;return Zt(T,this,p)}return u}function Ja(t){return function(e,i,a){var u=ut(e);if(!Ht(e)){var h=k(i,3);e=Pt(e),i=function(m){return h(u[m],m,u)}}var p=t(e,i,a);return p>-1?u[h?e[p]:p]:n}}function ja(t){return We(function(e){var i=e.length,a=i,u=fe.prototype.thru;for(t&&e.reverse();a--;){var h=e[a];if(typeof h!="function")throw new ce(d);if(u&&!p&&ri(h)=="wrapper")var p=new fe([],!0)}for(a=p?a:i;++a<i;){h=e[a];var m=ri(h),w=m=="wrapper"?Lo(h):n;w&&ko(w[0])&&w[1]==(Ct|lt|At|Kt)&&!w[4].length&&w[9]==1?p=p[ri(w[0])].apply(p,w[3]):p=h.length==1&&ko(h)?p[m]():p.thru(h)}return function(){var x=arguments,T=x[0];if(p&&x.length==1&&K(T))return p.plant(T).value();for(var I=0,D=i?e[I].apply(this,x):T;++I<i;)D=e[I].call(this,D);return D}})}function jr(t,e,i,a,u,h,p,m,w,x){var T=e&Ct,I=e&G,D=e&at,F=e&(lt|pt),W=e&Et,X=D?n:ar(t);function q(){for(var Q=arguments.length,j=C(Q),te=Q;te--;)j[te]=arguments[te];if(F)var Nt=Rn(q),ee=jc(j,Nt);if(a&&(j=Ka(j,a,u,F)),h&&(j=Ya(j,h,p,F)),Q-=ee,F&&Q<x){var bt=Ye(j,Nt);return nl(t,e,jr,q.placeholder,i,j,bt,m,w,x-Q)}var Se=I?i:this,Ue=D?Se[t]:t;return Q=j.length,m?j=ld(j,m):W&&Q>1&&j.reverse(),T&&w<Q&&(j.length=w),this&&this!==Rt&&this instanceof q&&(Ue=X||ar(Ue)),Ue.apply(Se,j)}return q}function tl(t,e){return function(i,a){return mh(i,t,e(a),{})}}function ti(t,e){return function(i,a){var u;if(i===n&&a===n)return e;if(i!==n&&(u=i),a!==n){if(u===n)return a;typeof i=="string"||typeof a=="string"?(i=Jt(i),a=Jt(a)):(i=qa(i),a=qa(a)),u=t(i,a)}return u}}function Mo(t){return We(function(e){return e=ht(e,Qt(k())),Z(function(i){var a=this;return t(e,function(u){return Zt(u,a,i)})})})}function ei(t,e){e=e===n?" ":Jt(e);var i=e.length;if(i<2)return i?So(e,t):e;var a=So(e,$r(t/An(e)));return Sn(e)?je(_e(a),0,t).join(""):a.slice(0,t)}function Hh(t,e,i,a){var u=e&G,h=ar(t);function p(){for(var m=-1,w=arguments.length,x=-1,T=a.length,I=C(T+w),D=this&&this!==Rt&&this instanceof p?h:t;++x<T;)I[x]=a[x];for(;w--;)I[x++]=arguments[++m];return Zt(D,u?i:this,I)}return p}function el(t){return function(e,i,a){return a&&typeof a!="number"&&qt(e,i,a)&&(i=a=n),e=$e(e),i===n?(i=e,e=0):i=$e(i),a=a===n?e<i?1:-1:$e(a),Ih(e,i,a,t)}}function ni(t){return function(e,i){return typeof e=="string"&&typeof i=="string"||(e=ge(e),i=ge(i)),t(e,i)}}function nl(t,e,i,a,u,h,p,m,w,x){var T=e<,I=T?p:n,D=T?n:p,F=T?h:n,W=T?n:h;e|=T?At:It,e&=~(T?It:At),e&it||(e&=-4);var X=[t,e,u,F,I,W,D,m,w,x],q=i.apply(n,X);return ko(t)&&pl(q,X),q.placeholder=a,gl(q,t,e)}function Po(t){var e=xt[t];return function(i,a){if(i=ge(i),a=a==null?0:Ft(Y(a),292),a&&ga(i)){var u=(ot(i)+"e").split("e"),h=e(u[0]+"e"+(+u[1]+a));return u=(ot(h)+"e").split("e"),+(u[0]+"e"+(+u[1]-a))}return e(i)}}var zh=xn&&1/Rr(new xn([,-0]))[1]==Mt?function(t){return new xn(t)}:Jo;function rl(t){return function(e){var i=Bt(e);return i==ve?oo(e):i==ye?af(e):Jc(e,t(e))}}function ke(t,e,i,a,u,h,p,m){var w=e&at;if(!w&&typeof t!="function")throw new ce(d);var x=a?a.length:0;if(x||(e&=-97,a=u=n),p=p===n?p:Tt(Y(p),0),m=m===n?m:Y(m),x-=u?u.length:0,e&It){var T=a,I=u;a=u=n}var D=w?n:Lo(t),F=[t,e,i,a,u,T,I,h,p,m];if(D&&od(F,D),t=F[0],e=F[1],i=F[2],a=F[3],u=F[4],m=F[9]=F[9]===n?w?0:t.length:Tt(F[9]-x,0),!m&&e&(lt|pt)&&(e&=-25),!e||e==G)var W=$h(t,e,i);else e==lt||e==pt?W=Uh(t,e,m):(e==At||e==(G|At))&&!u.length?W=Hh(t,e,i,a):W=jr.apply(n,F);var X=D?ka:pl;return gl(X(W,F),t,e)}function il(t,e,i,a){return t===n||we(t,En[i])&&!st.call(a,i)?e:t}function ol(t,e,i,a,u,h){return gt(t)&>(e)&&(h.set(e,t),Xr(t,e,n,ol,h),h.delete(e)),t}function Vh(t){return cr(t)?n:t}function sl(t,e,i,a,u,h){var p=i&O,m=t.length,w=e.length;if(m!=w&&!(p&&w>m))return!1;var x=h.get(t),T=h.get(e);if(x&&T)return x==e&&T==t;var I=-1,D=!0,F=i&B?new ln:n;for(h.set(t,e),h.set(e,t);++I<m;){var W=t[I],X=e[I];if(a)var q=p?a(X,W,I,e,t,h):a(W,X,I,t,e,h);if(q!==n){if(q)continue;D=!1;break}if(F){if(!ji(e,function(Q,j){if(!Zn(F,j)&&(W===Q||u(W,Q,i,a,h)))return F.push(j)})){D=!1;break}}else if(!(W===X||u(W,X,i,a,h))){D=!1;break}}return h.delete(t),h.delete(e),D}function Gh(t,e,i,a,u,h,p){switch(i){case _n:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Xn:return!(t.byteLength!=e.byteLength||!h(new kr(t),new kr(e)));case Hn:case zn:case Vn:return we(+t,+e);case Ar:return t.name==e.name&&t.message==e.message;case Gn:case Kn:return t==e+"";case ve:var m=oo;case ye:var w=a&O;if(m||(m=Rr),t.size!=e.size&&!w)return!1;var x=p.get(t);if(x)return x==e;a|=B,p.set(t,e);var T=sl(m(t),m(e),a,u,h,p);return p.delete(t),T;case Er:if(er)return er.call(t)==er.call(e)}return!1}function Kh(t,e,i,a,u,h){var p=i&O,m=Ro(t),w=m.length,x=Ro(e),T=x.length;if(w!=T&&!p)return!1;for(var I=w;I--;){var D=m[I];if(!(p?D in e:st.call(e,D)))return!1}var F=h.get(t),W=h.get(e);if(F&&W)return F==e&&W==t;var X=!0;h.set(t,e),h.set(e,t);for(var q=p;++I<w;){D=m[I];var Q=t[D],j=e[D];if(a)var te=p?a(j,Q,D,e,t,h):a(Q,j,D,t,e,h);if(!(te===n?Q===j||u(Q,j,i,a,h):te)){X=!1;break}q||(q=D=="constructor")}if(X&&!q){var Nt=t.constructor,ee=e.constructor;Nt!=ee&&"constructor"in t&&"constructor"in e&&!(typeof Nt=="function"&&Nt instanceof Nt&&typeof ee=="function"&&ee instanceof ee)&&(X=!1)}return h.delete(t),h.delete(e),X}function We(t){return qo(hl(t,n,wl),t+"")}function Ro(t){return xa(t,Pt,Fo)}function Do(t){return xa(t,zt,al)}var Lo=Hr?function(t){return Hr.get(t)}:Jo;function ri(t){for(var e=t.name+"",i=Tn[e],a=st.call(Tn,e)?i.length:0;a--;){var u=i[a],h=u.func;if(h==null||h==t)return u.name}return e}function Rn(t){var e=st.call(f,"placeholder")?f:t;return e.placeholder}function k(){var t=f.iteratee||Zo;return t=t===Zo?Ma:t,arguments.length?t(arguments[0],arguments[1]):t}function ii(t,e){var i=t.__data__;return ed(e)?i[typeof e=="string"?"string":"hash"]:i.map}function Oo(t){for(var e=Pt(t),i=e.length;i--;){var a=e[i],u=t[a];e[i]=[a,u,cl(u)]}return e}function fn(t,e){var i=rf(t,e);return Ia(i)?i:n}function Yh(t){var e=st.call(t,sn),i=t[sn];try{t[sn]=n;var a=!0}catch{}var u=Fr.call(t);return a&&(e?t[sn]=i:delete t[sn]),u}var Fo=ao?function(t){return t==null?[]:(t=ut(t),Ge(ao(t),function(e){return da.call(t,e)}))}:jo,al=ao?function(t){for(var e=[];t;)Ke(e,Fo(t)),t=Wr(t);return e}:jo,Bt=Wt;(lo&&Bt(new lo(new ArrayBuffer(1)))!=_n||Jn&&Bt(new Jn)!=ve||uo&&Bt(uo.resolve())!=As||xn&&Bt(new xn)!=ye||jn&&Bt(new jn)!=Yn)&&(Bt=function(t){var e=Wt(t),i=e==Le?t.constructor:n,a=i?hn(i):"";if(a)switch(a){case Pf:return _n;case Rf:return ve;case Df:return As;case Lf:return ye;case Of:return Yn}return e});function Xh(t,e,i){for(var a=-1,u=i.length;++a<u;){var h=i[a],p=h.size;switch(h.type){case"drop":t+=p;break;case"dropRight":e-=p;break;case"take":e=Ft(e,t+p);break;case"takeRight":t=Tt(t,e-p);break}}return{start:t,end:e}}function Zh(t){var e=t.match(ec);return e?e[1].split(nc):[]}function ll(t,e,i){e=Je(e,t);for(var a=-1,u=e.length,h=!1;++a<u;){var p=Te(e[a]);if(!(h=t!=null&&i(t,p)))break;t=t[p]}return h||++a!=u?h:(u=t==null?0:t.length,!!u&&fi(u)&&qe(p,u)&&(K(t)||dn(t)))}function Qh(t){var e=t.length,i=new t.constructor(e);return e&&typeof t[0]=="string"&&st.call(t,"index")&&(i.index=t.index,i.input=t.input),i}function ul(t){return typeof t.constructor=="function"&&!lr(t)?In(Wr(t)):{}}function Jh(t,e,i){var a=t.constructor;switch(e){case Xn:return Io(t);case Hn:case zn:return new a(+t);case _n:return Fh(t,i);case Li:case Oi:case Fi:case Bi:case ki:case Wi:case qi:case Ni:case $i:return Va(t,i);case ve:return new a;case Vn:case Kn:return new a(t);case Gn:return Bh(t);case ye:return new a;case Er:return kh(t)}}function jh(t,e){var i=e.length;if(!i)return t;var a=i-1;return e[a]=(i>1?"& ":"")+e[a],e=e.join(i>2?", ":" "),t.replace(tc,`{ /* [wrapped with `+e+`] */ `)}function td(t){return K(t)||dn(t)||!!(pa&&t&&t[pa])}function qe(t,e){var i=typeof t;return e=e??ae,!!e&&(i=="number"||i!="symbol"&&fc.test(t))&&t>-1&&t%1==0&&t<e}function qt(t,e,i){if(!gt(i))return!1;var a=typeof e;return(a=="number"?Ht(i)&&qe(e,i.length):a=="string"&&e in i)?we(i[e],t):!1}function Bo(t,e){if(K(t))return!1;var i=typeof t;return i=="number"||i=="symbol"||i=="boolean"||t==null||jt(t)?!0:Zu.test(t)||!Xu.test(t)||e!=null&&t in ut(e)}function ed(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ko(t){var e=ri(t),i=f[e];if(typeof i!="function"||!(e in J.prototype))return!1;if(t===i)return!0;var a=Lo(i);return!!a&&t===a[0]}function nd(t){return!!ca&&ca in t}var rd=Lr?Ne:ts;function lr(t){var e=t&&t.constructor,i=typeof e=="function"&&e.prototype||En;return t===i}function cl(t){return t===t&&!gt(t)}function fl(t,e){return function(i){return i==null?!1:i[t]===e&&(e!==n||t in ut(i))}}function id(t){var e=ui(t,function(a){return i.size===v&&i.clear(),a}),i=e.cache;return e}function od(t,e){var i=t[1],a=e[1],u=i|a,h=u<(G|at|Ct),p=a==Ct&&i==lt||a==Ct&&i==Kt&&t[7].length<=e[8]||a==(Ct|Kt)&&e[7].length<=e[8]&&i==lt;if(!(h||p))return t;a&G&&(t[2]=e[2],u|=i&G?0:it);var m=e[3];if(m){var w=t[3];t[3]=w?Ka(w,m,e[4]):m,t[4]=w?Ye(t[3],A):e[4]}return m=e[5],m&&(w=t[5],t[5]=w?Ya(w,m,e[6]):m,t[6]=w?Ye(t[5],A):e[6]),m=e[7],m&&(t[7]=m),a&Ct&&(t[8]=t[8]==null?e[8]:Ft(t[8],e[8])),t[9]==null&&(t[9]=e[9]),t[0]=e[0],t[1]=u,t}function sd(t){var e=[];if(t!=null)for(var i in ut(t))e.push(i);return e}function ad(t){return Fr.call(t)}function hl(t,e,i){return e=Tt(e===n?t.length-1:e,0),function(){for(var a=arguments,u=-1,h=Tt(a.length-e,0),p=C(h);++u<h;)p[u]=a[e+u];u=-1;for(var m=C(e+1);++u<e;)m[u]=a[u];return m[e]=i(p),Zt(t,this,m)}}function dl(t,e){return e.length<2?t:cn(t,de(e,0,-1))}function ld(t,e){for(var i=t.length,a=Ft(e.length,i),u=Ut(t);a--;){var h=e[a];t[a]=qe(h,i)?u[h]:n}return t}function Wo(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var pl=ml(ka),ur=Af||function(t,e){return Rt.setTimeout(t,e)},qo=ml(Rh);function gl(t,e,i){var a=e+"";return qo(t,jh(a,ud(Zh(a),i)))}function ml(t){var e=0,i=0;return function(){var a=Tf(),u=Yt-(a-i);if(i=a,u>0){if(++e>=Re)return arguments[0]}else e=0;return t.apply(n,arguments)}}function oi(t,e){var i=-1,a=t.length,u=a-1;for(e=e===n?a:e;++i<e;){var h=wo(i,u),p=t[h];t[h]=t[i],t[i]=p}return t.length=e,t}var vl=id(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(Qu,function(i,a,u,h){e.push(u?h.replace(oc,"$1"):a||i)}),e});function Te(t){if(typeof t=="string"||jt(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function hn(t){if(t!=null){try{return Or.call(t)}catch{}try{return t+""}catch{}}return""}function ud(t,e){return ue(Fu,function(i){var a="_."+i[0];e&i[1]&&!Mr(t,a)&&t.push(a)}),t.sort()}function yl(t){if(t instanceof J)return t.clone();var e=new fe(t.__wrapped__,t.__chain__);return e.__actions__=Ut(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}function cd(t,e,i){(i?qt(t,e,i):e===n)?e=1:e=Tt(Y(e),0);var a=t==null?0:t.length;if(!a||e<1)return[];for(var u=0,h=0,p=C($r(a/e));u<a;)p[h++]=de(t,u,u+=e);return p}function fd(t){for(var e=-1,i=t==null?0:t.length,a=0,u=[];++e<i;){var h=t[e];h&&(u[a++]=h)}return u}function hd(){var t=arguments.length;if(!t)return[];for(var e=C(t-1),i=arguments[0],a=t;a--;)e[a-1]=arguments[a];return Ke(K(i)?Ut(i):[i],Dt(e,1))}var dd=Z(function(t,e){return _t(t)?rr(t,Dt(e,1,_t,!0)):[]}),pd=Z(function(t,e){var i=pe(e);return _t(i)&&(i=n),_t(t)?rr(t,Dt(e,1,_t,!0),k(i,2)):[]}),gd=Z(function(t,e){var i=pe(e);return _t(i)&&(i=n),_t(t)?rr(t,Dt(e,1,_t,!0),n,i):[]});function md(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:Y(e),de(t,e<0?0:e,a)):[]}function vd(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:Y(e),e=a-e,de(t,0,e<0?0:e)):[]}function yd(t,e){return t&&t.length?Qr(t,k(e,3),!0,!0):[]}function _d(t,e){return t&&t.length?Qr(t,k(e,3),!0):[]}function bd(t,e,i,a){var u=t==null?0:t.length;return u?(i&&typeof i!="number"&&qt(t,e,i)&&(i=0,a=u),hh(t,e,i,a)):[]}function _l(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var u=i==null?0:Y(i);return u<0&&(u=Tt(a+u,0)),Pr(t,k(e,3),u)}function bl(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var u=a-1;return i!==n&&(u=Y(i),u=i<0?Tt(a+u,0):Ft(u,a-1)),Pr(t,k(e,3),u,!0)}function wl(t){var e=t==null?0:t.length;return e?Dt(t,1):[]}function wd(t){var e=t==null?0:t.length;return e?Dt(t,Mt):[]}function Sd(t,e){var i=t==null?0:t.length;return i?(e=e===n?1:Y(e),Dt(t,e)):[]}function Ad(t){for(var e=-1,i=t==null?0:t.length,a={};++e<i;){var u=t[e];a[u[0]]=u[1]}return a}function Sl(t){return t&&t.length?t[0]:n}function Cd(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var u=i==null?0:Y(i);return u<0&&(u=Tt(a+u,0)),wn(t,e,u)}function Ed(t){var e=t==null?0:t.length;return e?de(t,0,-1):[]}var xd=Z(function(t){var e=ht(t,xo);return e.length&&e[0]===t[0]?mo(e):[]}),Td=Z(function(t){var e=pe(t),i=ht(t,xo);return e===pe(i)?e=n:i.pop(),i.length&&i[0]===t[0]?mo(i,k(e,2)):[]}),Id=Z(function(t){var e=pe(t),i=ht(t,xo);return e=typeof e=="function"?e:n,e&&i.pop(),i.length&&i[0]===t[0]?mo(i,n,e):[]});function Md(t,e){return t==null?"":Ef.call(t,e)}function pe(t){var e=t==null?0:t.length;return e?t[e-1]:n}function Pd(t,e,i){var a=t==null?0:t.length;if(!a)return-1;var u=a;return i!==n&&(u=Y(i),u=u<0?Tt(a+u,0):Ft(u,a-1)),e===e?uf(t,e,u):Pr(t,na,u,!0)}function Rd(t,e){return t&&t.length?La(t,Y(e)):n}var Dd=Z(Al);function Al(t,e){return t&&t.length&&e&&e.length?bo(t,e):t}function Ld(t,e,i){return t&&t.length&&e&&e.length?bo(t,e,k(i,2)):t}function Od(t,e,i){return t&&t.length&&e&&e.length?bo(t,e,n,i):t}var Fd=We(function(t,e){var i=t==null?0:t.length,a=fo(t,e);return Ba(t,ht(e,function(u){return qe(u,i)?+u:u}).sort(Ga)),a});function Bd(t,e){var i=[];if(!(t&&t.length))return i;var a=-1,u=[],h=t.length;for(e=k(e,3);++a<h;){var p=t[a];e(p,a,t)&&(i.push(p),u.push(a))}return Ba(t,u),i}function No(t){return t==null?t:Mf.call(t)}function kd(t,e,i){var a=t==null?0:t.length;return a?(i&&typeof i!="number"&&qt(t,e,i)?(e=0,i=a):(e=e==null?0:Y(e),i=i===n?a:Y(i)),de(t,e,i)):[]}function Wd(t,e){return Zr(t,e)}function qd(t,e,i){return Ao(t,e,k(i,2))}function Nd(t,e){var i=t==null?0:t.length;if(i){var a=Zr(t,e);if(a<i&&we(t[a],e))return a}return-1}function $d(t,e){return Zr(t,e,!0)}function Ud(t,e,i){return Ao(t,e,k(i,2),!0)}function Hd(t,e){var i=t==null?0:t.length;if(i){var a=Zr(t,e,!0)-1;if(we(t[a],e))return a}return-1}function zd(t){return t&&t.length?Wa(t):[]}function Vd(t,e){return t&&t.length?Wa(t,k(e,2)):[]}function Gd(t){var e=t==null?0:t.length;return e?de(t,1,e):[]}function Kd(t,e,i){return t&&t.length?(e=i||e===n?1:Y(e),de(t,0,e<0?0:e)):[]}function Yd(t,e,i){var a=t==null?0:t.length;return a?(e=i||e===n?1:Y(e),e=a-e,de(t,e<0?0:e,a)):[]}function Xd(t,e){return t&&t.length?Qr(t,k(e,3),!1,!0):[]}function Zd(t,e){return t&&t.length?Qr(t,k(e,3)):[]}var Qd=Z(function(t){return Qe(Dt(t,1,_t,!0))}),Jd=Z(function(t){var e=pe(t);return _t(e)&&(e=n),Qe(Dt(t,1,_t,!0),k(e,2))}),jd=Z(function(t){var e=pe(t);return e=typeof e=="function"?e:n,Qe(Dt(t,1,_t,!0),n,e)});function tp(t){return t&&t.length?Qe(t):[]}function ep(t,e){return t&&t.length?Qe(t,k(e,2)):[]}function np(t,e){return e=typeof e=="function"?e:n,t&&t.length?Qe(t,n,e):[]}function $o(t){if(!(t&&t.length))return[];var e=0;return t=Ge(t,function(i){if(_t(i))return e=Tt(i.length,e),!0}),ro(e,function(i){return ht(t,to(i))})}function Cl(t,e){if(!(t&&t.length))return[];var i=$o(t);return e==null?i:ht(i,function(a){return Zt(e,n,a)})}var rp=Z(function(t,e){return _t(t)?rr(t,e):[]}),ip=Z(function(t){return Eo(Ge(t,_t))}),op=Z(function(t){var e=pe(t);return _t(e)&&(e=n),Eo(Ge(t,_t),k(e,2))}),sp=Z(function(t){var e=pe(t);return e=typeof e=="function"?e:n,Eo(Ge(t,_t),n,e)}),ap=Z($o);function lp(t,e){return Ua(t||[],e||[],nr)}function up(t,e){return Ua(t||[],e||[],sr)}var cp=Z(function(t){var e=t.length,i=e>1?t[e-1]:n;return i=typeof i=="function"?(t.pop(),i):n,Cl(t,i)});function El(t){var e=f(t);return e.__chain__=!0,e}function fp(t,e){return e(t),t}function si(t,e){return e(t)}var hp=We(function(t){var e=t.length,i=e?t[0]:0,a=this.__wrapped__,u=function(h){return fo(h,t)};return e>1||this.__actions__.length||!(a instanceof J)||!qe(i)?this.thru(u):(a=a.slice(i,+i+(e?1:0)),a.__actions__.push({func:si,args:[u],thisArg:n}),new fe(a,this.__chain__).thru(function(h){return e&&!h.length&&h.push(n),h}))});function dp(){return El(this)}function pp(){return new fe(this.value(),this.__chain__)}function gp(){this.__values__===n&&(this.__values__=ql(this.value()));var t=this.__index__>=this.__values__.length,e=t?n:this.__values__[this.__index__++];return{done:t,value:e}}function mp(){return this}function vp(t){for(var e,i=this;i instanceof Vr;){var a=yl(i);a.__index__=0,a.__values__=n,e?u.__wrapped__=a:e=a;var u=a;i=i.__wrapped__}return u.__wrapped__=t,e}function yp(){var t=this.__wrapped__;if(t instanceof J){var e=t;return this.__actions__.length&&(e=new J(this)),e=e.reverse(),e.__actions__.push({func:si,args:[No],thisArg:n}),new fe(e,this.__chain__)}return this.thru(No)}function _p(){return $a(this.__wrapped__,this.__actions__)}var bp=Jr(function(t,e,i){st.call(t,i)?++t[i]:Be(t,i,1)});function wp(t,e,i){var a=K(t)?ta:fh;return i&&qt(t,e,i)&&(e=n),a(t,k(e,3))}function Sp(t,e){var i=K(t)?Ge:Ca;return i(t,k(e,3))}var Ap=Ja(_l),Cp=Ja(bl);function Ep(t,e){return Dt(ai(t,e),1)}function xp(t,e){return Dt(ai(t,e),Mt)}function Tp(t,e,i){return i=i===n?1:Y(i),Dt(ai(t,e),i)}function xl(t,e){var i=K(t)?ue:Ze;return i(t,k(e,3))}function Tl(t,e){var i=K(t)?Vc:Aa;return i(t,k(e,3))}var Ip=Jr(function(t,e,i){st.call(t,i)?t[i].push(e):Be(t,i,[e])});function Mp(t,e,i,a){t=Ht(t)?t:Ln(t),i=i&&!a?Y(i):0;var u=t.length;return i<0&&(i=Tt(u+i,0)),hi(t)?i<=u&&t.indexOf(e,i)>-1:!!u&&wn(t,e,i)>-1}var Pp=Z(function(t,e,i){var a=-1,u=typeof e=="function",h=Ht(t)?C(t.length):[];return Ze(t,function(p){h[++a]=u?Zt(e,p,i):ir(p,e,i)}),h}),Rp=Jr(function(t,e,i){Be(t,i,e)});function ai(t,e){var i=K(t)?ht:Pa;return i(t,k(e,3))}function Dp(t,e,i,a){return t==null?[]:(K(e)||(e=e==null?[]:[e]),i=a?n:i,K(i)||(i=i==null?[]:[i]),Oa(t,e,i))}var Lp=Jr(function(t,e,i){t[i?0:1].push(e)},function(){return[[],[]]});function Op(t,e,i){var a=K(t)?Ji:ia,u=arguments.length<3;return a(t,k(e,4),i,u,Ze)}function Fp(t,e,i){var a=K(t)?Gc:ia,u=arguments.length<3;return a(t,k(e,4),i,u,Aa)}function Bp(t,e){var i=K(t)?Ge:Ca;return i(t,ci(k(e,3)))}function kp(t){var e=K(t)?_a:Mh;return e(t)}function Wp(t,e,i){(i?qt(t,e,i):e===n)?e=1:e=Y(e);var a=K(t)?sh:Ph;return a(t,e)}function qp(t){var e=K(t)?ah:Dh;return e(t)}function Np(t){if(t==null)return 0;if(Ht(t))return hi(t)?An(t):t.length;var e=Bt(t);return e==ve||e==ye?t.size:yo(t).length}function $p(t,e,i){var a=K(t)?ji:Lh;return i&&qt(t,e,i)&&(e=n),a(t,k(e,3))}var Up=Z(function(t,e){if(t==null)return[];var i=e.length;return i>1&&qt(t,e[0],e[1])?e=[]:i>2&&qt(e[0],e[1],e[2])&&(e=[e[0]]),Oa(t,Dt(e,1),[])}),li=Sf||function(){return Rt.Date.now()};function Hp(t,e){if(typeof e!="function")throw new ce(d);return t=Y(t),function(){if(--t<1)return e.apply(this,arguments)}}function Il(t,e,i){return e=i?n:e,e=t&&e==null?t.length:e,ke(t,Ct,n,n,n,n,e)}function Ml(t,e){var i;if(typeof e!="function")throw new ce(d);return t=Y(t),function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=n),i}}var Uo=Z(function(t,e,i){var a=G;if(i.length){var u=Ye(i,Rn(Uo));a|=At}return ke(t,a,e,i,u)}),Pl=Z(function(t,e,i){var a=G|at;if(i.length){var u=Ye(i,Rn(Pl));a|=At}return ke(e,a,t,i,u)});function Rl(t,e,i){e=i?n:e;var a=ke(t,lt,n,n,n,n,n,e);return a.placeholder=Rl.placeholder,a}function Dl(t,e,i){e=i?n:e;var a=ke(t,pt,n,n,n,n,n,e);return a.placeholder=Dl.placeholder,a}function Ll(t,e,i){var a,u,h,p,m,w,x=0,T=!1,I=!1,D=!0;if(typeof t!="function")throw new ce(d);e=ge(e)||0,gt(i)&&(T=!!i.leading,I="maxWait"in i,h=I?Tt(ge(i.maxWait)||0,e):h,D="trailing"in i?!!i.trailing:D);function F(bt){var Se=a,Ue=u;return a=u=n,x=bt,p=t.apply(Ue,Se),p}function W(bt){return x=bt,m=ur(Q,e),T?F(bt):p}function X(bt){var Se=bt-w,Ue=bt-x,Jl=e-Se;return I?Ft(Jl,h-Ue):Jl}function q(bt){var Se=bt-w,Ue=bt-x;return w===n||Se>=e||Se<0||I&&Ue>=h}function Q(){var bt=li();if(q(bt))return j(bt);m=ur(Q,X(bt))}function j(bt){return m=n,D&&a?F(bt):(a=u=n,p)}function te(){m!==n&&Ha(m),x=0,a=w=u=m=n}function Nt(){return m===n?p:j(li())}function ee(){var bt=li(),Se=q(bt);if(a=arguments,u=this,w=bt,Se){if(m===n)return W(w);if(I)return Ha(m),m=ur(Q,e),F(w)}return m===n&&(m=ur(Q,e)),p}return ee.cancel=te,ee.flush=Nt,ee}var zp=Z(function(t,e){return Sa(t,1,e)}),Vp=Z(function(t,e,i){return Sa(t,ge(e)||0,i)});function Gp(t){return ke(t,Et)}function ui(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new ce(d);var i=function(){var a=arguments,u=e?e.apply(this,a):a[0],h=i.cache;if(h.has(u))return h.get(u);var p=t.apply(this,a);return i.cache=h.set(u,p)||h,p};return i.cache=new(ui.Cache||Fe),i}ui.Cache=Fe;function ci(t){if(typeof t!="function")throw new ce(d);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function Kp(t){return Ml(2,t)}var Yp=Oh(function(t,e){e=e.length==1&&K(e[0])?ht(e[0],Qt(k())):ht(Dt(e,1),Qt(k()));var i=e.length;return Z(function(a){for(var u=-1,h=Ft(a.length,i);++u<h;)a[u]=e[u].call(this,a[u]);return Zt(t,this,a)})}),Ho=Z(function(t,e){var i=Ye(e,Rn(Ho));return ke(t,At,n,e,i)}),Ol=Z(function(t,e){var i=Ye(e,Rn(Ol));return ke(t,It,n,e,i)}),Xp=We(function(t,e){return ke(t,Kt,n,n,n,e)});function Zp(t,e){if(typeof t!="function")throw new ce(d);return e=e===n?e:Y(e),Z(t,e)}function Qp(t,e){if(typeof t!="function")throw new ce(d);return e=e==null?0:Tt(Y(e),0),Z(function(i){var a=i[e],u=je(i,0,e);return a&&Ke(u,a),Zt(t,this,u)})}function Jp(t,e,i){var a=!0,u=!0;if(typeof t!="function")throw new ce(d);return gt(i)&&(a="leading"in i?!!i.leading:a,u="trailing"in i?!!i.trailing:u),Ll(t,e,{leading:a,maxWait:e,trailing:u})}function jp(t){return Il(t,1)}function tg(t,e){return Ho(To(e),t)}function eg(){if(!arguments.length)return[];var t=arguments[0];return K(t)?t:[t]}function ng(t){return he(t,R)}function rg(t,e){return e=typeof e=="function"?e:n,he(t,R,e)}function ig(t){return he(t,S|R)}function og(t,e){return e=typeof e=="function"?e:n,he(t,S|R,e)}function sg(t,e){return e==null||wa(t,e,Pt(e))}function we(t,e){return t===e||t!==t&&e!==e}var ag=ni(go),lg=ni(function(t,e){return t>=e}),dn=Ta(function(){return arguments}())?Ta:function(t){return vt(t)&&st.call(t,"callee")&&!da.call(t,"callee")},K=C.isArray,ug=Ys?Qt(Ys):vh;function Ht(t){return t!=null&&fi(t.length)&&!Ne(t)}function _t(t){return vt(t)&&Ht(t)}function cg(t){return t===!0||t===!1||vt(t)&&Wt(t)==Hn}var tn=Cf||ts,fg=Xs?Qt(Xs):yh;function hg(t){return vt(t)&&t.nodeType===1&&!cr(t)}function dg(t){if(t==null)return!0;if(Ht(t)&&(K(t)||typeof t=="string"||typeof t.splice=="function"||tn(t)||Dn(t)||dn(t)))return!t.length;var e=Bt(t);if(e==ve||e==ye)return!t.size;if(lr(t))return!yo(t).length;for(var i in t)if(st.call(t,i))return!1;return!0}function pg(t,e){return or(t,e)}function gg(t,e,i){i=typeof i=="function"?i:n;var a=i?i(t,e):n;return a===n?or(t,e,n,i):!!a}function zo(t){if(!vt(t))return!1;var e=Wt(t);return e==Ar||e==ku||typeof t.message=="string"&&typeof t.name=="string"&&!cr(t)}function mg(t){return typeof t=="number"&&ga(t)}function Ne(t){if(!gt(t))return!1;var e=Wt(t);return e==Cr||e==Ss||e==Bu||e==qu}function Fl(t){return typeof t=="number"&&t==Y(t)}function fi(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=ae}function gt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function vt(t){return t!=null&&typeof t=="object"}var Bl=Zs?Qt(Zs):bh;function vg(t,e){return t===e||vo(t,e,Oo(e))}function yg(t,e,i){return i=typeof i=="function"?i:n,vo(t,e,Oo(e),i)}function _g(t){return kl(t)&&t!=+t}function bg(t){if(rd(t))throw new z(c);return Ia(t)}function wg(t){return t===null}function Sg(t){return t==null}function kl(t){return typeof t=="number"||vt(t)&&Wt(t)==Vn}function cr(t){if(!vt(t)||Wt(t)!=Le)return!1;var e=Wr(t);if(e===null)return!0;var i=st.call(e,"constructor")&&e.constructor;return typeof i=="function"&&i instanceof i&&Or.call(i)==yf}var Vo=Qs?Qt(Qs):wh;function Ag(t){return Fl(t)&&t>=-9007199254740991&&t<=ae}var Wl=Js?Qt(Js):Sh;function hi(t){return typeof t=="string"||!K(t)&&vt(t)&&Wt(t)==Kn}function jt(t){return typeof t=="symbol"||vt(t)&&Wt(t)==Er}var Dn=js?Qt(js):Ah;function Cg(t){return t===n}function Eg(t){return vt(t)&&Bt(t)==Yn}function xg(t){return vt(t)&&Wt(t)==$u}var Tg=ni(_o),Ig=ni(function(t,e){return t<=e});function ql(t){if(!t)return[];if(Ht(t))return hi(t)?_e(t):Ut(t);if(Qn&&t[Qn])return sf(t[Qn]());var e=Bt(t),i=e==ve?oo:e==ye?Rr:Ln;return i(t)}function $e(t){if(!t)return t===0?t:0;if(t=ge(t),t===Mt||t===-1/0){var e=t<0?-1:1;return e*Ri}return t===t?t:0}function Y(t){var e=$e(t),i=e%1;return e===e?i?e-i:e:0}function Nl(t){return t?un(Y(t),0,Xt):0}function ge(t){if(typeof t=="number")return t;if(jt(t))return Un;if(gt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=gt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=oa(t);var i=lc.test(t);return i||cc.test(t)?Uc(t.slice(2),i?2:8):ac.test(t)?Un:+t}function $l(t){return xe(t,zt(t))}function Mg(t){return t?un(Y(t),-9007199254740991,ae):t===0?t:0}function ot(t){return t==null?"":Jt(t)}var Pg=Mn(function(t,e){if(lr(e)||Ht(e)){xe(e,Pt(e),t);return}for(var i in e)st.call(e,i)&&nr(t,i,e[i])}),Ul=Mn(function(t,e){xe(e,zt(e),t)}),di=Mn(function(t,e,i,a){xe(e,zt(e),t,a)}),Rg=Mn(function(t,e,i,a){xe(e,Pt(e),t,a)}),Dg=We(fo);function Lg(t,e){var i=In(t);return e==null?i:ba(i,e)}var Og=Z(function(t,e){t=ut(t);var i=-1,a=e.length,u=a>2?e[2]:n;for(u&&qt(e[0],e[1],u)&&(a=1);++i<a;)for(var h=e[i],p=zt(h),m=-1,w=p.length;++m<w;){var x=p[m],T=t[x];(T===n||we(T,En[x])&&!st.call(t,x))&&(t[x]=h[x])}return t}),Fg=Z(function(t){return t.push(n,ol),Zt(Hl,n,t)});function Bg(t,e){return ea(t,k(e,3),Ee)}function kg(t,e){return ea(t,k(e,3),po)}function Wg(t,e){return t==null?t:ho(t,k(e,3),zt)}function qg(t,e){return t==null?t:Ea(t,k(e,3),zt)}function Ng(t,e){return t&&Ee(t,k(e,3))}function $g(t,e){return t&&po(t,k(e,3))}function Ug(t){return t==null?[]:Yr(t,Pt(t))}function Hg(t){return t==null?[]:Yr(t,zt(t))}function Go(t,e,i){var a=t==null?n:cn(t,e);return a===n?i:a}function zg(t,e){return t!=null&&ll(t,e,dh)}function Ko(t,e){return t!=null&&ll(t,e,ph)}var Vg=tl(function(t,e,i){e!=null&&typeof e.toString!="function"&&(e=Fr.call(e)),t[e]=i},Xo(Vt)),Gg=tl(function(t,e,i){e!=null&&typeof e.toString!="function"&&(e=Fr.call(e)),st.call(t,e)?t[e].push(i):t[e]=[i]},k),Kg=Z(ir);function Pt(t){return Ht(t)?ya(t):yo(t)}function zt(t){return Ht(t)?ya(t,!0):Ch(t)}function Yg(t,e){var i={};return e=k(e,3),Ee(t,function(a,u,h){Be(i,e(a,u,h),a)}),i}function Xg(t,e){var i={};return e=k(e,3),Ee(t,function(a,u,h){Be(i,u,e(a,u,h))}),i}var Zg=Mn(function(t,e,i){Xr(t,e,i)}),Hl=Mn(function(t,e,i,a){Xr(t,e,i,a)}),Qg=We(function(t,e){var i={};if(t==null)return i;var a=!1;e=ht(e,function(h){return h=Je(h,t),a||(a=h.length>1),h}),xe(t,Do(t),i),a&&(i=he(i,S|M|R,Vh));for(var u=e.length;u--;)Co(i,e[u]);return i});function Jg(t,e){return zl(t,ci(k(e)))}var jg=We(function(t,e){return t==null?{}:xh(t,e)});function zl(t,e){if(t==null)return{};var i=ht(Do(t),function(a){return[a]});return e=k(e),Fa(t,i,function(a,u){return e(a,u[0])})}function tm(t,e,i){e=Je(e,t);var a=-1,u=e.length;for(u||(u=1,t=n);++a<u;){var h=t==null?n:t[Te(e[a])];h===n&&(a=u,h=i),t=Ne(h)?h.call(t):h}return t}function em(t,e,i){return t==null?t:sr(t,e,i)}function nm(t,e,i,a){return a=typeof a=="function"?a:n,t==null?t:sr(t,e,i,a)}var Vl=rl(Pt),Gl=rl(zt);function rm(t,e,i){var a=K(t),u=a||tn(t)||Dn(t);if(e=k(e,4),i==null){var h=t&&t.constructor;u?i=a?new h:[]:gt(t)?i=Ne(h)?In(Wr(t)):{}:i={}}return(u?ue:Ee)(t,function(p,m,w){return e(i,p,m,w)}),i}function im(t,e){return t==null?!0:Co(t,e)}function om(t,e,i){return t==null?t:Na(t,e,To(i))}function sm(t,e,i,a){return a=typeof a=="function"?a:n,t==null?t:Na(t,e,To(i),a)}function Ln(t){return t==null?[]:io(t,Pt(t))}function am(t){return t==null?[]:io(t,zt(t))}function lm(t,e,i){return i===n&&(i=e,e=n),i!==n&&(i=ge(i),i=i===i?i:0),e!==n&&(e=ge(e),e=e===e?e:0),un(ge(t),e,i)}function um(t,e,i){return e=$e(e),i===n?(i=e,e=0):i=$e(i),t=ge(t),gh(t,e,i)}function cm(t,e,i){if(i&&typeof i!="boolean"&&qt(t,e,i)&&(e=i=n),i===n&&(typeof e=="boolean"?(i=e,e=n):typeof t=="boolean"&&(i=t,t=n)),t===n&&e===n?(t=0,e=1):(t=$e(t),e===n?(e=t,t=0):e=$e(e)),t>e){var a=t;t=e,e=a}if(i||t%1||e%1){var u=ma();return Ft(t+u*(e-t+$c("1e-"+((u+"").length-1))),e)}return wo(t,e)}var fm=Pn(function(t,e,i){return e=e.toLowerCase(),t+(i?Kl(e):e)});function Kl(t){return Yo(ot(t).toLowerCase())}function Yl(t){return t=ot(t),t&&t.replace(hc,tf).replace(Rc,"")}function hm(t,e,i){t=ot(t),e=Jt(e);var a=t.length;i=i===n?a:un(Y(i),0,a);var u=i;return i-=e.length,i>=0&&t.slice(i,u)==e}function dm(t){return t=ot(t),t&&Gu.test(t)?t.replace(Es,ef):t}function pm(t){return t=ot(t),t&&Ju.test(t)?t.replace(Ui,"\\$&"):t}var gm=Pn(function(t,e,i){return t+(i?"-":"")+e.toLowerCase()}),mm=Pn(function(t,e,i){return t+(i?" ":"")+e.toLowerCase()}),vm=Qa("toLowerCase");function ym(t,e,i){t=ot(t),e=Y(e);var a=e?An(t):0;if(!e||a>=e)return t;var u=(e-a)/2;return ei(Ur(u),i)+t+ei($r(u),i)}function _m(t,e,i){t=ot(t),e=Y(e);var a=e?An(t):0;return e&&a<e?t+ei(e-a,i):t}function bm(t,e,i){t=ot(t),e=Y(e);var a=e?An(t):0;return e&&a<e?ei(e-a,i)+t:t}function wm(t,e,i){return i||e==null?e=0:e&&(e=+e),If(ot(t).replace(Hi,""),e||0)}function Sm(t,e,i){return(i?qt(t,e,i):e===n)?e=1:e=Y(e),So(ot(t),e)}function Am(){var t=arguments,e=ot(t[0]);return t.length<3?e:e.replace(t[1],t[2])}var Cm=Pn(function(t,e,i){return t+(i?"_":"")+e.toLowerCase()});function Em(t,e,i){return i&&typeof i!="number"&&qt(t,e,i)&&(e=i=n),i=i===n?Xt:i>>>0,i?(t=ot(t),t&&(typeof e=="string"||e!=null&&!Vo(e))&&(e=Jt(e),!e&&Sn(t))?je(_e(t),0,i):t.split(e,i)):[]}var xm=Pn(function(t,e,i){return t+(i?" ":"")+Yo(e)});function Tm(t,e,i){return t=ot(t),i=i==null?0:un(Y(i),0,t.length),e=Jt(e),t.slice(i,i+e.length)==e}function Im(t,e,i){var a=f.templateSettings;i&&qt(t,e,i)&&(e=n),t=ot(t),e=di({},e,a,il);var u=di({},e.imports,a.imports,il),h=Pt(u),p=io(u,h),m,w,x=0,T=e.interpolate||xr,I="__p += '",D=so((e.escape||xr).source+"|"+T.source+"|"+(T===xs?sc:xr).source+"|"+(e.evaluate||xr).source+"|$","g"),F="//# sourceURL="+(st.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Bc+"]")+` `;t.replace(D,function(q,Q,j,te,Nt,ee){return j||(j=te),I+=t.slice(x,ee).replace(dc,nf),Q&&(m=!0,I+=`' + __e(`+Q+`) + '`),Nt&&(w=!0,I+=`'; `+Nt+`; __p += '`),j&&(I+=`' + ((__t = (`+j+`)) == null ? '' : __t) + '`),x=ee+q.length,q}),I+=`'; `;var W=st.call(e,"variable")&&e.variable;if(!W)I=`with (obj) { `+I+` } `;else if(ic.test(W))throw new z(g);I=(w?I.replace(Uu,""):I).replace(Hu,"$1").replace(zu,"$1;"),I="function("+(W||"obj")+`) { `+(W?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(m?", __e = _.escape":"")+(w?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+I+`return __p }`;var X=Zl(function(){return et(h,F+"return "+I).apply(n,p)});if(X.source=I,zo(X))throw X;return X}function Mm(t){return ot(t).toLowerCase()}function Pm(t){return ot(t).toUpperCase()}function Rm(t,e,i){if(t=ot(t),t&&(i||e===n))return oa(t);if(!t||!(e=Jt(e)))return t;var a=_e(t),u=_e(e),h=sa(a,u),p=aa(a,u)+1;return je(a,h,p).join("")}function Dm(t,e,i){if(t=ot(t),t&&(i||e===n))return t.slice(0,ua(t)+1);if(!t||!(e=Jt(e)))return t;var a=_e(t),u=aa(a,_e(e))+1;return je(a,0,u).join("")}function Lm(t,e,i){if(t=ot(t),t&&(i||e===n))return t.replace(Hi,"");if(!t||!(e=Jt(e)))return t;var a=_e(t),u=sa(a,_e(e));return je(a,u).join("")}function Om(t,e){var i=Pe,a=oe;if(gt(e)){var u="separator"in e?e.separator:u;i="length"in e?Y(e.length):i,a="omission"in e?Jt(e.omission):a}t=ot(t);var h=t.length;if(Sn(t)){var p=_e(t);h=p.length}if(i>=h)return t;var m=i-An(a);if(m<1)return a;var w=p?je(p,0,m).join(""):t.slice(0,m);if(u===n)return w+a;if(p&&(m+=w.length-m),Vo(u)){if(t.slice(m).search(u)){var x,T=w;for(u.global||(u=so(u.source,ot(Ts.exec(u))+"g")),u.lastIndex=0;x=u.exec(T);)var I=x.index;w=w.slice(0,I===n?m:I)}}else if(t.indexOf(Jt(u),m)!=m){var D=w.lastIndexOf(u);D>-1&&(w=w.slice(0,D))}return w+a}function Fm(t){return t=ot(t),t&&Vu.test(t)?t.replace(Cs,cf):t}var Bm=Pn(function(t,e,i){return t+(i?" ":"")+e.toUpperCase()}),Yo=Qa("toUpperCase");function Xl(t,e,i){return t=ot(t),e=i?n:e,e===n?of(t)?df(t):Xc(t):t.match(e)||[]}var Zl=Z(function(t,e){try{return Zt(t,n,e)}catch(i){return zo(i)?i:new z(i)}}),km=We(function(t,e){return ue(e,function(i){i=Te(i),Be(t,i,Uo(t[i],t))}),t});function Wm(t){var e=t==null?0:t.length,i=k();return t=e?ht(t,function(a){if(typeof a[1]!="function")throw new ce(d);return[i(a[0]),a[1]]}):[],Z(function(a){for(var u=-1;++u<e;){var h=t[u];if(Zt(h[0],this,a))return Zt(h[1],this,a)}})}function qm(t){return ch(he(t,S))}function Xo(t){return function(){return t}}function Nm(t,e){return t==null||t!==t?e:t}var $m=ja(),Um=ja(!0);function Vt(t){return t}function Zo(t){return Ma(typeof t=="function"?t:he(t,S))}function Hm(t){return Ra(he(t,S))}function zm(t,e){return Da(t,he(e,S))}var Vm=Z(function(t,e){return function(i){return ir(i,t,e)}}),Gm=Z(function(t,e){return function(i){return ir(t,i,e)}});function Qo(t,e,i){var a=Pt(e),u=Yr(e,a);i==null&&!(gt(e)&&(u.length||!a.length))&&(i=e,e=t,t=this,u=Yr(e,Pt(e)));var h=!(gt(i)&&"chain"in i)||!!i.chain,p=Ne(t);return ue(u,function(m){var w=e[m];t[m]=w,p&&(t.prototype[m]=function(){var x=this.__chain__;if(h||x){var T=t(this.__wrapped__),I=T.__actions__=Ut(this.__actions__);return I.push({func:w,args:arguments,thisArg:t}),T.__chain__=x,T}return w.apply(t,Ke([this.value()],arguments))})}),t}function Km(){return Rt._===this&&(Rt._=_f),this}function Jo(){}function Ym(t){return t=Y(t),Z(function(e){return La(e,t)})}var Xm=Mo(ht),Zm=Mo(ta),Qm=Mo(ji);function Ql(t){return Bo(t)?to(Te(t)):Th(t)}function Jm(t){return function(e){return t==null?n:cn(t,e)}}var jm=el(),tv=el(!0);function jo(){return[]}function ts(){return!1}function ev(){return{}}function nv(){return""}function rv(){return!0}function iv(t,e){if(t=Y(t),t<1||t>ae)return[];var i=Xt,a=Ft(t,Xt);e=k(e),t-=Xt;for(var u=ro(a,e);++i<t;)e(i);return u}function ov(t){return K(t)?ht(t,Te):jt(t)?[t]:Ut(vl(ot(t)))}function sv(t){var e=++vf;return ot(t)+e}var av=ti(function(t,e){return t+e},0),lv=Po("ceil"),uv=ti(function(t,e){return t/e},1),cv=Po("floor");function fv(t){return t&&t.length?Kr(t,Vt,go):n}function hv(t,e){return t&&t.length?Kr(t,k(e,2),go):n}function dv(t){return ra(t,Vt)}function pv(t,e){return ra(t,k(e,2))}function gv(t){return t&&t.length?Kr(t,Vt,_o):n}function mv(t,e){return t&&t.length?Kr(t,k(e,2),_o):n}var vv=ti(function(t,e){return t*e},1),yv=Po("round"),_v=ti(function(t,e){return t-e},0);function bv(t){return t&&t.length?no(t,Vt):0}function wv(t,e){return t&&t.length?no(t,k(e,2)):0}return f.after=Hp,f.ary=Il,f.assign=Pg,f.assignIn=Ul,f.assignInWith=di,f.assignWith=Rg,f.at=Dg,f.before=Ml,f.bind=Uo,f.bindAll=km,f.bindKey=Pl,f.castArray=eg,f.chain=El,f.chunk=cd,f.compact=fd,f.concat=hd,f.cond=Wm,f.conforms=qm,f.constant=Xo,f.countBy=bp,f.create=Lg,f.curry=Rl,f.curryRight=Dl,f.debounce=Ll,f.defaults=Og,f.defaultsDeep=Fg,f.defer=zp,f.delay=Vp,f.difference=dd,f.differenceBy=pd,f.differenceWith=gd,f.drop=md,f.dropRight=vd,f.dropRightWhile=yd,f.dropWhile=_d,f.fill=bd,f.filter=Sp,f.flatMap=Ep,f.flatMapDeep=xp,f.flatMapDepth=Tp,f.flatten=wl,f.flattenDeep=wd,f.flattenDepth=Sd,f.flip=Gp,f.flow=$m,f.flowRight=Um,f.fromPairs=Ad,f.functions=Ug,f.functionsIn=Hg,f.groupBy=Ip,f.initial=Ed,f.intersection=xd,f.intersectionBy=Td,f.intersectionWith=Id,f.invert=Vg,f.invertBy=Gg,f.invokeMap=Pp,f.iteratee=Zo,f.keyBy=Rp,f.keys=Pt,f.keysIn=zt,f.map=ai,f.mapKeys=Yg,f.mapValues=Xg,f.matches=Hm,f.matchesProperty=zm,f.memoize=ui,f.merge=Zg,f.mergeWith=Hl,f.method=Vm,f.methodOf=Gm,f.mixin=Qo,f.negate=ci,f.nthArg=Ym,f.omit=Qg,f.omitBy=Jg,f.once=Kp,f.orderBy=Dp,f.over=Xm,f.overArgs=Yp,f.overEvery=Zm,f.overSome=Qm,f.partial=Ho,f.partialRight=Ol,f.partition=Lp,f.pick=jg,f.pickBy=zl,f.property=Ql,f.propertyOf=Jm,f.pull=Dd,f.pullAll=Al,f.pullAllBy=Ld,f.pullAllWith=Od,f.pullAt=Fd,f.range=jm,f.rangeRight=tv,f.rearg=Xp,f.reject=Bp,f.remove=Bd,f.rest=Zp,f.reverse=No,f.sampleSize=Wp,f.set=em,f.setWith=nm,f.shuffle=qp,f.slice=kd,f.sortBy=Up,f.sortedUniq=zd,f.sortedUniqBy=Vd,f.split=Em,f.spread=Qp,f.tail=Gd,f.take=Kd,f.takeRight=Yd,f.takeRightWhile=Xd,f.takeWhile=Zd,f.tap=fp,f.throttle=Jp,f.thru=si,f.toArray=ql,f.toPairs=Vl,f.toPairsIn=Gl,f.toPath=ov,f.toPlainObject=$l,f.transform=rm,f.unary=jp,f.union=Qd,f.unionBy=Jd,f.unionWith=jd,f.uniq=tp,f.uniqBy=ep,f.uniqWith=np,f.unset=im,f.unzip=$o,f.unzipWith=Cl,f.update=om,f.updateWith=sm,f.values=Ln,f.valuesIn=am,f.without=rp,f.words=Xl,f.wrap=tg,f.xor=ip,f.xorBy=op,f.xorWith=sp,f.zip=ap,f.zipObject=lp,f.zipObjectDeep=up,f.zipWith=cp,f.entries=Vl,f.entriesIn=Gl,f.extend=Ul,f.extendWith=di,Qo(f,f),f.add=av,f.attempt=Zl,f.camelCase=fm,f.capitalize=Kl,f.ceil=lv,f.clamp=lm,f.clone=ng,f.cloneDeep=ig,f.cloneDeepWith=og,f.cloneWith=rg,f.conformsTo=sg,f.deburr=Yl,f.defaultTo=Nm,f.divide=uv,f.endsWith=hm,f.eq=we,f.escape=dm,f.escapeRegExp=pm,f.every=wp,f.find=Ap,f.findIndex=_l,f.findKey=Bg,f.findLast=Cp,f.findLastIndex=bl,f.findLastKey=kg,f.floor=cv,f.forEach=xl,f.forEachRight=Tl,f.forIn=Wg,f.forInRight=qg,f.forOwn=Ng,f.forOwnRight=$g,f.get=Go,f.gt=ag,f.gte=lg,f.has=zg,f.hasIn=Ko,f.head=Sl,f.identity=Vt,f.includes=Mp,f.indexOf=Cd,f.inRange=um,f.invoke=Kg,f.isArguments=dn,f.isArray=K,f.isArrayBuffer=ug,f.isArrayLike=Ht,f.isArrayLikeObject=_t,f.isBoolean=cg,f.isBuffer=tn,f.isDate=fg,f.isElement=hg,f.isEmpty=dg,f.isEqual=pg,f.isEqualWith=gg,f.isError=zo,f.isFinite=mg,f.isFunction=Ne,f.isInteger=Fl,f.isLength=fi,f.isMap=Bl,f.isMatch=vg,f.isMatchWith=yg,f.isNaN=_g,f.isNative=bg,f.isNil=Sg,f.isNull=wg,f.isNumber=kl,f.isObject=gt,f.isObjectLike=vt,f.isPlainObject=cr,f.isRegExp=Vo,f.isSafeInteger=Ag,f.isSet=Wl,f.isString=hi,f.isSymbol=jt,f.isTypedArray=Dn,f.isUndefined=Cg,f.isWeakMap=Eg,f.isWeakSet=xg,f.join=Md,f.kebabCase=gm,f.last=pe,f.lastIndexOf=Pd,f.lowerCase=mm,f.lowerFirst=vm,f.lt=Tg,f.lte=Ig,f.max=fv,f.maxBy=hv,f.mean=dv,f.meanBy=pv,f.min=gv,f.minBy=mv,f.stubArray=jo,f.stubFalse=ts,f.stubObject=ev,f.stubString=nv,f.stubTrue=rv,f.multiply=vv,f.nth=Rd,f.noConflict=Km,f.noop=Jo,f.now=li,f.pad=ym,f.padEnd=_m,f.padStart=bm,f.parseInt=wm,f.random=cm,f.reduce=Op,f.reduceRight=Fp,f.repeat=Sm,f.replace=Am,f.result=tm,f.round=yv,f.runInContext=b,f.sample=kp,f.size=Np,f.snakeCase=Cm,f.some=$p,f.sortedIndex=Wd,f.sortedIndexBy=qd,f.sortedIndexOf=Nd,f.sortedLastIndex=$d,f.sortedLastIndexBy=Ud,f.sortedLastIndexOf=Hd,f.startCase=xm,f.startsWith=Tm,f.subtract=_v,f.sum=bv,f.sumBy=wv,f.template=Im,f.times=iv,f.toFinite=$e,f.toInteger=Y,f.toLength=Nl,f.toLower=Mm,f.toNumber=ge,f.toSafeInteger=Mg,f.toString=ot,f.toUpper=Pm,f.trim=Rm,f.trimEnd=Dm,f.trimStart=Lm,f.truncate=Om,f.unescape=Fm,f.uniqueId=sv,f.upperCase=Bm,f.upperFirst=Yo,f.each=xl,f.eachRight=Tl,f.first=Sl,Qo(f,function(){var t={};return Ee(f,function(e,i){st.call(f.prototype,i)||(t[i]=e)}),t}(),{chain:!1}),f.VERSION=o,ue(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){f[t].placeholder=f}),ue(["drop","take"],function(t,e){J.prototype[t]=function(i){i=i===n?1:Tt(Y(i),0);var a=this.__filtered__&&!e?new J(this):this.clone();return a.__filtered__?a.__takeCount__=Ft(i,a.__takeCount__):a.__views__.push({size:Ft(i,Xt),type:t+(a.__dir__<0?"Right":"")}),a},J.prototype[t+"Right"]=function(i){return this.reverse()[t](i).reverse()}}),ue(["filter","map","takeWhile"],function(t,e){var i=e+1,a=i==se||i==Ot;J.prototype[t]=function(u){var h=this.clone();return h.__iteratees__.push({iteratee:k(u,3),type:i}),h.__filtered__=h.__filtered__||a,h}}),ue(["head","last"],function(t,e){var i="take"+(e?"Right":"");J.prototype[t]=function(){return this[i](1).value()[0]}}),ue(["initial","tail"],function(t,e){var i="drop"+(e?"":"Right");J.prototype[t]=function(){return this.__filtered__?new J(this):this[i](1)}}),J.prototype.compact=function(){return this.filter(Vt)},J.prototype.find=function(t){return this.filter(t).head()},J.prototype.findLast=function(t){return this.reverse().find(t)},J.prototype.invokeMap=Z(function(t,e){return typeof t=="function"?new J(this):this.map(function(i){return ir(i,t,e)})}),J.prototype.reject=function(t){return this.filter(ci(k(t)))},J.prototype.slice=function(t,e){t=Y(t);var i=this;return i.__filtered__&&(t>0||e<0)?new J(i):(t<0?i=i.takeRight(-t):t&&(i=i.drop(t)),e!==n&&(e=Y(e),i=e<0?i.dropRight(-e):i.take(e-t)),i)},J.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},J.prototype.toArray=function(){return this.take(Xt)},Ee(J.prototype,function(t,e){var i=/^(?:filter|find|map|reject)|While$/.test(e),a=/^(?:head|last)$/.test(e),u=f[a?"take"+(e=="last"?"Right":""):e],h=a||/^find/.test(e);u&&(f.prototype[e]=function(){var p=this.__wrapped__,m=a?[1]:arguments,w=p instanceof J,x=m[0],T=w||K(p),I=function(Q){var j=u.apply(f,Ke([Q],m));return a&&D?j[0]:j};T&&i&&typeof x=="function"&&x.length!=1&&(w=T=!1);var D=this.__chain__,F=!!this.__actions__.length,W=h&&!D,X=w&&!F;if(!h&&T){p=X?p:new J(this);var q=t.apply(p,m);return q.__actions__.push({func:si,args:[I],thisArg:n}),new fe(q,D)}return W&&X?t.apply(this,m):(q=this.thru(I),W?a?q.value()[0]:q.value():q)})}),ue(["pop","push","shift","sort","splice","unshift"],function(t){var e=Dr[t],i=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",a=/^(?:pop|shift)$/.test(t);f.prototype[t]=function(){var u=arguments;if(a&&!this.__chain__){var h=this.value();return e.apply(K(h)?h:[],u)}return this[i](function(p){return e.apply(K(p)?p:[],u)})}}),Ee(J.prototype,function(t,e){var i=f[e];if(i){var a=i.name+"";st.call(Tn,a)||(Tn[a]=[]),Tn[a].push({name:e,func:i})}}),Tn[jr(n,at).name]=[{name:"wrapper",func:n}],J.prototype.clone=Ff,J.prototype.reverse=Bf,J.prototype.value=kf,f.prototype.at=hp,f.prototype.chain=dp,f.prototype.commit=pp,f.prototype.next=gp,f.prototype.plant=vp,f.prototype.reverse=yp,f.prototype.toJSON=f.prototype.valueOf=f.prototype.value=_p,f.prototype.first=f.prototype.head,Qn&&(f.prototype[Qn]=mp),f},Cn=pf();on?((on.exports=Cn)._=Cn,Xi._=Cn):Rt._=Cn}).call(L0)}(pr,pr.exports)),pr.exports}var _i=O0(),F0=Object.defineProperty,Iu=(s,r)=>{for(var n in r)F0(s,n,{get:r[n],enumerable:!0})},B0={};Iu(B0,{lerp:()=>Pu,makeCurveEasings:()=>Du,pointOnCurve:()=>Ru,scaleSpreadArray:()=>k0,shuffleArray:()=>Mu});function Mu(s,r=Math.random){const n=[...s];let o=n.length,l;for(;o!=0;)l=Math.floor(r()*o),o--,[n[o],n[l]]=[n[l],n[o]];return n}var Pu=(s,r,n)=>r+s*(n-r),k0=(s,r,n=Pu)=>{if(!s||s.length<2)throw new Error("valuesToFill array must have at least two values.");if(r<s.length)throw new Error("Target size must be greater than or equal to the valuesToFill array length.");const o=r-s.length,l=s.map(c=>[c]);for(let c=0;c<o;c++)l[c%(s.length-1)].push(null);for(let c=0;c<l.length-1;c++){const d=l[c],g=l[c+1],y=d[0],v=g[0];for(let A=1;A<d.length;A++){const S=A/d.length;d[A]=n(S,y,v)}}return l.flat()},Ru=(s,r)=>n=>{const o=Math.PI/2,l=o/1,c=n;let d=0,g=0;if(s==="lamé"){const y=c*o,v=2/(2+20*r),A=Math.cos(y),S=Math.sin(y);d=Math.sign(A)*Math.abs(A)**v,g=Math.sign(S)*Math.abs(S)**v}else if(s==="arc")g=Math.cos(-Math.PI/2+n*l+r),d=Math.sin(Math.PI/2+n*l-r);else if(s==="pow")d=Math.pow(1-c,1-r),g=Math.pow(c,1-r);else if(s==="powY")d=Math.pow(1-c,r),g=Math.pow(c,1-r);else if(s==="powX")d=Math.pow(c,r),g=Math.pow(c,1-r);else if(typeof s=="function"){const[y,v]=s(n,r);d=y,g=v}else throw new Error(`pointOnCurve() curveAccent parameter is expected to be "lamé" | "arc" | "pow" | "powY" | "powX" or a function but \`${s}\` given.`);return{x:d,y:g}},Du=(s,r)=>{const n=Ru(s,r);return{sEasing:o=>n(o).x,lEasing:o=>n(o).y}},ms={};Iu(ms,{colorHarmonies:()=>q0,colorToCSS:()=>U0,harveyHue:()=>W0,hsv2hsl:()=>Lu,normalizeHue:()=>nt,uniqueRandomHues:()=>N0});function nt(s){return(s%360+360)%360}function W0(s){if(s=nt(s)/360,s===1||s===0)return s;s=1+s%1;const r=1/6,n=s%r/r*Math.PI/2,[o,l]=[r*Math.cos(n),r*Math.sin(n)],c=Math.floor(s*6);return[l,1/3-o,1/3+l,2/3-o,2/3+l,1-o][c%6]*360}var q0={complementary:s=>[nt(s),nt(s+180)],splitComplementary:s=>[nt(s),nt(s+150),nt(s-150)],triadic:s=>[nt(s),nt(s+120),nt(s+240)],tetradic:s=>[nt(s),nt(s+90),nt(s+180),nt(s+270)],monochromatic:s=>[nt(s),nt(s)],doubleComplementary:s=>[nt(s),nt(s+180),nt(s+30),nt(s+210)],compound:s=>[nt(s),nt(s+180),nt(s+60),nt(s+240)],analogous:s=>[nt(s),nt(s+30),nt(s+60),nt(s+90),nt(s+120),nt(s+150)]};function N0({startHue:s=0,total:r=9,minHueDiffAngle:n=60,rndFn:o=Math.random}={}){n=Math.min(n,360/r);const l=s||o()*360,c=Array.from({length:Math.round(360/n)},(g,y)=>(l+y*n)%360);let d=Mu(c,o);return d.length>r&&(d=d.slice(0,r)),d}var Lu=([s,r,n])=>{const o=n-n*r/2,l=Math.min(o,1-o),c=l===0?0:(n-o)/l;return[s,c,o]},$0={oklch:s=>[s[2]*100+"%",s[1]*100+"%",s[0]],lch:s=>[s[2]*100+"%",s[1]*100+"%",s[0]],hsl:s=>[s[0],s[1]*100+"%",s[2]*100+"%"],hsv:s=>{const[r,n,o]=Lu(s);return[r,n*100+"%",o*100+"%"]}},U0=(s,r="oklch")=>`${r==="hsv"?"hsl":r}(${$0[r](s).join(" ")})`;function vs({total:s=9,hStart:r=Math.random()*360,hStartCenter:n=.5,hEasing:o=S=>S,hCycles:l=1,sRange:c=[.4,.35],sEasing:d=S=>Math.pow(S,2),lRange:g=[Math.random()*.1,.9],lEasing:y=S=>Math.pow(S,1.5),transformFn:v=([S,M,R])=>[S,M,R],hueList:A}={}){const S=g[1]-g[0],M=c[1]-c[0],R=A&&A.length>0?A.length:s;return Array.from({length:R},(O,B)=>{const G=B/(R-1),at=1/R,it=A?A[B]:nt(r+(1-o(G,at)-n)*(360*l)),lt=c[0]+M*d(G,at),pt=g[0]+S*y(G,at);return v([it,lt,pt],B)})}var H0=({total:s=9,hStart:r=Math.random()*360,hStartCenter:n=.5,hCycles:o=1,sRange:l=[.4,.35],lRange:c=[Math.random()*.1,.9],hueList:d,curveMethod:g="lamé",curveAccent:y=.5,transformFn:v=([A,S,M])=>[A,S,M]}={})=>{const{sEasing:A,lEasing:S}=Du(g,y);return vs({total:s,hStart:r,hStartCenter:n,hCycles:o,sRange:l,lRange:c,sEasing:A,lEasing:S,transformFn:v,hueList:d})};function z0(){return{options:{},styleTag:document.querySelector("#lqd-customizer-style"),darkMode:document.body.classList.contains("theme-dark"),rootStyles:null,styleString:"",lqdFontPreview:[],googleFontsList:[],showingGoogleFonts:[],fontsPaginationCurrent:20,fontsPaginationLimit:20,loadingFontPreviewQueue:[],localStorageKey:"lqdCustomizerStyle",cssSelectors:{light:":root",dark:".theme-dark"},init(){const s=document.body.getAttribute("data-theme");this.localStorageKey=s+":"+this.localStorageKey,this.onImportStyles=_.throttle(this.onImportStyles.bind(this),300,{leading:!1}),this.loadGoogleFontPreview=_.throttle(this.loadGoogleFontPreview.bind(this),300,{leading:!1}),this.options=window.lqdCustomizerOptions,this.googleFontsList=window.lqdGoogleFontsList,this.currentEdits=this.readFromLocalStorage();const r=document.body.classList.contains("theme-dark");this.rootStyles=getComputedStyle(r?document.body:document.documentElement),Object.entries(this.options).forEach(([n])=>{this.options[n].type==="color"&&(this.options[n].values={},this.options[n].values.light={},this.options[n].values.dark={})}),this.$watch("$store.darkMode.on",n=>{this.darkMode=n,this.rootStyles=getComputedStyle(n?document.body:document.documentElement)}),this.$watch("options",this.updateOutputs.bind(this)),this.showingGoogleFonts=this.googleFontsList.slice(0,this.fontsPaginationLimit),this.currentEdits&&this.onImportStyles(this.currentEdits)},setStyleStrings(){let s="",r="";if(Object.entries(this.options).forEach(([n,o])=>{var y,v;const l=o.type==="font",c=o.cssVar;let d=o.value,g=null;(y=o.values)!=null&&y.light&&(d=o.values.light.twHsl),(v=o.values)!=null&&v.dark&&(g=o.values.dark.twHsl),d&&(s+=` ${c}: ${l?`'${d}'`:d}; `),g&&(r+=` ${c}: ${g}; `)}),!s.length&&!r.length)return this.styleString="";this.styleString=`${this.cssSelectors.light} { ${s}}`,r.length&&(this.styleString+=` ${this.cssSelectors.dark} { ${r}}`)},updateOutputs(){this.setStyleStrings(),this.fillStyleTag(),this.writeToLocalStorage()},fillStyleTag(){if(!this.styleTag)return console.error("Style tag not found");this.styleTag.innerText=this.styleString.replace(/[\n\t]/g,"")},onColorInput({key:s,color:r,manipulations:n=[],assosiatedKeys:o=[]}){var d;if(((d=this.options[s])==null?void 0:d.type)!=="color")return;const l=this.parseColor({color:r,format:["twHsl","hex"],manipulations:n}),c=this.darkMode?"dark":"light";this.options[s].values[c]={twHsl:l.twHsl,hex:l.hex},o.length&&o.forEach(({key:g,color:y,manipulations:v})=>{this.onColorInput({key:g,color:y||r,manipulations:v})})},parseColor({color:s,format:r="hsl",manipulations:n=[]}){const o=typeof s=="string";let l=o?s.trim():s;o&&(/^--[\w-]+$/.test(s)&&(l=this.rootStyles.getPropertyValue(s).trim()),/\S+\s+\S+/.test(l)&&!l.startsWith("hsl")&&(l=`hsl(${l})`));let c=tinycolor(l);if(n.length&&n.forEach(({type:d,value:g,condition:y})=>{if(!(y==="lightMode"&&this.darkMode||y==="darkMode"&&!this.darkMode)){if(d==="autoBlackWhite")return c=c.getLuminance()>=.4?tinycolor("#000"):tinycolor("#fff");c=c[d](g)}}),Array.isArray(r)){const d={};return r.forEach(g=>{d[g]=this.getColorString(c,g)}),d}return this.getColorString(c,r)},getColorString(s,r="hsl"){if(r==="colorObj")return s;if(r==="twHsl"){const n=s.toHsl();return`${Math.ceil(n.h)} ${Math.ceil(n.s*100)}% ${Math.ceil(n.l*100)}%${n.a&&n.a!==1?` / ${Math.ceil(n.a*100)}%`:""}`}return s.toString(r)},randomColors(){const s=tinycolor.random();let r=[.25,1],n=[1,.05];this.darkMode&&(r[1]=.7,n=n.reverse());const o=vs({total:7,hStart:s.toHsl().h,hStartCenter:0,hCycles:.75,hEasing:(Ot,Mt)=>Ot+(-Mt+Math.random()*Mt*2)*.5,sRange:r,lRange:n,sEasing:(Ot,Mt)=>Ot+(-Mt+Math.random()*Mt*2)*.5,lEasing:(Ot,Mt)=>Ot+(-Mt+Math.random()*Mt*2)*.5}),l=H0({hueList:ms.colorHarmonies.splitComplementary(s.toHsl().h),sRange:r.reverse(),lRange:n.reverse(),curveMethod:"arc",curveAccent:.01}),c=vs({hueList:ms.uniqueRandomHues({startHue:0,total:4,minDistance:90}),sRange:[.5,.9],lRange:[.5,.9]}),d=Math.floor(o.length/2),g=o[d],y=o[d-1],v=o[d+1],A=o[0],S=o[o.length-1],M=o[1],R=Math.floor(l.length/2),O=l[l.length-1],B=l[0],G=l[R],at=c[0],it=c[1],lt=c[2],pt=tinycolor({h:g[0],s:g[1],l:g[2]}),At=tinycolor({h:y[0],s:Math.min(1,y[1]),l:Math.min(1,y[2])}),It=tinycolor({h:v[0],s:Math.min(1,v[1]),l:Math.min(1,v[2])}),Ct=tinycolor({h:S[0],s:Math.min(1,S[1]),l:Math.min(1,S[2])}),Kt=tinycolor({h:A[0],s:Math.min(1,A[1]),l:Math.min(1,A[2])}).desaturate(this.darkMode?30:0),Et=tinycolor({h:M[0],s:Math.min(1,M[1]),l:Math.min(1,M[2])}).desaturate(20).setAlpha(.55),Pe=tinycolor({h:O[0],s:Math.min(1,O[1]),l:Math.min(1,O[2])}).desaturate(this.darkMode?30:0),oe=tinycolor({h:B[0],s:Math.min(1,B[1]),l:Math.min(1,B[2])}),Re=tinycolor({h:G[0],s:Math.min(1,G[1]),l:Math.min(1,G[2])})[this.darkMode?"lighten":"darken"](30),Yt=tinycolor({h:at[0],s:Math.min(1,at[1]),l:Math.min(1,at[2])}),se=tinycolor({h:it[0],s:Math.min(1,it[1]),l:Math.min(1,it[2])}),De=tinycolor({h:lt[0],s:Math.min(1,lt[1]),l:Math.min(1,lt[2])});this.onColorInput({key:"colorMainPrimary",color:pt,assosiatedKeys:[{key:"colorMainPrimaryForeground",manipulations:[{type:"autoBlackWhite"}]}]}),this.onColorInput({key:"colorMainSecondary",color:At,assosiatedKeys:[{key:"colorMainSecondaryForeground",manipulations:[{type:"autoBlackWhite"}]}]}),this.onColorInput({key:"colorMainAccent",color:It,assosiatedKeys:[{key:"colorMainAccentForeground",manipulations:[{type:"autoBlackWhite"}]}]}),this.onColorInput({key:"colorMainForeground",color:Ct,assosiatedKeys:[{key:"colorMainHeadingForeground",manipulations:[{type:"darken",value:22,condition:"lightMode"},{type:"lighten",value:30,condition:"darkMode"},{type:"desaturate",value:7,condition:"lightMode"},{type:"desaturate",value:30,condition:"darkMode"}]}]}),this.onColorInput({key:"colorMainBackground",color:Kt}),this.onColorInput({key:"colorMainBorder",color:Et}),this.onColorInput({key:"colorNavbarBackground",color:Pe}),this.onColorInput({key:"colorNavbarForeground",color:oe}),this.onColorInput({key:"colorNavbarActiveBackground",color:Re,assosiatedKeys:[{key:"colorNavbarActiveForeground"},{key:"colorNavbarHoverForeground"},{key:"colorNavbarHoverBackground"}]}),this.onColorInput({key:"colorMainGradientFrom",color:Yt}),this.onColorInput({key:"colorMainGradientVia",color:se}),this.onColorInput({key:"colorMainGradientTo",color:De})},addToGoogleFontLoadQueue(s,r=!1){if(!(r&&this.lqdFontPreview.includes(s))){if(!r)return this.loadGoogleFontFull(s);this.loadingFontPreviewQueue.push(s),this.loadGoogleFontPreview(s),this.lqdFontPreview.push(s)}},loadGoogleFontPreview(){if(!this.loadingFontPreviewQueue.length)return;const s=this.loadingFontPreviewQueue.map(o=>`family=${o}`).join("&").replaceAll(" ","+"),r=encodeURIComponent(this.loadingFontPreviewQueue.join("")),n=`https://fonts.googleapis.com/css2?${s}&display=swap&text=${r}`;this.createLink(n),this.loadingFontPreviewQueue=[]},loadGoogleFontFull(s){const r=`https://fonts.googleapis.com/css2?family=${s.replaceAll(/ /g,"+")}&display=swap`;this.createLink(r)},createLink(s){const r=document.createElement("link");r.href=s,r.rel="stylesheet",r.type="text/css",document.head.appendChild(r)},onImportStyles(s){if(!s)return;let r=s.trim();const n={},o=/([\w\s\.\:\-\#]+)\s*\{([^}]*)\}/g;let l;for(;(l=o.exec(r))!==null;){const c=l[1].trim(),d=l[2].trim().split(";").filter(Boolean);n[c]=n[c]||[];for(const g of d){const y=g.indexOf(":");if(y>0){const v=g.slice(0,y).trim(),A=g.slice(y+1).trim();v&&A&&n[c].push({property:v,value:A})}}}Object.entries(this.options).forEach(([c,d])=>{const g=d.cssVar;Object.entries(this.cssSelectors).forEach(([y,v])=>{var M;const A=(M=n[v])==null?void 0:M.find(R=>R.property===g);if(!A)return;const S=this.sanitizeCssValue(A.value);if(d.type==="color"){const R=this.parseColor({color:S,format:["twHsl","hex"]});this.options[c].values[y].twHsl=R.twHsl,this.options[c].values[y].hex=R.hex}else if(d.type==="font"){const R=S.replace(/['"]/g,"");this.options[c].value=R,this.addToGoogleFontLoadQueue(R)}else this.options[c].value=S})})},sanitizeCssValue(s){if(!s)return"";s=s.replace(/javascript:/gi,"").replace(/expression\(/gi,"").replace(/eval\(/gi,"").replace(/url\(/gi,"").replace(/data:/gi,""),s=s.replace(/[^\w\s,.#:;%\/\-+()[\]@!~="'*]/g,"");const r=(s.match(/'/g)||[]).length,n=(s.match(/"/g)||[]).length;return r%2!==0&&(s=s.replace(/'/g,"")),n%2!==0&&(s=s.replace(/"/g,"")),s},resetStyles(){Object.entries(this.options).forEach(([s,r])=>{r.type==="color"?(this.options[s].values.light={},this.options[s].values.dark={}):r.type==="font"?this.options[s].value="":this.options[s].value=""})},readFromLocalStorage(){let s=localStorage.getItem(this.localStorageKey);return s||(s=this.styleTag.textContent),s},writeToLocalStorage(){const s=this.styleString.replace(/[\n\t]/g,"");if(!s){this.emptyLocalStorage();return}localStorage.setItem(this.localStorageKey,s)},emptyLocalStorage(){localStorage.removeItem(this.localStorageKey)},saveAndClose(){this.setBackEnd(this.styleString??"")},discardChanges(){var r,n;!(((n=(r=this.currentEdits)==null?void 0:r.replace(/[\n\t]/g,""))==null?void 0:n.trim())??"").length&&this.resetStyles(),this.emptyLocalStorage(),this.setBackEnd("",!0)},async setBackEnd(s="",r=!1){const n={};Object.entries(this.options).forEach(([c,d])=>{d.type==="font"&&(n[c]=d.value)});const o=await fetch("/dashboard/admin/live-customizer",{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify({style:s,fonts:n,clear:r})});let l=await o.json();if(!o.ok){toastr.error("Error uploading the customizer styles");return}if(l.status==="success"){toastr.success(l.message),setTimeout(()=>{this.emptyLocalStorage(),window.location.reload()},1e3);return}toastr.error(l.message??"Error uploading the customizer styles")}}}function V0(s){return{dropdownOpen:!1,selectedFont:"",searchString:"",init(){this.$watch("selectedFont",r=>{this.options[s].value=r})},onSearchInput(){const r=this.$event.target.value.trim();if(!r){this.fontsPaginationCurrent=this.fontsPaginationLimit,this.showingGoogleFonts=this.googleFontsList.slice(0,this.fontsPaginationLimit);return}this.showingGoogleFonts=this.googleFontsList.filter(n=>n.toLowerCase().includes(r.toLowerCase()))},loadMoreFonts(){this.fontsPaginationCurrent+=this.fontsPaginationLimit,this.showingGoogleFonts=this.googleFontsList.slice(0,this.fontsPaginationCurrent)}}}N.store("realtimeChatStatus",{active:!1,conversationStarted:!1,setActive(s){this.active=s,this.onActiveChange()},setConversationStarted(s){this.conversationStarted=s,this.onConversationStartedChange()},onActiveChange(){var s,r;document.querySelectorAll(".lqd-realtime-chat-button").forEach(n=>n.classList.toggle("active",this.active)),(r=(s=document.querySelector(".lqd-audio-vis-wrap"))==null?void 0:s.classList)==null||r.toggle("active",this.active)},onConversationStartedChange(){const s=document.querySelector(".chats-wrap");s.classList.toggle("conversation-started",this.conversationStarted),s.classList.toggle("conversation-not-started",!this.conversationStarted),document.querySelectorAll(".lqd-realtime-chat-button").forEach(r=>{r.classList.toggle("conversation-started",this.conversationStarted),r.classList.toggle("conversation-not-started",!this.conversationStarted)})}});const G0=s=>({agentId:s,recordingActive:!1,buffer:new Uint8Array,conversation:null,audioRecorder:null,audioPlayer:null,activeVisulaizer:"idle",audioVisWrap:null,audioVisBars:null,audioVisDotWrap:null,audioVisLoader:null,conversationArea:document.querySelector(".conversation-area"),chatsContainer:document.querySelector(".chats-container"),userBubbleTemplate:document.querySelector("#chat_user_bubble"),aiBubbleTemplate:document.querySelector("#chat_ai_bubble"),lastAiBubble:null,lastUserBubble:null,lastUserQuestion:"",lastAiResponse:"",lastResponseSaved:!1,init(){var r,n,o;this.audioVisWrap=document.querySelector(".lqd-audio-vis-wrap"),this.audioVisBars=(r=this.audioVisWrap)==null?void 0:r.querySelectorAll(".lqd-audio-vis-bar"),this.audioVisDotWrap=(n=this.audioVisWrap)==null?void 0:n.querySelector(".lqd-audio-vis-dot-wrap"),this.audioVisLoader=(o=this.audioVisWrap)==null?void 0:o.querySelector(".lqd-audio-vis-loader"),this.processAudioRecordingBuffer=this.processAudioRecordingBuffer.bind(this)},async start(){if(N.store("realtimeChatStatus").isActive)return;N.store("realtimeChatStatus").setActive(!0),this.switchVisualizers("waiting");const r=await this.checkBalance(!0);if(r.shouldStop){toastr.error(r.errorMsg),this.stop();return}this.conversation=await xv.startSession({agentId:this.agentId,onConnect:async()=>{await Promise.all([this.startRecorder(),this.startPlayer()]).then(()=>{this.startBarsVisualizer(),this.startDotVisualizer(),this.switchVisualizers("idle"),N.store("realtimeChatStatus").setConversationStarted(!0)}).catch(n=>{this.stop(),console.error("Error starting recorder and player:",n),this.appendToChatBubble("ai","[Error]: Unable to start audio recorder and player. Please check your microphone permissions and refresh the page.")})},onDisconnect:()=>{var n;this.disconnectHandle((n=this.conversation)==null?void 0:n.connection),this.stop()},onModeChange:n=>{this.checkBalance().then(o=>{if(o.shouldStop){this.stop(),toastr.error(o.errorMsg);return}})},onMessage:n=>{n.source=="ai"?(this.createChatBubble("ai"),this.appendToChatBubble("ai",n.message),this.lastAiResponse=n.message,"saveResponseAsync"in window&&(saveResponseAsync(this.lastUserQuestion.trim(),this.lastAiResponse.trim(),document.querySelector("#chat_id").value,"","","","","elevenlabs-voice-chatbot"),this.lastResponseSaved=!0),"formatString"in window&&this.lastAiBubble&&(this.lastAiBubble.innerHTML=formatString(this.lastAiResponse)),this.lastAiResponse=this.lastUserQuestion=""):(this.createChatBubble("user"),this.appendToChatBubble("user",n.message),this.lastUserQuestion+=" "+n.message,this.lastResponseSaved=!1)},onError:n=>{console.error("Error:",n),this.stop()}})},async stop(){!this.lastResponseSaved&&"saveResponseAsync"in window&&this.lastUserQuestion.trim()!==""&&this.lastAiResponse.trim()!==""&&saveResponseAsync(this.lastUserQuestion.trim(),this.lastAiResponse.trim(),document.querySelector("#chat_id").value,"","","","","elevenlabs-voice-chatbot"),this.resetPlayers(),this.conversation&&(await this.conversation.endSession(),this.conversation=null),this.switchVisualizers(""),N.store("realtimeChatStatus").setActive(!1)},async startPlayer(){try{this.audioPlayer=new Tu,await this.audioPlayer.init(24e3)}catch(r){console.error("Error starting audio player:",r)}},async startRecorder(){try{this.audioRecorder=new hu(this.processAudioRecordingBuffer);const r=await navigator.mediaDevices.getUserMedia({audio:!0,video:!1});await this.audioRecorder.start(r),this.recordingActive=!0}catch(r){console.error("Error starting audio recorder:",r)}},combineArray(r){const n=new Uint8Array(this.buffer.length+r.length);n.set(this.buffer),n.set(r,this.buffer.length),this.buffer=n},processAudioRecordingBuffer(r){const n=new Uint8Array(r);if(this.combineArray(n),this.buffer.length>=4800){const o=new Uint8Array(this.buffer.slice(0,4800));this.buffer=new Uint8Array(this.buffer.slice(4800));const l=String.fromCharCode(...o);btoa(l)}},async resetPlayers(){var r,n;this.recordingActive=!1,(r=this.audioRecorder)==null||r.stop(),(n=this.audioPlayer)==null||n.clear()},getSystemMessage(){return""},getTemperature(){return parseFloat(.8)},getVoice(){return"alloy"},switchVisualizers(r){var n;this.activeVisulaizer=r,(n=this.audioVisWrap)==null||n.setAttribute("data-state",this.activeVisulaizer)},createChatBubble(r){const o=(r==="user"?this.userBubbleTemplate:this.aiBubbleTemplate).content.cloneNode(!0),l=o.querySelector(".chat-content");this.chatsContainer.appendChild(o),r==="user"?this.lastUserBubble=l:this.lastAiBubble=l,this.scrollConversationAreaToBottom()},appendToChatBubble(r,n){const o=r==="user"?this.lastUserBubble:this.lastAiBubble;o?(o.textContent+=n,this.scrollConversationAreaToBottom()):(this.createChatBubble(r),this.appendToChatBubble(r,n))},scrollConversationAreaToBottom(){this.conversationArea.scrollTo({top:this.conversationArea.scrollHeight+200,left:0})},startBarsVisualizer(){var g;if(!((g=this.audioVisBars)!=null&&g.length))return;const r=this.audioPlayer.audioContext.createAnalyser();r.fftSize=4096;const n=r.frequencyBinCount,o=new Uint8Array(n),l=this.audioVisBars.length;this.audioPlayer.playbackNode.connect(r);const c=[[85,150],[150,250],[250,400],[400,600],[600,1e3]];this.barHeights=this.barHeights||new Array(l).fill(0);const d=()=>{r.getByteFrequencyData(o),this.audioVisBars.forEach((y,v)=>{const[A,S]=c[v],M=Math.floor(A/(this.audioPlayer.audioContext.sampleRate/r.fftSize)),R=Math.ceil(S/(this.audioPlayer.audioContext.sampleRate/r.fftSize));let O=0;for(let G=M;G<=R&&G<o.length;G++)o[G]>O&&(O=o[G]);let B=O/255*80;this.barHeights[v]+=(B-this.barHeights[v])*.4,this.barHeights[v]+=(Math.random()-.5)*2,this.barHeights[v]=Math.max(5,Math.min(100,this.barHeights[v])),y.animate([{height:y.style.height},{height:`${this.barHeights[v]}%`}],{duration:30,fill:"forwards",easing:"linear"})}),requestAnimationFrame(d)};d()},startDotVisualizer(){if(!this.audioRecorder||!this.audioVisDotWrap)return;const r=this.audioRecorder.audioContext.createAnalyser();r.fftSize=256;const n=r.frequencyBinCount,o=new Uint8Array(n);this.audioRecorder.getMediaStreamSource().connect(r);const l=this.audioVisDotWrap.querySelector(".lqd-audio-vis-dot");if(!l)return;const c=()=>{r.getByteFrequencyData(o);let d=0;for(let A=0;A<n;A++)d+=o[A];const y=1+d/n/256*1.5,v=Math.max(.2,1-(y-1)/1.5);l.style.transform=`scale(${y})`,l.style.opacity=v.toFixed(2),requestAnimationFrame(c)};c()},checkBalance(r=!1){return new Promise(n=>{$.ajax({url:"/dashboard/admin/voice-chatbot/check-balance",type:"POST",data:{onStart:r},dataType:"json",success:o=>{const l=o.status!=="success",c=o.message||"";n({shouldStop:l,errorMsg:c})},error:()=>{n({shouldStop:!0,errorMsg:"An error occurred."})}})})},disconnectHandle(r){var n,o;((n=r==null?void 0:r.disconnectionDetails)==null?void 0:n.reason)=="error"&&toastr.error(((o=r==null?void 0:r.disconnectionDetails)==null?void 0:o.message)||"Something went wrong on agent")}});window.fetchEventSource=Av;const K0=localStorage.getItem("lqdDarkMode"),Y0=localStorage.getItem("docsViewMode"),X0=localStorage.getItem("socialMediaPostsViewMode"),Z0=localStorage.getItem("lqdNavbarShrinked"),ys=document.querySelector("body").getAttribute("data-theme"),Q0=localStorage.getItem(ys+":lqdFocusModeEnabled");window.collectCreditsToFormData=function(s){document.querySelectorAll('input[name^="entities"]').forEach(n=>{const o=n.name,l=n.type==="checkbox"||n.type==="radio"?n.checked:n.value;s.append(o,l)})};window.Alpine=N;N.plugin(Cv);N.plugin(l0);N.plugin(d0);document.addEventListener("alpine:init",()=>{const s=N.$persist;N.data("modal",r=>p0(r)),N.data("clipboard",r=>Ev(r)),N.data("assignViewCredits",r=>g0(r)),N.store("navbarShrink",{active:s(!!Z0).as("lqdNavbarShrinked"),toggle(r){this.active=r?r==="shrink":!this.active,document.body.classList.toggle("navbar-shrinked",this.active)}}),N.data("navbarItem",()=>({dropdownOpen:!1,toggleDropdownOpen(r){this.dropdownOpen=r?r==="collapse":!this.dropdownOpen},item:{"x-ref":"item","@mouseenter"(){if(!N.store("navbarShrink").active)return;const r=this.$el.getBoundingClientRect(),n=this.$refs.item.querySelector(".lqd-navbar-dropdown");if(["y","height","bottom"].forEach(o=>this.$refs.item.style.setProperty(`--item-${o}`,`${r[o]}px`)),n){const o=n.getBoundingClientRect();["height"].forEach(l=>this.$refs.item.style.setProperty(`--dropdown-${l}`,`${o[l]}px`))}}}})),N.data("navbarLink",({isDemo:r=!1})=>({isDemo:r,isActive:!1,dropdown:null,dropdownItems:[],dropdownLinks:[],init(){const n=this.$el.closest(".lqd-navbar-inner");this.dropdown=this.$el.nextElementSibling&&this.$el.nextElementSibling.classList.contains("lqd-navbar-dropdown")&&this.$el.nextElementSibling,this.dropdownItems=this.dropdown?this.dropdown.querySelectorAll(".lqd-navbar-dropdown-link"):[],this.dropdownItems.forEach(o=>this.dropdownLinks.push(o.href)),this.isActive=this.$el.href===window.location.href||this.dropdownLinks.includes(window.location.href),this.$el.classList.toggle("active",this.isActive),this.$nextTick(()=>{var o,l;(l=(o=this.dropdown)==null?void 0:o.classList)==null||l.toggle("hidden",!this.isActive),n&&!this.isDemo&&this.isActive&&this.$el.parentElement.offsetTop+this.$el.parentElement.offsetHeight>window.innerHeight&&n.scrollTo({top:this.$el.parentElement.offsetTop-window.innerHeight/2})})}})),N.store("mobileNav",{navCollapse:!0,toggleNav(r){this.navCollapse=r?r==="collapse":!this.navCollapse},templatesCollapse:!0,toggleTemplates(r){this.templatesCollapse=r?r==="collapse":!this.templatesCollapse},searchCollapse:!0,toggleSearch(r){this.searchCollapse=r?r==="collapse":!this.searchCollapse}}),N.store("darkMode",{on:s(!!K0).as("lqdDarkMode"),toggle(){this.on=!this.on,document.body.classList.toggle("theme-dark",this.on),document.body.classList.toggle("theme-light",!this.on)}}),N.store("appLoadingIndicator",{showing:!1,show(){this.showing=!0},hide(){this.showing=!1},toggle(){this.showing=!this.showing}}),N.store("docsViewMode",{docsViewMode:s(Y0||"list").as("docsViewMode"),change(r){this.docsViewMode=r}}),N.store("generatorsFilter",{init(){const r=new URLSearchParams(window.location.search);this.filter=r.get("filter")||"all"},filter:"all",changeFilter(r){if(this.filter!==r){if(!document.startViewTransition)return this.filter=r;document.startViewTransition(()=>this.filter=r)}}}),N.data("generatorItem",()=>({get isHidden(){return this.$store.generatorsFilter.filter!=="all"&&this.$el.getAttribute("data-filter").search(this.$store.generatorsFilter.filter)<0},updateDataFilter(r,n){const o=this.$el.getAttribute("data-filter"),l=new Set(o.split(","));n?l.add("favorite"):l.delete("favorite"),this.$el.setAttribute("data-filter",Array.from(l).join(","))}})),N.store("documentsFilter",{init(){const r=new URLSearchParams(window.location.search);this.sort=r.get("sort")||"created_at",this.sortAscDesc=r.get("sortAscDesc")||"desc",this.filter=r.get("filter")||"all",this.page=r.get("page")||"1"},sort:"created_at",sortAscDesc:"desc",filter:"all",page:"1",changeSort(r){r===this.sort?this.sortAscDesc=this.sortAscDesc==="desc"?"asc":"desc":this.sortAscDesc="desc",this.sort=r},changeAscDesc(r){this.ascDesc!==r&&(this.ascDesc=r)},changeFilter(r){this.filter!==r&&(this.filter=r)},changePage(r){(r===">"||r==="<")&&(r=r===">"?Number(this.page)+1:Number(this.page)-1),this.page!==r&&(this.page=r)}}),N.store("socialMediaPostsViewMode",{socialMediaPostsViewMode:s(X0||"list").as("socialMediaPostsViewMode"),change(r){this.socialMediaPostsViewMode=r}}),N.store("socialMediaPostsFilter",{init(){const r=new URLSearchParams(window.location.search);this.sort=r.get("sort")||"created_at",this.sortAscDesc=r.get("sortAscDesc")||"desc",this.filter=r.get("filter")||"all",this.page=r.get("page")||"1"},sort:"created_at",sortAscDesc:"desc",filter:"all",page:"1",changeSort(r){r===this.sort?this.sortAscDesc=this.sortAscDesc==="desc"?"asc":"desc":this.sortAscDesc="desc",this.sort=r},changeAscDesc(r){this.ascDesc!==r&&(this.ascDesc=r)},changeFilter(r){this.filter!==r&&(this.filter=r)},changePage(r){(r===">"||r==="<")&&(r=r===">"?Number(this.page)+1:Number(this.page)-1),this.page!==r&&(this.page=r)}}),N.store("chatsFilter",{init(){const r=new URLSearchParams(window.location.search);this.filter=r.get("filter")||"all",this.setSearchStr(r.get("search")||"")},searchStr:"",setSearchStr(r){this.searchStr=r.trim().toLowerCase()},filter:"all",changeFilter(r){if(this.filter!==r){if(!document.startViewTransition)return this.filter=r;document.startViewTransition(()=>this.filter=r)}}}),N.data("generatorV2",()=>({itemsSearchStr:"",setItemsSearchStr(r){this.itemsSearchStr=r.trim().toLowerCase(),this.itemsSearchStr!==""?this.$el.closest(".lqd-generator-sidebar").classList.add("lqd-showing-search-results"):this.$el.closest(".lqd-generator-sidebar").classList.remove("lqd-showing-search-results")},sideNavCollapsed:!1,toggleSideNavCollapse(r){var n,o;this.sideNavCollapsed=r?r==="collapse":!this.sideNavCollapsed,this.sideNavCollapsed&&(typeof tinymce<"u"&&(tinymce!=null&&tinymce.activeEditor)?(n=tinymce==null?void 0:tinymce.activeEditor)==null||n.focus():(o=window.editorJS)==null||o.focus())},generatorStep:0,setGeneratorStep(r){if(r!==this.generatorStep){if(!document.startViewTransition)return this.generatorStep=Number(r);document.startViewTransition(()=>this.generatorStep=Number(r))}},selectedGenerator:null})),N.store("mobileChat",{sidebarOpen:!1,toggleSidebar(r){this.sidebarOpen=r?!1:!this.sidebarOpen}}),N.data("dropdown",({triggerType:r="hover"})=>({open:!1,toggle(n){this.open=n?n!=="collapse":!this.open,this.$refs.parent.classList.toggle("lqd-is-active",this.open)},parent:{"@mouseenter"(){r==="hover"&&this.toggle("expand")},"@mouseleave"(){r==="hover"&&this.toggle("collapse")},"@click.outside"(){this.toggle("collapse")}},trigger:{"@click.prevent"(){this.toggle()}},dropdown:{}})),N.store("notifications",{notifications:[],loading:!1,add(r){this.notifications.unshift(r)},remove(r){this.notifications.splice(r,1)},markThenHref(r){const n=this.notifications.indexOf(r);if(n!==-1){var o=new FormData;o.append("id",r.id),this.loading=!0,$.ajax({url:"/dashboard/notifications/mark-as-read",type:"POST",data:o,cache:!1,contentType:!1,processData:!1,success:l=>{},error:l=>{console.error(l)},complete:()=>{this.markAsRead(n),window.location=r.link,this.loading=!1}})}},markAsRead(r){this.notifications=this.notifications.map((n,o)=>(o===r&&(n.unread=!1),n))},markAllAsRead(){this.loading=!0,$.ajax({url:"/dashboard/notifications/mark-as-read",type:"POST",success:r=>{r.success&&this.notifications.forEach((n,o)=>{this.markAsRead(o)})},error:r=>{console.error(r)},complete:()=>{this.loading=!1}})},setNotifications(r){this.notifications=r},hasUnread:function(){return this.notifications.some(r=>r.unread)}}),N.data("notifications",r=>({notifications:r||[]})),N.store("focusMode",{active:N.$persist(!!Q0).as(ys+":lqdFocusModeEnabled"),toggle(r){console.log(ys),this.active=r?r==="activate":!this.active,document.body.classList.toggle("focus-mode",this.active)}}),N.data("numberCounter",({value:r=0,options:n={}})=>({value:r,options:{delay:0,...n},io:null,numberWrappers:[],numberCols:[],numberAnimators:[],init(){this.$el.innerHTML="",this.buildMarkup(),this.setupIO()},updateValue({value:o,options:l={}}){this.value!==o&&(this.value=o,this.options={...this.options,...l},this.buildMarkup(),this.setupIO())},buildMarkup(){const o=this.value.toString().split(""),l=this.$el.querySelectorAll(".lqd-number-counter-numbers-wrap");function c(){return Array.from({length:10},(g,y)=>`<span class="lqd-number-counter-number inline-flex h-full justify-center">${y}</span>`).join("")}if(o.map((g,y)=>{const v=!isNaN(g);return`<span class="lqd-number-counter-numbers-wrap relative inline-flex h-full w-[1ch]" data-index="${y}" data-value="${g}"><span class="lqd-number-counter-numbers-col absolute start-0 top-[-0.25lh] inline-flex h-[1.5lh] w-full flex-col overflow-hidden py-[0.25lh]"><span class="lqd-number-counter-numbers-animator inline-flex w-full h-full flex-col" data-is-number="${v}" data-value="${g}">${v?c():g}</span></span></span>`}).forEach((g,y)=>{const v=o[y],A=l[y],S=!isNaN(v);if(A){const M=A.querySelector(".lqd-number-counter-numbers-animator");A.setAttribute("data-value",v),M.setAttribute("data-value",v),M.setAttribute("data-is-number",S),M.getAttribute("data-is-number")==="true"&&S?M.innerHTML!==c()&&(M.innerHTML=c()):M.innerHTML!==v&&(M.innerHTML=v);return}this.$el.insertAdjacentHTML("beforeend",g),l.length&&this.$el.querySelector(`.lqd-number-counter-numbers-wrap[data-index="${y}"]`).animate([{translate:"0 0.25lh",opacity:0},{translate:"0 0",opacity:1}],{duration:250,easing:"ease",fill:"both"})}),l.length>o.length)for(let g=o.length;g<l.length;g++)l[g].animate([{translate:"0 -0.25lh",opacity:0}],{duration:250,easing:"ease",fill:"both"}).onfinish=()=>{l[g].remove()};this.numberWrappers=this.$el.querySelectorAll(".lqd-number-counter-numbers-wrap"),this.numberCols=this.$el.querySelectorAll(".lqd-number-counter-numbers-col"),this.numberAnimators=this.$el.querySelectorAll(".lqd-number-counter-numbers-animator")},setupIO(){this.io=new IntersectionObserver(([o],l)=>{o.isIntersecting&&(l.disconnect(),this.animate())}),this.io.observe(this.$el)},animate(){this.numberAnimators.forEach(o=>{if(!(o.getAttribute("data-is-number")==="true"))return;const c=o.getAttribute("data-value");o.animate([{translate:`0 ${c*100*-1}%`}],{duration:800,delay:this.options.delay,easing:"cubic-bezier(.47,1.09,.69,1.07)",fill:"both"})})}})),N.data("shapeCutout",()=>({init(){this.onResize=this.onResize.bind(this),this.afterResize=_i.debounce(this.afterResize.bind(this),1),this.svgEl=this.$el.querySelector("svg"),this.svgEl&&(this.svgObjects=this.svgEl.querySelectorAll("rect, circle, path, polygon"),this.events())},events(){$(window).on("resize",this.onResize),this.resizeObserver=new ResizeObserver(()=>{this.onResize()}),this.resizeObserver.observe(this.svgEl)},onResize(){this.changeObjAttr("-"),this.afterResize()},afterResize(){this.changeObjAttr("+")},changeObjAttr(r){this.svgObjects.forEach(n=>{n.hasAttribute("x")?n.setAttribute("x",parseFloat(parseFloat(n.getAttribute("x"))+r+"1")):n.hasAttribute("width")?n.setAttribute("width",parseFloat(parseFloat(n.getAttribute("width"))+r+"1")):n.hasAttribute("cx")?n.setAttribute("cx",parseFloat(parseFloat(n.getAttribute("cx"))+r+"1")):n.hasAttribute("r")&&n.setAttribute("r",parseFloat(parseFloat(n.getAttribute("r"))+r+"1"))})}})),N.data("marquee",(r={})=>({maxWidth:0,position:0,options:{direction:-1,speed:.5,pauseOnHover:!1,...r},async init(){this.direction=this.options.direction,this.cellWidths=[],this.cellHeights=[],this.viewportEl=this.$el.querySelector(".lqd-marquee-viewport"),this.sliderEl=this.$el.querySelector(".lqd-marquee-slider"),this.cells=this.sliderEl.querySelectorAll(".lqd-marquee-cell"),this.sliderElStyles=window.getComputedStyle(this.sliderEl),this.maxWidth=0,this.maxHeight=0,this.onResize=_i.debounce(this.onResize.bind(this),450),await document.fonts.ready,this.sizing(),this.startAnimation()},sizing(){for(let n=0;n<this.cells.length;n++)this.cellHeights.push(this.cells[n].offsetHeight),this.cellWidths.push(this.cells[n].offsetWidth);this.maxHeight=Math.max(...this.cellHeights),this.maxWidth=this.cellWidths.reduce((n,o)=>n+o,0),this.maxWidth+=parseInt(this.sliderElStyles.paddingLeft)+parseInt(this.sliderElStyles.paddingRight),this.maxWidth+=parseInt(this.sliderElStyles.gap)*(this.cells.length-1),this.viewportEl.style.height=`${this.maxHeight+parseInt(this.sliderElStyles.paddingTop)+parseInt(this.sliderElStyles.paddingBottom)}px`,this.sliderEl.classList.add("absolute","top-0","left-0","w-full","h-full"),this.maxWidth-=this.viewportEl.offsetWidth},startAnimation(){this.isAnimating=!0,this.options.pauseOnHover&&(this.sliderEl.addEventListener("pointerenter",()=>{this.isAnimating=!1}),this.sliderEl.addEventListener("pointerleave",()=>{this.isAnimating=!0}));const n=()=>{this.isAnimating&&(this.position+=this.options.speed*this.direction,this.position<=-this.maxWidth?this.direction=1:this.position>=0&&(this.direction=-1),this.sliderEl.style.transform=`translateX(${this.position}px)`),requestAnimationFrame(n)};requestAnimationFrame(n)},onResize(){this.sizing()}})),N.data("curtain",(r="curtain",n={})=>({id:r,activeCurtain:0,options:{itemsSelector:".lqd-curtain-item",contentSelector:".lqd-curtain-item-content",contentWidthOuter:".lqd-curtain-item-content-width-outer",contentWidthInner:".lqd-curtain-item-content-width-inner",activeClassname:"lqd-curtain-item-active",inactiveClassname:"lqd-curtain-item-inactive",duration:.65,ease:"cubic-bezier(0.23, 1, 0.320, 1)",trigger:"pointerenter",...n},init(){this.items=[...this.$el.querySelectorAll(this.options.itemsSelector)],this.items.length&&(this.onElementActive=this.onElementActive.bind(this),this.onWindowResize=_i.debounce(this.onWindowResize.bind(this),450),this.setActiveCurtain(),this.setActiveElement(),this.setActiveContentWidth(),this.events())},events(){const{trigger:o}=this.options,l=_i.throttle(this.onElementActive,50,{leading:!0,trailing:!1});this.items.forEach(c=>{c.addEventListener(o,l)}),window.addEventListener("resize",this.onWindowResize)},setActiveCurtain(){this.activeCurtain=this.items.findIndex(o=>o.classList.contains(this.options.activeClassname)),this.$dispatch(`curtain-changed-${this.id}`,{activeCurtain:this.activeCurtain})},setActiveElement(){this.activeElement=this.items[this.activeCurtain]},setActiveContentWidth(){if(!this.getElDirection().includes("row"))return;const l=this.activeElement.querySelector(this.options.contentWidthOuter).offsetWidth;this.$el.style.setProperty("--active-width",`${l}px`)},onElementActive(o){const{activeClassname:l,inactiveClassname:c}=this.options,d=o.currentTarget;this.items.forEach(g=>{g.classList.remove(l),g.classList.add(c)}),d.classList.remove(c),d.classList.add(l),this.setActiveCurtain(),this.setActiveElement()},getElDirection(){return window.getComputedStyle(this.activeElement).flexDirection},onWindowResize(){this.setActiveContentWidth()}})),N.data("slideshow",(r="slideshow",n=0,o={})=>({activeSlide:0,totalSlides:n,id:r,options:{...o},init(){this.setActiveSlide=this.setActiveSlide.bind(this)},setActiveSlide(l){l===">"?l=this.activeSlide+1:l==="<"&&(l=this.activeSlide-1),l<0?l=this.totalSlides-1:l>=this.totalSlides&&(l=0),this.activeSlide=l,this.$dispatch(`slide-changed-${this.id}`,{activeSlide:this.activeSlide})}})),N.data("splitText",(r={})=>({splitText:null,options:{type:"words",tag:"span",charsClass:"lqd-split-unit lqd-split-char",wordsClass:"lqd-split-unit lqd-split-word",linesClass:"lqd-split-unit lqd-split-line",...r},init(){this.splitText=new SplitText(this.$el,this.options);const n=this.splitText.words.length;this.splitText.words.forEach((o,l)=>{o.setAttribute("data-index",l),o.setAttribute("data-last-index",n-1-l),o.style.setProperty("--word-index",l),o.style.setProperty("--word-last-index",n-1-l)}),this.$dispatch("split-text-done",{splitText:this.splitText})}})),N.data("openaiRealtime",R0),N.data("elevenlabsRealtime",G0),N.data("advancedImageEditor",D0),N.data("lqdCustomizer",z0),N.data("lqdCustomizerFontPicker",V0)});Sv.start();export{ny as g};
Save
Cancel