@luizleon/sf.prefeiturasp.vuecomponents 0.0.17 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib.es.js +2882 -2214
- package/dist/lib.es.js.map +1 -1
- package/dist/lib.umd.js +37 -37
- package/dist/lib.umd.js.map +1 -1
- package/dist/services/dialogService.d.ts +8 -2
- package/package.json +4 -2
- package/src/components/internal/HeaderAvatar.vue +1 -1
- package/src/services/dialogService.ts +34 -6
package/dist/lib.umd.js
CHANGED
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(G,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(G=typeof globalThis<"u"?globalThis:G||self,l(G.Lib={},G.Vue))})(this,function(G,l){"use strict";var xl=Object.defineProperty;var Tl=(G,l,De)=>l in G?xl(G,l,{enumerable:!0,configurable:!0,writable:!0,value:De}):G[l]=De;var Tt=(G,l,De)=>(Tl(G,typeof l!="symbol"?l+"":l,De),De);class De{constructor(){Tt(this,"_visible",l.ref(!1))}get IsVisible(){return this._visible.value===!0}Toggle(){this._visible.value=!this._visible.value}Close(){this._visible.value=!1}Open(){this._visible.value=!0}}const rr=new De,Wt=()=>rr;var qt=(t=>(t.Primary="primary",t.Secondary="secondary",t.Info="info",t.Success="success",t.Help="help",t.Warn="warn",t.Error="error",t))(qt||{}),Ke=(t=>(t.Pequeno="sm",t.Medio="md",t.Grande="lg",t))(Ke||{});const In=(t,e)=>{const n=t.__vccOpts||t;for(const[o,s]of e)n[o]=s;return n},ir={},sr={class:"sf-loading-circle"},ar=[l.createElementVNode("div",null,[l.createElementVNode("svg",{viewBox:"25 25 50 50"},[l.createElementVNode("circle",{cx:"50",cy:"50",r:"20",fill:"none","stroke-width":"4","stroke-miterlimit":"10"})])],-1)];function lr(t,e){return l.openBlock(),l.createElementBlock("div",sr,ar)}const cr=In(ir,[["render",lr]]);class Ge{constructor(e){Tt(this,"retorno");this.retorno=e??""}Concat(e){return e&&e.trim().length&&(this.retorno+=` ${e}`),this}AddClass(e,n=!0){return n?this.Concat(e):this}Build(){return this.retorno.trim()}}const ur=["disabled","tabindex"],dr=["data-color"],ut=l.defineComponent({__name:"Icon",props:{icone:{},visible:{type:Boolean,default:!0},class:{default:""},style:{default:""},disabled:{type:Boolean},loading:{type:Boolean},button:{type:Boolean},tamanho:{default:Ke.Medio},dot:{type:Boolean},dotColor:{default:qt.Error},buttonProps:{}},setup(t){const e=t;function n(){return new Ge(`${e.class} sf-icon`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-icon-button",e.button).AddClass("sf-icon-small",e.tamanho===Ke.Pequeno).AddClass("sf-icon-medium",e.tamanho===Ke.Medio).AddClass("sf-icon-large",e.tamanho===Ke.Grande).AddClass("sf-ripple",e.button===!0).Build()}return(o,s)=>(l.openBlock(),l.createElementBlock("div",{style:l.normalizeStyle(e.style),class:l.normalizeClass(n())},[l.createElementVNode("button",l.mergeProps({class:"material-symbols-outlined",disabled:e.disabled||e.loading},e.buttonProps,{tabindex:e.button?void 0:-1}),[e.loading?(l.openBlock(),l.createBlock(cr,{key:0})):(l.openBlock(),l.createElementBlock(l.Fragment,{key:1},[l.createTextVNode(l.toDisplayString(e.icone),1)],64))],16,ur),e.dot?(l.openBlock(),l.createElementBlock("span",{key:0,"data-color":e.dotColor},null,8,dr)):l.createCommentVNode("",!0)],6))}});var fr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function o(){return this instanceof o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(o){var s=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(n,o,s.get?s:{enumerable:!0,get:function(){return t[o]}})}),n}var St={};St.byteLength=br,St.toByteArray=wr,St.fromByteArray=_r;for(var Ie=[],Ae=[],mr=typeof Uint8Array<"u"?Uint8Array:Array,Kt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ye=0,gr=Kt.length;Ye<gr;++Ye)Ie[Ye]=Kt[Ye],Ae[Kt.charCodeAt(Ye)]=Ye;Ae["-".charCodeAt(0)]=62,Ae["_".charCodeAt(0)]=63;function Pn(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var o=n===e?0:4-n%4;return[n,o]}function br(t){var e=Pn(t),n=e[0],o=e[1];return(n+o)*3/4-o}function yr(t,e,n){return(e+n)*3/4-n}function wr(t){var e,n=Pn(t),o=n[0],s=n[1],c=new mr(yr(t,o,s)),E=0,I=s>0?o-4:o,d;for(d=0;d<I;d+=4)e=Ae[t.charCodeAt(d)]<<18|Ae[t.charCodeAt(d+1)]<<12|Ae[t.charCodeAt(d+2)]<<6|Ae[t.charCodeAt(d+3)],c[E++]=e>>16&255,c[E++]=e>>8&255,c[E++]=e&255;return s===2&&(e=Ae[t.charCodeAt(d)]<<2|Ae[t.charCodeAt(d+1)]>>4,c[E++]=e&255),s===1&&(e=Ae[t.charCodeAt(d)]<<10|Ae[t.charCodeAt(d+1)]<<4|Ae[t.charCodeAt(d+2)]>>2,c[E++]=e>>8&255,c[E++]=e&255),c}function vr(t){return Ie[t>>18&63]+Ie[t>>12&63]+Ie[t>>6&63]+Ie[t&63]}function kr(t,e,n){for(var o,s=[],c=e;c<n;c+=3)o=(t[c]<<16&16711680)+(t[c+1]<<8&65280)+(t[c+2]&255),s.push(vr(o));return s.join("")}function _r(t){for(var e,n=t.length,o=n%3,s=[],c=16383,E=0,I=n-o;E<I;E+=c)s.push(kr(t,E,E+c>I?I:E+c));return o===1?(e=t[n-1],s.push(Ie[e>>2]+Ie[e<<4&63]+"==")):o===2&&(e=(t[n-2]<<8)+t[n-1],s.push(Ie[e>>10]+Ie[e>>4&63]+Ie[e<<2&63]+"=")),s.join("")}var Bn={exports:{}};const Rn=pr(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));/**
|
|
2
2
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
3
3
|
*
|
|
4
4
|
* @version 0.10.1
|
|
5
5
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
6
6
|
* @copyright Chen, Yi-Cyuan 2014-2023
|
|
7
7
|
* @license MIT
|
|
8
|
-
*/(function(l){(function(){var o="input is invalid type",h=typeof window=="object",v=h?window:{};v.JS_SHA256_NO_WINDOW&&(h=!1);var U=!h&&typeof self=="object",x=!v.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;x?v=ke:U&&(v=self);var I=!v.JS_SHA256_NO_COMMON_JS&&!0&&l.exports,O=!v.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",p="0123456789abcdef".split(""),K=[-2147483648,8388608,32768,128],W=[24,16,8,0],X=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],ae=["hex","array","digest","arrayBuffer"],j=[];(v.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(d){return Object.prototype.toString.call(d)==="[object Array]"}),O&&(v.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(d){return typeof d=="object"&&d.buffer&&d.buffer.constructor===ArrayBuffer});var Ce=function(d,C){return function(L){return new J(C,!0).update(L)[d]()}},ge=function(d){var C=Ce("hex",d);x&&(C=ce(C,d)),C.create=function(){return new J(d)},C.update=function(E){return C.create().update(E)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ce(A,d)}return C},ce=function(d,C){var L=yt,A=yt.Buffer,E=C?"sha224":"sha256",k;A.from&&!v.JS_SHA256_NO_BUFFER_FROM?k=A.from:k=function(g){return new A(g)};var i=function(g){if(typeof g=="string")return L.createHash(E).update(g,"utf8").digest("hex");if(g==null)throw new Error(o);return g.constructor===ArrayBuffer&&(g=new Uint8Array(g)),Array.isArray(g)||ArrayBuffer.isView(g)||g.constructor===A?L.createHash(E).update(k(g)).digest("hex"):d(g)};return i},Ie=function(d,C){return function(L,A){return new we(L,C,!0).update(A)[d]()}},fe=function(d){var C=Ie("hex",d);C.create=function(E){return new we(E,d)},C.update=function(E,k){return C.create(E).update(k)};for(var L=0;L<ae.length;++L){var A=ae[L];C[A]=Ie(A,d)}return C};function J(d,C){C?(j[0]=j[16]=j[1]=j[2]=j[3]=j[4]=j[5]=j[6]=j[7]=j[8]=j[9]=j[10]=j[11]=j[12]=j[13]=j[14]=j[15]=0,this.blocks=j):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],d?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=d}J.prototype.update=function(d){if(!this.finalized){var C,L=typeof d;if(L!=="string"){if(L==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);C=!0}for(var A,E=0,k,i=d.length,g=this.blocks;E<i;){if(this.hashed&&(this.hashed=!1,g[0]=this.block,g[16]=g[1]=g[2]=g[3]=g[4]=g[5]=g[6]=g[7]=g[8]=g[9]=g[10]=g[11]=g[12]=g[13]=g[14]=g[15]=0),C)for(k=this.start;E<i&&k<64;++E)g[k>>2]|=d[E]<<W[k++&3];else for(k=this.start;E<i&&k<64;++E)A=d.charCodeAt(E),A<128?g[k>>2]|=A<<W[k++&3]:A<2048?(g[k>>2]|=(192|A>>6)<<W[k++&3],g[k>>2]|=(128|A&63)<<W[k++&3]):A<55296||A>=57344?(g[k>>2]|=(224|A>>12)<<W[k++&3],g[k>>2]|=(128|A>>6&63)<<W[k++&3],g[k>>2]|=(128|A&63)<<W[k++&3]):(A=65536+((A&1023)<<10|d.charCodeAt(++E)&1023),g[k>>2]|=(240|A>>18)<<W[k++&3],g[k>>2]|=(128|A>>12&63)<<W[k++&3],g[k>>2]|=(128|A>>6&63)<<W[k++&3],g[k>>2]|=(128|A&63)<<W[k++&3]);this.lastByteIndex=k,this.bytes+=k-this.start,k>=64?(this.block=g[16],this.start=k-64,this.hash(),this.hashed=!0):this.start=k}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},J.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var d=this.blocks,C=this.lastByteIndex;d[16]=this.block,d[C>>2]|=K[C&3],this.block=d[16],C>=56&&(this.hashed||this.hash(),d[0]=this.block,d[16]=d[1]=d[2]=d[3]=d[4]=d[5]=d[6]=d[7]=d[8]=d[9]=d[10]=d[11]=d[12]=d[13]=d[14]=d[15]=0),d[14]=this.hBytes<<3|this.bytes>>>29,d[15]=this.bytes<<3,this.hash()}},J.prototype.hash=function(){var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,k=this.h5,i=this.h6,g=this.h7,T=this.blocks,z,$,F,G,N,te,s,a,m,b,u;for(z=16;z<64;++z)N=T[z-15],$=(N>>>7|N<<25)^(N>>>18|N<<14)^N>>>3,N=T[z-2],F=(N>>>17|N<<15)^(N>>>19|N<<13)^N>>>10,T[z]=T[z-16]+$+T[z-7]+F<<0;for(u=C&L,z=0;z<64;z+=4)this.first?(this.is224?(a=300032,N=T[0]-1413257819,g=N-150054599<<0,A=N+24177077<<0):(a=704751109,N=T[0]-210244248,g=N-1521486534<<0,A=N+143694565<<0),this.first=!1):($=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),F=(E>>>6|E<<26)^(E>>>11|E<<21)^(E>>>25|E<<7),a=d&C,G=a^d&L^u,s=E&k^~E&i,N=g+F+s+X[z]+T[z],te=$+G,g=A+N<<0,A=N+te<<0),$=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),F=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),m=A&d,G=m^A&C^a,s=g&E^~g&k,N=i+F+s+X[z+1]+T[z+1],te=$+G,i=L+N<<0,L=N+te<<0,$=(L>>>2|L<<30)^(L>>>13|L<<19)^(L>>>22|L<<10),F=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),b=L&A,G=b^L&d^m,s=i&g^~i&E,N=k+F+s+X[z+2]+T[z+2],te=$+G,k=C+N<<0,C=N+te<<0,$=(C>>>2|C<<30)^(C>>>13|C<<19)^(C>>>22|C<<10),F=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),u=C&L,G=u^C&A^b,s=k&i^~k&g,N=E+F+s+X[z+3]+T[z+3],te=$+G,E=d+N<<0,d=N+te<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+C<<0,this.h2=this.h2+L<<0,this.h3=this.h3+A<<0,this.h4=this.h4+E<<0,this.h5=this.h5+k<<0,this.h6=this.h6+i<<0,this.h7=this.h7+g<<0},J.prototype.hex=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,k=this.h5,i=this.h6,g=this.h7,T=p[d>>28&15]+p[d>>24&15]+p[d>>20&15]+p[d>>16&15]+p[d>>12&15]+p[d>>8&15]+p[d>>4&15]+p[d&15]+p[C>>28&15]+p[C>>24&15]+p[C>>20&15]+p[C>>16&15]+p[C>>12&15]+p[C>>8&15]+p[C>>4&15]+p[C&15]+p[L>>28&15]+p[L>>24&15]+p[L>>20&15]+p[L>>16&15]+p[L>>12&15]+p[L>>8&15]+p[L>>4&15]+p[L&15]+p[A>>28&15]+p[A>>24&15]+p[A>>20&15]+p[A>>16&15]+p[A>>12&15]+p[A>>8&15]+p[A>>4&15]+p[A&15]+p[E>>28&15]+p[E>>24&15]+p[E>>20&15]+p[E>>16&15]+p[E>>12&15]+p[E>>8&15]+p[E>>4&15]+p[E&15]+p[k>>28&15]+p[k>>24&15]+p[k>>20&15]+p[k>>16&15]+p[k>>12&15]+p[k>>8&15]+p[k>>4&15]+p[k&15]+p[i>>28&15]+p[i>>24&15]+p[i>>20&15]+p[i>>16&15]+p[i>>12&15]+p[i>>8&15]+p[i>>4&15]+p[i&15];return this.is224||(T+=p[g>>28&15]+p[g>>24&15]+p[g>>20&15]+p[g>>16&15]+p[g>>12&15]+p[g>>8&15]+p[g>>4&15]+p[g&15]),T},J.prototype.toString=J.prototype.hex,J.prototype.digest=function(){this.finalize();var d=this.h0,C=this.h1,L=this.h2,A=this.h3,E=this.h4,k=this.h5,i=this.h6,g=this.h7,T=[d>>24&255,d>>16&255,d>>8&255,d&255,C>>24&255,C>>16&255,C>>8&255,C&255,L>>24&255,L>>16&255,L>>8&255,L&255,A>>24&255,A>>16&255,A>>8&255,A&255,E>>24&255,E>>16&255,E>>8&255,E&255,k>>24&255,k>>16&255,k>>8&255,k&255,i>>24&255,i>>16&255,i>>8&255,i&255];return this.is224||T.push(g>>24&255,g>>16&255,g>>8&255,g&255),T},J.prototype.array=J.prototype.digest,J.prototype.arrayBuffer=function(){this.finalize();var d=new ArrayBuffer(this.is224?28:32),C=new DataView(d);return C.setUint32(0,this.h0),C.setUint32(4,this.h1),C.setUint32(8,this.h2),C.setUint32(12,this.h3),C.setUint32(16,this.h4),C.setUint32(20,this.h5),C.setUint32(24,this.h6),this.is224||C.setUint32(28,this.h7),d};function we(d,C,L){var A,E=typeof d;if(E==="string"){var k=[],i=d.length,g=0,T;for(A=0;A<i;++A)T=d.charCodeAt(A),T<128?k[g++]=T:T<2048?(k[g++]=192|T>>6,k[g++]=128|T&63):T<55296||T>=57344?(k[g++]=224|T>>12,k[g++]=128|T>>6&63,k[g++]=128|T&63):(T=65536+((T&1023)<<10|d.charCodeAt(++A)&1023),k[g++]=240|T>>18,k[g++]=128|T>>12&63,k[g++]=128|T>>6&63,k[g++]=128|T&63);d=k}else if(E==="object"){if(d===null)throw new Error(o);if(O&&d.constructor===ArrayBuffer)d=new Uint8Array(d);else if(!Array.isArray(d)&&(!O||!ArrayBuffer.isView(d)))throw new Error(o)}else throw new Error(o);d.length>64&&(d=new J(C,!0).update(d).array());var z=[],$=[];for(A=0;A<64;++A){var F=d[A]||0;z[A]=92^F,$[A]=54^F}J.call(this,C,L),this.update($),this.oKeyPad=z,this.inner=!0,this.sharedMemory=L}we.prototype=new J,we.prototype.finalize=function(){if(J.prototype.finalize.call(this),this.inner){this.inner=!1;var d=this.array();J.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(d),J.prototype.finalize.call(this)}};var Z=ge();Z.sha256=Z,Z.sha224=ge(!0),Z.sha256.hmac=fe(),Z.sha224.hmac=fe(!0),I?l.exports=Z:(v.sha256=Z.sha256,v.sha224=Z.sha224)})()})(wt);var xn=wt.exports;const Cn=gt(xn);class Re extends Error{}Re.prototype.name="InvalidTokenError";function An(l){return decodeURIComponent(atob(l).replace(/(.)/g,(o,h)=>{let v=h.charCodeAt(0).toString(16).toUpperCase();return v.length<2&&(v="0"+v),"%"+v}))}function Sn(l){let o=l.replace(/-/g,"+").replace(/_/g,"/");switch(o.length%4){case 0:break;case 2:o+="==";break;case 3:o+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return An(o)}catch{return atob(o)}}function et(l,o){if(typeof l!="string")throw new Re("Invalid token specified: must be a string");o||(o={});const h=o.header===!0?0:1,v=l.split(".")[h];if(typeof v!="string")throw new Re(`Invalid token specified: missing part #${h+1}`);let U;try{U=Sn(v)}catch(x){throw new Re(`Invalid token specified: invalid base64 for part #${h+1} (${x.message})`)}try{return JSON.parse(U)}catch(x){throw new Re(`Invalid token specified: invalid json for part #${h+1} (${x.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function vt(l){if(!(this instanceof vt))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var o=this,h,v=[],U,x={enable:!0,callbackList:[],interval:5},I=document.getElementsByTagName("script"),O=0;O<I.length;O++)(I[O].src.indexOf("keycloak.js")!==-1||I[O].src.indexOf("keycloak.min.js")!==-1)&&I[O].src.indexOf("version=")!==-1&&(o.iframeVersion=I[O].src.substring(I[O].src.indexOf("version=")+8).split("&")[0]);var p=!0,K=te(console.info),W=te(console.warn);o.init=function(s){if(o.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");o.didInitialize=!0,o.authenticated=!1,U=N();var a=["default","cordova","cordova-native"];if(s&&a.indexOf(s.adapter)>-1?h=$(s.adapter):s&&typeof s.adapter=="object"?h=s.adapter:window.Cordova||window.cordova?h=$("cordova"):h=$(),s){if(typeof s.useNonce<"u"&&(p=s.useNonce),typeof s.checkLoginIframe<"u"&&(x.enable=s.checkLoginIframe),s.checkLoginIframeInterval&&(x.interval=s.checkLoginIframeInterval),s.onLoad==="login-required"&&(o.loginRequired=!0),s.responseMode)if(s.responseMode==="query"||s.responseMode==="fragment")o.responseMode=s.responseMode;else throw"Invalid value for responseMode";if(s.flow){switch(s.flow){case"standard":o.responseType="code";break;case"implicit":o.responseType="id_token token";break;case"hybrid":o.responseType="code id_token token";break;default:throw"Invalid value for flow"}o.flow=s.flow}if(s.timeSkew!=null&&(o.timeSkew=s.timeSkew),s.redirectUri&&(o.redirectUri=s.redirectUri),s.silentCheckSsoRedirectUri&&(o.silentCheckSsoRedirectUri=s.silentCheckSsoRedirectUri),typeof s.silentCheckSsoFallback=="boolean"?o.silentCheckSsoFallback=s.silentCheckSsoFallback:o.silentCheckSsoFallback=!0,s.pkceMethod){if(s.pkceMethod!=="S256")throw"Invalid value for pkceMethod";o.pkceMethod=s.pkceMethod}typeof s.enableLogging=="boolean"?o.enableLogging=s.enableLogging:o.enableLogging=!1,typeof s.scope=="string"&&(o.scope=s.scope),typeof s.acrValues=="string"&&(o.acrValues=s.acrValues),typeof s.messageReceiveTimeout=="number"&&s.messageReceiveTimeout>0?o.messageReceiveTimeout=s.messageReceiveTimeout:o.messageReceiveTimeout=1e4}o.responseMode||(o.responseMode="fragment"),o.responseType||(o.responseType="code",o.flow="standard");var m=E(),b=E();b.promise.then(function(){o.onReady&&o.onReady(o.authenticated),m.setSuccess(o.authenticated)}).catch(function(_){m.setError(_)});var u=J();function S(){var _=function(H){H||(M.prompt="none"),s&&s.locale&&(M.locale=s.locale),o.login(M).then(function(){b.setSuccess()}).catch(function(he){b.setError(he)})},B=function(){var H=document.createElement("iframe"),he=o.createLoginUrl({prompt:"none",redirectUri:o.silentCheckSsoRedirectUri});H.setAttribute("src",he),H.setAttribute("sandbox","allow-scripts allow-same-origin"),H.setAttribute("title","keycloak-silent-check-sso"),H.style.display="none",document.body.appendChild(H);var pe=function(ne){if(!(ne.origin!==window.location.origin||H.contentWindow!==ne.source)){var ye=C(ne.data);fe(ye,b),document.body.removeChild(H),window.removeEventListener("message",pe)}};window.addEventListener("message",pe)},M={};switch(s.onLoad){case"check-sso":x.enable?i().then(function(){T().then(function(H){H?b.setSuccess():o.silentCheckSsoRedirectUri?B():_(!1)}).catch(function(H){b.setError(H)})}):o.silentCheckSsoRedirectUri?B():_(!1);break;case"login-required":_(!0);break;default:throw"Invalid value for onLoad"}}function w(){var _=C(window.location.href);if(_&&window.history.replaceState(window.history.state,null,_.newUrl),_&&_.valid)return i().then(function(){fe(_,b)}).catch(function(B){b.setError(B)});s?s.token&&s.refreshToken?(Z(s.token,s.refreshToken,s.idToken),x.enable?i().then(function(){T().then(function(B){B?(o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess(),g()):b.setSuccess()}).catch(function(B){b.setError(B)})}):o.updateToken(-1).then(function(){o.onAuthSuccess&&o.onAuthSuccess(),b.setSuccess()}).catch(function(B){o.onAuthError&&o.onAuthError(),s.onLoad?S():b.setError(B)})):s.onLoad?S():b.setSuccess():b.setSuccess()}function y(){var _=E(),B=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",B),_.setSuccess())};return document.addEventListener("readystatechange",B),B(),_.promise}return u.then(function(){y().then(z).then(w).catch(function(_){m.setError(_)})}),u.catch(function(_){m.setError(_)}),m.promise},o.login=function(s){return h.login(s)};function X(s){var a=null,m=window.crypto||window.msCrypto;if(m&&m.getRandomValues&&window.Uint8Array)return a=new Uint8Array(s),m.getRandomValues(a),a;a=new Array(s);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function ae(s){return j(s,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function j(s,a){for(var m=X(s),b=new Array(s),u=0;u<s;u++)b[u]=a.charCodeAt(m[u]%a.length);return String.fromCharCode.apply(null,b)}function Ce(s,a){switch(s){case"S256":var m=new Uint8Array(Cn.arrayBuffer(a)),b=qe.fromByteArray(m).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function ge(s){var a={id_token:{acr:s}};return JSON.stringify(a)}o.createLoginUrl=function(s){var a=d(),m=d(),b=h.redirectUri(s),u={state:a,nonce:m,redirectUri:encodeURIComponent(b)};s&&s.prompt&&(u.prompt=s.prompt);var S;s&&s.action=="register"?S=o.endpoints.register():S=o.endpoints.authorize();var w=s&&s.scope||o.scope;w?w.indexOf("openid")===-1&&(w="openid "+w):w="openid";var y=S+"?client_id="+encodeURIComponent(o.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(o.responseMode)+"&response_type="+encodeURIComponent(o.responseType)+"&scope="+encodeURIComponent(w);if(p&&(y=y+"&nonce="+encodeURIComponent(m)),s&&s.prompt&&(y+="&prompt="+encodeURIComponent(s.prompt)),s&&s.maxAge&&(y+="&max_age="+encodeURIComponent(s.maxAge)),s&&s.loginHint&&(y+="&login_hint="+encodeURIComponent(s.loginHint)),s&&s.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(s.idpHint)),s&&s.action&&s.action!="register"&&(y+="&kc_action="+encodeURIComponent(s.action)),s&&s.locale&&(y+="&ui_locales="+encodeURIComponent(s.locale)),s&&s.acr){var _=ge(s.acr);y+="&claims="+encodeURIComponent(_)}if((s&&s.acrValues||o.acrValues)&&(y+="&acr_values="+encodeURIComponent(s.acrValues||o.acrValues)),o.pkceMethod){var B=ae(96);u.pkceCodeVerifier=B;var M=Ce(o.pkceMethod,B);y+="&code_challenge="+M,y+="&code_challenge_method="+o.pkceMethod}return U.add(u),y},o.logout=function(s){return h.logout(s)},o.createLogoutUrl=function(s){var a=o.endpoints.logout()+"?client_id="+encodeURIComponent(o.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(h.redirectUri(s,!1));return o.idToken&&(a+="&id_token_hint="+encodeURIComponent(o.idToken)),a},o.register=function(s){return h.register(s)},o.createRegisterUrl=function(s){return s||(s={}),s.action="register",o.createLoginUrl(s)},o.createAccountUrl=function(s){var a=ce(),m=void 0;return typeof a<"u"&&(m=a+"/account?referrer="+encodeURIComponent(o.clientId)+"&referrer_uri="+encodeURIComponent(h.redirectUri(s))),m},o.accountManagement=function(){return h.accountManagement()},o.hasRealmRole=function(s){var a=o.realmAccess;return!!a&&a.roles.indexOf(s)>=0},o.hasResourceRole=function(s,a){if(!o.resourceAccess)return!1;var m=o.resourceAccess[a||o.clientId];return!!m&&m.roles.indexOf(s)>=0},o.loadUserProfile=function(){var s=ce()+"/account",a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.profile=JSON.parse(a.responseText),m.setSuccess(o.profile)):m.setError())},a.send(),m.promise},o.loadUserInfo=function(){var s=o.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",s,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+o.token);var m=E();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(o.userInfo=JSON.parse(a.responseText),m.setSuccess(o.userInfo)):m.setError())},a.send(),m.promise},o.isTokenExpired=function(s){if(!o.tokenParsed||!o.refreshToken&&o.flow!="implicit")throw"Not authenticated";if(o.timeSkew==null)return K("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=o.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+o.timeSkew;if(s){if(isNaN(s))throw"Invalid minValidity";a-=s}return a<0},o.updateToken=function(s){var a=E();if(!o.refreshToken)return a.setError(),a.promise;s=s||5;var m=function(){var u=!1;if(s==-1?(u=!0,K("[KEYCLOAK] Refreshing token: forced refresh")):(!o.tokenParsed||o.isTokenExpired(s))&&(u=!0,K("[KEYCLOAK] Refreshing token: token expired")),!u)a.setSuccess(!1);else{var S="grant_type=refresh_token&refresh_token="+o.refreshToken,w=o.endpoints.token();if(v.push(a),v.length==1){var y=new XMLHttpRequest;y.open("POST",w,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,S+="&client_id="+encodeURIComponent(o.clientId);var _=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){K("[KEYCLOAK] Token refreshed"),_=(_+new Date().getTime())/2;var B=JSON.parse(y.responseText);Z(B.access_token,B.refresh_token,B.id_token,_),o.onAuthRefreshSuccess&&o.onAuthRefreshSuccess();for(var M=v.pop();M!=null;M=v.pop())M.setSuccess(!0)}else{W("[KEYCLOAK] Failed to refresh token"),y.status==400&&o.clearToken(),o.onAuthRefreshError&&o.onAuthRefreshError();for(var M=v.pop();M!=null;M=v.pop())M.setError(!0)}},y.send(S)}}};if(x.enable){var b=T();b.then(function(){m()}).catch(function(u){a.setError(u)})}else m();return a.promise},o.clearToken=function(){o.token&&(Z(null,null,null),o.onAuthLogout&&o.onAuthLogout(),o.loginRequired&&o.login())},o.setToken=Z;function ce(){if(typeof o.authServerUrl<"u")return o.authServerUrl.charAt(o.authServerUrl.length-1)=="/"?o.authServerUrl+"realms/"+encodeURIComponent(o.realm):o.authServerUrl+"/realms/"+encodeURIComponent(o.realm)}function Ie(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function fe(s,a){var m=s.code,b=s.error,u=s.prompt,S=new Date().getTime();if(s.kc_action_status&&o.onActionUpdate&&o.onActionUpdate(s.kc_action_status),b){if(u!="none"){var w={error:b,error_description:s.error_description};o.onAuthError&&o.onAuthError(w),a&&a.setError(w)}else a&&a.setSuccess();return}else o.flow!="standard"&&(s.access_token||s.id_token)&&M(s.access_token,null,s.id_token,!0);if(o.flow!="implicit"&&m){var y="code="+m+"&grant_type=authorization_code",_=o.endpoints.token(),B=new XMLHttpRequest;B.open("POST",_,!0),B.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(o.clientId),y+="&redirect_uri="+s.redirectUri,s.pkceCodeVerifier&&(y+="&code_verifier="+s.pkceCodeVerifier),B.withCredentials=!0,B.onreadystatechange=function(){if(B.readyState==4)if(B.status==200){var H=JSON.parse(B.responseText);M(H.access_token,H.refresh_token,H.id_token,o.flow==="standard"),g()}else o.onAuthError&&o.onAuthError(),a&&a.setError()},B.send(y)}function M(H,he,pe,ne){S=(S+new Date().getTime())/2,Z(H,he,pe,S),p&&(o.tokenParsed&&o.tokenParsed.nonce!=s.storedNonce||o.refreshTokenParsed&&o.refreshTokenParsed.nonce!=s.storedNonce||o.idTokenParsed&&o.idTokenParsed.nonce!=s.storedNonce)?(K("[KEYCLOAK] Invalid nonce, clearing token"),o.clearToken(),a&&a.setError()):ne&&(o.onAuthSuccess&&o.onAuthSuccess(),a&&a.setSuccess())}}function J(s){var a=E(),m;l?typeof l=="string"&&(m=l):m=location.origin+"/keycloak.json";function b(B){B?o.endpoints={authorize:function(){return B.authorization_endpoint},token:function(){return B.token_endpoint},logout:function(){if(!B.end_session_endpoint)throw"Not supported by the OIDC server";return B.end_session_endpoint},checkSessionIframe:function(){if(!B.check_session_iframe)throw"Not supported by the OIDC server";return B.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!B.userinfo_endpoint)throw"Not supported by the OIDC server";return B.userinfo_endpoint}}:o.endpoints={authorize:function(){return ce()+"/protocol/openid-connect/auth"},token:function(){return ce()+"/protocol/openid-connect/token"},logout:function(){return ce()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var M=ce()+"/protocol/openid-connect/login-status-iframe.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},thirdPartyCookiesIframe:function(){var M=ce()+"/protocol/openid-connect/3p-cookies/step1.html";return o.iframeVersion&&(M=M+"?version="+o.iframeVersion),M},register:function(){return ce()+"/protocol/openid-connect/registrations"},userinfo:function(){return ce()+"/protocol/openid-connect/userinfo"}}}if(m){var u=new XMLHttpRequest;u.open("GET",m,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var B=JSON.parse(u.responseText);o.authServerUrl=B["auth-server-url"],o.realm=B.realm,o.clientId=B.resource,b(null),a.setSuccess()}else a.setError()},u.send()}else{if(!l.clientId)throw"clientId missing";o.clientId=l.clientId;var S=l.oidcProvider;if(S)if(typeof S=="string"){var _;S.charAt(S.length-1)=="/"?_=S+".well-known/openid-configuration":_=S+"/.well-known/openid-configuration";var u=new XMLHttpRequest;u.open("GET",_,!0),u.setRequestHeader("Accept","application/json"),u.onreadystatechange=function(){if(u.readyState==4)if(u.status==200||we(u)){var M=JSON.parse(u.responseText);b(M),a.setSuccess()}else a.setError()},u.send()}else b(S),a.setSuccess();else{if(!l.url){for(var w=document.getElementsByTagName("script"),y=0;y<w.length;y++)if(w[y].src.match(/.*keycloak\.js/)){l.url=w[y].src.substr(0,w[y].src.indexOf("/js/keycloak.js"));break}}if(!l.realm)throw"realm missing";o.authServerUrl=l.url,o.realm=l.realm,b(null),a.setSuccess()}}return a.promise}function we(s){return s.status==0&&s.responseText&&s.responseURL.startsWith("file:")}function Z(s,a,m,b){if(o.tokenTimeoutHandle&&(clearTimeout(o.tokenTimeoutHandle),o.tokenTimeoutHandle=null),a?(o.refreshToken=a,o.refreshTokenParsed=et(a)):(delete o.refreshToken,delete o.refreshTokenParsed),m?(o.idToken=m,o.idTokenParsed=et(m)):(delete o.idToken,delete o.idTokenParsed),s){if(o.token=s,o.tokenParsed=et(s),o.sessionId=o.tokenParsed.session_state,o.authenticated=!0,o.subject=o.tokenParsed.sub,o.realmAccess=o.tokenParsed.realm_access,o.resourceAccess=o.tokenParsed.resource_access,b&&(o.timeSkew=Math.floor(b/1e3)-o.tokenParsed.iat),o.timeSkew!=null&&(K("[KEYCLOAK] Estimated time difference between browser and server is "+o.timeSkew+" seconds"),o.onTokenExpired)){var u=(o.tokenParsed.exp-new Date().getTime()/1e3+o.timeSkew)*1e3;K("[KEYCLOAK] Token expires in "+Math.round(u/1e3)+" s"),u<=0?o.onTokenExpired():o.tokenTimeoutHandle=setTimeout(o.onTokenExpired,u)}}else delete o.token,delete o.tokenParsed,delete o.subject,delete o.realmAccess,delete o.resourceAccess,o.authenticated=!1}function d(){var s="0123456789abcdef",a=j(36,s).split("");a[14]="4",a[19]=s.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var m=a.join("");return m}function C(s){var a=L(s);if(a){var m=U.get(a.state);return m&&(a.valid=!0,a.redirectUri=m.redirectUri,a.storedNonce=m.nonce,a.prompt=m.prompt,a.pkceCodeVerifier=m.pkceCodeVerifier),a}}function L(s){var a;switch(o.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var m=s.indexOf("?"),b=s.indexOf("#"),u,S;if(o.responseMode==="query"&&m!==-1?(u=s.substring(0,m),S=A(s.substring(m+1,b!==-1?b:s.length),a),S.paramsString!==""&&(u+="?"+S.paramsString),b!==-1&&(u+=s.substring(b))):o.responseMode==="fragment"&&b!==-1&&(u=s.substring(0,b),S=A(s.substring(b+1),a),S.paramsString!==""&&(u+="#"+S.paramsString)),S&&S.oauthParams){if(o.flow==="standard"||o.flow==="hybrid"){if((S.oauthParams.code||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}else if(o.flow==="implicit"&&(S.oauthParams.access_token||S.oauthParams.error)&&S.oauthParams.state)return S.oauthParams.newUrl=u,S.oauthParams}}function A(s,a){for(var m=s.split("&"),b={paramsString:"",oauthParams:{}},u=0;u<m.length;u++){var S=m[u].indexOf("="),w=m[u].slice(0,S);a.indexOf(w)!==-1?b.oauthParams[w]=m[u].slice(S+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=m[u])}return b}function E(){var s={setSuccess:function(a){s.resolve(a)},setError:function(a){s.reject(a)}};return s.promise=new Promise(function(a,m){s.resolve=a,s.reject=m}),s}function k(s,a,m){var b=null,u=new Promise(function(S,w){b=setTimeout(function(){w({error:m||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([s,u]).finally(function(){clearTimeout(b)})}function i(){var s=E();if(!x.enable||x.iframe)return s.setSuccess(),s.promise;var a=document.createElement("iframe");x.iframe=a,a.onload=function(){var u=o.endpoints.authorize();u.charAt(0)==="/"?x.iframeOrigin=Ie():x.iframeOrigin=u.substring(0,u.indexOf("/",8)),s.setSuccess()};var m=o.endpoints.checkSessionIframe();a.setAttribute("src",m),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(u){if(!(u.origin!==x.iframeOrigin||x.iframe.contentWindow!==u.source)&&(u.data=="unchanged"||u.data=="changed"||u.data=="error")){u.data!="unchanged"&&o.clearToken();for(var S=x.callbackList.splice(0,x.callbackList.length),w=S.length-1;w>=0;--w){var y=S[w];u.data=="error"?y.setError():y.setSuccess(u.data=="unchanged")}}};return window.addEventListener("message",b,!1),s.promise}function g(){x.enable&&o.token&&setTimeout(function(){T().then(function(s){s&&g()})},x.interval*1e3)}function T(){var s=E();if(x.iframe&&x.iframeOrigin){var a=o.clientId+" "+(o.sessionId?o.sessionId:"");x.callbackList.push(s);var m=x.iframeOrigin;x.callbackList.length==1&&x.iframe.contentWindow.postMessage(a,m)}else s.setSuccess();return s.promise}function z(){var s=E();if(x.enable||o.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",o.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var m=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(W(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
8
|
+
*/(function(t){(function(){var e="input is invalid type",n=typeof window=="object",o=n?window:{};o.JS_SHA256_NO_WINDOW&&(n=!1);var s=!n&&typeof self=="object",c=!o.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;c?o=fr:s&&(o=self);var E=!o.JS_SHA256_NO_COMMON_JS&&!0&&t.exports,I=!o.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),V=[-2147483648,8388608,32768,128],W=[24,16,8,0],ee=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],Le=["hex","array","digest","arrayBuffer"],z=[];(o.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"}),I&&(o.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(h){return typeof h=="object"&&h.buffer&&h.buffer.constructor===ArrayBuffer});var Oe=function(h,_){return function(P){return new D(_,!0).update(P)[h]()}},rt=function(h){var _=Oe("hex",h);c&&(_=ke(_,h)),_.create=function(){return new D(h)},_.update=function(k){return _.create().update(k)};for(var P=0;P<Le.length;++P){var A=Le[P];_[A]=Oe(A,h)}return _},ke=function(h,_){var P=Rn,A=Rn.Buffer,k=_?"sha224":"sha256",v;A.from&&!o.JS_SHA256_NO_BUFFER_FROM?v=A.from:v=function(m){return new A(m)};var O=function(m){if(typeof m=="string")return P.createHash(k).update(m,"utf8").digest("hex");if(m==null)throw new Error(e);return m.constructor===ArrayBuffer&&(m=new Uint8Array(m)),Array.isArray(m)||ArrayBuffer.isView(m)||m.constructor===A?P.createHash(k).update(v(m)).digest("hex"):h(m)};return O},it=function(h,_){return function(P,A){return new _e(P,_,!0).update(A)[h]()}},he=function(h){var _=it("hex",h);_.create=function(k){return new _e(k,h)},_.update=function(k,v){return _.create(k).update(v)};for(var P=0;P<Le.length;++P){var A=Le[P];_[A]=it(A,h)}return _};function D(h,_){_?(z[0]=z[16]=z[1]=z[2]=z[3]=z[4]=z[5]=z[6]=z[7]=z[8]=z[9]=z[10]=z[11]=z[12]=z[13]=z[14]=z[15]=0,this.blocks=z):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=h}D.prototype.update=function(h){if(!this.finalized){var _,P=typeof h;if(P!=="string"){if(P==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);_=!0}for(var A,k=0,v,O=h.length,m=this.blocks;k<O;){if(this.hashed&&(this.hashed=!1,m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),_)for(v=this.start;k<O&&v<64;++k)m[v>>2]|=h[k]<<W[v++&3];else for(v=this.start;k<O&&v<64;++k)A=h.charCodeAt(k),A<128?m[v>>2]|=A<<W[v++&3]:A<2048?(m[v>>2]|=(192|A>>6)<<W[v++&3],m[v>>2]|=(128|A&63)<<W[v++&3]):A<55296||A>=57344?(m[v>>2]|=(224|A>>12)<<W[v++&3],m[v>>2]|=(128|A>>6&63)<<W[v++&3],m[v>>2]|=(128|A&63)<<W[v++&3]):(A=65536+((A&1023)<<10|h.charCodeAt(++k)&1023),m[v>>2]|=(240|A>>18)<<W[v++&3],m[v>>2]|=(128|A>>12&63)<<W[v++&3],m[v>>2]|=(128|A>>6&63)<<W[v++&3],m[v>>2]|=(128|A&63)<<W[v++&3]);this.lastByteIndex=v,this.bytes+=v-this.start,v>=64?(this.block=m[16],this.start=v-64,this.hash(),this.hashed=!0):this.start=v}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},D.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>2]|=V[_&3],this.block=h[16],_>=56&&(this.hashed||this.hash(),h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),h[14]=this.hBytes<<3|this.bytes>>>29,h[15]=this.bytes<<3,this.hash()}},D.prototype.hash=function(){var h=this.h0,_=this.h1,P=this.h2,A=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=this.blocks,q,J,Y,ce,B,pe,r,a,f,b,p;for(q=16;q<64;++q)B=F[q-15],J=(B>>>7|B<<25)^(B>>>18|B<<14)^B>>>3,B=F[q-2],Y=(B>>>17|B<<15)^(B>>>19|B<<13)^B>>>10,F[q]=F[q-16]+J+F[q-7]+Y<<0;for(p=_&P,q=0;q<64;q+=4)this.first?(this.is224?(a=300032,B=F[0]-1413257819,m=B-150054599<<0,A=B+24177077<<0):(a=704751109,B=F[0]-210244248,m=B-1521486534<<0,A=B+143694565<<0),this.first=!1):(J=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),Y=(k>>>6|k<<26)^(k>>>11|k<<21)^(k>>>25|k<<7),a=h&_,ce=a^h&P^p,r=k&v^~k&O,B=m+Y+r+ee[q]+F[q],pe=J+ce,m=A+B<<0,A=B+pe<<0),J=(A>>>2|A<<30)^(A>>>13|A<<19)^(A>>>22|A<<10),Y=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),f=A&h,ce=f^A&_^a,r=m&k^~m&v,B=O+Y+r+ee[q+1]+F[q+1],pe=J+ce,O=P+B<<0,P=B+pe<<0,J=(P>>>2|P<<30)^(P>>>13|P<<19)^(P>>>22|P<<10),Y=(O>>>6|O<<26)^(O>>>11|O<<21)^(O>>>25|O<<7),b=P&A,ce=b^P&h^f,r=O&m^~O&k,B=v+Y+r+ee[q+2]+F[q+2],pe=J+ce,v=_+B<<0,_=B+pe<<0,J=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),Y=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),p=_&P,ce=p^_&A^b,r=v&O^~v&m,B=k+Y+r+ee[q+3]+F[q+3],pe=J+ce,k=h+B<<0,h=B+pe<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+h<<0,this.h1=this.h1+_<<0,this.h2=this.h2+P<<0,this.h3=this.h3+A<<0,this.h4=this.h4+k<<0,this.h5=this.h5+v<<0,this.h6=this.h6+O<<0,this.h7=this.h7+m<<0},D.prototype.hex=function(){this.finalize();var h=this.h0,_=this.h1,P=this.h2,A=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=d[h>>28&15]+d[h>>24&15]+d[h>>20&15]+d[h>>16&15]+d[h>>12&15]+d[h>>8&15]+d[h>>4&15]+d[h&15]+d[_>>28&15]+d[_>>24&15]+d[_>>20&15]+d[_>>16&15]+d[_>>12&15]+d[_>>8&15]+d[_>>4&15]+d[_&15]+d[P>>28&15]+d[P>>24&15]+d[P>>20&15]+d[P>>16&15]+d[P>>12&15]+d[P>>8&15]+d[P>>4&15]+d[P&15]+d[A>>28&15]+d[A>>24&15]+d[A>>20&15]+d[A>>16&15]+d[A>>12&15]+d[A>>8&15]+d[A>>4&15]+d[A&15]+d[k>>28&15]+d[k>>24&15]+d[k>>20&15]+d[k>>16&15]+d[k>>12&15]+d[k>>8&15]+d[k>>4&15]+d[k&15]+d[v>>28&15]+d[v>>24&15]+d[v>>20&15]+d[v>>16&15]+d[v>>12&15]+d[v>>8&15]+d[v>>4&15]+d[v&15]+d[O>>28&15]+d[O>>24&15]+d[O>>20&15]+d[O>>16&15]+d[O>>12&15]+d[O>>8&15]+d[O>>4&15]+d[O&15];return this.is224||(F+=d[m>>28&15]+d[m>>24&15]+d[m>>20&15]+d[m>>16&15]+d[m>>12&15]+d[m>>8&15]+d[m>>4&15]+d[m&15]),F},D.prototype.toString=D.prototype.hex,D.prototype.digest=function(){this.finalize();var h=this.h0,_=this.h1,P=this.h2,A=this.h3,k=this.h4,v=this.h5,O=this.h6,m=this.h7,F=[h>>24&255,h>>16&255,h>>8&255,h&255,_>>24&255,_>>16&255,_>>8&255,_&255,P>>24&255,P>>16&255,P>>8&255,P&255,A>>24&255,A>>16&255,A>>8&255,A&255,k>>24&255,k>>16&255,k>>8&255,k&255,v>>24&255,v>>16&255,v>>8&255,v&255,O>>24&255,O>>16&255,O>>8&255,O&255];return this.is224||F.push(m>>24&255,m>>16&255,m>>8&255,m&255),F},D.prototype.array=D.prototype.digest,D.prototype.arrayBuffer=function(){this.finalize();var h=new ArrayBuffer(this.is224?28:32),_=new DataView(h);return _.setUint32(0,this.h0),_.setUint32(4,this.h1),_.setUint32(8,this.h2),_.setUint32(12,this.h3),_.setUint32(16,this.h4),_.setUint32(20,this.h5),_.setUint32(24,this.h6),this.is224||_.setUint32(28,this.h7),h};function _e(h,_,P){var A,k=typeof h;if(k==="string"){var v=[],O=h.length,m=0,F;for(A=0;A<O;++A)F=h.charCodeAt(A),F<128?v[m++]=F:F<2048?(v[m++]=192|F>>6,v[m++]=128|F&63):F<55296||F>=57344?(v[m++]=224|F>>12,v[m++]=128|F>>6&63,v[m++]=128|F&63):(F=65536+((F&1023)<<10|h.charCodeAt(++A)&1023),v[m++]=240|F>>18,v[m++]=128|F>>12&63,v[m++]=128|F>>6&63,v[m++]=128|F&63);h=v}else if(k==="object"){if(h===null)throw new Error(e);if(I&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!I||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);h.length>64&&(h=new D(_,!0).update(h).array());var q=[],J=[];for(A=0;A<64;++A){var Y=h[A]||0;q[A]=92^Y,J[A]=54^Y}D.call(this,_,P),this.update(J),this.oKeyPad=q,this.inner=!0,this.sharedMemory=P}_e.prototype=new D,_e.prototype.finalize=function(){if(D.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();D.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),D.prototype.finalize.call(this)}};var X=rt();X.sha256=X,X.sha224=rt(!0),X.sha256.hmac=he(),X.sha224.hmac=he(!0),E?t.exports=X:(o.sha256=X.sha256,o.sha224=X.sha224)})()})(Bn);var Ar=Bn.exports;const Cr=hr(Ar);class dt extends Error{}dt.prototype.name="InvalidTokenError";function Er(t){return decodeURIComponent(atob(t).replace(/(.)/g,(e,n)=>{let o=n.charCodeAt(0).toString(16).toUpperCase();return o.length<2&&(o="0"+o),"%"+o}))}function xr(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return Er(e)}catch{return atob(e)}}function Gt(t,e){if(typeof t!="string")throw new dt("Invalid token specified: must be a string");e||(e={});const n=e.header===!0?0:1,o=t.split(".")[n];if(typeof o!="string")throw new dt(`Invalid token specified: missing part #${n+1}`);let s;try{s=xr(o)}catch(c){throw new dt(`Invalid token specified: invalid base64 for part #${n+1} (${c.message})`)}try{return JSON.parse(s)}catch(c){throw new dt(`Invalid token specified: invalid json for part #${n+1} (${c.message})`)}}if(typeof Promise>"u")throw Error("Keycloak requires an environment that supports Promises. Make sure that you include the appropriate polyfill.");function On(t){if(!(this instanceof On))throw new Error("The 'Keycloak' constructor must be invoked with 'new'.");for(var e=this,n,o=[],s,c={enable:!0,callbackList:[],interval:5},E=document.getElementsByTagName("script"),I=0;I<E.length;I++)(E[I].src.indexOf("keycloak.js")!==-1||E[I].src.indexOf("keycloak.min.js")!==-1)&&E[I].src.indexOf("version=")!==-1&&(e.iframeVersion=E[I].src.substring(E[I].src.indexOf("version=")+8).split("&")[0]);var d=!0,V=pe(console.info),W=pe(console.warn);e.init=function(r){if(e.didInitialize)throw new Error("A 'Keycloak' instance can only be initialized once.");e.didInitialize=!0,e.authenticated=!1,s=B();var a=["default","cordova","cordova-native"];if(r&&a.indexOf(r.adapter)>-1?n=J(r.adapter):r&&typeof r.adapter=="object"?n=r.adapter:window.Cordova||window.cordova?n=J("cordova"):n=J(),r){if(typeof r.useNonce<"u"&&(d=r.useNonce),typeof r.checkLoginIframe<"u"&&(c.enable=r.checkLoginIframe),r.checkLoginIframeInterval&&(c.interval=r.checkLoginIframeInterval),r.onLoad==="login-required"&&(e.loginRequired=!0),r.responseMode)if(r.responseMode==="query"||r.responseMode==="fragment")e.responseMode=r.responseMode;else throw"Invalid value for responseMode";if(r.flow){switch(r.flow){case"standard":e.responseType="code";break;case"implicit":e.responseType="id_token token";break;case"hybrid":e.responseType="code id_token token";break;default:throw"Invalid value for flow"}e.flow=r.flow}if(r.timeSkew!=null&&(e.timeSkew=r.timeSkew),r.redirectUri&&(e.redirectUri=r.redirectUri),r.silentCheckSsoRedirectUri&&(e.silentCheckSsoRedirectUri=r.silentCheckSsoRedirectUri),typeof r.silentCheckSsoFallback=="boolean"?e.silentCheckSsoFallback=r.silentCheckSsoFallback:e.silentCheckSsoFallback=!0,r.pkceMethod){if(r.pkceMethod!=="S256")throw"Invalid value for pkceMethod";e.pkceMethod=r.pkceMethod}typeof r.enableLogging=="boolean"?e.enableLogging=r.enableLogging:e.enableLogging=!1,typeof r.scope=="string"&&(e.scope=r.scope),typeof r.acrValues=="string"&&(e.acrValues=r.acrValues),typeof r.messageReceiveTimeout=="number"&&r.messageReceiveTimeout>0?e.messageReceiveTimeout=r.messageReceiveTimeout:e.messageReceiveTimeout=1e4}e.responseMode||(e.responseMode="fragment"),e.responseType||(e.responseType="code",e.flow="standard");var f=k(),b=k();b.promise.then(function(){e.onReady&&e.onReady(e.authenticated),f.setSuccess(e.authenticated)}).catch(function(T){f.setError(T)});var p=D();function C(){var T=function($){$||(R.prompt="none"),r&&r.locale&&(R.locale=r.locale),e.login(R).then(function(){b.setSuccess()}).catch(function(me){b.setError(me)})},x=function(){var $=document.createElement("iframe"),me=e.createLoginUrl({prompt:"none",redirectUri:e.silentCheckSsoRedirectUri});$.setAttribute("src",me),$.setAttribute("sandbox","allow-scripts allow-same-origin"),$.setAttribute("title","keycloak-silent-check-sso"),$.style.display="none",document.body.appendChild($);var ue=function(te){if(!(te.origin!==window.location.origin||$.contentWindow!==te.source)){var Be=_(te.data);he(Be,b),document.body.removeChild($),window.removeEventListener("message",ue)}};window.addEventListener("message",ue)},R={};switch(r.onLoad){case"check-sso":c.enable?O().then(function(){F().then(function($){$?b.setSuccess():e.silentCheckSsoRedirectUri?x():T(!1)}).catch(function($){b.setError($)})}):e.silentCheckSsoRedirectUri?x():T(!1);break;case"login-required":T(!0);break;default:throw"Invalid value for onLoad"}}function g(){var T=_(window.location.href);if(T&&window.history.replaceState(window.history.state,null,T.newUrl),T&&T.valid)return O().then(function(){he(T,b)}).catch(function(x){b.setError(x)});r?r.token&&r.refreshToken?(X(r.token,r.refreshToken,r.idToken),c.enable?O().then(function(){F().then(function(x){x?(e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess(),m()):b.setSuccess()}).catch(function(x){b.setError(x)})}):e.updateToken(-1).then(function(){e.onAuthSuccess&&e.onAuthSuccess(),b.setSuccess()}).catch(function(x){e.onAuthError&&e.onAuthError(),r.onLoad?C():b.setError(x)})):r.onLoad?C():b.setSuccess():b.setSuccess()}function y(){var T=k(),x=function(){(document.readyState==="interactive"||document.readyState==="complete")&&(document.removeEventListener("readystatechange",x),T.setSuccess())};return document.addEventListener("readystatechange",x),x(),T.promise}return p.then(function(){y().then(q).then(g).catch(function(T){f.setError(T)})}),p.catch(function(T){f.setError(T)}),f.promise},e.login=function(r){return n.login(r)};function ee(r){var a=null,f=window.crypto||window.msCrypto;if(f&&f.getRandomValues&&window.Uint8Array)return a=new Uint8Array(r),f.getRandomValues(a),a;a=new Array(r);for(var b=0;b<a.length;b++)a[b]=Math.floor(256*Math.random());return a}function Le(r){return z(r,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789")}function z(r,a){for(var f=ee(r),b=new Array(r),p=0;p<r;p++)b[p]=a.charCodeAt(f[p]%a.length);return String.fromCharCode.apply(null,b)}function Oe(r,a){switch(r){case"S256":var f=new Uint8Array(Cr.arrayBuffer(a)),b=St.fromByteArray(f).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"");return b;default:throw"Invalid value for pkceMethod"}}function rt(r){var a={id_token:{acr:r}};return JSON.stringify(a)}e.createLoginUrl=function(r){var a=h(),f=h(),b=n.redirectUri(r),p={state:a,nonce:f,redirectUri:encodeURIComponent(b)};r&&r.prompt&&(p.prompt=r.prompt);var C;r&&r.action=="register"?C=e.endpoints.register():C=e.endpoints.authorize();var g=r&&r.scope||e.scope;g?g.indexOf("openid")===-1&&(g="openid "+g):g="openid";var y=C+"?client_id="+encodeURIComponent(e.clientId)+"&redirect_uri="+encodeURIComponent(b)+"&state="+encodeURIComponent(a)+"&response_mode="+encodeURIComponent(e.responseMode)+"&response_type="+encodeURIComponent(e.responseType)+"&scope="+encodeURIComponent(g);if(d&&(y=y+"&nonce="+encodeURIComponent(f)),r&&r.prompt&&(y+="&prompt="+encodeURIComponent(r.prompt)),r&&r.maxAge&&(y+="&max_age="+encodeURIComponent(r.maxAge)),r&&r.loginHint&&(y+="&login_hint="+encodeURIComponent(r.loginHint)),r&&r.idpHint&&(y+="&kc_idp_hint="+encodeURIComponent(r.idpHint)),r&&r.action&&r.action!="register"&&(y+="&kc_action="+encodeURIComponent(r.action)),r&&r.locale&&(y+="&ui_locales="+encodeURIComponent(r.locale)),r&&r.acr){var T=rt(r.acr);y+="&claims="+encodeURIComponent(T)}if((r&&r.acrValues||e.acrValues)&&(y+="&acr_values="+encodeURIComponent(r.acrValues||e.acrValues)),e.pkceMethod){var x=Le(96);p.pkceCodeVerifier=x;var R=Oe(e.pkceMethod,x);y+="&code_challenge="+R,y+="&code_challenge_method="+e.pkceMethod}return s.add(p),y},e.logout=function(r){return n.logout(r)},e.createLogoutUrl=function(r){var a=e.endpoints.logout()+"?client_id="+encodeURIComponent(e.clientId)+"&post_logout_redirect_uri="+encodeURIComponent(n.redirectUri(r,!1));return e.idToken&&(a+="&id_token_hint="+encodeURIComponent(e.idToken)),a},e.register=function(r){return n.register(r)},e.createRegisterUrl=function(r){return r||(r={}),r.action="register",e.createLoginUrl(r)},e.createAccountUrl=function(r){var a=ke(),f=void 0;return typeof a<"u"&&(f=a+"/account?referrer="+encodeURIComponent(e.clientId)+"&referrer_uri="+encodeURIComponent(n.redirectUri(r))),f},e.accountManagement=function(){return n.accountManagement()},e.hasRealmRole=function(r){var a=e.realmAccess;return!!a&&a.roles.indexOf(r)>=0},e.hasResourceRole=function(r,a){if(!e.resourceAccess)return!1;var f=e.resourceAccess[a||e.clientId];return!!f&&f.roles.indexOf(r)>=0},e.loadUserProfile=function(){var r=ke()+"/account",a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=k();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.profile=JSON.parse(a.responseText),f.setSuccess(e.profile)):f.setError())},a.send(),f.promise},e.loadUserInfo=function(){var r=e.endpoints.userinfo(),a=new XMLHttpRequest;a.open("GET",r,!0),a.setRequestHeader("Accept","application/json"),a.setRequestHeader("Authorization","bearer "+e.token);var f=k();return a.onreadystatechange=function(){a.readyState==4&&(a.status==200?(e.userInfo=JSON.parse(a.responseText),f.setSuccess(e.userInfo)):f.setError())},a.send(),f.promise},e.isTokenExpired=function(r){if(!e.tokenParsed||!e.refreshToken&&e.flow!="implicit")throw"Not authenticated";if(e.timeSkew==null)return V("[KEYCLOAK] Unable to determine if token is expired as timeskew is not set"),!0;var a=e.tokenParsed.exp-Math.ceil(new Date().getTime()/1e3)+e.timeSkew;if(r){if(isNaN(r))throw"Invalid minValidity";a-=r}return a<0},e.updateToken=function(r){var a=k();if(!e.refreshToken)return a.setError(),a.promise;r=r||5;var f=function(){var p=!1;if(r==-1?(p=!0,V("[KEYCLOAK] Refreshing token: forced refresh")):(!e.tokenParsed||e.isTokenExpired(r))&&(p=!0,V("[KEYCLOAK] Refreshing token: token expired")),!p)a.setSuccess(!1);else{var C="grant_type=refresh_token&refresh_token="+e.refreshToken,g=e.endpoints.token();if(o.push(a),o.length==1){var y=new XMLHttpRequest;y.open("POST",g,!0),y.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y.withCredentials=!0,C+="&client_id="+encodeURIComponent(e.clientId);var T=new Date().getTime();y.onreadystatechange=function(){if(y.readyState==4)if(y.status==200){V("[KEYCLOAK] Token refreshed"),T=(T+new Date().getTime())/2;var x=JSON.parse(y.responseText);X(x.access_token,x.refresh_token,x.id_token,T),e.onAuthRefreshSuccess&&e.onAuthRefreshSuccess();for(var R=o.pop();R!=null;R=o.pop())R.setSuccess(!0)}else{W("[KEYCLOAK] Failed to refresh token"),y.status==400&&e.clearToken(),e.onAuthRefreshError&&e.onAuthRefreshError();for(var R=o.pop();R!=null;R=o.pop())R.setError(!0)}},y.send(C)}}};if(c.enable){var b=F();b.then(function(){f()}).catch(function(p){a.setError(p)})}else f();return a.promise},e.clearToken=function(){e.token&&(X(null,null,null),e.onAuthLogout&&e.onAuthLogout(),e.loginRequired&&e.login())},e.setToken=X;function ke(){if(typeof e.authServerUrl<"u")return e.authServerUrl.charAt(e.authServerUrl.length-1)=="/"?e.authServerUrl+"realms/"+encodeURIComponent(e.realm):e.authServerUrl+"/realms/"+encodeURIComponent(e.realm)}function it(){return window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")}function he(r,a){var f=r.code,b=r.error,p=r.prompt,C=new Date().getTime();if(r.kc_action_status&&e.onActionUpdate&&e.onActionUpdate(r.kc_action_status),b){if(p!="none"){var g={error:b,error_description:r.error_description};e.onAuthError&&e.onAuthError(g),a&&a.setError(g)}else a&&a.setSuccess();return}else e.flow!="standard"&&(r.access_token||r.id_token)&&R(r.access_token,null,r.id_token,!0);if(e.flow!="implicit"&&f){var y="code="+f+"&grant_type=authorization_code",T=e.endpoints.token(),x=new XMLHttpRequest;x.open("POST",T,!0),x.setRequestHeader("Content-type","application/x-www-form-urlencoded"),y+="&client_id="+encodeURIComponent(e.clientId),y+="&redirect_uri="+r.redirectUri,r.pkceCodeVerifier&&(y+="&code_verifier="+r.pkceCodeVerifier),x.withCredentials=!0,x.onreadystatechange=function(){if(x.readyState==4)if(x.status==200){var $=JSON.parse(x.responseText);R($.access_token,$.refresh_token,$.id_token,e.flow==="standard"),m()}else e.onAuthError&&e.onAuthError(),a&&a.setError()},x.send(y)}function R($,me,ue,te){C=(C+new Date().getTime())/2,X($,me,ue,C),d&&(e.tokenParsed&&e.tokenParsed.nonce!=r.storedNonce||e.refreshTokenParsed&&e.refreshTokenParsed.nonce!=r.storedNonce||e.idTokenParsed&&e.idTokenParsed.nonce!=r.storedNonce)?(V("[KEYCLOAK] Invalid nonce, clearing token"),e.clearToken(),a&&a.setError()):te&&(e.onAuthSuccess&&e.onAuthSuccess(),a&&a.setSuccess())}}function D(r){var a=k(),f;t?typeof t=="string"&&(f=t):f=location.origin+"/keycloak.json";function b(x){x?e.endpoints={authorize:function(){return x.authorization_endpoint},token:function(){return x.token_endpoint},logout:function(){if(!x.end_session_endpoint)throw"Not supported by the OIDC server";return x.end_session_endpoint},checkSessionIframe:function(){if(!x.check_session_iframe)throw"Not supported by the OIDC server";return x.check_session_iframe},register:function(){throw'Redirection to "Register user" page not supported in standard OIDC mode'},userinfo:function(){if(!x.userinfo_endpoint)throw"Not supported by the OIDC server";return x.userinfo_endpoint}}:e.endpoints={authorize:function(){return ke()+"/protocol/openid-connect/auth"},token:function(){return ke()+"/protocol/openid-connect/token"},logout:function(){return ke()+"/protocol/openid-connect/logout"},checkSessionIframe:function(){var R=ke()+"/protocol/openid-connect/login-status-iframe.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},thirdPartyCookiesIframe:function(){var R=ke()+"/protocol/openid-connect/3p-cookies/step1.html";return e.iframeVersion&&(R=R+"?version="+e.iframeVersion),R},register:function(){return ke()+"/protocol/openid-connect/registrations"},userinfo:function(){return ke()+"/protocol/openid-connect/userinfo"}}}if(f){var p=new XMLHttpRequest;p.open("GET",f,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var x=JSON.parse(p.responseText);e.authServerUrl=x["auth-server-url"],e.realm=x.realm,e.clientId=x.resource,b(null),a.setSuccess()}else a.setError()},p.send()}else{if(!t.clientId)throw"clientId missing";e.clientId=t.clientId;var C=t.oidcProvider;if(C)if(typeof C=="string"){var T;C.charAt(C.length-1)=="/"?T=C+".well-known/openid-configuration":T=C+"/.well-known/openid-configuration";var p=new XMLHttpRequest;p.open("GET",T,!0),p.setRequestHeader("Accept","application/json"),p.onreadystatechange=function(){if(p.readyState==4)if(p.status==200||_e(p)){var R=JSON.parse(p.responseText);b(R),a.setSuccess()}else a.setError()},p.send()}else b(C),a.setSuccess();else{if(!t.url){for(var g=document.getElementsByTagName("script"),y=0;y<g.length;y++)if(g[y].src.match(/.*keycloak\.js/)){t.url=g[y].src.substr(0,g[y].src.indexOf("/js/keycloak.js"));break}}if(!t.realm)throw"realm missing";e.authServerUrl=t.url,e.realm=t.realm,b(null),a.setSuccess()}}return a.promise}function _e(r){return r.status==0&&r.responseText&&r.responseURL.startsWith("file:")}function X(r,a,f,b){if(e.tokenTimeoutHandle&&(clearTimeout(e.tokenTimeoutHandle),e.tokenTimeoutHandle=null),a?(e.refreshToken=a,e.refreshTokenParsed=Gt(a)):(delete e.refreshToken,delete e.refreshTokenParsed),f?(e.idToken=f,e.idTokenParsed=Gt(f)):(delete e.idToken,delete e.idTokenParsed),r){if(e.token=r,e.tokenParsed=Gt(r),e.sessionId=e.tokenParsed.session_state,e.authenticated=!0,e.subject=e.tokenParsed.sub,e.realmAccess=e.tokenParsed.realm_access,e.resourceAccess=e.tokenParsed.resource_access,b&&(e.timeSkew=Math.floor(b/1e3)-e.tokenParsed.iat),e.timeSkew!=null&&(V("[KEYCLOAK] Estimated time difference between browser and server is "+e.timeSkew+" seconds"),e.onTokenExpired)){var p=(e.tokenParsed.exp-new Date().getTime()/1e3+e.timeSkew)*1e3;V("[KEYCLOAK] Token expires in "+Math.round(p/1e3)+" s"),p<=0?e.onTokenExpired():e.tokenTimeoutHandle=setTimeout(e.onTokenExpired,p)}}else delete e.token,delete e.tokenParsed,delete e.subject,delete e.realmAccess,delete e.resourceAccess,e.authenticated=!1}function h(){var r="0123456789abcdef",a=z(36,r).split("");a[14]="4",a[19]=r.substr(a[19]&3|8,1),a[8]=a[13]=a[18]=a[23]="-";var f=a.join("");return f}function _(r){var a=P(r);if(a){var f=s.get(a.state);return f&&(a.valid=!0,a.redirectUri=f.redirectUri,a.storedNonce=f.nonce,a.prompt=f.prompt,a.pkceCodeVerifier=f.pkceCodeVerifier),a}}function P(r){var a;switch(e.flow){case"standard":a=["code","state","session_state","kc_action_status","iss"];break;case"implicit":a=["access_token","token_type","id_token","state","session_state","expires_in","kc_action_status","iss"];break;case"hybrid":a=["access_token","token_type","id_token","code","state","session_state","expires_in","kc_action_status","iss"];break}a.push("error"),a.push("error_description"),a.push("error_uri");var f=r.indexOf("?"),b=r.indexOf("#"),p,C;if(e.responseMode==="query"&&f!==-1?(p=r.substring(0,f),C=A(r.substring(f+1,b!==-1?b:r.length),a),C.paramsString!==""&&(p+="?"+C.paramsString),b!==-1&&(p+=r.substring(b))):e.responseMode==="fragment"&&b!==-1&&(p=r.substring(0,b),C=A(r.substring(b+1),a),C.paramsString!==""&&(p+="#"+C.paramsString)),C&&C.oauthParams){if(e.flow==="standard"||e.flow==="hybrid"){if((C.oauthParams.code||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=p,C.oauthParams}else if(e.flow==="implicit"&&(C.oauthParams.access_token||C.oauthParams.error)&&C.oauthParams.state)return C.oauthParams.newUrl=p,C.oauthParams}}function A(r,a){for(var f=r.split("&"),b={paramsString:"",oauthParams:{}},p=0;p<f.length;p++){var C=f[p].indexOf("="),g=f[p].slice(0,C);a.indexOf(g)!==-1?b.oauthParams[g]=f[p].slice(C+1):(b.paramsString!==""&&(b.paramsString+="&"),b.paramsString+=f[p])}return b}function k(){var r={setSuccess:function(a){r.resolve(a)},setError:function(a){r.reject(a)}};return r.promise=new Promise(function(a,f){r.resolve=a,r.reject=f}),r}function v(r,a,f){var b=null,p=new Promise(function(C,g){b=setTimeout(function(){g({error:f||"Promise is not settled within timeout of "+a+"ms"})},a)});return Promise.race([r,p]).finally(function(){clearTimeout(b)})}function O(){var r=k();if(!c.enable||c.iframe)return r.setSuccess(),r.promise;var a=document.createElement("iframe");c.iframe=a,a.onload=function(){var p=e.endpoints.authorize();p.charAt(0)==="/"?c.iframeOrigin=it():c.iframeOrigin=p.substring(0,p.indexOf("/",8)),r.setSuccess()};var f=e.endpoints.checkSessionIframe();a.setAttribute("src",f),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-session-iframe"),a.style.display="none",document.body.appendChild(a);var b=function(p){if(!(p.origin!==c.iframeOrigin||c.iframe.contentWindow!==p.source)&&(p.data=="unchanged"||p.data=="changed"||p.data=="error")){p.data!="unchanged"&&e.clearToken();for(var C=c.callbackList.splice(0,c.callbackList.length),g=C.length-1;g>=0;--g){var y=C[g];p.data=="error"?y.setError():y.setSuccess(p.data=="unchanged")}}};return window.addEventListener("message",b,!1),r.promise}function m(){c.enable&&e.token&&setTimeout(function(){F().then(function(r){r&&m()})},c.interval*1e3)}function F(){var r=k();if(c.iframe&&c.iframeOrigin){var a=e.clientId+" "+(e.sessionId?e.sessionId:"");c.callbackList.push(r);var f=c.iframeOrigin;c.callbackList.length==1&&c.iframe.contentWindow.postMessage(a,f)}else r.setSuccess();return r.promise}function q(){var r=k();if(c.enable||e.silentCheckSsoRedirectUri){var a=document.createElement("iframe");a.setAttribute("src",e.endpoints.thirdPartyCookiesIframe()),a.setAttribute("sandbox","allow-scripts allow-same-origin"),a.setAttribute("title","keycloak-3p-check-iframe"),a.style.display="none",document.body.appendChild(a);var f=function(b){a.contentWindow===b.source&&(b.data!=="supported"&&b.data!=="unsupported"||(b.data==="unsupported"&&(W(`[KEYCLOAK] Your browser is blocking access to 3rd-party cookies, this means:
|
|
9
9
|
|
|
10
10
|
- It is not possible to retrieve tokens without redirecting to the Keycloak server (a.k.a. no support for silent authentication).
|
|
11
11
|
- It is not possible to automatically detect changes to the session status (such as the user logging out in another tab).
|
|
12
12
|
|
|
13
|
-
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),x.enable=!1,o.silentCheckSsoFallback&&(o.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",m),s.setSuccess()))};window.addEventListener("message",m,!1)}else s.setSuccess();return k(s.promise,o.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function $(s){if(!s||s=="default")return{login:function(w){return window.location.assign(o.createLoginUrl(w)),E().promise},logout:function(w){return window.location.replace(o.createLogoutUrl(w)),E().promise},register:function(w){return window.location.assign(o.createRegisterUrl(w)),E().promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.location.href=w;else throw"Not supported by the OIDC server";return E().promise},redirectUri:function(w,y){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:location.href}};if(s=="cordova"){x.enable=!1;var a=function(w,y,_){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(w,y,_):window.open(w,y,_)},m=function(w){return w&&w.cordovaOptions?Object.keys(w.cordovaOptions).reduce(function(y,_){return y[_]=w.cordovaOptions[_],y},{}):{}},b=function(w){return Object.keys(w).reduce(function(y,_){return y.push(_+"="+w[_]),y},[]).join(",")},u=function(w){var y=m(w);return y.location="no",w&&w.prompt=="none"&&(y.hidden="yes"),b(y)},S=function(){return o.redirectUri||"http://localhost"};return{login:function(w){var y=E(),_=u(w),B=o.createLoginUrl(w),M=a(B,"_blank",_),H=!1,he=!1,pe=function(){he=!0,M.close()};return M.addEventListener("loadstart",function(ne){if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}}),M.addEventListener("loaderror",function(ne){if(!H)if(ne.url.indexOf(S())==0){var ye=C(ne.url);fe(ye,y),pe(),H=!0}else y.setError(),pe()}),M.addEventListener("exit",function(ne){he||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w),B=a(_,"_blank","location=no,hidden=yes,clearcache=yes"),M;return B.addEventListener("loadstart",function(H){H.url.indexOf(S())==0&&B.close()}),B.addEventListener("loaderror",function(H){H.url.indexOf(S())==0||(M=!0),B.close()}),B.addEventListener("exit",function(H){M?y.setError():(o.clearToken(),y.setSuccess())}),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(),B=u(w),M=a(_,"_blank",B);return M.addEventListener("loadstart",function(H){if(H.url.indexOf(S())==0){M.close();var he=C(H.url);fe(he,y)}}),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u"){var y=a(w,"_blank","location=no");y.addEventListener("loadstart",function(_){_.url.indexOf(S())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(w){return S()}}}if(s=="cordova-native")return x.enable=!1,{login:function(w){var y=E(),_=o.createLoginUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(B.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},logout:function(w){var y=E(),_=o.createLogoutUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),o.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(_),y.promise},register:function(w){var y=E(),_=o.createRegisterUrl(w);return universalLinks.subscribe("keycloak",function(B){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var M=C(B.url);fe(M,y)}),window.cordova.plugins.browsertab.openUrl(_),y.promise},accountManagement:function(){var w=o.createAccountUrl();if(typeof w<"u")window.cordova.plugins.browsertab.openUrl(w);else throw"Not supported by the OIDC server"},redirectUri:function(w){return w&&w.redirectUri?w.redirectUri:o.redirectUri?o.redirectUri:"http://localhost"}};throw"invalid adapter type: "+s}var F=function(){if(!(this instanceof F))return new F;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var s=this;function a(){for(var m=new Date().getTime(),b=0;b<localStorage.length;b++){var u=localStorage.key(b);if(u&&u.indexOf("kc-callback-")==0){var S=localStorage.getItem(u);if(S)try{var w=JSON.parse(S).expires;(!w||w<m)&&localStorage.removeItem(u)}catch{localStorage.removeItem(u)}}}}s.get=function(m){if(m){var b="kc-callback-"+m,u=localStorage.getItem(b);return u&&(localStorage.removeItem(b),u=JSON.parse(u)),a(),u}},s.add=function(m){a();var b="kc-callback-"+m.state;m.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(m))}},G=function(){if(!(this instanceof G))return new G;var s=this;s.get=function(u){if(u){var S=m("kc-callback-"+u);if(b("kc-callback-"+u,"",a(-100)),S)return JSON.parse(S)}},s.add=function(u){b("kc-callback-"+u.state,JSON.stringify(u),a(60))},s.removeItem=function(u){b(u,"",a(-100))};var a=function(u){var S=new Date;return S.setTime(S.getTime()+u*60*1e3),S},m=function(u){for(var S=u+"=",w=document.cookie.split(";"),y=0;y<w.length;y++){for(var _=w[y];_.charAt(0)==" ";)_=_.substring(1);if(_.indexOf(S)==0)return _.substring(S.length,_.length)}return""},b=function(u,S,w){var y=u+"="+S+"; expires="+w.toUTCString()+"; ";document.cookie=y}};function N(){try{return new F}catch{}return new G}function te(s){return function(){o.enableLogging&&s.apply(console,Array.prototype.slice.call(arguments))}}}const We=new vt,En=(l,o)=>{We.init({onLoad:"login-required"}).then(async h=>{h&&await _n(),l()}).catch(h=>{o(h)})},_n=async()=>{const l=await We.loadUserInfo();ee.User.email=l.email??"",ee.User.emailVerified=l.email_verified===!0,ee.User.firstName=l.given_name??"",ee.User.lastName=l.family_name??"",ee.User.name=l.name??"",ee.User.sub=l.sub??"",ee.User.username=l.preferred_username??"",ee.User.roles=[...l.role??[]],ee.User.groups=[...l.group??[]],ee.User.IsInRole=o=>ee.User.roles.includes(o)},ee={Instance:We,User:{},CallLogin:En,CallLogout:()=>{We.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}};var kt={exports:{}};/*!
|
|
14
|
-
* sweetalert2 v11.4.8
|
|
15
|
-
* Released under the MIT License.
|
|
16
|
-
*/(function(l,o){(function(h,v){l.exports=v()})(ke,function(){const h="SweetAlert2:",v=e=>{const t=[];for(let n=0;n<e.length;n++)t.indexOf(e[n])===-1&&t.push(e[n]);return t},U=e=>e.charAt(0).toUpperCase()+e.slice(1),x=e=>Array.prototype.slice.call(e),I=e=>{console.warn("".concat(h," ").concat(typeof e=="object"?e.join(" "):e))},O=e=>{console.error("".concat(h," ").concat(e))},p=[],K=e=>{p.includes(e)||(p.push(e),I(e))},W=(e,t)=>{K('"'.concat(e,'" is deprecated and will be removed in the next major release. Please use "').concat(t,'" instead.'))},X=e=>typeof e=="function"?e():e,ae=e=>e&&typeof e.toPromise=="function",j=e=>ae(e)?e.toPromise():Promise.resolve(e),Ce=e=>e&&Promise.resolve(e)===e,ge={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},ce=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Ie={},fe=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],J=e=>Object.prototype.hasOwnProperty.call(ge,e),we=e=>ce.indexOf(e)!==-1,Z=e=>Ie[e],d=e=>{J(e)||I('Unknown parameter "'.concat(e,'"'))},C=e=>{fe.includes(e)&&I('The parameter "'.concat(e,'" is incompatible with toasts'))},L=e=>{Z(e)&&W(e,Z(e))},A=e=>{!e.backdrop&&e.allowOutsideClick&&I('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const t in e)d(t),e.toast&&C(t),L(t)},E="swal2-",k=e=>{const t={};for(const n in e)t[e[n]]=E+e[n];return t},i=k(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),g=k(["success","warning","info","question","error"]),T=()=>document.body.querySelector(".".concat(i.container)),z=e=>{const t=T();return t?t.querySelector(e):null},$=e=>z(".".concat(e)),F=()=>$(i.popup),G=()=>$(i.icon),N=()=>$(i.title),te=()=>$(i["html-container"]),s=()=>$(i.image),a=()=>$(i["progress-steps"]),m=()=>$(i["validation-message"]),b=()=>z(".".concat(i.actions," .").concat(i.confirm)),u=()=>z(".".concat(i.actions," .").concat(i.deny)),S=()=>$(i["input-label"]),w=()=>z(".".concat(i.loader)),y=()=>z(".".concat(i.actions," .").concat(i.cancel)),_=()=>$(i.actions),B=()=>$(i.footer),M=()=>$(i["timer-progress-bar"]),H=()=>$(i.close),he=`
|
|
13
|
+
For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_modern_browsers`),c.enable=!1,e.silentCheckSsoFallback&&(e.silentCheckSsoRedirectUri=!1)),document.body.removeChild(a),window.removeEventListener("message",f),r.setSuccess()))};window.addEventListener("message",f,!1)}else r.setSuccess();return v(r.promise,e.messageReceiveTimeout,"Timeout when waiting for 3rd party check iframe message.")}function J(r){if(!r||r=="default")return{login:function(g){return window.location.assign(e.createLoginUrl(g)),k().promise},logout:function(g){return window.location.replace(e.createLogoutUrl(g)),k().promise},register:function(g){return window.location.assign(e.createRegisterUrl(g)),k().promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.location.href=g;else throw"Not supported by the OIDC server";return k().promise},redirectUri:function(g,y){return g&&g.redirectUri?g.redirectUri:e.redirectUri?e.redirectUri:location.href}};if(r=="cordova"){c.enable=!1;var a=function(g,y,T){return window.cordova&&window.cordova.InAppBrowser?window.cordova.InAppBrowser.open(g,y,T):window.open(g,y,T)},f=function(g){return g&&g.cordovaOptions?Object.keys(g.cordovaOptions).reduce(function(y,T){return y[T]=g.cordovaOptions[T],y},{}):{}},b=function(g){return Object.keys(g).reduce(function(y,T){return y.push(T+"="+g[T]),y},[]).join(",")},p=function(g){var y=f(g);return y.location="no",g&&g.prompt=="none"&&(y.hidden="yes"),b(y)},C=function(){return e.redirectUri||"http://localhost"};return{login:function(g){var y=k(),T=p(g),x=e.createLoginUrl(g),R=a(x,"_blank",T),$=!1,me=!1,ue=function(){me=!0,R.close()};return R.addEventListener("loadstart",function(te){if(te.url.indexOf(C())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}}),R.addEventListener("loaderror",function(te){if(!$)if(te.url.indexOf(C())==0){var Be=_(te.url);he(Be,y),ue(),$=!0}else y.setError(),ue()}),R.addEventListener("exit",function(te){me||y.setError({reason:"closed_by_user"})}),y.promise},logout:function(g){var y=k(),T=e.createLogoutUrl(g),x=a(T,"_blank","location=no,hidden=yes,clearcache=yes"),R;return x.addEventListener("loadstart",function($){$.url.indexOf(C())==0&&x.close()}),x.addEventListener("loaderror",function($){$.url.indexOf(C())==0||(R=!0),x.close()}),x.addEventListener("exit",function($){R?y.setError():(e.clearToken(),y.setSuccess())}),y.promise},register:function(g){var y=k(),T=e.createRegisterUrl(),x=p(g),R=a(T,"_blank",x);return R.addEventListener("loadstart",function($){if($.url.indexOf(C())==0){R.close();var me=_($.url);he(me,y)}}),y.promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u"){var y=a(g,"_blank","location=no");y.addEventListener("loadstart",function(T){T.url.indexOf(C())==0&&y.close()})}else throw"Not supported by the OIDC server"},redirectUri:function(g){return C()}}}if(r=="cordova-native")return c.enable=!1,{login:function(g){var y=k(),T=e.createLoginUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(T),y.promise},logout:function(g){var y=k(),T=e.createLogoutUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close(),e.clearToken(),y.setSuccess()}),window.cordova.plugins.browsertab.openUrl(T),y.promise},register:function(g){var y=k(),T=e.createRegisterUrl(g);return universalLinks.subscribe("keycloak",function(x){universalLinks.unsubscribe("keycloak"),window.cordova.plugins.browsertab.close();var R=_(x.url);he(R,y)}),window.cordova.plugins.browsertab.openUrl(T),y.promise},accountManagement:function(){var g=e.createAccountUrl();if(typeof g<"u")window.cordova.plugins.browsertab.openUrl(g);else throw"Not supported by the OIDC server"},redirectUri:function(g){return g&&g.redirectUri?g.redirectUri:e.redirectUri?e.redirectUri:"http://localhost"}};throw"invalid adapter type: "+r}var Y=function(){if(!(this instanceof Y))return new Y;localStorage.setItem("kc-test","test"),localStorage.removeItem("kc-test");var r=this;function a(){for(var f=new Date().getTime(),b=0;b<localStorage.length;b++){var p=localStorage.key(b);if(p&&p.indexOf("kc-callback-")==0){var C=localStorage.getItem(p);if(C)try{var g=JSON.parse(C).expires;(!g||g<f)&&localStorage.removeItem(p)}catch{localStorage.removeItem(p)}}}}r.get=function(f){if(f){var b="kc-callback-"+f,p=localStorage.getItem(b);return p&&(localStorage.removeItem(b),p=JSON.parse(p)),a(),p}},r.add=function(f){a();var b="kc-callback-"+f.state;f.expires=new Date().getTime()+60*60*1e3,localStorage.setItem(b,JSON.stringify(f))}},ce=function(){if(!(this instanceof ce))return new ce;var r=this;r.get=function(p){if(p){var C=f("kc-callback-"+p);if(b("kc-callback-"+p,"",a(-100)),C)return JSON.parse(C)}},r.add=function(p){b("kc-callback-"+p.state,JSON.stringify(p),a(60))},r.removeItem=function(p){b(p,"",a(-100))};var a=function(p){var C=new Date;return C.setTime(C.getTime()+p*60*1e3),C},f=function(p){for(var C=p+"=",g=document.cookie.split(";"),y=0;y<g.length;y++){for(var T=g[y];T.charAt(0)==" ";)T=T.substring(1);if(T.indexOf(C)==0)return T.substring(C.length,T.length)}return""},b=function(p,C,g){var y=p+"="+C+"; expires="+g.toUTCString()+"; ";document.cookie=y}};function B(){try{return new Y}catch{}return new ce}function pe(r){return function(){e.enableLogging&&r.apply(console,Array.prototype.slice.call(arguments))}}}const Lt=new On,Tr=(t,e)=>{Lt.init({onLoad:"login-required"}).then(async n=>{n&&await Sr(),t()}).catch(n=>{e(n)})},Sr=async()=>{const t=await Lt.loadUserInfo();ne.User.email=t.email??"",ne.User.emailVerified=t.email_verified===!0,ne.User.firstName=t.given_name??"",ne.User.lastName=t.family_name??"",ne.User.name=t.name??"",ne.User.sub=t.sub??"",ne.User.username=t.preferred_username??"",ne.User.roles=[...t.role??[]],ne.User.groups=[...t.group??[]],ne.User.IsInRole=e=>ne.User.roles.includes(e)},ne={Instance:Lt,User:{},CallLogin:Tr,CallLogout:()=>{Lt.logout({redirectUri:location.origin}).then(()=>{sessionStorage.removeItem("user-info")})}},Fn="SweetAlert2:",Lr=t=>{const e=[];for(let n=0;n<t.length;n++)e.indexOf(t[n])===-1&&e.push(t[n]);return e},Yt=t=>t.charAt(0).toUpperCase()+t.slice(1),ye=t=>Array.prototype.slice.call(t),de=t=>{console.warn(`${Fn} ${typeof t=="object"?t.join(" "):t}`)},$e=t=>{console.error(`${Fn} ${t}`)},Mn=[],Ir=t=>{Mn.includes(t)||(Mn.push(t),de(t))},Pr=(t,e)=>{Ir(`"${t}" is deprecated and will be removed in the next major release. Please use "${e}" instead.`)},It=t=>typeof t=="function"?t():t,Jt=t=>t&&typeof t.toPromise=="function",ft=t=>Jt(t)?t.toPromise():Promise.resolve(t),Xt=t=>t&&Promise.resolve(t)===t,Je={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose:void 0,didDestroy:void 0,scrollbarPadding:!0},Br=["allowEscapeKey","allowOutsideClick","background","buttonsStyling","cancelButtonAriaLabel","cancelButtonColor","cancelButtonText","closeButtonAriaLabel","closeButtonHtml","color","confirmButtonAriaLabel","confirmButtonColor","confirmButtonText","currentProgressStep","customClass","denyButtonAriaLabel","denyButtonColor","denyButtonText","didClose","didDestroy","footer","hideClass","html","icon","iconColor","iconHtml","imageAlt","imageHeight","imageUrl","imageWidth","preConfirm","preDeny","progressSteps","returnFocus","reverseButtons","showCancelButton","showCloseButton","showConfirmButton","showDenyButton","text","title","titleText","willClose"],Rr={},Or=["allowOutsideClick","allowEnterKey","backdrop","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],Nn=t=>Object.prototype.hasOwnProperty.call(Je,t),Un=t=>Br.indexOf(t)!==-1,Zt=t=>Rr[t],Fr=t=>{Nn(t)||de(`Unknown parameter "${t}"`)},Mr=t=>{Or.includes(t)&&de(`The parameter "${t}" is incompatible with toasts`)},Nr=t=>{Zt(t)&&Pr(t,Zt(t))},Ur=t=>{!t.backdrop&&t.allowOutsideClick&&de('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`');for(const e in t)Fr(e),t.toast&&Mr(e),Nr(e)},Dr="swal2-",Dn=t=>{const e={};for(const n in t)e[t[n]]=Dr+t[n];return e},u=Dn(["container","shown","height-auto","iosfix","popup","modal","no-backdrop","no-transition","toast","toast-shown","show","hide","close","title","html-container","actions","confirm","deny","cancel","default-outline","footer","icon","icon-content","image","input","file","range","select","radio","checkbox","label","textarea","inputerror","input-label","validation-message","progress-steps","active-progress-step","progress-step","progress-step-line","loader","loading","styled","top","top-start","top-end","top-left","top-right","center","center-start","center-end","center-left","center-right","bottom","bottom-start","bottom-end","bottom-left","bottom-right","grow-row","grow-column","grow-fullscreen","rtl","timer-progress-bar","timer-progress-bar-container","scrollbar-measure","icon-success","icon-warning","icon-info","icon-question","icon-error"]),ht=Dn(["success","warning","info","question","error"]),oe=()=>document.body.querySelector(`.${u.container}`),pt=t=>{const e=oe();return e?e.querySelector(t):null},Ce=t=>pt(`.${t}`),j=()=>Ce(u.popup),mt=()=>Ce(u.icon),$n=()=>Ce(u.title),Pt=()=>Ce(u["html-container"]),Hn=()=>Ce(u.image),Vn=()=>Ce(u["progress-steps"]),Bt=()=>Ce(u["validation-message"]),Te=()=>pt(`.${u.actions} .${u.confirm}`),Ne=()=>pt(`.${u.actions} .${u.deny}`),$r=()=>Ce(u["input-label"]),Xe=()=>pt(`.${u.loader}`),He=()=>pt(`.${u.actions} .${u.cancel}`),gt=()=>Ce(u.actions),jn=()=>Ce(u.footer),Rt=()=>Ce(u["timer-progress-bar"]),Qt=()=>Ce(u.close),Hr=`
|
|
17
14
|
a[href],
|
|
18
15
|
area[href],
|
|
19
16
|
input:not([disabled]),
|
|
@@ -28,53 +25,56 @@ For more information see: https://www.keycloak.org/docs/latest/securing_apps/#_m
|
|
|
28
25
|
audio[controls],
|
|
29
26
|
video[controls],
|
|
30
27
|
summary
|
|
31
|
-
`,
|
|
32
|
-
<div aria-labelledby="
|
|
33
|
-
<button type="button" class="
|
|
34
|
-
<ul class="
|
|
35
|
-
<div class="
|
|
36
|
-
<img class="
|
|
37
|
-
<h2 class="
|
|
38
|
-
<div class="
|
|
39
|
-
<input class="
|
|
40
|
-
<input type="file" class="
|
|
41
|
-
<div class="
|
|
28
|
+
`,en=()=>{const t=ye(j().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')).sort((n,o)=>{const s=parseInt(n.getAttribute("tabindex")),c=parseInt(o.getAttribute("tabindex"));return s>c?1:s<c?-1:0}),e=ye(j().querySelectorAll(Hr)).filter(n=>n.getAttribute("tabindex")!=="-1");return Lr(t.concat(e)).filter(n=>we(n))},tn=()=>Re(document.body,u.shown)&&!Re(document.body,u["toast-shown"])&&!Re(document.body,u["no-backdrop"]),Ot=()=>j()&&Re(j(),u.toast),Vr=()=>j().hasAttribute("data-loading"),Ze={previousBodyPadding:null},re=(t,e)=>{if(t.textContent="",e){const o=new DOMParser().parseFromString(e,"text/html");ye(o.querySelector("head").childNodes).forEach(s=>{t.appendChild(s)}),ye(o.querySelector("body").childNodes).forEach(s=>{t.appendChild(s)})}},Re=(t,e)=>{if(!e)return!1;const n=e.split(/\s+/);for(let o=0;o<n.length;o++)if(!t.classList.contains(n[o]))return!1;return!0},jr=(t,e)=>{ye(t.classList).forEach(n=>{!Object.values(u).includes(n)&&!Object.values(ht).includes(n)&&!Object.values(e.showClass).includes(n)&&t.classList.remove(n)})},Ee=(t,e,n)=>{if(jr(t,e),e.customClass&&e.customClass[n]){if(typeof e.customClass[n]!="string"&&!e.customClass[n].forEach)return de(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof e.customClass[n]}"`);H(t,e.customClass[n])}},nn=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(`.${u.popup} > .${u[e]}`);case"checkbox":return t.querySelector(`.${u.popup} > .${u.checkbox} input`);case"radio":return t.querySelector(`.${u.popup} > .${u.radio} input:checked`)||t.querySelector(`.${u.popup} > .${u.radio} input:first-child`);case"range":return t.querySelector(`.${u.popup} > .${u.range} input`);default:return t.querySelector(`.${u.popup} > .${u.input}`)}},zn=t=>{if(t.focus(),t.type!=="file"){const e=t.value;t.value="",t.value=e}},Wn=(t,e,n)=>{!t||!e||(typeof e=="string"&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(o=>{Array.isArray(t)?t.forEach(s=>{n?s.classList.add(o):s.classList.remove(o)}):n?t.classList.add(o):t.classList.remove(o)}))},H=(t,e)=>{Wn(t,e,!0)},Pe=(t,e)=>{Wn(t,e,!1)},Ue=(t,e)=>{const n=ye(t.childNodes);for(let o=0;o<n.length;o++)if(Re(n[o],e))return n[o]},bt=(t,e,n)=>{n===`${parseInt(n)}`&&(n=parseInt(n)),n||parseInt(n)===0?t.style[e]=typeof n=="number"?`${n}px`:n:t.style.removeProperty(e)},Q=(t,e="flex")=>{t.style.display=e},ie=t=>{t.style.display="none"},qn=(t,e,n,o)=>{const s=t.querySelector(e);s&&(s.style[n]=o)},Ft=(t,e,n)=>{e?Q(t,n):ie(t)},we=t=>!!(t&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),zr=()=>!we(Te())&&!we(Ne())&&!we(He()),Kn=t=>t.scrollHeight>t.clientHeight,Gn=t=>{const e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),o=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||o>0},on=(t,e=!1)=>{const n=Rt();we(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition=`width ${t/1e3}s linear`,n.style.width="0%"},10))},Wr=()=>{const t=Rt(),e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const n=parseInt(window.getComputedStyle(t).width),o=e/n*100;t.style.removeProperty("transition"),t.style.width=`${o}%`},Yn=()=>typeof window>"u"||typeof document>"u",qr=100,M={},Kr=()=>{M.previousActiveElement&&M.previousActiveElement.focus?(M.previousActiveElement.focus(),M.previousActiveElement=null):document.body&&document.body.focus()},Gr=t=>new Promise(e=>{if(!t)return e();const n=window.scrollX,o=window.scrollY;M.restoreFocusTimeout=setTimeout(()=>{Kr(),e()},qr),window.scrollTo(n,o)}),Yr=`
|
|
29
|
+
<div aria-labelledby="${u.title}" aria-describedby="${u["html-container"]}" class="${u.popup}" tabindex="-1">
|
|
30
|
+
<button type="button" class="${u.close}"></button>
|
|
31
|
+
<ul class="${u["progress-steps"]}"></ul>
|
|
32
|
+
<div class="${u.icon}"></div>
|
|
33
|
+
<img class="${u.image}" />
|
|
34
|
+
<h2 class="${u.title}" id="${u.title}"></h2>
|
|
35
|
+
<div class="${u["html-container"]}" id="${u["html-container"]}"></div>
|
|
36
|
+
<input class="${u.input}" />
|
|
37
|
+
<input type="file" class="${u.file}" />
|
|
38
|
+
<div class="${u.range}">
|
|
42
39
|
<input type="range" />
|
|
43
40
|
<output></output>
|
|
44
41
|
</div>
|
|
45
|
-
<select class="
|
|
46
|
-
<div class="
|
|
47
|
-
<label for="
|
|
42
|
+
<select class="${u.select}"></select>
|
|
43
|
+
<div class="${u.radio}"></div>
|
|
44
|
+
<label for="${u.checkbox}" class="${u.checkbox}">
|
|
48
45
|
<input type="checkbox" />
|
|
49
|
-
<span class="
|
|
46
|
+
<span class="${u.label}"></span>
|
|
50
47
|
</label>
|
|
51
|
-
<textarea class="
|
|
52
|
-
<div class="
|
|
53
|
-
<div class="
|
|
54
|
-
<div class="
|
|
55
|
-
<button type="button" class="
|
|
56
|
-
<button type="button" class="
|
|
57
|
-
<button type="button" class="
|
|
48
|
+
<textarea class="${u.textarea}"></textarea>
|
|
49
|
+
<div class="${u["validation-message"]}" id="${u["validation-message"]}"></div>
|
|
50
|
+
<div class="${u.actions}">
|
|
51
|
+
<div class="${u.loader}"></div>
|
|
52
|
+
<button type="button" class="${u.confirm}"></button>
|
|
53
|
+
<button type="button" class="${u.deny}"></button>
|
|
54
|
+
<button type="button" class="${u.cancel}"></button>
|
|
58
55
|
</div>
|
|
59
|
-
<div class="
|
|
60
|
-
<div class="
|
|
61
|
-
<div class="
|
|
56
|
+
<div class="${u.footer}"></div>
|
|
57
|
+
<div class="${u["timer-progress-bar-container"]}">
|
|
58
|
+
<div class="${u["timer-progress-bar"]}"></div>
|
|
62
59
|
</div>
|
|
63
60
|
</div>
|
|
64
|
-
|
|
61
|
+
`.replace(/(^|\n)\s*/g,""),Jr=()=>{const t=oe();return t?(t.remove(),Pe([document.documentElement,document.body],[u["no-backdrop"],u["toast-shown"],u["has-column"]]),!0):!1},Ve=()=>{M.currentInstance.resetValidationMessage()},Xr=()=>{const t=j(),e=Ue(t,u.input),n=Ue(t,u.file),o=t.querySelector(`.${u.range} input`),s=t.querySelector(`.${u.range} output`),c=Ue(t,u.select),E=t.querySelector(`.${u.checkbox} input`),I=Ue(t,u.textarea);e.oninput=Ve,n.onchange=Ve,c.onchange=Ve,E.onchange=Ve,I.oninput=Ve,o.oninput=()=>{Ve(),s.value=o.value},o.onchange=()=>{Ve(),o.nextSibling.value=o.value}},Zr=t=>typeof t=="string"?document.querySelector(t):t,Qr=t=>{const e=j();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")},ei=t=>{window.getComputedStyle(t).direction==="rtl"&&H(oe(),u.rtl)},ti=t=>{const e=Jr();if(Yn()){$e("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");n.className=u.container,e&&H(n,u["no-transition"]),re(n,Yr);const o=Zr(t.target);o.appendChild(n),Qr(t),ei(o),Xr()},rn=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):typeof t=="object"?ni(t,e):t&&re(e,t)},ni=(t,e)=>{t.jquery?oi(e,t):re(e,t.toString())},oi=(t,e)=>{if(t.textContent="",0 in e)for(let n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},yt=(()=>{if(Yn())return!1;const t=document.createElement("div"),e={WebkitAnimation:"webkitAnimationEnd",animation:"animationend"};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&typeof t.style[n]<"u")return e[n];return!1})(),ri=()=>{const t=document.createElement("div");t.className=u["scrollbar-measure"],document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e},ii=(t,e)=>{const n=gt(),o=Xe();!e.showConfirmButton&&!e.showDenyButton&&!e.showCancelButton?ie(n):Q(n),Ee(n,e,"actions"),si(n,o,e),re(o,e.loaderHtml),Ee(o,e,"loader")};function si(t,e,n){const o=Te(),s=Ne(),c=He();sn(o,"confirm",n),sn(s,"deny",n),sn(c,"cancel",n),ai(o,s,c,n),n.reverseButtons&&(n.toast?(t.insertBefore(c,o),t.insertBefore(s,o)):(t.insertBefore(c,e),t.insertBefore(s,e),t.insertBefore(o,e)))}function ai(t,e,n,o){if(!o.buttonsStyling)return Pe([t,e,n],u.styled);H([t,e,n],u.styled),o.confirmButtonColor&&(t.style.backgroundColor=o.confirmButtonColor,H(t,u["default-outline"])),o.denyButtonColor&&(e.style.backgroundColor=o.denyButtonColor,H(e,u["default-outline"])),o.cancelButtonColor&&(n.style.backgroundColor=o.cancelButtonColor,H(n,u["default-outline"]))}function sn(t,e,n){Ft(t,n[`show${Yt(e)}Button`],"inline-block"),re(t,n[`${e}ButtonText`]),t.setAttribute("aria-label",n[`${e}ButtonAriaLabel`]),t.className=u[e],Ee(t,n,`${e}Button`),H(t,n[`${e}ButtonClass`])}function li(t,e){typeof e=="string"?t.style.background=e:e||H([document.documentElement,document.body],u["no-backdrop"])}function ci(t,e){e in u?H(t,u[e]):(de('The "position" parameter is not valid, defaulting to "center"'),H(t,u.center))}function ui(t,e){if(e&&typeof e=="string"){const n=`grow-${e}`;n in u&&H(t,u[n])}}const di=(t,e)=>{const n=oe();n&&(li(n,e.backdrop),ci(n,e.position),ui(n,e.grow),Ee(n,e,"container"))},U={awaitingPromise:new WeakMap,promise:new WeakMap,innerParams:new WeakMap,domCache:new WeakMap},fi=["input","file","range","select","radio","checkbox","textarea"],hi=(t,e)=>{const n=j(),o=U.innerParams.get(t),s=!o||e.input!==o.input;fi.forEach(c=>{const E=u[c],I=Ue(n,E);gi(c,e.inputAttributes),I.className=E,s&&ie(I)}),e.input&&(s&&pi(e),bi(e))},pi=t=>{if(!fe[t.input])return $e(`Unexpected type of input! Expected "text", "email", "password", "number", "tel", "select", "radio", "checkbox", "textarea", "file" or "url", got "${t.input}"`);const e=Jn(t.input),n=fe[t.input](e,t);Q(n),setTimeout(()=>{zn(n)})},mi=t=>{for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;["type","value","style"].includes(n)||t.removeAttribute(n)}},gi=(t,e)=>{const n=nn(j(),t);if(n){mi(n);for(const o in e)n.setAttribute(o,e[o])}},bi=t=>{const e=Jn(t.input);t.customClass&&H(e,t.customClass.input)},an=(t,e)=>{(!t.placeholder||e.inputPlaceholder)&&(t.placeholder=e.inputPlaceholder)},wt=(t,e,n)=>{if(n.inputLabel){t.id=u.input;const o=document.createElement("label"),s=u["input-label"];o.setAttribute("for",t.id),o.className=s,H(o,n.customClass.inputLabel),o.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",o)}},Jn=t=>{const e=u[t]?u[t]:u.input;return Ue(j(),e)},fe={};fe.text=fe.email=fe.password=fe.number=fe.tel=fe.url=(t,e)=>(typeof e.inputValue=="string"||typeof e.inputValue=="number"?t.value=e.inputValue:Xt(e.inputValue)||de(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e.inputValue}"`),wt(t,t,e),an(t,e),t.type=e.input,t),fe.file=(t,e)=>(wt(t,t,e),an(t,e),t),fe.range=(t,e)=>{const n=t.querySelector("input"),o=t.querySelector("output");return n.value=e.inputValue,n.type=e.input,o.value=e.inputValue,wt(n,t,e),t},fe.select=(t,e)=>{if(t.textContent="",e.inputPlaceholder){const n=document.createElement("option");re(n,e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)}return wt(t,t,e),t},fe.radio=t=>(t.textContent="",t),fe.checkbox=(t,e)=>{const n=nn(j(),"checkbox");n.value="1",n.id=u.checkbox,n.checked=!!e.inputValue;const o=t.querySelector("span");return re(o,e.inputPlaceholder),t},fe.textarea=(t,e)=>{t.value=e.inputValue,an(t,e),wt(t,t,e);const n=o=>parseInt(window.getComputedStyle(o).marginLeft)+parseInt(window.getComputedStyle(o).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const o=parseInt(window.getComputedStyle(j()).width),s=()=>{const c=t.offsetWidth+n(t);c>o?j().style.width=`${c}px`:j().style.width=null};new MutationObserver(s).observe(t,{attributes:!0,attributeFilter:["style"]})}}),t};const yi=(t,e)=>{const n=Pt();Ee(n,e,"htmlContainer"),e.html?(rn(e.html,n),Q(n,"block")):e.text?(n.textContent=e.text,Q(n,"block")):ie(n),hi(t,e)},wi=(t,e)=>{const n=jn();Ft(n,e.footer),e.footer&&rn(e.footer,n),Ee(n,e,"footer")},vi=(t,e)=>{const n=Qt();re(n,e.closeButtonHtml),Ee(n,e,"closeButton"),Ft(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel)},ki=(t,e)=>{const n=U.innerParams.get(t),o=mt();if(n&&e.icon===n.icon){Zn(o,e),Xn(o,e);return}if(!e.icon&&!e.iconHtml)return ie(o);if(e.icon&&Object.keys(ht).indexOf(e.icon)===-1)return $e(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`),ie(o);Q(o),Zn(o,e),Xn(o,e),H(o,e.showClass.icon)},Xn=(t,e)=>{for(const n in ht)e.icon!==n&&Pe(t,ht[n]);H(t,ht[e.icon]),Ei(t,e),_i(),Ee(t,e,"icon")},_i=()=>{const t=j(),e=window.getComputedStyle(t).getPropertyValue("background-color"),n=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let o=0;o<n.length;o++)n[o].style.backgroundColor=e},Ai=`
|
|
65
62
|
<div class="swal2-success-circular-line-left"></div>
|
|
66
63
|
<span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span>
|
|
67
64
|
<div class="swal2-success-ring"></div> <div class="swal2-success-fix"></div>
|
|
68
65
|
<div class="swal2-success-circular-line-right"></div>
|
|
69
|
-
`,
|
|
66
|
+
`,Ci=`
|
|
70
67
|
<span class="swal2-x-mark">
|
|
71
68
|
<span class="swal2-x-mark-line-left"></span>
|
|
72
69
|
<span class="swal2-x-mark-line-right"></span>
|
|
73
70
|
</span>
|
|
74
|
-
`,
|
|
71
|
+
`,Zn=(t,e)=>{t.textContent="",e.iconHtml?re(t,Qn(e.iconHtml)):e.icon==="success"?re(t,Ai):e.icon==="error"?re(t,Ci):re(t,Qn({question:"?",warning:"!",info:"i"}[e.icon]))},Ei=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])qn(t,n,"backgroundColor",e.iconColor);qn(t,".swal2-success-ring","borderColor",e.iconColor)}},Qn=t=>`<div class="${u["icon-content"]}">${t}</div>`,xi=(t,e)=>{const n=Hn();if(!e.imageUrl)return ie(n);Q(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt),bt(n,"width",e.imageWidth),bt(n,"height",e.imageHeight),n.className=u.image,Ee(n,e,"image")},Ti=t=>{const e=document.createElement("li");return H(e,u["progress-step"]),re(e,t),e},Si=t=>{const e=document.createElement("li");return H(e,u["progress-step-line"]),t.progressStepsDistance&&(e.style.width=t.progressStepsDistance),e},Li=(t,e)=>{const n=Vn();if(!e.progressSteps||e.progressSteps.length===0)return ie(n);Q(n),n.textContent="",e.currentProgressStep>=e.progressSteps.length&&de("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),e.progressSteps.forEach((o,s)=>{const c=Ti(o);if(n.appendChild(c),s===e.currentProgressStep&&H(c,u["active-progress-step"]),s!==e.progressSteps.length-1){const E=Si(e);n.appendChild(E)}})},Ii=(t,e)=>{const n=$n();Ft(n,e.title||e.titleText,"block"),e.title&&rn(e.title,n),e.titleText&&(n.innerText=e.titleText),Ee(n,e,"title")},Pi=(t,e)=>{const n=oe(),o=j();e.toast?(bt(n,"width",e.width),o.style.width="100%",o.insertBefore(Xe(),mt())):bt(o,"width",e.width),bt(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),ie(Bt()),Bi(o,e)},Bi=(t,e)=>{t.className=`${u.popup} ${we(t)?e.showClass.popup:""}`,e.toast?(H([document.documentElement,document.body],u["toast-shown"]),H(t,u.toast)):H(t,u.modal),Ee(t,e,"popup"),typeof e.customClass=="string"&&H(t,e.customClass),e.icon&&H(t,u[`icon-${e.icon}`])},eo=(t,e)=>{Pi(t,e),di(t,e),Li(t,e),ki(t,e),xi(t,e),Ii(t,e),vi(t,e),yi(t,e),ii(t,e),wi(t,e),typeof e.didRender=="function"&&e.didRender(j())},Qe=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Ri=()=>{ye(document.body.children).forEach(e=>{e===oe()||e.contains(oe())||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")),e.setAttribute("aria-hidden","true"))})},to=()=>{ye(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},no=["swal-title","swal-html","swal-footer"],Oi=t=>{const e=typeof t.template=="string"?document.querySelector(t.template):t.template;if(!e)return{};const n=e.content;return Hi(n),Object.assign(Fi(n),Mi(n),Ni(n),Ui(n),Di(n),$i(n,no))},Fi=t=>{const e={};return ye(t.querySelectorAll("swal-param")).forEach(n=>{je(n,["name","value"]);const o=n.getAttribute("name"),s=n.getAttribute("value");typeof Je[o]=="boolean"&&s==="false"&&(e[o]=!1),typeof Je[o]=="object"&&(e[o]=JSON.parse(s))}),e},Mi=t=>{const e={};return ye(t.querySelectorAll("swal-button")).forEach(n=>{je(n,["type","color","aria-label"]);const o=n.getAttribute("type");e[`${o}ButtonText`]=n.innerHTML,e[`show${Yt(o)}Button`]=!0,n.hasAttribute("color")&&(e[`${o}ButtonColor`]=n.getAttribute("color")),n.hasAttribute("aria-label")&&(e[`${o}ButtonAriaLabel`]=n.getAttribute("aria-label"))}),e},Ni=t=>{const e={},n=t.querySelector("swal-image");return n&&(je(n,["src","width","height","alt"]),n.hasAttribute("src")&&(e.imageUrl=n.getAttribute("src")),n.hasAttribute("width")&&(e.imageWidth=n.getAttribute("width")),n.hasAttribute("height")&&(e.imageHeight=n.getAttribute("height")),n.hasAttribute("alt")&&(e.imageAlt=n.getAttribute("alt"))),e},Ui=t=>{const e={},n=t.querySelector("swal-icon");return n&&(je(n,["type","color"]),n.hasAttribute("type")&&(e.icon=n.getAttribute("type")),n.hasAttribute("color")&&(e.iconColor=n.getAttribute("color")),e.iconHtml=n.innerHTML),e},Di=t=>{const e={},n=t.querySelector("swal-input");n&&(je(n,["type","label","placeholder","value"]),e.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(e.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(e.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(e.inputValue=n.getAttribute("value")));const o=t.querySelectorAll("swal-input-option");return o.length&&(e.inputOptions={},ye(o).forEach(s=>{je(s,["value"]);const c=s.getAttribute("value"),E=s.innerHTML;e.inputOptions[c]=E})),e},$i=(t,e)=>{const n={};for(const o in e){const s=e[o],c=t.querySelector(s);c&&(je(c,[]),n[s.replace(/^swal-/,"")]=c.innerHTML.trim())}return n},Hi=t=>{const e=no.concat(["swal-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);ye(t.children).forEach(n=>{const o=n.tagName.toLowerCase();e.indexOf(o)===-1&&de(`Unrecognized element <${o}>`)})},je=(t,e)=>{ye(t.attributes).forEach(n=>{e.indexOf(n.name)===-1&&de([`Unrecognized attribute "${n.name}" on <${t.tagName.toLowerCase()}>.`,`${e.length?`Allowed attributes are: ${e.join(", ")}`:"To set the value, use HTML within the element."}`])})},oo={email:(t,e)=>/^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address"),url:(t,e)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")};function Vi(t){t.inputValidator||Object.keys(oo).forEach(e=>{t.input===e&&(t.inputValidator=oo[e])})}function ji(t){(!t.target||typeof t.target=="string"&&!document.querySelector(t.target)||typeof t.target!="string"&&!t.target.appendChild)&&(de('Target parameter is not valid, defaulting to "body"'),t.target="body")}function zi(t){Vi(t),t.showLoaderOnConfirm&&!t.preConfirm&&de(`showLoaderOnConfirm is set to true, but preConfirm is not defined.
|
|
75
72
|
showLoaderOnConfirm should be used together with preConfirm, see usage example:
|
|
76
|
-
https://sweetalert2.github.io/#ajax-request`),
|
|
77
|
-
`).join("<br />")),So(e)}class mr{constructor(t,n){this.callback=t,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(t){const n=this.running;return n&&this.stop(),this.remaining+=t,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const gr=()=>{Le.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Le.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(Le.previousBodyPadding+Bo(),"px"))},br=()=>{Le.previousBodyPadding!==null&&(document.body.style.paddingRight="".concat(Le.previousBodyPadding,"px"),Le.previousBodyPadding=null)},wr=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!xe(document.body,i.iosfix)){const t=document.body.scrollTop;document.body.style.top="".concat(t*-1,"px"),D(document.body,i.iosfix),vr(),yr()}},yr=()=>{const e=navigator.userAgent,t=!!e.match(/iPad/i)||!!e.match(/iPhone/i),n=!!e.match(/WebKit/i);t&&n&&!e.match(/CriOS/i)&&F().scrollHeight>window.innerHeight-44&&(T().style.paddingBottom="".concat(44,"px"))},vr=()=>{const e=T();let t;e.ontouchstart=n=>{t=kr(n)},e.ontouchmove=n=>{t&&(n.preventDefault(),n.stopPropagation())}},kr=e=>{const t=e.target,n=T();return xr(e)||Cr(e)?!1:t===n||!_t(n)&&t.tagName!=="INPUT"&&t.tagName!=="TEXTAREA"&&!(_t(te())&&te().contains(t))},xr=e=>e.touches&&e.touches.length&&e.touches[0].touchType==="stylus",Cr=e=>e.touches&&e.touches.length>1,Ar=()=>{if(xe(document.body,i.iosfix)){const e=parseInt(document.body.style.top,10);ve(document.body,i.iosfix),document.body.style.top="",document.body.scrollTop=e*-1}},Rt=10,Sr=e=>{const t=T(),n=F();typeof e.willOpen=="function"&&e.willOpen(n);const f=window.getComputedStyle(document.body).overflowY;Br(t,n,e),setTimeout(()=>{Er(t,n)},Rt),ne()&&(_r(t,e.scrollbarPadding,f),or()),!ye()&&!V.previousActiveElement&&(V.previousActiveElement=document.activeElement),typeof e.didOpen=="function"&&setTimeout(()=>e.didOpen(n)),ve(t,i["no-transition"])},Nt=e=>{const t=F();if(e.target!==t)return;const n=T();t.removeEventListener(He,Nt),n.style.overflowY="auto"},Er=(e,t)=>{He&&Bt(t)?(e.style.overflowY="hidden",t.addEventListener(He,Nt)):e.style.overflowY="auto"},_r=(e,t,n)=>{wr(),t&&n!=="hidden"&&gr(),setTimeout(()=>{e.scrollTop=0})},Br=(e,t,n)=>{D(e,n.showClass.backdrop),t.style.setProperty("opacity","0","important"),Q(t,"grid"),setTimeout(()=>{D(t,n.showClass.popup),t.style.removeProperty("opacity")},Rt),D([document.documentElement,document.body],i.shown),n.heightAuto&&n.backdrop&&!n.toast&&D([document.documentElement,document.body],i["height-auto"])},Ue=e=>{let t=F();t||new Xe,t=F();const n=w();ye()?re(G()):Pr(t,e),Q(n),t.setAttribute("data-loading",!0),t.setAttribute("aria-busy",!0),t.focus()},Pr=(e,t)=>{const n=_(),r=w();!t&&le(b())&&(t=b()),Q(n),t&&(re(t),r.setAttribute("data-button-to-replace",t.className)),r.parentNode.insertBefore(r,t),D([e,n],i.loading)},Tr=(e,t)=>{t.input==="select"||t.input==="radio"?Mr(e,t):["text","email","number","tel","textarea"].includes(t.input)&&(ae(t.inputValue)||Ce(t.inputValue))&&(Ue(b()),Or(e,t))},Ir=(e,t)=>{const n=e.getInput();if(!n)return null;switch(t.input){case"checkbox":return Lr(n);case"radio":return Fr(n);case"file":return Ur(n);default:return t.inputAutoTrim?n.value.trim():n.value}},Lr=e=>e.checked?1:0,Fr=e=>e.checked?e.value:null,Ur=e=>e.files.length?e.getAttribute("multiple")!==null?e.files:e.files[0]:null,Mr=(e,t)=>{const n=F(),r=f=>Vr[t.input](n,at(f),t);ae(t.inputOptions)||Ce(t.inputOptions)?(Ue(b()),j(t.inputOptions).then(f=>{e.hideLoading(),r(f)})):typeof t.inputOptions=="object"?r(t.inputOptions):O("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(typeof t.inputOptions))},Or=(e,t)=>{const n=e.getInput();re(n),j(t.inputValue).then(r=>{n.value=t.input==="number"?parseFloat(r)||0:"".concat(r),Q(n),n.focus(),e.hideLoading()}).catch(r=>{O("Error in inputValue promise: ".concat(r)),n.value="",Q(n),n.focus(),e.hideLoading()})},Vr={select:(e,t,n)=>{const r=Ae(e,i.select),f=(P,Y,ue)=>{const se=document.createElement("option");se.value=ue,oe(se,Y),se.selected=Ht(ue,n.inputValue),P.appendChild(se)};t.forEach(P=>{const Y=P[0],ue=P[1];if(Array.isArray(ue)){const se=document.createElement("optgroup");se.label=Y,se.disabled=!1,r.appendChild(se),ue.forEach(Oe=>f(se,Oe[1],Oe[0]))}else f(r,ue,Y)}),r.focus()},radio:(e,t,n)=>{const r=Ae(e,i.radio);t.forEach(P=>{const Y=P[0],ue=P[1],se=document.createElement("input"),Oe=document.createElement("label");se.type="radio",se.name=i.radio,se.value=Y,Ht(Y,n.inputValue)&&(se.checked=!0);const pt=document.createElement("span");oe(pt,ue),pt.className=i.label,Oe.appendChild(se),Oe.appendChild(pt),r.appendChild(Oe)});const f=r.querySelectorAll("input");f.length&&f[0].focus()}},at=e=>{const t=[];return typeof Map<"u"&&e instanceof Map?e.forEach((n,r)=>{let f=n;typeof f=="object"&&(f=at(f)),t.push([r,f])}):Object.keys(e).forEach(n=>{let r=e[n];typeof r=="object"&&(r=at(r)),t.push([n,r])}),t},Ht=(e,t)=>t&&t.toString()===e.toString();function Dt(){const e=R.innerParams.get(this);if(!e)return;const t=R.domCache.get(this);re(t.loader),ye()?e.icon&&Q(G()):Rr(t),ve([t.popup,t.actions],i.loading),t.popup.removeAttribute("aria-busy"),t.popup.removeAttribute("data-loading"),t.confirmButton.disabled=!1,t.denyButton.disabled=!1,t.cancelButton.disabled=!1}const Rr=e=>{const t=e.popup.getElementsByClassName(e.loader.getAttribute("data-button-to-replace"));t.length?Q(t[0],"inline-block"):po()&&re(e.actions)};function Nr(e){const t=R.innerParams.get(e||this),n=R.domCache.get(e||this);return n?nt(n.popup,t.input):null}var je={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const Hr=()=>le(F()),jt=()=>b()&&b().click(),Dr=()=>u()&&u().click(),jr=()=>y()&&y().click(),zt=e=>{e.keydownTarget&&e.keydownHandlerAdded&&(e.keydownTarget.removeEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!1)},zr=(e,t,n,r)=>{zt(t),n.toast||(t.keydownHandler=f=>qr(e,f,r),t.keydownTarget=n.keydownListenerCapture?window:F(),t.keydownListenerCapture=n.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},ct=(e,t,n)=>{const r=pe();if(r.length)return t=t+n,t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();F().focus()},$t=["ArrowRight","ArrowDown"],$r=["ArrowLeft","ArrowUp"],qr=(e,t,n)=>{const r=R.innerParams.get(e);r&&(t.isComposing||t.keyCode===229||(r.stopKeydownPropagation&&t.stopPropagation(),t.key==="Enter"?Wr(e,t,r):t.key==="Tab"?Kr(t,r):[...$t,...$r].includes(t.key)?Jr(t.key):t.key==="Escape"&&Yr(t,r,n)))},Wr=(e,t,n)=>{if(X(n.allowEnterKey)&&t.target&&e.getInput()&&t.target.outerHTML===e.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;jt(),t.preventDefault()}},Kr=(e,t)=>{const n=e.target,r=pe();let f=-1;for(let P=0;P<r.length;P++)if(n===r[P]){f=P;break}e.shiftKey?ct(t,f,-1):ct(t,f,1),e.stopPropagation(),e.preventDefault()},Jr=e=>{const t=b(),n=u(),r=y();if(![t,n,r].includes(document.activeElement))return;const f=$t.includes(e)?"nextElementSibling":"previousElementSibling";let P=document.activeElement;for(let Y=0;Y<_().children.length;Y++){if(P=P[f],!P)return;if(le(P)&&P instanceof HTMLButtonElement)break}P instanceof HTMLButtonElement&&P.focus()},Yr=(e,t,n)=>{X(t.allowEscapeKey)&&(e.preventDefault(),n(Fe.esc))};function qt(e,t,n,r){ye()?Wt(e,r):(wo(n).then(()=>Wt(e,r)),zt(V)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(t.setAttribute("style","display:none !important"),t.removeAttribute("class"),t.innerHTML=""):t.remove(),ne()&&(br(),Ar(),Mt()),Xr()}function Xr(){ve([document.documentElement,document.body],[i.shown,i["height-auto"],i["no-backdrop"],i["toast-shown"]])}function Je(e){e=es(e);const t=je.swalPromiseResolve.get(this),n=Gr(this);this.isAwaitingPromise()?e.isDismissed||(ze(this),t(e)):n&&t(e)}function Zr(){return!!R.awaitingPromise.get(this)}const Gr=e=>{const t=F();if(!t)return!1;const n=R.innerParams.get(e);if(!n||xe(t,n.hideClass.popup))return!1;ve(t,n.showClass.popup),D(t,n.hideClass.popup);const r=T();return ve(r,n.showClass.backdrop),D(r,n.hideClass.backdrop),ts(e,t,n),!0};function Qr(e){const t=je.swalPromiseReject.get(this);ze(this),t&&t(e)}const ze=e=>{e.isAwaitingPromise()&&(R.awaitingPromise.delete(e),R.innerParams.get(e)||e._destroy())},es=e=>typeof e>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},e),ts=(e,t,n)=>{const r=T(),f=He&&Bt(t);typeof n.willClose=="function"&&n.willClose(t),f?ns(e,t,r,n.returnFocus,n.didClose):qt(e,r,n.returnFocus,n.didClose)},ns=(e,t,n,r,f)=>{V.swalCloseEventFinishedCallback=qt.bind(null,e,n,r,f),t.addEventListener(He,function(P){P.target===t&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback)})},Wt=(e,t)=>{setTimeout(()=>{typeof t=="function"&&t.bind(e.params)(),e._destroy()})};function Kt(e,t,n){const r=R.domCache.get(e);t.forEach(f=>{r[f].disabled=n})}function Jt(e,t){if(!e)return!1;if(e.type==="radio"){const r=e.parentNode.parentNode.querySelectorAll("input");for(let f=0;f<r.length;f++)r[f].disabled=t}else e.disabled=t}function os(){Kt(this,["confirmButton","denyButton","cancelButton"],!1)}function rs(){Kt(this,["confirmButton","denyButton","cancelButton"],!0)}function ss(){return Jt(this.getInput(),!1)}function is(){return Jt(this.getInput(),!0)}function as(e){const t=R.domCache.get(this),n=R.innerParams.get(this);oe(t.validationMessage,e),t.validationMessage.className=i["validation-message"],n.customClass&&n.customClass.validationMessage&&D(t.validationMessage,n.customClass.validationMessage),Q(t.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid",!0),r.setAttribute("aria-describedby",i["validation-message"]),At(r),D(r,i.inputerror))}function cs(){const e=R.domCache.get(this);e.validationMessage&&re(e.validationMessage);const t=this.getInput();t&&(t.removeAttribute("aria-invalid"),t.removeAttribute("aria-describedby"),ve(t,i.inputerror))}function ls(){return R.domCache.get(this).progressSteps}function us(e){const t=F(),n=R.innerParams.get(this);if(!t||xe(t,n.hideClass.popup))return I("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const r=ds(e),f=Object.assign({},n,r);Ut(this,f),R.innerParams.set(this,f),Object.defineProperties(this,{params:{value:Object.assign({},this.params,e),writable:!1,enumerable:!0}})}const ds=e=>{const t={};return Object.keys(e).forEach(n=>{we(n)?t[n]=e[n]:I('Invalid parameter to update: "'.concat(n,`". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
73
|
+
https://sweetalert2.github.io/#ajax-request`),ji(t),typeof t.title=="string"&&(t.title=t.title.split(`
|
|
74
|
+
`).join("<br />")),ti(t)}class Wi{constructor(e,n){this.callback=e,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){const n=this.running;return n&&this.stop(),this.remaining+=e,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const qi=()=>{Ze.previousBodyPadding===null&&document.body.scrollHeight>window.innerHeight&&(Ze.previousBodyPadding=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${Ze.previousBodyPadding+ri()}px`)},Ki=()=>{Ze.previousBodyPadding!==null&&(document.body.style.paddingRight=`${Ze.previousBodyPadding}px`,Ze.previousBodyPadding=null)},Gi=()=>{if((/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!Re(document.body,u.iosfix)){const e=document.body.scrollTop;document.body.style.top=`${e*-1}px`,H(document.body,u.iosfix),Ji(),Yi()}},Yi=()=>{const t=navigator.userAgent,e=!!t.match(/iPad/i)||!!t.match(/iPhone/i),n=!!t.match(/WebKit/i);e&&n&&!t.match(/CriOS/i)&&j().scrollHeight>window.innerHeight-44&&(oe().style.paddingBottom="44px")},Ji=()=>{const t=oe();let e;t.ontouchstart=n=>{e=Xi(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},Xi=t=>{const e=t.target,n=oe();return Zi(t)||Qi(t)?!1:e===n||!Kn(n)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(Kn(Pt())&&Pt().contains(e))},Zi=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",Qi=t=>t.touches&&t.touches.length>1,es=()=>{if(Re(document.body,u.iosfix)){const t=parseInt(document.body.style.top,10);Pe(document.body,u.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},ro=10,ts=t=>{const e=oe(),n=j();typeof t.willOpen=="function"&&t.willOpen(n);const s=window.getComputedStyle(document.body).overflowY;rs(e,n,t),setTimeout(()=>{ns(e,n)},ro),tn()&&(os(e,t.scrollbarPadding,s),Ri()),!Ot()&&!M.previousActiveElement&&(M.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),Pe(e,u["no-transition"])},io=t=>{const e=j();if(t.target!==e)return;const n=oe();e.removeEventListener(yt,io),n.style.overflowY="auto"},ns=(t,e)=>{yt&&Gn(e)?(t.style.overflowY="hidden",e.addEventListener(yt,io)):t.style.overflowY="auto"},os=(t,e,n)=>{Gi(),e&&n!=="hidden"&&qi(),setTimeout(()=>{t.scrollTop=0})},rs=(t,e,n)=>{H(t,n.showClass.backdrop),e.style.setProperty("opacity","0","important"),Q(e,"grid"),setTimeout(()=>{H(e,n.showClass.popup),e.style.removeProperty("opacity")},ro),H([document.documentElement,document.body],u.shown),n.heightAuto&&n.backdrop&&!n.toast&&H([document.documentElement,document.body],u["height-auto"])},et=t=>{let e=j();e||new nt,e=j();const n=Xe();Ot()?ie(mt()):is(e,t),Q(n),e.setAttribute("data-loading",!0),e.setAttribute("aria-busy",!0),e.focus()},is=(t,e)=>{const n=gt(),o=Xe();!e&&we(Te())&&(e=Te()),Q(n),e&&(ie(e),o.setAttribute("data-button-to-replace",e.className)),o.parentNode.insertBefore(o,e),H([t,n],u.loading)},ss=(t,e)=>{e.input==="select"||e.input==="radio"?ds(t,e):["text","email","number","tel","textarea"].includes(e.input)&&(Jt(e.inputValue)||Xt(e.inputValue))&&(et(Te()),fs(t,e))},as=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return ls(n);case"radio":return cs(n);case"file":return us(n);default:return e.inputAutoTrim?n.value.trim():n.value}},ls=t=>t.checked?1:0,cs=t=>t.checked?t.value:null,us=t=>t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,ds=(t,e)=>{const n=j(),o=s=>hs[e.input](n,ln(s),e);Jt(e.inputOptions)||Xt(e.inputOptions)?(et(Te()),ft(e.inputOptions).then(s=>{t.hideLoading(),o(s)})):typeof e.inputOptions=="object"?o(e.inputOptions):$e(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},fs=(t,e)=>{const n=t.getInput();ie(n),ft(e.inputValue).then(o=>{n.value=e.input==="number"?parseFloat(o)||0:`${o}`,Q(n),n.focus(),t.hideLoading()}).catch(o=>{$e(`Error in inputValue promise: ${o}`),n.value="",Q(n),n.focus(),t.hideLoading()})},hs={select:(t,e,n)=>{const o=Ue(t,u.select),s=(c,E,I)=>{const d=document.createElement("option");d.value=I,re(d,E),d.selected=so(I,n.inputValue),c.appendChild(d)};e.forEach(c=>{const E=c[0],I=c[1];if(Array.isArray(I)){const d=document.createElement("optgroup");d.label=E,d.disabled=!1,o.appendChild(d),I.forEach(V=>s(d,V[1],V[0]))}else s(o,I,E)}),o.focus()},radio:(t,e,n)=>{const o=Ue(t,u.radio);e.forEach(c=>{const E=c[0],I=c[1],d=document.createElement("input"),V=document.createElement("label");d.type="radio",d.name=u.radio,d.value=E,so(E,n.inputValue)&&(d.checked=!0);const W=document.createElement("span");re(W,I),W.className=u.label,V.appendChild(d),V.appendChild(W),o.appendChild(V)});const s=o.querySelectorAll("input");s.length&&s[0].focus()}},ln=t=>{const e=[];return typeof Map<"u"&&t instanceof Map?t.forEach((n,o)=>{let s=n;typeof s=="object"&&(s=ln(s)),e.push([o,s])}):Object.keys(t).forEach(n=>{let o=t[n];typeof o=="object"&&(o=ln(o)),e.push([n,o])}),e},so=(t,e)=>e&&e.toString()===t.toString();function ao(){const t=U.innerParams.get(this);if(!t)return;const e=U.domCache.get(this);ie(e.loader),Ot()?t.icon&&Q(mt()):ps(e),Pe([e.popup,e.actions],u.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const ps=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?Q(e[0],"inline-block"):zr()&&ie(t.actions)};function ms(t){const e=U.innerParams.get(t||this),n=U.domCache.get(t||this);return n?nn(n.popup,e.input):null}const vt={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap},gs=()=>we(j()),lo=()=>Te()&&Te().click(),bs=()=>Ne()&&Ne().click(),ys=()=>He()&&He().click(),co=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},ws=(t,e,n,o)=>{co(e),n.toast||(e.keydownHandler=s=>ks(t,s,o),e.keydownTarget=n.keydownListenerCapture?window:j(),e.keydownListenerCapture=n.keydownListenerCapture,e.keydownTarget.addEventListener("keydown",e.keydownHandler,{capture:e.keydownListenerCapture}),e.keydownHandlerAdded=!0)},cn=(t,e,n)=>{const o=en();if(o.length)return e=e+n,e===o.length?e=0:e===-1&&(e=o.length-1),o[e].focus();j().focus()},uo=["ArrowRight","ArrowDown"],vs=["ArrowLeft","ArrowUp"],ks=(t,e,n)=>{const o=U.innerParams.get(t);o&&(e.isComposing||e.keyCode===229||(o.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?_s(t,e,o):e.key==="Tab"?As(e,o):[...uo,...vs].includes(e.key)?Cs(e.key):e.key==="Escape"&&Es(e,o,n)))},_s=(t,e,n)=>{if(It(n.allowEnterKey)&&e.target&&t.getInput()&&e.target.outerHTML===t.getInput().outerHTML){if(["textarea","file"].includes(n.input))return;lo(),e.preventDefault()}},As=(t,e)=>{const n=t.target,o=en();let s=-1;for(let c=0;c<o.length;c++)if(n===o[c]){s=c;break}t.shiftKey?cn(e,s,-1):cn(e,s,1),t.stopPropagation(),t.preventDefault()},Cs=t=>{const e=Te(),n=Ne(),o=He();if(![e,n,o].includes(document.activeElement))return;const s=uo.includes(t)?"nextElementSibling":"previousElementSibling";let c=document.activeElement;for(let E=0;E<gt().children.length;E++){if(c=c[s],!c)return;if(we(c)&&c instanceof HTMLButtonElement)break}c instanceof HTMLButtonElement&&c.focus()},Es=(t,e,n)=>{It(e.allowEscapeKey)&&(t.preventDefault(),n(Qe.esc))};function fo(t,e,n,o){Ot()?ho(t,o):(Gr(n).then(()=>ho(t,o)),co(M)),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),tn()&&(Ki(),es(),to()),xs()}function xs(){Pe([document.documentElement,document.body],[u.shown,u["height-auto"],u["no-backdrop"],u["toast-shown"]])}function Mt(t){t=Is(t);const e=vt.swalPromiseResolve.get(this),n=Ss(this);this.isAwaitingPromise()?t.isDismissed||(kt(this),e(t)):n&&e(t)}function Ts(){return!!U.awaitingPromise.get(this)}const Ss=t=>{const e=j();if(!e)return!1;const n=U.innerParams.get(t);if(!n||Re(e,n.hideClass.popup))return!1;Pe(e,n.showClass.popup),H(e,n.hideClass.popup);const o=oe();return Pe(o,n.showClass.backdrop),H(o,n.hideClass.backdrop),Ps(t,e,n),!0};function Ls(t){const e=vt.swalPromiseReject.get(this);kt(this),e&&e(t)}const kt=t=>{t.isAwaitingPromise()&&(U.awaitingPromise.delete(t),U.innerParams.get(t)||t._destroy())},Is=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),Ps=(t,e,n)=>{const o=oe(),s=yt&&Gn(e);typeof n.willClose=="function"&&n.willClose(e),s?Bs(t,e,o,n.returnFocus,n.didClose):fo(t,o,n.returnFocus,n.didClose)},Bs=(t,e,n,o,s)=>{M.swalCloseEventFinishedCallback=fo.bind(null,t,n,o,s),e.addEventListener(yt,function(c){c.target===e&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback)})},ho=(t,e)=>{setTimeout(()=>{typeof e=="function"&&e.bind(t.params)(),t._destroy()})};function po(t,e,n){const o=U.domCache.get(t);e.forEach(s=>{o[s].disabled=n})}function mo(t,e){if(!t)return!1;if(t.type==="radio"){const o=t.parentNode.parentNode.querySelectorAll("input");for(let s=0;s<o.length;s++)o[s].disabled=e}else t.disabled=e}function Rs(){po(this,["confirmButton","denyButton","cancelButton"],!1)}function Os(){po(this,["confirmButton","denyButton","cancelButton"],!0)}function Fs(){return mo(this.getInput(),!1)}function Ms(){return mo(this.getInput(),!0)}function Ns(t){const e=U.domCache.get(this),n=U.innerParams.get(this);re(e.validationMessage,t),e.validationMessage.className=u["validation-message"],n.customClass&&n.customClass.validationMessage&&H(e.validationMessage,n.customClass.validationMessage),Q(e.validationMessage);const o=this.getInput();o&&(o.setAttribute("aria-invalid",!0),o.setAttribute("aria-describedby",u["validation-message"]),zn(o),H(o,u.inputerror))}function Us(){const t=U.domCache.get(this);t.validationMessage&&ie(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),Pe(e,u.inputerror))}function Ds(){return U.domCache.get(this).progressSteps}function $s(t){const e=j(),n=U.innerParams.get(this);if(!e||Re(e,n.hideClass.popup))return de("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.");const o=Hs(t),s=Object.assign({},n,o);eo(this,s),U.innerParams.set(this,s),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const Hs=t=>{const e={};return Object.keys(t).forEach(n=>{Un(n)?e[n]=t[n]:de(`Invalid parameter to update: "${n}". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js
|
|
78
75
|
|
|
79
|
-
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`))}),t};function fs(){const e=R.domCache.get(this),t=R.innerParams.get(this);if(!t){Yt(this);return}e.popup&&V.swalCloseEventFinishedCallback&&(V.swalCloseEventFinishedCallback(),delete V.swalCloseEventFinishedCallback),V.deferDisposalTimer&&(clearTimeout(V.deferDisposalTimer),delete V.deferDisposalTimer),typeof t.didDestroy=="function"&&t.didDestroy(),hs(this)}const hs=e=>{Yt(e),delete e.params,delete V.keydownHandler,delete V.keydownTarget,delete V.currentInstance},Yt=e=>{e.isAwaitingPromise()?(lt(R,e),R.awaitingPromise.set(e,!0)):(lt(je,e),lt(R,e))},lt=(e,t)=>{for(const n in e)e[n].delete(t)};var Xt=Object.freeze({hideLoading:Dt,disableLoading:Dt,getInput:Nr,close:Je,isAwaitingPromise:Zr,rejectPromise:Qr,handleAwaitingPromise:ze,closePopup:Je,closeModal:Je,closeToast:Je,enableButtons:os,disableButtons:rs,enableInput:ss,disableInput:is,showValidationMessage:as,resetValidationMessage:cs,getProgressSteps:ls,update:us,_destroy:fs});const ps=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.input?Zt(e,"confirm"):dt(e,!0)},ms=e=>{const t=R.innerParams.get(e);e.disableButtons(),t.returnInputValueOnDeny?Zt(e,"deny"):ut(e,!1)},gs=(e,t)=>{e.disableButtons(),t(Fe.cancel)},Zt=(e,t)=>{const n=R.innerParams.get(e);if(!n.input)return O('The "input" parameter is needed to be set when using returnInputValueOn'.concat(U(t)));const r=Ir(e,n);n.inputValidator?bs(e,r,t):e.getInput().checkValidity()?t==="deny"?ut(e,r):dt(e,r):(e.enableButtons(),e.showValidationMessage(n.validationMessage))},bs=(e,t,n)=>{const r=R.innerParams.get(e);e.disableInput(),Promise.resolve().then(()=>j(r.inputValidator(t,r.validationMessage))).then(P=>{e.enableButtons(),e.enableInput(),P?e.showValidationMessage(P):n==="deny"?ut(e,t):dt(e,t)})},ut=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnDeny&&Ue(u()),n.preDeny?(R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preDeny(t,n.validationMessage))).then(f=>{f===!1?(e.hideLoading(),ze(e)):e.closePopup({isDenied:!0,value:typeof f>"u"?t:f})}).catch(f=>Qt(e||void 0,f))):e.closePopup({isDenied:!0,value:t})},Gt=(e,t)=>{e.closePopup({isConfirmed:!0,value:t})},Qt=(e,t)=>{e.rejectPromise(t)},dt=(e,t)=>{const n=R.innerParams.get(e||void 0);n.showLoaderOnConfirm&&Ue(),n.preConfirm?(e.resetValidationMessage(),R.awaitingPromise.set(e||void 0,!0),Promise.resolve().then(()=>j(n.preConfirm(t,n.validationMessage))).then(f=>{le(m())||f===!1?(e.hideLoading(),ze(e)):Gt(e,typeof f>"u"?t:f)}).catch(f=>Qt(e||void 0,f))):Gt(e,t)},ws=(e,t,n)=>{R.innerParams.get(e).toast?ys(e,t,n):(ks(t),xs(t),Cs(e,t,n))},ys=(e,t,n)=>{t.popup.onclick=()=>{const r=R.innerParams.get(e);r&&(vs(r)||r.timer||r.input)||n(Fe.close)}},vs=e=>e.showConfirmButton||e.showDenyButton||e.showCancelButton||e.showCloseButton;let Ye=!1;const ks=e=>{e.popup.onmousedown=()=>{e.container.onmouseup=function(t){e.container.onmouseup=void 0,t.target===e.container&&(Ye=!0)}}},xs=e=>{e.container.onmousedown=()=>{e.popup.onmouseup=function(t){e.popup.onmouseup=void 0,(t.target===e.popup||e.popup.contains(t.target))&&(Ye=!0)}}},Cs=(e,t,n)=>{t.container.onclick=r=>{const f=R.innerParams.get(e);if(Ye){Ye=!1;return}r.target===t.container&&X(f.allowOutsideClick)&&n(Fe.backdrop)}},As=e=>typeof e=="object"&&e.jquery,en=e=>e instanceof Element||As(e),Ss=e=>{const t={};return typeof e[0]=="object"&&!en(e[0])?Object.assign(t,e[0]):["title","html","icon"].forEach((n,r)=>{const f=e[r];typeof f=="string"||en(f)?t[n]=f:f!==void 0&&O("Unexpected type of ".concat(n,'! Expected "string" or "Element", got ').concat(typeof f))}),t};function Es(){const e=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new e(...n)}function _s(e){class t extends this{_main(r,f){return super._main(r,Object.assign({},e,f))}}return t}const Bs=()=>V.timeout&&V.timeout.getTimerLeft(),tn=()=>{if(V.timeout)return mo(),V.timeout.stop()},nn=()=>{if(V.timeout){const e=V.timeout.start();return ot(e),e}},Ps=()=>{const e=V.timeout;return e&&(e.running?tn():nn())},Ts=e=>{if(V.timeout){const t=V.timeout.increase(e);return ot(t,!0),t}},Is=()=>V.timeout&&V.timeout.isRunning();let on=!1;const ft={};function Ls(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"data-swal-template";ft[e]=this,on||(document.body.addEventListener("click",Fs),on=!0)}const Fs=e=>{for(let t=e.target;t&&t!==document;t=t.parentNode)for(const n in ft){const r=t.getAttribute(n);if(r){ft[n].fire({template:r});return}}};var Us=Object.freeze({isValidParameter:J,isUpdatableParameter:we,isDeprecatedParameter:Z,argsToParams:Ss,isVisible:Hr,clickConfirm:jt,clickDeny:Dr,clickCancel:jr,getContainer:T,getPopup:F,getTitle:N,getHtmlContainer:te,getImage:s,getIcon:G,getInputLabel:S,getCloseButton:H,getActions:_,getConfirmButton:b,getDenyButton:u,getCancelButton:y,getLoader:w,getFooter:B,getTimerProgressBar:M,getFocusableElements:pe,getValidationMessage:m,isLoading:fo,fire:Es,mixin:_s,showLoading:Ue,enableLoading:Ue,getTimerLeft:Bs,stopTimer:tn,resumeTimer:nn,toggleTimer:Ps,increaseTimer:Ts,isTimerRunning:Is,bindClickHandler:Ls});let ht;class Me{constructor(){if(typeof window>"u")return;ht=this;for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const f=Object.freeze(this.constructor.argsToParams(n));Object.defineProperties(this,{params:{value:f,writable:!1,enumerable:!0,configurable:!0}});const P=this._main(this.params);R.promise.set(this,P)}_main(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};A(Object.assign({},n,t)),V.currentInstance&&(V.currentInstance._destroy(),ne()&&Mt()),V.currentInstance=this;const r=Os(t,n);pr(r),Object.freeze(r),V.timeout&&(V.timeout.stop(),delete V.timeout),clearTimeout(V.restoreFocusTimeout);const f=Vs(this);return Ut(this,r),R.innerParams.set(this,r),Ms(this,f,r)}then(t){return R.promise.get(this).then(t)}finally(t){return R.promise.get(this).finally(t)}}const Ms=(e,t,n)=>new Promise((r,f)=>{const P=Y=>{e.closePopup({isDismissed:!0,dismiss:Y})};je.swalPromiseResolve.set(e,r),je.swalPromiseReject.set(e,f),t.confirmButton.onclick=()=>ps(e),t.denyButton.onclick=()=>ms(e),t.cancelButton.onclick=()=>gs(e,P),t.closeButton.onclick=()=>P(Fe.close),ws(e,t,P),zr(e,V,n,P),Tr(e,n),Sr(n),Rs(V,n,P),Ns(t,n),setTimeout(()=>{t.container.scrollTop=0})}),Os=(e,t)=>{const n=rr(e),r=Object.assign({},ge,t,n,e);return r.showClass=Object.assign({},ge.showClass,r.showClass),r.hideClass=Object.assign({},ge.hideClass,r.hideClass),r},Vs=e=>{const t={popup:F(),container:T(),actions:_(),confirmButton:b(),denyButton:u(),cancelButton:y(),loader:w(),closeButton:H(),validationMessage:m(),progressSteps:a()};return R.domCache.set(e,t),t},Rs=(e,t,n)=>{const r=M();re(r),t.timer&&(e.timeout=new mr(()=>{n("timer"),delete e.timeout},t.timer),t.timerProgressBar&&(Q(r),me(r,t,"timerProgressBar"),setTimeout(()=>{e.timeout&&e.timeout.running&&ot(t.timer)})))},Ns=(e,t)=>{if(!t.toast){if(!X(t.allowEnterKey))return Ds();Hs(e,t)||ct(t,-1,1)}},Hs=(e,t)=>t.focusDeny&&le(e.denyButton)?(e.denyButton.focus(),!0):t.focusCancel&&le(e.cancelButton)?(e.cancelButton.focus(),!0):t.focusConfirm&&le(e.confirmButton)?(e.confirmButton.focus(),!0):!1,Ds=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(Me.prototype,Xt),Object.assign(Me,Us),Object.keys(Xt).forEach(e=>{Me[e]=function(){if(ht)return ht[e](...arguments)}}),Me.DismissReason=Fe,Me.version="11.4.8";const Xe=Me;return Xe.default=Xe,Xe}),typeof ke<"u"&&ke.Sweetalert2&&(ke.swal=ke.sweetAlert=ke.Swal=ke.SweetAlert=ke.Sweetalert2)})(kt);var Bn=kt.exports;const xt=gt(Bn);class Pn{get IsVisible(){return xt.isVisible()}async ConfirmAsync(o){return new Promise(h=>{xt.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:o.header,html:o.message,confirmButtonText:o.confirmLabel??"confirmar",cancelButtonText:o.rejectLabel??"cancelar"}).then(v=>{h(v.isConfirmed===!0)})})}}const Tn=new Pn,Ct=()=>Tn,In=["data-cor"],Ln=c.defineComponent({__name:"HeaderAvatar",setup(l){const o=Ct(),h=U();async function v(){await o.ConfirmAsync({message:`${ee.User.username} - ${ee.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ee.CallLogout()}function U(){const I=ee.User.name;let O="?";if(!I)return O;const p=I.split(" ").filter(W=>W.length>0).map(W=>W[0].toUpperCase()),K=Math.min(2,p.length);return O=p.slice(0,K).join(""),O.length>0?O:"?"}function x(){const I=h[0],O=I==="?"?0:(I.charCodeAt(0)-64)%19;return Math.max(O,0)}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{id:"sf-header-avatar","data-cor":x(),onClick:v},c.toDisplayString(c.unref(h)),9,In))}}),Fn={},Un={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Mn=[c.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function On(l,o){return c.openBlock(),c.createElementBlock("svg",Un,Mn)}const Vn=mt(Fn,[["render",On]]);class Rn{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const tt=(()=>new Rn)(),Nn=[c.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],Hn=c.defineComponent({__name:"ThemeToggle",setup(l){return(o,h)=>(c.openBlock(),c.createElementBlock("button",{id:"sf-theme-toggle",onClick:h[0]||(h[0]=(...v)=>c.unref(tt).Toggle&&c.unref(tt).Toggle(...v))},Nn))}}),Dn={id:"sf-layout"},jn=c.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),zn={class:"title"},$n={class:"sf-layout-nav-header"},qn=c.createElementVNode("span",null,"Menu",-1),Wn={class:"sf-layout-nav-content"},Kn=c.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),Jn={id:"sf-layout-content"},Yn=c.defineComponent({__name:"Layout",setup(l){const o=Ze();return(h,v)=>(c.openBlock(),c.createElementBlock("div",Dn,[c.createElementVNode("header",null,[c.createElementVNode("div",{class:c.normalizeClass(["sf-layout-menu-toggler",{invert:c.unref(o).IsVisible}]),onClick:v[0]||(v[0]=U=>c.unref(o).Toggle())},[jn,c.createVNode(Vn)],2),c.createElementVNode("div",zn,[c.renderSlot(h.$slots,"title")]),c.renderSlot(h.$slots,"action"),c.createVNode(Hn),c.createVNode(Ln)]),c.createElementVNode("nav",{class:c.normalizeClass({visible:c.unref(o).IsVisible})},[c.createElementVNode("div",$n,[qn,c.createVNode(Ve,{icone:"close",button:"",onClick:v[1]||(v[1]=U=>c.unref(o).Close())})]),c.createElementVNode("div",Wn,[c.renderSlot(h.$slots,"menu")])],2),c.createElementVNode("main",{class:c.normalizeClass({"menu-visible":c.unref(o).IsVisible})},[Kn,c.createElementVNode("section",Jn,[c.renderSlot(h.$slots,"content")])],2)]))}}),Xn=["href","data-active","onClick"],Zn={class:"sf-navmenulink-text"},Gn=c.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(l){const o=l,h=Ze();function v(U,x){U.preventDefault();const O=U.target.closest(".sf-layout-nav-content");x(),O&&O.clientWidth+10>document.body.clientWidth&&h.Close()}return(U,x)=>{const I=c.resolveComponent("router-link");return c.openBlock(),c.createBlock(I,{to:o.href,custom:""},{default:c.withCtx(({href:O,navigate:p,isExactActive:K,isActive:W})=>[c.createElementVNode("a",{class:"sf-navmenulink",href:O,"data-active":o.exact?K:W,onClick:X=>v(X,p)},[o.icon?(c.openBlock(),c.createBlock(Ve,{key:0,icone:o.icon,"button-props":{tabindex:-1}},null,8,["icone"])):c.createCommentVNode("",!0),c.createElementVNode("span",Zn,c.toDisplayString(o.text),1)],8,Xn)]),_:1},8,["to"])}}}),Qn=c.defineComponent({__name:"ScrollToTop",setup(l){const o=c.ref(!1),h=`--${+new Date}`;let v=null;function U(){v==null||v.scrollTo(0,0)}return c.onMounted(()=>{var x;v=((x=document.getElementById(h))==null?void 0:x.parentElement)??null,v&&v.addEventListener("scroll",function(){o.value=this.scrollTop-this.clientHeight>0})}),(x,I)=>(c.openBlock(),c.createElementBlock("button",{id:h,class:c.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":o.value}]),onClick:U},null,2))}}),eo=c.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(l){const o=l;function h(){return new Pe("sf-content").AddClass(o.class,!!o.class).Build()}function v(){return new Pe("sf-content-body").AddClass("sf-content-no-padding",o.disableBodyPadding).Build()}function U(){return new Pe("sf-content-header").AddClass("sf-content-no-padding",o.disableHeaderPadding).Build()}function x(){return new Pe("sf-content-footer").AddClass("sf-content-no-padding",o.disableFooterPadding).Build()}return(I,O)=>(c.openBlock(),c.createElementBlock("div",{class:c.normalizeClass(h()),style:c.normalizeStyle(o.style)},[c.createElementVNode("div",{class:c.normalizeClass(U())},[c.renderSlot(I.$slots,"header")],2),c.createElementVNode("div",{class:c.normalizeClass(v())},[c.renderSlot(I.$slots,"default"),c.createVNode(Qn)],2),c.createElementVNode("div",{class:c.normalizeClass(x())},[c.renderSlot(I.$slots,"footer")],2)],6))}}),to={class:"sf-tab-navigation"},no=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],oo=["data-active"],ro=["href","onClick"],so=[c.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[c.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],io=c.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(l){const o=l,h=c.ref(null),v=new ResizeObserver(p=>{O()}),U=c.ref(!1),x=c.ref(!1);function I(p=!1){const K=h.value.clientWidth;h.value.scrollLeft+=p?-K:K}function O(){const p=h.value.scrollWidth-h.value.clientWidth;U.value=h.value.scrollLeft>10,x.value=h.value.scrollLeft<p-10}return c.onMounted(()=>{h.value.addEventListener("scroll",O),v.observe(h.value)}),c.onBeforeUnmount(()=>{var p;try{(p=h.value)==null||p.removeEventListener("scroll",O),v.unobserve(h.value),v.disconnect()}catch{}}),(p,K)=>{const W=c.resolveComponent("RouterLink");return c.openBlock(),c.createElementBlock("div",to,[c.createElementVNode("div",{class:c.normalizeClass(["left-arrow",{active:U.value}]),onClick:K[0]||(K[0]=X=>I(!0))},no,2),c.createElementVNode("ul",{ref_key:"trackerContainer",ref:h},[(c.openBlock(!0),c.createElementBlock(c.Fragment,null,c.renderList(o.tabs,X=>(c.openBlock(),c.createBlock(W,{to:X.route,custom:!0},{default:c.withCtx(({navigate:ae,isActive:j})=>[c.createElementVNode("li",{"data-active":j},[c.renderSlot(p.$slots,"item",{item:X,navigate:ae,isActive:j},()=>[c.createElementVNode("a",{href:X.route,class:c.normalizeClass({active:j}),onClick:ae},c.toDisplayString(X.text),11,ro)])],8,oo)]),_:2},1032,["to"]))),256))],512),c.createElementVNode("div",{class:c.normalizeClass(["right-arrow",{active:x.value}]),onClick:K[1]||(K[1]=X=>I())},so,2)])}}}),ao=["id","name","disabled","data-color","form","type"],co={class:"sf-button-label"},lo=c.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{}},setup(l){const o=l;function h(){return new Pe(`${o.class??""} sf-button`).AddClass("sf-component-loading",o.loading).AddClass("sf-component-disabled",o.disabled).AddClass("sf-button-small",o.size==="sm").AddClass("sf-button-medium",o.size==="md").AddClass("sf-button-large",o.size==="lg").AddClass("sf-button-filled",o.variant==="filled").AddClass("sf-button-text",o.variant==="text").AddClass("sf-button-outlined",o.variant==="outlined").AddClass("sf-button-with-icon",!!o.icon).AddClass("sf-ripple").Build()}return(v,U)=>(c.openBlock(),c.createElementBlock("button",{id:o.id,name:o.name,class:c.normalizeClass(h()),style:c.normalizeStyle(o.style),disabled:o.disabled||o.loading,"data-color":o.color,form:o.form,type:o.type},[o.icon?(c.openBlock(),c.createBlock(Ve,{key:0,icone:o.icon,loading:o.loading,size:o.size,"button-props":{tabindex:-1}},null,8,["icone","loading","size"])):o.loading?(c.openBlock(),c.createBlock(Ve,{key:1,loading:!0,size:o.size,"button-props":{tabindex:-1}},null,8,["size"])):c.createCommentVNode("",!0),c.createElementVNode("span",co,[c.renderSlot(v.$slots,"default")])],14,ao))}});class uo{constructor(o=null){$e(this,"errors",[]);$e(this,"_value",null);this._value=o}get value(){return this._value}set value(o){this._value=o}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}WithError(o){this.errors.push(o)}}const Gs="",Qs="";(()=>{function l(){c.nextTick(()=>{setTimeout(()=>{var h;const o=document.querySelector(":root");o&&o.style.setProperty("--window-height",`${((h=window.visualViewport)==null?void 0:h.height)??window.innerHeight}px`)},1)})}l(),window.addEventListener("resize",l)})(),tt.SetInitialTheme(),q.AppResult=uo,q.AuthService=ee,q.Cor=Ge,q.SfButton=lo,q.SfContent=eo,q.SfIcon=Ve,q.SfLayout=Yn,q.SfNavMenuLink=Gn,q.SfTabNavigation=io,q.Tamanho=Be,q.UseDialogService=Ct,q.UseNavMenuService=Ze,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
76
|
+
If you think this parameter should be updatable, request it here: https://github.com/sweetalert2/sweetalert2/issues/new?template=02_feature_request.md`)}),e};function Vs(){const t=U.domCache.get(this),e=U.innerParams.get(this);if(!e){go(this);return}t.popup&&M.swalCloseEventFinishedCallback&&(M.swalCloseEventFinishedCallback(),delete M.swalCloseEventFinishedCallback),M.deferDisposalTimer&&(clearTimeout(M.deferDisposalTimer),delete M.deferDisposalTimer),typeof e.didDestroy=="function"&&e.didDestroy(),js(this)}const js=t=>{go(t),delete t.params,delete M.keydownHandler,delete M.keydownTarget,delete M.currentInstance},go=t=>{t.isAwaitingPromise()?(un(U,t),U.awaitingPromise.set(t,!0)):(un(vt,t),un(U,t))},un=(t,e)=>{for(const n in t)t[n].delete(e)},bo=Object.freeze(Object.defineProperty({__proto__:null,_destroy:Vs,close:Mt,closeModal:Mt,closePopup:Mt,closeToast:Mt,disableButtons:Os,disableInput:Ms,disableLoading:ao,enableButtons:Rs,enableInput:Fs,getInput:ms,getProgressSteps:Ds,handleAwaitingPromise:kt,hideLoading:ao,isAwaitingPromise:Ts,rejectPromise:Ls,resetValidationMessage:Us,showValidationMessage:Ns,update:$s},Symbol.toStringTag,{value:"Module"})),zs=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.input?yo(t,"confirm"):fn(t,!0)},Ws=t=>{const e=U.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?yo(t,"deny"):dn(t,!1)},qs=(t,e)=>{t.disableButtons(),e(Qe.cancel)},yo=(t,e)=>{const n=U.innerParams.get(t);if(!n.input)return $e(`The "input" parameter is needed to be set when using returnInputValueOn${Yt(e)}`);const o=as(t,n);n.inputValidator?Ks(t,o,e):t.getInput().checkValidity()?e==="deny"?dn(t,o):fn(t,o):(t.enableButtons(),t.showValidationMessage(n.validationMessage))},Ks=(t,e,n)=>{const o=U.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>ft(o.inputValidator(e,o.validationMessage))).then(c=>{t.enableButtons(),t.enableInput(),c?t.showValidationMessage(c):n==="deny"?dn(t,e):fn(t,e)})},dn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnDeny&&et(Ne()),n.preDeny?(U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>ft(n.preDeny(e,n.validationMessage))).then(s=>{s===!1?(t.hideLoading(),kt(t)):t.closePopup({isDenied:!0,value:typeof s>"u"?e:s})}).catch(s=>vo(t||globalThis,s))):t.closePopup({isDenied:!0,value:e})},wo=(t,e)=>{t.closePopup({isConfirmed:!0,value:e})},vo=(t,e)=>{t.rejectPromise(e)},fn=(t,e)=>{const n=U.innerParams.get(t||globalThis);n.showLoaderOnConfirm&&et(),n.preConfirm?(t.resetValidationMessage(),U.awaitingPromise.set(t||globalThis,!0),Promise.resolve().then(()=>ft(n.preConfirm(e,n.validationMessage))).then(s=>{we(Bt())||s===!1?(t.hideLoading(),kt(t)):wo(t,typeof s>"u"?e:s)}).catch(s=>vo(t||globalThis,s))):wo(t,e)},Gs=(t,e,n)=>{U.innerParams.get(t).toast?Ys(t,e,n):(Xs(e),Zs(e),Qs(t,e,n))},Ys=(t,e,n)=>{e.popup.onclick=()=>{const o=U.innerParams.get(t);o&&(Js(o)||o.timer||o.input)||n(Qe.close)}},Js=t=>t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton;let Nt=!1;const Xs=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=void 0,e.target===t.container&&(Nt=!0)}}},Zs=t=>{t.container.onmousedown=()=>{t.popup.onmouseup=function(e){t.popup.onmouseup=void 0,(e.target===t.popup||t.popup.contains(e.target))&&(Nt=!0)}}},Qs=(t,e,n)=>{e.container.onclick=o=>{const s=U.innerParams.get(t);if(Nt){Nt=!1;return}o.target===e.container&&It(s.allowOutsideClick)&&n(Qe.backdrop)}},ea=t=>typeof t=="object"&&t.jquery,ko=t=>t instanceof Element||ea(t),ta=t=>{const e={};return typeof t[0]=="object"&&!ko(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,o)=>{const s=t[o];typeof s=="string"||ko(s)?e[n]=s:s!==void 0&&$e(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`)}),e};function na(...t){const e=this;return new e(...t)}function oa(t){class e extends this{_main(o,s){return super._main(o,Object.assign({},t,s))}}return e}const ra=()=>M.timeout&&M.timeout.getTimerLeft(),_o=()=>{if(M.timeout)return Wr(),M.timeout.stop()},Ao=()=>{if(M.timeout){const t=M.timeout.start();return on(t),t}},ia=()=>{const t=M.timeout;return t&&(t.running?_o():Ao())},sa=t=>{if(M.timeout){const e=M.timeout.increase(t);return on(e,!0),e}},aa=()=>M.timeout&&M.timeout.isRunning();let Co=!1;const hn={};function la(t="data-swal-template"){hn[t]=this,Co||(document.body.addEventListener("click",ca),Co=!0)}const ca=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in hn){const o=e.getAttribute(n);if(o){hn[n].fire({template:o});return}}},ua=Object.freeze(Object.defineProperty({__proto__:null,argsToParams:ta,bindClickHandler:la,clickCancel:ys,clickConfirm:lo,clickDeny:bs,enableLoading:et,fire:na,getActions:gt,getCancelButton:He,getCloseButton:Qt,getConfirmButton:Te,getContainer:oe,getDenyButton:Ne,getFocusableElements:en,getFooter:jn,getHtmlContainer:Pt,getIcon:mt,getImage:Hn,getInputLabel:$r,getLoader:Xe,getPopup:j,getTimerLeft:ra,getTimerProgressBar:Rt,getTitle:$n,getValidationMessage:Bt,increaseTimer:sa,isDeprecatedParameter:Zt,isLoading:Vr,isTimerRunning:aa,isUpdatableParameter:Un,isValidParameter:Nn,isVisible:gs,mixin:oa,resumeTimer:Ao,showLoading:et,stopTimer:_o,toggleTimer:ia},Symbol.toStringTag,{value:"Module"}));let pn;class tt{constructor(...e){if(typeof window>"u")return;pn=this;const n=Object.freeze(this.constructor.argsToParams(e));Object.defineProperties(this,{params:{value:n,writable:!1,enumerable:!0,configurable:!0}});const o=this._main(this.params);U.promise.set(this,o)}_main(e,n={}){Ur(Object.assign({},n,e)),M.currentInstance&&(M.currentInstance._destroy(),tn()&&to()),M.currentInstance=this;const o=fa(e,n);zi(o),Object.freeze(o),M.timeout&&(M.timeout.stop(),delete M.timeout),clearTimeout(M.restoreFocusTimeout);const s=ha(this);return eo(this,o),U.innerParams.set(this,o),da(this,s,o)}then(e){return U.promise.get(this).then(e)}finally(e){return U.promise.get(this).finally(e)}}const da=(t,e,n)=>new Promise((o,s)=>{const c=E=>{t.closePopup({isDismissed:!0,dismiss:E})};vt.swalPromiseResolve.set(t,o),vt.swalPromiseReject.set(t,s),e.confirmButton.onclick=()=>zs(t),e.denyButton.onclick=()=>Ws(t),e.cancelButton.onclick=()=>qs(t,c),e.closeButton.onclick=()=>c(Qe.close),Gs(t,e,c),ws(t,M,n,c),ss(t,n),ts(n),pa(M,n,c),ma(e,n),setTimeout(()=>{e.container.scrollTop=0})}),fa=(t,e)=>{const n=Oi(t),o=Object.assign({},Je,e,n,t);return o.showClass=Object.assign({},Je.showClass,o.showClass),o.hideClass=Object.assign({},Je.hideClass,o.hideClass),o},ha=t=>{const e={popup:j(),container:oe(),actions:gt(),confirmButton:Te(),denyButton:Ne(),cancelButton:He(),loader:Xe(),closeButton:Qt(),validationMessage:Bt(),progressSteps:Vn()};return U.domCache.set(t,e),e},pa=(t,e,n)=>{const o=Rt();ie(o),e.timer&&(t.timeout=new Wi(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(Q(o),Ee(o,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&on(e.timer)})))},ma=(t,e)=>{if(!e.toast){if(!It(e.allowEnterKey))return ba();ga(t,e)||cn(e,-1,1)}},ga=(t,e)=>e.focusDeny&&we(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&we(t.cancelButton)?(t.cancelButton.focus(),!0):e.focusConfirm&&we(t.confirmButton)?(t.confirmButton.focus(),!0):!1,ba=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Object.assign(tt.prototype,bo),Object.assign(tt,ua),Object.keys(bo).forEach(t=>{tt[t]=function(...e){if(pn)return pn[t](...e)}}),tt.DismissReason=Qe,tt.version="11.4.8";const nt=tt;nt.default=nt;/*! @license DOMPurify 3.0.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.6/LICENSE */const{entries:Eo,setPrototypeOf:xo,isFrozen:ya,getPrototypeOf:wa,getOwnPropertyDescriptor:To}=Object;let{freeze:le,seal:Se,create:So}=Object,{apply:mn,construct:gn}=typeof Reflect<"u"&&Reflect;le||(le=function(e){return e}),Se||(Se=function(e){return e}),mn||(mn=function(e,n,o){return e.apply(n,o)}),gn||(gn=function(e,n){return new e(...n)});const Ut=xe(Array.prototype.forEach),Lo=xe(Array.prototype.pop),_t=xe(Array.prototype.push),Dt=xe(String.prototype.toLowerCase),bn=xe(String.prototype.toString),va=xe(String.prototype.match),At=xe(String.prototype.replace),ka=xe(String.prototype.indexOf),_a=xe(String.prototype.trim),ve=xe(RegExp.prototype.test),Ct=Aa(TypeError);function xe(t){return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),s=1;s<n;s++)o[s-1]=arguments[s];return mn(t,e,o)}}function Aa(t){return function(){for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return gn(t,n)}}function N(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Dt;xo&&xo(t,null);let o=e.length;for(;o--;){let s=e[o];if(typeof s=="string"){const c=n(s);c!==s&&(ya(e)||(e[o]=c),s=c)}t[s]=!0}return t}function ot(t){const e=So(null);for(const[n,o]of Eo(t))To(t,n)!==void 0&&(e[n]=o);return e}function $t(t,e){for(;t!==null;){const o=To(t,e);if(o){if(o.get)return xe(o.get);if(typeof o.value=="function")return xe(o.value)}t=wa(t)}function n(o){return console.warn("fallback value for",o),null}return n}const Io=le(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),yn=le(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),wn=le(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ca=le(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vn=le(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Ea=le(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Po=le(["#text"]),Bo=le(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),kn=le(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ro=le(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ht=le(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xa=Se(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ta=Se(/<%[\w\W]*|[\w\W]*%>/gm),Sa=Se(/\${[\w\W]*}/gm),La=Se(/^data-[\-\w.\u00B7-\uFFFF]/),Ia=Se(/^aria-[\-\w]+$/),Oo=Se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pa=Se(/^(?:\w+script|data):/i),Ba=Se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Fo=Se(/^html$/i);var Mo=Object.freeze({__proto__:null,MUSTACHE_EXPR:xa,ERB_EXPR:Ta,TMPLIT_EXPR:Sa,DATA_ATTR:La,ARIA_ATTR:Ia,IS_ALLOWED_URI:Oo,IS_SCRIPT_OR_DATA:Pa,ATTR_WHITESPACE:Ba,DOCTYPE_NAME:Fo});const Ra=function(){return typeof window>"u"?null:window},Oa=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(o=n.getAttribute(s));const c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(E){return E},createScriptURL(E){return E}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}};function No(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ra();const e=L=>No(L);if(e.version="3.0.6",e.removed=[],!t||!t.document||t.document.nodeType!==9)return e.isSupported=!1,e;let{document:n}=t;const o=n,s=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:E,Node:I,Element:d,NodeFilter:V,NamedNodeMap:W=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:ee,DOMParser:Le,trustedTypes:z}=t,Oe=d.prototype,rt=$t(Oe,"cloneNode"),ke=$t(Oe,"nextSibling"),it=$t(Oe,"childNodes"),he=$t(Oe,"parentNode");if(typeof E=="function"){const L=n.createElement("template");L.content&&L.content.ownerDocument&&(n=L.content.ownerDocument)}let D,_e="";const{implementation:X,createNodeIterator:h,createDocumentFragment:_,getElementsByTagName:P}=n,{importNode:A}=o;let k={};e.isSupported=typeof Eo=="function"&&typeof he=="function"&&X&&X.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:v,ERB_EXPR:O,TMPLIT_EXPR:m,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:J,ATTR_WHITESPACE:Y}=Mo;let{IS_ALLOWED_URI:ce}=Mo,B=null;const pe=N({},[...Io,...yn,...wn,...vn,...Po]);let r=null;const a=N({},[...Bo,...kn,...Ro,...Ht]);let f=Object.seal(So(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),b=null,p=null,C=!0,g=!0,y=!1,T=!0,x=!1,R=!1,$=!1,me=!1,ue=!1,te=!1,Be=!1,$o=!0,Ho=!1;const bl="user-content-";let An=!0,Et=!1,st={},at=null;const Vo=N({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let jo=null;const zo=N({},["audio","video","img","source","image","track"]);let Cn=null;const Wo=N({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Vt="http://www.w3.org/1998/Math/MathML",jt="http://www.w3.org/2000/svg",Fe="http://www.w3.org/1999/xhtml";let lt=Fe,En=!1,xn=null;const yl=N({},[Vt,jt,Fe],bn);let ze=null;const wl=["application/xhtml+xml","text/html"],vl="text/html";let Z=null,ct=null;const kl=n.createElement("form"),qo=function(i){return i instanceof RegExp||i instanceof Function},Tn=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(ct&&ct===i)){if((!i||typeof i!="object")&&(i={}),i=ot(i),ze=wl.indexOf(i.PARSER_MEDIA_TYPE)===-1?ze=vl:ze=i.PARSER_MEDIA_TYPE,Z=ze==="application/xhtml+xml"?bn:Dt,B="ALLOWED_TAGS"in i?N({},i.ALLOWED_TAGS,Z):pe,r="ALLOWED_ATTR"in i?N({},i.ALLOWED_ATTR,Z):a,xn="ALLOWED_NAMESPACES"in i?N({},i.ALLOWED_NAMESPACES,bn):yl,Cn="ADD_URI_SAFE_ATTR"in i?N(ot(Wo),i.ADD_URI_SAFE_ATTR,Z):Wo,jo="ADD_DATA_URI_TAGS"in i?N(ot(zo),i.ADD_DATA_URI_TAGS,Z):zo,at="FORBID_CONTENTS"in i?N({},i.FORBID_CONTENTS,Z):Vo,b="FORBID_TAGS"in i?N({},i.FORBID_TAGS,Z):{},p="FORBID_ATTR"in i?N({},i.FORBID_ATTR,Z):{},st="USE_PROFILES"in i?i.USE_PROFILES:!1,C=i.ALLOW_ARIA_ATTR!==!1,g=i.ALLOW_DATA_ATTR!==!1,y=i.ALLOW_UNKNOWN_PROTOCOLS||!1,T=i.ALLOW_SELF_CLOSE_IN_ATTR!==!1,x=i.SAFE_FOR_TEMPLATES||!1,R=i.WHOLE_DOCUMENT||!1,ue=i.RETURN_DOM||!1,te=i.RETURN_DOM_FRAGMENT||!1,Be=i.RETURN_TRUSTED_TYPE||!1,me=i.FORCE_BODY||!1,$o=i.SANITIZE_DOM!==!1,Ho=i.SANITIZE_NAMED_PROPS||!1,An=i.KEEP_CONTENT!==!1,Et=i.IN_PLACE||!1,ce=i.ALLOWED_URI_REGEXP||Oo,lt=i.NAMESPACE||Fe,f=i.CUSTOM_ELEMENT_HANDLING||{},i.CUSTOM_ELEMENT_HANDLING&&qo(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(f.tagNameCheck=i.CUSTOM_ELEMENT_HANDLING.tagNameCheck),i.CUSTOM_ELEMENT_HANDLING&&qo(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(f.attributeNameCheck=i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),i.CUSTOM_ELEMENT_HANDLING&&typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(f.allowCustomizedBuiltInElements=i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),x&&(g=!1),te&&(ue=!0),st&&(B=N({},[...Po]),r=[],st.html===!0&&(N(B,Io),N(r,Bo)),st.svg===!0&&(N(B,yn),N(r,kn),N(r,Ht)),st.svgFilters===!0&&(N(B,wn),N(r,kn),N(r,Ht)),st.mathMl===!0&&(N(B,vn),N(r,Ro),N(r,Ht))),i.ADD_TAGS&&(B===pe&&(B=ot(B)),N(B,i.ADD_TAGS,Z)),i.ADD_ATTR&&(r===a&&(r=ot(r)),N(r,i.ADD_ATTR,Z)),i.ADD_URI_SAFE_ATTR&&N(Cn,i.ADD_URI_SAFE_ATTR,Z),i.FORBID_CONTENTS&&(at===Vo&&(at=ot(at)),N(at,i.FORBID_CONTENTS,Z)),An&&(B["#text"]=!0),R&&N(B,["html","head","body"]),B.table&&(N(B,["tbody"]),delete b.tbody),i.TRUSTED_TYPES_POLICY){if(typeof i.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof i.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ct('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');D=i.TRUSTED_TYPES_POLICY,_e=D.createHTML("")}else D===void 0&&(D=Oa(z,s)),D!==null&&typeof _e=="string"&&(_e=D.createHTML(""));le&&le(i),ct=i}},Ko=N({},["mi","mo","mn","ms","mtext"]),Go=N({},["foreignobject","desc","title","annotation-xml"]),_l=N({},["title","style","font","a","script"]),zt=N({},yn);N(zt,wn),N(zt,Ca);const Sn=N({},vn);N(Sn,Ea);const Al=function(i){let w=he(i);(!w||!w.tagName)&&(w={namespaceURI:lt,tagName:"template"});const S=Dt(i.tagName),K=Dt(w.tagName);return xn[i.namespaceURI]?i.namespaceURI===jt?w.namespaceURI===Fe?S==="svg":w.namespaceURI===Vt?S==="svg"&&(K==="annotation-xml"||Ko[K]):!!zt[S]:i.namespaceURI===Vt?w.namespaceURI===Fe?S==="math":w.namespaceURI===jt?S==="math"&&Go[K]:!!Sn[S]:i.namespaceURI===Fe?w.namespaceURI===jt&&!Go[K]||w.namespaceURI===Vt&&!Ko[K]?!1:!Sn[S]&&(_l[S]||!zt[S]):!!(ze==="application/xhtml+xml"&&xn[i.namespaceURI]):!1},We=function(i){_t(e.removed,{element:i});try{i.parentNode.removeChild(i)}catch{i.remove()}},Ln=function(i,w){try{_t(e.removed,{attribute:w.getAttributeNode(i),from:w})}catch{_t(e.removed,{attribute:null,from:w})}if(w.removeAttribute(i),i==="is"&&!r[i])if(ue||te)try{We(w)}catch{}else try{w.setAttribute(i,"")}catch{}},Yo=function(i){let w=null,S=null;if(me)i="<remove></remove>"+i;else{const ae=va(i,/^[\r\n\t ]+/);S=ae&&ae[0]}ze==="application/xhtml+xml"&<===Fe&&(i='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+i+"</body></html>");const K=D?D.createHTML(i):i;if(lt===Fe)try{w=new Le().parseFromString(K,ze)}catch{}if(!w||!w.documentElement){w=X.createDocument(lt,"template",null);try{w.documentElement.innerHTML=En?_e:K}catch{}}const se=w.body||w.documentElement;return i&&S&&se.insertBefore(n.createTextNode(S),se.childNodes[0]||null),lt===Fe?P.call(w,R?"html":"body")[0]:R?w.documentElement:se},Jo=function(i){return h.call(i.ownerDocument||i,i,V.SHOW_ELEMENT|V.SHOW_COMMENT|V.SHOW_TEXT,null)},Cl=function(i){return i instanceof ee&&(typeof i.nodeName!="string"||typeof i.textContent!="string"||typeof i.removeChild!="function"||!(i.attributes instanceof W)||typeof i.removeAttribute!="function"||typeof i.setAttribute!="function"||typeof i.namespaceURI!="string"||typeof i.insertBefore!="function"||typeof i.hasChildNodes!="function")},Xo=function(i){return typeof I=="function"&&i instanceof I},Me=function(i,w,S){k[i]&&Ut(k[i],K=>{K.call(e,w,S,ct)})},Zo=function(i){let w=null;if(Me("beforeSanitizeElements",i,null),Cl(i))return We(i),!0;const S=Z(i.nodeName);if(Me("uponSanitizeElement",i,{tagName:S,allowedTags:B}),i.hasChildNodes()&&!Xo(i.firstElementChild)&&ve(/<[/\w]/g,i.innerHTML)&&ve(/<[/\w]/g,i.textContent))return We(i),!0;if(!B[S]||b[S]){if(!b[S]&&er(S)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,S)||f.tagNameCheck instanceof Function&&f.tagNameCheck(S)))return!1;if(An&&!at[S]){const K=he(i)||i.parentNode,se=it(i)||i.childNodes;if(se&&K){const ae=se.length;for(let ge=ae-1;ge>=0;--ge)K.insertBefore(rt(se[ge],!0),ke(i))}}return We(i),!0}return i instanceof d&&!Al(i)||(S==="noscript"||S==="noembed"||S==="noframes")&&ve(/<\/no(script|embed|frames)/i,i.innerHTML)?(We(i),!0):(x&&i.nodeType===3&&(w=i.textContent,Ut([v,O,m],K=>{w=At(w,K," ")}),i.textContent!==w&&(_t(e.removed,{element:i.cloneNode()}),i.textContent=w)),Me("afterSanitizeElements",i,null),!1)},Qo=function(i,w,S){if($o&&(w==="id"||w==="name")&&(S in n||S in kl))return!1;if(!(g&&!p[w]&&ve(F,w))){if(!(C&&ve(q,w))){if(!r[w]||p[w]){if(!(er(i)&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,i)||f.tagNameCheck instanceof Function&&f.tagNameCheck(i))&&(f.attributeNameCheck instanceof RegExp&&ve(f.attributeNameCheck,w)||f.attributeNameCheck instanceof Function&&f.attributeNameCheck(w))||w==="is"&&f.allowCustomizedBuiltInElements&&(f.tagNameCheck instanceof RegExp&&ve(f.tagNameCheck,S)||f.tagNameCheck instanceof Function&&f.tagNameCheck(S))))return!1}else if(!Cn[w]){if(!ve(ce,At(S,Y,""))){if(!((w==="src"||w==="xlink:href"||w==="href")&&i!=="script"&&ka(S,"data:")===0&&jo[i])){if(!(y&&!ve(J,At(S,Y,"")))){if(S)return!1}}}}}}return!0},er=function(i){return i.indexOf("-")>0},tr=function(i){Me("beforeSanitizeAttributes",i,null);const{attributes:w}=i;if(!w)return;const S={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:r};let K=w.length;for(;K--;){const se=w[K],{name:ae,namespaceURI:ge,value:qe}=se,xt=Z(ae);let be=ae==="value"?qe:_a(qe);if(S.attrName=xt,S.attrValue=be,S.keepAttr=!0,S.forceKeepAttr=void 0,Me("uponSanitizeAttribute",i,S),be=S.attrValue,S.forceKeepAttr||(Ln(ae,i),!S.keepAttr))continue;if(!T&&ve(/\/>/i,be)){Ln(ae,i);continue}x&&Ut([v,O,m],or=>{be=At(be,or," ")});const nr=Z(i.nodeName);if(Qo(nr,xt,be)){if(Ho&&(xt==="id"||xt==="name")&&(Ln(ae,i),be=bl+be),D&&typeof z=="object"&&typeof z.getAttributeType=="function"&&!ge)switch(z.getAttributeType(nr,xt)){case"TrustedHTML":{be=D.createHTML(be);break}case"TrustedScriptURL":{be=D.createScriptURL(be);break}}try{ge?i.setAttributeNS(ge,ae,be):i.setAttribute(ae,be),Lo(e.removed)}catch{}}}Me("afterSanitizeAttributes",i,null)},El=function L(i){let w=null;const S=Jo(i);for(Me("beforeSanitizeShadowDOM",i,null);w=S.nextNode();)Me("uponSanitizeShadowNode",w,null),!Zo(w)&&(w.content instanceof c&&L(w.content),tr(w));Me("afterSanitizeShadowDOM",i,null)};return e.sanitize=function(L){let i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},w=null,S=null,K=null,se=null;if(En=!L,En&&(L="<!-->"),typeof L!="string"&&!Xo(L))if(typeof L.toString=="function"){if(L=L.toString(),typeof L!="string")throw Ct("dirty is not a string, aborting")}else throw Ct("toString is not a function");if(!e.isSupported)return L;if($||Tn(i),e.removed=[],typeof L=="string"&&(Et=!1),Et){if(L.nodeName){const qe=Z(L.nodeName);if(!B[qe]||b[qe])throw Ct("root node is forbidden and cannot be sanitized in-place")}}else if(L instanceof I)w=Yo("<!---->"),S=w.ownerDocument.importNode(L,!0),S.nodeType===1&&S.nodeName==="BODY"||S.nodeName==="HTML"?w=S:w.appendChild(S);else{if(!ue&&!x&&!R&&L.indexOf("<")===-1)return D&&Be?D.createHTML(L):L;if(w=Yo(L),!w)return ue?null:Be?_e:""}w&&me&&We(w.firstChild);const ae=Jo(Et?L:w);for(;K=ae.nextNode();)Zo(K)||(K.content instanceof c&&El(K.content),tr(K));if(Et)return L;if(ue){if(te)for(se=_.call(w.ownerDocument);w.firstChild;)se.appendChild(w.firstChild);else se=w;return(r.shadowroot||r.shadowrootmode)&&(se=A.call(o,se,!0)),se}let ge=R?w.outerHTML:w.innerHTML;return R&&B["!doctype"]&&w.ownerDocument&&w.ownerDocument.doctype&&w.ownerDocument.doctype.name&&ve(Fo,w.ownerDocument.doctype.name)&&(ge="<!DOCTYPE "+w.ownerDocument.doctype.name+`>
|
|
77
|
+
`+ge),x&&Ut([v,O,m],qe=>{ge=At(ge,qe," ")}),D&&Be?D.createHTML(ge):ge},e.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn(L),$=!0},e.clearConfig=function(){ct=null,$=!1},e.isValidAttribute=function(L,i,w){ct||Tn({});const S=Z(L),K=Z(i);return Qo(S,K,w)},e.addHook=function(L,i){typeof i=="function"&&(k[L]=k[L]||[],_t(k[L],i))},e.removeHook=function(L){if(k[L])return Lo(k[L])},e.removeHooks=function(L){k[L]&&(k[L]=[])},e.removeAllHooks=function(){k={}},e}var Uo=No();class Fa{get IsVisible(){return nt.isVisible()}async ConfirmAsync(e){return new Promise(n=>{nt.fire({showCancelButton:!0,allowEscapeKey:!1,allowOutsideClick:!1,icon:"question",title:e.title,html:Uo.sanitize(e.text),confirmButtonText:e.confirmLabel??"confirmar",cancelButtonText:e.rejectLabel??"cancelar"}).then(o=>{n(o.isConfirmed===!0)})})}async AlertAsync(e){const n=e.icon??"info";let o;return Array.isArray(e.text)?o=`<div style="max-height: 50vh; overflow: auto">
|
|
78
|
+
${e.text.join("<br />")}
|
|
79
|
+
</div>`:o=e.text,new Promise(s=>{nt.fire({allowEscapeKey:!1,allowOutsideClick:!1,icon:n,title:e.title,html:Uo.sanitize(o)}).then(()=>s(!0))})}}const Ma=new Fa,Do=()=>Ma,Na=["data-cor"],Ua=l.defineComponent({__name:"HeaderAvatar",setup(t){const e=Do(),n=s();async function o(){await e.ConfirmAsync({text:`${ne.User.username} - ${ne.User.name}.<br /><br />Você deseja sair da conta?`,confirmLabel:"sair"})&&ne.CallLogout()}function s(){const E=ne.User.name;let I="?";if(!E)return I;const d=E.split(" ").filter(W=>W.length>0).map(W=>W[0].toUpperCase()),V=Math.min(2,d.length);return I=d.slice(0,V).join(""),I.length>0?I:"?"}function c(){const E=n[0],I=E==="?"?0:(E.charCodeAt(0)-64)%19;return Math.max(I,0)}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{id:"sf-header-avatar","data-cor":c(),onClick:o},l.toDisplayString(l.unref(n)),9,Na))}}),Da={},$a={xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",class:"sf-svg-icon"},Ha=[l.createElementVNode("path",{d:"m307.231-83.463-54.999-55.23 343.923-343.922-343.923-343.539 54.999-54.614 398.153 398.153L307.231-83.462Z"},null,-1)];function Va(t,e){return l.openBlock(),l.createElementBlock("svg",$a,Ha)}const ja=In(Da,[["render",Va]]);class za{get storedTheme(){return localStorage.getItem("color-scheme")}get IsDark(){return document.documentElement.classList.contains("dark")}Toggle(){this.IsDark?this.EnableLightMode():this.EnableDarkMode()}EnableDarkMode(){document.documentElement.classList.add("dark"),document.documentElement.classList.remove("light"),localStorage.setItem("color-scheme","dark")}EnableLightMode(){document.documentElement.classList.remove("dark"),document.documentElement.classList.add("light"),localStorage.setItem("color-scheme","light")}SetInitialTheme(){if(this.storedTheme==="light")return this.EnableLightMode();if(this.storedTheme==="dark")return this.EnableDarkMode();if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches)return this.EnableDarkMode();this.EnableLightMode()}}const _n=(()=>new za)(),Wa=[l.createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="472.39" height="472.39" viewBox="0 0 472.39 472.39"><g class="toggle-sun"><path d="M403.21,167V69.18H305.38L236.2,0,167,69.18H69.18V167L0,236.2l69.18,69.18v97.83H167l69.18,69.18,69.18-69.18h97.83V305.38l69.18-69.18Zm-167,198.17a129,129,0,1,1,129-129A129,129,0,0,1,236.2,365.19Z"></path></g><g class="toggle-circle"><circle class="cls-1" cx="236.2" cy="236.2" r="103.78"></circle></g></svg>',1)],qa=l.defineComponent({__name:"ThemeToggle",setup(t){return(e,n)=>(l.openBlock(),l.createElementBlock("button",{id:"sf-theme-toggle",onClick:n[0]||(n[0]=(...o)=>l.unref(_n).Toggle&&l.unref(_n).Toggle(...o))},Wa))}}),Ka={id:"sf-layout"},Ga=l.createElementVNode("div",{class:"sf-layout-menu-toggler-logo"},null,-1),Ya={class:"title"},Ja={class:"sf-layout-nav-header"},Xa=l.createElementVNode("span",null,"Menu",-1),Za={class:"sf-layout-nav-content"},Qa=l.createElementVNode("section",{id:"sf-layout-page-title"},null,-1),el={id:"sf-layout-content"},tl=l.defineComponent({__name:"Layout",setup(t){const e=Wt();return(n,o)=>(l.openBlock(),l.createElementBlock("div",Ka,[l.createElementVNode("header",null,[l.createElementVNode("div",{class:l.normalizeClass(["sf-layout-menu-toggler",{invert:l.unref(e).IsVisible}]),onClick:o[0]||(o[0]=s=>l.unref(e).Toggle())},[Ga,l.createVNode(ja)],2),l.createElementVNode("div",Ya,[l.renderSlot(n.$slots,"title")]),l.renderSlot(n.$slots,"action"),l.createVNode(qa),l.createVNode(Ua)]),l.createElementVNode("nav",{class:l.normalizeClass({visible:l.unref(e).IsVisible})},[l.createElementVNode("div",Ja,[Xa,l.createVNode(ut,{icone:"close",button:"",onClick:o[1]||(o[1]=s=>l.unref(e).Close())})]),l.createElementVNode("div",Za,[l.renderSlot(n.$slots,"menu")])],2),l.createElementVNode("main",{class:l.normalizeClass({"menu-visible":l.unref(e).IsVisible})},[Qa,l.createElementVNode("section",el,[l.renderSlot(n.$slots,"content")])],2)]))}}),nl=["href","data-active","onClick"],ol={class:"sf-navmenulink-text"},rl=l.defineComponent({__name:"NavMenuLink",props:{href:{},text:{},icon:{},exact:{type:Boolean}},setup(t){const e=t,n=Wt();function o(s,c){s.preventDefault();const I=s.target.closest(".sf-layout-nav-content");c(),I&&I.clientWidth+10>document.body.clientWidth&&n.Close()}return(s,c)=>{const E=l.resolveComponent("router-link");return l.openBlock(),l.createBlock(E,{to:e.href,custom:""},{default:l.withCtx(({href:I,navigate:d,isExactActive:V,isActive:W})=>[l.createElementVNode("a",{class:"sf-navmenulink",href:I,"data-active":e.exact?V:W,onClick:ee=>o(ee,d)},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,"button-props":{tabindex:-1}},null,8,["icone"])):l.createCommentVNode("",!0),l.createElementVNode("span",ol,l.toDisplayString(e.text),1)],8,nl)]),_:1},8,["to"])}}}),il=l.defineComponent({__name:"ScrollToTop",setup(t){const e=l.ref(!1),n=`--${+new Date}`;let o=null;function s(){o==null||o.scrollTo(0,0)}return l.onMounted(()=>{var c;o=((c=document.getElementById(n))==null?void 0:c.parentElement)??null,o&&o.addEventListener("scroll",function(){e.value=this.scrollTop-this.clientHeight>0})}),(c,E)=>(l.openBlock(),l.createElementBlock("button",{id:n,class:l.normalizeClass(["sf-scrollToTop",{"sf-scrollToTop-visible":e.value}]),onClick:s},null,2))}}),sl=l.defineComponent({__name:"Content",props:{class:{},style:{},disableBodyPadding:{type:Boolean},disableHeaderPadding:{type:Boolean},disableFooterPadding:{type:Boolean}},setup(t){const e=t;function n(){return new Ge("sf-content").AddClass(e.class,!!e.class).Build()}function o(){return new Ge("sf-content-body").AddClass("sf-content-no-padding",e.disableBodyPadding).Build()}function s(){return new Ge("sf-content-header").AddClass("sf-content-no-padding",e.disableHeaderPadding).Build()}function c(){return new Ge("sf-content-footer").AddClass("sf-content-no-padding",e.disableFooterPadding).Build()}return(E,I)=>(l.openBlock(),l.createElementBlock("div",{class:l.normalizeClass(n()),style:l.normalizeStyle(e.style)},[l.createElementVNode("div",{class:l.normalizeClass(s())},[l.renderSlot(E.$slots,"header")],2),l.createElementVNode("div",{class:l.normalizeClass(o())},[l.renderSlot(E.$slots,"default"),l.createVNode(il)],2),l.createElementVNode("div",{class:l.normalizeClass(c())},[l.renderSlot(E.$slots,"footer")],2)],6))}}),al={class:"sf-tab-navigation"},ll=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 19.5L8.25 12l7.5-7.5"})],-1)],cl=["data-active"],ul=["href","onClick"],dl=[l.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"w-6 h-6"},[l.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 4.5l7.5 7.5-7.5 7.5"})],-1)],fl=l.defineComponent({__name:"TabNavigation",props:{tabs:{}},setup(t){const e=t,n=l.ref(null),o=new ResizeObserver(d=>{I()}),s=l.ref(!1),c=l.ref(!1);function E(d=!1){const V=n.value.clientWidth;n.value.scrollLeft+=d?-V:V}function I(){const d=n.value.scrollWidth-n.value.clientWidth;s.value=n.value.scrollLeft>10,c.value=n.value.scrollLeft<d-10}return l.onMounted(()=>{n.value.addEventListener("scroll",I),o.observe(n.value)}),l.onBeforeUnmount(()=>{var d;try{(d=n.value)==null||d.removeEventListener("scroll",I),o.unobserve(n.value),o.disconnect()}catch{}}),(d,V)=>{const W=l.resolveComponent("RouterLink");return l.openBlock(),l.createElementBlock("div",al,[l.createElementVNode("div",{class:l.normalizeClass(["left-arrow",{active:s.value}]),onClick:V[0]||(V[0]=ee=>E(!0))},ll,2),l.createElementVNode("ul",{ref_key:"trackerContainer",ref:n},[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(e.tabs,ee=>(l.openBlock(),l.createBlock(W,{to:ee.route,custom:!0},{default:l.withCtx(({navigate:Le,isActive:z})=>[l.createElementVNode("li",{"data-active":z},[l.renderSlot(d.$slots,"item",{item:ee,navigate:Le,isActive:z},()=>[l.createElementVNode("a",{href:ee.route,class:l.normalizeClass({active:z}),onClick:Le},l.toDisplayString(ee.text),11,ul)])],8,cl)]),_:2},1032,["to"]))),256))],512),l.createElementVNode("div",{class:l.normalizeClass(["right-arrow",{active:c.value}]),onClick:V[1]||(V[1]=ee=>E())},dl,2)])}}}),hl=["id","name","disabled","data-color","form","type"],pl={class:"sf-button-label"},ml=l.defineComponent({__name:"Button",props:{icon:{},visible:{type:Boolean,default:!0},class:{},style:{},disabled:{type:Boolean},loading:{type:Boolean},color:{default:"primary"},size:{default:"md"},variant:{default:"filled"},autofocus:{type:Boolean},form:{},name:{},id:{},type:{default:"button"},value:{}},setup(t){const e=t;function n(){return new Ge(`${e.class??""} sf-button`).AddClass("sf-component-loading",e.loading).AddClass("sf-component-disabled",e.disabled).AddClass("sf-button-small",e.size==="sm").AddClass("sf-button-medium",e.size==="md").AddClass("sf-button-large",e.size==="lg").AddClass("sf-button-filled",e.variant==="filled").AddClass("sf-button-text",e.variant==="text").AddClass("sf-button-outlined",e.variant==="outlined").AddClass("sf-button-with-icon",!!e.icon).AddClass("sf-ripple").Build()}return(o,s)=>(l.openBlock(),l.createElementBlock("button",{id:e.id,name:e.name,class:l.normalizeClass(n()),style:l.normalizeStyle(e.style),disabled:e.disabled||e.loading,"data-color":e.color,form:e.form,type:e.type},[e.icon?(l.openBlock(),l.createBlock(ut,{key:0,icone:e.icon,loading:e.loading,size:e.size,"button-props":{tabindex:-1}},null,8,["icone","loading","size"])):e.loading?(l.openBlock(),l.createBlock(ut,{key:1,loading:!0,size:e.size,"button-props":{tabindex:-1}},null,8,["size"])):l.createCommentVNode("",!0),l.createElementVNode("span",pl,[l.renderSlot(o.$slots,"default")])],14,hl))}});class gl{constructor(e=null){Tt(this,"errors",[]);Tt(this,"_value",null);this._value=e}get value(){return this._value}set value(e){this._value=e}get hasSuccess(){return!this.hasError}get hasError(){return this.errors.length>0}WithError(e){this.errors.push(e)}}const Ml="",Nl="";(()=>{function t(){l.nextTick(()=>{setTimeout(()=>{var n;const e=document.querySelector(":root");e&&e.style.setProperty("--window-height",`${((n=window.visualViewport)==null?void 0:n.height)??window.innerHeight}px`)},1)})}t(),window.addEventListener("resize",t)})(),_n.SetInitialTheme(),G.AppResult=gl,G.AuthService=ne,G.Cor=qt,G.SfButton=ml,G.SfContent=sl,G.SfIcon=ut,G.SfLayout=tl,G.SfNavMenuLink=rl,G.SfTabNavigation=fl,G.Tamanho=Ke,G.UseDialogService=Do,G.UseNavMenuService=Wt,Object.defineProperty(G,Symbol.toStringTag,{value:"Module"})});
|
|
80
80
|
//# sourceMappingURL=lib.umd.js.map
|