jplan-pack 0.6.767 → 0.6.768

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,7 @@ About how to use the Composition API mode, see https://vue-i18n.intlify.dev/guid
38
38
  * @author RubaXa <trash@rubaxa.org>
39
39
  * @author owenm <owen23355@gmail.com>
40
40
  * @license MIT
41
- */function dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),t.push.apply(t,r)}return t}function Wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dv(Object(t),!0).forEach(function(r){$x(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function cl(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cl=function(e){return typeof e}:cl=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(n)}function $x(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mo(){return mo=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},mo.apply(this,arguments)}function Kx(n,e){if(n==null)return{};var t={},r=Object.keys(n),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(t[o]=n[o]);return t}function Wx(n,e){if(n==null)return{};var t=Kx(n,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}var zx="1.14.0";function ho(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var po=ho(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Fs=ho(/Edge/i),hv=ho(/firefox/i),ms=ho(/safari/i)&&!ho(/chrome/i)&&!ho(/android/i),rE=ho(/iP(ad|od|hone)/i),Gx=ho(/chrome/i)&&ho(/android/i),oE={capture:!1,passive:!1};function Ve(n,e,t){n.addEventListener(e,t,!po&&oE)}function xe(n,e,t){n.removeEventListener(e,t,!po&&oE)}function wl(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function qx(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function Lr(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&wl(n,e):wl(n,e))||r&&n===t)return n;if(n===t)break}while(n=qx(n))}return null}var fv=/\s+/g;function Nn(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(fv," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(fv," ")}}function pe(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function ga(n,e){var t="";if(typeof n=="string")t=n;else do{var r=pe(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(t)}function iE(n,e,t){if(n){var r=n.getElementsByTagName(e),o=0,a=r.length;if(t)for(;o<a;o++)t(r[o],o);return r}return[]}function $r(){var n=document.scrollingElement;return n||document.documentElement}function Rt(n,e,t,r,o){if(!(!n.getBoundingClientRect&&n!==window)){var a,c,d,h,m,g,_;if(n!==window&&n.parentNode&&n!==$r()?(a=n.getBoundingClientRect(),c=a.top,d=a.left,h=a.bottom,m=a.right,g=a.height,_=a.width):(c=0,d=0,h=window.innerHeight,m=window.innerWidth,g=window.innerHeight,_=window.innerWidth),(e||t)&&n!==window&&(o=o||n.parentNode,!po))do if(o&&o.getBoundingClientRect&&(pe(o,"transform")!=="none"||t&&pe(o,"position")!=="static")){var p=o.getBoundingClientRect();c-=p.top+parseInt(pe(o,"border-top-width")),d-=p.left+parseInt(pe(o,"border-left-width")),h=c+a.height,m=d+a.width;break}while(o=o.parentNode);if(r&&n!==window){var w=ga(o||n),C=w&&w.a,T=w&&w.d;w&&(c/=T,d/=C,_/=C,g/=T,h=c+g,m=d+_)}return{top:c,left:d,bottom:h,right:m,width:_,height:g}}}function mv(n,e,t){for(var r=Fo(n,!0),o=Rt(n)[e];r;){var a=Rt(r)[t],c=void 0;if(c=o>=a,!c)return r;if(r===$r())break;r=Fo(r,!1)}return!1}function wa(n,e,t,r){for(var o=0,a=0,c=n.children;a<c.length;){if(c[a].style.display!=="none"&&c[a]!==_e.ghost&&(r||c[a]!==_e.dragged)&&Lr(c[a],t.draggable,n,!1)){if(o===e)return c[a];o++}a++}return null}function xf(n,e){for(var t=n.lastElementChild;t&&(t===_e.ghost||pe(t,"display")==="none"||e&&!wl(t,e));)t=t.previousElementSibling;return t||null}function nr(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==_e.clone&&(!e||wl(n,e))&&t++;return t}function gv(n){var e=0,t=0,r=$r();if(n)do{var o=ga(n),a=o.a,c=o.d;e+=n.scrollLeft*a,t+=n.scrollTop*c}while(n!==r&&(n=n.parentNode));return[e,t]}function jx(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function Fo(n,e){if(!n||!n.getBoundingClientRect)return $r();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var o=pe(t);if(t.clientWidth<t.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return $r();if(r||e)return t;r=!0}}while(t=t.parentNode);return $r()}function Yx(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function zd(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var gs;function aE(n,e){return function(){if(!gs){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),gs=setTimeout(function(){gs=void 0},e)}}}function Jx(){clearTimeout(gs),gs=void 0}function sE(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function cE(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}var xn="Sortable"+new Date().getTime();function Qx(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(o){if(!(pe(o,"display")==="none"||o===_e.ghost)){n.push({target:o,rect:Rt(o)});var a=Wr({},n[n.length-1].rect);if(o.thisAnimationDuration){var c=ga(o,!0);c&&(a.top-=c.f,a.left-=c.e)}o.fromRect=a}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(jx(n,{target:r}),1)},animateAll:function(r){var o=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var a=!1,c=0;n.forEach(function(d){var h=0,m=d.target,g=m.fromRect,_=Rt(m),p=m.prevFromRect,w=m.prevToRect,C=d.rect,T=ga(m,!0);T&&(_.top-=T.f,_.left-=T.e),m.toRect=_,m.thisAnimationDuration&&zd(p,_)&&!zd(g,_)&&(C.top-_.top)/(C.left-_.left)===(g.top-_.top)/(g.left-_.left)&&(h=Zx(C,p,w,o.options)),zd(_,g)||(m.prevFromRect=g,m.prevToRect=_,h||(h=o.options.animation),o.animate(m,C,_,h)),h&&(a=!0,c=Math.max(c,h),clearTimeout(m.animationResetTimer),m.animationResetTimer=setTimeout(function(){m.animationTime=0,m.prevFromRect=null,m.fromRect=null,m.prevToRect=null,m.thisAnimationDuration=null},h),m.thisAnimationDuration=h)}),clearTimeout(e),a?e=setTimeout(function(){typeof r=="function"&&r()},c):typeof r=="function"&&r(),n=[]},animate:function(r,o,a,c){if(c){pe(r,"transition",""),pe(r,"transform","");var d=ga(this.el),h=d&&d.a,m=d&&d.d,g=(o.left-a.left)/(h||1),_=(o.top-a.top)/(m||1);r.animatingX=!!g,r.animatingY=!!_,pe(r,"transform","translate3d("+g+"px,"+_+"px,0)"),this.forRepaintDummy=Xx(r),pe(r,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),pe(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){pe(r,"transition",""),pe(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},c)}}}}function Xx(n){return n.offsetWidth}function Zx(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var qi=[],Gd={initializeByDefault:!0},Vs={mount:function(e){for(var t in Gd)Gd.hasOwnProperty(t)&&!(t in e)&&(e[t]=Gd[t]);qi.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),qi.push(e)},pluginEvent:function(e,t,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var a=e+"Global";qi.forEach(function(c){t[c.pluginName]&&(t[c.pluginName][a]&&t[c.pluginName][a](Wr({sortable:t},r)),t.options[c.pluginName]&&t[c.pluginName][e]&&t[c.pluginName][e](Wr({sortable:t},r)))})},initializePlugins:function(e,t,r,o){qi.forEach(function(d){var h=d.pluginName;if(!(!e.options[h]&&!d.initializeByDefault)){var m=new d(e,t,e.options);m.sortable=e,m.options=e.options,e[h]=m,mo(r,m.defaults)}});for(var a in e.options)if(e.options.hasOwnProperty(a)){var c=this.modifyOption(e,a,e.options[a]);typeof c<"u"&&(e.options[a]=c)}},getEventProperties:function(e,t){var r={};return qi.forEach(function(o){typeof o.eventProperties=="function"&&mo(r,o.eventProperties.call(t[o.pluginName],e))}),r},modifyOption:function(e,t,r){var o;return qi.forEach(function(a){e[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[t]=="function"&&(o=a.optionListeners[t].call(e[a.pluginName],r))}),o}};function eU(n){var e=n.sortable,t=n.rootEl,r=n.name,o=n.targetEl,a=n.cloneEl,c=n.toEl,d=n.fromEl,h=n.oldIndex,m=n.newIndex,g=n.oldDraggableIndex,_=n.newDraggableIndex,p=n.originalEvent,w=n.putSortable,C=n.extraEventProperties;if(e=e||t&&t[xn],!!e){var T,k=e.options,I="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!po&&!Fs?T=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(T=document.createEvent("Event"),T.initEvent(r,!0,!0)),T.to=c||t,T.from=d||t,T.item=o||t,T.clone=a,T.oldIndex=h,T.newIndex=m,T.oldDraggableIndex=g,T.newDraggableIndex=_,T.originalEvent=p,T.pullMode=w?w.lastPutMode:void 0;var N=Wr(Wr({},C),Vs.getEventProperties(r,e));for(var D in N)T[D]=N[D];t&&t.dispatchEvent(T),k[I]&&k[I].call(e,T)}}var tU=["evt"],pn=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,a=Wx(r,tU);Vs.pluginEvent.bind(_e)(e,t,Wr({dragEl:Z,parentEl:ft,ghostEl:we,rootEl:ct,nextEl:ui,lastDownEl:ll,cloneEl:mt,cloneHidden:Lo,dragStarted:ss,putSortable:zt,activeSortable:_e.active,originalEvent:o,oldIndex:da,oldDraggableIndex:ps,newIndex:Rn,newDraggableIndex:Do,hideGhostForTarget:hE,unhideGhostForTarget:fE,cloneNowHidden:function(){Lo=!0},cloneNowShown:function(){Lo=!1},dispatchSortableEvent:function(d){ln({sortable:t,name:d,originalEvent:o})}},a))};function ln(n){eU(Wr({putSortable:zt,cloneEl:mt,targetEl:Z,rootEl:ct,oldIndex:da,oldDraggableIndex:ps,newIndex:Rn,newDraggableIndex:Do},n))}var Z,ft,we,ct,ui,ll,mt,Lo,da,Rn,ps,Do,Fc,zt,oa=!1,Tl=!1,bl=[],ai,fr,qd,jd,pv,_v,ss,ji,_s,vs=!1,Vc=!1,ul,Jt,Yd=[],Bh=!1,Il=[],Zl=typeof document<"u",Hc=rE,vv=Fs||po?"cssFloat":"float",nU=Zl&&!Gx&&!rE&&"draggable"in document.createElement("div"),lE=function(){if(Zl){if(po)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),uE=function(e,t){var r=pe(e),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),a=wa(e,0,t),c=wa(e,1,t),d=a&&pe(a),h=c&&pe(c),m=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Rt(a).width,g=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Rt(c).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&d.float&&d.float!=="none"){var _=d.float==="left"?"left":"right";return c&&(h.clear==="both"||h.clear===_)?"vertical":"horizontal"}return a&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||m>=o&&r[vv]==="none"||c&&r[vv]==="none"&&m+g>o)?"vertical":"horizontal"},rU=function(e,t,r){var o=r?e.left:e.top,a=r?e.right:e.bottom,c=r?e.width:e.height,d=r?t.left:t.top,h=r?t.right:t.bottom,m=r?t.width:t.height;return o===d||a===h||o+c/2===d+m/2},oU=function(e,t){var r;return bl.some(function(o){var a=o[xn].options.emptyInsertThreshold;if(!(!a||xf(o))){var c=Rt(o),d=e>=c.left-a&&e<=c.right+a,h=t>=c.top-a&&t<=c.bottom+a;if(d&&h)return r=o}}),r},dE=function(e){function t(a,c){return function(d,h,m,g){var _=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(a==null&&(c||_))return!0;if(a==null||a===!1)return!1;if(c&&a==="clone")return a;if(typeof a=="function")return t(a(d,h,m,g),c)(d,h,m,g);var p=(c?d:h).options.group.name;return a===!0||typeof a=="string"&&a===p||a.join&&a.indexOf(p)>-1}}var r={},o=e.group;(!o||cl(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=t(o.pull,!0),r.checkPut=t(o.put),r.revertClone=o.revertClone,e.group=r},hE=function(){!lE&&we&&pe(we,"display","none")},fE=function(){!lE&&we&&pe(we,"display","")};Zl&&document.addEventListener("click",function(n){if(Tl)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Tl=!1,!1},!0);var si=function(e){if(Z){e=e.touches?e.touches[0]:e;var t=oU(e.clientX,e.clientY);if(t){var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=e[o]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[xn]._onDragOver(r)}}},iU=function(e){Z&&Z.parentNode[xn]._isOutsideThisEl(e.target)};function _e(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=mo({},e),n[xn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return uE(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,d){c.setData("Text",d.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:_e.supportPointer!==!1&&"PointerEvent"in window&&!ms,emptyInsertThreshold:5};Vs.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);dE(e);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=e.forceFallback?!1:nU,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ve(n,"pointerdown",this._onTapStart):(Ve(n,"mousedown",this._onTapStart),Ve(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ve(n,"dragover",this),Ve(n,"dragenter",this)),bl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),mo(this,Qx())}_e.prototype={constructor:_e,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ji=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,o=this.options,a=o.preventOnFilter,c=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,m=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,g=o.filter;if(fU(r),!Z&&!(/mousedown|pointerdown/.test(c)&&e.button!==0||o.disabled)&&!m.isContentEditable&&!(!this.nativeDraggable&&ms&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=Lr(h,o.draggable,r,!1),!(h&&h.animated)&&ll!==h)){if(da=nr(h),ps=nr(h,o.draggable),typeof g=="function"){if(g.call(this,e,h,this)){ln({sortable:t,rootEl:m,name:"filter",targetEl:h,toEl:r,fromEl:r}),pn("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(g&&(g=g.split(",").some(function(_){if(_=Lr(m,_.trim(),r,!1),_)return ln({sortable:t,rootEl:_,name:"filter",targetEl:h,fromEl:r,toEl:r}),pn("filter",t,{evt:e}),!0}),g)){a&&e.cancelable&&e.preventDefault();return}o.handle&&!Lr(m,o.handle,r,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,r){var o=this,a=o.el,c=o.options,d=a.ownerDocument,h;if(r&&!Z&&r.parentNode===a){var m=Rt(r);if(ct=a,Z=r,ft=Z.parentNode,ui=Z.nextSibling,ll=r,Fc=c.group,_e.dragged=Z,ai={target:Z,clientX:(t||e).clientX,clientY:(t||e).clientY},pv=ai.clientX-m.left,_v=ai.clientY-m.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Z.style["will-change"]="all",h=function(){if(pn("delayEnded",o,{evt:e}),_e.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!hv&&o.nativeDraggable&&(Z.draggable=!0),o._triggerDragStart(e,t),ln({sortable:o,name:"choose",originalEvent:e}),Nn(Z,c.chosenClass,!0)},c.ignore.split(",").forEach(function(g){iE(Z,g.trim(),Jd)}),Ve(d,"dragover",si),Ve(d,"mousemove",si),Ve(d,"touchmove",si),Ve(d,"mouseup",o._onDrop),Ve(d,"touchend",o._onDrop),Ve(d,"touchcancel",o._onDrop),hv&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),pn("delayStart",this,{evt:e}),c.delay&&(!c.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Fs||po))){if(_e.eventCanceled){this._onDrop();return}Ve(d,"mouseup",o._disableDelayedDrag),Ve(d,"touchend",o._disableDelayedDrag),Ve(d,"touchcancel",o._disableDelayedDrag),Ve(d,"mousemove",o._delayedDragTouchMoveHandler),Ve(d,"touchmove",o._delayedDragTouchMoveHandler),c.supportPointer&&Ve(d,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(h,c.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Jd(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;xe(e,"mouseup",this._disableDelayedDrag),xe(e,"touchend",this._disableDelayedDrag),xe(e,"touchcancel",this._disableDelayedDrag),xe(e,"mousemove",this._delayedDragTouchMoveHandler),xe(e,"touchmove",this._delayedDragTouchMoveHandler),xe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Ve(document,"pointermove",this._onTouchMove):t?Ve(document,"touchmove",this._onTouchMove):Ve(document,"mousemove",this._onTouchMove):(Ve(Z,"dragend",this),Ve(ct,"dragstart",this._onDragStart));try{document.selection?dl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(oa=!1,ct&&Z){pn("dragStarted",this,{evt:t}),this.nativeDraggable&&Ve(document,"dragover",iU);var r=this.options;!e&&Nn(Z,r.dragClass,!1),Nn(Z,r.ghostClass,!0),_e.active=this,e&&this._appendGhost(),ln({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(fr){this._lastX=fr.clientX,this._lastY=fr.clientY,hE();for(var e=document.elementFromPoint(fr.clientX,fr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(fr.clientX,fr.clientY),e!==t);)t=e;if(Z.parentNode[xn]._isOutsideThisEl(e),t)do{if(t[xn]){var r=void 0;if(r=t[xn]._onDragOver({clientX:fr.clientX,clientY:fr.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);fE()}},_onTouchMove:function(e){if(ai){var t=this.options,r=t.fallbackTolerance,o=t.fallbackOffset,a=e.touches?e.touches[0]:e,c=we&&ga(we,!0),d=we&&c&&c.a,h=we&&c&&c.d,m=Hc&&Jt&&gv(Jt),g=(a.clientX-ai.clientX+o.x)/(d||1)+(m?m[0]-Yd[0]:0)/(d||1),_=(a.clientY-ai.clientY+o.y)/(h||1)+(m?m[1]-Yd[1]:0)/(h||1);if(!_e.active&&!oa){if(r&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(we){c?(c.e+=g-(qd||0),c.f+=_-(jd||0)):c={a:1,b:0,c:0,d:1,e:g,f:_};var p="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");pe(we,"webkitTransform",p),pe(we,"mozTransform",p),pe(we,"msTransform",p),pe(we,"transform",p),qd=g,jd=_,fr=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!we){var e=this.options.fallbackOnBody?document.body:ct,t=Rt(Z,!0,Hc,!0,e),r=this.options;if(Hc){for(Jt=e;pe(Jt,"position")==="static"&&pe(Jt,"transform")==="none"&&Jt!==document;)Jt=Jt.parentNode;Jt!==document.body&&Jt!==document.documentElement?(Jt===document&&(Jt=$r()),t.top+=Jt.scrollTop,t.left+=Jt.scrollLeft):Jt=$r(),Yd=gv(Jt)}we=Z.cloneNode(!0),Nn(we,r.ghostClass,!1),Nn(we,r.fallbackClass,!0),Nn(we,r.dragClass,!0),pe(we,"transition",""),pe(we,"transform",""),pe(we,"box-sizing","border-box"),pe(we,"margin",0),pe(we,"top",t.top),pe(we,"left",t.left),pe(we,"width",t.width),pe(we,"height",t.height),pe(we,"opacity","0.8"),pe(we,"position",Hc?"absolute":"fixed"),pe(we,"zIndex","100000"),pe(we,"pointerEvents","none"),_e.ghost=we,e.appendChild(we),pe(we,"transform-origin",pv/parseInt(we.style.width)*100+"% "+_v/parseInt(we.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,o=e.dataTransfer,a=r.options;if(pn("dragStart",this,{evt:e}),_e.eventCanceled){this._onDrop();return}pn("setupClone",this),_e.eventCanceled||(mt=cE(Z),mt.draggable=!1,mt.style["will-change"]="",this._hideClone(),Nn(mt,this.options.chosenClass,!1),_e.clone=mt),r.cloneId=dl(function(){pn("clone",r),!_e.eventCanceled&&(r.options.removeCloneOnHide||ct.insertBefore(mt,Z),r._hideClone(),ln({sortable:r,name:"clone"}))}),!t&&Nn(Z,a.dragClass,!0),t?(Tl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(xe(document,"mouseup",r._onDrop),xe(document,"touchend",r._onDrop),xe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",a.setData&&a.setData.call(r,o,Z)),Ve(document,"drop",r),pe(Z,"transform","translateZ(0)")),oa=!0,r._dragStartId=dl(r._dragStarted.bind(r,t,e)),Ve(document,"selectstart",r),ss=!0,ms&&pe(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,o,a,c,d=this.options,h=d.group,m=_e.active,g=Fc===h,_=d.sort,p=zt||m,w,C=this,T=!1;if(Bh)return;function k(at,Et){pn(at,C,Wr({evt:e,isOwner:g,axis:w?"vertical":"horizontal",revert:c,dragRect:o,targetRect:a,canSort:_,fromSortable:p,target:r,completed:N,onMove:function(St,jo){return $c(ct,t,Z,o,St,Rt(St),e,jo)},changed:D},Et))}function I(){k("dragOverAnimationCapture"),C.captureAnimationState(),C!==p&&p.captureAnimationState()}function N(at){return k("dragOverCompleted",{insertion:at}),at&&(g?m._hideClone():m._showClone(C),C!==p&&(Nn(Z,zt?zt.options.ghostClass:m.options.ghostClass,!1),Nn(Z,d.ghostClass,!0)),zt!==C&&C!==_e.active?zt=C:C===_e.active&&zt&&(zt=null),p===C&&(C._ignoreWhileAnimating=r),C.animateAll(function(){k("dragOverAnimationComplete"),C._ignoreWhileAnimating=null}),C!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(r===Z&&!Z.animated||r===t&&!r.animated)&&(ji=null),!d.dragoverBubble&&!e.rootEl&&r!==document&&(Z.parentNode[xn]._isOutsideThisEl(e.target),!at&&si(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),T=!0}function D(){Rn=nr(Z),Do=nr(Z,d.draggable),ln({sortable:C,name:"change",toEl:t,newIndex:Rn,newDraggableIndex:Do,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=Lr(r,d.draggable,t,!0),k("dragOver"),_e.eventCanceled)return T;if(Z.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||C._ignoreWhileAnimating===r)return N(!1);if(Tl=!1,m&&!d.disabled&&(g?_||(c=ft!==ct):zt===this||(this.lastPutMode=Fc.checkPull(this,m,Z,e))&&h.checkPut(this,m,Z,e))){if(w=this._getDirection(e,r)==="vertical",o=Rt(Z),k("dragOverValid"),_e.eventCanceled)return T;if(c)return ft=ct,I(),this._hideClone(),k("revert"),_e.eventCanceled||(ui?ct.insertBefore(Z,ui):ct.appendChild(Z)),N(!0);var L=xf(t,d.draggable);if(!L||lU(e,w,this)&&!L.animated){if(L===Z)return N(!1);if(L&&t===e.target&&(r=L),r&&(a=Rt(r)),$c(ct,t,Z,o,r,a,e,!!r)!==!1)return I(),t.appendChild(Z),ft=t,D(),N(!0)}else if(L&&cU(e,w,this)){var K=wa(t,0,d,!0);if(K===Z)return N(!1);if(r=K,a=Rt(r),$c(ct,t,Z,o,r,a,e,!1)!==!1)return I(),t.insertBefore(Z,K),ft=t,D(),N(!0)}else if(r.parentNode===t){a=Rt(r);var q=0,M,ce=Z.parentNode!==t,ae=!rU(Z.animated&&Z.toRect||o,r.animated&&r.toRect||a,w),X=w?"top":"left",ee=mv(r,"top","top")||mv(Z,"top","top"),ue=ee?ee.scrollTop:void 0;ji!==r&&(M=a[X],vs=!1,Vc=!ae&&d.invertSwap||ce),q=uU(e,r,a,w,ae?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,Vc,ji===r);var Be;if(q!==0){var Ct=nr(Z);do Ct-=q,Be=ft.children[Ct];while(Be&&(pe(Be,"display")==="none"||Be===we))}if(q===0||Be===r)return N(!1);ji=r,_s=q;var rn=r.nextElementSibling,qt=!1;qt=q===1;var Mt=$c(ct,t,Z,o,r,a,e,qt);if(Mt!==!1)return(Mt===1||Mt===-1)&&(qt=Mt===1),Bh=!0,setTimeout(sU,30),I(),qt&&!rn?t.appendChild(Z):r.parentNode.insertBefore(Z,qt?rn:r),ee&&sE(ee,0,ue-ee.scrollTop),ft=Z.parentNode,M!==void 0&&!Vc&&(ul=Math.abs(M-Rt(r)[X])),D(),N(!0)}if(t.contains(Z))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){xe(document,"mousemove",this._onTouchMove),xe(document,"touchmove",this._onTouchMove),xe(document,"pointermove",this._onTouchMove),xe(document,"dragover",si),xe(document,"mousemove",si),xe(document,"touchmove",si)},_offUpEvents:function(){var e=this.el.ownerDocument;xe(e,"mouseup",this._onDrop),xe(e,"touchend",this._onDrop),xe(e,"pointerup",this._onDrop),xe(e,"touchcancel",this._onDrop),xe(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(Rn=nr(Z),Do=nr(Z,r.draggable),pn("drop",this,{evt:e}),ft=Z&&Z.parentNode,Rn=nr(Z),Do=nr(Z,r.draggable),_e.eventCanceled){this._nulling();return}oa=!1,Vc=!1,vs=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Fh(this.cloneId),Fh(this._dragStartId),this.nativeDraggable&&(xe(document,"drop",this),xe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ms&&pe(document.body,"user-select",""),pe(Z,"transform",""),e&&(ss&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),we&&we.parentNode&&we.parentNode.removeChild(we),(ct===ft||zt&&zt.lastPutMode!=="clone")&&mt&&mt.parentNode&&mt.parentNode.removeChild(mt),Z&&(this.nativeDraggable&&xe(Z,"dragend",this),Jd(Z),Z.style["will-change"]="",ss&&!oa&&Nn(Z,zt?zt.options.ghostClass:this.options.ghostClass,!1),Nn(Z,this.options.chosenClass,!1),ln({sortable:this,name:"unchoose",toEl:ft,newIndex:null,newDraggableIndex:null,originalEvent:e}),ct!==ft?(Rn>=0&&(ln({rootEl:ft,name:"add",toEl:ft,fromEl:ct,originalEvent:e}),ln({sortable:this,name:"remove",toEl:ft,originalEvent:e}),ln({rootEl:ft,name:"sort",toEl:ft,fromEl:ct,originalEvent:e}),ln({sortable:this,name:"sort",toEl:ft,originalEvent:e})),zt&&zt.save()):Rn!==da&&Rn>=0&&(ln({sortable:this,name:"update",toEl:ft,originalEvent:e}),ln({sortable:this,name:"sort",toEl:ft,originalEvent:e})),_e.active&&((Rn==null||Rn===-1)&&(Rn=da,Do=ps),ln({sortable:this,name:"end",toEl:ft,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){pn("nulling",this),ct=Z=ft=we=ui=mt=ll=Lo=ai=fr=ss=Rn=Do=da=ps=ji=_s=zt=Fc=_e.dragged=_e.ghost=_e.clone=_e.active=null,Il.forEach(function(e){e.checked=!0}),Il.length=qd=jd=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Z&&(this._onDragOver(e),aU(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,o=0,a=r.length,c=this.options;o<a;o++)t=r[o],Lr(t,c.draggable,this.el,!1)&&e.push(t.getAttribute(c.dataIdAttr)||hU(t));return e},sort:function(e,t){var r={},o=this.el;this.toArray().forEach(function(a,c){var d=o.children[c];Lr(d,this.options.draggable,o,!1)&&(r[a]=d)},this),t&&this.captureAnimationState(),e.forEach(function(a){r[a]&&(o.removeChild(r[a]),o.appendChild(r[a]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Lr(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var o=Vs.modifyOption(this,e,t);typeof o<"u"?r[e]=o:r[e]=t,e==="group"&&dE(r)},destroy:function(){pn("destroy",this);var e=this.el;e[xn]=null,xe(e,"mousedown",this._onTapStart),xe(e,"touchstart",this._onTapStart),xe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(xe(e,"dragover",this),xe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bl.splice(bl.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Lo){if(pn("hideClone",this),_e.eventCanceled)return;pe(mt,"display","none"),this.options.removeCloneOnHide&&mt.parentNode&&mt.parentNode.removeChild(mt),Lo=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Lo){if(pn("showClone",this),_e.eventCanceled)return;Z.parentNode==ct&&!this.options.group.revertClone?ct.insertBefore(mt,Z):ui?ct.insertBefore(mt,ui):ct.appendChild(mt),this.options.group.revertClone&&this.animate(Z,mt),pe(mt,"display",""),Lo=!1}}};function aU(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function $c(n,e,t,r,o,a,c,d){var h,m=n[xn],g=m.options.onMove,_;return window.CustomEvent&&!po&&!Fs?h=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent("move",!0,!0)),h.to=e,h.from=n,h.dragged=t,h.draggedRect=r,h.related=o||e,h.relatedRect=a||Rt(e),h.willInsertAfter=d,h.originalEvent=c,n.dispatchEvent(h),g&&(_=g.call(m,h,c)),_}function Jd(n){n.draggable=!1}function sU(){Bh=!1}function cU(n,e,t){var r=Rt(wa(t.el,0,t.options,!0)),o=10;return e?n.clientX<r.left-o||n.clientY<r.top&&n.clientX<r.right:n.clientY<r.top-o||n.clientY<r.bottom&&n.clientX<r.left}function lU(n,e,t){var r=Rt(xf(t.el,t.options.draggable)),o=10;return e?n.clientX>r.right+o||n.clientX<=r.right&&n.clientY>r.bottom&&n.clientX>=r.left:n.clientX>r.right&&n.clientY>r.top||n.clientX<=r.right&&n.clientY>r.bottom+o}function uU(n,e,t,r,o,a,c,d){var h=r?n.clientY:n.clientX,m=r?t.height:t.width,g=r?t.top:t.left,_=r?t.bottom:t.right,p=!1;if(!c){if(d&&ul<m*o){if(!vs&&(_s===1?h>g+m*a/2:h<_-m*a/2)&&(vs=!0),vs)p=!0;else if(_s===1?h<g+ul:h>_-ul)return-_s}else if(h>g+m*(1-o)/2&&h<_-m*(1-o)/2)return dU(e)}return p=p||c,p&&(h<g+m*a/2||h>_-m*a/2)?h>g+m/2?1:-1:0}function dU(n){return nr(Z)<nr(n)?1:-1}function hU(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function fU(n){Il.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&Il.push(r)}}function dl(n){return setTimeout(n,0)}function Fh(n){return clearTimeout(n)}Zl&&Ve(document,"touchmove",function(n){(_e.active||oa)&&n.cancelable&&n.preventDefault()});_e.utils={on:Ve,off:xe,css:pe,find:iE,is:function(e,t){return!!Lr(e,t,e,!1)},extend:Yx,throttle:aE,closest:Lr,toggleClass:Nn,clone:cE,index:nr,nextTick:dl,cancelNextTick:Fh,detectDirection:uE,getChild:wa};_e.get=function(n){return n[xn]};_e.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(_e.utils=Wr(Wr({},_e.utils),r.utils)),Vs.mount(r)})};_e.create=function(n,e){return new _e(n,e)};_e.version=zx;var wt=[],cs,Vh,Hh=!1,Qd,Xd,Sl,ls;function mU(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?Ve(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ve(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Ve(document,"touchmove",this._handleFallbackAutoScroll):Ve(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?xe(document,"dragover",this._handleAutoScroll):(xe(document,"pointermove",this._handleFallbackAutoScroll),xe(document,"touchmove",this._handleFallbackAutoScroll),xe(document,"mousemove",this._handleFallbackAutoScroll)),yv(),hl(),Jx()},nulling:function(){Sl=Vh=cs=Hh=ls=Qd=Xd=null,wt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var o=this,a=(t.touches?t.touches[0]:t).clientX,c=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(a,c);if(Sl=t,r||this.options.forceAutoScrollFallback||Fs||po||ms){Zd(t,this.options,d,r);var h=Fo(d,!0);Hh&&(!ls||a!==Qd||c!==Xd)&&(ls&&yv(),ls=setInterval(function(){var m=Fo(document.elementFromPoint(a,c),!0);m!==h&&(h=m,hl()),Zd(t,o.options,m,r)},10),Qd=a,Xd=c)}else{if(!this.options.bubbleScroll||Fo(d,!0)===$r()){hl();return}Zd(t,this.options,Fo(d,!1),!1)}}},mo(n,{pluginName:"scroll",initializeByDefault:!0})}function hl(){wt.forEach(function(n){clearInterval(n.pid)}),wt=[]}function yv(){clearInterval(ls)}var Zd=aE(function(n,e,t,r){if(e.scroll){var o=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,c=e.scrollSensitivity,d=e.scrollSpeed,h=$r(),m=!1,g;Vh!==t&&(Vh=t,hl(),cs=e.scroll,g=e.scrollFn,cs===!0&&(cs=Fo(t,!0)));var _=0,p=cs;do{var w=p,C=Rt(w),T=C.top,k=C.bottom,I=C.left,N=C.right,D=C.width,L=C.height,K=void 0,q=void 0,M=w.scrollWidth,ce=w.scrollHeight,ae=pe(w),X=w.scrollLeft,ee=w.scrollTop;w===h?(K=D<M&&(ae.overflowX==="auto"||ae.overflowX==="scroll"||ae.overflowX==="visible"),q=L<ce&&(ae.overflowY==="auto"||ae.overflowY==="scroll"||ae.overflowY==="visible")):(K=D<M&&(ae.overflowX==="auto"||ae.overflowX==="scroll"),q=L<ce&&(ae.overflowY==="auto"||ae.overflowY==="scroll"));var ue=K&&(Math.abs(N-o)<=c&&X+D<M)-(Math.abs(I-o)<=c&&!!X),Be=q&&(Math.abs(k-a)<=c&&ee+L<ce)-(Math.abs(T-a)<=c&&!!ee);if(!wt[_])for(var Ct=0;Ct<=_;Ct++)wt[Ct]||(wt[Ct]={});(wt[_].vx!=ue||wt[_].vy!=Be||wt[_].el!==w)&&(wt[_].el=w,wt[_].vx=ue,wt[_].vy=Be,clearInterval(wt[_].pid),(ue!=0||Be!=0)&&(m=!0,wt[_].pid=setInterval((function(){r&&this.layer===0&&_e.active._onTouchMove(Sl);var rn=wt[this.layer].vy?wt[this.layer].vy*d:0,qt=wt[this.layer].vx?wt[this.layer].vx*d:0;typeof g=="function"&&g.call(_e.dragged.parentNode[xn],qt,rn,n,Sl,wt[this.layer].el)!=="continue"||sE(wt[this.layer].el,qt,rn)}).bind({layer:_}),24))),_++}while(e.bubbleScroll&&p!==h&&(p=Fo(p,!1)));Hh=m}},30),mE=function(e){var t=e.originalEvent,r=e.putSortable,o=e.dragEl,a=e.activeSortable,c=e.dispatchSortableEvent,d=e.hideGhostForTarget,h=e.unhideGhostForTarget;if(t){var m=r||a;d();var g=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,_=document.elementFromPoint(g.clientX,g.clientY);h(),m&&!m.el.contains(_)&&(c("spill"),this.onSpill({dragEl:o,putSortable:r}))}};function Uf(){}Uf.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var o=wa(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:mE};mo(Uf,{pluginName:"revertOnSpill"});function Bf(){}Bf.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,o=r||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:mE};mo(Bf,{pluginName:"removeOnSpill"});_e.mount(new mU);_e.mount(Bf,Uf);function gU(){return typeof window<"u"?window.console:global.console}const pU=gU();function _U(n){const e=Object.create(null);return function(r){return e[r]||(e[r]=n(r))}}const vU=/-(\w)/g,Cv=_U(n=>n.replace(vU,(e,t)=>t?t.toUpperCase():""));function eh(n){n.parentElement!==null&&n.parentElement.removeChild(n)}function Ev(n,e,t){const r=t===0?n.children[0]:n.children[t-1].nextSibling;n.insertBefore(e,r)}function yU(n,e){return Object.values(n).indexOf(e)}function CU(n,e,t,r){if(!n)return[];const o=Object.values(n),a=e.length-r;return[...e].map((d,h)=>h>=a?o.length:o.indexOf(d))}function gE(n,e){this.$nextTick(()=>this.$emit(n.toLowerCase(),e))}function EU(n){return e=>{this.realList!==null&&this["onDrag"+n](e),gE.call(this,n,e)}}function wU(n){return["transition-group","TransitionGroup"].includes(n)}function TU(n){if(!n||n.length!==1)return!1;const[{type:e}]=n;return e?wU(e.name):!1}function bU(n,e){return e?{...e.props,...e.attrs}:n}const $h=["Start","Add","Remove","Update","End"],Kh=["Choose","Unchoose","Sort","Filter","Clone"],IU=["Move",...$h,...Kh].map(n=>"on"+n);let th=null;const SU={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:n=>n},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},AU=l.defineComponent({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...$h.map(n=>n.toLowerCase()),...Kh.map(n=>n.toLowerCase())],props:SU,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const n=this.$slots.default?this.$slots.default():null,e=bU(this.$attrs,this.componentData);return n?(this.transitionMode=TU(n),l.h(this.getTag(),e,n)):l.h(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&pU.error("list props are mutually exclusive! Please set one.")},mounted(){const n={};$h.forEach(o=>{n["on"+o]=EU.call(this,o)}),Kh.forEach(o=>{n["on"+o]=gE.bind(this,o)});const e=Object.keys(this.$attrs).reduce((o,a)=>(o[Cv(a)]=this.$attrs[a],o),{}),t=Object.assign({},e,n,{onMove:(o,a)=>this.onDragMove(o,a)});!("draggable"in t)&&(t.draggable=">*");const r=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new _e(r,t),r.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(n){this.updateOptions(n)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?l.resolveComponent(this.component):this.tag},updateOptions(n){for(var e in n){const t=Cv(e);IU.indexOf(t)===-1&&this._sortable.option(t,n[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=CU(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(n){const e=yU(this.getChildrenNodes()||[],n);if(e===-1)return null;const t=this.realList[e];return{index:e,element:t}},emitChanges(n){this.$nextTick(()=>{this.$emit("change",n)})},alterList(n){if(this.list){n(this.list);return}const e=[...this.modelValue];n(e),this.$emit("update:modelValue",e)},spliceList(){const n=e=>e.splice(...arguments);this.alterList(n)},updatePosition(n,e){const t=r=>r.splice(e,0,r.splice(n,1)[0]);this.alterList(t)},getVmIndex(n){const e=this.visibleIndexes,t=e.length;return n>t-1?t:e[n]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(n){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[n].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(n){this.computeIndexes(),this.context=this.getUnderlyingVm(n.item),this.context&&(n.item._underlying_vm_=this.clone(this.context.element),th=n.item)},onDragAdd(n){const e=n.item._underlying_vm_;if(e===void 0)return;eh(n.item);const t=this.getVmIndex(n.newIndex);this.spliceList(t,0,e),this.computeIndexes();const r={element:e,newIndex:t};this.emitChanges({added:r})},onDragRemove(n){if(Ev(this.$el,n.item,n.oldIndex),n.pullMode==="clone"){eh(n.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const t={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:t})},onDragUpdate(n){eh(n.item),Ev(n.from,n.item,n.oldIndex);const e=this.context.index,t=this.getVmIndex(n.newIndex);this.updatePosition(e,t);const r={element:this.context.element,oldIndex:e,newIndex:t};this.emitChanges({moved:r})},updateProperty(n,e){n.hasOwnProperty(e)&&(n[e]+=this.headerOffset)},onDragMove(n,e){const t=this.move;if(!t||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(n),o=this.context,a=this.computeFutureIndex(r,n);Object.assign(o,{futureIndex:a});const c=Object.assign({},n,{relatedContext:r,draggedContext:o});return t(c,e)},onDragEnd(){this.computeIndexes(),th=null},getTrargetedComponent(n){return n.__draggable_component__},getRelatedContextFromMoveEvent({to:n,related:e}){const t=this.getTrargetedComponent(n);if(!t)return{component:t};const r=t.realList,o={list:r,component:t};if(n!==e&&r&&t.getUnderlyingVm){const a=t.getUnderlyingVm(e);if(a)return Object.assign(a,o)}return o},computeFutureIndex(n,e){const t=[...e.to.children].filter(c=>c.style.display!=="none");if(t.length===0)return 0;const r=t.indexOf(e.related),o=n.component.getVmIndex(r);return t.indexOf(th)!==-1||!e.willInsertAfter?o:o+1}}}),kU={class:"d-flex flex-row align-center"},Ff=l.defineComponent({__name:"ColumnSettingsDialog",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const e=l.useModel(n,"modelValue"),t=l.ref(""),r=l.computed(()=>{var a;return(a=e.value)==null?void 0:a.filter(c=>c.title.toLowerCase().includes(t.value.toLowerCase()))}),{t:o}=br();return(a,c)=>{const d=l.resolveComponent("v-list-item-content");return l.openBlock(),l.createBlock(Us,{"dd-id":"col-settings",buttons:!1,title:l.unref(o)("dialogs.columnSettings.title")},{default:l.withCtx(()=>[l.createVNode(Xl,{modelValue:t.value,"onUpdate:modelValue":c[0]||(c[0]=h=>t.value=h)},null,8,["modelValue"]),l.createVNode(Qt.VList,null,{default:l.withCtx(()=>[l.createVNode(l.unref(AU),{list:r.value,animation:200,"ghost-class":"ghost-card"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,h=>(l.openBlock(),l.createBlock(Qt.VListItem,{key:h.key,class:"pa-0"},{default:l.withCtx(()=>[l.createElementVNode("div",kU,[l.createVNode(l.unref(hP),{class:"cursor-grab mb-2"}),l.createVNode(Qt.VListItemAction,null,{default:l.withCtx(()=>[l.createVNode(IO.VCheckbox,{modelValue:h.checked,"onUpdate:modelValue":m=>h.checked=m},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),l.createVNode(d,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,{class:"mb-1"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.title)+"  ",1)]),_:2},1024)]),_:2},1024),h.icon?(l.openBlock(),l.createBlock(vl.VIcon,{key:0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.icon),1)]),_:2},1024)):l.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:1},8,["list"])]),_:1})]),_:1},8,["title"])}}}),NU=["src","height","width"],RU={key:0,class:"text-center text-h6"},OU={key:1,class:"text-center text-h5"},PU={key:0,class:"text-center"},MU={class:"d-flex justify-center align-center mt-4 ga-3"},Vf=l.defineComponent({__name:"TableCard",props:{item:{},columns:{},size:{},image:{},tags:{},route:{},callback:{type:Function}},setup(n){const e=n,t=()=>{var o;return((o=e.columns.find(a=>a.isHeader))==null?void 0:o.key)||""},r=()=>{var o;return((o=e.columns.find(a=>a.isSubtitle))==null?void 0:o.key)||""};return(o,a)=>(l.openBlock(),l.createBlock(xt.VCard,{onClick:o.callback,ripple:"",class:"d-flex flex-column pa-4pa-4 bg-containerBg"},{default:l.withCtx(()=>[l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[l.createVNode(Qe.VRow,{"no-gutters":"",align:"center",justify:"end"},{default:l.withCtx(()=>[l.renderSlot(o.$slots,"actions",{item:o.item})]),_:3})]),_:3}),l.createVNode(xt.VCardTitle,null,{default:l.withCtx(()=>[l.createVNode(Qe.VRow,{"no-gutters":"",align:"center",justify:"center"},{default:l.withCtx(()=>[o.image?(l.openBlock(),l.createElementBlock("img",{key:0,src:o.image,height:o.size,width:o.size,alt:""},null,8,NU)):l.createCommentVNode("",!0)]),_:1})]),_:1}),t()?(l.openBlock(),l.createElementBlock("div",RU,l.toDisplayString(o.item[t()]),1)):l.createCommentVNode("",!0),r()?(l.openBlock(),l.createElementBlock("div",OU,l.toDisplayString(o.item[r()]),1)):l.createCommentVNode("",!0),l.createVNode(pi.VDivider,{class:"ma-3"}),l.createVNode(xt.VCardText,{class:"d-flex flex-column align-center pa-4 pt-1"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.columns,c=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:c.key},[o.item[c.key]&&!c.isHeader&&!c.isSubtitle?(l.openBlock(),l.createElementBlock("div",PU,l.toDisplayString(c.title)+": "+l.toDisplayString(o.item[c.key]),1)):l.createCommentVNode("",!0)],64))),128)),l.createElementVNode("div",MU,[o.tags?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(o.tags,c=>(l.openBlock(),l.createBlock(SO.VChip,{class:"pa-3",key:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(c),1)]),_:2},1024))),128)):l.createCommentVNode("",!0)])]),_:1})]),_:3},8,["onClick"]))}}),DU=l.defineComponent({__name:"TableCardsView",props:{data:{},columns:{},size:{},itemKey:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(Qe.VRow,{class:"mt-5 border tb-cards-h",wrap:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.data,r=>(l.openBlock(),l.createBlock(Qe.VCol,{cols:"12",sm:"6",md:"4",lg:"3",class:"pa-2",key:r[e.itemKey]},{default:l.withCtx(()=>[l.createVNode(Vf,{item:r,columns:e.columns,size:e.size},{actions:l.withCtx(({item:o})=>[l.renderSlot(e.$slots,"actions",{item:o},void 0,!0)]),_:2},1032,["item","columns","size"])]),_:2},1024))),128))]),_:3}))}}),pE=Aa(DU,[["__scopeId","data-v-e1a4ccbc"]]),LU={key:0,class:"mb-2 ms-1"},_E=l.defineComponent({__name:"JTextField",props:l.mergeModels({name:{},label:{},type:{default:"text"},readonly:{type:Boolean},density:{},rules:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=l.useModel(n,"modelValue"),t=n,r=l.computed(()=>t.readonly?"solo":"solo-filled");return(o,a)=>(l.openBlock(),l.createElementBlock("div",null,[o.name?(l.openBlock(),l.createElementBlock("p",LU,l.toDisplayString(o.name),1)):l.createCommentVNode("",!0),o.label?(l.openBlock(),l.createBlock(va.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(o.label),1)]),_:1})):l.createCommentVNode("",!0),l.createVNode(l.unref(Vo.VTextField),{variant:r.value,color:"secondary","bg-color":"containerBg",rounded:"sm",type:o.type,density:o.density,rules:o.rules,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=c=>e.value=c),class:"j-field",readonly:o.readonly},null,8,["variant","type","density","rules","modelValue","readonly"])]))}});function vE(n,e){return function(){return n.apply(e,arguments)}}const{toString:xU}=Object.prototype,{getPrototypeOf:Hf}=Object,eu=(n=>e=>{const t=xU.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ir=n=>(n=n.toLowerCase(),e=>eu(e)===n),tu=n=>e=>typeof e===n,{isArray:Na}=Array,Ps=tu("undefined");function UU(n){return n!==null&&!Ps(n)&&n.constructor!==null&&!Ps(n.constructor)&&Fn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const yE=Ir("ArrayBuffer");function BU(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&yE(n.buffer),e}const FU=tu("string"),Fn=tu("function"),CE=tu("number"),nu=n=>n!==null&&typeof n=="object",VU=n=>n===!0||n===!1,fl=n=>{if(eu(n)!=="object")return!1;const e=Hf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},HU=Ir("Date"),$U=Ir("File"),KU=Ir("Blob"),WU=Ir("FileList"),zU=n=>nu(n)&&Fn(n.pipe),GU=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Fn(n.append)&&((e=eu(n))==="formdata"||e==="object"&&Fn(n.toString)&&n.toString()==="[object FormData]"))},qU=Ir("URLSearchParams"),[jU,YU,JU,QU]=["ReadableStream","Request","Response","Headers"].map(Ir),XU=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hs(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,o;if(typeof n!="object"&&(n=[n]),Na(n))for(r=0,o=n.length;r<o;r++)e.call(null,n[r],r,n);else{const a=t?Object.getOwnPropertyNames(n):Object.keys(n),c=a.length;let d;for(r=0;r<c;r++)d=a[r],e.call(null,n[d],d,n)}}function EE(n,e){e=e.toLowerCase();const t=Object.keys(n);let r=t.length,o;for(;r-- >0;)if(o=t[r],e===o.toLowerCase())return o;return null}const mi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wE=n=>!Ps(n)&&n!==mi;function Wh(){const{caseless:n}=wE(this)&&this||{},e={},t=(r,o)=>{const a=n&&EE(e,o)||o;fl(e[a])&&fl(r)?e[a]=Wh(e[a],r):fl(r)?e[a]=Wh({},r):Na(r)?e[a]=r.slice():e[a]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Hs(arguments[r],t);return e}const ZU=(n,e,t,{allOwnKeys:r}={})=>(Hs(e,(o,a)=>{t&&Fn(o)?n[a]=vE(o,t):n[a]=o},{allOwnKeys:r}),n),eB=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),tB=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},nB=(n,e,t,r)=>{let o,a,c;const d={};if(e=e||{},n==null)return e;do{for(o=Object.getOwnPropertyNames(n),a=o.length;a-- >0;)c=o[a],(!r||r(c,n,e))&&!d[c]&&(e[c]=n[c],d[c]=!0);n=t!==!1&&Hf(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},rB=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},oB=n=>{if(!n)return null;if(Na(n))return n;let e=n.length;if(!CE(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},iB=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Hf(Uint8Array)),aB=(n,e)=>{const r=(n&&n[Symbol.iterator]).call(n);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(n,a[0],a[1])}},sB=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},cB=Ir("HTMLFormElement"),lB=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),wv=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),uB=Ir("RegExp"),TE=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};Hs(t,(o,a)=>{let c;(c=e(o,a,n))!==!1&&(r[a]=c||o)}),Object.defineProperties(n,r)},dB=n=>{TE(n,(e,t)=>{if(Fn(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if(Fn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},hB=(n,e)=>{const t={},r=o=>{o.forEach(a=>{t[a]=!0})};return Na(n)?r(n):r(String(n).split(e)),t},fB=()=>{},mB=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,nh="abcdefghijklmnopqrstuvwxyz",Tv="0123456789",bE={DIGIT:Tv,ALPHA:nh,ALPHA_DIGIT:nh+nh.toUpperCase()+Tv},gB=(n=16,e=bE.ALPHA_DIGIT)=>{let t="";const{length:r}=e;for(;n--;)t+=e[Math.random()*r|0];return t};function pB(n){return!!(n&&Fn(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const _B=n=>{const e=new Array(10),t=(r,o)=>{if(nu(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const a=Na(r)?[]:{};return Hs(r,(c,d)=>{const h=t(c,o+1);!Ps(h)&&(a[d]=h)}),e[o]=void 0,a}}return r};return t(n,0)},vB=Ir("AsyncFunction"),yB=n=>n&&(nu(n)||Fn(n))&&Fn(n.then)&&Fn(n.catch),IE=((n,e)=>n?setImmediate:e?((t,r)=>(mi.addEventListener("message",({source:o,data:a})=>{o===mi&&a===t&&r.length&&r.shift()()},!1),o=>{r.push(o),mi.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Fn(mi.postMessage)),CB=typeof queueMicrotask<"u"?queueMicrotask.bind(mi):typeof process<"u"&&process.nextTick||IE,B={isArray:Na,isArrayBuffer:yE,isBuffer:UU,isFormData:GU,isArrayBufferView:BU,isString:FU,isNumber:CE,isBoolean:VU,isObject:nu,isPlainObject:fl,isReadableStream:jU,isRequest:YU,isResponse:JU,isHeaders:QU,isUndefined:Ps,isDate:HU,isFile:$U,isBlob:KU,isRegExp:uB,isFunction:Fn,isStream:zU,isURLSearchParams:qU,isTypedArray:iB,isFileList:WU,forEach:Hs,merge:Wh,extend:ZU,trim:XU,stripBOM:eB,inherits:tB,toFlatObject:nB,kindOf:eu,kindOfTest:Ir,endsWith:rB,toArray:oB,forEachEntry:aB,matchAll:sB,isHTMLForm:cB,hasOwnProperty:wv,hasOwnProp:wv,reduceDescriptors:TE,freezeMethods:dB,toObjectSet:hB,toCamelCase:lB,noop:fB,toFiniteNumber:mB,findKey:EE,global:mi,isContextDefined:wE,ALPHABET:bE,generateString:gB,isSpecCompliantForm:pB,toJSONObject:_B,isAsyncFn:vB,isThenable:yB,setImmediate:IE,asap:CB};function Te(n,e,t,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}B.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const SE=Te.prototype,AE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{AE[n]={value:n}});Object.defineProperties(Te,AE);Object.defineProperty(SE,"isAxiosError",{value:!0});Te.from=(n,e,t,r,o,a)=>{const c=Object.create(SE);return B.toFlatObject(n,c,function(h){return h!==Error.prototype},d=>d!=="isAxiosError"),Te.call(c,n.message,e,t,r,o),c.cause=n,c.name=n.name,a&&Object.assign(c,a),c};const EB=null;function zh(n){return B.isPlainObject(n)||B.isArray(n)}function kE(n){return B.endsWith(n,"[]")?n.slice(0,-2):n}function bv(n,e,t){return n?n.concat(e).map(function(o,a){return o=kE(o),!t&&a?"["+o+"]":o}).join(t?".":""):e}function wB(n){return B.isArray(n)&&!n.some(zh)}const TB=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function ru(n,e,t){if(!B.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=B.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,k){return!B.isUndefined(k[T])});const r=t.metaTokens,o=t.visitor||g,a=t.dots,c=t.indexes,h=(t.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(o))throw new TypeError("visitor must be a function");function m(C){if(C===null)return"";if(B.isDate(C))return C.toISOString();if(!h&&B.isBlob(C))throw new Te("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(C)||B.isTypedArray(C)?h&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function g(C,T,k){let I=C;if(C&&!k&&typeof C=="object"){if(B.endsWith(T,"{}"))T=r?T:T.slice(0,-2),C=JSON.stringify(C);else if(B.isArray(C)&&wB(C)||(B.isFileList(C)||B.endsWith(T,"[]"))&&(I=B.toArray(C)))return T=kE(T),I.forEach(function(D,L){!(B.isUndefined(D)||D===null)&&e.append(c===!0?bv([T],L,a):c===null?T:T+"[]",m(D))}),!1}return zh(C)?!0:(e.append(bv(k,T,a),m(C)),!1)}const _=[],p=Object.assign(TB,{defaultVisitor:g,convertValue:m,isVisitable:zh});function w(C,T){if(!B.isUndefined(C)){if(_.indexOf(C)!==-1)throw Error("Circular reference detected in "+T.join("."));_.push(C),B.forEach(C,function(I,N){(!(B.isUndefined(I)||I===null)&&o.call(e,I,B.isString(N)?N.trim():N,T,p))===!0&&w(I,T?T.concat(N):[N])}),_.pop()}}if(!B.isObject(n))throw new TypeError("data must be an object");return w(n),e}function Iv(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function $f(n,e){this._pairs=[],n&&ru(n,this,e)}const NE=$f.prototype;NE.append=function(e,t){this._pairs.push([e,t])};NE.toString=function(e){const t=e?function(r){return e.call(this,r,Iv)}:Iv;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};function bB(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function RE(n,e,t){if(!e)return n;const r=t&&t.encode||bB;B.isFunction(t)&&(t={serialize:t});const o=t&&t.serialize;let a;if(o?a=o(e,t):a=B.isURLSearchParams(e)?e.toString():new $f(e,t).toString(r),a){const c=n.indexOf("#");c!==-1&&(n=n.slice(0,c)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n}class Sv{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(r){r!==null&&e(r)})}}const OE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},IB=typeof URLSearchParams<"u"?URLSearchParams:$f,SB=typeof FormData<"u"?FormData:null,AB=typeof Blob<"u"?Blob:null,kB={isBrowser:!0,classes:{URLSearchParams:IB,FormData:SB,Blob:AB},protocols:["http","https","file","blob","url","data"]},Kf=typeof window<"u"&&typeof document<"u",Gh=typeof navigator=="object"&&navigator||void 0,NB=Kf&&(!Gh||["ReactNative","NativeScript","NS"].indexOf(Gh.product)<0),RB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OB=Kf&&window.location.href||"http://localhost",PB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Kf,hasStandardBrowserEnv:NB,hasStandardBrowserWebWorkerEnv:RB,navigator:Gh,origin:OB},Symbol.toStringTag,{value:"Module"})),nn={...PB,...kB};function MB(n,e){return ru(n,new nn.classes.URLSearchParams,Object.assign({visitor:function(t,r,o,a){return nn.isNode&&B.isBuffer(t)?(this.append(r,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function DB(n){return B.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function LB(n){const e={},t=Object.keys(n);let r;const o=t.length;let a;for(r=0;r<o;r++)a=t[r],e[a]=n[a];return e}function PE(n){function e(t,r,o,a){let c=t[a++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),h=a>=t.length;return c=!c&&B.isArray(o)?o.length:c,h?(B.hasOwnProp(o,c)?o[c]=[o[c],r]:o[c]=r,!d):((!o[c]||!B.isObject(o[c]))&&(o[c]=[]),e(t,r,o[c],a)&&B.isArray(o[c])&&(o[c]=LB(o[c])),!d)}if(B.isFormData(n)&&B.isFunction(n.entries)){const t={};return B.forEachEntry(n,(r,o)=>{e(DB(r),o,t,0)}),t}return null}function xB(n,e,t){if(B.isString(n))try{return(e||JSON.parse)(n),B.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(n)}const $s={transitional:OE,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,a=B.isObject(e);if(a&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return o?JSON.stringify(PE(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e)||B.isReadableStream(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return MB(e,this.formSerializer).toString();if((d=B.isFileList(e))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ru(d?{"files[]":e}:e,h&&new h,this.formSerializer)}}return a||o?(t.setContentType("application/json",!1),xB(e)):e}],transformResponse:[function(e){const t=this.transitional||$s.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(B.isResponse(e)||B.isReadableStream(e))return e;if(e&&B.isString(e)&&(r&&!this.responseType||o)){const c=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(d){if(c)throw d.name==="SyntaxError"?Te.from(d,Te.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nn.classes.FormData,Blob:nn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],n=>{$s.headers[n]={}});const UB=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BB=n=>{const e={};let t,r,o;return n&&n.split(`
41
+ */function dv(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(n,o).enumerable})),t.push.apply(t,r)}return t}function Wr(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?dv(Object(t),!0).forEach(function(r){$x(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):dv(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function cl(n){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?cl=function(e){return typeof e}:cl=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cl(n)}function $x(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mo(){return mo=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},mo.apply(this,arguments)}function Kx(n,e){if(n==null)return{};var t={},r=Object.keys(n),o,a;for(a=0;a<r.length;a++)o=r[a],!(e.indexOf(o)>=0)&&(t[o]=n[o]);return t}function Wx(n,e){if(n==null)return{};var t=Kx(n,e),r,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(o=0;o<a.length;o++)r=a[o],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(n,r)&&(t[r]=n[r])}return t}var zx="1.14.0";function ho(n){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(n)}var po=ho(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Fs=ho(/Edge/i),hv=ho(/firefox/i),ms=ho(/safari/i)&&!ho(/chrome/i)&&!ho(/android/i),rE=ho(/iP(ad|od|hone)/i),Gx=ho(/chrome/i)&&ho(/android/i),oE={capture:!1,passive:!1};function Ve(n,e,t){n.addEventListener(e,t,!po&&oE)}function xe(n,e,t){n.removeEventListener(e,t,!po&&oE)}function wl(n,e){if(e){if(e[0]===">"&&(e=e.substring(1)),n)try{if(n.matches)return n.matches(e);if(n.msMatchesSelector)return n.msMatchesSelector(e);if(n.webkitMatchesSelector)return n.webkitMatchesSelector(e)}catch{return!1}return!1}}function qx(n){return n.host&&n!==document&&n.host.nodeType?n.host:n.parentNode}function Lr(n,e,t,r){if(n){t=t||document;do{if(e!=null&&(e[0]===">"?n.parentNode===t&&wl(n,e):wl(n,e))||r&&n===t)return n;if(n===t)break}while(n=qx(n))}return null}var fv=/\s+/g;function Nn(n,e,t){if(n&&e)if(n.classList)n.classList[t?"add":"remove"](e);else{var r=(" "+n.className+" ").replace(fv," ").replace(" "+e+" "," ");n.className=(r+(t?" "+e:"")).replace(fv," ")}}function pe(n,e,t){var r=n&&n.style;if(r){if(t===void 0)return document.defaultView&&document.defaultView.getComputedStyle?t=document.defaultView.getComputedStyle(n,""):n.currentStyle&&(t=n.currentStyle),e===void 0?t:t[e];!(e in r)&&e.indexOf("webkit")===-1&&(e="-webkit-"+e),r[e]=t+(typeof t=="string"?"":"px")}}function ga(n,e){var t="";if(typeof n=="string")t=n;else do{var r=pe(n,"transform");r&&r!=="none"&&(t=r+" "+t)}while(!e&&(n=n.parentNode));var o=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return o&&new o(t)}function iE(n,e,t){if(n){var r=n.getElementsByTagName(e),o=0,a=r.length;if(t)for(;o<a;o++)t(r[o],o);return r}return[]}function $r(){var n=document.scrollingElement;return n||document.documentElement}function Rt(n,e,t,r,o){if(!(!n.getBoundingClientRect&&n!==window)){var a,c,d,h,m,g,_;if(n!==window&&n.parentNode&&n!==$r()?(a=n.getBoundingClientRect(),c=a.top,d=a.left,h=a.bottom,m=a.right,g=a.height,_=a.width):(c=0,d=0,h=window.innerHeight,m=window.innerWidth,g=window.innerHeight,_=window.innerWidth),(e||t)&&n!==window&&(o=o||n.parentNode,!po))do if(o&&o.getBoundingClientRect&&(pe(o,"transform")!=="none"||t&&pe(o,"position")!=="static")){var p=o.getBoundingClientRect();c-=p.top+parseInt(pe(o,"border-top-width")),d-=p.left+parseInt(pe(o,"border-left-width")),h=c+a.height,m=d+a.width;break}while(o=o.parentNode);if(r&&n!==window){var w=ga(o||n),C=w&&w.a,T=w&&w.d;w&&(c/=T,d/=C,_/=C,g/=T,h=c+g,m=d+_)}return{top:c,left:d,bottom:h,right:m,width:_,height:g}}}function mv(n,e,t){for(var r=Fo(n,!0),o=Rt(n)[e];r;){var a=Rt(r)[t],c=void 0;if(c=o>=a,!c)return r;if(r===$r())break;r=Fo(r,!1)}return!1}function wa(n,e,t,r){for(var o=0,a=0,c=n.children;a<c.length;){if(c[a].style.display!=="none"&&c[a]!==_e.ghost&&(r||c[a]!==_e.dragged)&&Lr(c[a],t.draggable,n,!1)){if(o===e)return c[a];o++}a++}return null}function xf(n,e){for(var t=n.lastElementChild;t&&(t===_e.ghost||pe(t,"display")==="none"||e&&!wl(t,e));)t=t.previousElementSibling;return t||null}function nr(n,e){var t=0;if(!n||!n.parentNode)return-1;for(;n=n.previousElementSibling;)n.nodeName.toUpperCase()!=="TEMPLATE"&&n!==_e.clone&&(!e||wl(n,e))&&t++;return t}function gv(n){var e=0,t=0,r=$r();if(n)do{var o=ga(n),a=o.a,c=o.d;e+=n.scrollLeft*a,t+=n.scrollTop*c}while(n!==r&&(n=n.parentNode));return[e,t]}function jx(n,e){for(var t in n)if(n.hasOwnProperty(t)){for(var r in e)if(e.hasOwnProperty(r)&&e[r]===n[t][r])return Number(t)}return-1}function Fo(n,e){if(!n||!n.getBoundingClientRect)return $r();var t=n,r=!1;do if(t.clientWidth<t.scrollWidth||t.clientHeight<t.scrollHeight){var o=pe(t);if(t.clientWidth<t.scrollWidth&&(o.overflowX=="auto"||o.overflowX=="scroll")||t.clientHeight<t.scrollHeight&&(o.overflowY=="auto"||o.overflowY=="scroll")){if(!t.getBoundingClientRect||t===document.body)return $r();if(r||e)return t;r=!0}}while(t=t.parentNode);return $r()}function Yx(n,e){if(n&&e)for(var t in e)e.hasOwnProperty(t)&&(n[t]=e[t]);return n}function zd(n,e){return Math.round(n.top)===Math.round(e.top)&&Math.round(n.left)===Math.round(e.left)&&Math.round(n.height)===Math.round(e.height)&&Math.round(n.width)===Math.round(e.width)}var gs;function aE(n,e){return function(){if(!gs){var t=arguments,r=this;t.length===1?n.call(r,t[0]):n.apply(r,t),gs=setTimeout(function(){gs=void 0},e)}}}function Jx(){clearTimeout(gs),gs=void 0}function sE(n,e,t){n.scrollLeft+=e,n.scrollTop+=t}function cE(n){var e=window.Polymer,t=window.jQuery||window.Zepto;return e&&e.dom?e.dom(n).cloneNode(!0):t?t(n).clone(!0)[0]:n.cloneNode(!0)}var xn="Sortable"+new Date().getTime();function Qx(){var n=[],e;return{captureAnimationState:function(){if(n=[],!!this.options.animation){var r=[].slice.call(this.el.children);r.forEach(function(o){if(!(pe(o,"display")==="none"||o===_e.ghost)){n.push({target:o,rect:Rt(o)});var a=Wr({},n[n.length-1].rect);if(o.thisAnimationDuration){var c=ga(o,!0);c&&(a.top-=c.f,a.left-=c.e)}o.fromRect=a}})}},addAnimationState:function(r){n.push(r)},removeAnimationState:function(r){n.splice(jx(n,{target:r}),1)},animateAll:function(r){var o=this;if(!this.options.animation){clearTimeout(e),typeof r=="function"&&r();return}var a=!1,c=0;n.forEach(function(d){var h=0,m=d.target,g=m.fromRect,_=Rt(m),p=m.prevFromRect,w=m.prevToRect,C=d.rect,T=ga(m,!0);T&&(_.top-=T.f,_.left-=T.e),m.toRect=_,m.thisAnimationDuration&&zd(p,_)&&!zd(g,_)&&(C.top-_.top)/(C.left-_.left)===(g.top-_.top)/(g.left-_.left)&&(h=Zx(C,p,w,o.options)),zd(_,g)||(m.prevFromRect=g,m.prevToRect=_,h||(h=o.options.animation),o.animate(m,C,_,h)),h&&(a=!0,c=Math.max(c,h),clearTimeout(m.animationResetTimer),m.animationResetTimer=setTimeout(function(){m.animationTime=0,m.prevFromRect=null,m.fromRect=null,m.prevToRect=null,m.thisAnimationDuration=null},h),m.thisAnimationDuration=h)}),clearTimeout(e),a?e=setTimeout(function(){typeof r=="function"&&r()},c):typeof r=="function"&&r(),n=[]},animate:function(r,o,a,c){if(c){pe(r,"transition",""),pe(r,"transform","");var d=ga(this.el),h=d&&d.a,m=d&&d.d,g=(o.left-a.left)/(h||1),_=(o.top-a.top)/(m||1);r.animatingX=!!g,r.animatingY=!!_,pe(r,"transform","translate3d("+g+"px,"+_+"px,0)"),this.forRepaintDummy=Xx(r),pe(r,"transition","transform "+c+"ms"+(this.options.easing?" "+this.options.easing:"")),pe(r,"transform","translate3d(0,0,0)"),typeof r.animated=="number"&&clearTimeout(r.animated),r.animated=setTimeout(function(){pe(r,"transition",""),pe(r,"transform",""),r.animated=!1,r.animatingX=!1,r.animatingY=!1},c)}}}}function Xx(n){return n.offsetWidth}function Zx(n,e,t,r){return Math.sqrt(Math.pow(e.top-n.top,2)+Math.pow(e.left-n.left,2))/Math.sqrt(Math.pow(e.top-t.top,2)+Math.pow(e.left-t.left,2))*r.animation}var qi=[],Gd={initializeByDefault:!0},Vs={mount:function(e){for(var t in Gd)Gd.hasOwnProperty(t)&&!(t in e)&&(e[t]=Gd[t]);qi.forEach(function(r){if(r.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),qi.push(e)},pluginEvent:function(e,t,r){var o=this;this.eventCanceled=!1,r.cancel=function(){o.eventCanceled=!0};var a=e+"Global";qi.forEach(function(c){t[c.pluginName]&&(t[c.pluginName][a]&&t[c.pluginName][a](Wr({sortable:t},r)),t.options[c.pluginName]&&t[c.pluginName][e]&&t[c.pluginName][e](Wr({sortable:t},r)))})},initializePlugins:function(e,t,r,o){qi.forEach(function(d){var h=d.pluginName;if(!(!e.options[h]&&!d.initializeByDefault)){var m=new d(e,t,e.options);m.sortable=e,m.options=e.options,e[h]=m,mo(r,m.defaults)}});for(var a in e.options)if(e.options.hasOwnProperty(a)){var c=this.modifyOption(e,a,e.options[a]);typeof c<"u"&&(e.options[a]=c)}},getEventProperties:function(e,t){var r={};return qi.forEach(function(o){typeof o.eventProperties=="function"&&mo(r,o.eventProperties.call(t[o.pluginName],e))}),r},modifyOption:function(e,t,r){var o;return qi.forEach(function(a){e[a.pluginName]&&a.optionListeners&&typeof a.optionListeners[t]=="function"&&(o=a.optionListeners[t].call(e[a.pluginName],r))}),o}};function eU(n){var e=n.sortable,t=n.rootEl,r=n.name,o=n.targetEl,a=n.cloneEl,c=n.toEl,d=n.fromEl,h=n.oldIndex,m=n.newIndex,g=n.oldDraggableIndex,_=n.newDraggableIndex,p=n.originalEvent,w=n.putSortable,C=n.extraEventProperties;if(e=e||t&&t[xn],!!e){var T,k=e.options,I="on"+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!po&&!Fs?T=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(T=document.createEvent("Event"),T.initEvent(r,!0,!0)),T.to=c||t,T.from=d||t,T.item=o||t,T.clone=a,T.oldIndex=h,T.newIndex=m,T.oldDraggableIndex=g,T.newDraggableIndex=_,T.originalEvent=p,T.pullMode=w?w.lastPutMode:void 0;var N=Wr(Wr({},C),Vs.getEventProperties(r,e));for(var D in N)T[D]=N[D];t&&t.dispatchEvent(T),k[I]&&k[I].call(e,T)}}var tU=["evt"],pn=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=r.evt,a=Wx(r,tU);Vs.pluginEvent.bind(_e)(e,t,Wr({dragEl:Z,parentEl:ft,ghostEl:we,rootEl:ct,nextEl:ui,lastDownEl:ll,cloneEl:mt,cloneHidden:Lo,dragStarted:ss,putSortable:zt,activeSortable:_e.active,originalEvent:o,oldIndex:da,oldDraggableIndex:ps,newIndex:Rn,newDraggableIndex:Do,hideGhostForTarget:hE,unhideGhostForTarget:fE,cloneNowHidden:function(){Lo=!0},cloneNowShown:function(){Lo=!1},dispatchSortableEvent:function(d){ln({sortable:t,name:d,originalEvent:o})}},a))};function ln(n){eU(Wr({putSortable:zt,cloneEl:mt,targetEl:Z,rootEl:ct,oldIndex:da,oldDraggableIndex:ps,newIndex:Rn,newDraggableIndex:Do},n))}var Z,ft,we,ct,ui,ll,mt,Lo,da,Rn,ps,Do,Fc,zt,oa=!1,Tl=!1,bl=[],ai,fr,qd,jd,pv,_v,ss,ji,_s,vs=!1,Vc=!1,ul,Jt,Yd=[],Bh=!1,Il=[],Zl=typeof document<"u",Hc=rE,vv=Fs||po?"cssFloat":"float",nU=Zl&&!Gx&&!rE&&"draggable"in document.createElement("div"),lE=function(){if(Zl){if(po)return!1;var n=document.createElement("x");return n.style.cssText="pointer-events:auto",n.style.pointerEvents==="auto"}}(),uE=function(e,t){var r=pe(e),o=parseInt(r.width)-parseInt(r.paddingLeft)-parseInt(r.paddingRight)-parseInt(r.borderLeftWidth)-parseInt(r.borderRightWidth),a=wa(e,0,t),c=wa(e,1,t),d=a&&pe(a),h=c&&pe(c),m=d&&parseInt(d.marginLeft)+parseInt(d.marginRight)+Rt(a).width,g=h&&parseInt(h.marginLeft)+parseInt(h.marginRight)+Rt(c).width;if(r.display==="flex")return r.flexDirection==="column"||r.flexDirection==="column-reverse"?"vertical":"horizontal";if(r.display==="grid")return r.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(a&&d.float&&d.float!=="none"){var _=d.float==="left"?"left":"right";return c&&(h.clear==="both"||h.clear===_)?"vertical":"horizontal"}return a&&(d.display==="block"||d.display==="flex"||d.display==="table"||d.display==="grid"||m>=o&&r[vv]==="none"||c&&r[vv]==="none"&&m+g>o)?"vertical":"horizontal"},rU=function(e,t,r){var o=r?e.left:e.top,a=r?e.right:e.bottom,c=r?e.width:e.height,d=r?t.left:t.top,h=r?t.right:t.bottom,m=r?t.width:t.height;return o===d||a===h||o+c/2===d+m/2},oU=function(e,t){var r;return bl.some(function(o){var a=o[xn].options.emptyInsertThreshold;if(!(!a||xf(o))){var c=Rt(o),d=e>=c.left-a&&e<=c.right+a,h=t>=c.top-a&&t<=c.bottom+a;if(d&&h)return r=o}}),r},dE=function(e){function t(a,c){return function(d,h,m,g){var _=d.options.group.name&&h.options.group.name&&d.options.group.name===h.options.group.name;if(a==null&&(c||_))return!0;if(a==null||a===!1)return!1;if(c&&a==="clone")return a;if(typeof a=="function")return t(a(d,h,m,g),c)(d,h,m,g);var p=(c?d:h).options.group.name;return a===!0||typeof a=="string"&&a===p||a.join&&a.indexOf(p)>-1}}var r={},o=e.group;(!o||cl(o)!="object")&&(o={name:o}),r.name=o.name,r.checkPull=t(o.pull,!0),r.checkPut=t(o.put),r.revertClone=o.revertClone,e.group=r},hE=function(){!lE&&we&&pe(we,"display","none")},fE=function(){!lE&&we&&pe(we,"display","")};Zl&&document.addEventListener("click",function(n){if(Tl)return n.preventDefault(),n.stopPropagation&&n.stopPropagation(),n.stopImmediatePropagation&&n.stopImmediatePropagation(),Tl=!1,!1},!0);var si=function(e){if(Z){e=e.touches?e.touches[0]:e;var t=oU(e.clientX,e.clientY);if(t){var r={};for(var o in e)e.hasOwnProperty(o)&&(r[o]=e[o]);r.target=r.rootEl=t,r.preventDefault=void 0,r.stopPropagation=void 0,t[xn]._onDragOver(r)}}},iU=function(e){Z&&Z.parentNode[xn]._isOutsideThisEl(e.target)};function _e(n,e){if(!(n&&n.nodeType&&n.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(n));this.el=n,this.options=e=mo({},e),n[xn]=this;var t={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(n.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return uE(n,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(c,d){c.setData("Text",d.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:_e.supportPointer!==!1&&"PointerEvent"in window&&!ms,emptyInsertThreshold:5};Vs.initializePlugins(this,n,t);for(var r in t)!(r in e)&&(e[r]=t[r]);dE(e);for(var o in this)o.charAt(0)==="_"&&typeof this[o]=="function"&&(this[o]=this[o].bind(this));this.nativeDraggable=e.forceFallback?!1:nU,this.nativeDraggable&&(this.options.touchStartThreshold=1),e.supportPointer?Ve(n,"pointerdown",this._onTapStart):(Ve(n,"mousedown",this._onTapStart),Ve(n,"touchstart",this._onTapStart)),this.nativeDraggable&&(Ve(n,"dragover",this),Ve(n,"dragenter",this)),bl.push(this.el),e.store&&e.store.get&&this.sort(e.store.get(this)||[]),mo(this,Qx())}_e.prototype={constructor:_e,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(ji=null)},_getDirection:function(e,t){return typeof this.options.direction=="function"?this.options.direction.call(this,e,t,Z):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,r=this.el,o=this.options,a=o.preventOnFilter,c=e.type,d=e.touches&&e.touches[0]||e.pointerType&&e.pointerType==="touch"&&e,h=(d||e).target,m=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||h,g=o.filter;if(fU(r),!Z&&!(/mousedown|pointerdown/.test(c)&&e.button!==0||o.disabled)&&!m.isContentEditable&&!(!this.nativeDraggable&&ms&&h&&h.tagName.toUpperCase()==="SELECT")&&(h=Lr(h,o.draggable,r,!1),!(h&&h.animated)&&ll!==h)){if(da=nr(h),ps=nr(h,o.draggable),typeof g=="function"){if(g.call(this,e,h,this)){ln({sortable:t,rootEl:m,name:"filter",targetEl:h,toEl:r,fromEl:r}),pn("filter",t,{evt:e}),a&&e.cancelable&&e.preventDefault();return}}else if(g&&(g=g.split(",").some(function(_){if(_=Lr(m,_.trim(),r,!1),_)return ln({sortable:t,rootEl:_,name:"filter",targetEl:h,fromEl:r,toEl:r}),pn("filter",t,{evt:e}),!0}),g)){a&&e.cancelable&&e.preventDefault();return}o.handle&&!Lr(m,o.handle,r,!1)||this._prepareDragStart(e,d,h)}}},_prepareDragStart:function(e,t,r){var o=this,a=o.el,c=o.options,d=a.ownerDocument,h;if(r&&!Z&&r.parentNode===a){var m=Rt(r);if(ct=a,Z=r,ft=Z.parentNode,ui=Z.nextSibling,ll=r,Fc=c.group,_e.dragged=Z,ai={target:Z,clientX:(t||e).clientX,clientY:(t||e).clientY},pv=ai.clientX-m.left,_v=ai.clientY-m.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,Z.style["will-change"]="all",h=function(){if(pn("delayEnded",o,{evt:e}),_e.eventCanceled){o._onDrop();return}o._disableDelayedDragEvents(),!hv&&o.nativeDraggable&&(Z.draggable=!0),o._triggerDragStart(e,t),ln({sortable:o,name:"choose",originalEvent:e}),Nn(Z,c.chosenClass,!0)},c.ignore.split(",").forEach(function(g){iE(Z,g.trim(),Jd)}),Ve(d,"dragover",si),Ve(d,"mousemove",si),Ve(d,"touchmove",si),Ve(d,"mouseup",o._onDrop),Ve(d,"touchend",o._onDrop),Ve(d,"touchcancel",o._onDrop),hv&&this.nativeDraggable&&(this.options.touchStartThreshold=4,Z.draggable=!0),pn("delayStart",this,{evt:e}),c.delay&&(!c.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Fs||po))){if(_e.eventCanceled){this._onDrop();return}Ve(d,"mouseup",o._disableDelayedDrag),Ve(d,"touchend",o._disableDelayedDrag),Ve(d,"touchcancel",o._disableDelayedDrag),Ve(d,"mousemove",o._delayedDragTouchMoveHandler),Ve(d,"touchmove",o._delayedDragTouchMoveHandler),c.supportPointer&&Ve(d,"pointermove",o._delayedDragTouchMoveHandler),o._dragStartTimer=setTimeout(h,c.delay)}else h()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){Z&&Jd(Z),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;xe(e,"mouseup",this._disableDelayedDrag),xe(e,"touchend",this._disableDelayedDrag),xe(e,"touchcancel",this._disableDelayedDrag),xe(e,"mousemove",this._delayedDragTouchMoveHandler),xe(e,"touchmove",this._delayedDragTouchMoveHandler),xe(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||e.pointerType=="touch"&&e,!this.nativeDraggable||t?this.options.supportPointer?Ve(document,"pointermove",this._onTouchMove):t?Ve(document,"touchmove",this._onTouchMove):Ve(document,"mousemove",this._onTouchMove):(Ve(Z,"dragend",this),Ve(ct,"dragstart",this._onDragStart));try{document.selection?dl(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(oa=!1,ct&&Z){pn("dragStarted",this,{evt:t}),this.nativeDraggable&&Ve(document,"dragover",iU);var r=this.options;!e&&Nn(Z,r.dragClass,!1),Nn(Z,r.ghostClass,!0),_e.active=this,e&&this._appendGhost(),ln({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(fr){this._lastX=fr.clientX,this._lastY=fr.clientY,hE();for(var e=document.elementFromPoint(fr.clientX,fr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(fr.clientX,fr.clientY),e!==t);)t=e;if(Z.parentNode[xn]._isOutsideThisEl(e),t)do{if(t[xn]){var r=void 0;if(r=t[xn]._onDragOver({clientX:fr.clientX,clientY:fr.clientY,target:e,rootEl:t}),r&&!this.options.dragoverBubble)break}e=t}while(t=t.parentNode);fE()}},_onTouchMove:function(e){if(ai){var t=this.options,r=t.fallbackTolerance,o=t.fallbackOffset,a=e.touches?e.touches[0]:e,c=we&&ga(we,!0),d=we&&c&&c.a,h=we&&c&&c.d,m=Hc&&Jt&&gv(Jt),g=(a.clientX-ai.clientX+o.x)/(d||1)+(m?m[0]-Yd[0]:0)/(d||1),_=(a.clientY-ai.clientY+o.y)/(h||1)+(m?m[1]-Yd[1]:0)/(h||1);if(!_e.active&&!oa){if(r&&Math.max(Math.abs(a.clientX-this._lastX),Math.abs(a.clientY-this._lastY))<r)return;this._onDragStart(e,!0)}if(we){c?(c.e+=g-(qd||0),c.f+=_-(jd||0)):c={a:1,b:0,c:0,d:1,e:g,f:_};var p="matrix(".concat(c.a,",").concat(c.b,",").concat(c.c,",").concat(c.d,",").concat(c.e,",").concat(c.f,")");pe(we,"webkitTransform",p),pe(we,"mozTransform",p),pe(we,"msTransform",p),pe(we,"transform",p),qd=g,jd=_,fr=a}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!we){var e=this.options.fallbackOnBody?document.body:ct,t=Rt(Z,!0,Hc,!0,e),r=this.options;if(Hc){for(Jt=e;pe(Jt,"position")==="static"&&pe(Jt,"transform")==="none"&&Jt!==document;)Jt=Jt.parentNode;Jt!==document.body&&Jt!==document.documentElement?(Jt===document&&(Jt=$r()),t.top+=Jt.scrollTop,t.left+=Jt.scrollLeft):Jt=$r(),Yd=gv(Jt)}we=Z.cloneNode(!0),Nn(we,r.ghostClass,!1),Nn(we,r.fallbackClass,!0),Nn(we,r.dragClass,!0),pe(we,"transition",""),pe(we,"transform",""),pe(we,"box-sizing","border-box"),pe(we,"margin",0),pe(we,"top",t.top),pe(we,"left",t.left),pe(we,"width",t.width),pe(we,"height",t.height),pe(we,"opacity","0.8"),pe(we,"position",Hc?"absolute":"fixed"),pe(we,"zIndex","100000"),pe(we,"pointerEvents","none"),_e.ghost=we,e.appendChild(we),pe(we,"transform-origin",pv/parseInt(we.style.width)*100+"% "+_v/parseInt(we.style.height)*100+"%")}},_onDragStart:function(e,t){var r=this,o=e.dataTransfer,a=r.options;if(pn("dragStart",this,{evt:e}),_e.eventCanceled){this._onDrop();return}pn("setupClone",this),_e.eventCanceled||(mt=cE(Z),mt.draggable=!1,mt.style["will-change"]="",this._hideClone(),Nn(mt,this.options.chosenClass,!1),_e.clone=mt),r.cloneId=dl(function(){pn("clone",r),!_e.eventCanceled&&(r.options.removeCloneOnHide||ct.insertBefore(mt,Z),r._hideClone(),ln({sortable:r,name:"clone"}))}),!t&&Nn(Z,a.dragClass,!0),t?(Tl=!0,r._loopId=setInterval(r._emulateDragOver,50)):(xe(document,"mouseup",r._onDrop),xe(document,"touchend",r._onDrop),xe(document,"touchcancel",r._onDrop),o&&(o.effectAllowed="move",a.setData&&a.setData.call(r,o,Z)),Ve(document,"drop",r),pe(Z,"transform","translateZ(0)")),oa=!0,r._dragStartId=dl(r._dragStarted.bind(r,t,e)),Ve(document,"selectstart",r),ss=!0,ms&&pe(document.body,"user-select","none")},_onDragOver:function(e){var t=this.el,r=e.target,o,a,c,d=this.options,h=d.group,m=_e.active,g=Fc===h,_=d.sort,p=zt||m,w,C=this,T=!1;if(Bh)return;function k(at,Et){pn(at,C,Wr({evt:e,isOwner:g,axis:w?"vertical":"horizontal",revert:c,dragRect:o,targetRect:a,canSort:_,fromSortable:p,target:r,completed:N,onMove:function(St,jo){return $c(ct,t,Z,o,St,Rt(St),e,jo)},changed:D},Et))}function I(){k("dragOverAnimationCapture"),C.captureAnimationState(),C!==p&&p.captureAnimationState()}function N(at){return k("dragOverCompleted",{insertion:at}),at&&(g?m._hideClone():m._showClone(C),C!==p&&(Nn(Z,zt?zt.options.ghostClass:m.options.ghostClass,!1),Nn(Z,d.ghostClass,!0)),zt!==C&&C!==_e.active?zt=C:C===_e.active&&zt&&(zt=null),p===C&&(C._ignoreWhileAnimating=r),C.animateAll(function(){k("dragOverAnimationComplete"),C._ignoreWhileAnimating=null}),C!==p&&(p.animateAll(),p._ignoreWhileAnimating=null)),(r===Z&&!Z.animated||r===t&&!r.animated)&&(ji=null),!d.dragoverBubble&&!e.rootEl&&r!==document&&(Z.parentNode[xn]._isOutsideThisEl(e.target),!at&&si(e)),!d.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),T=!0}function D(){Rn=nr(Z),Do=nr(Z,d.draggable),ln({sortable:C,name:"change",toEl:t,newIndex:Rn,newDraggableIndex:Do,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),r=Lr(r,d.draggable,t,!0),k("dragOver"),_e.eventCanceled)return T;if(Z.contains(e.target)||r.animated&&r.animatingX&&r.animatingY||C._ignoreWhileAnimating===r)return N(!1);if(Tl=!1,m&&!d.disabled&&(g?_||(c=ft!==ct):zt===this||(this.lastPutMode=Fc.checkPull(this,m,Z,e))&&h.checkPut(this,m,Z,e))){if(w=this._getDirection(e,r)==="vertical",o=Rt(Z),k("dragOverValid"),_e.eventCanceled)return T;if(c)return ft=ct,I(),this._hideClone(),k("revert"),_e.eventCanceled||(ui?ct.insertBefore(Z,ui):ct.appendChild(Z)),N(!0);var L=xf(t,d.draggable);if(!L||lU(e,w,this)&&!L.animated){if(L===Z)return N(!1);if(L&&t===e.target&&(r=L),r&&(a=Rt(r)),$c(ct,t,Z,o,r,a,e,!!r)!==!1)return I(),t.appendChild(Z),ft=t,D(),N(!0)}else if(L&&cU(e,w,this)){var K=wa(t,0,d,!0);if(K===Z)return N(!1);if(r=K,a=Rt(r),$c(ct,t,Z,o,r,a,e,!1)!==!1)return I(),t.insertBefore(Z,K),ft=t,D(),N(!0)}else if(r.parentNode===t){a=Rt(r);var q=0,M,ce=Z.parentNode!==t,ae=!rU(Z.animated&&Z.toRect||o,r.animated&&r.toRect||a,w),X=w?"top":"left",ee=mv(r,"top","top")||mv(Z,"top","top"),ue=ee?ee.scrollTop:void 0;ji!==r&&(M=a[X],vs=!1,Vc=!ae&&d.invertSwap||ce),q=uU(e,r,a,w,ae?1:d.swapThreshold,d.invertedSwapThreshold==null?d.swapThreshold:d.invertedSwapThreshold,Vc,ji===r);var Be;if(q!==0){var Ct=nr(Z);do Ct-=q,Be=ft.children[Ct];while(Be&&(pe(Be,"display")==="none"||Be===we))}if(q===0||Be===r)return N(!1);ji=r,_s=q;var rn=r.nextElementSibling,qt=!1;qt=q===1;var Mt=$c(ct,t,Z,o,r,a,e,qt);if(Mt!==!1)return(Mt===1||Mt===-1)&&(qt=Mt===1),Bh=!0,setTimeout(sU,30),I(),qt&&!rn?t.appendChild(Z):r.parentNode.insertBefore(Z,qt?rn:r),ee&&sE(ee,0,ue-ee.scrollTop),ft=Z.parentNode,M!==void 0&&!Vc&&(ul=Math.abs(M-Rt(r)[X])),D(),N(!0)}if(t.contains(Z))return N(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){xe(document,"mousemove",this._onTouchMove),xe(document,"touchmove",this._onTouchMove),xe(document,"pointermove",this._onTouchMove),xe(document,"dragover",si),xe(document,"mousemove",si),xe(document,"touchmove",si)},_offUpEvents:function(){var e=this.el.ownerDocument;xe(e,"mouseup",this._onDrop),xe(e,"touchend",this._onDrop),xe(e,"pointerup",this._onDrop),xe(e,"touchcancel",this._onDrop),xe(document,"selectstart",this)},_onDrop:function(e){var t=this.el,r=this.options;if(Rn=nr(Z),Do=nr(Z,r.draggable),pn("drop",this,{evt:e}),ft=Z&&Z.parentNode,Rn=nr(Z),Do=nr(Z,r.draggable),_e.eventCanceled){this._nulling();return}oa=!1,Vc=!1,vs=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Fh(this.cloneId),Fh(this._dragStartId),this.nativeDraggable&&(xe(document,"drop",this),xe(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),ms&&pe(document.body,"user-select",""),pe(Z,"transform",""),e&&(ss&&(e.cancelable&&e.preventDefault(),!r.dropBubble&&e.stopPropagation()),we&&we.parentNode&&we.parentNode.removeChild(we),(ct===ft||zt&&zt.lastPutMode!=="clone")&&mt&&mt.parentNode&&mt.parentNode.removeChild(mt),Z&&(this.nativeDraggable&&xe(Z,"dragend",this),Jd(Z),Z.style["will-change"]="",ss&&!oa&&Nn(Z,zt?zt.options.ghostClass:this.options.ghostClass,!1),Nn(Z,this.options.chosenClass,!1),ln({sortable:this,name:"unchoose",toEl:ft,newIndex:null,newDraggableIndex:null,originalEvent:e}),ct!==ft?(Rn>=0&&(ln({rootEl:ft,name:"add",toEl:ft,fromEl:ct,originalEvent:e}),ln({sortable:this,name:"remove",toEl:ft,originalEvent:e}),ln({rootEl:ft,name:"sort",toEl:ft,fromEl:ct,originalEvent:e}),ln({sortable:this,name:"sort",toEl:ft,originalEvent:e})),zt&&zt.save()):Rn!==da&&Rn>=0&&(ln({sortable:this,name:"update",toEl:ft,originalEvent:e}),ln({sortable:this,name:"sort",toEl:ft,originalEvent:e})),_e.active&&((Rn==null||Rn===-1)&&(Rn=da,Do=ps),ln({sortable:this,name:"end",toEl:ft,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){pn("nulling",this),ct=Z=ft=we=ui=mt=ll=Lo=ai=fr=ss=Rn=Do=da=ps=ji=_s=zt=Fc=_e.dragged=_e.ghost=_e.clone=_e.active=null,Il.forEach(function(e){e.checked=!0}),Il.length=qd=jd=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":Z&&(this._onDragOver(e),aU(e));break;case"selectstart":e.preventDefault();break}},toArray:function(){for(var e=[],t,r=this.el.children,o=0,a=r.length,c=this.options;o<a;o++)t=r[o],Lr(t,c.draggable,this.el,!1)&&e.push(t.getAttribute(c.dataIdAttr)||hU(t));return e},sort:function(e,t){var r={},o=this.el;this.toArray().forEach(function(a,c){var d=o.children[c];Lr(d,this.options.draggable,o,!1)&&(r[a]=d)},this),t&&this.captureAnimationState(),e.forEach(function(a){r[a]&&(o.removeChild(r[a]),o.appendChild(r[a]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Lr(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var r=this.options;if(t===void 0)return r[e];var o=Vs.modifyOption(this,e,t);typeof o<"u"?r[e]=o:r[e]=t,e==="group"&&dE(r)},destroy:function(){pn("destroy",this);var e=this.el;e[xn]=null,xe(e,"mousedown",this._onTapStart),xe(e,"touchstart",this._onTapStart),xe(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(xe(e,"dragover",this),xe(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(t){t.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),bl.splice(bl.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Lo){if(pn("hideClone",this),_e.eventCanceled)return;pe(mt,"display","none"),this.options.removeCloneOnHide&&mt.parentNode&&mt.parentNode.removeChild(mt),Lo=!0}},_showClone:function(e){if(e.lastPutMode!=="clone"){this._hideClone();return}if(Lo){if(pn("showClone",this),_e.eventCanceled)return;Z.parentNode==ct&&!this.options.group.revertClone?ct.insertBefore(mt,Z):ui?ct.insertBefore(mt,ui):ct.appendChild(mt),this.options.group.revertClone&&this.animate(Z,mt),pe(mt,"display",""),Lo=!1}}};function aU(n){n.dataTransfer&&(n.dataTransfer.dropEffect="move"),n.cancelable&&n.preventDefault()}function $c(n,e,t,r,o,a,c,d){var h,m=n[xn],g=m.options.onMove,_;return window.CustomEvent&&!po&&!Fs?h=new CustomEvent("move",{bubbles:!0,cancelable:!0}):(h=document.createEvent("Event"),h.initEvent("move",!0,!0)),h.to=e,h.from=n,h.dragged=t,h.draggedRect=r,h.related=o||e,h.relatedRect=a||Rt(e),h.willInsertAfter=d,h.originalEvent=c,n.dispatchEvent(h),g&&(_=g.call(m,h,c)),_}function Jd(n){n.draggable=!1}function sU(){Bh=!1}function cU(n,e,t){var r=Rt(wa(t.el,0,t.options,!0)),o=10;return e?n.clientX<r.left-o||n.clientY<r.top&&n.clientX<r.right:n.clientY<r.top-o||n.clientY<r.bottom&&n.clientX<r.left}function lU(n,e,t){var r=Rt(xf(t.el,t.options.draggable)),o=10;return e?n.clientX>r.right+o||n.clientX<=r.right&&n.clientY>r.bottom&&n.clientX>=r.left:n.clientX>r.right&&n.clientY>r.top||n.clientX<=r.right&&n.clientY>r.bottom+o}function uU(n,e,t,r,o,a,c,d){var h=r?n.clientY:n.clientX,m=r?t.height:t.width,g=r?t.top:t.left,_=r?t.bottom:t.right,p=!1;if(!c){if(d&&ul<m*o){if(!vs&&(_s===1?h>g+m*a/2:h<_-m*a/2)&&(vs=!0),vs)p=!0;else if(_s===1?h<g+ul:h>_-ul)return-_s}else if(h>g+m*(1-o)/2&&h<_-m*(1-o)/2)return dU(e)}return p=p||c,p&&(h<g+m*a/2||h>_-m*a/2)?h>g+m/2?1:-1:0}function dU(n){return nr(Z)<nr(n)?1:-1}function hU(n){for(var e=n.tagName+n.className+n.src+n.href+n.textContent,t=e.length,r=0;t--;)r+=e.charCodeAt(t);return r.toString(36)}function fU(n){Il.length=0;for(var e=n.getElementsByTagName("input"),t=e.length;t--;){var r=e[t];r.checked&&Il.push(r)}}function dl(n){return setTimeout(n,0)}function Fh(n){return clearTimeout(n)}Zl&&Ve(document,"touchmove",function(n){(_e.active||oa)&&n.cancelable&&n.preventDefault()});_e.utils={on:Ve,off:xe,css:pe,find:iE,is:function(e,t){return!!Lr(e,t,e,!1)},extend:Yx,throttle:aE,closest:Lr,toggleClass:Nn,clone:cE,index:nr,nextTick:dl,cancelNextTick:Fh,detectDirection:uE,getChild:wa};_e.get=function(n){return n[xn]};_e.mount=function(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];e[0].constructor===Array&&(e=e[0]),e.forEach(function(r){if(!r.prototype||!r.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(r));r.utils&&(_e.utils=Wr(Wr({},_e.utils),r.utils)),Vs.mount(r)})};_e.create=function(n,e){return new _e(n,e)};_e.version=zx;var wt=[],cs,Vh,Hh=!1,Qd,Xd,Sl,ls;function mU(){function n(){this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0};for(var e in this)e.charAt(0)==="_"&&typeof this[e]=="function"&&(this[e]=this[e].bind(this))}return n.prototype={dragStarted:function(t){var r=t.originalEvent;this.sortable.nativeDraggable?Ve(document,"dragover",this._handleAutoScroll):this.options.supportPointer?Ve(document,"pointermove",this._handleFallbackAutoScroll):r.touches?Ve(document,"touchmove",this._handleFallbackAutoScroll):Ve(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(t){var r=t.originalEvent;!this.options.dragOverBubble&&!r.rootEl&&this._handleAutoScroll(r)},drop:function(){this.sortable.nativeDraggable?xe(document,"dragover",this._handleAutoScroll):(xe(document,"pointermove",this._handleFallbackAutoScroll),xe(document,"touchmove",this._handleFallbackAutoScroll),xe(document,"mousemove",this._handleFallbackAutoScroll)),yv(),hl(),Jx()},nulling:function(){Sl=Vh=cs=Hh=ls=Qd=Xd=null,wt.length=0},_handleFallbackAutoScroll:function(t){this._handleAutoScroll(t,!0)},_handleAutoScroll:function(t,r){var o=this,a=(t.touches?t.touches[0]:t).clientX,c=(t.touches?t.touches[0]:t).clientY,d=document.elementFromPoint(a,c);if(Sl=t,r||this.options.forceAutoScrollFallback||Fs||po||ms){Zd(t,this.options,d,r);var h=Fo(d,!0);Hh&&(!ls||a!==Qd||c!==Xd)&&(ls&&yv(),ls=setInterval(function(){var m=Fo(document.elementFromPoint(a,c),!0);m!==h&&(h=m,hl()),Zd(t,o.options,m,r)},10),Qd=a,Xd=c)}else{if(!this.options.bubbleScroll||Fo(d,!0)===$r()){hl();return}Zd(t,this.options,Fo(d,!1),!1)}}},mo(n,{pluginName:"scroll",initializeByDefault:!0})}function hl(){wt.forEach(function(n){clearInterval(n.pid)}),wt=[]}function yv(){clearInterval(ls)}var Zd=aE(function(n,e,t,r){if(e.scroll){var o=(n.touches?n.touches[0]:n).clientX,a=(n.touches?n.touches[0]:n).clientY,c=e.scrollSensitivity,d=e.scrollSpeed,h=$r(),m=!1,g;Vh!==t&&(Vh=t,hl(),cs=e.scroll,g=e.scrollFn,cs===!0&&(cs=Fo(t,!0)));var _=0,p=cs;do{var w=p,C=Rt(w),T=C.top,k=C.bottom,I=C.left,N=C.right,D=C.width,L=C.height,K=void 0,q=void 0,M=w.scrollWidth,ce=w.scrollHeight,ae=pe(w),X=w.scrollLeft,ee=w.scrollTop;w===h?(K=D<M&&(ae.overflowX==="auto"||ae.overflowX==="scroll"||ae.overflowX==="visible"),q=L<ce&&(ae.overflowY==="auto"||ae.overflowY==="scroll"||ae.overflowY==="visible")):(K=D<M&&(ae.overflowX==="auto"||ae.overflowX==="scroll"),q=L<ce&&(ae.overflowY==="auto"||ae.overflowY==="scroll"));var ue=K&&(Math.abs(N-o)<=c&&X+D<M)-(Math.abs(I-o)<=c&&!!X),Be=q&&(Math.abs(k-a)<=c&&ee+L<ce)-(Math.abs(T-a)<=c&&!!ee);if(!wt[_])for(var Ct=0;Ct<=_;Ct++)wt[Ct]||(wt[Ct]={});(wt[_].vx!=ue||wt[_].vy!=Be||wt[_].el!==w)&&(wt[_].el=w,wt[_].vx=ue,wt[_].vy=Be,clearInterval(wt[_].pid),(ue!=0||Be!=0)&&(m=!0,wt[_].pid=setInterval((function(){r&&this.layer===0&&_e.active._onTouchMove(Sl);var rn=wt[this.layer].vy?wt[this.layer].vy*d:0,qt=wt[this.layer].vx?wt[this.layer].vx*d:0;typeof g=="function"&&g.call(_e.dragged.parentNode[xn],qt,rn,n,Sl,wt[this.layer].el)!=="continue"||sE(wt[this.layer].el,qt,rn)}).bind({layer:_}),24))),_++}while(e.bubbleScroll&&p!==h&&(p=Fo(p,!1)));Hh=m}},30),mE=function(e){var t=e.originalEvent,r=e.putSortable,o=e.dragEl,a=e.activeSortable,c=e.dispatchSortableEvent,d=e.hideGhostForTarget,h=e.unhideGhostForTarget;if(t){var m=r||a;d();var g=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,_=document.elementFromPoint(g.clientX,g.clientY);h(),m&&!m.el.contains(_)&&(c("spill"),this.onSpill({dragEl:o,putSortable:r}))}};function Uf(){}Uf.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,r=e.putSortable;this.sortable.captureAnimationState(),r&&r.captureAnimationState();var o=wa(this.sortable.el,this.startIndex,this.options);o?this.sortable.el.insertBefore(t,o):this.sortable.el.appendChild(t),this.sortable.animateAll(),r&&r.animateAll()},drop:mE};mo(Uf,{pluginName:"revertOnSpill"});function Bf(){}Bf.prototype={onSpill:function(e){var t=e.dragEl,r=e.putSortable,o=r||this.sortable;o.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),o.animateAll()},drop:mE};mo(Bf,{pluginName:"removeOnSpill"});_e.mount(new mU);_e.mount(Bf,Uf);function gU(){return typeof window<"u"?window.console:global.console}const pU=gU();function _U(n){const e=Object.create(null);return function(r){return e[r]||(e[r]=n(r))}}const vU=/-(\w)/g,Cv=_U(n=>n.replace(vU,(e,t)=>t?t.toUpperCase():""));function eh(n){n.parentElement!==null&&n.parentElement.removeChild(n)}function Ev(n,e,t){const r=t===0?n.children[0]:n.children[t-1].nextSibling;n.insertBefore(e,r)}function yU(n,e){return Object.values(n).indexOf(e)}function CU(n,e,t,r){if(!n)return[];const o=Object.values(n),a=e.length-r;return[...e].map((d,h)=>h>=a?o.length:o.indexOf(d))}function gE(n,e){this.$nextTick(()=>this.$emit(n.toLowerCase(),e))}function EU(n){return e=>{this.realList!==null&&this["onDrag"+n](e),gE.call(this,n,e)}}function wU(n){return["transition-group","TransitionGroup"].includes(n)}function TU(n){if(!n||n.length!==1)return!1;const[{type:e}]=n;return e?wU(e.name):!1}function bU(n,e){return e?{...e.props,...e.attrs}:n}const $h=["Start","Add","Remove","Update","End"],Kh=["Choose","Unchoose","Sort","Filter","Clone"],IU=["Move",...$h,...Kh].map(n=>"on"+n);let th=null;const SU={options:Object,list:{type:Array,required:!1,default:null},noTransitionOnDrag:{type:Boolean,default:!1},clone:{type:Function,default:n=>n},tag:{type:String,default:"div"},move:{type:Function,default:null},componentData:{type:Object,required:!1,default:null},component:{type:String,default:null},modelValue:{type:Array,required:!1,default:null}},AU=l.defineComponent({name:"VueDraggableNext",inheritAttrs:!1,emits:["update:modelValue","move","change",...$h.map(n=>n.toLowerCase()),...Kh.map(n=>n.toLowerCase())],props:SU,data(){return{transitionMode:!1,noneFunctionalComponentMode:!1,headerOffset:0,footerOffset:0,_sortable:{},visibleIndexes:[],context:{}}},render(){const n=this.$slots.default?this.$slots.default():null,e=bU(this.$attrs,this.componentData);return n?(this.transitionMode=TU(n),l.h(this.getTag(),e,n)):l.h(this.getTag(),e,[])},created(){this.list!==null&&this.modelValue!==null&&pU.error("list props are mutually exclusive! Please set one.")},mounted(){const n={};$h.forEach(o=>{n["on"+o]=EU.call(this,o)}),Kh.forEach(o=>{n["on"+o]=gE.bind(this,o)});const e=Object.keys(this.$attrs).reduce((o,a)=>(o[Cv(a)]=this.$attrs[a],o),{}),t=Object.assign({},e,n,{onMove:(o,a)=>this.onDragMove(o,a)});!("draggable"in t)&&(t.draggable=">*");const r=this.$el.nodeType===1?this.$el:this.$el.parentElement;this._sortable=new _e(r,t),r.__draggable_component__=this,this.computeIndexes()},beforeUnmount(){try{this._sortable!==void 0&&this._sortable.destroy()}catch{}},computed:{realList(){return this.list?this.list:this.modelValue}},watch:{$attrs:{handler(n){this.updateOptions(n)},deep:!0},realList(){this.computeIndexes()}},methods:{getTag(){return this.component?l.resolveComponent(this.component):this.tag},updateOptions(n){for(var e in n){const t=Cv(e);IU.indexOf(t)===-1&&this._sortable.option(t,n[e])}},getChildrenNodes(){return this.$el.children},computeIndexes(){this.$nextTick(()=>{this.visibleIndexes=CU(this.getChildrenNodes(),this.$el.children,this.transitionMode,this.footerOffset)})},getUnderlyingVm(n){const e=yU(this.getChildrenNodes()||[],n);if(e===-1)return null;const t=this.realList[e];return{index:e,element:t}},emitChanges(n){this.$nextTick(()=>{this.$emit("change",n)})},alterList(n){if(this.list){n(this.list);return}const e=[...this.modelValue];n(e),this.$emit("update:modelValue",e)},spliceList(){const n=e=>e.splice(...arguments);this.alterList(n)},updatePosition(n,e){const t=r=>r.splice(e,0,r.splice(n,1)[0]);this.alterList(t)},getVmIndex(n){const e=this.visibleIndexes,t=e.length;return n>t-1?t:e[n]},getComponent(){return this.$slots.default?this.$slots.default()[0].componentInstance:null},resetTransitionData(n){if(!this.noTransitionOnDrag||!this.transitionMode)return;var e=this.getChildrenNodes();e[n].data=null;const t=this.getComponent();t.children=[],t.kept=void 0},onDragStart(n){this.computeIndexes(),this.context=this.getUnderlyingVm(n.item),this.context&&(n.item._underlying_vm_=this.clone(this.context.element),th=n.item)},onDragAdd(n){const e=n.item._underlying_vm_;if(e===void 0)return;eh(n.item);const t=this.getVmIndex(n.newIndex);this.spliceList(t,0,e),this.computeIndexes();const r={element:e,newIndex:t};this.emitChanges({added:r})},onDragRemove(n){if(Ev(this.$el,n.item,n.oldIndex),n.pullMode==="clone"){eh(n.clone);return}if(!this.context)return;const e=this.context.index;this.spliceList(e,1);const t={element:this.context.element,oldIndex:e};this.resetTransitionData(e),this.emitChanges({removed:t})},onDragUpdate(n){eh(n.item),Ev(n.from,n.item,n.oldIndex);const e=this.context.index,t=this.getVmIndex(n.newIndex);this.updatePosition(e,t);const r={element:this.context.element,oldIndex:e,newIndex:t};this.emitChanges({moved:r})},updateProperty(n,e){n.hasOwnProperty(e)&&(n[e]+=this.headerOffset)},onDragMove(n,e){const t=this.move;if(!t||!this.realList)return!0;const r=this.getRelatedContextFromMoveEvent(n),o=this.context,a=this.computeFutureIndex(r,n);Object.assign(o,{futureIndex:a});const c=Object.assign({},n,{relatedContext:r,draggedContext:o});return t(c,e)},onDragEnd(){this.computeIndexes(),th=null},getTrargetedComponent(n){return n.__draggable_component__},getRelatedContextFromMoveEvent({to:n,related:e}){const t=this.getTrargetedComponent(n);if(!t)return{component:t};const r=t.realList,o={list:r,component:t};if(n!==e&&r&&t.getUnderlyingVm){const a=t.getUnderlyingVm(e);if(a)return Object.assign(a,o)}return o},computeFutureIndex(n,e){const t=[...e.to.children].filter(c=>c.style.display!=="none");if(t.length===0)return 0;const r=t.indexOf(e.related),o=n.component.getVmIndex(r);return t.indexOf(th)!==-1||!e.willInsertAfter?o:o+1}}}),kU={class:"d-flex flex-row align-center"},Ff=l.defineComponent({__name:"ColumnSettingsDialog",props:{modelValue:{},modelModifiers:{}},emits:["update:modelValue"],setup(n){const e=l.useModel(n,"modelValue"),t=l.ref(""),r=l.computed(()=>{var a;return(a=e.value)==null?void 0:a.filter(c=>c.title.toLowerCase().includes(t.value.toLowerCase()))}),{t:o}=br();return(a,c)=>{const d=l.resolveComponent("v-list-item-content");return l.openBlock(),l.createBlock(Us,{"dd-id":"col-settings",buttons:!1,title:l.unref(o)("dialogs.columnSettings.title")},{default:l.withCtx(()=>[l.createVNode(Xl,{modelValue:t.value,"onUpdate:modelValue":c[0]||(c[0]=h=>t.value=h)},null,8,["modelValue"]),l.createVNode(Qt.VList,null,{default:l.withCtx(()=>[l.createVNode(l.unref(AU),{list:r.value,animation:200,"ghost-class":"ghost-card"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(r.value,h=>(l.openBlock(),l.createBlock(Qt.VListItem,{key:h.key,class:"pa-0"},{default:l.withCtx(()=>[l.createElementVNode("div",kU,[l.createVNode(l.unref(hP),{class:"cursor-grab mb-2"}),l.createVNode(Qt.VListItemAction,null,{default:l.withCtx(()=>[l.createVNode(IO.VCheckbox,{modelValue:h.checked,"onUpdate:modelValue":m=>h.checked=m},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),l.createVNode(d,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,{class:"mb-1"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.title)+"  ",1)]),_:2},1024)]),_:2},1024),h.icon?(l.openBlock(),l.createBlock(vl.VIcon,{key:0},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(h.icon),1)]),_:2},1024)):l.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:1},8,["list"])]),_:1})]),_:1},8,["title"])}}}),NU=["src","height","width"],RU={key:0,class:"text-center text-h6"},OU={key:1,class:"text-center text-h5"},PU={key:0,class:"text-center"},MU={class:"d-flex justify-center align-center mt-4 ga-3"},Vf=l.defineComponent({__name:"TableCard",props:{item:{},columns:{},size:{},image:{},tags:{},route:{},callback:{type:Function}},setup(n){const e=n,t=()=>{var o;return((o=e.columns.find(a=>a.isHeader))==null?void 0:o.key)||""},r=()=>{var o;return((o=e.columns.find(a=>a.isSubtitle))==null?void 0:o.key)||""};return(o,a)=>(l.openBlock(),l.createBlock(xt.VCard,{onClick:o.callback,ripple:"",class:"d-flex flex-column pa-4pa-4 bg-containerBg"},{default:l.withCtx(()=>[l.createVNode(xt.VCardActions,null,{default:l.withCtx(()=>[l.createVNode(Qe.VRow,{"no-gutters":"",align:"center",justify:"end"},{default:l.withCtx(()=>[l.renderSlot(o.$slots,"actions",{item:o.item})]),_:3})]),_:3}),l.createVNode(xt.VCardTitle,null,{default:l.withCtx(()=>[l.createVNode(Qe.VRow,{"no-gutters":"",align:"center",justify:"center"},{default:l.withCtx(()=>[o.image?(l.openBlock(),l.createElementBlock("img",{key:0,src:o.image,height:o.size,width:o.size,alt:""},null,8,NU)):l.createCommentVNode("",!0)]),_:1})]),_:1}),t()?(l.openBlock(),l.createElementBlock("div",RU,l.toDisplayString(o.item[t()]),1)):l.createCommentVNode("",!0),r()?(l.openBlock(),l.createElementBlock("div",OU,l.toDisplayString(o.item[r()]),1)):l.createCommentVNode("",!0),l.createVNode(pi.VDivider,{class:"ma-3"}),l.createVNode(xt.VCardText,{class:"d-flex flex-column align-center pa-4 pt-1"},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(o.columns,c=>(l.openBlock(),l.createElementBlock(l.Fragment,{key:c.key},[o.item[c.key]&&!c.isHeader&&!c.isSubtitle?(l.openBlock(),l.createElementBlock("div",PU,l.toDisplayString(c.title)+": "+l.toDisplayString(o.item[c.key]),1)):l.createCommentVNode("",!0)],64))),128)),l.createElementVNode("div",MU,[o.tags?(l.openBlock(!0),l.createElementBlock(l.Fragment,{key:0},l.renderList(o.tags,c=>(l.openBlock(),l.createBlock(SO.VChip,{class:"pa-3",key:c},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(c),1)]),_:2},1024))),128)):l.createCommentVNode("",!0)])]),_:1})]),_:3},8,["onClick"]))}}),DU=l.defineComponent({__name:"TableCardsView",props:{data:{},columns:{},size:{},itemKey:{}},setup(n){return(e,t)=>(l.openBlock(),l.createBlock(Qe.VRow,{class:"mt-5 border tb-cards-h",wrap:""},{default:l.withCtx(()=>[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.data,r=>(l.openBlock(),l.createBlock(Qe.VCol,{cols:"12",sm:"6",md:"4",lg:"3",class:"pa-2",key:r[e.itemKey]},{default:l.withCtx(()=>[l.createVNode(Vf,{item:r,columns:e.columns,size:e.size},{actions:l.withCtx(({item:o})=>[l.renderSlot(e.$slots,"actions",{item:o},void 0,!0)]),_:2},1032,["item","columns","size"])]),_:2},1024))),128))]),_:3}))}}),pE=Aa(DU,[["__scopeId","data-v-e1a4ccbc"]]),LU={key:0,class:"mb-2 ms-1"},_E=l.defineComponent({__name:"JTextField",props:l.mergeModels({name:{},label:{},type:{default:"text"},readonly:{type:Boolean},density:{},rules:{},hideDetails:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(n){const e=l.useModel(n,"modelValue"),t=n,r=l.computed(()=>t.readonly?"solo":"solo-filled");return(o,a)=>(l.openBlock(),l.createElementBlock("div",null,[o.name?(l.openBlock(),l.createElementBlock("p",LU,l.toDisplayString(o.name),1)):l.createCommentVNode("",!0),o.label?(l.openBlock(),l.createBlock(va.VLabel,{key:1,class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(o.label),1)]),_:1})):l.createCommentVNode("",!0),l.createVNode(l.unref(Vo.VTextField),{variant:r.value,color:"secondary","bg-color":"containerBg",rounded:"sm",type:o.type,density:o.density,rules:o.rules,modelValue:e.value,"onUpdate:modelValue":a[0]||(a[0]=c=>e.value=c),class:"j-field",readonly:o.readonly,"hide-details":o.hideDetails},null,8,["variant","type","density","rules","modelValue","readonly","hide-details"])]))}});function vE(n,e){return function(){return n.apply(e,arguments)}}const{toString:xU}=Object.prototype,{getPrototypeOf:Hf}=Object,eu=(n=>e=>{const t=xU.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ir=n=>(n=n.toLowerCase(),e=>eu(e)===n),tu=n=>e=>typeof e===n,{isArray:Na}=Array,Ps=tu("undefined");function UU(n){return n!==null&&!Ps(n)&&n.constructor!==null&&!Ps(n.constructor)&&Fn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const yE=Ir("ArrayBuffer");function BU(n){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(n):e=n&&n.buffer&&yE(n.buffer),e}const FU=tu("string"),Fn=tu("function"),CE=tu("number"),nu=n=>n!==null&&typeof n=="object",VU=n=>n===!0||n===!1,fl=n=>{if(eu(n)!=="object")return!1;const e=Hf(n);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},HU=Ir("Date"),$U=Ir("File"),KU=Ir("Blob"),WU=Ir("FileList"),zU=n=>nu(n)&&Fn(n.pipe),GU=n=>{let e;return n&&(typeof FormData=="function"&&n instanceof FormData||Fn(n.append)&&((e=eu(n))==="formdata"||e==="object"&&Fn(n.toString)&&n.toString()==="[object FormData]"))},qU=Ir("URLSearchParams"),[jU,YU,JU,QU]=["ReadableStream","Request","Response","Headers"].map(Ir),XU=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Hs(n,e,{allOwnKeys:t=!1}={}){if(n===null||typeof n>"u")return;let r,o;if(typeof n!="object"&&(n=[n]),Na(n))for(r=0,o=n.length;r<o;r++)e.call(null,n[r],r,n);else{const a=t?Object.getOwnPropertyNames(n):Object.keys(n),c=a.length;let d;for(r=0;r<c;r++)d=a[r],e.call(null,n[d],d,n)}}function EE(n,e){e=e.toLowerCase();const t=Object.keys(n);let r=t.length,o;for(;r-- >0;)if(o=t[r],e===o.toLowerCase())return o;return null}const mi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wE=n=>!Ps(n)&&n!==mi;function Wh(){const{caseless:n}=wE(this)&&this||{},e={},t=(r,o)=>{const a=n&&EE(e,o)||o;fl(e[a])&&fl(r)?e[a]=Wh(e[a],r):fl(r)?e[a]=Wh({},r):Na(r)?e[a]=r.slice():e[a]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&Hs(arguments[r],t);return e}const ZU=(n,e,t,{allOwnKeys:r}={})=>(Hs(e,(o,a)=>{t&&Fn(o)?n[a]=vE(o,t):n[a]=o},{allOwnKeys:r}),n),eB=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),tB=(n,e,t,r)=>{n.prototype=Object.create(e.prototype,r),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:e.prototype}),t&&Object.assign(n.prototype,t)},nB=(n,e,t,r)=>{let o,a,c;const d={};if(e=e||{},n==null)return e;do{for(o=Object.getOwnPropertyNames(n),a=o.length;a-- >0;)c=o[a],(!r||r(c,n,e))&&!d[c]&&(e[c]=n[c],d[c]=!0);n=t!==!1&&Hf(n)}while(n&&(!t||t(n,e))&&n!==Object.prototype);return e},rB=(n,e,t)=>{n=String(n),(t===void 0||t>n.length)&&(t=n.length),t-=e.length;const r=n.indexOf(e,t);return r!==-1&&r===t},oB=n=>{if(!n)return null;if(Na(n))return n;let e=n.length;if(!CE(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=n[e];return t},iB=(n=>e=>n&&e instanceof n)(typeof Uint8Array<"u"&&Hf(Uint8Array)),aB=(n,e)=>{const r=(n&&n[Symbol.iterator]).call(n);let o;for(;(o=r.next())&&!o.done;){const a=o.value;e.call(n,a[0],a[1])}},sB=(n,e)=>{let t;const r=[];for(;(t=n.exec(e))!==null;)r.push(t);return r},cB=Ir("HTMLFormElement"),lB=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,r,o){return r.toUpperCase()+o}),wv=(({hasOwnProperty:n})=>(e,t)=>n.call(e,t))(Object.prototype),uB=Ir("RegExp"),TE=(n,e)=>{const t=Object.getOwnPropertyDescriptors(n),r={};Hs(t,(o,a)=>{let c;(c=e(o,a,n))!==!1&&(r[a]=c||o)}),Object.defineProperties(n,r)},dB=n=>{TE(n,(e,t)=>{if(Fn(n)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const r=n[t];if(Fn(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},hB=(n,e)=>{const t={},r=o=>{o.forEach(a=>{t[a]=!0})};return Na(n)?r(n):r(String(n).split(e)),t},fB=()=>{},mB=(n,e)=>n!=null&&Number.isFinite(n=+n)?n:e,nh="abcdefghijklmnopqrstuvwxyz",Tv="0123456789",bE={DIGIT:Tv,ALPHA:nh,ALPHA_DIGIT:nh+nh.toUpperCase()+Tv},gB=(n=16,e=bE.ALPHA_DIGIT)=>{let t="";const{length:r}=e;for(;n--;)t+=e[Math.random()*r|0];return t};function pB(n){return!!(n&&Fn(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const _B=n=>{const e=new Array(10),t=(r,o)=>{if(nu(r)){if(e.indexOf(r)>=0)return;if(!("toJSON"in r)){e[o]=r;const a=Na(r)?[]:{};return Hs(r,(c,d)=>{const h=t(c,o+1);!Ps(h)&&(a[d]=h)}),e[o]=void 0,a}}return r};return t(n,0)},vB=Ir("AsyncFunction"),yB=n=>n&&(nu(n)||Fn(n))&&Fn(n.then)&&Fn(n.catch),IE=((n,e)=>n?setImmediate:e?((t,r)=>(mi.addEventListener("message",({source:o,data:a})=>{o===mi&&a===t&&r.length&&r.shift()()},!1),o=>{r.push(o),mi.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",Fn(mi.postMessage)),CB=typeof queueMicrotask<"u"?queueMicrotask.bind(mi):typeof process<"u"&&process.nextTick||IE,B={isArray:Na,isArrayBuffer:yE,isBuffer:UU,isFormData:GU,isArrayBufferView:BU,isString:FU,isNumber:CE,isBoolean:VU,isObject:nu,isPlainObject:fl,isReadableStream:jU,isRequest:YU,isResponse:JU,isHeaders:QU,isUndefined:Ps,isDate:HU,isFile:$U,isBlob:KU,isRegExp:uB,isFunction:Fn,isStream:zU,isURLSearchParams:qU,isTypedArray:iB,isFileList:WU,forEach:Hs,merge:Wh,extend:ZU,trim:XU,stripBOM:eB,inherits:tB,toFlatObject:nB,kindOf:eu,kindOfTest:Ir,endsWith:rB,toArray:oB,forEachEntry:aB,matchAll:sB,isHTMLForm:cB,hasOwnProperty:wv,hasOwnProp:wv,reduceDescriptors:TE,freezeMethods:dB,toObjectSet:hB,toCamelCase:lB,noop:fB,toFiniteNumber:mB,findKey:EE,global:mi,isContextDefined:wE,ALPHABET:bE,generateString:gB,isSpecCompliantForm:pB,toJSONObject:_B,isAsyncFn:vB,isThenable:yB,setImmediate:IE,asap:CB};function Te(n,e,t,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}B.inherits(Te,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:B.toJSONObject(this.config),code:this.code,status:this.status}}});const SE=Te.prototype,AE={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(n=>{AE[n]={value:n}});Object.defineProperties(Te,AE);Object.defineProperty(SE,"isAxiosError",{value:!0});Te.from=(n,e,t,r,o,a)=>{const c=Object.create(SE);return B.toFlatObject(n,c,function(h){return h!==Error.prototype},d=>d!=="isAxiosError"),Te.call(c,n.message,e,t,r,o),c.cause=n,c.name=n.name,a&&Object.assign(c,a),c};const EB=null;function zh(n){return B.isPlainObject(n)||B.isArray(n)}function kE(n){return B.endsWith(n,"[]")?n.slice(0,-2):n}function bv(n,e,t){return n?n.concat(e).map(function(o,a){return o=kE(o),!t&&a?"["+o+"]":o}).join(t?".":""):e}function wB(n){return B.isArray(n)&&!n.some(zh)}const TB=B.toFlatObject(B,{},null,function(e){return/^is[A-Z]/.test(e)});function ru(n,e,t){if(!B.isObject(n))throw new TypeError("target must be an object");e=e||new FormData,t=B.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,k){return!B.isUndefined(k[T])});const r=t.metaTokens,o=t.visitor||g,a=t.dots,c=t.indexes,h=(t.Blob||typeof Blob<"u"&&Blob)&&B.isSpecCompliantForm(e);if(!B.isFunction(o))throw new TypeError("visitor must be a function");function m(C){if(C===null)return"";if(B.isDate(C))return C.toISOString();if(!h&&B.isBlob(C))throw new Te("Blob is not supported. Use a Buffer instead.");return B.isArrayBuffer(C)||B.isTypedArray(C)?h&&typeof Blob=="function"?new Blob([C]):Buffer.from(C):C}function g(C,T,k){let I=C;if(C&&!k&&typeof C=="object"){if(B.endsWith(T,"{}"))T=r?T:T.slice(0,-2),C=JSON.stringify(C);else if(B.isArray(C)&&wB(C)||(B.isFileList(C)||B.endsWith(T,"[]"))&&(I=B.toArray(C)))return T=kE(T),I.forEach(function(D,L){!(B.isUndefined(D)||D===null)&&e.append(c===!0?bv([T],L,a):c===null?T:T+"[]",m(D))}),!1}return zh(C)?!0:(e.append(bv(k,T,a),m(C)),!1)}const _=[],p=Object.assign(TB,{defaultVisitor:g,convertValue:m,isVisitable:zh});function w(C,T){if(!B.isUndefined(C)){if(_.indexOf(C)!==-1)throw Error("Circular reference detected in "+T.join("."));_.push(C),B.forEach(C,function(I,N){(!(B.isUndefined(I)||I===null)&&o.call(e,I,B.isString(N)?N.trim():N,T,p))===!0&&w(I,T?T.concat(N):[N])}),_.pop()}}if(!B.isObject(n))throw new TypeError("data must be an object");return w(n),e}function Iv(n){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function $f(n,e){this._pairs=[],n&&ru(n,this,e)}const NE=$f.prototype;NE.append=function(e,t){this._pairs.push([e,t])};NE.toString=function(e){const t=e?function(r){return e.call(this,r,Iv)}:Iv;return this._pairs.map(function(o){return t(o[0])+"="+t(o[1])},"").join("&")};function bB(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function RE(n,e,t){if(!e)return n;const r=t&&t.encode||bB;B.isFunction(t)&&(t={serialize:t});const o=t&&t.serialize;let a;if(o?a=o(e,t):a=B.isURLSearchParams(e)?e.toString():new $f(e,t).toString(r),a){const c=n.indexOf("#");c!==-1&&(n=n.slice(0,c)),n+=(n.indexOf("?")===-1?"?":"&")+a}return n}class Sv{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){B.forEach(this.handlers,function(r){r!==null&&e(r)})}}const OE={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},IB=typeof URLSearchParams<"u"?URLSearchParams:$f,SB=typeof FormData<"u"?FormData:null,AB=typeof Blob<"u"?Blob:null,kB={isBrowser:!0,classes:{URLSearchParams:IB,FormData:SB,Blob:AB},protocols:["http","https","file","blob","url","data"]},Kf=typeof window<"u"&&typeof document<"u",Gh=typeof navigator=="object"&&navigator||void 0,NB=Kf&&(!Gh||["ReactNative","NativeScript","NS"].indexOf(Gh.product)<0),RB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OB=Kf&&window.location.href||"http://localhost",PB=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Kf,hasStandardBrowserEnv:NB,hasStandardBrowserWebWorkerEnv:RB,navigator:Gh,origin:OB},Symbol.toStringTag,{value:"Module"})),nn={...PB,...kB};function MB(n,e){return ru(n,new nn.classes.URLSearchParams,Object.assign({visitor:function(t,r,o,a){return nn.isNode&&B.isBuffer(t)?(this.append(r,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function DB(n){return B.matchAll(/\w+|\[(\w*)]/g,n).map(e=>e[0]==="[]"?"":e[1]||e[0])}function LB(n){const e={},t=Object.keys(n);let r;const o=t.length;let a;for(r=0;r<o;r++)a=t[r],e[a]=n[a];return e}function PE(n){function e(t,r,o,a){let c=t[a++];if(c==="__proto__")return!0;const d=Number.isFinite(+c),h=a>=t.length;return c=!c&&B.isArray(o)?o.length:c,h?(B.hasOwnProp(o,c)?o[c]=[o[c],r]:o[c]=r,!d):((!o[c]||!B.isObject(o[c]))&&(o[c]=[]),e(t,r,o[c],a)&&B.isArray(o[c])&&(o[c]=LB(o[c])),!d)}if(B.isFormData(n)&&B.isFunction(n.entries)){const t={};return B.forEachEntry(n,(r,o)=>{e(DB(r),o,t,0)}),t}return null}function xB(n,e,t){if(B.isString(n))try{return(e||JSON.parse)(n),B.trim(n)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(n)}const $s={transitional:OE,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const r=t.getContentType()||"",o=r.indexOf("application/json")>-1,a=B.isObject(e);if(a&&B.isHTMLForm(e)&&(e=new FormData(e)),B.isFormData(e))return o?JSON.stringify(PE(e)):e;if(B.isArrayBuffer(e)||B.isBuffer(e)||B.isStream(e)||B.isFile(e)||B.isBlob(e)||B.isReadableStream(e))return e;if(B.isArrayBufferView(e))return e.buffer;if(B.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let d;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return MB(e,this.formSerializer).toString();if((d=B.isFileList(e))||r.indexOf("multipart/form-data")>-1){const h=this.env&&this.env.FormData;return ru(d?{"files[]":e}:e,h&&new h,this.formSerializer)}}return a||o?(t.setContentType("application/json",!1),xB(e)):e}],transformResponse:[function(e){const t=this.transitional||$s.transitional,r=t&&t.forcedJSONParsing,o=this.responseType==="json";if(B.isResponse(e)||B.isReadableStream(e))return e;if(e&&B.isString(e)&&(r&&!this.responseType||o)){const c=!(t&&t.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(d){if(c)throw d.name==="SyntaxError"?Te.from(d,Te.ERR_BAD_RESPONSE,this,null,this.response):d}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:nn.classes.FormData,Blob:nn.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};B.forEach(["delete","get","head","post","put","patch"],n=>{$s.headers[n]={}});const UB=B.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),BB=n=>{const e={};let t,r,o;return n&&n.split(`
42
42
  `).forEach(function(c){o=c.indexOf(":"),t=c.substring(0,o).trim().toLowerCase(),r=c.substring(o+1).trim(),!(!t||e[t]&&UB[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},Av=Symbol("internals");function is(n){return n&&String(n).trim().toLowerCase()}function ml(n){return n===!1||n==null?n:B.isArray(n)?n.map(ml):String(n)}function FB(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const VB=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function rh(n,e,t,r,o){if(B.isFunction(r))return r.call(this,e,t);if(o&&(e=t),!!B.isString(e)){if(B.isString(r))return e.indexOf(r)!==-1;if(B.isRegExp(r))return r.test(e)}}function HB(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function $B(n,e){const t=B.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(o,a,c){return this[r].call(this,e,o,a,c)},configurable:!0})})}class yn{constructor(e){e&&this.set(e)}set(e,t,r){const o=this;function a(d,h,m){const g=is(h);if(!g)throw new Error("header name must be a non-empty string");const _=B.findKey(o,g);(!_||o[_]===void 0||m===!0||m===void 0&&o[_]!==!1)&&(o[_||h]=ml(d))}const c=(d,h)=>B.forEach(d,(m,g)=>a(m,g,h));if(B.isPlainObject(e)||e instanceof this.constructor)c(e,t);else if(B.isString(e)&&(e=e.trim())&&!VB(e))c(BB(e),t);else if(B.isHeaders(e))for(const[d,h]of e.entries())a(h,d,r);else e!=null&&a(t,e,r);return this}get(e,t){if(e=is(e),e){const r=B.findKey(this,e);if(r){const o=this[r];if(!t)return o;if(t===!0)return FB(o);if(B.isFunction(t))return t.call(this,o,r);if(B.isRegExp(t))return t.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=is(e),e){const r=B.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||rh(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let o=!1;function a(c){if(c=is(c),c){const d=B.findKey(r,c);d&&(!t||rh(r,r[d],d,t))&&(delete r[d],o=!0)}}return B.isArray(e)?e.forEach(a):a(e),o}clear(e){const t=Object.keys(this);let r=t.length,o=!1;for(;r--;){const a=t[r];(!e||rh(this,this[a],a,e,!0))&&(delete this[a],o=!0)}return o}normalize(e){const t=this,r={};return B.forEach(this,(o,a)=>{const c=B.findKey(r,a);if(c){t[c]=ml(o),delete t[a];return}const d=e?HB(a):String(a).trim();d!==a&&delete t[a],t[d]=ml(o),r[d]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return B.forEach(this,(r,o)=>{r!=null&&r!==!1&&(t[o]=e&&B.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
43
43
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(o=>r.set(o)),r}static accessor(e){const r=(this[Av]=this[Av]={accessors:{}}).accessors,o=this.prototype;function a(c){const d=is(c);r[d]||($B(o,c),r[d]=!0)}return B.isArray(e)?e.forEach(a):a(e),this}}yn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);B.reduceDescriptors(yn.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});B.freezeMethods(yn);function oh(n,e){const t=this||$s,r=e||t,o=yn.from(r.headers);let a=r.data;return B.forEach(n,function(d){a=d.call(t,a,o.normalize(),e?e.status:void 0)}),o.normalize(),a}function ME(n){return!!(n&&n.__CANCEL__)}function Ra(n,e,t){Te.call(this,n??"canceled",Te.ERR_CANCELED,e,t),this.name="CanceledError"}B.inherits(Ra,Te,{__CANCEL__:!0});function DE(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new Te("Request failed with status code "+t.status,[Te.ERR_BAD_REQUEST,Te.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function KB(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function WB(n,e){n=n||10;const t=new Array(n),r=new Array(n);let o=0,a=0,c;return e=e!==void 0?e:1e3,function(h){const m=Date.now(),g=r[a];c||(c=m),t[o]=h,r[o]=m;let _=a,p=0;for(;_!==o;)p+=t[_++],_=_%n;if(o=(o+1)%n,o===a&&(a=(a+1)%n),m-c<e)return;const w=g&&m-g;return w?Math.round(p*1e3/w):void 0}}function zB(n,e){let t=0,r=1e3/e,o,a;const c=(m,g=Date.now())=>{t=g,o=null,a&&(clearTimeout(a),a=null),n.apply(null,m)};return[(...m)=>{const g=Date.now(),_=g-t;_>=r?c(m,g):(o=m,a||(a=setTimeout(()=>{a=null,c(o)},r-_)))},()=>o&&c(o)]}const Al=(n,e,t=3)=>{let r=0;const o=WB(50,250);return zB(a=>{const c=a.loaded,d=a.lengthComputable?a.total:void 0,h=c-r,m=o(h),g=c<=d;r=c;const _={loaded:c,total:d,progress:d?c/d:void 0,bytes:h,rate:m||void 0,estimated:m&&d&&g?(d-c)/m:void 0,event:a,lengthComputable:d!=null,[e?"download":"upload"]:!0};n(_)},t)},kv=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},Nv=n=>(...e)=>B.asap(()=>n(...e)),GB=nn.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,nn.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(nn.origin),nn.navigator&&/(msie|trident)/i.test(nn.navigator.userAgent)):()=>!0,qB=nn.hasStandardBrowserEnv?{write(n,e,t,r,o,a){const c=[n+"="+encodeURIComponent(e)];B.isNumber(t)&&c.push("expires="+new Date(t).toGMTString()),B.isString(r)&&c.push("path="+r),B.isString(o)&&c.push("domain="+o),a===!0&&c.push("secure"),document.cookie=c.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function jB(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function YB(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function LE(n,e){return n&&!jB(e)?YB(n,e):e}const Rv=n=>n instanceof yn?{...n}:n;function Ei(n,e){e=e||{};const t={};function r(m,g,_,p){return B.isPlainObject(m)&&B.isPlainObject(g)?B.merge.call({caseless:p},m,g):B.isPlainObject(g)?B.merge({},g):B.isArray(g)?g.slice():g}function o(m,g,_,p){if(B.isUndefined(g)){if(!B.isUndefined(m))return r(void 0,m,_,p)}else return r(m,g,_,p)}function a(m,g){if(!B.isUndefined(g))return r(void 0,g)}function c(m,g){if(B.isUndefined(g)){if(!B.isUndefined(m))return r(void 0,m)}else return r(void 0,g)}function d(m,g,_){if(_ in e)return r(m,g);if(_ in n)return r(void 0,m)}const h={url:a,method:a,data:a,baseURL:c,transformRequest:c,transformResponse:c,paramsSerializer:c,timeout:c,timeoutMessage:c,withCredentials:c,withXSRFToken:c,adapter:c,responseType:c,xsrfCookieName:c,xsrfHeaderName:c,onUploadProgress:c,onDownloadProgress:c,decompress:c,maxContentLength:c,maxBodyLength:c,beforeRedirect:c,transport:c,httpAgent:c,httpsAgent:c,cancelToken:c,socketPath:c,responseEncoding:c,validateStatus:d,headers:(m,g,_)=>o(Rv(m),Rv(g),_,!0)};return B.forEach(Object.keys(Object.assign({},n,e)),function(g){const _=h[g]||o,p=_(n[g],e[g],g);B.isUndefined(p)&&_!==d||(t[g]=p)}),t}const xE=n=>{const e=Ei({},n);let{data:t,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:c,auth:d}=e;e.headers=c=yn.from(c),e.url=RE(LE(e.baseURL,e.url),n.params,n.paramsSerializer),d&&c.set("Authorization","Basic "+btoa((d.username||"")+":"+(d.password?unescape(encodeURIComponent(d.password)):"")));let h;if(B.isFormData(t)){if(nn.hasStandardBrowserEnv||nn.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if((h=c.getContentType())!==!1){const[m,...g]=h?h.split(";").map(_=>_.trim()).filter(Boolean):[];c.setContentType([m||"multipart/form-data",...g].join("; "))}}if(nn.hasStandardBrowserEnv&&(r&&B.isFunction(r)&&(r=r(e)),r||r!==!1&&GB(e.url))){const m=o&&a&&qB.read(a);m&&c.set(o,m)}return e},JB=typeof XMLHttpRequest<"u",QB=JB&&function(n){return new Promise(function(t,r){const o=xE(n);let a=o.data;const c=yn.from(o.headers).normalize();let{responseType:d,onUploadProgress:h,onDownloadProgress:m}=o,g,_,p,w,C;function T(){w&&w(),C&&C(),o.cancelToken&&o.cancelToken.unsubscribe(g),o.signal&&o.signal.removeEventListener("abort",g)}let k=new XMLHttpRequest;k.open(o.method.toUpperCase(),o.url,!0),k.timeout=o.timeout;function I(){if(!k)return;const D=yn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),K={data:!d||d==="text"||d==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:D,config:n,request:k};DE(function(M){t(M),T()},function(M){r(M),T()},K),k=null}"onloadend"in k?k.onloadend=I:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(I)},k.onabort=function(){k&&(r(new Te("Request aborted",Te.ECONNABORTED,n,k)),k=null)},k.onerror=function(){r(new Te("Network Error",Te.ERR_NETWORK,n,k)),k=null},k.ontimeout=function(){let L=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const K=o.transitional||OE;o.timeoutErrorMessage&&(L=o.timeoutErrorMessage),r(new Te(L,K.clarifyTimeoutError?Te.ETIMEDOUT:Te.ECONNABORTED,n,k)),k=null},a===void 0&&c.setContentType(null),"setRequestHeader"in k&&B.forEach(c.toJSON(),function(L,K){k.setRequestHeader(K,L)}),B.isUndefined(o.withCredentials)||(k.withCredentials=!!o.withCredentials),d&&d!=="json"&&(k.responseType=o.responseType),m&&([p,C]=Al(m,!0),k.addEventListener("progress",p)),h&&k.upload&&([_,w]=Al(h),k.upload.addEventListener("progress",_),k.upload.addEventListener("loadend",w)),(o.cancelToken||o.signal)&&(g=D=>{k&&(r(!D||D.type?new Ra(null,n,k):D),k.abort(),k=null)},o.cancelToken&&o.cancelToken.subscribe(g),o.signal&&(o.signal.aborted?g():o.signal.addEventListener("abort",g)));const N=KB(o.url);if(N&&nn.protocols.indexOf(N)===-1){r(new Te("Unsupported protocol "+N+":",Te.ERR_BAD_REQUEST,n));return}k.send(a||null)})},XB=(n,e)=>{const{length:t}=n=n?n.filter(Boolean):[];if(e||t){let r=new AbortController,o;const a=function(m){if(!o){o=!0,d();const g=m instanceof Error?m:this.reason;r.abort(g instanceof Te?g:new Ra(g instanceof Error?g.message:g))}};let c=e&&setTimeout(()=>{c=null,a(new Te(`timeout ${e} of ms exceeded`,Te.ETIMEDOUT))},e);const d=()=>{n&&(c&&clearTimeout(c),c=null,n.forEach(m=>{m.unsubscribe?m.unsubscribe(a):m.removeEventListener("abort",a)}),n=null)};n.forEach(m=>m.addEventListener("abort",a));const{signal:h}=r;return h.unsubscribe=()=>B.asap(d),h}},ZB=function*(n,e){let t=n.byteLength;if(t<e){yield n;return}let r=0,o;for(;r<t;)o=r+e,yield n.slice(r,o),r=o},eF=async function*(n,e){for await(const t of tF(n))yield*ZB(t,e)},tF=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const e=n.getReader();try{for(;;){const{done:t,value:r}=await e.read();if(t)break;yield r}}finally{await e.cancel()}},Ov=(n,e,t,r)=>{const o=eF(n,e);let a=0,c,d=h=>{c||(c=!0,r&&r(h))};return new ReadableStream({async pull(h){try{const{done:m,value:g}=await o.next();if(m){d(),h.close();return}let _=g.byteLength;if(t){let p=a+=_;t(p)}h.enqueue(new Uint8Array(g))}catch(m){throw d(m),m}},cancel(h){return d(h),o.return()}},{highWaterMark:2})},ou=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",UE=ou&&typeof ReadableStream=="function",nF=ou&&(typeof TextEncoder=="function"?(n=>e=>n.encode(e))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),BE=(n,...e)=>{try{return!!n(...e)}catch{return!1}},rF=UE&&BE(()=>{let n=!1;const e=new Request(nn.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!e}),Pv=64*1024,qh=UE&&BE(()=>B.isReadableStream(new Response("").body)),kl={stream:qh&&(n=>n.body)};ou&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!kl[e]&&(kl[e]=B.isFunction(n[e])?t=>t[e]():(t,r)=>{throw new Te(`Response type '${e}' is not supported`,Te.ERR_NOT_SUPPORT,r)})})})(new Response);const oF=async n=>{if(n==null)return 0;if(B.isBlob(n))return n.size;if(B.isSpecCompliantForm(n))return(await new Request(nn.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(B.isArrayBufferView(n)||B.isArrayBuffer(n))return n.byteLength;if(B.isURLSearchParams(n)&&(n=n+""),B.isString(n))return(await nF(n)).byteLength},iF=async(n,e)=>{const t=B.toFiniteNumber(n.getContentLength());return t??oF(e)},aF=ou&&(async n=>{let{url:e,method:t,data:r,signal:o,cancelToken:a,timeout:c,onDownloadProgress:d,onUploadProgress:h,responseType:m,headers:g,withCredentials:_="same-origin",fetchOptions:p}=xE(n);m=m?(m+"").toLowerCase():"text";let w=XB([o,a&&a.toAbortSignal()],c),C;const T=w&&w.unsubscribe&&(()=>{w.unsubscribe()});let k;try{if(h&&rF&&t!=="get"&&t!=="head"&&(k=await iF(g,r))!==0){let K=new Request(e,{method:"POST",body:r,duplex:"half"}),q;if(B.isFormData(r)&&(q=K.headers.get("content-type"))&&g.setContentType(q),K.body){const[M,ce]=kv(k,Al(Nv(h)));r=Ov(K.body,Pv,M,ce)}}B.isString(_)||(_=_?"include":"omit");const I="credentials"in Request.prototype;C=new Request(e,{...p,signal:w,method:t.toUpperCase(),headers:g.normalize().toJSON(),body:r,duplex:"half",credentials:I?_:void 0});let N=await fetch(C);const D=qh&&(m==="stream"||m==="response");if(qh&&(d||D&&T)){const K={};["status","statusText","headers"].forEach(ae=>{K[ae]=N[ae]});const q=B.toFiniteNumber(N.headers.get("content-length")),[M,ce]=d&&kv(q,Al(Nv(d),!0))||[];N=new Response(Ov(N.body,Pv,M,()=>{ce&&ce(),T&&T()}),K)}m=m||"text";let L=await kl[B.findKey(kl,m)||"text"](N,n);return!D&&T&&T(),await new Promise((K,q)=>{DE(K,q,{data:L,headers:yn.from(N.headers),status:N.status,statusText:N.statusText,config:n,request:C})})}catch(I){throw T&&T(),I&&I.name==="TypeError"&&/fetch/i.test(I.message)?Object.assign(new Te("Network Error",Te.ERR_NETWORK,n,C),{cause:I.cause||I}):Te.from(I,I&&I.code,n,C)}}),jh={http:EB,xhr:QB,fetch:aF};B.forEach(jh,(n,e)=>{if(n){try{Object.defineProperty(n,"name",{value:e})}catch{}Object.defineProperty(n,"adapterName",{value:e})}});const Mv=n=>`- ${n}`,sF=n=>B.isFunction(n)||n===null||n===!1,FE={getAdapter:n=>{n=B.isArray(n)?n:[n];const{length:e}=n;let t,r;const o={};for(let a=0;a<e;a++){t=n[a];let c;if(r=t,!sF(t)&&(r=jh[(c=String(t)).toLowerCase()],r===void 0))throw new Te(`Unknown adapter '${c}'`);if(r)break;o[c||"#"+a]=r}if(!r){const a=Object.entries(o).map(([d,h])=>`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let c=e?a.length>1?`since :
44
44
  `+a.map(Mv).join(`
@@ -110,4 +110,4 @@ Error Description: ${a.errorMessage}`);else{const c=a;this.logger.error(`A non-M
110
110
  Error: ${c.name}
111
111
  Error Description: ${c.message}`)}return null}return r||(this.logger.warning("The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request."),this.logger.verbose("Creating custom Authority for custom domain scenario."),r=Xt.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort)),r}isInKnownAuthorities(){return this.authorityOptions.knownAuthorities.filter(t=>t&&De.getDomainFromUrl(t).toLowerCase()===this.hostnameAndPort).length>0}static generateAuthority(e,t){let r;if(t&&t.azureCloudInstance!==em.None){const o=t.tenant?t.tenant:F.DEFAULT_COMMON_TENANT;r=`${t.azureCloudInstance}/${o}/`}return r||e}static createCloudDiscoveryMetadataFromHost(e){return{preferred_network:e,preferred_cache:e,aliases:[e]}}getPreferredCache(){if(this.managedIdentity)return F.DEFAULT_AUTHORITY_HOST;if(this.discoveryComplete())return this.metadata.preferred_cache;throw Y(ao)}isAlias(e){return this.metadata.aliases.indexOf(e)>-1}isAliasOfKnownMicrosoftAuthority(e){return Lw.has(e)}static isPublicCloudAuthority(e){return F.KNOWN_PUBLIC_CLOUDS.indexOf(e)>=0}static buildRegionalAuthorityString(e,t,r){const o=new De(e);o.validateAsUri();const a=o.getUrlComponents();let c=`${t}.${a.HostNameAndPort}`;this.isPublicCloudAuthority(a.HostNameAndPort)&&(c=`${t}.${F.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`);const d=De.constructAuthorityUriFromObject({...o.getUrlComponents(),HostNameAndPort:c}).urlString;return r?`${d}?${r}`:d}static replaceWithRegionalInformation(e,t){const r={...e};return r.authorization_endpoint=Xt.buildRegionalAuthorityString(r.authorization_endpoint,t),r.token_endpoint=Xt.buildRegionalAuthorityString(r.token_endpoint,t),r.end_session_endpoint&&(r.end_session_endpoint=Xt.buildRegionalAuthorityString(r.end_session_endpoint,t)),r}static transformCIAMAuthority(e){let t=e;const o=new De(e).getUrlComponents();if(o.PathSegments.length===0&&o.HostNameAndPort.endsWith(F.CIAM_AUTH_URL)){const a=o.HostNameAndPort.split(".")[0];t=`${t}${a}${F.AAD_TENANT_DOMAIN_SUFFIX}`}return t}}Xt.reservedTenantDomains=new Set(["{tenant}","{tenantid}",Ho.COMMON,Ho.CONSUMERS,Ho.ORGANIZATIONS]);function w2(n){var o;const r=(o=new De(n).getUrlComponents().PathSegments.slice(-1)[0])==null?void 0:o.toLowerCase();switch(r){case Ho.COMMON:case Ho.ORGANIZATIONS:case Ho.CONSUMERS:return;default:return r}}function Fw(n){return n.endsWith(F.FORWARD_SLASH)?n:`${n}${F.FORWARD_SLASH}`}function T2(n){const e=n.cloudDiscoveryMetadata;let t;if(e)try{t=JSON.parse(e)}catch{throw Xe(om)}return{canonicalAuthority:n.authority?Fw(n.authority):void 0,knownAuthorities:n.knownAuthorities,cloudDiscoveryMetadata:t}}/*! @azure/msal-common v14.16.0 2024-11-05 */async function Vw(n,e,t,r,o,a,c){c==null||c.addQueueMeasurement(x.AuthorityFactoryCreateDiscoveredInstance,a);const d=Xt.transformCIAMAuthority(Fw(n)),h=new Xt(d,e,t,r,o,a,c);try{return await Q(h.resolveEndpointsAsync.bind(h),x.AuthorityResolveEndpointsAsync,o,c,a)(),h}catch{throw Y(ao)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Wo extends lt{constructor(e,t,r,o,a){super(e,t,r),this.name="ServerError",this.errorNo=o,this.status=a,Object.setPrototypeOf(this,Wo.prototype)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class Ur{static generateThrottlingStorageKey(e){return`${Cs.THROTTLING_PREFIX}.${JSON.stringify(e)}`}static preProcess(e,t){var a;const r=Ur.generateThrottlingStorageKey(t),o=e.getThrottlingCache(r);if(o){if(o.throttleTime<Date.now()){e.removeItem(r);return}throw new Wo(((a=o.errorCodes)==null?void 0:a.join(" "))||F.EMPTY_STRING,o.errorMessage,o.subError)}}static postProcess(e,t,r){if(Ur.checkResponseStatus(r)||Ur.checkResponseForRetryAfter(r)){const o={throttleTime:Ur.calculateThrottleTime(parseInt(r.headers[dn.RETRY_AFTER])),error:r.body.error,errorCodes:r.body.error_codes,errorMessage:r.body.error_description,subError:r.body.suberror};e.setThrottlingCache(Ur.generateThrottlingStorageKey(t),o)}}static checkResponseStatus(e){return e.status===429||e.status>=500&&e.status<600}static checkResponseForRetryAfter(e){return e.headers?e.headers.hasOwnProperty(dn.RETRY_AFTER)&&(e.status<200||e.status>=300):!1}static calculateThrottleTime(e){const t=e<=0?0:e,r=Date.now()/1e3;return Math.floor(Math.min(r+(t||Cs.DEFAULT_THROTTLE_TIME_SECONDS),r+Cs.DEFAULT_MAX_THROTTLE_TIME_SECONDS)*1e3)}static removeThrottle(e,t,r,o){const a={clientId:t,authority:r.authority,scopes:r.scopes,homeAccountIdentifier:o,claims:r.claims,authenticationScheme:r.authenticationScheme,resourceRequestMethod:r.resourceRequestMethod,resourceRequestUri:r.resourceRequestUri,shrClaims:r.shrClaims,sshKid:r.sshKid},c=this.generateThrottlingStorageKey(a);e.removeItem(c)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class hu extends lt{constructor(e,t,r){super(e.errorCode,e.errorMessage,e.subError),Object.setPrototypeOf(this,hu.prototype),this.name="NetworkError",this.error=e,this.httpStatus=t,this.responseHeaders=r}}function ty(n,e,t){return new hu(n,e,t)}/*! @azure/msal-common v14.16.0 2024-11-05 */class dm{constructor(e,t){this.config=MV(e),this.logger=new Ko(this.config.loggerOptions,gw,Zf),this.cryptoUtils=this.config.cryptoInterface,this.cacheManager=this.config.storageInterface,this.networkClient=this.config.networkInterface,this.serverTelemetryManager=this.config.serverTelemetryManager,this.authority=this.config.authOptions.authority,this.performanceClient=t}createTokenRequestHeaders(e){const t={};if(t[dn.CONTENT_TYPE]=F.URL_FORM_CONTENT_TYPE,!this.config.systemOptions.preventCorsPreflight&&e)switch(e.type){case Bn.HOME_ACCOUNT_ID:try{const r=fa(e.credential);t[dn.CCS_HEADER]=`Oid:${r.uid}@${r.utid}`}catch(r){this.logger.verbose("Could not parse home account ID for CCS Header: "+r)}break;case Bn.UPN:t[dn.CCS_HEADER]=`UPN: ${e.credential}`;break}return t}async executePostToTokenEndpoint(e,t,r,o,a,c){var h;c&&((h=this.performanceClient)==null||h.addQueueMeasurement(c,a));const d=await this.sendPostRequest(o,e,{body:t,headers:r},a);return this.config.serverTelemetryManager&&d.status<500&&d.status!==429&&this.config.serverTelemetryManager.clearTelemetryCache(),d}async sendPostRequest(e,t,r,o){var c,d,h;Ur.preProcess(this.cacheManager,e);let a;try{a=await Q(this.networkClient.sendPostRequestAsync.bind(this.networkClient),x.NetworkClientSendPostRequestAsync,this.logger,this.performanceClient,o)(t,r);const m=a.headers||{};(d=this.performanceClient)==null||d.addFields({refreshTokenSize:((c=a.body.refresh_token)==null?void 0:c.length)||0,httpVerToken:m[dn.X_MS_HTTP_VERSION]||"",requestId:m[dn.X_MS_REQUEST_ID]||""},o)}catch(m){if(m instanceof hu){const g=m.responseHeaders;throw g&&((h=this.performanceClient)==null||h.addFields({httpVerToken:g[dn.X_MS_HTTP_VERSION]||"",requestId:g[dn.X_MS_REQUEST_ID]||"",contentTypeHeader:g[dn.CONTENT_TYPE]||void 0,contentLengthHeader:g[dn.CONTENT_LENGTH]||void 0,httpStatus:m.httpStatus},o)),m.error}throw m instanceof lt?m:Y(ew)}return Ur.postProcess(this.cacheManager,e,a),a}async updateAuthority(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.UpdateTokenEndpointAuthority,t);const r=`https://${e}/${this.authority.tenant}/`,o=await Vw(r,this.networkClient,this.cacheManager,this.authority.options,this.logger,t,this.performanceClient);this.authority=o}createTokenQueryParameters(e){const t=new Es(e.correlationId,this.performanceClient);return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenQueryParameters&&t.addExtraQueryParameters(e.tokenQueryParameters),t.addCorrelationId(e.correlationId),t.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */const xl="no_tokens_found",Hw="native_account_unavailable",hm="refresh_token_expired",b2="interaction_required",I2="consent_required",S2="login_required",fu="bad_token";/*! @azure/msal-common v14.16.0 2024-11-05 */const ny=[b2,I2,S2,fu],A2=["message_only","additional_action","basic_action","user_password_expired","consent_required","bad_token"],k2={[xl]:"No refresh token found in the cache. Please sign-in.",[Hw]:"The requested account is not available in the native broker. It may have been deleted or logged out. Please sign-in again using an interactive API.",[hm]:"Refresh token has expired.",[fu]:"Identity provider returned bad_token due to an expired or invalid refresh token. Please invoke an interactive API to resolve."};class wr extends lt{constructor(e,t,r,o,a,c,d,h){super(e,t,r),Object.setPrototypeOf(this,wr.prototype),this.timestamp=o||F.EMPTY_STRING,this.traceId=a||F.EMPTY_STRING,this.correlationId=c||F.EMPTY_STRING,this.claims=d||F.EMPTY_STRING,this.name="InteractionRequiredAuthError",this.errorNo=h}}function ry(n,e,t){const r=!!n&&ny.indexOf(n)>-1,o=!!t&&A2.indexOf(t)>-1,a=!!e&&ny.some(c=>e.indexOf(c)>-1);return r||a||o}function rf(n){return new wr(n,k2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class Cr{static setRequestState(e,t,r){const o=Cr.generateLibraryState(e,r);return t?`${o}${F.RESOURCE_DELIM}${t}`:o}static generateLibraryState(e,t){if(!e)throw Y(Xh);const r={id:e.createNewGuid()};t&&(r.meta=t);const o=JSON.stringify(r);return e.base64Encode(o)}static parseRequestState(e,t){if(!e)throw Y(Xh);if(!t)throw Y(Ta);try{const r=t.split(F.RESOURCE_DELIM),o=r[0],a=r.length>1?r.slice(1).join(F.RESOURCE_DELIM):F.EMPTY_STRING,c=e.base64Decode(o),d=JSON.parse(c);return{userRequestState:a||F.EMPTY_STRING,libraryState:d}}catch{throw Y(Ta)}}}/*! @azure/msal-common v14.16.0 2024-11-05 */const N2={SW:"sw",UHW:"uhw"};class Ia{constructor(e,t){this.cryptoUtils=e,this.performanceClient=t}async generateCnf(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.PopTokenGenerateCnf,e.correlationId);const r=await Q(this.generateKid.bind(this),x.PopTokenGenerateCnf,t,this.performanceClient,e.correlationId)(e),o=this.cryptoUtils.base64UrlEncode(JSON.stringify(r));return{kid:r.kid,reqCnfString:o}}async generateKid(e){var r;return(r=this.performanceClient)==null||r.addQueueMeasurement(x.PopTokenGenerateKid,e.correlationId),{kid:await this.cryptoUtils.getPublicKeyThumbprint(e),xms_ksl:N2.SW}}async signPopToken(e,t,r){return this.signPayload(e,t,r)}async signPayload(e,t,r,o){const{resourceRequestMethod:a,resourceRequestUri:c,shrClaims:d,shrNonce:h,shrOptions:m}=r,g=c?new De(c):void 0,_=g==null?void 0:g.getUrlComponents();return this.cryptoUtils.signJwt({at:e,ts:zr(),m:a==null?void 0:a.toUpperCase(),u:_==null?void 0:_.HostNameAndPort,nonce:h||this.cryptoUtils.createNewGuid(),p:_==null?void 0:_.AbsolutePath,q:_!=null&&_.QueryString?[[],_.QueryString]:void 0,client_claims:d||void 0,...o},t,m,r.correlationId)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class R2{constructor(e,t){this.cache=e,this.hasChanged=t}get cacheHasChanged(){return this.hasChanged}get tokenCache(){return this.cache}}/*! @azure/msal-common v14.16.0 2024-11-05 */function O2(n){var r,o;const e="code=",t=(r=n.error_uri)==null?void 0:r.lastIndexOf(e);return t&&t>=0?(o=n.error_uri)==null?void 0:o.substring(t+e.length):void 0}class Ti{constructor(e,t,r,o,a,c,d){this.clientId=e,this.cacheStorage=t,this.cryptoObj=r,this.logger=o,this.serializableCache=a,this.persistencePlugin=c,this.performanceClient=d}validateServerAuthorizationCodeResponse(e,t){if(!e.state||!t)throw e.state?Y(Rl,"Cached State"):Y(Rl,"Server State");let r,o;try{r=decodeURIComponent(e.state)}catch{throw Y(Ta,e.state)}try{o=decodeURIComponent(t)}catch{throw Y(Ta,e.state)}if(r!==o)throw Y(rw);if(e.error||e.error_description||e.suberror){const a=O2(e);throw ry(e.error,e.error_description,e.suberror)?new wr(e.error||"",e.error_description,e.suberror,e.timestamp||"",e.trace_id||"",e.correlation_id||"",e.claims||"",a):new Wo(e.error||"",e.error_description,e.suberror,a)}}validateTokenResponse(e,t){var r;if(e.error||e.error_description||e.suberror){const o=`Error(s): ${e.error_codes||F.NOT_AVAILABLE} - Timestamp: ${e.timestamp||F.NOT_AVAILABLE} - Description: ${e.error_description||F.NOT_AVAILABLE} - Correlation ID: ${e.correlation_id||F.NOT_AVAILABLE} - Trace ID: ${e.trace_id||F.NOT_AVAILABLE}`,a=(r=e.error_codes)!=null&&r.length?e.error_codes[0]:void 0,c=new Wo(e.error,o,e.suberror,a,e.status);if(t&&e.status&&e.status>=Wc.SERVER_ERROR_RANGE_START&&e.status<=Wc.SERVER_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently unavailable and the access token is unable to be refreshed.
112
112
  ${c}`);return}else if(t&&e.status&&e.status>=Wc.CLIENT_ERROR_RANGE_START&&e.status<=Wc.CLIENT_ERROR_RANGE_END){this.logger.warning(`executeTokenRequest:validateTokenResponse - AAD is currently available but is unable to refresh the access token.
113
- ${c}`);return}throw ry(e.error,e.error_description,e.suberror)?new wr(e.error,e.error_description,e.suberror,e.timestamp||F.EMPTY_STRING,e.trace_id||F.EMPTY_STRING,e.correlation_id||F.EMPTY_STRING,e.claims||F.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Si(e.id_token||F.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw Y(ow);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw Y(Yf);pw(T,o.maxAge)}}this.homeAccountIdentifier=Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let _;a&&a.state&&(_=Cr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new R2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,_,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,_,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw Y(Qf);const m=Pw(a);let g,_;e.id_token&&a&&(g=cu(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),_=fm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?_t.fromString(e.scope):new _t(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,D=r+k,L=D+I,K=N&&N>0?r+N:void 0;p=lu(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),D,L,this.cryptoObj.base64Decode,K,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=_w(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:_,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var D,L,K,q,M;let g=F.EMPTY_STRING,_=[],p=null,w,C,T=F.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ge.POP&&!a.popKid){const ce=new Ia(e),{secret:ae,keyId:X}=r.accessToken;if(!X)throw Y(Xf);g=await ce.signPopToken(ae,X,a)}else g=r.accessToken.secret;_=_t.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ys?ys:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?sm(r.account.getAccountInfo(),void 0,c,(D=r.idToken)==null?void 0:D.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:_,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||F.EMPTY_STRING,familyId:T,tokenType:((K=r.accessToken)==null?void 0:K.tokenType)||F.EMPTY_STRING,state:d?d.userRequestState:F.EMPTY_STRING,cloudGraphHostName:((q=r.account)==null?void 0:q.cloudGraphHostName)||F.EMPTY_STRING,msGraphHost:((M=r.account)==null?void 0:M.msGraphHost)||F.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function fm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Pt.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=am(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function $w(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Kw extends dm{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await Q(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return De.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw Y(sw);const r=zr(),o=await Q(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[dn.X_MS_REQUEST_ID],c=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),Q(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw Y(hw);return e}getLogoutUri(e){if(!e)throw Xe(bw);const t=this.createLogoutUrlQueryString(e);return De.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=De.appendQueryString(e.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const _=Pl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${_.uid}${tn.CLIENT_INFO_SEPARATOR}${_.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(_){this.logger.verbose("Could not parse client info for CCS Header: "+_)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new Es(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ia.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!tf(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await $w(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType(JE.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ge.POP){const c=new Ia(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await Q(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Xe(uu);(!yr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=Pl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${tn.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Bn.HOME_ACCOUNT_ID:try{const c=fa(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Bn.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[ey])&&t.addExtraQueryParameters({[ey]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new Es(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[wi])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),tf(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Bt.SELECT_ACCOUNT)if(e.sid&&e.prompt===Bt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Bt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ge.POP)){const d=new Ia(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new Es(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const P2=300;class of extends dm{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=zr(),r=await Q(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[dn.X_MS_REQUEST_ID],a=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),Q(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Xe(Tw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Y(Jf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof wr&&o.errorCode===xl,c=o instanceof Wo&&o.errorCode===Vv.INVALID_GRANT_ERROR&&o.subError===Vv.CLIENT_MISMATCH_ERROR;if(a||c)return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Ai(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw rf(xl);if(r.expiresOn&&ef(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||P2))throw rf(hm);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ge.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}};try{return await Q(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof wr&&c.subError===fu){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ha(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=De.appendQueryString(t.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new Es(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType(JE.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!tf(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await $w(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Ge.POP){const d=new Ia(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Xe(uu);if((!yr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Bn.HOME_ACCOUNT_ID:try{const d=fa(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Bn.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class M2 extends dm{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Ma]});return o===Mo.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new of(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof su&&r.errorCode===co)return new of(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Mo.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!yr.isEmptyObj(e.claims))throw this.setCacheOutcome(Mo.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(co);if(!e.account)throw Y(Jf);const r=e.account.tenantId||w2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(cV(a.cachedAt)||ef(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mo.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(co);a.refreshOn&&ef(a.refreshOn,0)&&(t=Mo.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mo.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(co);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Q(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Mo.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Si(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw Y(Yf);pw(a,t.maxAge)}return Ti.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const D2={sendGetRequestAsync:()=>Promise.reject(Y(Ae)),sendPostRequestAsync:()=>Promise.reject(Y(Ae))};/*! @azure/msal-common v14.16.0 2024-11-05 */const oy=",",Ww="|";function L2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(oy),d.length<4)return e}else d=Array.from({length:4},()=>Ww);return c.forEach((h,m)=>{var g,_;h.length===2&&((g=h[0])!=null&&g.length)&&((_=h[1])!=null&&_.length)&&x2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(oy)}function x2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Ww))}class Ms{constructor(e,t){this.cacheOutcome=Mo.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||F.EMPTY_STRING,this.wrapperVer=e.wrapperVer||F.EMPTY_STRING,this.telemetryCacheKey=Wt.CACHE_KEY+tn.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Wt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Wt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,c,o].join(Wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Ms.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Wt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Wt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Wt.OVERFLOW_TRUE:Wt.OVERFLOW_FALSE,d=[a,c].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Wt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Wt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof lt?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Ms.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||F.EMPTY_STRING,d=e.failedRequests[2*t+1]||F.EMPTY_STRING,h=e.errors[t]||F.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Wt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||F.EMPTY_STRING),e.push(this.regionSource||F.EMPTY_STRING),e.push(this.regionOutcome||F.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return L2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const zw="missing_kid_error",Gw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const U2={[zw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Gw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class mm extends lt{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,mm.prototype)}}function iy(n){return new mm(n,U2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class gm{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw iy(zw);if(!e.alg)throw iy(Gw);const t=new gm({typ:e.typ||GF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class ay{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class B2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:E2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new ay}}startPerformanceMeasurement(){return new ay}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const pm="pkce_not_created",af="crypto_nonexistent",mu="empty_navigate_uri",qw="hash_empty_error",_m="no_state_in_hash",jw="hash_does_not_contain_known_properties",Yw="unable_to_parse_state",Jw="state_interaction_type_mismatch",Qw="interaction_in_progress",Xw="popup_window_error",Zw="empty_window_error",bi="user_cancelled",F2="monitor_popup_timeout",eT="monitor_window_timeout",tT="redirect_in_iframe",nT="block_iframe_reload",rT="block_nested_popups",V2="iframe_closed_prematurely",gu="silent_logout_unsupported",oT="no_account_error",H2="silent_prompt_value_error",iT="no_token_request_cache_error",aT="unable_to_parse_token_request_cache_error",vm="no_cached_authority_error",$2="auth_request_not_set_error",K2="invalid_cache_type",pu="non_browser_environment",aa="database_not_open",Ul="no_network_connectivity",sT="post_request_failed",cT="get_request_failed",sf="failed_to_parse_response",lT="unable_to_load_token",ym="crypto_key_not_found",uT="auth_code_required",dT="auth_code_or_nativeAccountId_required",hT="spa_code_and_nativeAccountId_present",Cm="database_unavailable",fT="unable_to_acquire_token_from_native_platform",mT="native_handshake_timeout",gT="native_extension_not_installed",zs="native_connection_not_established",pT="uninitialized_public_client_application",_T="native_prompt_not_supported",vT="invalid_base64_string",yT="invalid_pop_token_request",CT="failed_to_build_headers",ET="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const io="For more visit: aka.ms/msaljs/browser-errors",W2={[pm]:"The PKCE code challenge and verifier could not be generated.",[af]:"The crypto object or function is not available.",[mu]:"Navigation URI is empty. Please check stack trace for more info.",[qw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${io}`,[_m]:"Hash does not contain state. Please verify that the request originated from msal.",[jw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${io}`,[Yw]:"Unable to parse state. Please verify that the request originated from msal.",[Jw]:"Hash contains state but the interaction type does not match the caller.",[Qw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${io}`,[Xw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Zw]:"window.open returned null or undefined window object.",[bi]:"User cancelled the flow.",[F2]:`Token acquisition in popup failed due to timeout. ${io}`,[eT]:`Token acquisition in iframe failed due to timeout. ${io}`,[tT]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[nT]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${io}`,[rT]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[V2]:"The iframe being monitored was closed prematurely.",[gu]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[oT]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[H2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[iT]:"No token request found in cache.",[aT]:"The cached token request could not be parsed.",[vm]:"No cached authority found.",[$2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[K2]:"Invalid cache type",[pu]:"Login and token requests are not supported in non-browser environments.",[aa]:"Database is not open!",[Ul]:"No network connectivity. Check your internet connection.",[sT]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[cT]:"Network request failed. Please check the network trace to determine root cause.",[sf]:"Failed to parse network response. Check network trace.",[lT]:"Error loading token to cache.",[ym]:"Cryptographic Key or Keypair not found in browser storage.",[uT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[dT]:"An authorization code or nativeAccountId must be provided to this flow.",[hT]:"Request cannot contain both spa code and native account id.",[Cm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[fT]:`Unable to acquire token from native platform. ${io}`,[mT]:"Timed out while attempting to establish connection to browser extension",[gT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[zs]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${io}`,[pT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${io}`,[_T]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[vT]:"Invalid base64 encoded string.",[yT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[CT]:"Failed to build request headers object.",[ET]:"Failed to parse response headers"};class Gs extends lt{constructor(e,t){super(e,W2[e],t),Object.setPrototypeOf(this,Gs.prototype),this.name="BrowserAuthError"}}function ie(n,e){return new Gs(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Dn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ma={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},gi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},vn={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},sy={GET:"GET",POST:"POST"},Ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Po={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Yc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ot={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var le;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(le||(le={}));const cy={scopes:Ma},wT="jwk",cf="msal.db",z2=1,G2=`${cf}.keys`,Pn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},q2=[Pn.Default,Pn.Skip,Pn.RefreshTokenAndNetwork],j2="msal.browser.log.level",Y2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Jc(n){return encodeURIComponent(Em(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function _u(n){return TT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Em(n){return TT(new TextEncoder().encode(n))}function TT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const J2="RSASSA-PKCS1-v1_5",bT="SHA-256",Q2=2048,X2=new Uint8Array([1,0,1]),ly="0123456789abcdef",uy=new Uint32Array(1),Z2="crypto_subtle_undefined",wm={name:J2,hash:bT,modulusLength:Q2,publicExponent:X2};function eH(n){if(!window)throw ie(pu);if(!window.crypto)throw ie(af);if(!n&&!window.crypto.subtle)throw ie(af,Z2)}async function IT(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(bT,o)}function tH(n){return window.crypto.getRandomValues(n)}function lh(){return window.crypto.getRandomValues(uy),uy[0]}function go(){const n=Date.now(),e=lh()*1024+(lh()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=lh();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=ly.charAt(t[d]>>>4),c+=ly.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function nH(n,e){return window.crypto.subtle.generateKey(wm,n,e)}async function uh(n){return window.crypto.subtle.exportKey(wT,n)}async function rH(n,e,t){return window.crypto.subtle.importKey(wT,n,wm,e,t)}async function oH(n,e){return window.crypto.subtle.sign(wm,n,e)}async function ST(n){const e=await IT(n),t=new Uint8Array(e);return _u(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Ds="storage_not_supported",lf="stubbed_public_client_application_called",Bl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const _l={[Ds]:"Given storage configuration option was not supported.",[lf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Bl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};_l[Ds],_l[lf],_l[Bl];class Tm extends lt{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Tm.prototype)}}function bm(n){return new Tm(n,_l[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function iH(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function aH(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Im(){return window.parent!==window}function sH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Dn.POPUP_NAME_PREFIX}.`)===0}function lo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function cH(){const e=new De(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function lH(){if(De.hashContainsKnownProperties(window.location.hash)&&Im())throw ie(nT)}function uH(n){if(Im()&&!n)throw ie(tT)}function dH(){if(sH())throw ie(rT)}function AT(){if(typeof window>"u")throw ie(pu)}function kT(n){if(!n)throw ie(pT)}function Sm(n){AT(),lH(),dH(),kT(n)}function dy(n,e){if(Sm(n),uH(e.system.allowRedirectInIframe),e.cache.cacheLocation===vn.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw bm(Bl)}function NT(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function hH(){return go()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fl{navigateInternal(e,t){return Fl.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Fl.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=hy(t);try{r=await fetch(e,{method:sy.GET,headers:c})}catch{throw ie(window.navigator.onLine?cT:Ul)}o=fy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw ty(ie(sf),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=hy(t);let a,c=0,d={};try{a=await fetch(e,{method:sy.POST,headers:o,body:r})}catch{throw ie(window.navigator.onLine?sT:Ul)}d=fy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw ty(ie(sf),c,d)}}}function hy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw ie(CT)}}function fy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw ie(ET)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const mH=6e4,uf=1e4,gH=3e4,pH=2e3;function _H({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:F.EMPTY_STRING,authority:`${F.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:F.EMPTY_STRING,authorityMetadata:F.EMPTY_STRING,redirectUri:typeof window<"u"?lo():"",postLogoutRedirectUri:F.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:fo.AAD,OIDCOptions:{serverResponseType:Ws.FRAGMENT,defaultScopes:[F.OPENID_SCOPE,F.PROFILE_SCOPE,F.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:em.None,tenant:F.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:vn.SessionStorage,temporaryCacheLocation:vn.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===vn.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:tt.Info,piiLoggingEnabled:!1},m={...{...Uw,loggerOptions:d,networkClient:o?new fH:D2,navigationClient:new Fl,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||mH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||uf,navigateFrameWait:0,redirectNavigationTimeout:gH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||pH,pollIntervalMilliseconds:Dn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:F.EMPTY_STRING,appVersion:F.EMPTY_STRING},client:new B2};if((n==null?void 0:n.protocolMode)!==fo.OIDC&&(n!=null&&n.OIDCOptions)&&new Ko(m.loggerOptions).warning(JSON.stringify(Xe(Nw))),n!=null&&n.protocolMode&&n.protocolMode!==fo.AAD&&(m!=null&&m.allowNativeBroker))throw Xe(Rw);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const vH="@azure/msal-browser",vu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Am{static loggerCallback(e,t){switch(e){case tt.Error:console.error(t);return;case tt.Info:console.info(t);return;case tt.Verbose:console.debug(t);return;case tt.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=_H(e,this.browserEnvironment);let t;try{t=window[vn.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(j2),o=(h=t==null?void 0:t.getItem(Y2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(tt).includes(r)?tt[r]:void 0;d&&(c.loggerCallback=Am.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new Ko(c,vH,vu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ii extends Am{getModuleName(){return Ii.MODULE_NAME}getId(){return Ii.ID}async initialize(){return this.available=typeof window<"u",this.available}}Ii.MODULE_NAME="";Ii.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Kr(n){return new TextDecoder().decode(yH(n))}function yH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw ie(vT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class CH{constructor(){this.dbName=cf,this.version=z2,this.tableName=G2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(ie(Cm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(ie(aa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(ie(aa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(cf),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class df{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class EH{constructor(e){this.inMemoryCache=new df,this.indexedDBCache=new CH,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Gs&&e.errorCode===Cm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Sa{constructor(e,t,r){this.logger=e,eH(r??!1),this.cache=new EH(this.logger),this.performanceClient=t}createNewGuid(){return go()}base64Encode(e){return Em(e)}base64Decode(e){return Kr(e)}base64UrlEncode(e){return Jc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await nH(Sa.EXTRACTABLE,Sa.POP_KEY_USAGES),o=await uh(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=my(a),d=await this.hashString(c),h=await uh(r.privateKey),m=await rH(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var D;const a=(D=this.performanceClient)==null?void 0:D.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw ie(ym);const d=await uh(c.publicKey),h=my(d),m=Jc(JSON.stringify({kid:t})),g=gm.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),_=Jc(g);e.cnf={jwk:JSON.parse(h)};const p=Jc(JSON.stringify(e)),w=`${_}.${p}`,T=new TextEncoder().encode(w),k=await oH(c.privateKey,T),I=_u(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return ST(e)}}Sa.POP_KEY_USAGES=["sign","verify"];Sa.EXTRACTABLE=!0;function my(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class wH{constructor(){if(!window.localStorage)throw bm(Ds)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class TH{constructor(){if(!window.sessionStorage)throw bm(Ds)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function RT(n,e){if(!e)return null;try{return Cr.parseRequestState(n,e).libraryState.meta}catch{throw Y(Ta)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const bH=24*60*60*1e3;class IH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=SH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function SH(n){const e=new Date;return new Date(e.getTime()+n*bH).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class hf extends ba{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new df,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new IH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case vn.LocalStorage:return new wH;case vn.SessionStorage:return new TH;case vn.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=vn.MemoryStorage,new df}migrateCacheEntries(){const e=`${F.CACHE_PREFIX}.${Lt.ID_TOKEN}`,t=`${F.CACHE_PREFIX}.${Lt.CLIENT_INFO}`,r=`${F.CACHE_PREFIX}.${Lt.ERROR}`,o=`${F.CACHE_PREFIX}.${Lt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Lt.ID_TOKEN,Lt.CLIENT_INFO,Lt.ERROR,Lt.ERROR_DESC].forEach((_,p)=>{const w=m[p];w&&this.setTemporaryCache(_,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Po.ACCOUNT_KEYS),t=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case ge.ID_TOKEN:if(zv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case ge.ACCESS_TOKEN:case ge.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Wv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case ge.REFRESH_TOKEN:if(Gv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Pt.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Pt.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):ba.toObject(new Pt,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Po.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,ge.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ge.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ge.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case ge.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case ge.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Zh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Zh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!zv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Wv(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Gv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!_V(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=pV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!mV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&vV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Yc.WRAPPER_SKU,e),this.internalStorage.setItem(Yc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Yc.WRAPPER_SKU)||F.EMPTY_STRING,t=this.internalStorage.getItem(Yc.WRAPPER_VER)||F.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Lt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Lt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!gV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===vn.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):yr.startsWith(e,F.CACHE_PREFIX)||yr.startsWith(e,Lt.ADAL_ID_TOKEN)?e:`${F.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Bn.HOME_ACCOUNT_ID};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Bn.UPN};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||F.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(Ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=RT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Em(JSON.stringify(e));this.setTemporaryCache(Ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ke.REQUEST_PARAMS,!0);if(!t)throw ie(iT);let r;try{r=JSON.parse(Kr(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),ie(aT)}if(this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw ie(vm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw ie(Qw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Lt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Lt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Lt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Lt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Si(r,Kr);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ha(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=cu((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=lu((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Kr,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof pa&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const AH=(n,e)=>{const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new hf(n,t,Ol,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function kH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function NH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function RH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function OH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function PH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function MH(n,e){e.setActiveAccount(n)}function DH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class LH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ko({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||hH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class OT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||go(),this.logger=o.clone(Dn.MSAL_SKU,vu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Pt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Pt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return De.getAbsoluteUrl(t,lo())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ms(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(De.getDomainFromUrl(a),t.environment):a,h=Xt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await Q(Vw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Xe(Ow);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const xH=32;async function UH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Ai(BH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await Q(FH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function BH(n,e,t){try{const r=new Uint8Array(xH);return Ai(tH,x.GetRandomValues,e,n,t)(r),_u(r)}catch{throw ie(pm)}}async function FH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await Q(IT,x.Sha256Digest,t,e,r)(n,e,r);return _u(new Uint8Array(o))}catch{throw ie(pm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function km(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=Ge.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===Ge.SSH){if(!n.sshJwk)throw Xe(uu);if(!n.sshKid)throw Xe(kw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!yr.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await ST(n.claims)),c}async function VH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await Q(km,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Da extends OT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await Q(UH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:F.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=F.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||go(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(e.postLogoutRedirectUri,lo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,lo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(lo(),lo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Kw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await Q(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Dn.MSAL_SKU,version:vu,cpu:F.EMPTY_STRING,os:F.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=Cr.setRequestState(this.browserCrypto,e&&e.state||F.EMPTY_STRING,o),d={...await Q(km,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||go(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const HH="ContentError",PT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const $H="USER_INTERACTION_REQUIRED",KH="USER_CANCEL",WH="NO_NETWORK",zH="PERSISTENT_ERROR",GH="DISABLED",qH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const jH=-2147186943,YH={[PT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Br extends lt{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Br.prototype),this.name="NativeAuthError",this.ext=r}}function sa(n){if(n.ext&&n.ext.status&&(n.ext.status===zH||n.ext.status===GH)||n.ext&&n.ext.error&&n.ext.error===jH)return!0;switch(n.errorCode){case HH:return!0;default:return!1}}function ff(n,e,t){if(t&&t.status)switch(t.status){case qH:return rf(Hw);case $H:return new wr(n,e);case KH:return ie(bi);case WH:return ie(Ul)}return new Br(n,YH[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class MT extends Da{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),r=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new M2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await Q(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof Gs&&a.errorCode===ym&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _a extends OT{constructor(e,t,r,o,a,c,d,h,m,g,_,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=_,this.silentCacheClient=new MT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ma.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Ms.makeExtraSkuString({libraryName:Dn.MSAL_SKU,libraryVersion:vu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[p2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=zr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:gi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Br&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:_t.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Y(Qh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw Y(Qh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:gi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Br&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),sa(h)))throw h}this.browserStorage.setTemporaryCache(Ke.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:ot.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.NATIVE_REQUEST));const c={method:gi.GetToken,request:a},d=zr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Si(e.id_token,Kr),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw ff(PT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=fm(this.browserStorage,d,a,Kr,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,gr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?_t.fromString(e.scope):_t.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ge.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Ia(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw Y(Xf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?_t.fromString(e.scope):_t.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||F.EMPTY_STRING,_=m.TenantId||r.tid||F.EMPTY_STRING,p=sm(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===Ge.POP?Ge.POP:Ge.BEARER;return{authority:a,uniqueId:g,tenantId:_,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=cu(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===Ge.POP?F.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,_=this.generateScopes(e,t),p=lu(r,t.authority,a,t.clientId,o.tid||c,_.printScopes(),g,0,Kr,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw QE(Gf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new De(t);r.validateAsUri();const{scopes:o,...a}=e,c=new _t(o||[]);c.appendScopes(Ma);const d=()=>{switch(this.apiId){case ot.ssoSilent:case ot.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Bt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),ie(_T)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw ie(yT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ma.MATS_TELEMETRY,e.authenticationScheme===Ge.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new Ia(this.browserCrypto);let _;if(h.keyId)_=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await Q(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);_=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=_}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(um)&&e.extraParameters.hasOwnProperty(nf)&&e.extraParameters.hasOwnProperty(wi);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[nf],r=e.extraParameters[wi]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ma.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:{method:gi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(ie(mT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ma.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===gi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(ie(gT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===gi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(ff(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(ff(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw QE(Gf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===gi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ge.BEARER:case Ge.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Nm{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Wo&&o.subError===bi?ie(bi):o}return Q(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await Q(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Bn.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function DT(n,e,t){const r=Dl(n);if(!r)throw Mw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),ie(jw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),ie(qw));return r}function JH(n,e,t){if(!n.state)throw ie(_m);const r=RT(e,n.state);if(!r)throw ie(Yw);if(r.interactionType!==t)throw ie(Jw)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class QH extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Ma,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ot.acquireTokenPopup),o=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Popup);NT(o.authority);try{const c=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),_=new Nm(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Ai(DT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw ie(zs);const k=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=Cr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await _.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,le.Popup,e);const a=this.initializeServerTelemetryManager(ot.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===fo.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const _=g.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e);const p=this.openPopup(_,t);if(this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof lt&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Popup,null,g),this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup),g}this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),ie(mu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(ie(bi));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===Ws.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw ie(Zw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),ie(Xw)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,_=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Dn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Dn.POPUP_HEIGHT),(!_||_<0||_>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),_=Math.max(0,h/2-Dn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Dn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${_}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(le.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ot.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),ie(mu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw Y(Rl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Wo&&m.subError===bi?ie(bi):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function XH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class ZH extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(ot.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,le.Redirect))};try{const a=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new gy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof lt&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(ot.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(le.Redirect),XH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(Ke.ORIGIN_URI,!0)||F.EMPTY_STRING,d=De.removeHashFromUrl(c),h=De.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&aH(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Im()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Ke.URL_HASH,a,!0);const m={apiId:ot.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const _=cH();this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,_,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(_,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(le.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Ws.QUERY?t=window.location.search:t=window.location.hash);let r=Dl(t);if(r){try{JH(r,this.browserCrypto,le.Redirect)}catch(a){return a instanceof lt&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return iH(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(Ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.URL_HASH)),o&&(r=Dl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw ie(_m);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(zs);const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=Cr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw ie(vm);const c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new gy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ot.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,le.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:ot.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===fo.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Redirect,null,c),this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect),c}this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return De.getAbsoluteUrl(t,lo())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function e$(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),ie(mu);return o?Q(n$,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Ai(r$,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function t$(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<uf&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${uf}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(ie(eT))},e),g=window.setInterval(()=>{let _="";const p=n.contentWindow;try{_=p?p.location.href:""}catch{}if(!_||_==="about:blank")return;let w="";p&&(c===Ws.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Ai(o$,x.RemoveHiddenIframe,o,r,a)(n)})}function n$(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=LT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function r$(n){const e=LT();return e.src=n,e}function LT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function o$(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class i$ extends Da{constructor(e,t,r,o,a,c,d,h,m,g,_){super(e,t,r,o,a,c,h,g,_),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Bt.NONE&&t.prompt!==Bt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Bt.NONE}`),t.prompt=Bt.NONE):t.prompt=Bt.NONE;const r=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);NT(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof lt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof lt)||c.errorCode!==Dn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);return await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(ie(gu))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await Q(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new Nm(e,this.browserStorage,o,this.logger,this.performanceClient),d=await Q(e$,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await Q(t$,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Ai(DT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(zs);const _=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=Cr.parseRequestState(this.browserCrypto,t.state);return Q(_.acquireToken.bind(_),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Bt.NONE})}return Q(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class a$ extends Da{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await Q(km,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Q(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(ie(gu))}async createRefreshTokenClient(e){const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new of(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class s${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw ie(pu);const o=t.id_token?Si(t.id_token,Kr):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Xt(Xt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||go()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Pt.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),ie(lT);const a=Pt.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=fm(this.storage,o,a,Kr,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=cu(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?_t.fromString(t.scope):new _t(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=lu(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,Kr);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=_w(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,_,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=_t.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((_=t.refreshToken)==null?void 0:_.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class c$ extends Kw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class l$ extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw ie(uT);const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,le.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new c$(a);this.logger.verbose("Auth code client created");const d=new Nm(c,this.browserStorage,o,this.logger,this.performanceClient);return await Q(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(ie(gu))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Dr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Qc(n,e){try{Sm(n)}catch(t){throw e.end({success:!1},t),t}}class yu{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Sa(this.logger,this.performanceClient):Ol,this.eventHandler=new LH(this.logger),this.browserStorage=this.isBrowserEnvironment?new hf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,T2(this.config.auth),this.performanceClient):AH(this.config.auth.clientId,this.logger);const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new hf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new s$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new yu(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),kT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Ke.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,le.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=Q(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=Q(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Dr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,m):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,m),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Dr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{dy(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Br&&sa(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof wr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Dr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Qc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Dr(c.account)}),c)).catch(c=>{if(c instanceof Br&&sa(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof wr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Popup,c):this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Popup,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Dr(e.account)}),Qc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(me.SSO_SILENT_START,le.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ot.ssoSilent).catch(d=>{if(d instanceof Br&&sa(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,le.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Dr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,le.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);Qc(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,le.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw ie(hT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,le.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Br&&sa(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Dr(o.account),success:!0}),o}else throw ie(fT);else throw ie(dT)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case Pn.Default:case Pn.AccessToken:case Pn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case Pn.Default:case Pn.AccessTokenAndRefreshToken:case Pn.RefreshToken:case Pn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Q(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return dy(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Sm(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return kH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return NH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return RH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return OH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return PH(e,this.logger,this.browserStorage)}setActiveAccount(e){MH(e,this.browserStorage)}getActiveAccount(){return DH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Pt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw ie(zs);return new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new QH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new ZH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new i$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new MT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new a$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new l$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return AT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Lt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Pt.isAccountEntity(o))return;const c=ba.toObject(new Pt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?go():F.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||cy})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||cy})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Qc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw ie(oT);r.add({accountType:Dr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||F.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=Q(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await Q(VH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||Pn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(u$(d,a))if(this.activeIframeRequest)if(a!==Pn.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const _=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);_.add({awaitIframeCorrelationId:g});const p=await m;if(_.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ot.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Br&&sa(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,Y(co)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Q(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Pn.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,le.Silent,e),Q(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function u$(n,e){const t=!(n instanceof wr&&n.subError!==fu),r=n.errorCode===Dn.INVALID_GRANT_ERROR||n.errorCode===co,o=t&&r||n.errorCode===xl||n.errorCode===hm,a=q2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function d$(n,e){const t=new Ii(n);return await t.initialize(),yu.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Rm{static async createPublicClientApplication(e){const t=await d$(e);return new Rm(e,t)}constructor(e,t){this.controller=t||new yu(new Ii(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const dh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",h$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",f$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",mf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",m$={auth:{clientId:h$,authority:`https://${dh}.b2clogin.com/${dh}.onmicrosoft.com/${f$}`,knownAuthorities:[`${dh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${mf}/_/dashboard`:mf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===tt.Error&&console.error(e)},logLevel:tt.Warning}}},xT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${mf}${n}`,extraQueryParameters:e}),Gt=new Rm(m$),py=l.ref(null);function UT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),py.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:py,setJToken:n}}let Xc=null;const tr=l.ref(null),Ji=l.ref(null),BT=l.ref(Math.floor(Date.now()/1e3));gf.useIntervalFn(()=>g$(),1e3);function g$(){var r,o;if(!((o=(r=tr.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=tr.value.idTokenClaims.exp;BT.value=t-n-e}function Om(){if(Xc)return Xc;const{setJToken:n,jToken:e}=UT(),t=l.computed(()=>!!tr.value),r=l.computed(()=>tr.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":w&&(o=w,await h());break;case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await Gt.initialize();const p=Gt.getActiveAccount();if(p)tr.value=p;else{const w=await Gt.handleRedirectPromise();w?(Gt.setActiveAccount(w.account),tr.value=Gt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}tr.value&&await n(tr.value)},h=async()=>{try{await Gt.initialize();const p=await Gt.handleRedirectPromise();if(!p||Gt.getAllAccounts().length===0){const w=xT(o);await Gt.loginRedirect(w);return}Gt.setActiveAccount(p.account),tr.value=Gt.getActiveAccount(),tr.value&&await n(tr.value),Ji.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){ve.value=!0,Ji.value="updating";try{const p=await Gt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});Gt.setActiveAccount(p.account),await n(tr.value),Ji.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Ji.value="error",localStorage.clear(),window.location.reload()}ve.value=!1}const g=async()=>{try{await Gt.initialize(),localStorage.clear(),await Gt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(BT,async p=>{p<=0&&Ji.value==="updated"&&await m()});const _=l.computed(()=>e.value);return Xc={isAuthenticated:t,authState:Ji,account:r,token:_,refreshToken:m,handleRedirect:a,logout:g},Xc}const{jToken:_y}=UT(),Pm=()=>{const{toast:n}=uC(),e=yt.create({headers:{"Content-Type":"application/json"}});function t(c,d){const h={url:c.url||"",method:(c.method||"get").toUpperCase(),status:(d==null?void 0:d.status)||0};return{success:m=>n.server.success(m,h),error:m=>n.server.error(m,h),warning:m=>n.server.warning(m,h),info:m=>n.server.info(m,h)}}l.watch(_y,c=>{e.interceptors.request.use(d=>(c&&(d.headers.Authorization=`Bearer ${c}`),d))},{immediate:!0});let r=1;e.interceptors.response.use(c=>(c.notify=t(c.config,c),c),async c=>{var d;if(c.config&&(c.notify=t(c.config,c.response)),c.config&&c.config.headers){const h=c.config;if(((d=c.response)==null?void 0:d.status)===401&&r>0){r--;try{return h.headers.Authorization=`Bearer ${_y.value}`,await e(h)}catch(m){return Promise.reject(m)}}}return Promise.reject(c)});async function o({url:c,method:d,header:h={},body:m,baseURL:g}){return g&&(e.defaults.baseURL=g),e({url:c,method:d,headers:h,data:m})}async function a({url:c,method:d,header:h,body:m,baseURL:g}){return g&&(e.defaults.baseURL=g),e({url:c,method:d,headers:h,data:m})}return Object.assign(e,{_request:o,rawRequest:a})},{request:vy}=Pm(),yy=l.ref(null),Cy=l.ref("default"),hh=l.ref(null),fh=l.ref({scope_type:"org"});function Cu(){var _,p;const{handleRedirect:n,account:e,logout:t}=Om();(p=(_=e.value)==null?void 0:_.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:Cy.value,...fh.value}}),o=l.computed(()=>fh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await vy({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});hh.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=hh.value)!=null&&w.email))throw new Error("User email is undefined");const C=await vy({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});yy.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){fh.value=w}function m(w){Cy.value=w,h(r.value)}async function g(w,C){const T=xT(w,{request_domain:C});await Gt.loginRedirect(T)}return{__init__:a,user:hh,userDomains:yy,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const p$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-BnUbO5fl.js")),meta:{requiresAuth:!1}},_$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:Ey,handleRedirect:v$}=Om(),y$=Cu();function C$(n,e){n.addRoute(p$),n.addRoute(_$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!Ey.value){ve.value=!0;try{await v$(e,t.fullPath),await y$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}ve.value=!1}if(Ey.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:wy}=Cu();function E$(){const n=Pm(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(wy,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=wy.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function La(n){const e=E$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}const Ty={enUS:{widget:"widget",spacer:"spacer"},ptBr:{widget:"widget",spacer:"Espaçador"}},Mm={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"},scope:{title:"Escopo",unknown:"Desconhecido",domain:"Domínio",environment:"Ambiente",organizational:"Organizacional",organization:"Organização",team:"Time",user:"Usuário",none:"Nenhum",selectOrganization:"Selecione uma Organização",selectTeam:"Selecione um Time"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}},toast:{error:{create_failed:"Falha ao criar {entity}",update_failed:"Falha ao atualizar {entity}",delete_failed:"Falha ao apagar {entity}",fetch_failed:"Falha ao buscar {entity}",activate_failed:"Falha ao ativar {entity}",deactivate_failed:"Falha ao desativar {entity}",link_failed:"Falha ao vincular {entity}",unlink_failed:"Falha ao desvincular {entity}"},success:{create_success:"{entity} criado com sucesso",update_success:"{entity} atualizado com sucesso",delete_success:"{entity} apagado com sucesso",activate_success:"{entity} ativado com sucesso",deactivate_success:"{entity} desativado com sucesso",link_success:"{entity} vinculado com sucesso",unlink_success:"{entity} desvinculado com sucesso"},info:{already_linked:"{entity} já está vinculado",select_valid_item:"Selecione um item válido"}},app:{widget:Ty.ptBr}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"},scope:{title:"Scope",unknown:"Unknown",domain:"Domain",environment:"Environment",organizational:"Organizational",organization:"Organization",team:"Team",user:"User",none:"None",selectOrganization:"Select a organization",selectTeam:"Select a Team"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}},toast:{error:{create_failed:"Failed to create {entity}",update_failed:"Failed to update {entity}",delete_failed:"Failed to delete {entity}",fetch_failed:"Failed to fetch {entity}",activate_failed:"Failed to activate {entity}",deactivate_failed:"Failed to deactivate {entity}",link_failed:"Failed to link {entity}",unlink_failed:"Failed to unlink {entity}"},success:{create_success:"{entity} created successfully",update_success:"{entity} updated successfully",delete_success:"{entity} deleted successfully",activate_success:"{entity} activated successfully",deactivate_success:"{entity} deactivated successfully",link_success:"{entity} linked successfully",unlink_success:"{entity} unlinked successfully"},info:{already_linked:"{entity} is already linked",select_valid_item:"Please select a valid item"}},app:{widget:Ty.ptBr}}},w$=Object.keys(Mm),by=navigator.language,T$=w$.includes(by)?by:"pt-BR",$=Tx({locale:T$,fallbackLocale:"en-US",messages:Mm});function b$(){const n=La("https://api.jplan.com.br/management/organization"),{error:e}=ar();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Organization"}));return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Organization"})),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Organization"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Organization"})),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Organization"})),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Organization"})),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Organization"})),a}}}}const xo=b$();function I$(){const n=La("https://api.jplan.com.br/management/branch/"),{error:e}=ar();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e($.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Branch"}))}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||$.global.t("toast.error.update_failed",{entity:"Branch"}));return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Branch"}))}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||$.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.activate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Branch"}))}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}}}}const Uo=I$();function S$(){const n=La("https://api.jplan.com.br/management/team"),{error:e}=ar();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Team"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e($.global.t("toast.error.create_failed",{entity:"Team"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Team"})),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Team"})),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e($.global.t("toast.error.fetch_failed",{entity:"Team"})),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Team"})),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Team"})),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.link_failed",{entity:"User"})),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e($.global.t("toast.error.link_failed",{entity:"User"}));return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e($.global.t("toast.error.update_failed",{entity:"User"})),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e($.global.t("toast.error.unlink_failed",{entity:"User"})),a}}}}const Mn=S$();let Zc=!1;const mh=l.ref(!1),jn=l.ref([]),Iy=l.ref([]),ht=l.ref(null),Qi=l.ref([]),Xi=l.ref([]),FT=()=>{const n=ar(),e=async C=>{mh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await xo.getOrgList(T);k&&(jn.value=k,Zc=!0),mh.value=!1},t=async C=>{var T;return(T=jn.value)!=null&&T.length||await e(C),jn.value};function r(C){if(!jn.value)throw new Error("Data not stored yet");const T=Pa(jn.value,C,["name","description"]);return C!==""?T:jn.value}const o=C=>{Iy.value=C},a=C=>{ht.value=Oa.cloneDeep(C)},c=async C=>await xo.getOrg(C),d=async()=>{if(ht.value!=null){const C=await xo.createOrg(ht.value);return C!=null&&C.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Organization"})),Zc&&jn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(ve.value=!0,ht.value&&ht.value.__id){const C=await xo.updateOrg(ht.value);if(Zc&&(C!=null&&C.data.__id)){const T=jn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(jn.value[T]=C.data,n.success($.global.t("toast.success.update_success",{entity:"Organization"}))):n.error($.global.t("toast.error.update_failed",{entity:"Organization"})),ve.value=!1,C.data}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Organization"}))},m=async()=>{if(ve.value=!0,ht.value&&ht.value.created_at){if(await xo.deactivateOrg(ht.value.__id),Zc){const C=jn.value.findIndex(T=>{var k;return T.__id===((k=ht.value)==null?void 0:k.__id)});if(C!==-1)return jn.value.splice(C,1),ht.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Organization"}))}ve.value=!1}};async function g(C){ve.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Uo.updateBranch(T)){ve.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Branch"})),Qi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Branch"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function _(C){if(ve.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Uo.updateBranch(T)){ve.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),ve.value=!1,Qi.value;throw new Error("Item not found to remove")}ve.value=!1}async function p(C){ve.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Mn.updateTeam(T)){ve.value=!1;return}if(Xi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),Xi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function w(C){if(ve.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Mn.updateTeam(T)){ve.value=!1;return}const I=Xi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Xi.value.splice(I,1),ve.value=!1,Xi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:jn,loading:mh,columns:Iy,item:ht,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Qi,orgTeams:Xi,linkBranch:g,unlinkBranch:_,linkTeam:p,unlinkTeam:w}};let el=!1;const Yn=l.ref([]),Sy=l.ref([]),Nt=l.ref(null),gh=l.ref(!1),Zi=l.ref([]),VT=()=>{const n=ar(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Mn.getTeamList(w);C&&(Yn.value=C,el=!0),gh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Pa(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{Sy.value=p},a=p=>{Nt.value=Oa.cloneDeep(p)},c=async p=>await Mn.getTeam(p),d=async()=>{if(Nt.value!=null){const p=await Mn.createTeam(Nt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Team"})),el&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Nt.value&&Nt.value.__id){const p=await Mn.updateTeam(Nt.value);if(el&&(p!=null&&p.data.__id)){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Team"}))):n.error($.global.t("toast.error.update_failed",{entity:"Team"})),p.data}}else n.error($.global.t("toast.error.update_failed",{entity:"Team"}))},m=async()=>{if(Nt.value&&Nt.value.created_at&&(await Mn.deactivateTeam(Nt.value.__id),el)){const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Nt.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Nt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Team"}))}};async function g(p){var w;if(ve.value=!0,(w=Nt.value)!=null&&w.__id)if(Zi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Mn.linkManageUser(Nt.value.__id,{team:Nt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Mn.getTeamUserList(Nt.value.__id);return k&&(Zi.value=k),n.success($.global.t("toast.success.link_success",{entity:"User"})),T}catch(T){console.error(T),n.error($.global.t("toast.error.link_failed",{entity:"User"}))}finally{ve.value=!1}else n.info($.global.t("toast.info.already_linked",{entity:"User"}));else console.warn("No item selected or item ID is missing."),n.info($.global.t("toast.info.select_valid_item"));ve.value=!1}async function _(p){if(ve.value=!0,Nt.value&&Nt.value.__id){const w=Zi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Mn.unlinkManageUser(Nt.value.__id,p),Zi.value.splice(w,1),ve.value=!1,Zi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Yn,loading:gh,columns:Sy,item:Nt,usersTeam:Zi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:_}},HT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Ls("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=Cu(),{getData:c,data:d}=FT(),{getData:h,data:m}=VT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const _=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,D,L;_.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((D=r.value)==null?void 0:D.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return HF;case"org":return FF;case"team":return $F;default:return VF}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(_.value)}return(N,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(it.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Us),{loading:g.value,title:l.unref($).global.t("dialogs.scope.title"),"dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Qe.VRow,null,{default:l.withCtx(()=>[l.createVNode(Qe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||l.unref($).global.t("dialogs.scope.unknownUser")),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(NO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:_.value.scope_type,"onUpdate:modelValue":D[0]||(D[0]=L=>_.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{value:"org",label:l.unref($).global.t("dialogs.scope.organizational"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organizational")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"team",label:l.unref($).global.t("dialogs.scope.team"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"user",label:l.unref($).global.t("dialogs.scope.user"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"",label:l.unref($).global.t("dialogs.scope.none"),color:"lightext"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.none")),1)]),_:1},8,["label"])]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(va.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organization")),1)]),_:1}),l.createVNode(hs.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectOrganization"),class:"min-w-50",modelValue:_.value.organization,"onUpdate:modelValue":D[1]||(D[1]=L=>_.value.organization=L),clearable:""},null,8,["items","placeholder","modelValue"]),l.createVNode(va.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1}),l.createVNode(hs.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectTeam"),class:"min-w-50",modelValue:_.value.team,"onUpdate:modelValue":D[2]||(D[2]=L=>_.value.team=L),clearable:""},null,8,["items","placeholder","modelValue"])])])]),_:1},8,["loading","title"])],64))}}),A$={},k$={class:"double-ring-spinner-container"};function N$(n,e){return l.openBlock(),l.createElementBlock("div",k$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const $T=Aa(A$,[["render",N$],["__scopeId","data-v-00d7a69f"]]),R$={key:0,class:"_jspinner-overlay_jj"},KT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(ve)?(l.openBlock(),l.createElementBlock("div",R$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),WT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Qt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(KF))]),default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(_f.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),O$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:pC,ColumnSettingsDialog:Ff,ConfirmDialog:mC,ContextMenu:_C,CopyButton:Vl,DeleteAllBtn:wf,DotsMenu:fC,EditButton:hC,FormHeadless:YE,FormMetadata:au,GlobalScopeFilter:HT,GlobalSpinner:KT,JAutocomplete:KE,JAvatar:gC,JBtn:My,JDialog:Us,JForm:qE,JIconBtn:Py,JSelect:$E,JTextArea:WE,JTextField:_E,ParentCard:zl,SearchFilter:Xl,SpinnerLoader:$T,SubMenu:WT,TabFormHeader:jE,TableAdvanced:tE,TableCard:Vf,TableCardsView:pE,TableHeader:nE,UiTable:vC},Symbol.toStringTag,{value:"Module"})),P$=o0(),M$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let ph=!1;const _h=l.ref(!1),Jn=l.ref([]),Ay=l.ref([]),$t=l.ref(null),ea=l.ref([]),D$=()=>{const n=ar(),e=async p=>{_h.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Uo.getBranchList(w);C&&(Jn.value=C,ph=!0),_h.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Pa(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{Ay.value=p},a=p=>{$t.value=Oa.cloneDeep(p)},c=async p=>await Uo.getBranch(p),d=async()=>{if($t.value!=null){const p=await Uo.createBranch($t.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Branch"})),ph&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if($t.value&&$t.value.__id){const p=await Uo.updateBranch($t.value);if(ph&&p){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Branch"}))):n.error($.global.t("toast.error.update_failed",{entity:"Branch"})),p}}else n.error($.global.t("toast.error.update_failed",{entity:"Branch"}))},m=async()=>{if($t.value&&$t.value.created_at){await Uo.deactivateBranch($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}};async function g(p){ve.value=!0;try{if($t.value&&$t.value.__id){const w={...p,branch:$t.value.__id};if(!await Mn.updateTeam(w)){n.error($.global.t("toast.error.link_failed",{entity:"Team"}));return}if(ea.value.findIndex(k=>k.__id===p.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),ea.value.push(w),w;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function _(p){if(ve.value=!0,$t.value&&$t.value.__id){const w={...p,branch:null};if(!await Mn.updateTeam(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return ea.value.splice(T,1),ve.value=!1,ea.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Jn,columns:Ay,item:$t,loading:_h,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:ea,linkTeam:g,unlinkTeam:_}};function L$(){const n=La("https://api.jplan.com.br/management/division"),{error:e}=ar();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Division"}));return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Division"})),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Division"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Division"})),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Division"})),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Division"})),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Division"})),a}}}}const ca=L$();let vh=!1;const yh=l.ref(!1),Qn=l.ref([]),ky=l.ref([]),Kt=l.ref(null),ta=l.ref([]),x$=()=>{const n=ar(),e=async p=>{yh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await ca.getDivisionList(w);C&&(Qn.value=C,vh=!0),yh.value=!1},t=async p=>(Qn.value.length||await e(p),Qn.value);function r(p){if(!Qn.value)throw new Error("Data not stored yet");const w=Pa(Qn.value,p,["name","description"]);return p!==""?w:Qn.value}const o=p=>{ky.value=p},a=p=>{Kt.value=Oa.cloneDeep(p)},c=async p=>await ca.getDivision(p),d=async()=>{if(Kt.value!=null){const p=await ca.createDivision(Kt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Division"})),vh&&Qn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Kt.value&&Kt.value.__id){const p=await ca.updateDivision(Kt.value);if(vh&&(p!=null&&p.data.__id)){const w=Qn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Qn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Division"}))):n.error($.global.t("toast.error.update_failed",{entity:"Division"})),ve.value=!1,p}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Division"}))},m=async()=>{if(ve.value=!0,Kt.value&&Kt.value.created_at){await ca.deactivateDivision(Kt.value.__id);const p=Qn.value.findIndex(w=>{var C;return w.__id===((C=Kt.value)==null?void 0:C.__id)});if(p!==-1)return Qn.value.splice(p,1),Kt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Division"}))}ve.value=!1};async function g(p){ve.value=!0;try{if(Kt.value&&Kt.value.__id){const w={...p,division:Kt.value.__id};return await xo.updateOrg(w)?(ta.value.findIndex(k=>k.__id===p.__id)===-1?(n.success($.global.t("toast.success.link_success",{entity:"Organization"})),ta.value.push(w)):n.info($.global.t("toast.info.already_linked",{entity:"Organization"})),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function _(p){if(ve.value=!0,Kt.value&&Kt.value.__id){const w={...p,division:null};if(!await xo.updateOrg(w))return;const T=ta.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ta.value.splice(T,1);else throw new Error("Item not found to remove")}else throw new Error("Item is not defined");return ve.value=!1,ta.value}return{data:Qn,columns:ky,item:Kt,loading:yh,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ta,linkDivision:g,unlinkDivision:_}};function U$(){const n=La("https://api.jplan.com.br/management/user"),{error:e}=ar();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"User"})),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"User"})),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"User"})),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"User"})),a}}}}const la=U$();let Ch=!1,Eh=l.ref(!1);const Xn=l.ref([]),Ny=l.ref([]),Zn=l.ref(null),B$=l.ref(null),F$=l.ref([]),V$=()=>{const n=ar(),e=async g=>{Eh.value=!0;const _=g?`_active eq true and ${g}`:"_active eq true",p=await la.getManageUserList(_);p&&(Xn.value=p,Ch=!0),Eh.value=!1},t=async g=>(Xn.value.length||await e(g),Xn.value);function r(g){if(!Xn.value)throw new Error("Data not stored yet");const _=Pa(Xn.value,g,["name","description"]);return g!==""?_:Xn.value}return{data:Xn,loading:Eh,columns:Ny,item:Zn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ny.value=g},setItem:g=>{Zn.value=Oa.cloneDeep(g)},getItem:async g=>await la.getManageUser(g),createItem:async()=>{if(Zn.value!=null){const g=crypto.randomUUID(),_=await la.createManageUser({...Zn.value,__id:g});return _!=null&&_.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"User"})),Ch&&Xn.value.push(_.data)),_==null?void 0:_.data}},updateItem:async()=>{if(ve.value=!0,Zn.value&&Zn.value.created_at){const g=await la.updateManageUser(Zn.value);if(Ch&&(g!=null&&g.data)){const _=Xn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));_!==-1?(Xn.value[_]=g==null?void 0:g.data,n.success($.global.t("toast.success.update_success",{entity:"User"}))):n.error($.global.t("toast.error.update_failed",{entity:"User"}))}return ve.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Zn.value&&Zn.value.created_at){try{await la.deactivateManageUser(Zn.value.__id)}catch{n.error($.global.t("toast.error.deactivate_failed",{entity:"User"}));return}const g=Xn.value.findIndex(_=>{var p;return _.__id===((p=Zn.value)==null?void 0:p.__id)});if(g!==-1)return Xn.value.splice(g,1),n.success($.global.t("toast.success.deactivate_success",{entity:"User"})),Zn.value}},userOrg:B$,userTeams:F$}},wh=Object.freeze({colNum:24,rowHeight:50,useCssTransforms:!0,responsive:!0,margin:[12,10]}),na=l.ref(!1),H$=l.ref([]);function $$(){const n=l.ref({...wh,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"});function e(){if(na.value=!na.value,n.value.isDraggable=na.value,n.value.isResizable=na.value,!na.value){n.value.useStyleCursor=!0,n.value.cursor="pointer";return}n.value.useStyleCursor=!1,n.value.cursor="move"}function t(){n.value={...wh,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"}}return{DEFAULT_CONFIG:wh,config:n,layout:H$,edition:na,toggleEdit:e,resetLayout:t}}const K$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetTask-C3T8JOug.js"))),W$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetImage-CmXW7a_H.js"))),z$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetShortcut-DVGM3eCo.js"))),G$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetSpacer-Dj0NrQAc.js"))),q$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetLabel-5QtIKXSm.js"))),j$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartBar-ChMg_dbz.js"))),Y$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartPie-C2AIgVQ2.js"))),J$={WidgetSpacer:G$,WidgetLabel:q$,WidgetTask:K$,WidgetImage:W$,WidgetShortcut:z$,WidgetChartBar:j$,WidgetChartPie:Y$},Q$={defaultI18n:!0},X$=(n,e)=>{const t={...Q$,...e};n.use(P$),n.use(aP,M$),t.defaultI18n&&n.use($),Object.entries(O$).forEach(([r,o])=>{n.component(r,o)}),Object.entries(OO).forEach(([r,o])=>{n.provide(r,o)})},Z$={install:X$};exports.ContextMenu=_C;exports.EmptyListImg=Uh;exports.EventBus=Kl;exports.FormHeadless=YE;exports.HttpCore=dF;exports.I18nMessages=Mm;exports.SpinnerLoader=$T;exports.TableCardsView=pE;exports.TableHeader=nE;exports.__spinner=ve;exports._export_sfc=Aa;exports._sfc_main=Us;exports._sfc_main$1=vC;exports._sfc_main$10=My;exports._sfc_main$11=wf;exports._sfc_main$12=hC;exports._sfc_main$13=Py;exports._sfc_main$14=$E;exports._sfc_main$15=KE;exports._sfc_main$16=WE;exports._sfc_main$17=_E;exports._sfc_main$18=qE;exports._sfc_main$19=jE;exports._sfc_main$2=tE;exports._sfc_main$20=zl;exports._sfc_main$21=gC;exports._sfc_main$22=pC;exports._sfc_main$23=WT;exports._sfc_main$24=HT;exports._sfc_main$25=KT;exports._sfc_main$3=Ff;exports._sfc_main$4=Vf;exports._sfc_main$5=Xl;exports._sfc_main$6=mC;exports._sfc_main$7=Vl;exports._sfc_main$8=fC;exports._sfc_main$9=au;exports.branchInstance=Uo;exports.coreClient=Pm;exports.createToastInterface=bs;exports.dateFormat=fs;exports.divisionInstance=ca;exports.filterQuery=Pa;exports.globalEventBus=Ef;exports.i18n=$;exports.index=Z$;exports.manageUserInstance=la;exports.msal=Gt;exports.orgInstance=xo;exports.provideToast=iP;exports.scopedClient=La;exports.setupAuthGuard=C$;exports.teamInstance=Mn;exports.toastInjectionKey=Wl;exports.useAuth=Om;exports.useBranchStore=D$;exports.useCustomizer=l0;exports.useDashboardStore=$$;exports.useDialog=Ls;exports.useDivisionStore=x$;exports.useManageUserStore=V$;exports.useNotifications=uC;exports.useOrganizationStore=FT;exports.useSession=Cu;exports.useTeamStore=VT;exports.useToast=ar;exports.widgets=J$;
113
+ ${c}`);return}throw ry(e.error,e.error_description,e.suberror)?new wr(e.error,e.error_description,e.suberror,e.timestamp||F.EMPTY_STRING,e.trace_id||F.EMPTY_STRING,e.correlation_id||F.EMPTY_STRING,e.claims||F.EMPTY_STRING,a):c}}async handleServerTokenResponse(e,t,r,o,a,c,d,h,m){var C;(C=this.performanceClient)==null||C.addQueueMeasurement(x.HandleServerTokenResponse,e.correlation_id);let g;if(e.id_token){if(g=Si(e.id_token||F.EMPTY_STRING,this.cryptoObj.base64Decode),a&&a.nonce&&g.nonce!==a.nonce)throw Y(ow);if(o.maxAge||o.maxAge===0){const T=g.auth_time;if(!T)throw Y(Yf);pw(T,o.maxAge)}}this.homeAccountIdentifier=Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,t.authorityType,this.logger,this.cryptoObj,g);let _;a&&a.state&&(_=Cr.parseRequestState(this.cryptoObj,a.state)),e.key_id=e.key_id||o.sshKid||void 0;const p=this.generateCacheRecord(e,t,r,o,g,c,a);let w;try{if(this.persistencePlugin&&this.serializableCache&&(this.logger.verbose("Persistence enabled, calling beforeCacheAccess"),w=new R2(this.serializableCache,!0),await this.persistencePlugin.beforeCacheAccess(w)),d&&!h&&p.account){const T=p.account.generateAccountKey();if(!this.cacheStorage.getAccount(T,this.logger))return this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache"),await Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,_,void 0,m)}await this.cacheStorage.saveCacheRecord(p,o.storeInCache,o.correlationId)}finally{this.persistencePlugin&&this.serializableCache&&w&&(this.logger.verbose("Persistence enabled, calling afterCacheAccess"),await this.persistencePlugin.afterCacheAccess(w))}return Ti.generateAuthenticationResult(this.cryptoObj,t,p,!1,o,g,_,e,m)}generateCacheRecord(e,t,r,o,a,c,d){const h=t.getPreferredCache();if(!h)throw Y(Qf);const m=Pw(a);let g,_;e.id_token&&a&&(g=cu(this.homeAccountIdentifier,h,e.id_token,this.clientId,m||""),_=fm(this.cacheStorage,t,this.homeAccountIdentifier,this.cryptoObj.base64Decode,a,e.client_info,h,m,d,void 0,this.logger));let p=null;if(e.access_token){const T=e.scope?_t.fromString(e.scope):new _t(o.scopes||[]),k=(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,I=(typeof e.ext_expires_in=="string"?parseInt(e.ext_expires_in,10):e.ext_expires_in)||0,N=(typeof e.refresh_in=="string"?parseInt(e.refresh_in,10):e.refresh_in)||void 0,D=r+k,L=D+I,K=N&&N>0?r+N:void 0;p=lu(this.homeAccountIdentifier,h,e.access_token,this.clientId,m||t.tenant||"",T.printScopes(),D,L,this.cryptoObj.base64Decode,K,e.token_type,c,e.key_id,o.claims,o.requestedClaimsHash)}let w=null;if(e.refresh_token){let T;if(e.refresh_token_expires_in){const k=typeof e.refresh_token_expires_in=="string"?parseInt(e.refresh_token_expires_in,10):e.refresh_token_expires_in;T=r+k}w=_w(this.homeAccountIdentifier,h,e.refresh_token,this.clientId,e.foci,c,T)}let C=null;return e.foci&&(C={clientId:this.clientId,environment:h,familyId:e.foci}),{account:_,idToken:g,accessToken:p,refreshToken:w,appMetadata:C}}static async generateAuthenticationResult(e,t,r,o,a,c,d,h,m){var D,L,K,q,M;let g=F.EMPTY_STRING,_=[],p=null,w,C,T=F.EMPTY_STRING;if(r.accessToken){if(r.accessToken.tokenType===Ge.POP&&!a.popKid){const ce=new Ia(e),{secret:ae,keyId:X}=r.accessToken;if(!X)throw Y(Xf);g=await ce.signPopToken(ae,X,a)}else g=r.accessToken.secret;_=_t.fromString(r.accessToken.target).asArray(),p=new Date(Number(r.accessToken.expiresOn)*1e3),w=new Date(Number(r.accessToken.extendedExpiresOn)*1e3),r.accessToken.refreshOn&&(C=new Date(Number(r.accessToken.refreshOn)*1e3))}r.appMetadata&&(T=r.appMetadata.familyId===ys?ys:"");const k=(c==null?void 0:c.oid)||(c==null?void 0:c.sub)||"",I=(c==null?void 0:c.tid)||"";h!=null&&h.spa_accountid&&r.account&&(r.account.nativeAccountId=h==null?void 0:h.spa_accountid);const N=r.account?sm(r.account.getAccountInfo(),void 0,c,(D=r.idToken)==null?void 0:D.secret):null;return{authority:t.canonicalAuthority,uniqueId:k,tenantId:I,scopes:_,account:N,idToken:((L=r==null?void 0:r.idToken)==null?void 0:L.secret)||"",idTokenClaims:c||{},accessToken:g,fromCache:o,expiresOn:p,extExpiresOn:w,refreshOn:C,correlationId:a.correlationId,requestId:m||F.EMPTY_STRING,familyId:T,tokenType:((K=r.accessToken)==null?void 0:K.tokenType)||F.EMPTY_STRING,state:d?d.userRequestState:F.EMPTY_STRING,cloudGraphHostName:((q=r.account)==null?void 0:q.cloudGraphHostName)||F.EMPTY_STRING,msGraphHost:((M=r.account)==null?void 0:M.msGraphHost)||F.EMPTY_STRING,code:h==null?void 0:h.spa_code,fromNativeBroker:!1}}}function fm(n,e,t,r,o,a,c,d,h,m,g){g==null||g.verbose("setCachedAccount called");const p=n.getAccountKeys().find(I=>I.startsWith(t));let w=null;p&&(w=n.getAccount(p,g));const C=w||Pt.createAccount({homeAccountId:t,idTokenClaims:o,clientInfo:a,environment:c,cloudGraphHostName:h==null?void 0:h.cloud_graph_host_name,msGraphHost:h==null?void 0:h.msgraph_host,nativeAccountId:m},e,r),T=C.tenantProfiles||[],k=d||C.realm;if(k&&!T.find(I=>I.tenantId===k)){const I=am(t,C.localAccountId,k,o);T.push(I)}return C.tenantProfiles=T,C}/*! @azure/msal-common v14.16.0 2024-11-05 */async function $w(n,e,t){return typeof n=="string"?n:n({clientId:e,tokenEndpoint:t})}/*! @azure/msal-common v14.16.0 2024-11-05 */class Kw extends dm{constructor(e,t){var r;super(e,t),this.includeRedirectUri=!0,this.oidcDefaultScopes=(r=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:r.defaultScopes}async getAuthCodeUrl(e){var r;(r=this.performanceClient)==null||r.addQueueMeasurement(x.GetAuthCodeUrl,e.correlationId);const t=await Q(this.createAuthCodeUrlQueryString.bind(this),x.AuthClientCreateQueryString,this.logger,this.performanceClient,e.correlationId)(e);return De.appendQueryString(this.authority.authorizationEndpoint,t)}async acquireToken(e,t){var d,h;if((d=this.performanceClient)==null||d.addQueueMeasurement(x.AuthClientAcquireToken,e.correlationId),!e.code)throw Y(sw);const r=zr(),o=await Q(this.executeTokenRequest.bind(this),x.AuthClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(this.authority,e),a=(h=o.headers)==null?void 0:h[dn.X_MS_REQUEST_ID],c=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin,this.performanceClient);return c.validateTokenResponse(o.body),Q(c.handleServerTokenResponse.bind(c),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(o.body,this.authority,r,e,t,void 0,void 0,void 0,a)}handleFragmentResponse(e,t){if(new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,null,null).validateServerAuthorizationCodeResponse(e,t),!e.code)throw Y(hw);return e}getLogoutUri(e){if(!e)throw Xe(bw);const t=this.createLogoutUrlQueryString(e);return De.appendQueryString(this.authority.endSessionEndpoint,t)}async executeTokenRequest(e,t){var m,g;(m=this.performanceClient)==null||m.addQueueMeasurement(x.AuthClientExecuteTokenRequest,t.correlationId);const r=this.createTokenQueryParameters(t),o=De.appendQueryString(e.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.AuthClientCreateTokenRequestBody,this.logger,this.performanceClient,t.correlationId)(t);let c;if(t.clientInfo)try{const _=Pl(t.clientInfo,this.cryptoUtils.base64Decode);c={credential:`${_.uid}${tn.CLIENT_INFO_SEPARATOR}${_.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(_){this.logger.verbose("Could not parse client info for CCS Header: "+_)}const d=this.createTokenRequestHeaders(c||t.ccsCredential),h={clientId:((g=t.tokenBodyParameters)==null?void 0:g.clientId)||this.config.authOptions.clientId,authority:e.canonicalAuthority,scopes:t.scopes,claims:t.claims,authenticationScheme:t.authenticationScheme,resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,sshKid:t.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.AuthorizationCodeClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,t.correlationId)(o,a,d,h,t.correlationId,x.AuthorizationCodeClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a;(o=this.performanceClient)==null||o.addQueueMeasurement(x.AuthClientCreateTokenRequestBody,e.correlationId);const t=new Es(e.correlationId,this.performanceClient);if(t.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),this.includeRedirectUri?t.addRedirectUri(e.redirectUri):ia.validateRedirectUri(e.redirectUri),t.addScopes(e.scopes,!0,this.oidcDefaultScopes),t.addAuthorizationCode(e.code),t.addLibraryInfo(this.config.libraryInfo),t.addApplicationTelemetry(this.config.telemetry.application),t.addThrottling(),this.serverTelemetryManager&&!tf(this.config)&&t.addServerTelemetry(this.serverTelemetryManager),e.codeVerifier&&t.addCodeVerifier(e.codeVerifier),this.config.clientCredentials.clientSecret&&t.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const c=this.config.clientCredentials.clientAssertion;t.addClientAssertion(await $w(c.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),t.addClientAssertionType(c.assertionType)}if(t.addGrantType(JE.AUTHORIZATION_CODE_GRANT),t.addClientInfo(),e.authenticationScheme===Ge.POP){const c=new Ia(this.cryptoUtils,this.performanceClient);let d;e.popKid?d=this.cryptoUtils.encodeKid(e.popKid):d=(await Q(c.generateCnf.bind(c),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,t.addPopToken(d)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)t.addSshJwk(e.sshJwk);else throw Xe(uu);(!yr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&t.addClaims(e.claims,this.config.authOptions.clientCapabilities);let r;if(e.clientInfo)try{const c=Pl(e.clientInfo,this.cryptoUtils.base64Decode);r={credential:`${c.uid}${tn.CLIENT_INFO_SEPARATOR}${c.utid}`,type:Bn.HOME_ACCOUNT_ID}}catch(c){this.logger.verbose("Could not parse client info for CCS Header: "+c)}else r=e.ccsCredential;if(this.config.systemOptions.preventCorsPreflight&&r)switch(r.type){case Bn.HOME_ACCOUNT_ID:try{const c=fa(r.credential);t.addCcsOid(c)}catch(c){this.logger.verbose("Could not parse home account ID for CCS Header: "+c)}break;case Bn.UPN:t.addCcsUpn(r.credential);break}return e.embeddedClientId&&t.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&t.addExtraQueryParameters(e.tokenBodyParameters),e.enableSpaAuthorizationCode&&(!e.tokenBodyParameters||!e.tokenBodyParameters[ey])&&t.addExtraQueryParameters({[ey]:"1"}),t.createQueryString()}async createAuthCodeUrlQueryString(e){var a,c;const t=e.correlationId||this.config.cryptoInterface.createNewGuid();(a=this.performanceClient)==null||a.addQueueMeasurement(x.AuthClientCreateQueryString,t);const r=new Es(t,this.performanceClient);r.addClientId(e.embeddedClientId||((c=e.extraQueryParameters)==null?void 0:c[wi])||this.config.authOptions.clientId);const o=[...e.scopes||[],...e.extraScopesToConsent||[]];if(r.addScopes(o,!0,this.oidcDefaultScopes),r.addRedirectUri(e.redirectUri),r.addCorrelationId(t),r.addResponseMode(e.responseMode),r.addResponseTypeCode(),r.addLibraryInfo(this.config.libraryInfo),tf(this.config)||r.addApplicationTelemetry(this.config.telemetry.application),r.addClientInfo(),e.codeChallenge&&e.codeChallengeMethod&&r.addCodeChallengeParams(e.codeChallenge,e.codeChallengeMethod),e.prompt&&r.addPrompt(e.prompt),e.domainHint&&r.addDomainHint(e.domainHint),e.prompt!==Bt.SELECT_ACCOUNT)if(e.sid&&e.prompt===Bt.NONE)this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from request"),r.addSid(e.sid);else if(e.account){const d=this.extractAccountSid(e.account);let h=this.extractLoginHint(e.account);if(h&&e.domainHint&&(this.logger.warning('AuthorizationCodeClient.createAuthCodeUrlQueryString: "domainHint" param is set, skipping opaque "login_hint" claim. Please consider not passing domainHint'),h=null),h){this.logger.verbose("createAuthCodeUrlQueryString: login_hint claim present on account"),r.addLoginHint(h);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(d&&e.prompt===Bt.NONE){this.logger.verbose("createAuthCodeUrlQueryString: Prompt is none, adding sid from account"),r.addSid(d);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}else if(e.loginHint)this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint);else if(e.account.username){this.logger.verbose("createAuthCodeUrlQueryString: Adding login_hint from account"),r.addLoginHint(e.account.username);try{const m=fa(e.account.homeAccountId);r.addCcsOid(m)}catch{this.logger.verbose("createAuthCodeUrlQueryString: Could not parse home account ID for CCS Header")}}}else e.loginHint&&(this.logger.verbose("createAuthCodeUrlQueryString: No account, adding login_hint from request"),r.addLoginHint(e.loginHint),r.addCcsUpn(e.loginHint));else this.logger.verbose("createAuthCodeUrlQueryString: Prompt is select_account, ignoring account hints");if(e.nonce&&r.addNonce(e.nonce),e.state&&r.addState(e.state),(e.claims||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),this.addExtraQueryParams(e,r),e.nativeBroker&&(r.addNativeBroker(),e.authenticationScheme===Ge.POP)){const d=new Ia(this.cryptoUtils);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}return r.createQueryString()}createLogoutUrlQueryString(e){const t=new Es(e.correlationId,this.performanceClient);return e.postLogoutRedirectUri&&t.addPostLogoutRedirectUri(e.postLogoutRedirectUri),e.correlationId&&t.addCorrelationId(e.correlationId),e.idTokenHint&&t.addIdTokenHint(e.idTokenHint),e.state&&t.addState(e.state),e.logoutHint&&t.addLogoutHint(e.logoutHint),this.addExtraQueryParams(e,t),t.createQueryString()}addExtraQueryParams(e,t){!(e.extraQueryParameters&&e.extraQueryParameters.hasOwnProperty("instance_aware"))&&this.config.authOptions.instanceAware&&(e.extraQueryParameters=e.extraQueryParameters||{},e.extraQueryParameters.instance_aware="true"),e.extraQueryParameters&&t.addExtraQueryParameters(e.extraQueryParameters)}extractAccountSid(e){var t;return((t=e.idTokenClaims)==null?void 0:t.sid)||null}extractLoginHint(e){var t;return((t=e.idTokenClaims)==null?void 0:t.login_hint)||null}}/*! @azure/msal-common v14.16.0 2024-11-05 */const P2=300;class of extends dm{constructor(e,t){super(e,t)}async acquireToken(e){var c,d;(c=this.performanceClient)==null||c.addQueueMeasurement(x.RefreshTokenClientAcquireToken,e.correlationId);const t=zr(),r=await Q(this.executeTokenRequest.bind(this),x.RefreshTokenClientExecuteTokenRequest,this.logger,this.performanceClient,e.correlationId)(e,this.authority),o=(d=r.headers)==null?void 0:d[dn.X_MS_REQUEST_ID],a=new Ti(this.config.authOptions.clientId,this.cacheManager,this.cryptoUtils,this.logger,this.config.serializableCache,this.config.persistencePlugin);return a.validateTokenResponse(r.body),Q(a.handleServerTokenResponse.bind(a),x.HandleServerTokenResponse,this.logger,this.performanceClient,e.correlationId)(r.body,this.authority,t,e,void 0,void 0,!0,e.forceCache,o)}async acquireTokenByRefreshToken(e){var r;if(!e)throw Xe(Tw);if((r=this.performanceClient)==null||r.addQueueMeasurement(x.RefreshTokenClientAcquireTokenByRefreshToken,e.correlationId),!e.account)throw Y(Jf);if(this.cacheManager.isAppMetadataFOCI(e.account.environment))try{return await Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!0)}catch(o){const a=o instanceof wr&&o.errorCode===xl,c=o instanceof Wo&&o.errorCode===Vv.INVALID_GRANT_ERROR&&o.subError===Vv.CLIENT_MISMATCH_ERROR;if(a||c)return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1);throw o}return Q(this.acquireTokenWithCachedRefreshToken.bind(this),x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,!1)}async acquireTokenWithCachedRefreshToken(e,t){var a;(a=this.performanceClient)==null||a.addQueueMeasurement(x.RefreshTokenClientAcquireTokenWithCachedRefreshToken,e.correlationId);const r=Ai(this.cacheManager.getRefreshToken.bind(this.cacheManager),x.CacheManagerGetRefreshToken,this.logger,this.performanceClient,e.correlationId)(e.account,t,void 0,this.performanceClient,e.correlationId);if(!r)throw rf(xl);if(r.expiresOn&&ef(r.expiresOn,e.refreshTokenExpirationOffsetSeconds||P2))throw rf(hm);const o={...e,refreshToken:r.secret,authenticationScheme:e.authenticationScheme||Ge.BEARER,ccsCredential:{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}};try{return await Q(this.acquireToken.bind(this),x.RefreshTokenClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(o)}catch(c){if(c instanceof wr&&c.subError===fu){this.logger.verbose("acquireTokenWithRefreshToken: bad refresh token, removing from cache");const d=ha(r);this.cacheManager.removeRefreshToken(d)}throw c}}async executeTokenRequest(e,t){var h,m;(h=this.performanceClient)==null||h.addQueueMeasurement(x.RefreshTokenClientExecuteTokenRequest,e.correlationId);const r=this.createTokenQueryParameters(e),o=De.appendQueryString(t.tokenEndpoint,r),a=await Q(this.createTokenRequestBody.bind(this),x.RefreshTokenClientCreateTokenRequestBody,this.logger,this.performanceClient,e.correlationId)(e),c=this.createTokenRequestHeaders(e.ccsCredential),d={clientId:((m=e.tokenBodyParameters)==null?void 0:m.clientId)||this.config.authOptions.clientId,authority:t.canonicalAuthority,scopes:e.scopes,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid};return Q(this.executePostToTokenEndpoint.bind(this),x.RefreshTokenClientExecutePostToTokenEndpoint,this.logger,this.performanceClient,e.correlationId)(o,a,c,d,e.correlationId,x.RefreshTokenClientExecutePostToTokenEndpoint)}async createTokenRequestBody(e){var o,a,c;(o=this.performanceClient)==null||o.addQueueMeasurement(x.RefreshTokenClientCreateTokenRequestBody,e.correlationId);const t=e.correlationId,r=new Es(t,this.performanceClient);if(r.addClientId(e.embeddedClientId||((a=e.tokenBodyParameters)==null?void 0:a[wi])||this.config.authOptions.clientId),e.redirectUri&&r.addRedirectUri(e.redirectUri),r.addScopes(e.scopes,!0,(c=this.config.authOptions.authority.options.OIDCOptions)==null?void 0:c.defaultScopes),r.addGrantType(JE.REFRESH_TOKEN_GRANT),r.addClientInfo(),r.addLibraryInfo(this.config.libraryInfo),r.addApplicationTelemetry(this.config.telemetry.application),r.addThrottling(),this.serverTelemetryManager&&!tf(this.config)&&r.addServerTelemetry(this.serverTelemetryManager),r.addRefreshToken(e.refreshToken),this.config.clientCredentials.clientSecret&&r.addClientSecret(this.config.clientCredentials.clientSecret),this.config.clientCredentials.clientAssertion){const d=this.config.clientCredentials.clientAssertion;r.addClientAssertion(await $w(d.assertion,this.config.authOptions.clientId,e.resourceRequestUri)),r.addClientAssertionType(d.assertionType)}if(e.authenticationScheme===Ge.POP){const d=new Ia(this.cryptoUtils,this.performanceClient);let h;e.popKid?h=this.cryptoUtils.encodeKid(e.popKid):h=(await Q(d.generateCnf.bind(d),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(e,this.logger)).reqCnfString,r.addPopToken(h)}else if(e.authenticationScheme===Ge.SSH)if(e.sshJwk)r.addSshJwk(e.sshJwk);else throw Xe(uu);if((!yr.isEmptyObj(e.claims)||this.config.authOptions.clientCapabilities&&this.config.authOptions.clientCapabilities.length>0)&&r.addClaims(e.claims,this.config.authOptions.clientCapabilities),this.config.systemOptions.preventCorsPreflight&&e.ccsCredential)switch(e.ccsCredential.type){case Bn.HOME_ACCOUNT_ID:try{const d=fa(e.ccsCredential.credential);r.addCcsOid(d)}catch(d){this.logger.verbose("Could not parse home account ID for CCS Header: "+d)}break;case Bn.UPN:r.addCcsUpn(e.ccsCredential.credential);break}return e.embeddedClientId&&r.addBrokerParameters({brokerClientId:this.config.authOptions.clientId,brokerRedirectUri:this.config.authOptions.redirectUri}),e.tokenBodyParameters&&r.addExtraQueryParameters(e.tokenBodyParameters),r.createQueryString()}}/*! @azure/msal-common v14.16.0 2024-11-05 */class M2 extends dm{constructor(e,t){super(e,t)}async acquireToken(e){var t;try{const[r,o]=await this.acquireCachedToken({...e,scopes:(t=e.scopes)!=null&&t.length?e.scopes:[...Ma]});return o===Mo.PROACTIVELY_REFRESHED&&(this.logger.info("SilentFlowClient:acquireCachedToken - Cached access token's refreshOn property has been exceeded'. It's not expired, but must be refreshed."),new of(this.config,this.performanceClient).acquireTokenByRefreshToken(e).catch(()=>{})),r}catch(r){if(r instanceof su&&r.errorCode===co)return new of(this.config,this.performanceClient).acquireTokenByRefreshToken(e);throw r}}async acquireCachedToken(e){var h;(h=this.performanceClient)==null||h.addQueueMeasurement(x.SilentFlowClientAcquireCachedToken,e.correlationId);let t=Mo.NOT_APPLICABLE;if(e.forceRefresh||!this.config.cacheOptions.claimsBasedCachingEnabled&&!yr.isEmptyObj(e.claims))throw this.setCacheOutcome(Mo.FORCE_REFRESH_OR_CLAIMS,e.correlationId),Y(co);if(!e.account)throw Y(Jf);const r=e.account.tenantId||w2(e.authority),o=this.cacheManager.getTokenKeys(),a=this.cacheManager.getAccessToken(e.account,e,o,r,this.performanceClient,e.correlationId);if(a){if(cV(a.cachedAt)||ef(a.expiresOn,this.config.systemOptions.tokenRenewalOffsetSeconds))throw this.setCacheOutcome(Mo.CACHED_ACCESS_TOKEN_EXPIRED,e.correlationId),Y(co);a.refreshOn&&ef(a.refreshOn,0)&&(t=Mo.PROACTIVELY_REFRESHED)}else throw this.setCacheOutcome(Mo.NO_CACHED_ACCESS_TOKEN,e.correlationId),Y(co);const c=e.authority||this.authority.getPreferredCache(),d={account:this.cacheManager.readAccountFromCache(e.account),accessToken:a,idToken:this.cacheManager.getIdToken(e.account,o,r,this.performanceClient,e.correlationId),refreshToken:null,appMetadata:this.cacheManager.readAppMetadataFromCache(c)};return this.setCacheOutcome(t,e.correlationId),this.config.serverTelemetryManager&&this.config.serverTelemetryManager.incrementCacheHits(),[await Q(this.generateResultFromCacheRecord.bind(this),x.SilentFlowClientGenerateResultFromCacheRecord,this.logger,this.performanceClient,e.correlationId)(d,e),t]}setCacheOutcome(e,t){var r,o;(r=this.serverTelemetryManager)==null||r.setCacheOutcome(e),(o=this.performanceClient)==null||o.addFields({cacheOutcome:e},t),e!==Mo.NOT_APPLICABLE&&this.logger.info(`Token refresh is required due to cache outcome: ${e}`)}async generateResultFromCacheRecord(e,t){var o;(o=this.performanceClient)==null||o.addQueueMeasurement(x.SilentFlowClientGenerateResultFromCacheRecord,t.correlationId);let r;if(e.idToken&&(r=Si(e.idToken.secret,this.config.cryptoInterface.base64Decode)),t.maxAge||t.maxAge===0){const a=r==null?void 0:r.auth_time;if(!a)throw Y(Yf);pw(a,t.maxAge)}return Ti.generateAuthenticationResult(this.cryptoUtils,this.authority,e,!0,t,r)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const D2={sendGetRequestAsync:()=>Promise.reject(Y(Ae)),sendPostRequestAsync:()=>Promise.reject(Y(Ae))};/*! @azure/msal-common v14.16.0 2024-11-05 */const oy=",",Ww="|";function L2(n){const{skus:e,libraryName:t,libraryVersion:r,extensionName:o,extensionVersion:a}=n,c=new Map([[0,[t,r]],[2,[o,a]]]);let d=[];if(e!=null&&e.length){if(d=e.split(oy),d.length<4)return e}else d=Array.from({length:4},()=>Ww);return c.forEach((h,m)=>{var g,_;h.length===2&&((g=h[0])!=null&&g.length)&&((_=h[1])!=null&&_.length)&&x2({skuArr:d,index:m,skuName:h[0],skuVersion:h[1]})}),d.join(oy)}function x2(n){const{skuArr:e,index:t,skuName:r,skuVersion:o}=n;t>=e.length||(e[t]=[r,o].join(Ww))}class Ms{constructor(e,t){this.cacheOutcome=Mo.NOT_APPLICABLE,this.cacheManager=t,this.apiId=e.apiId,this.correlationId=e.correlationId,this.wrapperSKU=e.wrapperSKU||F.EMPTY_STRING,this.wrapperVer=e.wrapperVer||F.EMPTY_STRING,this.telemetryCacheKey=Wt.CACHE_KEY+tn.CACHE_KEY_SEPARATOR+e.clientId}generateCurrentRequestHeaderValue(){const e=`${this.apiId}${Wt.VALUE_SEPARATOR}${this.cacheOutcome}`,t=[this.wrapperSKU,this.wrapperVer],r=this.getNativeBrokerErrorCode();r!=null&&r.length&&t.push(`broker_error=${r}`);const o=t.join(Wt.VALUE_SEPARATOR),a=this.getRegionDiscoveryFields(),c=[e,a].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,c,o].join(Wt.CATEGORY_SEPARATOR)}generateLastRequestHeaderValue(){const e=this.getLastRequests(),t=Ms.maxErrorsToSend(e),r=e.failedRequests.slice(0,2*t).join(Wt.VALUE_SEPARATOR),o=e.errors.slice(0,t).join(Wt.VALUE_SEPARATOR),a=e.errors.length,c=t<a?Wt.OVERFLOW_TRUE:Wt.OVERFLOW_FALSE,d=[a,c].join(Wt.VALUE_SEPARATOR);return[Wt.SCHEMA_VERSION,e.cacheHits,r,o,d].join(Wt.CATEGORY_SEPARATOR)}cacheFailedRequest(e){const t=this.getLastRequests();t.errors.length>=Wt.MAX_CACHED_ERRORS&&(t.failedRequests.shift(),t.failedRequests.shift(),t.errors.shift()),t.failedRequests.push(this.apiId,this.correlationId),e instanceof Error&&e&&e.toString()?e instanceof lt?e.subError?t.errors.push(e.subError):e.errorCode?t.errors.push(e.errorCode):t.errors.push(e.toString()):t.errors.push(e.toString()):t.errors.push(Wt.UNKNOWN_ERROR),this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}incrementCacheHits(){const e=this.getLastRequests();return e.cacheHits+=1,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e),e.cacheHits}getLastRequests(){const e={failedRequests:[],errors:[],cacheHits:0};return this.cacheManager.getServerTelemetry(this.telemetryCacheKey)||e}clearTelemetryCache(){const e=this.getLastRequests(),t=Ms.maxErrorsToSend(e),r=e.errors.length;if(t===r)this.cacheManager.removeItem(this.telemetryCacheKey);else{const o={failedRequests:e.failedRequests.slice(t*2),errors:e.errors.slice(t),cacheHits:0};this.cacheManager.setServerTelemetry(this.telemetryCacheKey,o)}}static maxErrorsToSend(e){let t,r=0,o=0;const a=e.errors.length;for(t=0;t<a;t++){const c=e.failedRequests[2*t]||F.EMPTY_STRING,d=e.failedRequests[2*t+1]||F.EMPTY_STRING,h=e.errors[t]||F.EMPTY_STRING;if(o+=c.toString().length+d.toString().length+h.length+3,o<Wt.MAX_LAST_HEADER_BYTES)r+=1;else break}return r}getRegionDiscoveryFields(){const e=[];return e.push(this.regionUsed||F.EMPTY_STRING),e.push(this.regionSource||F.EMPTY_STRING),e.push(this.regionOutcome||F.EMPTY_STRING),e.join(",")}updateRegionDiscoveryMetadata(e){this.regionUsed=e.region_used,this.regionSource=e.region_source,this.regionOutcome=e.region_outcome}setCacheOutcome(e){this.cacheOutcome=e}setNativeBrokerErrorCode(e){const t=this.getLastRequests();t.nativeBrokerErrorCode=e,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,t)}getNativeBrokerErrorCode(){return this.getLastRequests().nativeBrokerErrorCode}clearNativeBrokerErrorCode(){const e=this.getLastRequests();delete e.nativeBrokerErrorCode,this.cacheManager.setServerTelemetry(this.telemetryCacheKey,e)}static makeExtraSkuString(e){return L2(e)}}/*! @azure/msal-common v14.16.0 2024-11-05 */const zw="missing_kid_error",Gw="missing_alg_error";/*! @azure/msal-common v14.16.0 2024-11-05 */const U2={[zw]:"The JOSE Header for the requested JWT, JWS or JWK object requires a keyId to be configured as the 'kid' header claim. No 'kid' value was provided.",[Gw]:"The JOSE Header for the requested JWT, JWS or JWK object requires an algorithm to be specified as the 'alg' header claim. No 'alg' value was provided."};class mm extends lt{constructor(e,t){super(e,t),this.name="JoseHeaderError",Object.setPrototypeOf(this,mm.prototype)}}function iy(n){return new mm(n,U2[n])}/*! @azure/msal-common v14.16.0 2024-11-05 */class gm{constructor(e){this.typ=e.typ,this.alg=e.alg,this.kid=e.kid}static getShrHeaderString(e){if(!e.kid)throw iy(zw);if(!e.alg)throw iy(Gw);const t=new gm({typ:e.typ||GF.Pop,kid:e.kid,alg:e.alg});return JSON.stringify(t)}}/*! @azure/msal-common v14.16.0 2024-11-05 */class ay{startMeasurement(){}endMeasurement(){}flushMeasurement(){return null}}class B2{generateId(){return"callback-id"}startMeasurement(e,t){return{end:()=>null,discard:()=>{},add:()=>{},increment:()=>{},event:{eventId:this.generateId(),status:E2.InProgress,authority:"",libraryName:"",libraryVersion:"",clientId:"",name:e,startTimeMs:Date.now(),correlationId:t||""},measurement:new ay}}startPerformanceMeasurement(){return new ay}calculateQueuedTime(){return 0}addQueueMeasurement(){}setPreQueueTime(){}endMeasurement(){return null}discardMeasurements(){}removePerformanceCallback(){return!0}addPerformanceCallback(){return""}emitEvents(){}addFields(){}incrementFields(){}cacheEventByCorrelationId(){}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const pm="pkce_not_created",af="crypto_nonexistent",mu="empty_navigate_uri",qw="hash_empty_error",_m="no_state_in_hash",jw="hash_does_not_contain_known_properties",Yw="unable_to_parse_state",Jw="state_interaction_type_mismatch",Qw="interaction_in_progress",Xw="popup_window_error",Zw="empty_window_error",bi="user_cancelled",F2="monitor_popup_timeout",eT="monitor_window_timeout",tT="redirect_in_iframe",nT="block_iframe_reload",rT="block_nested_popups",V2="iframe_closed_prematurely",gu="silent_logout_unsupported",oT="no_account_error",H2="silent_prompt_value_error",iT="no_token_request_cache_error",aT="unable_to_parse_token_request_cache_error",vm="no_cached_authority_error",$2="auth_request_not_set_error",K2="invalid_cache_type",pu="non_browser_environment",aa="database_not_open",Ul="no_network_connectivity",sT="post_request_failed",cT="get_request_failed",sf="failed_to_parse_response",lT="unable_to_load_token",ym="crypto_key_not_found",uT="auth_code_required",dT="auth_code_or_nativeAccountId_required",hT="spa_code_and_nativeAccountId_present",Cm="database_unavailable",fT="unable_to_acquire_token_from_native_platform",mT="native_handshake_timeout",gT="native_extension_not_installed",zs="native_connection_not_established",pT="uninitialized_public_client_application",_T="native_prompt_not_supported",vT="invalid_base64_string",yT="invalid_pop_token_request",CT="failed_to_build_headers",ET="failed_to_parse_headers";/*! @azure/msal-browser v3.28.1 2025-01-14 */const io="For more visit: aka.ms/msaljs/browser-errors",W2={[pm]:"The PKCE code challenge and verifier could not be generated.",[af]:"The crypto object or function is not available.",[mu]:"Navigation URI is empty. Please check stack trace for more info.",[qw]:`Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. ${io}`,[_m]:"Hash does not contain state. Please verify that the request originated from msal.",[jw]:`Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. ${io}`,[Yw]:"Unable to parse state. Please verify that the request originated from msal.",[Jw]:"Hash contains state but the interaction type does not match the caller.",[Qw]:`Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. ${io}`,[Xw]:"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.",[Zw]:"window.open returned null or undefined window object.",[bi]:"User cancelled the flow.",[F2]:`Token acquisition in popup failed due to timeout. ${io}`,[eT]:`Token acquisition in iframe failed due to timeout. ${io}`,[tT]:"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.",[nT]:`Request was blocked inside an iframe because MSAL detected an authentication response. ${io}`,[rT]:"Request was blocked inside a popup because MSAL detected it was running in a popup.",[V2]:"The iframe being monitored was closed prematurely.",[gu]:"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.",[oT]:"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.",[H2]:"The value given for the prompt value is not valid for silent requests - must be set to 'none' or 'no_session'.",[iT]:"No token request found in cache.",[aT]:"The cached token request could not be parsed.",[vm]:"No cached authority found.",[$2]:"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler",[K2]:"Invalid cache type",[pu]:"Login and token requests are not supported in non-browser environments.",[aa]:"Database is not open!",[Ul]:"No network connectivity. Check your internet connection.",[sT]:"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'",[cT]:"Network request failed. Please check the network trace to determine root cause.",[sf]:"Failed to parse network response. Check network trace.",[lT]:"Error loading token to cache.",[ym]:"Cryptographic Key or Keypair not found in browser storage.",[uT]:"An authorization code must be provided (as the `code` property on the request) to this flow.",[dT]:"An authorization code or nativeAccountId must be provided to this flow.",[hT]:"Request cannot contain both spa code and native account id.",[Cm]:"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.",[fT]:`Unable to acquire token from native platform. ${io}`,[mT]:"Timed out while attempting to establish connection to browser extension",[gT]:"Native extension is not installed. If you think this is a mistake call the initialize function.",[zs]:`Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). ${io}`,[pT]:`You must call and await the initialize function before attempting to call any other MSAL API. ${io}`,[_T]:"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",[vT]:"Invalid base64 encoded string.",[yT]:"Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",[CT]:"Failed to build request headers object.",[ET]:"Failed to parse response headers"};class Gs extends lt{constructor(e,t){super(e,W2[e],t),Object.setPrototypeOf(this,Gs.prototype),this.name="BrowserAuthError"}}function ie(n,e){return new Gs(n,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Dn={INTERACTION_IN_PROGRESS_VALUE:"interaction_in_progress",INVALID_GRANT_ERROR:"invalid_grant",POPUP_WIDTH:483,POPUP_HEIGHT:600,POPUP_NAME_PREFIX:"msal",DEFAULT_POLL_INTERVAL_MS:30,MSAL_SKU:"msal.js.browser"},ma={CHANNEL_ID:"53ee284d-920a-4b59-9d30-a60315b26836",PREFERRED_EXTENSION_ID:"ppnbnpeolgkicgegkbkbjmhlideopiji",MATS_TELEMETRY:"MATS"},gi={HandshakeRequest:"Handshake",HandshakeResponse:"HandshakeResponse",GetToken:"GetToken",Response:"Response"},vn={LocalStorage:"localStorage",SessionStorage:"sessionStorage",MemoryStorage:"memoryStorage"},sy={GET:"GET",POST:"POST"},Ke={AUTHORITY:"authority",ACQUIRE_TOKEN_ACCOUNT:"acquireToken.account",SESSION_STATE:"session.state",REQUEST_STATE:"request.state",NONCE_IDTOKEN:"nonce.id_token",ORIGIN_URI:"request.origin",RENEW_STATUS:"token.renew.status",URL_HASH:"urlHash",REQUEST_PARAMS:"request.params",SCOPES:"scopes",INTERACTION_STATUS_KEY:"interaction.status",CCS_CREDENTIAL:"ccs.credential",CORRELATION_ID:"request.correlationId",NATIVE_REQUEST:"request.native",REDIRECT_CONTEXT:"request.redirect.context"},Po={ACCOUNT_KEYS:"msal.account.keys",TOKEN_KEYS:"msal.token.keys"},Yc={WRAPPER_SKU:"wrapper.sku",WRAPPER_VER:"wrapper.version"},ot={acquireTokenRedirect:861,acquireTokenPopup:862,ssoSilent:863,acquireTokenSilent_authCode:864,handleRedirectPromise:865,acquireTokenByCode:866,acquireTokenSilent_silentFlow:61,logout:961,logoutPopup:962};var le;(function(n){n.Redirect="redirect",n.Popup="popup",n.Silent="silent",n.None="none"})(le||(le={}));const cy={scopes:Ma},wT="jwk",cf="msal.db",z2=1,G2=`${cf}.keys`,Pn={Default:0,AccessToken:1,AccessTokenAndRefreshToken:2,RefreshToken:3,RefreshTokenAndNetwork:4,Skip:5},q2=[Pn.Default,Pn.Skip,Pn.RefreshTokenAndNetwork],j2="msal.browser.log.level",Y2="msal.browser.log.pii";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Jc(n){return encodeURIComponent(Em(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"))}function _u(n){return TT(n).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function Em(n){return TT(new TextEncoder().encode(n))}function TT(n){const e=Array.from(n,t=>String.fromCodePoint(t)).join("");return btoa(e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const J2="RSASSA-PKCS1-v1_5",bT="SHA-256",Q2=2048,X2=new Uint8Array([1,0,1]),ly="0123456789abcdef",uy=new Uint32Array(1),Z2="crypto_subtle_undefined",wm={name:J2,hash:bT,modulusLength:Q2,publicExponent:X2};function eH(n){if(!window)throw ie(pu);if(!window.crypto)throw ie(af);if(!n&&!window.crypto.subtle)throw ie(af,Z2)}async function IT(n,e,t){e==null||e.addQueueMeasurement(x.Sha256Digest,t);const o=new TextEncoder().encode(n);return window.crypto.subtle.digest(bT,o)}function tH(n){return window.crypto.getRandomValues(n)}function lh(){return window.crypto.getRandomValues(uy),uy[0]}function go(){const n=Date.now(),e=lh()*1024+(lh()&1023),t=new Uint8Array(16),r=Math.trunc(e/2**30),o=e&2**30-1,a=lh();t[0]=n/2**40,t[1]=n/2**32,t[2]=n/2**24,t[3]=n/2**16,t[4]=n/2**8,t[5]=n,t[6]=112|r>>>8,t[7]=r,t[8]=128|o>>>24,t[9]=o>>>16,t[10]=o>>>8,t[11]=o,t[12]=a>>>24,t[13]=a>>>16,t[14]=a>>>8,t[15]=a;let c="";for(let d=0;d<t.length;d++)c+=ly.charAt(t[d]>>>4),c+=ly.charAt(t[d]&15),(d===3||d===5||d===7||d===9)&&(c+="-");return c}async function nH(n,e){return window.crypto.subtle.generateKey(wm,n,e)}async function uh(n){return window.crypto.subtle.exportKey(wT,n)}async function rH(n,e,t){return window.crypto.subtle.importKey(wT,n,wm,e,t)}async function oH(n,e){return window.crypto.subtle.sign(wm,n,e)}async function ST(n){const e=await IT(n),t=new Uint8Array(e);return _u(t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */const Ds="storage_not_supported",lf="stubbed_public_client_application_called",Bl="in_mem_redirect_unavailable";/*! @azure/msal-browser v3.28.1 2025-01-14 */const _l={[Ds]:"Given storage configuration option was not supported.",[lf]:"Stub instance of Public Client Application was called. If using msal-react, please ensure context is not used without a provider. For more visit: aka.ms/msaljs/browser-errors",[Bl]:"Redirect cannot be supported. In-memory storage was selected and storeAuthStateInCookie=false, which would cause the library to be unable to handle the incoming hash. If you would like to use the redirect API, please use session/localStorage or set storeAuthStateInCookie=true."};_l[Ds],_l[lf],_l[Bl];class Tm extends lt{constructor(e,t){super(e,t),this.name="BrowserConfigurationAuthError",Object.setPrototypeOf(this,Tm.prototype)}}function bm(n){return new Tm(n,_l[n])}/*! @azure/msal-browser v3.28.1 2025-01-14 */function iH(n){n.location.hash="",typeof n.history.replaceState=="function"&&n.history.replaceState(null,"",`${n.location.origin}${n.location.pathname}${n.location.search}`)}function aH(n){const e=n.split("#");e.shift(),window.location.hash=e.length>0?e.join("#"):""}function Im(){return window.parent!==window}function sH(){return typeof window<"u"&&!!window.opener&&window.opener!==window&&typeof window.name=="string"&&window.name.indexOf(`${Dn.POPUP_NAME_PREFIX}.`)===0}function lo(){return typeof window<"u"&&window.location?window.location.href.split("?")[0].split("#")[0]:""}function cH(){const e=new De(window.location.href).getUrlComponents();return`${e.Protocol}//${e.HostNameAndPort}/`}function lH(){if(De.hashContainsKnownProperties(window.location.hash)&&Im())throw ie(nT)}function uH(n){if(Im()&&!n)throw ie(tT)}function dH(){if(sH())throw ie(rT)}function AT(){if(typeof window>"u")throw ie(pu)}function kT(n){if(!n)throw ie(pT)}function Sm(n){AT(),lH(),dH(),kT(n)}function dy(n,e){if(Sm(n),uH(e.system.allowRedirectInIframe),e.cache.cacheLocation===vn.MemoryStorage&&!e.cache.storeAuthStateInCookie)throw bm(Bl)}function NT(n){const e=document.createElement("link");e.rel="preconnect",e.href=new URL(n).origin,e.crossOrigin="anonymous",document.head.appendChild(e),window.setTimeout(()=>{try{document.head.removeChild(e)}catch{}},1e4)}function hH(){return go()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fl{navigateInternal(e,t){return Fl.defaultNavigateWindow(e,t)}navigateExternal(e,t){return Fl.defaultNavigateWindow(e,t)}static defaultNavigateWindow(e,t){return t.noHistory?window.location.replace(e):window.location.assign(e),new Promise(r=>{setTimeout(()=>{r(!0)},t.timeout)})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class fH{async sendGetRequestAsync(e,t){let r,o={},a=0;const c=hy(t);try{r=await fetch(e,{method:sy.GET,headers:c})}catch{throw ie(window.navigator.onLine?cT:Ul)}o=fy(r.headers);try{return a=r.status,{headers:o,body:await r.json(),status:a}}catch{throw ty(ie(sf),a,o)}}async sendPostRequestAsync(e,t){const r=t&&t.body||"",o=hy(t);let a,c=0,d={};try{a=await fetch(e,{method:sy.POST,headers:o,body:r})}catch{throw ie(window.navigator.onLine?sT:Ul)}d=fy(a.headers);try{return c=a.status,{headers:d,body:await a.json(),status:c}}catch{throw ty(ie(sf),c,d)}}}function hy(n){try{const e=new Headers;if(!(n&&n.headers))return e;const t=n.headers;return Object.entries(t).forEach(([r,o])=>{e.append(r,o)}),e}catch{throw ie(CT)}}function fy(n){try{const e={};return n.forEach((t,r)=>{e[r]=t}),e}catch{throw ie(ET)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const mH=6e4,uf=1e4,gH=3e4,pH=2e3;function _H({auth:n,cache:e,system:t,telemetry:r},o){const a={clientId:F.EMPTY_STRING,authority:`${F.DEFAULT_AUTHORITY}`,knownAuthorities:[],cloudDiscoveryMetadata:F.EMPTY_STRING,authorityMetadata:F.EMPTY_STRING,redirectUri:typeof window<"u"?lo():"",postLogoutRedirectUri:F.EMPTY_STRING,navigateToLoginRequestUrl:!0,clientCapabilities:[],protocolMode:fo.AAD,OIDCOptions:{serverResponseType:Ws.FRAGMENT,defaultScopes:[F.OPENID_SCOPE,F.PROFILE_SCOPE,F.OFFLINE_ACCESS_SCOPE]},azureCloudOptions:{azureCloudInstance:em.None,tenant:F.EMPTY_STRING},skipAuthorityMetadataCache:!1,supportsNestedAppAuth:!1,instanceAware:!1},c={cacheLocation:vn.SessionStorage,temporaryCacheLocation:vn.SessionStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!!(e&&e.cacheLocation===vn.LocalStorage),claimsBasedCachingEnabled:!1},d={loggerCallback:()=>{},logLevel:tt.Info,piiLoggingEnabled:!1},m={...{...Uw,loggerOptions:d,networkClient:o?new fH:D2,navigationClient:new Fl,loadFrameTimeout:0,windowHashTimeout:(t==null?void 0:t.loadFrameTimeout)||mH,iframeHashTimeout:(t==null?void 0:t.loadFrameTimeout)||uf,navigateFrameWait:0,redirectNavigationTimeout:gH,asyncPopups:!1,allowRedirectInIframe:!1,allowNativeBroker:!1,nativeBrokerHandshakeTimeout:(t==null?void 0:t.nativeBrokerHandshakeTimeout)||pH,pollIntervalMilliseconds:Dn.DEFAULT_POLL_INTERVAL_MS},...t,loggerOptions:(t==null?void 0:t.loggerOptions)||d},g={application:{appName:F.EMPTY_STRING,appVersion:F.EMPTY_STRING},client:new B2};if((n==null?void 0:n.protocolMode)!==fo.OIDC&&(n!=null&&n.OIDCOptions)&&new Ko(m.loggerOptions).warning(JSON.stringify(Xe(Nw))),n!=null&&n.protocolMode&&n.protocolMode!==fo.AAD&&(m!=null&&m.allowNativeBroker))throw Xe(Rw);return{auth:{...a,...n,OIDCOptions:{...a.OIDCOptions,...n==null?void 0:n.OIDCOptions}},cache:{...c,...e},system:m,telemetry:{...g,...r}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const vH="@azure/msal-browser",vu="3.28.1";/*! @azure/msal-browser v3.28.1 2025-01-14 */class Am{static loggerCallback(e,t){switch(e){case tt.Error:console.error(t);return;case tt.Info:console.info(t);return;case tt.Verbose:console.debug(t);return;case tt.Warning:console.warn(t);return;default:console.log(t);return}}constructor(e){var h;this.browserEnvironment=typeof window<"u",this.config=_H(e,this.browserEnvironment);let t;try{t=window[vn.SessionStorage]}catch{}const r=t==null?void 0:t.getItem(j2),o=(h=t==null?void 0:t.getItem(Y2))==null?void 0:h.toLowerCase(),a=o==="true"?!0:o==="false"?!1:void 0,c={...this.config.system.loggerOptions},d=r&&Object.keys(tt).includes(r)?tt[r]:void 0;d&&(c.loggerCallback=Am.loggerCallback,c.logLevel=d),a!==void 0&&(c.piiLoggingEnabled=a),this.logger=new Ko(c,vH,vu),this.available=!1}getConfig(){return this.config}getLogger(){return this.logger}isAvailable(){return this.available}isBrowserEnvironment(){return this.browserEnvironment}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Ii extends Am{getModuleName(){return Ii.MODULE_NAME}getId(){return Ii.ID}async initialize(){return this.available=typeof window<"u",this.available}}Ii.MODULE_NAME="";Ii.ID="StandardOperatingContext";/*! @azure/msal-browser v3.28.1 2025-01-14 */function Kr(n){return new TextDecoder().decode(yH(n))}function yH(n){let e=n.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw ie(vT)}const t=atob(e);return Uint8Array.from(t,r=>r.codePointAt(0)||0)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class CH{constructor(){this.dbName=cf,this.version=z2,this.tableName=G2,this.dbOpen=!1}async open(){return new Promise((e,t)=>{const r=window.indexedDB.open(this.dbName,this.version);r.addEventListener("upgradeneeded",o=>{o.target.result.createObjectStore(this.tableName)}),r.addEventListener("success",o=>{const a=o;this.db=a.target.result,this.dbOpen=!0,e()}),r.addEventListener("error",()=>t(ie(Cm)))})}closeConnection(){const e=this.db;e&&this.dbOpen&&(e.close(),this.dbOpen=!1)}async validateDbIsOpen(){if(!this.dbOpen)return this.open()}async getItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).get(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async setItem(e,t){return await this.validateDbIsOpen(),new Promise((r,o)=>{if(!this.db)return o(ie(aa));const d=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).put(t,e);d.addEventListener("success",()=>{this.closeConnection(),r()}),d.addEventListener("error",h=>{this.closeConnection(),o(h)})})}async removeItem(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readwrite").objectStore(this.tableName).delete(e);c.addEventListener("success",()=>{this.closeConnection(),t()}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async getKeys(){return await this.validateDbIsOpen(),new Promise((e,t)=>{if(!this.db)return t(ie(aa));const a=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).getAllKeys();a.addEventListener("success",c=>{const d=c;this.closeConnection(),e(d.target.result)}),a.addEventListener("error",c=>{this.closeConnection(),t(c)})})}async containsKey(e){return await this.validateDbIsOpen(),new Promise((t,r)=>{if(!this.db)return r(ie(aa));const c=this.db.transaction([this.tableName],"readonly").objectStore(this.tableName).count(e);c.addEventListener("success",d=>{const h=d;this.closeConnection(),t(h.target.result===1)}),c.addEventListener("error",d=>{this.closeConnection(),r(d)})})}async deleteDatabase(){return this.db&&this.dbOpen&&this.closeConnection(),new Promise((e,t)=>{const r=window.indexedDB.deleteDatabase(cf),o=setTimeout(()=>t(!1),200);r.addEventListener("success",()=>(clearTimeout(o),e(!0))),r.addEventListener("blocked",()=>(clearTimeout(o),e(!0))),r.addEventListener("error",()=>(clearTimeout(o),t(!1)))})}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class df{constructor(){this.cache=new Map}getItem(e){return this.cache.get(e)||null}setItem(e,t){this.cache.set(e,t)}removeItem(e){this.cache.delete(e)}getKeys(){const e=[];return this.cache.forEach((t,r)=>{e.push(r)}),e}containsKey(e){return this.cache.has(e)}clear(){this.cache.clear()}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class EH{constructor(e){this.inMemoryCache=new df,this.indexedDBCache=new CH,this.logger=e}handleDatabaseAccessError(e){if(e instanceof Gs&&e.errorCode===Cm)this.logger.error("Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.");else throw e}async getItem(e){const t=this.inMemoryCache.getItem(e);if(!t)try{return this.logger.verbose("Queried item not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.getItem(e)}catch(r){this.handleDatabaseAccessError(r)}return t}async setItem(e,t){this.inMemoryCache.setItem(e,t);try{await this.indexedDBCache.setItem(e,t)}catch(r){this.handleDatabaseAccessError(r)}}async removeItem(e){this.inMemoryCache.removeItem(e);try{await this.indexedDBCache.removeItem(e)}catch(t){this.handleDatabaseAccessError(t)}}async getKeys(){const e=this.inMemoryCache.getKeys();if(e.length===0)try{return this.logger.verbose("In-memory cache is empty, now querying persistent storage."),await this.indexedDBCache.getKeys()}catch(t){this.handleDatabaseAccessError(t)}return e}async containsKey(e){const t=this.inMemoryCache.containsKey(e);if(!t)try{return this.logger.verbose("Key not found in in-memory cache, now querying persistent storage."),await this.indexedDBCache.containsKey(e)}catch(r){this.handleDatabaseAccessError(r)}return t}clearInMemory(){this.logger.verbose("Deleting in-memory keystore"),this.inMemoryCache.clear(),this.logger.verbose("In-memory keystore deleted")}async clearPersistent(){try{this.logger.verbose("Deleting persistent keystore");const e=await this.indexedDBCache.deleteDatabase();return e&&this.logger.verbose("Persistent keystore deleted"),e}catch(e){return this.handleDatabaseAccessError(e),!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Sa{constructor(e,t,r){this.logger=e,eH(r??!1),this.cache=new EH(this.logger),this.performanceClient=t}createNewGuid(){return go()}base64Encode(e){return Em(e)}base64Decode(e){return Kr(e)}base64UrlEncode(e){return Jc(e)}encodeKid(e){return this.base64UrlEncode(JSON.stringify({kid:e}))}async getPublicKeyThumbprint(e){var g;const t=(g=this.performanceClient)==null?void 0:g.startMeasurement(x.CryptoOptsGetPublicKeyThumbprint,e.correlationId),r=await nH(Sa.EXTRACTABLE,Sa.POP_KEY_USAGES),o=await uh(r.publicKey),a={e:o.e,kty:o.kty,n:o.n},c=my(a),d=await this.hashString(c),h=await uh(r.privateKey),m=await rH(h,!1,["sign"]);return await this.cache.setItem(d,{privateKey:m,publicKey:r.publicKey,requestMethod:e.resourceRequestMethod,requestUri:e.resourceRequestUri}),t&&t.end({success:!0}),d}async removeTokenBindingKey(e){return await this.cache.removeItem(e),!await this.cache.containsKey(e)}async clearKeystore(){this.cache.clearInMemory();try{return await this.cache.clearPersistent(),!0}catch(e){return e instanceof Error?this.logger.error(`Clearing keystore failed with error: ${e.message}`):this.logger.error("Clearing keystore failed with unknown error"),!1}}async signJwt(e,t,r,o){var D;const a=(D=this.performanceClient)==null?void 0:D.startMeasurement(x.CryptoOptsSignJwt,o),c=await this.cache.getItem(t);if(!c)throw ie(ym);const d=await uh(c.publicKey),h=my(d),m=Jc(JSON.stringify({kid:t})),g=gm.getShrHeaderString({...r==null?void 0:r.header,alg:d.alg,kid:m}),_=Jc(g);e.cnf={jwk:JSON.parse(h)};const p=Jc(JSON.stringify(e)),w=`${_}.${p}`,T=new TextEncoder().encode(w),k=await oH(c.privateKey,T),I=_u(new Uint8Array(k)),N=`${w}.${I}`;return a&&a.end({success:!0}),N}async hashString(e){return ST(e)}}Sa.POP_KEY_USAGES=["sign","verify"];Sa.EXTRACTABLE=!0;function my(n){return JSON.stringify(n,Object.keys(n).sort())}/*! @azure/msal-browser v3.28.1 2025-01-14 */class wH{constructor(){if(!window.localStorage)throw bm(Ds)}getItem(e){return window.localStorage.getItem(e)}setItem(e,t){window.localStorage.setItem(e,t)}removeItem(e){window.localStorage.removeItem(e)}getKeys(){return Object.keys(window.localStorage)}containsKey(e){return window.localStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class TH{constructor(){if(!window.sessionStorage)throw bm(Ds)}getItem(e){return window.sessionStorage.getItem(e)}setItem(e,t){window.sessionStorage.setItem(e,t)}removeItem(e){window.sessionStorage.removeItem(e)}getKeys(){return Object.keys(window.sessionStorage)}containsKey(e){return window.sessionStorage.hasOwnProperty(e)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function RT(n,e){if(!e)return null;try{return Cr.parseRequestState(n,e).libraryState.meta}catch{throw Y(Ta)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const bH=24*60*60*1e3;class IH{getItem(e){const t=`${encodeURIComponent(e)}`,r=document.cookie.split(";");for(let o=0;o<r.length;o++){const a=r[o],[c,...d]=decodeURIComponent(a).trim().split("="),h=d.join("=");if(c===t)return h}return""}setItem(e,t,r,o=!0){let a=`${encodeURIComponent(e)}=${encodeURIComponent(t)};path=/;SameSite=Lax;`;if(r){const c=SH(r);a+=`expires=${c};`}o&&(a+="Secure;"),document.cookie=a}removeItem(e){this.setItem(e,"",-1)}getKeys(){const e=document.cookie.split(";"),t=[];return e.forEach(r=>{const o=decodeURIComponent(r).trim().split("=");t.push(o[0])}),t}containsKey(e){return this.getKeys().includes(e)}}function SH(n){const e=new Date;return new Date(e.getTime()+n*bH).toUTCString()}/*! @azure/msal-browser v3.28.1 2025-01-14 */class hf extends ba{constructor(e,t,r,o,a,c){super(e,r,o,a),this.cacheConfig=t,this.logger=o,this.internalStorage=new df,this.browserStorage=this.setupBrowserStorage(this.cacheConfig.cacheLocation),this.temporaryCacheStorage=this.setupBrowserStorage(this.cacheConfig.temporaryCacheLocation),this.cookieStorage=new IH,t.cacheMigrationEnabled&&(this.migrateCacheEntries(),this.createKeyMaps()),this.performanceClient=c}setupBrowserStorage(e){try{switch(e){case vn.LocalStorage:return new wH;case vn.SessionStorage:return new TH;case vn.MemoryStorage:default:break}}catch(t){this.logger.error(t)}return this.cacheConfig.cacheLocation=vn.MemoryStorage,new df}migrateCacheEntries(){const e=`${F.CACHE_PREFIX}.${Lt.ID_TOKEN}`,t=`${F.CACHE_PREFIX}.${Lt.CLIENT_INFO}`,r=`${F.CACHE_PREFIX}.${Lt.ERROR}`,o=`${F.CACHE_PREFIX}.${Lt.ERROR_DESC}`,a=this.browserStorage.getItem(e),c=this.browserStorage.getItem(t),d=this.browserStorage.getItem(r),h=this.browserStorage.getItem(o),m=[a,c,d,h];[Lt.ID_TOKEN,Lt.CLIENT_INFO,Lt.ERROR,Lt.ERROR_DESC].forEach((_,p)=>{const w=m[p];w&&this.setTemporaryCache(_,w,!0)})}createKeyMaps(){this.logger.trace("BrowserCacheManager - createKeyMaps called.");const e=this.getItem(Po.ACCOUNT_KEYS),t=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e&&t){this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");return}this.browserStorage.getKeys().forEach(o=>{if(this.isCredentialKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);if(c&&c.hasOwnProperty("credentialType"))switch(c.credentialType){case ge.ID_TOKEN:if(zv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ID_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${o}`);break;case ge.ACCESS_TOKEN:case ge.ACCESS_TOKEN_WITH_AUTH_SCHEME:if(Wv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.ACCESS_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${o}`);break;case ge.REFRESH_TOKEN:if(Gv(c)){this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${o} found, saving key to token key map`);const d=c,h=this.updateCredentialCacheKey(o,d);this.addTokenKey(h,ge.REFRESH_TOKEN);return}else this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping."),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${o}`);break}}}if(this.isAccountKey(o)){const a=this.getItem(o);if(a){const c=this.validateAndParseJson(a);c&&Pt.isAccountEntity(c)&&(this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map"),this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${o} found, saving key to account key map`),this.addAccountKeyToMap(o))}}})}validateAndParseJson(e){try{const t=JSON.parse(e);return t&&typeof t=="object"?t:null}catch{return null}}getItem(e){return this.browserStorage.getItem(e)}setItem(e,t){this.browserStorage.setItem(e,t)}getAccount(e,t){this.logger.trace("BrowserCacheManager.getAccount called");const r=this.getCachedAccountEntity(e);return this.updateOutdatedCachedAccount(e,r,t)}getCachedAccountEntity(e){const t=this.getItem(e);if(!t)return this.removeAccountKeyFromMap(e),null;const r=this.validateAndParseJson(t);return!r||!Pt.isAccountEntity(r)?(this.removeAccountKeyFromMap(e),null):ba.toObject(new Pt,r)}setAccount(e){this.logger.trace("BrowserCacheManager.setAccount called");const t=e.generateAccountKey();this.setItem(t,JSON.stringify(e)),this.addAccountKeyToMap(t)}getAccountKeys(){this.logger.trace("BrowserCacheManager.getAccountKeys called");const e=this.getItem(Po.ACCOUNT_KEYS);return e?JSON.parse(e):(this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found"),[])}addAccountKeyToMap(e){this.logger.trace("BrowserCacheManager.addAccountKeyToMap called"),this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${e}`);const t=this.getAccountKeys();t.indexOf(e)===-1?(t.push(e),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added")):this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map")}removeAccountKeyFromMap(e){this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called"),this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${e}`);const t=this.getAccountKeys(),r=t.indexOf(e);r>-1?(t.splice(r,1),this.setItem(Po.ACCOUNT_KEYS,JSON.stringify(t)),this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed")):this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map")}async removeAccount(e){super.removeAccount(e),this.removeAccountKeyFromMap(e)}removeOutdatedAccount(e){this.removeItem(e),this.removeAccountKeyFromMap(e)}removeIdToken(e){super.removeIdToken(e),this.removeTokenKey(e,ge.ID_TOKEN)}async removeAccessToken(e){super.removeAccessToken(e),this.removeTokenKey(e,ge.ACCESS_TOKEN)}removeRefreshToken(e){super.removeRefreshToken(e),this.removeTokenKey(e,ge.REFRESH_TOKEN)}getTokenKeys(){this.logger.trace("BrowserCacheManager.getTokenKeys called");const e=this.getItem(`${Po.TOKEN_KEYS}.${this.clientId}`);if(e){const t=this.validateAndParseJson(e);if(t&&t.hasOwnProperty("idToken")&&t.hasOwnProperty("accessToken")&&t.hasOwnProperty("refreshToken"))return t;this.logger.error("BrowserCacheManager.getTokenKeys - Token keys found but in an unknown format. Returning empty key map.")}else this.logger.verbose("BrowserCacheManager.getTokenKeys - No token keys found");return{idToken:[],accessToken:[],refreshToken:[]}}addTokenKey(e,t){this.logger.trace("BrowserCacheManager addTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:r.idToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - idToken added to map"),r.idToken.push(e));break;case ge.ACCESS_TOKEN:r.accessToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - accessToken added to map"),r.accessToken.push(e));break;case ge.REFRESH_TOKEN:r.refreshToken.indexOf(e)===-1&&(this.logger.info("BrowserCacheManager: addTokenKey - refreshToken added to map"),r.refreshToken.push(e));break;default:throw this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Zh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}removeTokenKey(e,t){this.logger.trace("BrowserCacheManager removeTokenKey called");const r=this.getTokenKeys();switch(t){case ge.ID_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${e} from map`);const o=r.idToken.indexOf(e);o>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map"),r.idToken.splice(o,1)):this.logger.info("BrowserCacheManager: removeTokenKey - idToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.ACCESS_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${e} from map`);const a=r.accessToken.indexOf(e);a>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map"),r.accessToken.splice(a,1)):this.logger.info("BrowserCacheManager: removeTokenKey - accessToken does not exist in map. Either it was previously removed or it was never added.");break;case ge.REFRESH_TOKEN:this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${e} from map`);const c=r.refreshToken.indexOf(e);c>-1?(this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map"),r.refreshToken.splice(c,1)):this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken does not exist in map. Either it was previously removed or it was never added.");break;default:throw this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${t}`),Y(Zh)}this.setItem(`${Po.TOKEN_KEYS}.${this.clientId}`,JSON.stringify(r))}getIdTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!zv(r)?(this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ID_TOKEN),null):(this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit"),r)}setIdTokenCredential(e){this.logger.trace("BrowserCacheManager.setIdTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ID_TOKEN)}getAccessTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Wv(r)?(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.ACCESS_TOKEN),null):(this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit"),r)}setAccessTokenCredential(e){this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.ACCESS_TOKEN)}getRefreshTokenCredential(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null;const r=this.validateAndParseJson(t);return!r||!Gv(r)?(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit"),this.removeTokenKey(e,ge.REFRESH_TOKEN),null):(this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit"),r)}setRefreshTokenCredential(e){this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");const t=ha(e);this.setItem(t,JSON.stringify(e)),this.addTokenKey(t,ge.REFRESH_TOKEN)}getAppMetadata(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!_V(e,r)?(this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit"),r)}setAppMetadata(e){this.logger.trace("BrowserCacheManager.setAppMetadata called");const t=pV(e);this.setItem(t,JSON.stringify(e))}getServerTelemetry(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!mV(e,r)?(this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit"),r)}setServerTelemetry(e,t){this.logger.trace("BrowserCacheManager.setServerTelemetry called"),this.setItem(e,JSON.stringify(t))}getAuthorityMetadata(e){const t=this.internalStorage.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit"),null;const r=this.validateAndParseJson(t);return r&&vV(e,r)?(this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit"),r):null}getAuthorityMetadataKeys(){return this.internalStorage.getKeys().filter(t=>this.isAuthorityMetadata(t))}setWrapperMetadata(e,t){this.internalStorage.setItem(Yc.WRAPPER_SKU,e),this.internalStorage.setItem(Yc.WRAPPER_VER,t)}getWrapperMetadata(){const e=this.internalStorage.getItem(Yc.WRAPPER_SKU)||F.EMPTY_STRING,t=this.internalStorage.getItem(Yc.WRAPPER_VER)||F.EMPTY_STRING;return[e,t]}setAuthorityMetadata(e,t){this.logger.trace("BrowserCacheManager.setAuthorityMetadata called"),this.internalStorage.setItem(e,JSON.stringify(t))}getActiveAccount(){const e=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),t=this.getItem(e);if(!t){this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");const o=this.generateCacheKey(Lt.ACTIVE_ACCOUNT),a=this.getItem(o);if(!a)return this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null;const c=this.getAccountInfoFilteredBy({localAccountId:a});return c?(this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found"),this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema"),this.setActiveAccount(c),c):null}const r=this.validateAndParseJson(t);return r?(this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found"),this.getAccountInfoFilteredBy({homeAccountId:r.homeAccountId,localAccountId:r.localAccountId,tenantId:r.tenantId})):(this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found"),null)}setActiveAccount(e){const t=this.generateCacheKey(Lt.ACTIVE_ACCOUNT_FILTERS),r=this.generateCacheKey(Lt.ACTIVE_ACCOUNT);if(e){this.logger.verbose("setActiveAccount: Active account set");const o={homeAccountId:e.homeAccountId,localAccountId:e.localAccountId,tenantId:e.tenantId};this.browserStorage.setItem(t,JSON.stringify(o)),this.browserStorage.setItem(r,e.localAccountId)}else this.logger.verbose("setActiveAccount: No account passed, active account not set"),this.browserStorage.removeItem(t),this.browserStorage.removeItem(r)}getThrottlingCache(e){const t=this.getItem(e);if(!t)return this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null;const r=this.validateAndParseJson(t);return!r||!gV(e,r)?(this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit"),null):(this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit"),r)}setThrottlingCache(e,t){this.logger.trace("BrowserCacheManager.setThrottlingCache called"),this.setItem(e,JSON.stringify(t))}getTemporaryCache(e,t){const r=t?this.generateCacheKey(e):e;if(this.cacheConfig.storeAuthStateInCookie){const a=this.cookieStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies"),a}const o=this.temporaryCacheStorage.getItem(r);if(!o){if(this.cacheConfig.cacheLocation===vn.LocalStorage){const a=this.browserStorage.getItem(r);if(a)return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage"),a}return this.logger.trace("BrowserCacheManager.getTemporaryCache: No cache item found in local storage"),null}return this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned"),o}setTemporaryCache(e,t,r){const o=r?this.generateCacheKey(e):e;this.temporaryCacheStorage.setItem(o,t),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie"),this.cookieStorage.setItem(o,t,void 0,this.cacheConfig.secureCookies))}removeItem(e){this.browserStorage.removeItem(e)}removeTemporaryItem(e){this.temporaryCacheStorage.removeItem(e),this.cacheConfig.storeAuthStateInCookie&&(this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie"),this.cookieStorage.removeItem(e))}getKeys(){return this.browserStorage.getKeys()}async clear(){await this.removeAllAccounts(),this.removeAppMetadata(),this.temporaryCacheStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.removeTemporaryItem(e)}),this.browserStorage.getKeys().forEach(e=>{(e.indexOf(F.CACHE_PREFIX)!==-1||e.indexOf(this.clientId)!==-1)&&this.browserStorage.removeItem(e)}),this.internalStorage.clear()}async clearTokensAndKeysWithClaims(e,t){e.addQueueMeasurement(x.ClearTokensAndKeysWithClaims,t);const r=this.getTokenKeys(),o=[];r.accessToken.forEach(a=>{const c=this.getAccessTokenCredential(a);c!=null&&c.requestedClaimsHash&&a.includes(c.requestedClaimsHash.toLowerCase())&&o.push(this.removeAccessToken(a))}),await Promise.all(o),o.length>0&&this.logger.warning(`${o.length} access tokens with claims in the cache keys have been removed from the cache.`)}generateCacheKey(e){return this.validateAndParseJson(e)?JSON.stringify(e):yr.startsWith(e,F.CACHE_PREFIX)||yr.startsWith(e,Lt.ADAL_ID_TOKEN)?e:`${F.CACHE_PREFIX}.${this.clientId}.${e}`}generateAuthorityKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.AUTHORITY}.${t}`)}generateNonceKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.NONCE_IDTOKEN}.${t}`)}generateStateKey(e){const{libraryState:{id:t}}=Cr.parseRequestState(this.cryptoImpl,e);return this.generateCacheKey(`${Ke.REQUEST_STATE}.${t}`)}getCachedAuthority(e){const t=this.generateStateKey(e),r=this.getTemporaryCache(t);if(!r)return null;const o=this.generateAuthorityKey(r);return this.getTemporaryCache(o)}updateCacheEntries(e,t,r,o,a){this.logger.trace("BrowserCacheManager.updateCacheEntries called");const c=this.generateStateKey(e);this.setTemporaryCache(c,e,!1);const d=this.generateNonceKey(e);this.setTemporaryCache(d,t,!1);const h=this.generateAuthorityKey(e);if(this.setTemporaryCache(h,r,!1),a){const m={credential:a.homeAccountId,type:Bn.HOME_ACCOUNT_ID};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}else if(o){const m={credential:o,type:Bn.UPN};this.setTemporaryCache(Ke.CCS_CREDENTIAL,JSON.stringify(m),!0)}}resetRequestCache(e){this.logger.trace("BrowserCacheManager.resetRequestCache called"),e&&(this.temporaryCacheStorage.getKeys().forEach(t=>{t.indexOf(e)!==-1&&this.removeTemporaryItem(t)}),this.removeTemporaryItem(this.generateStateKey(e)),this.removeTemporaryItem(this.generateNonceKey(e)),this.removeTemporaryItem(this.generateAuthorityKey(e))),this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),this.removeTemporaryItem(this.generateCacheKey(Ke.ORIGIN_URI)),this.removeTemporaryItem(this.generateCacheKey(Ke.URL_HASH)),this.removeTemporaryItem(this.generateCacheKey(Ke.CORRELATION_ID)),this.removeTemporaryItem(this.generateCacheKey(Ke.CCS_CREDENTIAL)),this.removeTemporaryItem(this.generateCacheKey(Ke.NATIVE_REQUEST)),this.setInteractionInProgress(!1)}cleanRequestByState(e){if(this.logger.trace("BrowserCacheManager.cleanRequestByState called"),e){const t=this.generateStateKey(e),r=this.temporaryCacheStorage.getItem(t);this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r||F.EMPTY_STRING)}}cleanRequestByInteractionType(e){this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called"),this.temporaryCacheStorage.getKeys().forEach(t=>{if(t.indexOf(Ke.REQUEST_STATE)===-1)return;const r=this.temporaryCacheStorage.getItem(t);if(!r)return;const o=RT(this.cryptoImpl,r);o&&o.interactionType===e&&(this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${r}`),this.resetRequestCache(r))}),this.setInteractionInProgress(!1)}cacheCodeRequest(e){this.logger.trace("BrowserCacheManager.cacheCodeRequest called");const t=Em(JSON.stringify(e));this.setTemporaryCache(Ke.REQUEST_PARAMS,t,!0)}getCachedRequest(e){this.logger.trace("BrowserCacheManager.getCachedRequest called");const t=this.getTemporaryCache(Ke.REQUEST_PARAMS,!0);if(!t)throw ie(iT);let r;try{r=JSON.parse(Kr(t))}catch(o){throw this.logger.errorPii(`Attempted to parse: ${t}`),this.logger.error(`Parsing cached token request threw with error: ${o}`),ie(aT)}if(this.removeTemporaryItem(this.generateCacheKey(Ke.REQUEST_PARAMS)),!r.authority){const o=this.generateAuthorityKey(e),a=this.getTemporaryCache(o);if(!a)throw ie(vm);r.authority=a}return r}getCachedNativeRequest(){this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");const e=this.getTemporaryCache(Ke.NATIVE_REQUEST,!0);if(!e)return this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found"),null;const t=this.validateAndParseJson(e);return t||(this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request"),null)}isInteractionInProgress(e){const t=this.getInteractionInProgress();return e?t===this.clientId:!!t}getInteractionInProgress(){const e=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;return this.getTemporaryCache(e,!1)}setInteractionInProgress(e){const t=`${F.CACHE_PREFIX}.${Ke.INTERACTION_STATUS_KEY}`;if(e){if(this.getInteractionInProgress())throw ie(Qw);this.setTemporaryCache(t,this.clientId,!1)}else!e&&this.getInteractionInProgress()===this.clientId&&this.removeTemporaryItem(t)}getLegacyLoginHint(){const e=this.getTemporaryCache(Lt.ADAL_ID_TOKEN);e&&(this.browserStorage.removeItem(Lt.ADAL_ID_TOKEN),this.logger.verbose("Cached ADAL id token retrieved."));const t=this.getTemporaryCache(Lt.ID_TOKEN,!0);t&&(this.browserStorage.removeItem(this.generateCacheKey(Lt.ID_TOKEN)),this.logger.verbose("Cached MSAL.js v1 id token retrieved"));const r=t||e;if(r){const o=Si(r,Kr);if(o.preferred_username)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint"),o.preferred_username;if(o.upn)return this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 upn as loginHint"),o.upn;this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, however, no account hint claim found. Enable preferred_username or upn id token claim to get SSO.")}return null}updateCredentialCacheKey(e,t){const r=ha(t);if(e!==r){const o=this.getItem(e);if(o)return this.browserStorage.removeItem(e),this.setItem(r,o),this.logger.verbose(`Updated an outdated ${t.credentialType} cache key`),r;this.logger.error(`Attempted to update an outdated ${t.credentialType} cache key but no item matching the outdated key was found in storage`)}return e}async hydrateCache(e,t){var d,h,m;const r=cu((d=e.account)==null?void 0:d.homeAccountId,(h=e.account)==null?void 0:h.environment,e.idToken,this.clientId,e.tenantId);let o;t.claims&&(o=await this.cryptoImpl.hashString(t.claims));const a=lu((m=e.account)==null?void 0:m.homeAccountId,e.account.environment,e.accessToken,this.clientId,e.tenantId,e.scopes.join(" "),e.expiresOn?e.expiresOn.getTime()/1e3:0,e.extExpiresOn?e.extExpiresOn.getTime()/1e3:0,Kr,void 0,e.tokenType,void 0,t.sshKid,t.claims,o),c={idToken:r,accessToken:a};return this.saveCacheRecord(c)}async saveCacheRecord(e,t,r){try{await super.saveCacheRecord(e,t,r)}catch(o){if(o instanceof pa&&this.performanceClient&&r)try{const a=this.getTokenKeys();this.performanceClient.addFields({cacheRtCount:a.refreshToken.length,cacheIdCount:a.idToken.length,cacheAtCount:a.accessToken.length},r)}catch{}throw o}}}const AH=(n,e)=>{const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};return new hf(n,t,Ol,e)};/*! @azure/msal-browser v3.28.1 2025-01-14 */function kH(n,e,t,r){return n.verbose("getAllAccounts called"),t?e.getAllAccounts(r):[]}function NH(n,e,t){if(e.trace("getAccount called"),Object.keys(n).length===0)return e.warning("getAccount: No accountFilter provided"),null;const r=t.getAccountInfoFilteredBy(n);return r?(e.verbose("getAccount: Account matching provided filter found, returning"),r):(e.verbose("getAccount: No matching account found, returning null"),null)}function RH(n,e,t){if(e.trace("getAccountByUsername called"),!n)return e.warning("getAccountByUsername: No username provided"),null;const r=t.getAccountInfoFilteredBy({username:n});return r?(e.verbose("getAccountByUsername: Account matching username found, returning"),e.verbosePii(`getAccountByUsername: Returning signed-in accounts matching username: ${n}`),r):(e.verbose("getAccountByUsername: No matching account found, returning null"),null)}function OH(n,e,t){if(e.trace("getAccountByHomeId called"),!n)return e.warning("getAccountByHomeId: No homeAccountId provided"),null;const r=t.getAccountInfoFilteredBy({homeAccountId:n});return r?(e.verbose("getAccountByHomeId: Account matching homeAccountId found, returning"),e.verbosePii(`getAccountByHomeId: Returning signed-in accounts matching homeAccountId: ${n}`),r):(e.verbose("getAccountByHomeId: No matching account found, returning null"),null)}function PH(n,e,t){if(e.trace("getAccountByLocalId called"),!n)return e.warning("getAccountByLocalId: No localAccountId provided"),null;const r=t.getAccountInfoFilteredBy({localAccountId:n});return r?(e.verbose("getAccountByLocalId: Account matching localAccountId found, returning"),e.verbosePii(`getAccountByLocalId: Returning signed-in accounts matching localAccountId: ${n}`),r):(e.verbose("getAccountByLocalId: No matching account found, returning null"),null)}function MH(n,e){e.setActiveAccount(n)}function DH(n){return n.getActiveAccount()}/*! @azure/msal-browser v3.28.1 2025-01-14 */const me={INITIALIZE_START:"msal:initializeStart",INITIALIZE_END:"msal:initializeEnd",ACCOUNT_ADDED:"msal:accountAdded",ACCOUNT_REMOVED:"msal:accountRemoved",ACTIVE_ACCOUNT_CHANGED:"msal:activeAccountChanged",LOGIN_START:"msal:loginStart",LOGIN_SUCCESS:"msal:loginSuccess",LOGIN_FAILURE:"msal:loginFailure",ACQUIRE_TOKEN_START:"msal:acquireTokenStart",ACQUIRE_TOKEN_SUCCESS:"msal:acquireTokenSuccess",ACQUIRE_TOKEN_FAILURE:"msal:acquireTokenFailure",ACQUIRE_TOKEN_NETWORK_START:"msal:acquireTokenFromNetworkStart",SSO_SILENT_START:"msal:ssoSilentStart",SSO_SILENT_SUCCESS:"msal:ssoSilentSuccess",SSO_SILENT_FAILURE:"msal:ssoSilentFailure",ACQUIRE_TOKEN_BY_CODE_START:"msal:acquireTokenByCodeStart",ACQUIRE_TOKEN_BY_CODE_SUCCESS:"msal:acquireTokenByCodeSuccess",ACQUIRE_TOKEN_BY_CODE_FAILURE:"msal:acquireTokenByCodeFailure",HANDLE_REDIRECT_START:"msal:handleRedirectStart",HANDLE_REDIRECT_END:"msal:handleRedirectEnd",POPUP_OPENED:"msal:popupOpened",LOGOUT_START:"msal:logoutStart",LOGOUT_SUCCESS:"msal:logoutSuccess",LOGOUT_FAILURE:"msal:logoutFailure",LOGOUT_END:"msal:logoutEnd",RESTORE_FROM_BFCACHE:"msal:restoreFromBFCache"};/*! @azure/msal-browser v3.28.1 2025-01-14 */class LH{constructor(e){this.eventCallbacks=new Map,this.logger=e||new Ko({})}addEventCallback(e,t,r){if(typeof window<"u"){const o=r||hH();return this.eventCallbacks.has(o)?(this.logger.error(`Event callback with id: ${o} is already registered. Please provide a unique id or remove the existing callback and try again.`),null):(this.eventCallbacks.set(o,[e,t||[]]),this.logger.verbose(`Event callback registered with id: ${o}`),o)}return null}removeEventCallback(e){this.eventCallbacks.delete(e),this.logger.verbose(`Event callback ${e} removed.`)}emitEvent(e,t,r,o){if(typeof window<"u"){const a={eventType:e,interactionType:t||null,payload:r||null,error:o||null,timestamp:Date.now()};this.eventCallbacks.forEach(([c,d],h)=>{(d.length===0||d.includes(e))&&(this.logger.verbose(`Emitting event to callback ${h}: ${e}`),c.apply(null,[a]))})}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class OT{constructor(e,t,r,o,a,c,d,h,m){this.config=e,this.browserStorage=t,this.browserCrypto=r,this.networkClient=this.config.system.networkClient,this.eventHandler=a,this.navigationClient=c,this.nativeMessageHandler=h,this.correlationId=m||go(),this.logger=o.clone(Dn.MSAL_SKU,vu,this.correlationId),this.performanceClient=d}async clearCacheOnLogout(e){if(e){Pt.accountInfoIsEqual(e,this.browserStorage.getActiveAccount(),!1)&&(this.logger.verbose("Setting active account to null"),this.browserStorage.setActiveAccount(null));try{await this.browserStorage.removeAccount(Pt.generateAccountCacheKey(e)),this.logger.verbose("Cleared cache items belonging to the account provided in the logout request.")}catch{this.logger.error("Account provided in logout request was not found. Local cache unchanged.")}}else try{this.logger.verbose("No account provided in logout request, clearing all cache items.",this.correlationId),await this.browserStorage.clear(),await this.browserCrypto.clearKeystore()}catch{this.logger.error("Attempted to clear all MSAL cache items and failed. Local cache unchanged.")}}getRedirectUri(e){this.logger.verbose("getRedirectUri called");const t=e||this.config.auth.redirectUri;return De.getAbsoluteUrl(t,lo())}initializeServerTelemetryManager(e,t){this.logger.verbose("initializeServerTelemetryManager called");const r={clientId:this.config.auth.clientId,correlationId:this.correlationId,apiId:e,forceRefresh:t||!1,wrapperSKU:this.browserStorage.getWrapperMetadata()[0],wrapperVer:this.browserStorage.getWrapperMetadata()[1]};return new Ms(r,this.browserStorage)}async getDiscoveredAuthority(e){const{account:t}=e,r=e.requestExtraQueryParameters&&e.requestExtraQueryParameters.hasOwnProperty("instance_aware")?e.requestExtraQueryParameters.instance_aware:void 0;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetDiscoveredAuthority,this.correlationId);const o={protocolMode:this.config.auth.protocolMode,OIDCOptions:this.config.auth.OIDCOptions,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},a=e.requestAuthority||this.config.auth.authority,c=r!=null&&r.length?r==="true":this.config.auth.instanceAware,d=t&&c?this.config.auth.authority.replace(De.getDomainFromUrl(a),t.environment):a,h=Xt.generateAuthority(d,e.requestAzureCloudOptions||this.config.auth.azureCloudOptions),m=await Q(Vw,x.AuthorityFactoryCreateDiscoveredInstance,this.logger,this.performanceClient,this.correlationId)(h,this.config.system.networkClient,this.browserStorage,o,this.logger,this.correlationId,this.performanceClient);if(t&&!m.isAlias(t.environment))throw Xe(Ow);return m}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const xH=32;async function UH(n,e,t){n.addQueueMeasurement(x.GeneratePkceCodes,t);const r=Ai(BH,x.GenerateCodeVerifier,e,n,t)(n,e,t),o=await Q(FH,x.GenerateCodeChallengeFromVerifier,e,n,t)(r,n,e,t);return{verifier:r,challenge:o}}function BH(n,e,t){try{const r=new Uint8Array(xH);return Ai(tH,x.GetRandomValues,e,n,t)(r),_u(r)}catch{throw ie(pm)}}async function FH(n,e,t,r){e.addQueueMeasurement(x.GenerateCodeChallengeFromVerifier,r);try{const o=await Q(IT,x.Sha256Digest,t,e,r)(n,e,r);return _u(new Uint8Array(o))}catch{throw ie(pm)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function km(n,e,t,r){t.addQueueMeasurement(x.InitializeBaseRequest,n.correlationId);const o=n.authority||e.auth.authority,a=[...n&&n.scopes||[]],c={...n,correlationId:n.correlationId,authority:o,scopes:a};if(!c.authenticationScheme)c.authenticationScheme=Ge.BEARER,r.verbose(`Authentication Scheme wasn't explicitly set in request, defaulting to "Bearer" request`);else{if(c.authenticationScheme===Ge.SSH){if(!n.sshJwk)throw Xe(uu);if(!n.sshKid)throw Xe(kw)}r.verbose(`Authentication Scheme set to "${c.authenticationScheme}" as configured in Auth request`)}return e.cache.claimsBasedCachingEnabled&&n.claims&&!yr.isEmptyObj(n.claims)&&(c.requestedClaimsHash=await ST(n.claims)),c}async function VH(n,e,t,r,o){r.addQueueMeasurement(x.InitializeSilentRequest,n.correlationId);const a=await Q(km,x.InitializeBaseRequest,o,r,n.correlationId)(n,t,r,o);return{...n,...a,account:e,forceRefresh:n.forceRefresh||!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Da extends OT{async initializeAuthorizationCodeRequest(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.correlationId);const t=await Q(UH,x.GeneratePkceCodes,this.logger,this.performanceClient,this.correlationId)(this.performanceClient,this.logger,this.correlationId),r={...e,redirectUri:e.redirectUri,code:F.EMPTY_STRING,codeVerifier:t.verifier};return e.codeChallenge=t.challenge,e.codeChallengeMethod=F.S256_CODE_CHALLENGE_METHOD,r}initializeLogoutRequest(e){this.logger.verbose("initializeLogoutRequest called",e==null?void 0:e.correlationId);const t={correlationId:this.correlationId||go(),...e};if(e)if(e.logoutHint)this.logger.verbose("logoutHint has already been set in logoutRequest");else if(e.account){const r=this.getLogoutHintFromIdTokenClaims(e.account);r&&(this.logger.verbose("Setting logoutHint to login_hint ID Token Claim value for the account provided"),t.logoutHint=r)}else this.logger.verbose("logoutHint was not set and account was not passed into logout request, logoutHint will not be set");else this.logger.verbose("logoutHint will not be set since no logout request was configured");return!e||e.postLogoutRedirectUri!==null?e&&e.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to uri set on logout request",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(e.postLogoutRedirectUri,lo())):this.config.auth.postLogoutRedirectUri===null?this.logger.verbose("postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect",t.correlationId):this.config.auth.postLogoutRedirectUri?(this.logger.verbose("Setting postLogoutRedirectUri to configured uri",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri,lo())):(this.logger.verbose("Setting postLogoutRedirectUri to current page",t.correlationId),t.postLogoutRedirectUri=De.getAbsoluteUrl(lo(),lo())):this.logger.verbose("postLogoutRedirectUri passed as null, not setting post logout redirect uri",t.correlationId),t}getLogoutHintFromIdTokenClaims(e){const t=e.idTokenClaims;if(t){if(t.login_hint)return t.login_hint;this.logger.verbose("The ID Token Claims tied to the provided account do not contain a login_hint claim, logoutHint will not be added to logout request")}else this.logger.verbose("The provided account does not contain ID Token Claims, logoutHint will not be added to logout request");return null}async createAuthCodeClient(e){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientCreateAuthCodeClient,this.correlationId);const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)(e);return new Kw(t,this.performanceClient)}async getClientConfiguration(e){const{serverTelemetryManager:t,requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}=e;this.performanceClient.addQueueMeasurement(x.StandardInteractionClientGetClientConfiguration,this.correlationId);const d=await Q(this.getDiscoveredAuthority.bind(this),x.StandardInteractionClientGetDiscoveredAuthority,this.logger,this.performanceClient,this.correlationId)({requestAuthority:r,requestAzureCloudOptions:o,requestExtraQueryParameters:a,account:c}),h=this.config.system.loggerOptions;return{authOptions:{clientId:this.config.auth.clientId,authority:d,clientCapabilities:this.config.auth.clientCapabilities,redirectUri:this.config.auth.redirectUri},systemOptions:{tokenRenewalOffsetSeconds:this.config.system.tokenRenewalOffsetSeconds,preventCorsPreflight:!0},loggerOptions:{loggerCallback:h.loggerCallback,piiLoggingEnabled:h.piiLoggingEnabled,logLevel:h.logLevel,correlationId:this.correlationId},cacheOptions:{claimsBasedCachingEnabled:this.config.cache.claimsBasedCachingEnabled},cryptoInterface:this.browserCrypto,networkInterface:this.networkClient,storageInterface:this.browserStorage,serverTelemetryManager:t,libraryInfo:{sku:Dn.MSAL_SKU,version:vu,cpu:F.EMPTY_STRING,os:F.EMPTY_STRING},telemetry:this.config.telemetry}}async initializeAuthorizationRequest(e,t){this.performanceClient.addQueueMeasurement(x.StandardInteractionClientInitializeAuthorizationRequest,this.correlationId);const r=this.getRedirectUri(e.redirectUri),o={interactionType:t},a=Cr.setRequestState(this.browserCrypto,e&&e.state||F.EMPTY_STRING,o),d={...await Q(km,x.InitializeBaseRequest,this.logger,this.performanceClient,this.correlationId)({...e,correlationId:this.correlationId},this.config,this.performanceClient,this.logger),redirectUri:r,state:a,nonce:e.nonce||go(),responseMode:this.config.auth.OIDCOptions.serverResponseType};if(e.loginHint||e.sid)return d;const h=e.account||this.browserStorage.getActiveAccount();if(h&&(this.logger.verbose("Setting validated request account",this.correlationId),this.logger.verbosePii(`Setting validated request account: ${h.homeAccountId}`,this.correlationId),d.account=h),!d.loginHint&&!h){const m=this.browserStorage.getLegacyLoginHint();m&&(d.loginHint=m)}return d}}/*! @azure/msal-browser v3.28.1 2025-01-14 */const HH="ContentError",PT="user_switch";/*! @azure/msal-browser v3.28.1 2025-01-14 */const $H="USER_INTERACTION_REQUIRED",KH="USER_CANCEL",WH="NO_NETWORK",zH="PERSISTENT_ERROR",GH="DISABLED",qH="ACCOUNT_UNAVAILABLE";/*! @azure/msal-browser v3.28.1 2025-01-14 */const jH=-2147186943,YH={[PT]:"User attempted to switch accounts in the native broker, which is not allowed. All new accounts must sign-in through the standard web flow first, please try again."};class Br extends lt{constructor(e,t,r){super(e,t),Object.setPrototypeOf(this,Br.prototype),this.name="NativeAuthError",this.ext=r}}function sa(n){if(n.ext&&n.ext.status&&(n.ext.status===zH||n.ext.status===GH)||n.ext&&n.ext.error&&n.ext.error===jH)return!0;switch(n.errorCode){case HH:return!0;default:return!1}}function ff(n,e,t){if(t&&t.status)switch(t.status){case qH:return rf(Hw);case $H:return new wr(n,e);case KH:return ie(bi);case WH:return ie(Ul)}return new Br(n,YH[n]||e,t)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class MT extends Da{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentCacheClientAcquireToken,e.correlationId);const t=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),r=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:e.authority,requestAzureCloudOptions:e.azureCloudOptions,account:e.account}),o=new M2(r,this.performanceClient);this.logger.verbose("Silent auth client created");try{const c=(await Q(o.acquireCachedToken.bind(o),x.SilentFlowClientAcquireCachedToken,this.logger,this.performanceClient,e.correlationId)(e))[0];return this.performanceClient.addFields({fromCache:!0},e.correlationId),c}catch(a){throw a instanceof Gs&&a.errorCode===ym&&this.logger.verbose("Signing keypair for bound access token not found. Refreshing bound access token and generating a new crypto keypair."),a}}logout(e){this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e);return this.clearCacheOnLogout(t==null?void 0:t.account)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class _a extends OT{constructor(e,t,r,o,a,c,d,h,m,g,_,p){var C;super(e,t,r,o,a,c,h,m,p),this.apiId=d,this.accountId=g,this.nativeMessageHandler=m,this.nativeStorageManager=_,this.silentCacheClient=new MT(e,this.nativeStorageManager,r,o,a,c,h,m,p),this.serverTelemetryManager=this.initializeServerTelemetryManager(this.apiId);const w=this.nativeMessageHandler.getExtensionId()===ma.PREFERRED_EXTENSION_ID?"chrome":(C=this.nativeMessageHandler.getExtensionId())!=null&&C.length?"unknown":void 0;this.skus=Ms.makeExtraSkuString({libraryName:Dn.MSAL_SKU,libraryVersion:vu,extensionName:w,extensionVersion:this.nativeMessageHandler.getExtensionVersion()})}addRequestSKUs(e){e.extraParameters={...e.extraParameters,[p2]:this.skus}}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),this.logger.trace("NativeInteractionClient - acquireToken called.");const t=this.performanceClient.startMeasurement(x.NativeInteractionClientAcquireToken,e.correlationId),r=zr();try{const o=await this.initializeNativeRequest(e);try{const m=await this.acquireTokensFromCache(this.accountId,o);return t.end({success:!0,isNativeBroker:!1,fromCache:!0}),m}catch{this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call")}const{...a}=o,c={method:gi.GetToken,request:a},d=await this.nativeMessageHandler.sendMessage(c),h=this.validateNativeResponse(d);return await this.handleNativeResponse(h,o,r).then(m=>(t.end({success:!0,isNativeBroker:!0,requestId:m.requestId}),this.serverTelemetryManager.clearNativeBrokerErrorCode(),m)).catch(m=>{throw t.end({success:!1,errorCode:m.errorCode,subErrorCode:m.subError,isNativeBroker:!0}),m})}catch(o){throw o instanceof Br&&this.serverTelemetryManager.setNativeBrokerErrorCode(o.errorCode),o}}createSilentCacheRequest(e,t){return{authority:e.authority,correlationId:this.correlationId,scopes:_t.fromString(e.scope).asArray(),account:t,forceRefresh:!1}}async acquireTokensFromCache(e,t){if(!e)throw this.logger.warning("NativeInteractionClient:acquireTokensFromCache - No nativeAccountId provided"),Y(Qh);const r=this.browserStorage.getBaseAccountInfo({nativeAccountId:e});if(!r)throw Y(Qh);try{const o=this.createSilentCacheRequest(t,r),a=await this.silentCacheClient.acquireToken(o),c={...r,idTokenClaims:a==null?void 0:a.idTokenClaims,idToken:a==null?void 0:a.idToken};return{...a,account:c}}catch(o){throw o}}async acquireTokenRedirect(e,t){this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.");const{...r}=e;delete r.onRedirectNavigate;const o=await this.initializeNativeRequest(r),a={method:gi.GetToken,request:o};try{const h=await this.nativeMessageHandler.sendMessage(a);this.validateNativeResponse(h)}catch(h){if(h instanceof Br&&(this.serverTelemetryManager.setNativeBrokerErrorCode(h.errorCode),sa(h)))throw h}this.browserStorage.setTemporaryCache(Ke.NATIVE_REQUEST,JSON.stringify(o),!0);const c={apiId:ot.acquireTokenRedirect,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=this.config.auth.navigateToLoginRequestUrl?window.location.href:this.getRedirectUri(e.redirectUri);t.end({success:!0}),await this.navigationClient.navigateExternal(d,c)}async handleRedirectPromise(e,t){if(this.logger.trace("NativeInteractionClient - handleRedirectPromise called."),!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const r=this.browserStorage.getCachedNativeRequest();if(!r)return this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null."),e&&t&&(e==null||e.addFields({errorCode:"no_cached_request"},t)),null;const{prompt:o,...a}=r;o&&this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window."),this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.NATIVE_REQUEST));const c={method:gi.GetToken,request:a},d=zr();try{this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");const h=await this.nativeMessageHandler.sendMessage(c);this.validateNativeResponse(h);const m=this.handleNativeResponse(h,a,d);this.browserStorage.setInteractionInProgress(!1);const g=await m;return this.serverTelemetryManager.clearNativeBrokerErrorCode(),g}catch(h){throw this.browserStorage.setInteractionInProgress(!1),h}}logout(){return this.logger.trace("NativeInteractionClient - logout called."),Promise.reject("Logout not implemented yet")}async handleNativeResponse(e,t,r){var g;this.logger.trace("NativeInteractionClient - handleNativeResponse called.");const o=Si(e.id_token,Kr),a=this.createHomeAccountIdentifier(e,o),c=(g=this.browserStorage.getAccountInfoFilteredBy({nativeAccountId:t.accountId}))==null?void 0:g.homeAccountId;if(a!==c&&e.account.id!==t.accountId)throw ff(PT);const d=await this.getDiscoveredAuthority({requestAuthority:t.authority}),h=fm(this.browserStorage,d,a,Kr,o,e.client_info,void 0,o.tid,void 0,e.account.id,this.logger),m=await this.generateAuthenticationResult(e,t,o,h,d.canonicalAuthority,r);return this.cacheAccount(h),this.cacheNativeTokens(e,t,a,o,e.access_token,m.tenantId,r),m}createHomeAccountIdentifier(e,t){return Pt.generateHomeAccountId(e.client_info||F.EMPTY_STRING,gr.Default,this.logger,this.browserCrypto,t)}generateScopes(e,t){return e.scope?_t.fromString(e.scope):_t.fromString(t.scope)}async generatePopAccessToken(e,t){if(t.tokenType===Ge.POP&&t.signPopToken){if(e.shr)return this.logger.trace("handleNativeServerResponse: SHR is enabled in native layer"),e.shr;const r=new Ia(this.browserCrypto),o={resourceRequestMethod:t.resourceRequestMethod,resourceRequestUri:t.resourceRequestUri,shrClaims:t.shrClaims,shrNonce:t.shrNonce};if(!t.keyId)throw Y(Xf);return r.signPopToken(e.access_token,t.keyId,o)}else return e.access_token}async generateAuthenticationResult(e,t,r,o,a,c){const d=this.addTelemetryFromNativeResponse(e),h=e.scope?_t.fromString(e.scope):_t.fromString(t.scope),m=e.account.properties||{},g=m.UID||r.oid||r.sub||F.EMPTY_STRING,_=m.TenantId||r.tid||F.EMPTY_STRING,p=sm(o.getAccountInfo(),void 0,r,e.id_token);p.nativeAccountId!==e.account.id&&(p.nativeAccountId=e.account.id);const w=await this.generatePopAccessToken(e,t),C=t.tokenType===Ge.POP?Ge.POP:Ge.BEARER;return{authority:a,uniqueId:g,tenantId:_,scopes:h.asArray(),account:p,idToken:e.id_token,idTokenClaims:r,accessToken:w,fromCache:d?this.isResponseFromCache(d):!1,expiresOn:new Date(Number(c+e.expires_in)*1e3),tokenType:C,correlationId:this.correlationId,state:e.state,fromNativeBroker:!0}}cacheAccount(e){this.browserStorage.setAccount(e),this.browserStorage.removeAccountContext(e).catch(t=>{this.logger.error(`Error occurred while removing account context from browser storage. ${t}`)})}cacheNativeTokens(e,t,r,o,a,c,d){const h=cu(r,t.authority,e.id_token||"",t.clientId,o.tid||""),m=t.tokenType===Ge.POP?F.SHR_NONCE_VALIDITY:(typeof e.expires_in=="string"?parseInt(e.expires_in,10):e.expires_in)||0,g=d+m,_=this.generateScopes(e,t),p=lu(r,t.authority,a,t.clientId,o.tid||c,_.printScopes(),g,0,Kr,void 0,t.tokenType,void 0,t.keyId),w={idToken:h,accessToken:p};this.nativeStorageManager.saveCacheRecord(w,t.storeInCache)}addTelemetryFromNativeResponse(e){const t=this.getMATSFromResponse(e);return t?(this.performanceClient.addFields({extensionId:this.nativeMessageHandler.getExtensionId(),extensionVersion:this.nativeMessageHandler.getExtensionVersion(),matsBrokerVersion:t.broker_version,matsAccountJoinOnStart:t.account_join_on_start,matsAccountJoinOnEnd:t.account_join_on_end,matsDeviceJoin:t.device_join,matsPromptBehavior:t.prompt_behavior,matsApiErrorCode:t.api_error_code,matsUiVisible:t.ui_visible,matsSilentCode:t.silent_code,matsSilentBiSubCode:t.silent_bi_sub_code,matsSilentMessage:t.silent_message,matsSilentStatus:t.silent_status,matsHttpStatus:t.http_status,matsHttpEventCount:t.http_event_count},this.correlationId),t):null}validateNativeResponse(e){if(e.hasOwnProperty("access_token")&&e.hasOwnProperty("id_token")&&e.hasOwnProperty("client_info")&&e.hasOwnProperty("account")&&e.hasOwnProperty("scope")&&e.hasOwnProperty("expires_in"))return e;throw QE(Gf,"Response missing expected properties.")}getMATSFromResponse(e){if(e.properties.MATS)try{return JSON.parse(e.properties.MATS)}catch{this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead")}return null}isResponseFromCache(e){return typeof e.is_cached>"u"?(this.logger.verbose("NativeInteractionClient - MATS telemetry does not contain field indicating if response was served from cache. Returning false."),!1):!!e.is_cached}async initializeNativeRequest(e){this.logger.trace("NativeInteractionClient - initializeNativeRequest called");const t=e.authority||this.config.auth.authority;e.account&&await this.getDiscoveredAuthority({requestAuthority:t,requestAzureCloudOptions:e.azureCloudOptions,account:e.account});const r=new De(t);r.validateAsUri();const{scopes:o,...a}=e,c=new _t(o||[]);c.appendScopes(Ma);const d=()=>{switch(this.apiId){case ot.ssoSilent:case ot.acquireTokenSilent_silentFlow:return this.logger.trace("initializeNativeRequest: silent request sets prompt to none"),Bt.NONE}if(!e.prompt){this.logger.trace("initializeNativeRequest: prompt was not provided");return}switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:return this.logger.trace("initializeNativeRequest: prompt is compatible with native flow"),e.prompt;default:throw this.logger.trace(`initializeNativeRequest: prompt = ${e.prompt} is not compatible with native flow`),ie(_T)}},h={...a,accountId:this.accountId,clientId:this.config.auth.clientId,authority:r.urlString,scope:c.printScopes(),redirectUri:this.getRedirectUri(e.redirectUri),prompt:d(),correlationId:this.correlationId,tokenType:e.authenticationScheme,windowTitleSubstring:document.title,extraParameters:{...e.extraQueryParameters,...e.tokenQueryParameters},extendedExpiryToken:!1,keyId:e.popKid};if(h.signPopToken&&e.popKid)throw ie(yT);if(this.handleExtraBrokerParams(h),h.extraParameters=h.extraParameters||{},h.extraParameters.telemetry=ma.MATS_TELEMETRY,e.authenticationScheme===Ge.POP){const m={resourceRequestUri:e.resourceRequestUri,resourceRequestMethod:e.resourceRequestMethod,shrClaims:e.shrClaims,shrNonce:e.shrNonce},g=new Ia(this.browserCrypto);let _;if(h.keyId)_=this.browserCrypto.base64UrlEncode(JSON.stringify({kid:h.keyId})),h.signPopToken=!1;else{const p=await Q(g.generateCnf.bind(g),x.PopTokenGenerateCnf,this.logger,this.performanceClient,e.correlationId)(m,this.logger);_=p.reqCnfString,h.keyId=p.kid,h.signPopToken=!0}h.reqCnf=_}return this.addRequestSKUs(h),h}handleExtraBrokerParams(e){var a;const t=e.extraParameters&&e.extraParameters.hasOwnProperty(um)&&e.extraParameters.hasOwnProperty(nf)&&e.extraParameters.hasOwnProperty(wi);if(!e.embeddedClientId&&!t)return;let r="";const o=e.redirectUri;e.embeddedClientId?(e.redirectUri=this.config.auth.redirectUri,r=e.embeddedClientId):e.extraParameters&&(e.redirectUri=e.extraParameters[nf],r=e.extraParameters[wi]),e.extraParameters={child_client_id:r,child_redirect_uri:o},(a=this.performanceClient)==null||a.addFields({embeddedClientId:r,embeddedRedirectUri:o},e.correlationId)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Fr{constructor(e,t,r,o){this.logger=e,this.handshakeTimeoutMs=t,this.extensionId=o,this.resolvers=new Map,this.handshakeResolvers=new Map,this.messageChannel=new MessageChannel,this.windowListener=this.onWindowMessage.bind(this),this.performanceClient=r,this.handshakeEvent=r.startMeasurement(x.NativeMessageHandlerHandshake)}async sendMessage(e){this.logger.trace("NativeMessageHandler - sendMessage called.");const t={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:e};return this.logger.trace("NativeMessageHandler - Sending request to browser extension"),this.logger.tracePii(`NativeMessageHandler - Sending request to browser extension: ${JSON.stringify(t)}`),this.messageChannel.port1.postMessage(t),new Promise((r,o)=>{this.resolvers.set(t.responseId,{resolve:r,reject:o})})}static async createProvider(e,t,r){e.trace("NativeMessageHandler - createProvider called.");try{const o=new Fr(e,t,r,ma.PREFERRED_EXTENSION_ID);return await o.sendHandshakeRequest(),o}catch{const a=new Fr(e,t,r);return await a.sendHandshakeRequest(),a}}async sendHandshakeRequest(){this.logger.trace("NativeMessageHandler - sendHandshakeRequest called."),window.addEventListener("message",this.windowListener,!1);const e={channel:ma.CHANNEL_ID,extensionId:this.extensionId,responseId:go(),body:{method:gi.HandshakeRequest}};return this.handshakeEvent.add({extensionId:this.extensionId,extensionHandshakeTimeoutMs:this.handshakeTimeoutMs}),this.messageChannel.port1.onmessage=t=>{this.onChannelMessage(t)},window.postMessage(e,window.origin,[this.messageChannel.port2]),new Promise((t,r)=>{this.handshakeResolvers.set(e.responseId,{resolve:t,reject:r}),this.timeoutId=window.setTimeout(()=>{window.removeEventListener("message",this.windowListener,!1),this.messageChannel.port1.close(),this.messageChannel.port2.close(),this.handshakeEvent.end({extensionHandshakeTimedOut:!0,success:!1}),r(ie(mT)),this.handshakeResolvers.delete(e.responseId)},this.handshakeTimeoutMs)})}onWindowMessage(e){if(this.logger.trace("NativeMessageHandler - onWindowMessage called"),e.source!==window)return;const t=e.data;if(!(!t.channel||t.channel!==ma.CHANNEL_ID)&&!(t.extensionId&&t.extensionId!==this.extensionId)&&t.body.method===gi.HandshakeRequest){const r=this.handshakeResolvers.get(t.responseId);if(!r){this.logger.trace(`NativeMessageHandler.onWindowMessage - resolver can't be found for request ${t.responseId}`);return}this.logger.verbose(t.extensionId?`Extension with id: ${t.extensionId} not installed`:"No extension installed"),clearTimeout(this.timeoutId),this.messageChannel.port1.close(),this.messageChannel.port2.close(),window.removeEventListener("message",this.windowListener,!1),this.handshakeEvent.end({success:!1,extensionInstalled:!1}),r.reject(ie(gT))}}onChannelMessage(e){this.logger.trace("NativeMessageHandler - onChannelMessage called.");const t=e.data,r=this.resolvers.get(t.responseId),o=this.handshakeResolvers.get(t.responseId);try{const a=t.body.method;if(a===gi.Response){if(!r)return;const c=t.body.response;if(this.logger.trace("NativeMessageHandler - Received response from browser extension"),this.logger.tracePii(`NativeMessageHandler - Received response from browser extension: ${JSON.stringify(c)}`),c.status!=="Success")r.reject(ff(c.code,c.description,c.ext));else if(c.result)c.result.code&&c.result.description?r.reject(ff(c.result.code,c.result.description,c.result.ext)):r.resolve(c.result);else throw QE(Gf,"Event does not contain result.");this.resolvers.delete(t.responseId)}else if(a===gi.HandshakeResponse){if(!o){this.logger.trace(`NativeMessageHandler.onChannelMessage - resolver can't be found for request ${t.responseId}`);return}clearTimeout(this.timeoutId),window.removeEventListener("message",this.windowListener,!1),this.extensionId=t.extensionId,this.extensionVersion=t.body.version,this.logger.verbose(`NativeMessageHandler - Received HandshakeResponse from extension: ${this.extensionId}`),this.handshakeEvent.end({extensionInstalled:!0,success:!0}),o.resolve(),this.handshakeResolvers.delete(t.responseId)}}catch(a){this.logger.error("Error parsing response from WAM Extension"),this.logger.errorPii(`Error parsing response from WAM Extension: ${a}`),this.logger.errorPii(`Unable to parse ${e}`),r?r.reject(a):o&&o.reject(a)}}getExtensionId(){return this.extensionId}getExtensionVersion(){return this.extensionVersion}static isNativeAvailable(e,t,r,o){if(t.trace("isNativeAvailable called"),!e.system.allowNativeBroker)return t.trace("isNativeAvailable: allowNativeBroker is not enabled, returning false"),!1;if(!r)return t.trace("isNativeAvailable: WAM extension provider is not initialized, returning false"),!1;if(o)switch(o){case Ge.BEARER:case Ge.POP:return t.trace("isNativeAvailable: authenticationScheme is supported, returning true"),!0;default:return t.trace("isNativeAvailable: authenticationScheme is not supported, returning false"),!1}return!0}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Nm{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async handleCodeResponse(e,t){this.performanceClient.addQueueMeasurement(x.HandleCodeResponse,t.correlationId);let r;try{r=this.authModule.handleFragmentResponse(e,t.state)}catch(o){throw o instanceof Wo&&o.subError===bi?ie(bi):o}return Q(this.handleCodeResponseFromServer.bind(this),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,t.correlationId)(r,t)}async handleCodeResponseFromServer(e,t,r=!0){if(this.performanceClient.addQueueMeasurement(x.HandleCodeResponseFromServer,t.correlationId),this.logger.trace("InteractionHandler.handleCodeResponseFromServer called"),this.authCodeRequest.code=e.code,e.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,t.correlationId)(e.cloud_instance_host_name,t.correlationId),r&&(e.nonce=t.nonce||void 0),e.state=t.state,e.client_info)this.authCodeRequest.clientInfo=e.client_info;else{const a=this.createCcsCredentials(t);a&&(this.authCodeRequest.ccsCredential=a)}return await Q(this.authModule.acquireToken.bind(this.authModule),x.AuthClientAcquireToken,this.logger,this.performanceClient,t.correlationId)(this.authCodeRequest,e)}createCcsCredentials(e){return e.account?{credential:e.account.homeAccountId,type:Bn.HOME_ACCOUNT_ID}:e.loginHint?{credential:e.loginHint,type:Bn.UPN}:null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function DT(n,e,t){const r=Dl(n);if(!r)throw Mw(n)?(t.error(`A ${e} is present in the iframe but it does not contain known properties. It's likely that the ${e} has been replaced by code running on the redirectUri page.`),t.errorPii(`The ${e} detected is: ${n}`),ie(jw)):(t.error(`The request has returned to the redirectUri but a ${e} is not present. It's likely that the ${e} has been removed or the page has been redirected by code running on the redirectUri page.`),ie(qw));return r}function JH(n,e,t){if(!n.state)throw ie(_m);const r=RT(e,n.state);if(!r)throw ie(Yw);if(r.interactionType!==t)throw ie(Jw)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class QH extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.unloadWindow=this.unloadWindow.bind(this),this.nativeStorage=h}acquireToken(e){try{const r={popupName:this.generatePopupName(e.scopes||Ma,e.authority||this.config.auth.authority),popupWindowAttributes:e.popupWindowAttributes||{},popupWindowParent:e.popupWindowParent??window};return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true, acquiring token"),this.acquireTokenPopupAsync(e,r)):(this.logger.verbose("asyncPopup set to false, opening popup before acquiring token"),r.popup=this.openSizedPopup("about:blank",r),this.acquireTokenPopupAsync(e,r))}catch(t){return Promise.reject(t)}}logout(e){try{this.logger.verbose("logoutPopup called");const t=this.initializeLogoutRequest(e),r={popupName:this.generateLogoutPopupName(t),popupWindowAttributes:(e==null?void 0:e.popupWindowAttributes)||{},popupWindowParent:(e==null?void 0:e.popupWindowParent)??window},o=e&&e.authority,a=e&&e.mainWindowRedirectUri;return this.config.system.asyncPopups?(this.logger.verbose("asyncPopups set to true"),this.logoutPopupAsync(t,r,o,a)):(this.logger.verbose("asyncPopup set to false, opening popup"),r.popup=this.openSizedPopup("about:blank",r),this.logoutPopupAsync(t,r,o,a))}catch(t){return Promise.reject(t)}}async acquireTokenPopupAsync(e,t){var a;this.logger.verbose("acquireTokenPopupAsync called");const r=this.initializeServerTelemetryManager(ot.acquireTokenPopup),o=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Popup);NT(o.authority);try{const c=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(o),d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:o.authority,requestAzureCloudOptions:o.azureCloudOptions,requestExtraQueryParameters:o.extraQueryParameters,account:o.account}),h=Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme);let m;h&&(m=this.performanceClient.startMeasurement(x.FetchAccountIdWithNativeBroker,e.correlationId));const g=await d.getAuthCodeUrl({...o,nativeBroker:h}),_=new Nm(d,this.browserStorage,c,this.logger,this.performanceClient),p=this.initiateAuthRequest(g,t);this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null);const w=await this.monitorPopupForHash(p,t.popupWindowParent),C=Ai(DT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(w,this.config.auth.OIDCOptions.serverResponseType,this.logger);if(Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,c),C.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),m&&m.end({success:!0,isNativeBroker:!0}),!this.nativeMessageHandler)throw ie(zs);const k=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,C.accountId,this.nativeStorage,o.correlationId),{userRequestState:I}=Cr.parseRequestState(this.browserCrypto,o.state);return await k.acquireToken({...o,state:I,prompt:void 0})}return await _.handleCodeResponse(C,o)}catch(c){throw(a=t.popup)==null||a.close(),c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),c}}async logoutPopupAsync(e,t,r,o){var c,d,h,m;this.logger.verbose("logoutPopupAsync called"),this.eventHandler.emitEvent(me.LOGOUT_START,le.Popup,e);const a=this.initializeServerTelemetryManager(ot.logoutPopup);try{await this.clearCacheOnLogout(e.account);const g=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:a,requestAuthority:r,account:e.account||void 0});try{g.authority.endSessionEndpoint}catch{if((c=e.account)!=null&&c.homeAccountId&&e.postLogoutRedirectUri&&g.authority.protocolMode===fo.OIDC){if(this.browserStorage.removeAccount((d=e.account)==null?void 0:d.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());await this.navigationClient.navigateInternal(C,w)}(h=t.popup)==null||h.close();return}}const _=g.getLogoutUri(e);this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Popup,e);const p=this.openPopup(_,t);if(this.eventHandler.emitEvent(me.POPUP_OPENED,le.Popup,{popupWindow:p},null),await this.monitorPopupForHash(p,t.popupWindowParent).catch(()=>{}),o){const w={apiId:ot.logoutPopup,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},C=De.getAbsoluteUrl(o,lo());this.logger.verbose("Redirecting main window to url specified in the request"),this.logger.verbosePii(`Redirecting main window to: ${C}`),await this.navigationClient.navigateInternal(C,w)}else this.logger.verbose("No main window navigation requested")}catch(g){throw(m=t.popup)==null||m.close(),g instanceof lt&&(g.setCorrelationId(this.correlationId),a.cacheFailedRequest(g)),this.browserStorage.setInteractionInProgress(!1),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Popup,null,g),this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup),g}this.eventHandler.emitEvent(me.LOGOUT_END,le.Popup)}initiateAuthRequest(e,t){if(e)return this.logger.infoPii(`Navigate to: ${e}`),this.openPopup(e,t);throw this.logger.error("Navigate url is empty"),ie(mu)}monitorPopupForHash(e,t){return new Promise((r,o)=>{this.logger.verbose("PopupHandler.monitorPopupForHash - polling started");const a=setInterval(()=>{if(e.closed){this.logger.error("PopupHandler.monitorPopupForHash - window closed"),clearInterval(a),o(ie(bi));return}let c="";try{c=e.location.href}catch{}if(!c||c==="about:blank")return;clearInterval(a);let d="";const h=this.config.auth.OIDCOptions.serverResponseType;e&&(h===Ws.QUERY?d=e.location.search:d=e.location.hash),this.logger.verbose("PopupHandler.monitorPopupForHash - popup window is on same origin as caller"),r(d)},this.config.system.pollIntervalMilliseconds)}).finally(()=>{this.cleanPopup(e,t)})}openPopup(e,t){try{let r;if(t.popup?(r=t.popup,this.logger.verbosePii(`Navigating popup window to: ${e}`),r.location.assign(e)):typeof t.popup>"u"&&(this.logger.verbosePii(`Opening popup window to: ${e}`),r=this.openSizedPopup(e,t)),!r)throw ie(Zw);return r.focus&&r.focus(),this.currentWindow=r,t.popupWindowParent.addEventListener("beforeunload",this.unloadWindow),r}catch(r){throw this.logger.error("error opening popup "+r.message),this.browserStorage.setInteractionInProgress(!1),ie(Xw)}}openSizedPopup(e,{popupName:t,popupWindowAttributes:r,popupWindowParent:o}){var w,C,T,k;const a=o.screenLeft?o.screenLeft:o.screenX,c=o.screenTop?o.screenTop:o.screenY,d=o.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=o.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;let m=(w=r.popupSize)==null?void 0:w.width,g=(C=r.popupSize)==null?void 0:C.height,_=(T=r.popupPosition)==null?void 0:T.top,p=(k=r.popupPosition)==null?void 0:k.left;return(!m||m<0||m>d)&&(this.logger.verbose("Default popup window width used. Window width not configured or invalid."),m=Dn.POPUP_WIDTH),(!g||g<0||g>h)&&(this.logger.verbose("Default popup window height used. Window height not configured or invalid."),g=Dn.POPUP_HEIGHT),(!_||_<0||_>h)&&(this.logger.verbose("Default popup window top position used. Window top not configured or invalid."),_=Math.max(0,h/2-Dn.POPUP_HEIGHT/2+c)),(!p||p<0||p>d)&&(this.logger.verbose("Default popup window left position used. Window left not configured or invalid."),p=Math.max(0,d/2-Dn.POPUP_WIDTH/2+a)),o.open(e,t,`width=${m}, height=${g}, top=${_}, left=${p}, scrollbars=yes`)}unloadWindow(e){this.browserStorage.cleanRequestByInteractionType(le.Popup),this.currentWindow&&this.currentWindow.close(),e.preventDefault()}cleanPopup(e,t){e.close(),t.removeEventListener("beforeunload",this.unloadWindow),this.browserStorage.setInteractionInProgress(!1)}generatePopupName(e,t){return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${e.join("-")}.${t}.${this.correlationId}`}generateLogoutPopupName(e){const t=e.account&&e.account.homeAccountId;return`${Dn.POPUP_NAME_PREFIX}.${this.config.auth.clientId}.${t}.${this.correlationId}`}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class gy{constructor(e,t,r,o,a){this.authModule=e,this.browserStorage=t,this.authCodeRequest=r,this.logger=o,this.performanceClient=a}async initiateAuthRequest(e,t){if(this.logger.verbose("RedirectHandler.initiateAuthRequest called"),e){t.redirectStartPage&&(this.logger.verbose("RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page"),this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,t.redirectStartPage,!0)),this.browserStorage.setTemporaryCache(Ke.CORRELATION_ID,this.authCodeRequest.correlationId,!0),this.browserStorage.cacheCodeRequest(this.authCodeRequest),this.logger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${e}`);const r={apiId:ot.acquireTokenRedirect,timeout:t.redirectTimeout,noHistory:!1};if(typeof t.onRedirectNavigate=="function")if(this.logger.verbose("RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback"),t.onRedirectNavigate(e)!==!1){this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating"),await t.navigationClient.navigateExternal(e,r);return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation");return}else{this.logger.verbose("RedirectHandler.initiateAuthRequest: Navigating window to navigate url"),await t.navigationClient.navigateExternal(e,r);return}}else throw this.logger.info("RedirectHandler.initiateAuthRequest: Navigate url is empty"),ie(mu)}async handleCodeResponse(e,t){this.logger.verbose("RedirectHandler.handleCodeResponse called"),this.browserStorage.setInteractionInProgress(!1);const r=this.browserStorage.generateStateKey(t),o=this.browserStorage.getTemporaryCache(r);if(!o)throw Y(Rl,"Cached State");let a;try{a=this.authModule.handleFragmentResponse(e,o)}catch(m){throw m instanceof Wo&&m.subError===bi?ie(bi):m}const c=this.browserStorage.generateNonceKey(o),d=this.browserStorage.getTemporaryCache(c);if(this.authCodeRequest.code=a.code,a.cloud_instance_host_name&&await Q(this.authModule.updateAuthority.bind(this.authModule),x.UpdateTokenEndpointAuthority,this.logger,this.performanceClient,this.authCodeRequest.correlationId)(a.cloud_instance_host_name,this.authCodeRequest.correlationId),a.nonce=d||void 0,a.state=o,a.client_info)this.authCodeRequest.clientInfo=a.client_info;else{const m=this.checkCcsCredentials();m&&(this.authCodeRequest.ccsCredential=m)}const h=await this.authModule.acquireToken(this.authCodeRequest,a);return this.browserStorage.cleanRequestByState(t),h}checkCcsCredentials(){const e=this.browserStorage.getTemporaryCache(Ke.CCS_CREDENTIAL,!0);if(e)try{return JSON.parse(e)}catch{this.authModule.logger.error("Cache credential could not be parsed"),this.authModule.logger.errorPii(`Cache credential could not be parsed: ${e}`)}return null}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function XH(){if(typeof window>"u"||typeof window.performance>"u"||typeof window.performance.getEntriesByType!="function")return;const n=window.performance.getEntriesByType("navigation"),e=n.length?n[0]:void 0;return e==null?void 0:e.type}class ZH extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,d,m,g),this.nativeStorage=h}async acquireToken(e){const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,this.correlationId)(e,le.Redirect);this.browserStorage.updateCacheEntries(t.state,t.nonce,t.authority,t.loginHint||"",t.account||null);const r=this.initializeServerTelemetryManager(ot.acquireTokenRedirect),o=a=>{a.persisted&&(this.logger.verbose("Page was restored from back/forward cache. Clearing temporary cache."),this.browserStorage.cleanRequestByState(t.state),this.eventHandler.emitEvent(me.RESTORE_FROM_BFCACHE,le.Redirect))};try{const a=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,this.correlationId)(t),c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),d=new gy(c,this.browserStorage,a,this.logger,this.performanceClient),h=await c.getAuthCodeUrl({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,e.authenticationScheme)}),m=this.getRedirectStartPage(e.redirectStartPage);return this.logger.verbosePii(`Redirect start page: ${m}`),window.addEventListener("pageshow",o),await d.initiateAuthRequest(h,{navigationClient:this.navigationClient,redirectTimeout:this.config.system.redirectNavigationTimeout,redirectStartPage:m,onRedirectNavigate:e.onRedirectNavigate||this.config.auth.onRedirectNavigate})}catch(a){throw a instanceof lt&&(a.setCorrelationId(this.correlationId),r.cacheFailedRequest(a)),window.removeEventListener("pageshow",o),this.browserStorage.cleanRequestByState(t.state),a}}async handleRedirectPromise(e="",t){const r=this.initializeServerTelemetryManager(ot.handleRedirectPromise);try{if(!this.browserStorage.isInteractionInProgress(!0))return this.logger.info("handleRedirectPromise called but there is no interaction in progress, returning null."),null;const[o,a]=this.getRedirectResponse(e||"");if(!o)return this.logger.info("handleRedirectPromise did not detect a response as a result of a redirect. Cleaning temporary cache."),this.browserStorage.cleanRequestByInteractionType(le.Redirect),XH()!=="back_forward"?t.event.errorCode="no_server_response":this.logger.verbose("Back navigation event detected. Muting no_server_response error"),null;const c=this.browserStorage.getTemporaryCache(Ke.ORIGIN_URI,!0)||F.EMPTY_STRING,d=De.removeHashFromUrl(c),h=De.removeHashFromUrl(window.location.href);if(d===h&&this.config.auth.navigateToLoginRequestUrl)return this.logger.verbose("Current page is loginRequestUrl, handling response"),c.indexOf("#")>-1&&aH(c),await this.handleResponse(o,r);if(this.config.auth.navigateToLoginRequestUrl){if(!Im()||this.config.system.allowRedirectInIframe){this.browserStorage.setTemporaryCache(Ke.URL_HASH,a,!0);const m={apiId:ot.handleRedirectPromise,timeout:this.config.system.redirectNavigationTimeout,noHistory:!0};let g=!0;if(!c||c==="null"){const _=cH();this.browserStorage.setTemporaryCache(Ke.ORIGIN_URI,_,!0),this.logger.warning("Unable to get valid login request url from cache, redirecting to home page"),g=await this.navigationClient.navigateInternal(_,m)}else this.logger.verbose(`Navigating to loginRequestUrl: ${c}`),g=await this.navigationClient.navigateInternal(c,m);if(!g)return await this.handleResponse(o,r)}}else return this.logger.verbose("NavigateToLoginRequestUrl set to false, handling response"),await this.handleResponse(o,r);return null}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),this.browserStorage.cleanRequestByInteractionType(le.Redirect),o}}getRedirectResponse(e){this.logger.verbose("getRedirectResponseHash called");let t=e;t||(this.config.auth.OIDCOptions.serverResponseType===Ws.QUERY?t=window.location.search:t=window.location.hash);let r=Dl(t);if(r){try{JH(r,this.browserCrypto,le.Redirect)}catch(a){return a instanceof lt&&this.logger.error(`Interaction type validation failed due to ${a.errorCode}: ${a.errorMessage}`),[null,""]}return iH(window),this.logger.verbose("Hash contains known properties, returning response hash"),[r,t]}const o=this.browserStorage.getTemporaryCache(Ke.URL_HASH,!0);return this.browserStorage.removeItem(this.browserStorage.generateCacheKey(Ke.URL_HASH)),o&&(r=Dl(o),r)?(this.logger.verbose("Hash does not contain known properties, returning cached hash"),[r,o]):[null,""]}async handleResponse(e,t){const r=e.state;if(!r)throw ie(_m);const o=this.browserStorage.getCachedRequest(r);if(this.logger.verbose("handleResponse called, retrieved cached request"),e.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(zs);const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenPopup,this.performanceClient,this.nativeMessageHandler,e.accountId,this.nativeStorage,o.correlationId),{userRequestState:m}=Cr.parseRequestState(this.browserCrypto,r);return h.acquireToken({...o,state:m,prompt:void 0}).finally(()=>{this.browserStorage.cleanRequestByState(r)})}const a=this.browserStorage.getCachedAuthority(r);if(!a)throw ie(vm);const c=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:t,requestAuthority:a});return Ur.removeThrottle(this.browserStorage,this.config.auth.clientId,o),new gy(c,this.browserStorage,o,this.logger,this.performanceClient).handleCodeResponse(e,r)}async logout(e){var o,a;this.logger.verbose("logoutRedirect called");const t=this.initializeLogoutRequest(e),r=this.initializeServerTelemetryManager(ot.logout);try{this.eventHandler.emitEvent(me.LOGOUT_START,le.Redirect,e),await this.clearCacheOnLogout(t.account);const c={apiId:ot.logout,timeout:this.config.system.redirectNavigationTimeout,noHistory:!1},d=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:r,requestAuthority:e&&e.authority,requestExtraQueryParameters:e==null?void 0:e.extraQueryParameters,account:e&&e.account||void 0});if(d.authority.protocolMode===fo.OIDC)try{d.authority.endSessionEndpoint}catch{if((o=t.account)!=null&&o.homeAccountId){this.browserStorage.removeAccount((a=t.account)==null?void 0:a.homeAccountId),this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t);return}}const h=d.getLogoutUri(t);if(this.eventHandler.emitEvent(me.LOGOUT_SUCCESS,le.Redirect,t),e&&typeof e.onRedirectNavigate=="function")if(e.onRedirectNavigate(h)!==!1){this.logger.verbose("Logout onRedirectNavigate did not return false, navigating"),this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}else this.browserStorage.setInteractionInProgress(!1),this.logger.verbose("Logout onRedirectNavigate returned false, stopping navigation");else{this.browserStorage.getInteractionInProgress()||this.browserStorage.setInteractionInProgress(!0),await this.navigationClient.navigateExternal(h,c);return}}catch(c){throw c instanceof lt&&(c.setCorrelationId(this.correlationId),r.cacheFailedRequest(c)),this.eventHandler.emitEvent(me.LOGOUT_FAILURE,le.Redirect,null,c),this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect),c}this.eventHandler.emitEvent(me.LOGOUT_END,le.Redirect)}getRedirectStartPage(e){const t=e||window.location.href;return De.getAbsoluteUrl(t,lo())}}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function e$(n,e,t,r,o){if(e.addQueueMeasurement(x.SilentHandlerInitiateAuthRequest,r),!n)throw t.info("Navigate url is empty"),ie(mu);return o?Q(n$,x.SilentHandlerLoadFrame,t,e,r)(n,o,e,r):Ai(r$,x.SilentHandlerLoadFrameSync,t,e,r)(n)}async function t$(n,e,t,r,o,a,c){return r.addQueueMeasurement(x.SilentHandlerMonitorIframeForHash,a),new Promise((d,h)=>{e<uf&&o.warning(`system.loadFrameTimeout or system.iframeHashTimeout set to lower (${e}ms) than the default (${uf}ms). This may result in timeouts.`);const m=window.setTimeout(()=>{window.clearInterval(g),h(ie(eT))},e),g=window.setInterval(()=>{let _="";const p=n.contentWindow;try{_=p?p.location.href:""}catch{}if(!_||_==="about:blank")return;let w="";p&&(c===Ws.QUERY?w=p.location.search:w=p.location.hash),window.clearTimeout(m),window.clearInterval(g),d(w)},t)}).finally(()=>{Ai(o$,x.RemoveHiddenIframe,o,r,a)(n)})}function n$(n,e,t,r){return t.addQueueMeasurement(x.SilentHandlerLoadFrame,r),new Promise((o,a)=>{const c=LT();window.setTimeout(()=>{if(!c){a("Unable to load iframe");return}c.src=n,o(c)},e)})}function r$(n){const e=LT();return e.src=n,e}function LT(){const n=document.createElement("iframe");return n.className="msalSilentIframe",n.style.visibility="hidden",n.style.position="absolute",n.style.width=n.style.height="0",n.style.border="0",n.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),document.body.appendChild(n),n}function o$(n){document.body===n.parentNode&&document.body.removeChild(n)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class i$ extends Da{constructor(e,t,r,o,a,c,d,h,m,g,_){super(e,t,r,o,a,c,h,g,_),this.apiId=d,this.nativeStorage=m}async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentIframeClientAcquireToken,e.correlationId),!e.loginHint&&!e.sid&&(!e.account||!e.account.username)&&this.logger.warning("No user hint provided. The authorization server may need more information to complete this request.");const t={...e};t.prompt?t.prompt!==Bt.NONE&&t.prompt!==Bt.NO_SESSION&&(this.logger.warning(`SilentIframeClient. Replacing invalid prompt ${t.prompt} with ${Bt.NONE}`),t.prompt=Bt.NONE):t.prompt=Bt.NONE;const r=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);NT(r.authority);const o=this.initializeServerTelemetryManager(this.apiId);let a;try{return a=await Q(this.createAuthCodeClient.bind(this),x.StandardInteractionClientCreateAuthCodeClient,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:o,requestAuthority:r.authority,requestAzureCloudOptions:r.azureCloudOptions,requestExtraQueryParameters:r.extraQueryParameters,account:r.account}),await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,e.correlationId)(a,r)}catch(c){if(c instanceof lt&&(c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c)),!a||!(c instanceof lt)||c.errorCode!==Dn.INVALID_GRANT_ERROR)throw c;this.performanceClient.addFields({retryError:c.errorCode},this.correlationId);const d=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(t,le.Silent);return await Q(this.silentTokenHelper.bind(this),x.SilentIframeClientTokenHelper,this.logger,this.performanceClient,this.correlationId)(a,d)}}logout(){return Promise.reject(ie(gu))}async silentTokenHelper(e,t){const r=t.correlationId;this.performanceClient.addQueueMeasurement(x.SilentIframeClientTokenHelper,r);const o=await Q(this.initializeAuthorizationCodeRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationCodeRequest,this.logger,this.performanceClient,r)(t),a=await Q(e.getAuthCodeUrl.bind(e),x.GetAuthCodeUrl,this.logger,this.performanceClient,r)({...t,nativeBroker:Fr.isNativeAvailable(this.config,this.logger,this.nativeMessageHandler,t.authenticationScheme)}),c=new Nm(e,this.browserStorage,o,this.logger,this.performanceClient),d=await Q(e$,x.SilentHandlerInitiateAuthRequest,this.logger,this.performanceClient,r)(a,this.performanceClient,this.logger,r,this.config.system.navigateFrameWait),h=this.config.auth.OIDCOptions.serverResponseType,m=await Q(t$,x.SilentHandlerMonitorIframeForHash,this.logger,this.performanceClient,r)(d,this.config.system.iframeHashTimeout,this.config.system.pollIntervalMilliseconds,this.performanceClient,this.logger,r,h),g=Ai(DT,x.DeserializeResponse,this.logger,this.performanceClient,this.correlationId)(m,h,this.logger);if(g.accountId){if(this.logger.verbose("Account id found in hash, calling WAM for token"),!this.nativeMessageHandler)throw ie(zs);const _=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.apiId,this.performanceClient,this.nativeMessageHandler,g.accountId,this.browserStorage,r),{userRequestState:p}=Cr.parseRequestState(this.browserCrypto,t.state);return Q(_.acquireToken.bind(_),x.NativeInteractionClientAcquireToken,this.logger,this.performanceClient,r)({...t,state:p,prompt:t.prompt||Bt.NONE})}return Q(c.handleCodeResponse.bind(c),x.HandleCodeResponse,this.logger,this.performanceClient,r)(g,t)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class a$ extends Da{async acquireToken(e){this.performanceClient.addQueueMeasurement(x.SilentRefreshClientAcquireToken,e.correlationId);const t=await Q(km,x.InitializeBaseRequest,this.logger,this.performanceClient,e.correlationId)(e,this.config,this.performanceClient,this.logger),r={...e,...t};e.redirectUri&&(r.redirectUri=this.getRedirectUri(e.redirectUri));const o=this.initializeServerTelemetryManager(ot.acquireTokenSilent_silentFlow),a=await this.createRefreshTokenClient({serverTelemetryManager:o,authorityUrl:r.authority,azureCloudOptions:r.azureCloudOptions,account:r.account});return Q(a.acquireTokenByRefreshToken.bind(a),x.RefreshTokenClientAcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(r).catch(c=>{throw c.setCorrelationId(this.correlationId),o.cacheFailedRequest(c),c})}logout(){return Promise.reject(ie(gu))}async createRefreshTokenClient(e){const t=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,this.correlationId)({serverTelemetryManager:e.serverTelemetryManager,requestAuthority:e.authorityUrl,requestAzureCloudOptions:e.azureCloudOptions,requestExtraQueryParameters:e.extraQueryParameters,account:e.account});return new of(t,this.performanceClient)}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class s${constructor(e,t,r,o){this.isBrowserEnvironment=typeof window<"u",this.config=e,this.storage=t,this.logger=r,this.cryptoObj=o}loadExternalTokens(e,t,r){if(!this.isBrowserEnvironment)throw ie(pu);const o=t.id_token?Si(t.id_token,Kr):void 0,a={protocolMode:this.config.auth.protocolMode,knownAuthorities:this.config.auth.knownAuthorities,cloudDiscoveryMetadata:this.config.auth.cloudDiscoveryMetadata,authorityMetadata:this.config.auth.authorityMetadata,skipAuthorityMetadataCache:this.config.auth.skipAuthorityMetadataCache},c=e.authority?new Xt(Xt.generateAuthority(e.authority,e.azureCloudOptions),this.config.system.networkClient,this.storage,a,this.logger,e.correlationId||go()):void 0,d=this.loadAccount(e,r.clientInfo||t.client_info||"",o,c),h=this.loadIdToken(t,d.homeAccountId,d.environment,d.realm),m=this.loadAccessToken(e,t,d.homeAccountId,d.environment,d.realm,r),g=this.loadRefreshToken(t,d.homeAccountId,d.environment);return this.generateAuthenticationResult(e,{account:d,idToken:h,accessToken:m,refreshToken:g},o,c)}loadAccount(e,t,r,o){if(this.logger.verbose("TokenCache - loading account"),e.account){const h=Pt.createFromAccountInfo(e.account);return this.storage.setAccount(h),h}else if(!o||!t&&!r)throw this.logger.error("TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."),ie(lT);const a=Pt.generateHomeAccountId(t,o.authorityType,this.logger,this.cryptoObj,r),c=r==null?void 0:r.tid,d=fm(this.storage,o,a,Kr,r,t,o.hostnameAndPort,c,void 0,void 0,this.logger);return this.storage.setAccount(d),d}loadIdToken(e,t,r,o){if(!e.id_token)return this.logger.verbose("TokenCache - no id token found in response"),null;this.logger.verbose("TokenCache - loading id token");const a=cu(t,r,e.id_token,this.config.auth.clientId,o);return this.storage.setIdTokenCredential(a),a}loadAccessToken(e,t,r,o,a,c){if(t.access_token)if(t.expires_in){if(!t.scope&&(!e.scopes||!e.scopes.length))return this.logger.error("TokenCache - scopes not specified in the request or response. Cannot add token to the cache."),null}else return this.logger.error("TokenCache - no expiration set on the access token. Cannot add it to the cache."),null;else return this.logger.verbose("TokenCache - no access token found in response"),null;this.logger.verbose("TokenCache - loading access token");const d=t.scope?_t.fromString(t.scope):new _t(e.scopes),h=c.expiresOn||t.expires_in+new Date().getTime()/1e3,m=c.extendedExpiresOn||(t.ext_expires_in||t.expires_in)+new Date().getTime()/1e3,g=lu(r,o,t.access_token,this.config.auth.clientId,a,d.printScopes(),h,m,Kr);return this.storage.setAccessTokenCredential(g),g}loadRefreshToken(e,t,r){if(!e.refresh_token)return this.logger.verbose("TokenCache - no refresh token found in response"),null;this.logger.verbose("TokenCache - loading refresh token");const o=_w(t,r,e.refresh_token,this.config.auth.clientId,e.foci,void 0,e.refresh_token_expires_in);return this.storage.setRefreshTokenCredential(o),o}generateAuthenticationResult(e,t,r,o){var g,_,p;let a="",c=[],d=null,h;t!=null&&t.accessToken&&(a=t.accessToken.secret,c=_t.fromString(t.accessToken.target).asArray(),d=new Date(Number(t.accessToken.expiresOn)*1e3),h=new Date(Number(t.accessToken.extendedExpiresOn)*1e3));const m=t.account;return{authority:o?o.canonicalAuthority:"",uniqueId:t.account.localAccountId,tenantId:t.account.realm,scopes:c,account:m.getAccountInfo(),idToken:((g=t.idToken)==null?void 0:g.secret)||"",idTokenClaims:r||{},accessToken:a,fromCache:!0,expiresOn:d,correlationId:e.correlationId||"",requestId:"",extExpiresOn:h,familyId:((_=t.refreshToken)==null?void 0:_.familyId)||"",tokenType:((p=t==null?void 0:t.accessToken)==null?void 0:p.tokenType)||"",state:e.state||"",cloudGraphHostName:m.cloudGraphHostName||"",msGraphHost:m.msGraphHost||"",fromNativeBroker:!1}}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class c$ extends Kw{constructor(e){super(e),this.includeRedirectUri=!1}}/*! @azure/msal-browser v3.28.1 2025-01-14 */class l$ extends Da{constructor(e,t,r,o,a,c,d,h,m,g){super(e,t,r,o,a,c,h,m,g),this.apiId=d}async acquireToken(e){if(!e.code)throw ie(uT);const t=await Q(this.initializeAuthorizationRequest.bind(this),x.StandardInteractionClientInitializeAuthorizationRequest,this.logger,this.performanceClient,e.correlationId)(e,le.Silent),r=this.initializeServerTelemetryManager(this.apiId);try{const o={...t,code:e.code},a=await Q(this.getClientConfiguration.bind(this),x.StandardInteractionClientGetClientConfiguration,this.logger,this.performanceClient,e.correlationId)({serverTelemetryManager:r,requestAuthority:t.authority,requestAzureCloudOptions:t.azureCloudOptions,requestExtraQueryParameters:t.extraQueryParameters,account:t.account}),c=new c$(a);this.logger.verbose("Auth code client created");const d=new Nm(c,this.browserStorage,o,this.logger,this.performanceClient);return await Q(d.handleCodeResponseFromServer.bind(d),x.HandleCodeResponseFromServer,this.logger,this.performanceClient,e.correlationId)({code:e.code,msgraph_host:e.msGraphHost,cloud_graph_host_name:e.cloudGraphHostName,cloud_instance_host_name:e.cloudInstanceHostName},t,!1)}catch(o){throw o instanceof lt&&(o.setCorrelationId(this.correlationId),r.cacheFailedRequest(o)),o}}logout(){return Promise.reject(ie(gu))}}/*! @azure/msal-browser v3.28.1 2025-01-14 */function Dr(n){const e=n==null?void 0:n.idTokenClaims;if(e!=null&&e.tfp||e!=null&&e.acr)return"B2C";if(e!=null&&e.tid){if((e==null?void 0:e.tid)==="9188040d-6c67-4c5b-b112-36a304b66dad")return"MSA"}else return;return"AAD"}function Qc(n,e){try{Sm(n)}catch(t){throw e.end({success:!1},t),t}}class yu{constructor(e){this.operatingContext=e,this.isBrowserEnvironment=this.operatingContext.isBrowserEnvironment(),this.config=e.getConfig(),this.initialized=!1,this.logger=this.operatingContext.getLogger(),this.networkClient=this.config.system.networkClient,this.navigationClient=this.config.system.navigationClient,this.redirectResponse=new Map,this.hybridAuthCodeResponses=new Map,this.performanceClient=this.config.telemetry.client,this.browserCrypto=this.isBrowserEnvironment?new Sa(this.logger,this.performanceClient):Ol,this.eventHandler=new LH(this.logger),this.browserStorage=this.isBrowserEnvironment?new hf(this.config.auth.clientId,this.config.cache,this.browserCrypto,this.logger,T2(this.config.auth),this.performanceClient):AH(this.config.auth.clientId,this.logger);const t={cacheLocation:vn.MemoryStorage,temporaryCacheLocation:vn.MemoryStorage,storeAuthStateInCookie:!1,secureCookies:!1,cacheMigrationEnabled:!1,claimsBasedCachingEnabled:!1};this.nativeInternalStorage=new hf(this.config.auth.clientId,t,this.browserCrypto,this.logger,void 0,this.performanceClient),this.tokenCache=new s$(this.config,this.browserStorage,this.logger,this.browserCrypto),this.activeSilentTokenRequests=new Map,this.trackPageVisibility=this.trackPageVisibility.bind(this),this.trackPageVisibilityWithMeasurement=this.trackPageVisibilityWithMeasurement.bind(this),this.listeningToStorageEvents=!1,this.handleAccountCacheChange=this.handleAccountCacheChange.bind(this)}static async createController(e,t){const r=new yu(e);return await r.initialize(t),r}trackPageVisibility(e){e&&(this.logger.info("Perf: Visibility change detected"),this.performanceClient.incrementFields({visibilityChangeCount:1},e))}async initialize(e){if(this.logger.trace("initialize called"),this.initialized){this.logger.info("initialize has already been called, exiting early.");return}if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, exiting early."),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END);return}const t=(e==null?void 0:e.correlationId)||this.getRequestCorrelationId(),r=this.config.system.allowNativeBroker,o=this.performanceClient.startMeasurement(x.InitializeClientApplication,t);if(this.eventHandler.emitEvent(me.INITIALIZE_START),r)try{this.nativeExtensionProvider=await Fr.createProvider(this.logger,this.config.system.nativeBrokerHandshakeTimeout,this.performanceClient)}catch(a){this.logger.verbose(a)}this.config.cache.claimsBasedCachingEnabled||(this.logger.verbose("Claims-based caching is disabled. Clearing the previous cache with claims"),await Q(this.browserStorage.clearTokensAndKeysWithClaims.bind(this.browserStorage),x.ClearTokensAndKeysWithClaims,this.logger,this.performanceClient,t)(this.performanceClient,t)),this.initialized=!0,this.eventHandler.emitEvent(me.INITIALIZE_END),o.end({allowNativeBroker:r,success:!0})}async handleRedirectPromise(e){if(this.logger.verbose("handleRedirectPromise called"),kT(this.initialized),this.isBrowserEnvironment){const t=e||"";let r=this.redirectResponse.get(t);return typeof r>"u"?(r=this.handleRedirectPromiseInternal(e),this.redirectResponse.set(t,r),this.logger.verbose("handleRedirectPromise has been called for the first time, storing the promise")):this.logger.verbose("handleRedirectPromise has been called previously, returning the result from the first call"),r}return this.logger.verbose("handleRedirectPromise returns null, not browser environment"),null}async handleRedirectPromiseInternal(e){const t=this.getAllAccounts(),r=this.browserStorage.getCachedNativeRequest(),o=r&&Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider)&&this.nativeExtensionProvider&&!e,a=o?r==null?void 0:r.correlationId:this.browserStorage.getTemporaryCache(Ke.CORRELATION_ID,!0)||"",c=this.performanceClient.startMeasurement(x.AcquireTokenRedirect,a);this.eventHandler.emitEvent(me.HANDLE_REDIRECT_START,le.Redirect);let d;if(o&&this.nativeExtensionProvider){this.logger.trace("handleRedirectPromise - acquiring token from native platform");const h=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.handleRedirectPromise,this.performanceClient,this.nativeExtensionProvider,r.accountId,this.nativeInternalStorage,r.correlationId);d=Q(h.handleRedirectPromise.bind(h),x.HandleNativeRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(this.performanceClient,c.event.correlationId)}else{this.logger.trace("handleRedirectPromise - acquiring token from web flow");const h=this.createRedirectClient(a);d=Q(h.handleRedirectPromise.bind(h),x.HandleRedirectPromiseMeasurement,this.logger,this.performanceClient,c.event.correlationId)(e,c)}return d.then(h=>(h?(t.length<this.getAllAccounts().length?(this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, login success")):(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Redirect,h),this.logger.verbose("handleRedirectResponse returned result, acquire token success")),c.end({success:!0,accountType:Dr(h.account)})):c.event.errorCode?c.end({success:!1}):c.discard(),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),h)).catch(h=>{const m=h;throw t.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,m):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,m),this.eventHandler.emitEvent(me.HANDLE_REDIRECT_END,le.Redirect),c.end({success:!1},m),h})}async acquireTokenRedirect(e){const t=this.getRequestCorrelationId(e);this.logger.verbose("acquireTokenRedirect called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenPreRedirect,t);r.add({accountType:Dr(e.account),scenarioId:e.scenarioId});const o=e.onRedirectNavigate;if(o)e.onRedirectNavigate=c=>{const d=typeof o=="function"?o(c):void 0;return d!==!1?r.end({success:!0}):r.discard(),d};else{const c=this.config.auth.onRedirectNavigate;this.config.auth.onRedirectNavigate=d=>{const h=typeof c=="function"?c(d):void 0;return h!==!1?r.end({success:!0}):r.discard(),h}}const a=this.getAllAccounts().length>0;try{dy(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Redirect,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Redirect,e);let c;return this.nativeExtensionProvider&&this.canUseNative(e)?c=new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenRedirect,this.performanceClient,this.nativeExtensionProvider,this.getNativeAccountId(e),this.nativeInternalStorage,t).acquireTokenRedirect(e,r).catch(h=>{if(h instanceof Br&&sa(h))return this.nativeExtensionProvider=void 0,this.createRedirectClient(t).acquireToken(e);if(h instanceof wr)return this.logger.verbose("acquireTokenRedirect - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createRedirectClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),h}):c=this.createRedirectClient(t).acquireToken(e),await c}catch(c){throw r.end({success:!1},c),a?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Redirect,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Redirect,null,c),c}}acquireTokenPopup(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenPopup,t);r.add({scenarioId:e.scenarioId,accountType:Dr(e.account)});try{this.logger.verbose("acquireTokenPopup called",t),Qc(this.initialized,r),this.browserStorage.setInteractionInProgress(!0)}catch(c){return Promise.reject(c)}const o=this.getAllAccounts();o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Popup,e):this.eventHandler.emitEvent(me.LOGIN_START,le.Popup,e);let a;return this.canUseNative(e)?a=this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenPopup).then(c=>(this.browserStorage.setInteractionInProgress(!1),r.end({success:!0,isNativeBroker:!0,accountType:Dr(c.account)}),c)).catch(c=>{if(c instanceof Br&&sa(c))return this.nativeExtensionProvider=void 0,this.createPopupClient(t).acquireToken(e);if(c instanceof wr)return this.logger.verbose("acquireTokenPopup - Resolving interaction required error thrown by native broker by falling back to web flow"),this.createPopupClient(t).acquireToken(e);throw this.browserStorage.setInteractionInProgress(!1),c}):a=this.createPopupClient(t).acquireToken(e),a.then(c=>(o.length<this.getAllAccounts().length?this.eventHandler.emitEvent(me.LOGIN_SUCCESS,le.Popup,c):this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Popup,c),r.end({success:!0,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>(o.length>0?this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Popup,null,c):this.eventHandler.emitEvent(me.LOGIN_FAILURE,le.Popup,null,c),r.end({success:!1},c),Promise.reject(c)))}trackPageVisibilityWithMeasurement(){const e=this.ssoSilentMeasurement||this.acquireTokenByCodeAsyncMeasurement;e&&(this.logger.info("Perf: Visibility change detected in ",e.event.name),e.increment({visibilityChangeCount:1}))}async ssoSilent(e){var a,c;const t=this.getRequestCorrelationId(e),r={...e,prompt:e.prompt,correlationId:t};this.ssoSilentMeasurement=this.performanceClient.startMeasurement(x.SsoSilent,t),(a=this.ssoSilentMeasurement)==null||a.add({scenarioId:e.scenarioId,accountType:Dr(e.account)}),Qc(this.initialized,this.ssoSilentMeasurement),(c=this.ssoSilentMeasurement)==null||c.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),this.logger.verbose("ssoSilent called",t),this.eventHandler.emitEvent(me.SSO_SILENT_START,le.Silent,r);let o;return this.canUseNative(r)?o=this.acquireTokenNative(r,ot.ssoSilent).catch(d=>{if(d instanceof Br&&sa(d))return this.nativeExtensionProvider=void 0,this.createSilentIframeClient(r.correlationId).acquireToken(r);throw d}):o=this.createSilentIframeClient(r.correlationId).acquireToken(r),o.then(d=>{var h;return this.eventHandler.emitEvent(me.SSO_SILENT_SUCCESS,le.Silent,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!0,isNativeBroker:d.fromNativeBroker,accessTokenSize:d.accessToken.length,idTokenSize:d.idToken.length,accountType:Dr(d.account)}),d}).catch(d=>{var h;throw this.eventHandler.emitEvent(me.SSO_SILENT_FAILURE,le.Silent,null,d),(h=this.ssoSilentMeasurement)==null||h.end({success:!1},d),d}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenByCode(e){const t=this.getRequestCorrelationId(e);this.logger.trace("acquireTokenByCode called",t);const r=this.performanceClient.startMeasurement(x.AcquireTokenByCode,t);Qc(this.initialized,r),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_START,le.Silent,e),r.add({scenarioId:e.scenarioId});try{if(e.code&&e.nativeAccountId)throw ie(hT);if(e.code){const o=e.code;let a=this.hybridAuthCodeResponses.get(o);return a?(this.logger.verbose("Existing acquireTokenByCode request found",t),r.discard()):(this.logger.verbose("Initiating new acquireTokenByCode request",t),a=this.acquireTokenByCodeAsync({...e,correlationId:t}).then(c=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_SUCCESS,le.Silent,c),this.hybridAuthCodeResponses.delete(o),r.end({success:!0,isNativeBroker:c.fromNativeBroker,accessTokenSize:c.accessToken.length,idTokenSize:c.idToken.length,accountType:Dr(c.account)}),c)).catch(c=>{throw this.hybridAuthCodeResponses.delete(o),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,c),r.end({success:!1},c),c}),this.hybridAuthCodeResponses.set(o,a)),await a}else if(e.nativeAccountId)if(this.canUseNative(e,e.nativeAccountId)){const o=await this.acquireTokenNative({...e,correlationId:t},ot.acquireTokenByCode,e.nativeAccountId).catch(a=>{throw a instanceof Br&&sa(a)&&(this.nativeExtensionProvider=void 0),a});return r.end({accountType:Dr(o.account),success:!0}),o}else throw ie(fT);else throw ie(dT)}catch(o){throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_BY_CODE_FAILURE,le.Silent,null,o),r.end({success:!1},o),o}}async acquireTokenByCodeAsync(e){var o;return this.logger.trace("acquireTokenByCodeAsync called",e.correlationId),this.acquireTokenByCodeAsyncMeasurement=this.performanceClient.startMeasurement(x.AcquireTokenByCodeAsync,e.correlationId),(o=this.acquireTokenByCodeAsyncMeasurement)==null||o.increment({visibilityChangeCount:0}),document.addEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement),await this.createSilentAuthCodeClient(e.correlationId).acquireToken(e).then(a=>{var c;return(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!0,fromCache:a.fromCache,isNativeBroker:a.fromNativeBroker}),a}).catch(a=>{var c;throw(c=this.acquireTokenByCodeAsyncMeasurement)==null||c.end({success:!1},a),a}).finally(()=>{document.removeEventListener("visibilitychange",this.trackPageVisibilityWithMeasurement)})}async acquireTokenFromCache(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenFromCache,e.correlationId),t){case Pn.Default:case Pn.AccessToken:case Pn.AccessTokenAndRefreshToken:const r=this.createSilentCacheClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentCacheClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenByRefreshToken(e,t){switch(this.performanceClient.addQueueMeasurement(x.AcquireTokenByRefreshToken,e.correlationId),t){case Pn.Default:case Pn.AccessTokenAndRefreshToken:case Pn.RefreshToken:case Pn.RefreshTokenAndNetwork:const r=this.createSilentRefreshClient(e.correlationId);return Q(r.acquireToken.bind(r),x.SilentRefreshClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e);default:throw Y(co)}}async acquireTokenBySilentIframe(e){this.performanceClient.addQueueMeasurement(x.AcquireTokenBySilentIframe,e.correlationId);const t=this.createSilentIframeClient(e.correlationId);return Q(t.acquireToken.bind(t),x.SilentIframeClientAcquireToken,this.logger,this.performanceClient,e.correlationId)(e)}async logout(e){const t=this.getRequestCorrelationId(e);return this.logger.warning("logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.",t),this.logoutRedirect({correlationId:t,...e})}async logoutRedirect(e){const t=this.getRequestCorrelationId(e);return dy(this.initialized,this.config),this.browserStorage.setInteractionInProgress(!0),this.createRedirectClient(t).logout(e)}logoutPopup(e){try{const t=this.getRequestCorrelationId(e);return Sm(this.initialized),this.browserStorage.setInteractionInProgress(!0),this.createPopupClient(t).logout(e)}catch(t){return Promise.reject(t)}}async clearCache(e){if(!this.isBrowserEnvironment){this.logger.info("in non-browser environment, returning early.");return}const t=this.getRequestCorrelationId(e);return this.createSilentCacheClient(t).logout(e)}getAllAccounts(e){return kH(this.logger,this.browserStorage,this.isBrowserEnvironment,e)}getAccount(e){return NH(e,this.logger,this.browserStorage)}getAccountByUsername(e){return RH(e,this.logger,this.browserStorage)}getAccountByHomeId(e){return OH(e,this.logger,this.browserStorage)}getAccountByLocalId(e){return PH(e,this.logger,this.browserStorage)}setActiveAccount(e){MH(e,this.browserStorage)}getActiveAccount(){return DH(this.browserStorage)}async hydrateCache(e,t){this.logger.verbose("hydrateCache called");const r=Pt.createFromAccountInfo(e.account,e.cloudGraphHostName,e.msGraphHost);return this.browserStorage.setAccount(r),e.fromNativeBroker?(this.logger.verbose("Response was from native broker, storing in-memory"),this.nativeInternalStorage.hydrateCache(e,t)):this.browserStorage.hydrateCache(e,t)}async acquireTokenNative(e,t,r){if(this.logger.trace("acquireTokenNative called"),!this.nativeExtensionProvider)throw ie(zs);return new _a(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,t,this.performanceClient,this.nativeExtensionProvider,r||this.getNativeAccountId(e),this.nativeInternalStorage,e.correlationId).acquireToken(e)}canUseNative(e,t){if(this.logger.trace("canUseNative called"),!Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme))return this.logger.trace("canUseNative: isNativeAvailable returned false, returning false"),!1;if(e.prompt)switch(e.prompt){case Bt.NONE:case Bt.CONSENT:case Bt.LOGIN:this.logger.trace("canUseNative: prompt is compatible with native flow");break;default:return this.logger.trace(`canUseNative: prompt = ${e.prompt} is not compatible with native flow, returning false`),!1}return!t&&!this.getNativeAccountId(e)?(this.logger.trace("canUseNative: nativeAccountId is not available, returning false"),!1):!0}getNativeAccountId(e){const t=e.account||this.getAccount({loginHint:e.loginHint,sid:e.sid})||this.getActiveAccount();return t&&t.nativeAccountId||""}createPopupClient(e){return new QH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createRedirectClient(e){return new ZH(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentIframeClient(e){return new i$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.ssoSilent,this.performanceClient,this.nativeInternalStorage,this.nativeExtensionProvider,e)}createSilentCacheClient(e){return new MT(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentRefreshClient(e){return new a$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,this.performanceClient,this.nativeExtensionProvider,e)}createSilentAuthCodeClient(e){return new l$(this.config,this.browserStorage,this.browserCrypto,this.logger,this.eventHandler,this.navigationClient,ot.acquireTokenByCode,this.performanceClient,this.nativeExtensionProvider,e)}addEventCallback(e,t){return this.eventHandler.addEventCallback(e,t)}removeEventCallback(e){this.eventHandler.removeEventCallback(e)}addPerformanceCallback(e){return AT(),this.performanceClient.addPerformanceCallback(e)}removePerformanceCallback(e){return this.performanceClient.removePerformanceCallback(e)}enableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?this.logger.verbose("Account storage listener already registered."):(this.logger.verbose("Adding account storage listener."),this.listeningToStorageEvents=!0,window.addEventListener("storage",this.handleAccountCacheChange)))}disableAccountStorageEvents(){typeof window>"u"||(this.listeningToStorageEvents?(this.logger.verbose("Removing account storage listener."),window.removeEventListener("storage",this.handleAccountCacheChange),this.listeningToStorageEvents=!1):this.logger.verbose("No account storage listener registered."))}handleAccountCacheChange(e){var t;try{(t=e.key)!=null&&t.includes(Lt.ACTIVE_ACCOUNT_FILTERS)&&this.eventHandler.emitEvent(me.ACTIVE_ACCOUNT_CHANGED);const r=e.newValue||e.oldValue;if(!r)return;const o=JSON.parse(r);if(typeof o!="object"||!Pt.isAccountEntity(o))return;const c=ba.toObject(new Pt,o).getAccountInfo();!e.oldValue&&e.newValue?(this.logger.info("Account was added to cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_ADDED,void 0,c)):!e.newValue&&e.oldValue&&(this.logger.info("Account was removed from cache in a different window"),this.eventHandler.emitEvent(me.ACCOUNT_REMOVED,void 0,c))}catch{return}}getTokenCache(){return this.tokenCache}getLogger(){return this.logger}setLogger(e){this.logger=e}initializeWrapperLibrary(e,t){this.browserStorage.setWrapperMetadata(e,t)}setNavigationClient(e){this.navigationClient=e}getConfiguration(){return this.config}getPerformanceClient(){return this.performanceClient}isBrowserEnv(){return this.isBrowserEnvironment}getRequestCorrelationId(e){return e!=null&&e.correlationId?e.correlationId:this.isBrowserEnvironment?go():F.EMPTY_STRING}async loginRedirect(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginRedirect called",t),this.acquireTokenRedirect({correlationId:t,...e||cy})}loginPopup(e){const t=this.getRequestCorrelationId(e);return this.logger.verbose("loginPopup called",t),this.acquireTokenPopup({correlationId:t,...e||cy})}async acquireTokenSilent(e){const t=this.getRequestCorrelationId(e),r=this.performanceClient.startMeasurement(x.AcquireTokenSilent,t);r.add({cacheLookupPolicy:e.cacheLookupPolicy,scenarioId:e.scenarioId}),Qc(this.initialized,r),this.logger.verbose("acquireTokenSilent called",t);const o=e.account||this.getActiveAccount();if(!o)throw ie(oT);r.add({accountType:Dr(o)});const a={clientId:this.config.auth.clientId,authority:e.authority||F.EMPTY_STRING,scopes:e.scopes,homeAccountIdentifier:o.homeAccountId,claims:e.claims,authenticationScheme:e.authenticationScheme,resourceRequestMethod:e.resourceRequestMethod,resourceRequestUri:e.resourceRequestUri,shrClaims:e.shrClaims,sshKid:e.sshKid,shrOptions:e.shrOptions},c=JSON.stringify(a),d=this.activeSilentTokenRequests.get(c);if(typeof d>"u"){this.logger.verbose("acquireTokenSilent called for the first time, storing active request",t);const h=Q(this.acquireTokenSilentAsync.bind(this),x.AcquireTokenSilentAsync,this.logger,this.performanceClient,t)({...e,correlationId:t},o).then(m=>(this.activeSilentTokenRequests.delete(c),r.end({success:!0,fromCache:m.fromCache,isNativeBroker:m.fromNativeBroker,cacheLookupPolicy:e.cacheLookupPolicy,accessTokenSize:m.accessToken.length,idTokenSize:m.idToken.length}),m)).catch(m=>{throw this.activeSilentTokenRequests.delete(c),r.end({success:!1},m),m});return this.activeSilentTokenRequests.set(c,h),{...await h,state:e.state}}else return this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call",t),r.discard(),{...await d,state:e.state}}async acquireTokenSilentAsync(e,t){const r=()=>this.trackPageVisibility(e.correlationId);this.performanceClient.addQueueMeasurement(x.AcquireTokenSilentAsync,e.correlationId),this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_START,le.Silent,e),e.correlationId&&this.performanceClient.incrementFields({visibilityChangeCount:0},e.correlationId),document.addEventListener("visibilitychange",r);const o=await Q(VH,x.InitializeSilentRequest,this.logger,this.performanceClient,e.correlationId)(e,t,this.config,this.performanceClient,this.logger),a=e.cacheLookupPolicy||Pn.Default;return this.acquireTokenSilentNoIframe(o,a).catch(async d=>{if(u$(d,a))if(this.activeIframeRequest)if(a!==Pn.Skip){const[m,g]=this.activeIframeRequest;this.logger.verbose(`Iframe request is already in progress, awaiting resolution for request with correlationId: ${g}`,o.correlationId);const _=this.performanceClient.startMeasurement(x.AwaitConcurrentIframe,o.correlationId);_.add({awaitIframeCorrelationId:g});const p=await m;if(_.end({success:p}),p)return this.logger.verbose(`Parallel iframe request with correlationId: ${g} succeeded. Retrying cache and/or RT redemption`,o.correlationId),this.acquireTokenSilentNoIframe(o,a);throw this.logger.info(`Iframe request with correlationId: ${g} failed. Interaction is required.`),d}else return this.logger.warning("Another iframe request is currently in progress and CacheLookupPolicy is set to Skip. This may result in degraded performance and/or reliability for both calls. Please consider changing the CacheLookupPolicy to take advantage of request queuing and token cache.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o);else{let m;return this.activeIframeRequest=[new Promise(g=>{m=g}),o.correlationId],this.logger.verbose("Refresh token expired/invalid or CacheLookupPolicy is set to Skip, attempting acquire token by iframe.",o.correlationId),Q(this.acquireTokenBySilentIframe.bind(this),x.AcquireTokenBySilentIframe,this.logger,this.performanceClient,o.correlationId)(o).then(g=>(m(!0),g)).catch(g=>{throw m(!1),g}).finally(()=>{this.activeIframeRequest=void 0})}else throw d}).then(d=>(this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_SUCCESS,le.Silent,d),e.correlationId&&this.performanceClient.addFields({fromCache:d.fromCache,isNativeBroker:d.fromNativeBroker},e.correlationId),d)).catch(d=>{throw this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_FAILURE,le.Silent,null,d),d}).finally(()=>{document.removeEventListener("visibilitychange",r)})}async acquireTokenSilentNoIframe(e,t){return Fr.isNativeAvailable(this.config,this.logger,this.nativeExtensionProvider,e.authenticationScheme)&&e.account.nativeAccountId?(this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform"),this.acquireTokenNative(e,ot.acquireTokenSilent_silentFlow).catch(async r=>{throw r instanceof Br&&sa(r)?(this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow"),this.nativeExtensionProvider=void 0,Y(co)):r})):(this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow"),Q(this.acquireTokenFromCache.bind(this),x.AcquireTokenFromCache,this.logger,this.performanceClient,e.correlationId)(e,t).catch(r=>{if(t===Pn.AccessToken)throw r;return this.eventHandler.emitEvent(me.ACQUIRE_TOKEN_NETWORK_START,le.Silent,e),Q(this.acquireTokenByRefreshToken.bind(this),x.AcquireTokenByRefreshToken,this.logger,this.performanceClient,e.correlationId)(e,t)}))}}function u$(n,e){const t=!(n instanceof wr&&n.subError!==fu),r=n.errorCode===Dn.INVALID_GRANT_ERROR||n.errorCode===co,o=t&&r||n.errorCode===xl||n.errorCode===hm,a=q2.includes(e);return o&&a}/*! @azure/msal-browser v3.28.1 2025-01-14 */async function d$(n,e){const t=new Ii(n);return await t.initialize(),yu.createController(t,e)}/*! @azure/msal-browser v3.28.1 2025-01-14 */class Rm{static async createPublicClientApplication(e){const t=await d$(e);return new Rm(e,t)}constructor(e,t){this.controller=t||new yu(new Ii(e))}async initialize(e){return this.controller.initialize(e)}async acquireTokenPopup(e){return this.controller.acquireTokenPopup(e)}acquireTokenRedirect(e){return this.controller.acquireTokenRedirect(e)}acquireTokenSilent(e){return this.controller.acquireTokenSilent(e)}acquireTokenByCode(e){return this.controller.acquireTokenByCode(e)}addEventCallback(e,t){return this.controller.addEventCallback(e,t)}removeEventCallback(e){return this.controller.removeEventCallback(e)}addPerformanceCallback(e){return this.controller.addPerformanceCallback(e)}removePerformanceCallback(e){return this.controller.removePerformanceCallback(e)}enableAccountStorageEvents(){this.controller.enableAccountStorageEvents()}disableAccountStorageEvents(){this.controller.disableAccountStorageEvents()}getAccount(e){return this.controller.getAccount(e)}getAccountByHomeId(e){return this.controller.getAccountByHomeId(e)}getAccountByLocalId(e){return this.controller.getAccountByLocalId(e)}getAccountByUsername(e){return this.controller.getAccountByUsername(e)}getAllAccounts(e){return this.controller.getAllAccounts(e)}handleRedirectPromise(e){return this.controller.handleRedirectPromise(e)}loginPopup(e){return this.controller.loginPopup(e)}loginRedirect(e){return this.controller.loginRedirect(e)}logout(e){return this.controller.logout(e)}logoutRedirect(e){return this.controller.logoutRedirect(e)}logoutPopup(e){return this.controller.logoutPopup(e)}ssoSilent(e){return this.controller.ssoSilent(e)}getTokenCache(){return this.controller.getTokenCache()}getLogger(){return this.controller.getLogger()}setLogger(e){this.controller.setLogger(e)}setActiveAccount(e){this.controller.setActiveAccount(e)}getActiveAccount(){return this.controller.getActiveAccount()}initializeWrapperLibrary(e,t){return this.controller.initializeWrapperLibrary(e,t)}setNavigationClient(e){this.controller.setNavigationClient(e)}getConfiguration(){return this.controller.getConfiguration()}async hydrateCache(e,t){return this.controller.hydrateCache(e,t)}clearCache(e){return this.controller.clearCache(e)}}const dh=process.env.JPLAN_WEBAPP__APP_PROXY_TENANT_NAME??"",h$=process.env.JPLAN_WEBAPP__APP_PROXY_CLIENT_ID??"",f$=process.env.JPLAN_WEBAPP__APP_PROXY_USER_FLOW??"",mf=process.env.JPLAN_WEBAPP__URL_AUTH??process.env.JPLAN_WEBAPP__URL_BASE??"",m$={auth:{clientId:h$,authority:`https://${dh}.b2clogin.com/${dh}.onmicrosoft.com/${f$}`,knownAuthorities:[`${dh}.b2clogin.com`],redirectUri:process.env.JPLAN_AUTOMATION_ENVIRONMENT?`${mf}/_/dashboard`:mf},cache:{cacheLocation:"localStorage",storeAuthStateInCookie:!1},system:{loggerOptions:{loggerCallback:(n,e)=>{n===tt.Error&&console.error(e)},logLevel:tt.Warning}}},xT=(n,e)=>({scopes:["https://graph.microsoft.com/.default","openid","profile"],redirectStartPage:`${mf}${n}`,extraQueryParameters:e}),Gt=new Rm(m$),py=l.ref(null);function UT(){async function n(e){var t;if(e)try{const r=e.idTokenClaims;if(!(r!=null&&r.aud))throw new Error("User audience (aud) is missing in ID token claims");const o=localStorage.getItem(`msal.token.keys.${r.aud}`);if(!o)throw new Error(`Token keys para ${r.aud} não encontrados no localStorage`);const a=JSON.parse(o),c=(t=a==null?void 0:a.idToken)==null?void 0:t[0];if(!c)throw new Error("idToken não encontrado nos token keys");const d=localStorage.getItem(c);if(!d)throw new Error(`Dados do token para ID ${c} não encontrados no localStorage`);const h=JSON.parse(d),m=h==null?void 0:h.secret;if(!m)throw new Error("Secret não encontrado nos dados do token");sessionStorage.setItem("isAuthenticated","true"),py.value=m}catch(r){console.error("Erro ao obter token de acesso:",r)}}return{jToken:py,setJToken:n}}let Xc=null;const tr=l.ref(null),Ji=l.ref(null),BT=l.ref(Math.floor(Date.now()/1e3));gf.useIntervalFn(()=>g$(),1e3);function g$(){var r,o;if(!((o=(r=tr.value)==null?void 0:r.idTokenClaims)!=null&&o.exp))return;const n=Math.floor(Date.now()/1e3),e=300,t=tr.value.idTokenClaims.exp;BT.value=t-n-e}function Om(){if(Xc)return Xc;const{setJToken:n,jToken:e}=UT(),t=l.computed(()=>!!tr.value),r=l.computed(()=>tr.value);let o;async function a(p,w){if(!t.value)switch(p){case"redirect":w&&(o=w,await h());break;case"tab":default:await c();break}}const c=async()=>new Promise((p,w)=>{try{localStorage.clear();const C=process.env.JPLAN_WEBAPP__URL_AUTH,T=window.open(C);if(!T){console.error("Failed to open authentication window"),w("Failed to open authentication window");return}const k=Date.now(),I=6e4,N=setInterval(()=>{if(Date.now()-k>I||T.closed){clearInterval(N),console.error("Authentication canceled or timeout reached."),w("Authentication canceled or timeout reached.");return}Object.keys(localStorage).some(L=>L.startsWith("msal.account.keys"))&&(clearInterval(N),d(),T.close(),p())},500)}catch(C){console.error("Error in handleRedirect:",C),w(C)}}),d=async()=>{try{await Gt.initialize();const p=Gt.getActiveAccount();if(p)tr.value=p;else{const w=await Gt.handleRedirectPromise();w?(Gt.setActiveAccount(w.account),tr.value=Gt.getActiveAccount()):console.error("Falha na autenticação")}}catch(p){console.error("Erro no processo de autenticação:",p)}tr.value&&await n(tr.value)},h=async()=>{try{await Gt.initialize();const p=await Gt.handleRedirectPromise();if(!p||Gt.getAllAccounts().length===0){const w=xT(o);await Gt.loginRedirect(w);return}Gt.setActiveAccount(p.account),tr.value=Gt.getActiveAccount(),tr.value&&await n(tr.value),Ji.value="updated"}catch(p){console.error("handleRedirect failed",p)}};async function m(){ve.value=!0,Ji.value="updating";try{const p=await Gt.acquireTokenSilent({scopes:["https://graph.microsoft.com/.default","openid","profile"]});Gt.setActiveAccount(p.account),await n(tr.value),Ji.value="updated"}catch(p){console.error("Failed to refresh token, forcing new login.",p),Ji.value="error",localStorage.clear(),window.location.reload()}ve.value=!1}const g=async()=>{try{await Gt.initialize(),localStorage.clear(),await Gt.logoutRedirect({postLogoutRedirectUri:"/"})}catch(p){console.error("Logout error",p)}};l.watch(BT,async p=>{p<=0&&Ji.value==="updated"&&await m()});const _=l.computed(()=>e.value);return Xc={isAuthenticated:t,authState:Ji,account:r,token:_,refreshToken:m,handleRedirect:a,logout:g},Xc}const{jToken:_y}=UT(),Pm=()=>{const{toast:n}=uC(),e=yt.create({headers:{"Content-Type":"application/json"}});function t(c,d){const h={url:c.url||"",method:(c.method||"get").toUpperCase(),status:(d==null?void 0:d.status)||0};return{success:m=>n.server.success(m,h),error:m=>n.server.error(m,h),warning:m=>n.server.warning(m,h),info:m=>n.server.info(m,h)}}l.watch(_y,c=>{e.interceptors.request.use(d=>(c&&(d.headers.Authorization=`Bearer ${c}`),d))},{immediate:!0});let r=1;e.interceptors.response.use(c=>(c.notify=t(c.config,c),c),async c=>{var d;if(c.config&&(c.notify=t(c.config,c.response)),c.config&&c.config.headers){const h=c.config;if(((d=c.response)==null?void 0:d.status)===401&&r>0){r--;try{return h.headers.Authorization=`Bearer ${_y.value}`,await e(h)}catch(m){return Promise.reject(m)}}}return Promise.reject(c)});async function o({url:c,method:d,header:h={},body:m,baseURL:g}){return g&&(e.defaults.baseURL=g),e({url:c,method:d,headers:h,data:m})}async function a({url:c,method:d,header:h,body:m,baseURL:g}){return g&&(e.defaults.baseURL=g),e({url:c,method:d,headers:h,data:m})}return Object.assign(e,{_request:o,rawRequest:a})},{request:vy}=Pm(),yy=l.ref(null),Cy=l.ref("default"),hh=l.ref(null),fh=l.ref({scope_type:"org"});function Cu(){var _,p;const{handleRedirect:n,account:e,logout:t}=Om();(p=(_=e.value)==null?void 0:_.idTokenClaims)==null||p.domain;const r=l.computed(()=>{var w,C;return{domain:(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.domain,environment:Cy.value,...fh.value}}),o=l.computed(()=>fh.value);async function a(){var w;(!e.value||!((w=e.value.idTokenClaims)!=null&&w.email))&&await n();try{await c(),await d()}catch{}}async function c(){var w,C;try{const T=(C=(w=e.value)==null?void 0:w.idTokenClaims)==null?void 0:C.email;if(!T)throw new Error("Email is undefined");const k=await vy({url:`https://api.jplan.com.br/platform/user/profile/?email=${T}`,method:"GET"});hh.value=k.data??null}catch(T){console.error("Failed to fetch user profile:",T)}}async function d(){var w;try{if(!((w=hh.value)!=null&&w.email))throw new Error("User email is undefined");const C=await vy({url:"https://api.jplan.com.br/platform/user/domain/",method:"GET"});yy.value=C.data.data??[]}catch(C){console.error("Failed to fetch user domains:",C)}}function h(w){fh.value=w}function m(w){Cy.value=w,h(r.value)}async function g(w,C){const T=xT(w,{request_domain:C});await Gt.loginRedirect(T)}return{__init__:a,user:hh,userDomains:yy,setEnv:m,setScope:h,changeDomain:g,session:r,scope:o,logout:t}}const p$={path:"/_/dashboard",component:()=>Promise.resolve().then(()=>require("./AuthRoute-k248ue31.js")),meta:{requiresAuth:!1}},_$={path:"/jplan-auth-fail",component:()=>Promise.resolve().then(()=>require("./AuthFailRoute-DHl-IhUQ.js")),meta:{requiresAuth:!1}},{isAuthenticated:Ey,handleRedirect:v$}=Om(),y$=Cu();function C$(n,e){n.addRoute(p$),n.addRoute(_$),n.beforeEach(async(t,r,o)=>{function a(d){return d.matched.some(h=>h.meta.requiresAuth)}if(!a(t))return o();if(!Ey.value){ve.value=!0;try{await v$(e,t.fullPath),await y$.__init__()}catch(d){console.error("Fail to authenticate",d),await n.push("/jplan-auth-fail")}ve.value=!1}if(Ey.value){if(localStorage.getItem("returnRoute")&&localStorage.getItem("returnRoute")!==null){const d=localStorage.getItem("returnRoute")??"/";console.log("trying to go to saved route:",d),o(d),localStorage.removeItem("returnRoute");return}o()}})}const{scope:wy}=Cu();function E$(){const n=Pm(),e=l.ref({scope_type:"org"});async function t(r){e.value=r}return l.watch(wy,()=>{n.interceptors.request.use(r=>{const o=r.headers,a=o.Authorization;a&&(o.Authorization=a);const c=wy.value;return c&&(c.scope_type&&(o["j-scope-type"]=c.scope_type,c.organization&&(o["j-scope-organization"]=c.organization),c.team&&(o["j-scope-team"]=c.team)),c.environment&&(o["j-scope-environment"]=c.environment)),r})},{immediate:!0}),Object.assign(n,{setScope:t,scope:e})}function La(n){const e=E$();e.defaults.baseURL=n;const t=l.ref({scope_type:"org"});async function r(o){t.value=o}return l.watch(t,()=>{e.interceptors.request.use(o=>{const a=t.value;return delete o.headers["j-scope-type"],delete o.headers["j-scope-organization"],delete o.headers["j-scope-team"],a!=null&&a.scope_type&&(o.headers["j-scope-type"]=a.scope_type),a!=null&&a.organization&&(o.headers["j-scope-organization"]=a.organization),a!=null&&a.team&&(o.headers["j-scope-team"]=a.team),o})},{immediate:!0}),Object.assign(e,{setScope:r,scope:t})}const Ty={enUS:{widget:"widget",spacer:"spacer"},ptBr:{widget:"widget",spacer:"Espaçador"}},Mm={"pt-BR":{placeholders:{selectFilter:"Selecionar filtro",visualize:"Visualizar",actions:"Ações",search:"Pesquisar"},dialogs:{columnSettings:{title:"Configurações de coluna"},scope:{title:"Escopo",unknown:"Desconhecido",domain:"Domínio",environment:"Ambiente",organizational:"Organizacional",organization:"Organização",team:"Time",user:"Usuário",none:"Nenhum",selectOrganization:"Selecione uma Organização",selectTeam:"Selecione um Time"}},actions:{save:"Salvar",cancel:"Cancelar",edit:"Editar",delete:"Apagar",disable:"Desabilitar",confirm:"Confirmar",back:"Voltar"},forms:{metadata:{created:"Criado",updated:"Atualizado",modified:"Modificado",delegated:"Delegado"}},$vuetify:{dataFooter:{itemsPerPageAll:"Todos",itemsPerPageText:"Itens por página:",pageText:"{0}-{1} de {2}"}},toast:{error:{create_failed:"Falha ao criar {entity}",update_failed:"Falha ao atualizar {entity}",delete_failed:"Falha ao apagar {entity}",fetch_failed:"Falha ao buscar {entity}",activate_failed:"Falha ao ativar {entity}",deactivate_failed:"Falha ao desativar {entity}",link_failed:"Falha ao vincular {entity}",unlink_failed:"Falha ao desvincular {entity}"},success:{create_success:"{entity} criado com sucesso",update_success:"{entity} atualizado com sucesso",delete_success:"{entity} apagado com sucesso",activate_success:"{entity} ativado com sucesso",deactivate_success:"{entity} desativado com sucesso",link_success:"{entity} vinculado com sucesso",unlink_success:"{entity} desvinculado com sucesso"},info:{already_linked:"{entity} já está vinculado",select_valid_item:"Selecione um item válido"}},app:{widget:Ty.ptBr}},"en-US":{placeholders:{selectFilter:"Select a filter",visualize:"Visualize",actions:"Actions",search:"Search"},dialogs:{columnSettings:{title:"Column Settings"},scope:{title:"Scope",unknown:"Unknown",domain:"Domain",environment:"Environment",organizational:"Organizational",organization:"Organization",team:"Team",user:"User",none:"None",selectOrganization:"Select a organization",selectTeam:"Select a Team"}},actions:{save:"Save",cancel:"Cancel",edit:"Edit",delete:"Delete",disable:"Disable",back:"Back",confirm:"Confirm"},forms:{metadata:{created:"Created",updated:"Updated",modified:"Modified",delegated:"Delegated"}},$vuetify:{dataFooter:{itemsPerPageAll:"All",itemsPerPageText:"Items per page:",pageText:"{0}-{1} of {2}"}},toast:{error:{create_failed:"Failed to create {entity}",update_failed:"Failed to update {entity}",delete_failed:"Failed to delete {entity}",fetch_failed:"Failed to fetch {entity}",activate_failed:"Failed to activate {entity}",deactivate_failed:"Failed to deactivate {entity}",link_failed:"Failed to link {entity}",unlink_failed:"Failed to unlink {entity}"},success:{create_success:"{entity} created successfully",update_success:"{entity} updated successfully",delete_success:"{entity} deleted successfully",activate_success:"{entity} activated successfully",deactivate_success:"{entity} deactivated successfully",link_success:"{entity} linked successfully",unlink_success:"{entity} unlinked successfully"},info:{already_linked:"{entity} is already linked",select_valid_item:"Please select a valid item"}},app:{widget:Ty.ptBr}}},w$=Object.keys(Mm),by=navigator.language,T$=w$.includes(by)?by:"pt-BR",$=Tx({locale:T$,fallbackLocale:"en-US",messages:Mm});function b$(){const n=La("https://api.jplan.com.br/management/organization"),{error:e}=ar();return{async getOrgList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getOrgList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Organization"}));return}},async createOrg(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Organization"})),a}},async updateOrg(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Organization"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Organization"})),a}},async getOrg(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Organization"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Organization"})),a}},async activateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Organization"})),a}},async deactivateOrg(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Organization"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateOrg:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Organization"})),a}}}}const xo=b$();function I$(){const n=La("https://api.jplan.com.br/management/branch/"),{error:e}=ar();return{async getBranchList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error){e($.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return o.data.data}catch(r){console.error("Error in getBranchList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async createBranch(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){console.error("Error in createBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Branch"}))}},async updateBranch(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error){e(a.data.error||$.global.t("toast.error.update_failed",{entity:"Branch"}));return}return a}catch(a){console.error("Error in updateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Branch"}))}},async getBranch(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error){e(a.data.error||$.global.t("toast.error.fetch_failed",{entity:"Branch"}));return}return a.data}catch(a){console.error("Error in getBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Branch"}))}},async activateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.activate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in activateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Branch"}))}},async deactivateBranch(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error){e(a.data.error||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}));return}}catch(a){console.error("Error in deactivateBranch:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}}}}const Uo=I$();function S$(){const n=La("https://api.jplan.com.br/management/team"),{error:e}=ar();return{async getTeamList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Team"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getTeamList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async createTeam(t){var r,o;try{const a=await n.post("/item",t);if(a.data.error)throw e($.global.t("toast.error.create_failed",{entity:"Team"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in createTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Team"})),a}},async updateTeam(t){var r,o;try{const a=await n.patch("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in updateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Team"})),a}},async getTeam(t){var r,o;try{const a=await n.get(`/item/${t}`);return a.data.error&&e($.global.t("toast.error.fetch_failed",{entity:"Team"})),a.data}catch(a){console.error("Error in getTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Team"}));return}},async activateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Team"})),a}},async deactivateTeam(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Team"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateTeam:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Team"})),a}},async getTeamUserList(t,r){try{const o=r?`?filter_query=${r}`:"",a=await n.get(`/item/${t}/user/list/${o}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data.data}catch(o){console.error("Error in getTeamUserList:",o),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async linkManageUser(t,r){try{const o=await n.post(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.link_failed",{entity:"User"})),new Error(o.data.error);return o.data}catch(o){console.error("Error in link User:",o),e($.global.t("toast.error.link_failed",{entity:"User"}));return}},async updateManageUser(t,r){try{const o=await n.patch(`/item/${t}/user/item/`,r);if(o.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(o){throw console.error("Error in update User:",o),e($.global.t("toast.error.update_failed",{entity:"User"})),o}},async getManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"",c=await n.get(`/item/${t}/user/item/${r}/${a}`);if(c.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(c.data.error);return c.data.data}catch(a){console.error("Error in getUser:",a),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async unlinkManageUser(t,r,o){try{const a=o?`?filter_query=${o}`:"";await n.delete(`/item/${t}/user/item/${r}/${a}`)}catch(a){throw console.error("Error in unlink User:",a),e($.global.t("toast.error.unlink_failed",{entity:"User"})),a}}}}const Mn=S$();let Zc=!1;const mh=l.ref(!1),jn=l.ref([]),Iy=l.ref([]),ht=l.ref(null),Qi=l.ref([]),Xi=l.ref([]),FT=()=>{const n=ar(),e=async C=>{mh.value=!0;const T=C?`_active eq true and ${C}`:"_active eq true",k=await xo.getOrgList(T);k&&(jn.value=k,Zc=!0),mh.value=!1},t=async C=>{var T;return(T=jn.value)!=null&&T.length||await e(C),jn.value};function r(C){if(!jn.value)throw new Error("Data not stored yet");const T=Pa(jn.value,C,["name","description"]);return C!==""?T:jn.value}const o=C=>{Iy.value=C},a=C=>{ht.value=Oa.cloneDeep(C)},c=async C=>await xo.getOrg(C),d=async()=>{if(ht.value!=null){const C=await xo.createOrg(ht.value);return C!=null&&C.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Organization"})),Zc&&jn.value.push(C.data)),C==null?void 0:C.data}},h=async()=>{if(ve.value=!0,ht.value&&ht.value.__id){const C=await xo.updateOrg(ht.value);if(Zc&&(C!=null&&C.data.__id)){const T=jn.value.findIndex(k=>k.__id===C.data.__id);return T!==-1?(jn.value[T]=C.data,n.success($.global.t("toast.success.update_success",{entity:"Organization"}))):n.error($.global.t("toast.error.update_failed",{entity:"Organization"})),ve.value=!1,C.data}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Organization"}))},m=async()=>{if(ve.value=!0,ht.value&&ht.value.created_at){if(await xo.deactivateOrg(ht.value.__id),Zc){const C=jn.value.findIndex(T=>{var k;return T.__id===((k=ht.value)==null?void 0:k.__id)});if(C!==-1)return jn.value.splice(C,1),ht.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Organization"}))}ve.value=!1}};async function g(C){ve.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Uo.updateBranch(T)){ve.value=!1;return}if(Qi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Branch"})),Qi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Branch"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function _(C){if(ve.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Uo.updateBranch(T)){ve.value=!1;return}const I=Qi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Qi.value.splice(I,1),ve.value=!1,Qi.value;throw new Error("Item not found to remove")}ve.value=!1}async function p(C){ve.value=!0;try{if(ht.value&&ht.value.__id){const T={...C,organization:ht.value.__id};if(!await Mn.updateTeam(T)){ve.value=!1;return}if(Xi.value.findIndex(N=>N.__id===C.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),Xi.value.push(T),T;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}}catch(T){console.error(T)}finally{ve.value=!1}}async function w(C){if(ve.value=!0,ht.value&&ht.value.__id){const T={...C,organization:null};if(!await Mn.updateTeam(T)){ve.value=!1;return}const I=Xi.value.findIndex(N=>N.__id===C.__id);if(I!==-1)return Xi.value.splice(I,1),ve.value=!1,Xi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:jn,loading:mh,columns:Iy,item:ht,filterData:r,__init__:e,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgBranches:Qi,orgTeams:Xi,linkBranch:g,unlinkBranch:_,linkTeam:p,unlinkTeam:w}};let el=!1;const Yn=l.ref([]),Sy=l.ref([]),Nt=l.ref(null),gh=l.ref(!1),Zi=l.ref([]),VT=()=>{const n=ar(),e=async p=>{gh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Mn.getTeamList(w);C&&(Yn.value=C,el=!0),gh.value=!1},t=async p=>(Yn.value.length||await e(p),Yn.value);function r(p){if(!Yn.value)throw new Error("Data not stored yet");const w=Pa(Yn.value,p,["name","description"]);return p!==""?w:Yn.value}const o=p=>{Sy.value=p},a=p=>{Nt.value=Oa.cloneDeep(p)},c=async p=>await Mn.getTeam(p),d=async()=>{if(Nt.value!=null){const p=await Mn.createTeam(Nt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Team"})),el&&Yn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Nt.value&&Nt.value.__id){const p=await Mn.updateTeam(Nt.value);if(el&&(p!=null&&p.data.__id)){const w=Yn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Yn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Team"}))):n.error($.global.t("toast.error.update_failed",{entity:"Team"})),p.data}}else n.error($.global.t("toast.error.update_failed",{entity:"Team"}))},m=async()=>{if(Nt.value&&Nt.value.created_at&&(await Mn.deactivateTeam(Nt.value.__id),el)){const p=Yn.value.findIndex(w=>{var C;return w.__id===((C=Nt.value)==null?void 0:C.__id)});if(p!==-1)return Yn.value.splice(p,1),Nt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Team"}))}};async function g(p){var w;if(ve.value=!0,(w=Nt.value)!=null&&w.__id)if(Zi.value.findIndex(T=>T.__id===p.__id)===-1)try{const T=await Mn.linkManageUser(Nt.value.__id,{team:Nt.value.__id,user:p.__id,role:"string",joined_at:"string",comments:"string"}),k=await Mn.getTeamUserList(Nt.value.__id);return k&&(Zi.value=k),n.success($.global.t("toast.success.link_success",{entity:"User"})),T}catch(T){console.error(T),n.error($.global.t("toast.error.link_failed",{entity:"User"}))}finally{ve.value=!1}else n.info($.global.t("toast.info.already_linked",{entity:"User"}));else console.warn("No item selected or item ID is missing."),n.info($.global.t("toast.info.select_valid_item"));ve.value=!1}async function _(p){if(ve.value=!0,Nt.value&&Nt.value.__id){const w=Zi.value.findIndex(C=>C.__id===p);if(w!==-1)return await Mn.unlinkManageUser(Nt.value.__id,p),Zi.value.splice(w,1),ve.value=!1,Zi.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Yn,loading:gh,columns:Sy,item:Nt,usersTeam:Zi,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,linkUser:g,unlinkUser:_}},HT=l.defineComponent({__name:"GlobalScopeFilter",setup(n){var T,k,I;const{openDialog:e}=Ls("global-scope__J-"),{user:t,scope:r,session:o,setScope:a}=Cu(),{getData:c,data:d}=FT(),{getData:h,data:m}=VT(),g=l.ref(!1);l.onBeforeMount(async()=>{g.value=!0,await c(),await h(),g.value=!1});const _=l.ref({scope_type:(T=r.value)==null?void 0:T.scope_type,organization:((k=r.value)==null?void 0:k.organization)??"org",team:(I=r.value)==null?void 0:I.team});function p(){var N,D,L;_.value={...r.value,scope_type:(N=r.value)==null?void 0:N.scope_type,organization:((D=r.value)==null?void 0:D.organization)??"",team:(L=r.value)==null?void 0:L.team},e()}const w=l.computed(()=>{var N;switch((N=r.value)==null?void 0:N.scope_type){case"user":return HF;case"org":return FF;case"team":return $F;default:return VF}});async function C(){var N;((N=r.value)==null?void 0:N.scope_type)!==""&&a(_.value)}return(N,D)=>(l.openBlock(),l.createElementBlock(l.Fragment,null,[l.createVNode(it.VBtn,{onClick:p,icon:"",class:"text-secondary",color:"surface",rounded:"sm",size:"small",variant:"flat"},{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(w.value),{size:"20"}))]),_:1}),l.createVNode(l.unref(Us),{loading:g.value,title:l.unref($).global.t("dialogs.scope.title"),"dd-id":"global-scope__J-",onOnSave:C},{default:l.withCtx(()=>[l.createElementVNode("div",null,[l.createVNode(Qe.VRow,null,{default:l.withCtx(()=>[l.createVNode(Qe.VCol,{cols:"4",class:"d-flex flex-row align-center"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>{var L;return[l.createTextVNode(l.toDisplayString(((L=l.unref(t))==null?void 0:L.name)||l.unref($).global.t("dialogs.scope.unknownUser")),1)]}),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).domain),1)]),_:1})]),_:1})]),_:1}),l.createVNode(Qe.VCol,{cols:"4"},{default:l.withCtx(()=>[l.createVNode(Qt.VListItem,null,{default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.environment")),1)]),_:1}),l.createVNode(Qt.VListItemSubtitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref(o).environment),1)]),_:1})]),_:1})]),_:1})]),_:1}),l.createVNode(NO.VBtnToggle,{density:"compact",variant:"outlined",modelValue:_.value.scope_type,"onUpdate:modelValue":D[0]||(D[0]=L=>_.value.scope_type=L),class:"d-flex justify-center my-4"},{default:l.withCtx(()=>[l.createVNode(it.VBtn,{value:"org",label:l.unref($).global.t("dialogs.scope.organizational"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organizational")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"team",label:l.unref($).global.t("dialogs.scope.team"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"user",label:l.unref($).global.t("dialogs.scope.user"),color:"secondary"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.user")),1)]),_:1},8,["label"]),l.createVNode(it.VBtn,{value:"",label:l.unref($).global.t("dialogs.scope.none"),color:"lightext"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.none")),1)]),_:1},8,["label"])]),_:1},8,["modelValue"]),l.createElementVNode("div",null,[l.createVNode(va.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.organization")),1)]),_:1}),l.createVNode(hs.VSelect,{items:l.unref(d),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectOrganization"),class:"min-w-50",modelValue:_.value.organization,"onUpdate:modelValue":D[1]||(D[1]=L=>_.value.organization=L),clearable:""},null,8,["items","placeholder","modelValue"]),l.createVNode(va.VLabel,{class:"text-subtitle-1 text-high-emphasis mb-2"},{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(l.unref($).global.t("dialogs.scope.team")),1)]),_:1}),l.createVNode(hs.VSelect,{items:l.unref(m),"item-title":"name","item-value":"__id",variant:"solo","bg-color":"containerBg",rounded:"false",placeholder:l.unref($).global.t("dialogs.scope.selectTeam"),class:"min-w-50",modelValue:_.value.team,"onUpdate:modelValue":D[2]||(D[2]=L=>_.value.team=L),clearable:""},null,8,["items","placeholder","modelValue"])])])]),_:1},8,["loading","title"])],64))}}),A$={},k$={class:"double-ring-spinner-container"};function N$(n,e){return l.openBlock(),l.createElementBlock("div",k$,e[0]||(e[0]=[l.createElementVNode("div",{class:"spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])],-1)]))}const $T=Aa(A$,[["render",N$],["__scopeId","data-v-00d7a69f"]]),R$={key:0,class:"_jspinner-overlay_jj"},KT=l.defineComponent({__name:"GlobalSpinner",setup(n){return(e,t)=>l.unref(ve)?(l.openBlock(),l.createElementBlock("div",R$,t[0]||(t[0]=[l.createElementVNode("div",{class:"j-double-ring-spinner-container"},[l.createElementVNode("div",{class:"j-global-spinner-loading"},[l.createElementVNode("div"),l.createElementVNode("div"),l.createElementVNode("div",null,[l.createElementVNode("div")]),l.createElementVNode("div",null,[l.createElementVNode("div")])])],-1)]))):l.createCommentVNode("",!0)}}),WT=l.defineComponent({__name:"SubMenu",props:{title:{}},setup(n,{expose:e}){return e({props:n}),(r,o)=>(l.openBlock(),l.createBlock(Qt.VListItem,{onClick:o[0]||(o[0]=()=>{}),density:"compact"},{append:l.withCtx(()=>[l.createVNode(l.unref(KF))]),default:l.withCtx(()=>[l.createVNode(Qt.VListItemTitle,null,{default:l.withCtx(()=>[l.createTextVNode(l.toDisplayString(r.title),1)]),_:1}),l.createVNode(_f.VMenu,{activator:"parent","open-on-hover":"",submenu:"",density:"compact"},{default:l.withCtx(()=>[l.renderSlot(r.$slots,"default")]),_:3})]),_:3}))}}),O$=Object.freeze(Object.defineProperty({__proto__:null,AvatarPicture:pC,ColumnSettingsDialog:Ff,ConfirmDialog:mC,ContextMenu:_C,CopyButton:Vl,DeleteAllBtn:wf,DotsMenu:fC,EditButton:hC,FormHeadless:YE,FormMetadata:au,GlobalScopeFilter:HT,GlobalSpinner:KT,JAutocomplete:KE,JAvatar:gC,JBtn:My,JDialog:Us,JForm:qE,JIconBtn:Py,JSelect:$E,JTextArea:WE,JTextField:_E,ParentCard:zl,SearchFilter:Xl,SpinnerLoader:$T,SubMenu:WT,TabFormHeader:jE,TableAdvanced:tE,TableCard:Vf,TableCardsView:pE,TableHeader:nE,UiTable:vC},Symbol.toStringTag,{value:"Module"})),P$=o0(),M$={transition:"Vue-Toastification__fade",maxToasts:20,newestOnTop:!0};let ph=!1;const _h=l.ref(!1),Jn=l.ref([]),Ay=l.ref([]),$t=l.ref(null),ea=l.ref([]),D$=()=>{const n=ar(),e=async p=>{_h.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await Uo.getBranchList(w);C&&(Jn.value=C,ph=!0),_h.value=!1},t=async p=>(Jn.value.length||await e(p),Jn.value);function r(p){if(!Jn.value)throw new Error("Data not stored yet");const w=Pa(Jn.value,p,["name","description"]);return p!==""?w:Jn.value}const o=p=>{Ay.value=p},a=p=>{$t.value=Oa.cloneDeep(p)},c=async p=>await Uo.getBranch(p),d=async()=>{if($t.value!=null){const p=await Uo.createBranch($t.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Branch"})),ph&&Jn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if($t.value&&$t.value.__id){const p=await Uo.updateBranch($t.value);if(ph&&p){const w=Jn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Jn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Branch"}))):n.error($.global.t("toast.error.update_failed",{entity:"Branch"})),p}}else n.error($.global.t("toast.error.update_failed",{entity:"Branch"}))},m=async()=>{if($t.value&&$t.value.created_at){await Uo.deactivateBranch($t.value.__id);const p=Jn.value.findIndex(w=>{var C;return w.__id===((C=$t.value)==null?void 0:C.__id)});if(p!==-1)return Jn.value.splice(p,1),$t.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Branch"}))}};async function g(p){ve.value=!0;try{if($t.value&&$t.value.__id){const w={...p,branch:$t.value.__id};if(!await Mn.updateTeam(w)){n.error($.global.t("toast.error.link_failed",{entity:"Team"}));return}if(ea.value.findIndex(k=>k.__id===p.__id)===-1)return n.success($.global.t("toast.success.link_success",{entity:"Team"})),ea.value.push(w),w;n.info($.global.t("toast.info.already_linked",{entity:"Team"}))}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function _(p){if(ve.value=!0,$t.value&&$t.value.__id){const w={...p,branch:null};if(!await Mn.updateTeam(w))return;const T=ea.value.findIndex(k=>k.__id===p.__id);if(T!==-1)return ea.value.splice(T,1),ve.value=!1,ea.value;throw new Error("Item not found to remove")}ve.value=!1}return{data:Jn,columns:Ay,item:$t,loading:_h,__init__:e,getData:t,filterData:r,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,branchTeams:ea,linkTeam:g,unlinkTeam:_}};function L$(){const n=La("https://api.jplan.com.br/management/division"),{error:e}=ar();return{async getDivisionList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getDivisionList:",r),e($.global.t("toast.error.fetch_failed",{entity:"Division"}));return}},async createDivision(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"Division"})),a}},async updateDivision(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"Division"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"Division"})),a}},async getDivision(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"Division"})),new Error(a.data.error);return a.data}catch(a){throw console.error("Error in getDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"Division"})),a}},async activateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"Division"})),a}},async deactivateDivision(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"Division"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateDivision:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"Division"})),a}}}}const ca=L$();let vh=!1;const yh=l.ref(!1),Qn=l.ref([]),ky=l.ref([]),Kt=l.ref(null),ta=l.ref([]),x$=()=>{const n=ar(),e=async p=>{yh.value=!0;const w=p?`_active eq true and ${p}`:"_active eq true",C=await ca.getDivisionList(w);C&&(Qn.value=C,vh=!0),yh.value=!1},t=async p=>(Qn.value.length||await e(p),Qn.value);function r(p){if(!Qn.value)throw new Error("Data not stored yet");const w=Pa(Qn.value,p,["name","description"]);return p!==""?w:Qn.value}const o=p=>{ky.value=p},a=p=>{Kt.value=Oa.cloneDeep(p)},c=async p=>await ca.getDivision(p),d=async()=>{if(Kt.value!=null){const p=await ca.createDivision(Kt.value);return p!=null&&p.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"Division"})),vh&&Qn.value.push(p.data)),p==null?void 0:p.data}},h=async()=>{if(ve.value=!0,Kt.value&&Kt.value.__id){const p=await ca.updateDivision(Kt.value);if(vh&&(p!=null&&p.data.__id)){const w=Qn.value.findIndex(C=>C.__id===p.data.__id);return w!==-1?(Qn.value[w]=p.data,n.success($.global.t("toast.success.update_success",{entity:"Division"}))):n.error($.global.t("toast.error.update_failed",{entity:"Division"})),ve.value=!1,p}}else ve.value=!1,n.error($.global.t("toast.error.update_failed",{entity:"Division"}))},m=async()=>{if(ve.value=!0,Kt.value&&Kt.value.created_at){await ca.deactivateDivision(Kt.value.__id);const p=Qn.value.findIndex(w=>{var C;return w.__id===((C=Kt.value)==null?void 0:C.__id)});if(p!==-1)return Qn.value.splice(p,1),Kt.value;n.error($.global.t("toast.error.deactivate_failed",{entity:"Division"}))}ve.value=!1};async function g(p){ve.value=!0;try{if(Kt.value&&Kt.value.__id){const w={...p,division:Kt.value.__id};return await xo.updateOrg(w)?(ta.value.findIndex(k=>k.__id===p.__id)===-1?(n.success($.global.t("toast.success.link_success",{entity:"Organization"})),ta.value.push(w)):n.info($.global.t("toast.info.already_linked",{entity:"Organization"})),w):void 0}else throw new Error("Item is not defined")}catch(w){console.error(w)}finally{ve.value=!1}}async function _(p){if(ve.value=!0,Kt.value&&Kt.value.__id){const w={...p,division:null};if(!await xo.updateOrg(w))return;const T=ta.value.findIndex(k=>k.__id===p.__id);if(T!==-1)ta.value.splice(T,1);else throw new Error("Item not found to remove")}else throw new Error("Item is not defined");return ve.value=!1,ta.value}return{data:Qn,columns:ky,item:Kt,loading:yh,__init__:e,filterData:r,getData:t,setColumns:o,setItem:a,getItem:c,createItem:d,updateItem:h,removeItem:m,orgs:ta,linkDivision:g,unlinkDivision:_}};function U$(){const n=La("https://api.jplan.com.br/management/user"),{error:e}=ar();return{async getManageUserList(t){try{const r=t?`?filter_query=${t}`:"",o=await n.get(`/list/${r}`);if(o.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(o.data.error);return o.data.data}catch(r){console.error("Error in getManageUserList:",r),e($.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async createManageUser(t){var r,o;try{const a=await n.post("/item",t);return a.status>=200&&a.status<300?a:void 0}catch(a){throw console.error("Error in createManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.create_failed",{entity:"User"})),a}},async updateManageUser(t){var r,o;try{const a=await n.patch("/item",t);if(a.data.error)throw e($.global.t("toast.error.update_failed",{entity:"User"})),new Error(a.data.error);return a}catch(a){throw console.error("Error in updateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.update_failed",{entity:"User"})),a}},async getManageUser(t){var r,o;try{const a=await n.get(`/item/${t}`);if(a.data.error)throw e($.global.t("toast.error.fetch_failed",{entity:"User"})),new Error(a.data.error);return a.data}catch(a){console.error("Error in getManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.fetch_failed",{entity:"User"}));return}},async activateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/activate`);if(a.data.error)throw e($.global.t("toast.error.activate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in activateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.activate_failed",{entity:"User"})),a}},async deactivateManageUser(t){var r,o;try{const a=await n.post(`/item/${t}/deactivate`);if(a.data.error)throw e($.global.t("toast.error.deactivate_failed",{entity:"User"})),new Error(a.data.error)}catch(a){throw console.error("Error in deactivateManageUser:",a),e(((o=(r=a.response)==null?void 0:r.data)==null?void 0:o.message)||$.global.t("toast.error.deactivate_failed",{entity:"User"})),a}}}}const la=U$();let Ch=!1,Eh=l.ref(!1);const Xn=l.ref([]),Ny=l.ref([]),Zn=l.ref(null),B$=l.ref(null),F$=l.ref([]),V$=()=>{const n=ar(),e=async g=>{Eh.value=!0;const _=g?`_active eq true and ${g}`:"_active eq true",p=await la.getManageUserList(_);p&&(Xn.value=p,Ch=!0),Eh.value=!1},t=async g=>(Xn.value.length||await e(g),Xn.value);function r(g){if(!Xn.value)throw new Error("Data not stored yet");const _=Pa(Xn.value,g,["name","description"]);return g!==""?_:Xn.value}return{data:Xn,loading:Eh,columns:Ny,item:Zn,filterData:r,__init__:e,getData:t,setColumns:g=>{Ny.value=g},setItem:g=>{Zn.value=Oa.cloneDeep(g)},getItem:async g=>await la.getManageUser(g),createItem:async()=>{if(Zn.value!=null){const g=crypto.randomUUID(),_=await la.createManageUser({...Zn.value,__id:g});return _!=null&&_.data.created_at&&(n.success($.global.t("toast.success.create_success",{entity:"User"})),Ch&&Xn.value.push(_.data)),_==null?void 0:_.data}},updateItem:async()=>{if(ve.value=!0,Zn.value&&Zn.value.created_at){const g=await la.updateManageUser(Zn.value);if(Ch&&(g!=null&&g.data)){const _=Xn.value.findIndex(p=>p.__id===(g==null?void 0:g.data.__id));_!==-1?(Xn.value[_]=g==null?void 0:g.data,n.success($.global.t("toast.success.update_success",{entity:"User"}))):n.error($.global.t("toast.error.update_failed",{entity:"User"}))}return ve.value=!1,g==null?void 0:g.data}},removeItem:async()=>{if(Zn.value&&Zn.value.created_at){try{await la.deactivateManageUser(Zn.value.__id)}catch{n.error($.global.t("toast.error.deactivate_failed",{entity:"User"}));return}const g=Xn.value.findIndex(_=>{var p;return _.__id===((p=Zn.value)==null?void 0:p.__id)});if(g!==-1)return Xn.value.splice(g,1),n.success($.global.t("toast.success.deactivate_success",{entity:"User"})),Zn.value}},userOrg:B$,userTeams:F$}},wh=Object.freeze({colNum:24,rowHeight:50,useCssTransforms:!0,responsive:!0,margin:[12,10]}),na=l.ref(!1),H$=l.ref([]);function $$(){const n=l.ref({...wh,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"});function e(){if(na.value=!na.value,n.value.isDraggable=na.value,n.value.isResizable=na.value,!na.value){n.value.useStyleCursor=!0,n.value.cursor="pointer";return}n.value.useStyleCursor=!1,n.value.cursor="move"}function t(){n.value={...wh,isResizable:!1,isDraggable:!1,useStyleCursor:!1,cursor:"default"}}return{DEFAULT_CONFIG:wh,config:n,layout:H$,edition:na,toggleEdit:e,resetLayout:t}}const K$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetTask-C86P4qwO.js"))),W$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetImage-CmXW7a_H.js"))),z$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetShortcut-vS-UcWKp.js"))),G$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetSpacer-BQt9B-Lz.js"))),q$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetLabel-CImpFC-R.js"))),j$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartBar-ChMg_dbz.js"))),Y$=l.defineAsyncComponent(()=>Promise.resolve().then(()=>require("./WidgetChartPie-C2AIgVQ2.js"))),J$={WidgetSpacer:G$,WidgetLabel:q$,WidgetTask:K$,WidgetImage:W$,WidgetShortcut:z$,WidgetChartBar:j$,WidgetChartPie:Y$},Q$={defaultI18n:!0},X$=(n,e)=>{const t={...Q$,...e};n.use(P$),n.use(aP,M$),t.defaultI18n&&n.use($),Object.entries(O$).forEach(([r,o])=>{n.component(r,o)}),Object.entries(OO).forEach(([r,o])=>{n.provide(r,o)})},Z$={install:X$};exports.ContextMenu=_C;exports.EmptyListImg=Uh;exports.EventBus=Kl;exports.FormHeadless=YE;exports.HttpCore=dF;exports.I18nMessages=Mm;exports.SpinnerLoader=$T;exports.TableCardsView=pE;exports.TableHeader=nE;exports.__spinner=ve;exports._export_sfc=Aa;exports._sfc_main=Us;exports._sfc_main$1=vC;exports._sfc_main$10=My;exports._sfc_main$11=wf;exports._sfc_main$12=hC;exports._sfc_main$13=Py;exports._sfc_main$14=$E;exports._sfc_main$15=KE;exports._sfc_main$16=WE;exports._sfc_main$17=_E;exports._sfc_main$18=qE;exports._sfc_main$19=jE;exports._sfc_main$2=tE;exports._sfc_main$20=zl;exports._sfc_main$21=gC;exports._sfc_main$22=pC;exports._sfc_main$23=WT;exports._sfc_main$24=HT;exports._sfc_main$25=KT;exports._sfc_main$3=Ff;exports._sfc_main$4=Vf;exports._sfc_main$5=Xl;exports._sfc_main$6=mC;exports._sfc_main$7=Vl;exports._sfc_main$8=fC;exports._sfc_main$9=au;exports.branchInstance=Uo;exports.coreClient=Pm;exports.createToastInterface=bs;exports.dateFormat=fs;exports.divisionInstance=ca;exports.filterQuery=Pa;exports.globalEventBus=Ef;exports.i18n=$;exports.index=Z$;exports.manageUserInstance=la;exports.msal=Gt;exports.orgInstance=xo;exports.provideToast=iP;exports.scopedClient=La;exports.setupAuthGuard=C$;exports.teamInstance=Mn;exports.toastInjectionKey=Wl;exports.useAuth=Om;exports.useBranchStore=D$;exports.useCustomizer=l0;exports.useDashboardStore=$$;exports.useDialog=Ls;exports.useDivisionStore=x$;exports.useManageUserStore=V$;exports.useNotifications=uC;exports.useOrganizationStore=FT;exports.useSession=Cu;exports.useTeamStore=VT;exports.useToast=ar;exports.widgets=J$;