UNPKG

@randevcx/ranui

Version:

UI Component library based on `Web Component`

1 lines 6.74 MB
!function(g,I){"object"==typeof exports&&"undefined"!=typeof module?I(exports):"function"==typeof define&&define.amd?define(["exports"],I):I((g="undefined"!=typeof globalThis?globalThis:g||self).ranui={})}(this,(function(g){"use strict";var I=Object.defineProperty,C=(g,C,A)=>(((g,C,A)=>{C in g?I(g,C,{enumerable:!0,configurable:!0,writable:!0,value:A}):g[C]=A})(g,"symbol"!=typeof C?C+"":C,A),A);function A(g,I){for(var C=0;C<I.length;C++){const A=I[C];if("string"!=typeof A&&!Array.isArray(A))for(const I in A)if("default"!==I&&!(I in g)){const C=Object.getOwnPropertyDescriptor(A,I);C&&Object.defineProperty(g,I,C.get?C:{enumerable:!0,get:()=>A[I]})}}return Object.freeze(Object.defineProperty(g,Symbol.toStringTag,{value:"Module"}))}const i=(g,I="text/xml")=>{if(window.DOMParser)return(new window.DOMParser).parseFromString(g,I).documentElement;if(void 0!==window.ActiveXObject){const I=new window.ActiveXObject("Microsoft.XMLDOM");return I.async="false",I.loadXML(g),I}};var e=Object.defineProperty,l=(g,I,C)=>(((g,I,C)=>{I in g?e(g,I,{enumerable:!0,configurable:!0,writable:!0,value:C}):g[I]=C})(g,"symbol"!=typeof I?I+"":I,C),C);const t=()=>{},s=()=>{if("undefined"!=typeof window){const g=navigator.userAgent.toLowerCase();return/ipad|ipod/.test(g)?"ipad":/android/.test(g)?"android":/iphone/.test(g)?"iphone":"pc"}return"pc"},c="undefined"!=typeof window,d=()=>{if(!c)return!1;const g=window.navigator.userAgent;return!!/Android|webOS|iPhone|iPod|iPad|BlackBerry/i.test(g)},o=[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];class n{constructor(g,I){l(this,"highOrder"),l(this,"lowOrder"),this.highOrder=g,this.lowOrder=I}}function a(g){return g<10?`0${g}`:g}function Z(g){let I=new Date;return g&&(I=new Date(g)),I.format=(g="YYYY-MM-DD HH:mm:ss")=>{const C=I.getFullYear(),A=a(I.getMonth()+1),i=a(I.getDate()),e=a(I.getHours()),l=a(I.getMinutes()),t=a(I.getSeconds());return g.replace(/Y+/gi,`${C}`).replace(/M+/g,`${A}`).replace(/D+/gi,`${i}`).replace(/H+/gi,`${e}`).replace(/m+/g,`${l}`).replace(/S+/gi,`${t}`)},I}new n(o[0],3609767458),new n(o[1],602891725),new n(o[2],3964484399),new n(o[3],2173295548),new n(o[4],4081628472),new n(o[5],3053834265),new n(o[6],2937671579),new n(o[7],3664609560),new n(o[8],2734883394),new n(o[9],1164996542),new n(o[10],1323610764),new n(o[11],3590304994),new n(o[12],4068182383),new n(o[13],991336113),new n(o[14],633803317),new n(o[15],3479774868),new n(o[16],2666613458),new n(o[17],944711139),new n(o[18],2341262773),new n(o[19],2007800933),new n(o[20],1495990901),new n(o[21],1856431235),new n(o[22],3175218132),new n(o[23],2198950837),new n(o[24],3999719339),new n(o[25],766784016),new n(o[26],2566594879),new n(o[27],3203337956),new n(o[28],1034457026),new n(o[29],2466948901),new n(o[30],3758326383),new n(o[31],168717936),new n(o[32],1188179964),new n(o[33],1546045734),new n(o[34],1522805485),new n(o[35],2643833823),new n(o[36],2343527390),new n(o[37],1014477480),new n(o[38],1206759142),new n(o[39],344077627),new n(o[40],1290863460),new n(o[41],3158454273),new n(o[42],3505952657),new n(o[43],106217008),new n(o[44],3606008344),new n(o[45],1432725776),new n(o[46],1467031594),new n(o[47],851169720),new n(o[48],3100823752),new n(o[49],1363258195),new n(o[50],3750685593),new n(o[51],3785050280),new n(o[52],3318307427),new n(o[53],3812723403),new n(o[54],2003034995),new n(o[55],3602036899),new n(o[56],1575990012),new n(o[57],1125592928),new n(o[58],2716904306),new n(o[59],442776044),new n(o[60],593698344),new n(o[61],3733110249),new n(o[62],2999351573),new n(o[63],3815920427),new n(3391569614,3928383900),new n(3515267271,566280711),new n(3940187606,3454069534),new n(4118630271,4000239992),new n(116418474,1914138554),new n(174292421,2731055270),new n(289380356,3203993006),new n(460393269,320620315),new n(685471733,587496836),new n(852142971,1086792851),new n(1017036298,365543100),new n(1126000580,2618297676),new n(1288033470,3409855158),new n(1501505948,4234509866),new n(1607167915,987167468),new n(1816402316,1246189591),new n(0,1),new n(0,32898),new n(2147483648,32906),new n(2147483648,2147516416),new n(0,32907),new n(0,2147483649),new n(2147483648,2147516545),new n(2147483648,32777),new n(0,138),new n(0,136),new n(0,2147516425),new n(0,2147483658),new n(0,2147516555),new n(2147483648,139),new n(2147483648,32905),new n(2147483648,32771),new n(2147483648,32770),new n(2147483648,128),new n(0,32778),new n(2147483648,2147483658),new n(2147483648,2147516545),new n(2147483648,32896),new n(0,2147483649),new n(2147483648,2147516424);const b=g=>{if(0===g)return"00:00";if(!g)return"";const I=Math.trunc(g/3600),C=Math.trunc(g%3600/60),A=a(Math.trunc(g-3600*I-60*C));return 0===I?`${a(C)}:${A}`:`${a(I)}:${a(C)}:${A}`},r=g=>{const I=g.backingStorePixelRatio||g.webkitBackingStorePixelRatio||g.mozBackingStorePixelRatio||g.msBackingStorePixelRatio||g.oBackingStorePixelRatio||1;return(c&&window.devicePixelRatio||1)/I},m=(g,I)=>{if("undefined"==typeof document)return;const C=g.classList;C.contains(I)||C.add(I)},h=(g,I)=>{if("undefined"==typeof document)return;const C=g.classList;C.contains(I)&&C.remove(I)},G=g=>{if("undefined"==typeof document)return;const I=document.createDocumentFragment();return g.forEach((g=>I.appendChild(g))),I},u=()=>{let g;return function(I,C=300){return function(...A){g&&(clearTimeout(g),g=void 0);const i=this;g||(g=setTimeout((()=>{I.apply(i,A),clearTimeout(g),g=void 0}),C))}}},B=new Map([[100,"Continue"],[101,"Switching Protocols"],[102,"Processing"],[103,"Early Hints"],[200,"OK"],[201,"Created"],[202,"Accepted"],[203,"Non-Authoritative Information"],[204,"No Content"],[205,"Reset Content"],[206,"Partial Content"],[207,"Multi-Status"],[208,"Already Reported"],[226,"IM Used"],[300,"Multiple Choices"],[301,"Moved Permanently"],[302,"Found"],[303,"See Other"],[304,"Not Modified"],[305,"Use Proxy"],[307,"Temporary Redirect"],[308,"Permanent Redirect"],[400,"Bad Request"],[401,"Unauthorized"],[402,"Payment Required"],[403,"Forbidden"],[404,"Not Found"],[405,"Method Not Allowed"],[406,"Not Acceptable"],[407,"Proxy Authentication Required"],[408,"Request Timeout"],[409,"Conflict"],[410,"Gone"],[411,"Length Required"],[412,"Precondition Failed"],[413,"Payload Too Large"],[414,"URI Too Long"],[415,"Unsupported Media Type"],[416,"Range Not Satisfiable"],[417,"Expectation Failed"],[418,"I'm a Teapot"],[421,"Misdirected Request"],[422,"Unprocessable Entity"],[423,"Locked"],[424,"Failed Dependency"],[425,"Too Early"],[426,"Upgrade Required"],[428,"Precondition Required"],[429,"Too Many Requests"],[431,"Request Header Fields Too Large"],[451,"Unavailable For Legal Reasons"],[500,"Internal Server Error"],[501,"Not Implemented"],[502,"Bad Gateway"],[503,"Service Unavailable"],[504,"Gateway Timeout"],[505,"HTTP Version Not Supported"],[506,"Variant Also Negotiates"],[507,"Insufficient Storage"],[508,"Loop Detected"],[509,"Bandwidth Limit Exceeded"],[510,"Not Extended"],[511,"Network Authentication Required"]]);(function(g){const I=new Map;for(const[C,A]of g)I.set(A.toLowerCase(),C)})(B),function(g){const I=[];for(const[C,A]of g)I.push(C)}(B);const w=(g="")=>{if(0===g.length)return 0;if(g.endsWith("%")){const I=Number(g.replace("%",""));return I>1?I/100:I}return Number(g)},W=(g,I=0,C=1)=>Math.min(C,Math.max(I,g)),p=class{constructor(){l(this,"getDecimalLength",(g=>{const[I,C]=g.toString().split(".");return C?C.length:0})),l(this,"amend",((g,I=15)=>parseFloat(Number(g).toPrecision(I)))),l(this,"power",((g,I)=>Math.pow(10,Math.max(this.getDecimalLength(g),this.getDecimalLength(I)))))}};l(p,"handleMethod",((g,I)=>{const C=new p,{power:A,amend:i}=C,e=A(g,I),l=i(g*e),t=i(I*e);return g=>{switch(g){case"+":return(l+t)/e;case"-":return(l-t)/e;case"*":return l*t/(e*e);case"/":return l/t}}})),l(p,"add",((g,I)=>p.handleMethod(g,I)("+"))),l(p,"divide",((g,I)=>p.handleMethod(g,I)("/"))),l(p,"multiply",((g,I)=>p.handleMethod(g,I)("*"))),l(p,"subtract",((g,I)=>p.handleMethod(g,I)("-")));const V="NEW_LISTENER";class y{constructor(){l(this,"_events"),l(this,"tap",((g,I)=>{this._events[g]&&g!==Symbol.for(V)&&this.call(Symbol.for(V),g);const C=this._events[g]||[];"function"==typeof I?C.push({name:g,callback:I}):C.push(I),this._events[g]=C})),l(this,"call",((g,...I)=>{(this._events[g]||[]).forEach((g=>{const{callback:C}=g;C(...I)}))})),l(this,"callSync",(async(g,...I)=>{const C=this._events[g]||[];for(const A of C){const{callback:g}=A;await g(...I)}})),l(this,"once",((g,I)=>{let C;if("function"==typeof I)C={name:g,callback:(...A)=>{I(...A),this.off(g,C)},initialCallback:I};else{const{callback:A}=I;C={name:g,callback:(...I)=>{A(...I),this.off(g,C)},initialCallback:A}}this.tap(g,C)})),l(this,"off",((g,I)=>{const C=(this._events[g]||[]).filter((g=>{if("function"==typeof I)return g.callback!==I&&g.initialCallback!==I;{const{callback:C}=I;return g.callback!==C&&g.initialCallback!==C}}));this._events[g]=C})),this._events={}}}const X=[!1,"false",null,void 0],Y=g=>{const I=g.hasAttribute("disabled"),C=g.getAttribute("disabled");return!(!I||X.includes(C))};function R(g=""){return class{constructor(I=g){C(this,"message"),this.message=I}}}const N=()=>"undefined"!=typeof document?HTMLElement:null,H=(g,I)=>{const C={value:g,subscribers:new Set,comparator:null==I?void 0:I.equals},{subscriber:A}=I||{};A&&Array.isArray(A)&&A.forEach((g=>{"function"!=typeof g||C.subscribers.has(g)||C.subscribers.add(g)}));const i=g=>{C.value!==g&&(C.value=g,C.subscribers.forEach((I=>I(g))))};return[()=>C.value,g=>{const{comparator:I}=C;if(I instanceof Function)return!I(C.value,g)&&i(g);void 0===I?C.value!==g&&i(g):!I&&i(g)}]};let K=class extends(N()){constructor(){super(),C(this,"_btn"),C(this,"_btnContent"),C(this,"_iconElement"),C(this,"_slot"),C(this,"_shadowDom"),C(this,"debounceTimeId"),C(this,"setIcon",(()=>{if(this.icon){const{width:g,height:I}=this._slot.getBoundingClientRect(),C=Math.min(g,I);this._iconElement?this._iconElement.setAttribute("name",this.icon):(this._iconElement=document.createElement("r-icon"),this._iconElement.setAttribute("name",this.icon),this._iconElement.setAttribute("color","currentColor"),this._iconElement.setAttribute("class","icon"),this._slot.insertAdjacentElement("beforebegin",this._iconElement)),this.iconSize?this._iconElement.setAttribute("size",this.iconSize):this._iconElement.setAttribute("size",""+(C-5))}})),C(this,"mousedown",(g=>{if("pc"===s()&&(!this.disabled||"false"===this.disabled)){this.debounceMouseEvent();const{left:I,top:C}=this.getBoundingClientRect();this._btn.style.setProperty("--ran-x",g.clientX-I+"px"),this._btn.style.setProperty("--ran-y",g.clientY-C+"px")}})),C(this,"mouseup",(g=>{"pc"===s()&&(this.debounceTimeId||(this.debounceTimeId=setTimeout((()=>{this._btn.style.removeProperty("--ran-x"),this._btn.style.removeProperty("--ran-y"),this.debounceMouseEvent()}),600)))})),C(this,"debounceMouseEvent",(()=>{clearTimeout(this.debounceTimeId),this.debounceTimeId=void 0})),C(this,"handlerExternalCss",(()=>{if(this.sheet)try{const g=new CSSStyleSheet;g.insertRule(this.sheet),this._shadowDom.adoptedStyleSheets=[g]}catch(g){console.error(`Failed to parse the rule in CSSStyleSheet: ${this.sheet}`)}})),this._slot=document.createElement("slot"),this._btnContent=document.createElement("div"),this._btn=document.createElement("div"),this._btn.setAttribute("class","ran-btn"),this._btn.setAttribute("part","ran-btn"),this._btnContent.setAttribute("class","ran-btn-content"),this._btnContent.setAttribute("part","ran-btn-content"),this._btnContent.appendChild(this._slot),this._slot.setAttribute("class","slot");const g=this.attachShadow({mode:"closed"}),I=document.createElement("style");I.textContent='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}html.dark .r-preview-mask .r-preview-contain{background-color:#191919!important}:host{position:var(--ran-btn-position, relative);display:var(--ran-btn-display, inline-block);background-image:var(--ran-btn-background-image, none);box-shadow:var(--ran-btn-box-shadow, 0 2px #00000004);cursor:var(--ran-btn-cursor, pointer);-webkit-user-select:var(--ran-btn-user-select, none);user-select:var(--ran-btn-user-select, none);touch-action:var(--ran-btn-touch-action, manipulation);overflow:var(--ran-btn-overflow, hidden);pointer-events:var(--ran-btn-pointer-events, auto)}:host .ran-btn{position:relative;display:inline-block;background-image:none;cursor:pointer;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;user-select:none;touch-action:manipulation;background:#fff}:host,:host(:active),:host(:focus){outline:0;-webkit-tap-highlight-color:transparent}:host .ran-btn,:host(:active) .ran-btn,:host(:focus) .ran-btn{outline:0}:host(:not([disabled]):hover) .ran-btn-content{border-color:var(--ran-btn-content-hover-border-color, #1890ff);color:var(--ran-btn-content-hover-color, #1890ff)}:host([type="primary"]) .ran-btn-content{background-color:var(--ran-btn-content-background-color, #1890ff);border-color:var(--ran-btn-content-border-color, #1890ff);color:var(--ran-btn-content-color, #fff)}:host([type="primary"]:not([disabled])) .ran-btn:after{background-image:var(--ran-btn-after-background-image, radial-gradient(circle, #fff 10%, transparent 10.01%))}:host([type="primary"]:not([disabled]):hover) .ran-btn-content{background-color:var(--ran-btn-content-hover-background-color, #40a9ff);color:var(--ran-btn-content-hover-color, #fff)}:host([type="warning"]) .ran-btn-content{border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="warning"]:not([disabled])) .ran-btn:after{background-image:radial-gradient(circle,#fff 10%,transparent 10.01%)}:host([type="warning"]:not([disabled]):hover) .ran-btn-content{border-color:#ff4d4f;background-color:#ff4d4f;color:#fff}:host([type="text"]) .ran-btn-content{border:none}:host([disabled]){cursor:not-allowed;pointer-events:all;opacity:.6}:host([disabled]) .ran-btn{cursor:not-allowed;pointer-events:all;opacity:.6}:host(:not([disabled]):active) .ran-btn:after{transform:translate(-50%,-50%) scale(0);opacity:.3;transition:0s}@media (min-width: 1024px){:host(:not([disabled],[effect])) .ran-btn:after{content:"";display:block;position:absolute;width:100%;height:100%;left:var(--ran-x, 0);top:var(--ran-y, 0);pointer-events:none;background-image:radial-gradient(circle,#1890ff 10%,transparent 10.01%);background-repeat:no-repeat;background-position:50%;transform:translate(-50%,-50%) scale(10);opacity:0;transition:transform .3s,opacity .8s}}:host .slot{display:block}.ran-btn-content{display:flex;justify-content:space-between;align-items:center;padding:4px 15px;border:1px solid transparent;border-radius:2px;border-color:#d9d9d9;color:#000000d9;line-height:22px;font-size:14px;font-weight:400;white-space:nowrap;text-align:center}.ran-btn-content .icon{margin-right:2px}',g.appendChild(I),this._shadowDom=g,this._btn.appendChild(this._btnContent),g.appendChild(this._btn)}static get observedAttributes(){return["disabled","icon","effect","iconSize","sheet"]}get sheet(){return this.getAttribute("sheet")||""}set sheet(g){this.setAttribute("sheet",g||"")}get disabled(){return Y(this)}set disabled(g){g&&"false"!==g?(this.setAttribute("disabled",""),this.setAttribute("aria-disabled","true")):(this.removeAttribute("disabled"),this.removeAttribute("aria-disabled"))}get iconSize(){return this.getAttribute("iconSize")||""}set iconSize(g){g&&"false"!==g?(this.setAttribute("iconSize",g),this.setIcon()):this.removeAttribute("iconSize")}get icon(){return this.getAttribute("icon")||""}set icon(g){g&&"false"!==g?(this.setAttribute("icon",g),this.setIcon()):this.removeAttribute("icon")}get effect(){return this.getAttribute("effect")||""}set effect(g){X.includes(g)||!g?this.removeAttribute("effect"):this.setAttribute("effect",g)}connectedCallback(){this._btn.addEventListener("mousedown",this.mousedown),this._btn.addEventListener("mouseup",this.mouseup),this.handlerExternalCss(),this.setIcon(),this.setAttribute("role","button"),this.setAttribute("tabindex","0")}disconnectCallback(){this._btn.removeEventListener("mousedown",this.mousedown),this._btn.removeEventListener("mouseup",this.mouseup)}attributeChangedCallback(g,I,C){"disabled"===g&&this._btnContent&&(C&&"false"!==C?this._btnContent.removeAttribute("disabled"):this._btnContent.setAttribute("disabled","")),"icon"===g&&this._btnContent&&I!==C&&this.setIcon(),"iconSize"===g&&this._btnContent&&I!==C&&this._btnContent.setAttribute("iconSize",C),"sheet"===g&&this._shadowDom&&I!==C&&this.handlerExternalCss()}};const F="undefined"==typeof document||customElements.get("r-button")?R("document is undefined or r-button is exist"):(customElements.define("r-button",K),K),M=Object.freeze(Object.defineProperty({__proto__:null,Button:K,default:F},Symbol.toStringTag,{value:"Module"})),J=(g,I,C)=>{const A=g[I];return A?"function"==typeof A?A():Promise.resolve(A):new Promise(((g,A)=>{("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(A.bind(null,new Error("Unknown variable dynamic import: "+I+(I.split("/").length!==C?". Note that variables only represent file names one level deep.":""))))}))},S="http://www.w3.org/1999/xlink",f="xlink:href";const k=function(){if("undefined"!=typeof window&&!customElements.get("r-icon")){class g extends HTMLElement{constructor(){super(),C(this,"_icon"),C(this,"_div"),C(this,"loadLocal",(()=>new Promise(((g,I)=>{J(Object.assign({"../../assets/icons/add-user.svg":()=>Promise.resolve().then((()=>II)),"../../assets/icons/arrow-down.svg":()=>Promise.resolve().then((()=>CI)),"../../assets/icons/book.svg":()=>Promise.resolve().then((()=>AI)),"../../assets/icons/check-circle-fill.svg":()=>Promise.resolve().then((()=>iI)),"../../assets/icons/check-circle.svg":()=>Promise.resolve().then((()=>eI)),"../../assets/icons/close-circle-fill.svg":()=>Promise.resolve().then((()=>lI)),"../../assets/icons/close-circle.svg":()=>Promise.resolve().then((()=>tI)),"../../assets/icons/close.svg":()=>Promise.resolve().then((()=>sI)),"../../assets/icons/eye-close.svg":()=>Promise.resolve().then((()=>cI)),"../../assets/icons/eye.svg":()=>Promise.resolve().then((()=>dI)),"../../assets/icons/home.svg":()=>Promise.resolve().then((()=>oI)),"../../assets/icons/info-circle-fill.svg":()=>Promise.resolve().then((()=>nI)),"../../assets/icons/info-circle.svg":()=>Promise.resolve().then((()=>aI)),"../../assets/icons/loading.svg":()=>Promise.resolve().then((()=>ZI)),"../../assets/icons/lock.svg":()=>Promise.resolve().then((()=>bI)),"../../assets/icons/message.svg":()=>Promise.resolve().then((()=>rI)),"../../assets/icons/power-off.svg":()=>Promise.resolve().then((()=>mI)),"../../assets/icons/preview.svg":()=>Promise.resolve().then((()=>hI)),"../../assets/icons/setting.svg":()=>Promise.resolve().then((()=>GI)),"../../assets/icons/sprite.svg":()=>Promise.resolve().then((()=>BI)),"../../assets/icons/team.svg":()=>Promise.resolve().then((()=>wI)),"../../assets/icons/unlock.svg":()=>Promise.resolve().then((()=>WI)),"../../assets/icons/user.svg":()=>Promise.resolve().then((()=>pI)),"../../assets/icons/warning-circle-fill.svg":()=>Promise.resolve().then((()=>VI)),"../../assets/icons/warning-circle.svg":()=>Promise.resolve().then((()=>yI))}),`../../assets/icons/${this.name}.svg`,5).then((C=>{if(C&&C.default&&C.default._identification){const{data:I}=C.default;this._icon&&this._div.removeChild(this._icon),this._icon=i(I,"image/svg+xml"),this._icon&&(this._div.appendChild(this._icon),this.setSize(),this.setColor(),g())}else this.loadNs(),I(`\n couldn't be loaded by r-icon, message: ${this.name} icon is undefined`)})).catch((g=>{this.loadNs()}))})))),C(this,"loadNs",(()=>{this._icon&&this._div&&this._div.removeChild(this._icon),this._icon=document.createElement("svg"),this._icon.setAttribute("class","icon"),this._icon.setAttribute("viewBox","0 0 1024 1024"),this._icon.setAttribute("width","100"),this._icon.setAttribute("height","100");const g=document.createElementNS(S,"use");g.setAttributeNS(S,f,`../../assets/iconfont/icon.svg#icon-${this.name}`),this._icon.appendChild(g),this._div.appendChild(this._icon)})),C(this,"setIcon",(async()=>{this.name&&this.loadLocal()})),C(this,"setSize",(()=>{this._icon&&this.size&&(this._icon.setAttribute("width",this.size),this._icon.setAttribute("height",this.size))})),C(this,"setColor",(()=>{this._icon&&(this.color?this._icon.setAttribute("fill",this.color):this._icon.setAttribute("fill","currentColor"))})),C(this,"setSpin",(()=>{this.spin&&this.style.setProperty("animation-duration",`${this.spin}s`)})),this._div=document.createElement("div"),this._div.setAttribute("class","ran-icon"),this._div.setAttribute("part","ran-icon");const g=this.attachShadow({mode:"closed"}),I=document.createElement("style");I.textContent=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}html.dark .r-preview-mask .r-preview-contain{background-color:#191919!important}:host{display:inline-flex}:host([spin]){animation-name:rotate;animation-duration:1.4s;animation-timing-function:linear;animation-iteration-count:infinite}.ran-icon{display:flex;align-items:center;justify-content:center}@keyframes rotate{to{transform:rotate(360deg)}}",g.appendChild(I),g.appendChild(this._div)}static get observedAttributes(){return["name","size","color","spin"]}get name(){return this.getAttribute("name")}set name(g){g&&this.setAttribute("name",g)}get size(){return this.getAttribute("size")}set size(g){g&&this.setAttribute("size",g)}get color(){return this.getAttribute("color")}set color(g){g&&this.setAttribute("color",g)}get spin(){return this.getAttribute("spin")}set spin(g){null!=g&&this.setAttribute("spin",g)}connectedCallback(){this.setIcon()}attributeChangedCallback(g,I,C){C!==I&&("name"===g&&this.setIcon(),"size"===g&&this.setSize(),"color"===g&&this.setColor(),"spin"===g&&this.setSpin())}}customElements.define("r-icon",g)}if("undefined"!=typeof window&&!customElements.get("ra-icon")){class g extends HTMLElement{constructor(){super(),C(this,"_icon"),C(this,"_div"),C(this,"loadLocal",(()=>new Promise(((g,I)=>{J(Object.assign({"../../assets/icons/add-user.svg":()=>Promise.resolve().then((()=>II)),"../../assets/icons/arrow-down.svg":()=>Promise.resolve().then((()=>CI)),"../../assets/icons/book.svg":()=>Promise.resolve().then((()=>AI)),"../../assets/icons/check-circle-fill.svg":()=>Promise.resolve().then((()=>iI)),"../../assets/icons/check-circle.svg":()=>Promise.resolve().then((()=>eI)),"../../assets/icons/close-circle-fill.svg":()=>Promise.resolve().then((()=>lI)),"../../assets/icons/close-circle.svg":()=>Promise.resolve().then((()=>tI)),"../../assets/icons/close.svg":()=>Promise.resolve().then((()=>sI)),"../../assets/icons/eye-close.svg":()=>Promise.resolve().then((()=>cI)),"../../assets/icons/eye.svg":()=>Promise.resolve().then((()=>dI)),"../../assets/icons/home.svg":()=>Promise.resolve().then((()=>oI)),"../../assets/icons/info-circle-fill.svg":()=>Promise.resolve().then((()=>nI)),"../../assets/icons/info-circle.svg":()=>Promise.resolve().then((()=>aI)),"../../assets/icons/loading.svg":()=>Promise.resolve().then((()=>ZI)),"../../assets/icons/lock.svg":()=>Promise.resolve().then((()=>bI)),"../../assets/icons/message.svg":()=>Promise.resolve().then((()=>rI)),"../../assets/icons/power-off.svg":()=>Promise.resolve().then((()=>mI)),"../../assets/icons/preview.svg":()=>Promise.resolve().then((()=>hI)),"../../assets/icons/setting.svg":()=>Promise.resolve().then((()=>GI)),"../../assets/icons/sprite.svg":()=>Promise.resolve().then((()=>BI)),"../../assets/icons/team.svg":()=>Promise.resolve().then((()=>wI)),"../../assets/icons/unlock.svg":()=>Promise.resolve().then((()=>WI)),"../../assets/icons/user.svg":()=>Promise.resolve().then((()=>pI)),"../../assets/icons/warning-circle-fill.svg":()=>Promise.resolve().then((()=>VI)),"../../assets/icons/warning-circle.svg":()=>Promise.resolve().then((()=>yI))}),`../../assets/icons/${this.name}.svg`,5).then((C=>{if(C&&C.default&&C.default._identification){const{data:I}=C.default;this._icon&&this._div.removeChild(this._icon),this._icon=i(I,"image/svg+xml"),this._icon&&(this._div.appendChild(this._icon),this.setSize(),this.setColor(),g())}else this.loadNs(),I(`\n couldn't be loaded by r-icon, message: ${this.name} icon is undefined`)})).catch((g=>{this.loadNs()}))})))),C(this,"loadNs",(()=>{this._icon&&this._div&&this._div.removeChild(this._icon),this._icon=document.createElement("svg"),this._icon.setAttribute("class","icon"),this._icon.setAttribute("viewBox","0 0 1024 1024"),this._icon.setAttribute("width","100"),this._icon.setAttribute("height","100");const g=document.createElementNS(S,"use");g.setAttributeNS(S,f,`../../assets/iconfont/icon.svg#icon-${this.name}`),this._icon.appendChild(g),this._div.appendChild(this._icon)})),C(this,"setIcon",(async()=>{this.name&&this.loadLocal()})),C(this,"setSize",(()=>{this._icon&&this.size&&(this._icon.setAttribute("width",this.size),this._icon.setAttribute("height",this.size))})),C(this,"setColor",(()=>{this._icon&&(this.color?this._icon.setAttribute("fill",this.color):this._icon.setAttribute("fill","currentColor"))})),C(this,"setSpin",(()=>{this.spin&&this.style.setProperty("animation-duration",`${this.spin}s`)})),this._div=document.createElement("div"),this._div.setAttribute("class","ran-icon"),this._div.setAttribute("part","ran-icon")}static get observedAttributes(){return["name","size","color","spin"]}get name(){return this.getAttribute("name")}set name(g){g&&this.setAttribute("name",g)}get size(){return this.getAttribute("size")}set size(g){g&&this.setAttribute("size",g)}get color(){return this.getAttribute("color")}set color(g){g&&this.setAttribute("color",g)}get spin(){return this.getAttribute("spin")}set spin(g){null!=g&&this.setAttribute("spin",g)}connectedCallback(){this.appendChild(this._div),this.setIcon()}attributeChangedCallback(g,I,C){C!==I&&("name"===g&&this.setIcon(),"size"===g&&this.setSize(),"color"===g&&this.setColor(),"spin"===g&&this.setSpin())}}customElements.define("ra-icon",g)}}(),D=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}));const L=function(){if("undefined"!=typeof window&&!customElements.get("r-img")){class g extends HTMLElement{constructor(){super(),C(this,"_image"),C(this,"_container"),this._container=document.createElement("div"),this._container.setAttribute("class","ran-image");const g=this.attachShadow({mode:"closed"}),I=document.createElement("style");I.textContent=".remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}html.dark .r-preview-mask .r-preview-contain{background-color:#191919!important}",g.appendChild(I),g.appendChild(this._container)}static get observedAttributes(){return["fallback"]}get fallback(){return this.getAttribute("fallback")||"\n data:image/png;base64,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\n"}set fallback(g){g?this.setAttribute("fallback",g):this.removeAttribute("fallback")}listenFallback(g,I){"fallback"===g&&this._image&&(I?this._image.setAttribute("fallback",I):this._image.removeAttribute("fallback"))}connectedCallback(){const g=this.getAttribute("src")||"";this._image=new Image,this._image.src=g,this._image.addEventListener("error",(()=>{this._image&&this.fallback&&(this._image.src=this.fallback)})),this._image.addEventListener("load",(()=>{this._image&&this._container.appendChild(this._image)}))}attributeChangedCallback(g,I,C){this.listenFallback(g,C)}}customElements.define("r-img",g)}}(),z=Object.freeze(Object.defineProperty({__proto__:null,default:L},Symbol.toStringTag,{value:"Module"}));let v=class extends(N()){constructor(){super(),C(this,"_input"),C(this,"_label"),C(this,"_inputContent"),C(this,"_icon"),C(this,"customInput",(g=>{g.stopPropagation(),g.preventDefault();const{target:I,data:C=""}=g;this.value=(null==I?void 0:I.value)||C||"",this.customChange(),this.dispatchEvent(new CustomEvent("input",{detail:{value:this.value}}))})),C(this,"customChange",(()=>{this.dispatchEvent(new CustomEvent("change",{detail:{value:this.value}}))})),C(this,"listenPlaceholder",((g,I)=>{"placeholder"===g&&this._inputContent&&(null!=I?this._inputContent.setAttribute("placeholder",I):this._inputContent.removeAttribute("placeholder"))})),C(this,"listenLabel",((g,I)=>{"label"===g&&this._inputContent&&(null!=I?this._label?this._label.innerHTML=I:(this._label=document.createElement("label"),this._label.innerHTML=I,this._label.setAttribute("class","ran-input-label"),this._label.setAttribute("part","ran-input-label"),this._input.appendChild(this._label)):(this._input.removeAttribute("label"),this._label&&(this._input.removeChild(this._label),this._label=void 0)))})),C(this,"listenType",((g,I)=>{"type"===g&&this._inputContent&&(I?this._inputContent.setAttribute("type",I):(this._inputContent.removeAttribute("type"),this._inputContent.removeAttribute("min"),this._inputContent.removeAttribute("max"),this._inputContent.removeAttribute("step")))})),C(this,"listenStatus",((g,I)=>{"status"===g&&this._input&&(I?this._input.setAttribute("status",I):this._input.removeAttribute("status"))})),C(this,"listenDisabled",((g,I)=>{"disabled"===g&&this._input&&(X.includes(I)?this._input.removeAttribute("disabled"):(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")))})),C(this,"listenIcon",((g,I,C)=>{"icon"===g&&I&&I!==C&&(this.removeAttribute("label"),this.setAttribute("icon",I),this.dealIcon())})),C(this,"dealIcon",(()=>{if(!this._icon){this._icon=document.createElement("ra-icon");const{width:g,height:I}=this._inputContent.getBoundingClientRect(),C=Math.min(g,I);this._icon.setAttribute("size",`${C}`),this._inputContent.insertAdjacentElement("beforebegin",this._icon)}this.icon&&this._icon.setAttribute("name",this.icon)})),C(this,"listenEvent",((g,I,C)=>{this.listenPlaceholder(g,C),this.listenLabel(g,C),this.listenStatus(g,C),this.listenDisabled(g,C),this.listenIcon(g,C,I),"value"===g&&I!==C&&(this._inputContent.value=C,this._input.setAttribute("value",C))}));const g=this.attachShadow({mode:"closed"}),I=document.createElement("style");I.textContent='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}html.dark .r-preview-mask .r-preview-contain{background-color:#191919!important}.ran-input{position:relative;display:flex;width:var(--ran-input-width, calc(100% - 16px) );height:var(--ran-input-height, calc(100% - 4px) );min-width:0;padding:var(--ran-input-padding, 2px 8px);color:#000000d9;font-size:var(--ran-input-font-size, 12px);line-height:var(--ran-input-line-height, 1.5715);background-color:var(--ran-input-background-color, #fff);background-image:var(--ran-input-background-image, none);border:var(--ran-input-border, 1px solid #d9d9d9);border-radius:var(--ran-input-border-radius, 2px);transition:var(--ran-input-transition, all .3s)}.ran-input .ran-icon{display:flex;align-items:center;justify-content:center}.ran-input:active{border-color:#40a9ff;box-shadow:0 0 0 2px #1890ff33;border-right-width:1px;outline:0}.ran-input:hover{border-color:#40a9ff;border-right-width:1px}.ran-input>.ran-input-content:hover~.ran-input-label{color:#40a9ff}.ran-input[value]>.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8);color:#00000040}.ran-input[status=error]{border-color:#ff4d4f}.ran-input[status=error]>.ran-input-content~.ran-input-label{color:#ff4d4f}.ran-input[status=warning]{border-color:#ff7875}.ran-input[status=warning]>.ran-input-content~.ran-input-label{color:#ff7875}.ran-input[disabled]{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content{color:#00000040;background-color:#f5f5f5;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed;opacity:1}.ran-input[disabled]>.ran-input-content~.ran-input-label{color:#00000040;background-color:#f5f5f5}.ran-input[disabled]>.ran-input-label{color:#999;border-color:#d9d9d9;box-shadow:none;cursor:not-allowed}.ran-input-content{writing-mode:horizontal-tb;text-rendering:auto;letter-spacing:normal;word-spacing:normal;text-transform:none;text-indent:0px;text-shadow:none;text-align:start;-webkit-rtl-ordering:logical;cursor:text;touch-action:manipulation;-webkit-appearance:none;text-overflow:ellipsis;box-sizing:border-box;margin:0;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";position:relative;border:none;width:100%;min-width:0;color:#000000d9;font-size:14px;line-height:1.48;background-color:#fff;background-image:none;transition:all .3s;outline:none}.ran-input-content:focus,.ran-input-content:hover{border:none;outline:0}.ran-input-content::placeholder{color:#999}.ran-input-content:placeholder-shown~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content:focus~.ran-input-label{transform:translateY(calc(-50% - .43em)) scale(.8)}.ran-input-content::-webkit-search-cancel-button{display:none;-webkit-appearance:none}.ran-input-label{pointer-events:none;position:absolute;font-size:14px;left:8px;transition:transform .3s,color .3s,background-color .3s,backdrop-filter .3s;transform-origin:left;padding:0 .2em;color:#999;background:#fff;opacity:.9}',g.appendChild(I),this._input=document.createElement("div"),this._input.setAttribute("class","ran-input"),this._input.setAttribute("part","ran-input"),this._inputContent=document.createElement("input"),this._inputContent.setAttribute("class","ran-input-content"),this._inputContent.setAttribute("part","ran-input-content"),this._input.appendChild(this._inputContent),g.appendChild(this._input)}static get observedAttributes(){return["label","disabled","name","placeholder","type","icon","value","status","prefix","suffix","allowclear","count","maxlength","showcount","onPressEnter","variant","minrows","maxrows"]}get value(){return this.getAttribute("value")||""}set value(g){!Y(this)&&g?(this.setAttribute("value",g),this._input.setAttribute("value",g)):(this.removeAttribute("value"),this._input.removeAttribute("value"))}get placeholder(){return this.getAttribute("placeholder")||""}set placeholder(g){g?this.setAttribute("placeholder",g):this.removeAttribute("placeholder")}get required(){return this.getAttribute("required")||""}set required(g){g&&"false"!==g?this.setAttribute("required",""):this.removeAttribute("required")}get disabled(){return`${Y(this)}`}set disabled(g){X.includes(g)?(this.removeAttribute("disabled"),this._input.removeAttribute("disabled"),this._inputContent.removeAttribute("disabled")):(this.setAttribute("disabled",""),this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled",""))}get label(){return this.getAttribute("label")||""}set label(g){this.setAttribute("label",g)}get status(){return this.getAttribute("status")||""}set status(g){g?(this.setAttribute("status",g),this._input.setAttribute("status",g)):(this.removeAttribute("status"),this._input.removeAttribute("status"))}get name(){return this.getAttribute("name")||""}set name(g){this.setAttribute("name",g)}get min(){return this.getAttribute("min")||""}set min(g){"number"===this.type&&this.setAttribute("min",g)}get max(){return this.getAttribute("max")||""}set max(g){"number"===this.type&&this.setAttribute("max",g)}get step(){return this.getAttribute("step")||""}set step(g){"number"===this.type&&this.setAttribute("step",g)}get icon(){return this.getAttribute("icon")||""}set icon(g){g?this.setAttribute("icon",g):this.removeAttribute("icon")}get prefix(){return this.getAttribute("prefix")||""}set prefix(g){g?this.setAttribute("prefix",g):this.removeAttribute("prefix")}get suffix(){return this.getAttribute("suffix")||""}set suffix(g){g?this.setAttribute("suffix",g):this.removeAttribute("suffix")}get type(){return this.getAttribute("type")||""}set type(g){g?this.setAttribute("type",g):this.removeAttribute("type")}connectedCallback(){this.value&&(this._inputContent.value=this.value,this._input.setAttribute("value",this.value)),this.status&&this._input.setAttribute("status",this.status),Y(this)&&(this._input.setAttribute("disabled",""),this._inputContent.setAttribute("disabled","")),this.type&&this._inputContent.setAttribute("type",this.type),this._inputContent.addEventListener("input",this.customInput),"complete"===document.readyState&&this.dealIcon()}disconnectCallback(){this._inputContent.removeEventListener("input",this.customInput)}attributeChangedCallback(g,I,C){this.listenEvent(g,I,C)}};const T="undefined"==typeof window||customElements.get("r-input")?R("document is undefined or r-input is exist"):(customElements.define("r-input",v),v),x=Object.freeze(Object.defineProperty({__proto__:null,Input:v,default:T},Symbol.toStringTag,{value:"Module"})),U=new Map([["success","check-circle-fill"],["warning","warning-circle-fill"],["error","close-circle-fill"],["info","info-circle-fill"],["toast",null]]),Q=new Map([["success","#52c41a"],["warning","#faad14"],["error","#ff4d4f"],["info","#1890ff"],["toast","rgba(0, 0, 0, 0.7)"]]);const j=function(){if("undefined"!=typeof window&&!customElements.get("r-message")){class g extends HTMLElement{constructor(){super(),C(this,"_info"),C(this,"_notice"),C(this,"_content"),C(this,"_icon"),C(this,"_span"),C(this,"timeId"),C(this,"close"),C(this,"setIcon",(g=>{var I,C,A,i;const e=U.get(g),l=Q.get(g);e&&(null==(I=this._icon)||I.setAttribute("name",e),null==(C=this._icon)||C.style.setProperty("margin-right","8px"),null==(A=this._icon)||A.setAttribute("size","18"),l&&(null==(i=this._icon)||i.setAttribute("color",l)))})),this._notice=document.createElement("div"),this._notice.setAttribute("class","ran-message-notice"),this._content=document.createElement("div"),this._content.setAttribute("class","ran-message-notice-content"),this._info=document.createElement("div"),this._info.setAttribute("class","ran-message-notice-content-info"),this._icon=document.createElement("r-icon"),this._span=document.createElement("span"),this._info.appendChild(this._icon),this._info.appendChild(this._span),this._content.appendChild(this._info),this._notice.appendChild(this._content);const g=this.attachShadow({mode:"closed"}),I=document.createElement("style");I.textContent='.remove-wap-active-focus{outline:0;-webkit-tap-highlight-color:transparent}.remove-wap-active-focus:active,.remove-wap-active-focus:focus{outline:0;-webkit-tap-highlight-color:transparent}html.dark .r-preview-mask .r-preview-contain{background-color:#191919!important}:host([type="toast"]){--ranui-message-background: rgba(0, 0, 0, .7);--ranui-message-color: #fff;--ranui-message-border-radius: 7px}.ran-message-notice{padding:8px;text-align:center;max-width:90%;margin:0 auto;word-break:break-all}.ran-message-notice-content{display:inline-block;padding:10px 16px;background:var(--ranui-message-background, #fff);border-radius:var(--ranui-message-border-radius, 8px);box-shadow:0 3px 6px -4px #0000001f,0 6px 16px #00000014,0 9px 28px 8px #0000000d;pointer-events:all}.ran-message-notice-content-info{align-items:center;display:flex}.ran-message-notice-content-info span{margin:0;padding:0;color:var(--ranui-message-color, #000000d9);font-size:14px;font-variant:tabular-nums;list-style:none;font-feature-settings:"tnum";z-index:1010;width:100%;pointer-events:none}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes MessageMoveIn{0%{padding:0;transform:translateY(-100%);opacity:0}to{padding:8px;transform:translateY(0);opacity:1}}@keyframes MessageMoveOut{0%{max-height:150px;padding:8px;opacity:1}to{max-height:0;padding:0;opacity:0}}.ranui-message{box-sizing:border-box;margin:0;padding:0;color:#000000d9;font-size:14px;font-variant:tabular-nums;line-height:1.5715;list-style:none;font-feature-settings:"tnum";position:fixed;top:8px;left:0;z-index:1010;width:100%;pointer-events:none}.ranui-message .message-in{animation-name:MessageMoveIn;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.ranui-message .message-leave{animation-name:MessageMoveOut;animation-duration:.3s;animation-timing-function:cubic-bezier(.78,.14,.15,.86)}',g.appendChild(I),g.appendChild(this._notice)}static get observedAttributes(){return["type","content"]}get type(){return this.getAttribute("type")}set type(g){g&&this.setAttribute("type",g)}get content(){return this.getAttribute("content")}set content(g){g&&this.setAttribute("content",g)}attributeChangedCallback(g,I,C){"content"===g&&I!==C&&(this._span.textContent=C),"type"===g&&I!==C&&this.setIcon(C)}}customElements.define("r-message",g);const I=document.createElement("div"),A=document.createElement("div");A.setAttribute("class","ranui-message"),document.body.appendChild(I),I.appendChild(A);const i=I=>C=>{const i=new g;i.setAttribute("class","message"),i.timeId&&clearTimeout(i.timeId),i.setAttribute("type",I);let e,l=3e3;if(!C)return;"string"==typeof C?i.setAttribute("content",C):(i.setAttribute("content",C.content),e=C.close,l=C.duration||3e3);const t=setTimeout((()=>{i.classList.remove("message-in"),i.classList.add("message-leave"),clearTimeout(t)}),l-300);i.timeId=setTimeout((()=>{i.classList.remove("message-leave"),A.removeChild(i),e&&e()}),l),A.appendChild(i),i.classList.add("message-in"),setTimeout((()=>{i.classList.remove("message-in")}),300)};return{info:i("info"),success:i("success"),error:i("error"),warning:i("warning"),toast:i("toast")}}return{}}();"undefined"!=typeof window&&j&&(window.message=j,window.ranui||(window.ranui={}),window.ranui.message=j);const O=Object.freeze(Object.defineProperty({__proto__:null,default:j},Symbol.toStringTag,{value:"Module"})),E="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",P="application/vnd.ms-excel",{warning:_=t}=j;const q=async function(){if("undefined"!=typeof document&&!customElements.get("r-preview")){const{renderPptx:g}=await Promise.resolve().then((()=>OI)),{renderDocx:I}=await Promise.resolve().then((()=>QA)),{renderPdf:A}=await Promise.resolve().then((()=>OA)),{renderExcel:i}=await Promise.resolve().then((()=>bc)),e=(g,I)=>{if("undefined"==typeof XMLHttpRequest)throw new Error("XMLHttpRequest is not defined");return"undefined"==typeof document?Promise.reject("document is not defined"):new Promise((function(C,A){const i=new XMLHttpRequest;i.open(I.method||"GET",g,!0),i.responseType=I.responseType||"arraybuffer",i.onload=function(){if(200===i.status){const g={success:!0,data:i.response,message:""};I.onLoad&&I.onLoad(g),C(g)}else{const g={success:!1,data:i.status,message:`The request status is${i.status}`};I.onError&&I.onError(g),A(g)}},i.onerror=function(g){const C={success:!1,data:g,message:""};I.onError&&I.onError(C),A(C)},i.onprogress=g=>{I.onProgress&&I.onProgress(g)},i.withCredentials=I.withCredentials||!1,I.headers&&Object.keys(I.headers).forEach((function(g){(null==I?void 0:I.headers)&&i.setRequestHeader(g,I.headers[g])})),i.send(I.body)}))},l=new Map([["application/pdf",A],["application/vnd.openxmlformats-officedocument.presentationml.presentation",(I,C)=>{const{dom:A,onError:i,onLoad:e}=C;return new Promise(((C,l)=>{const t=new FileReader;t.readAsArrayBuffer(I),t.onload=()=>{var I;if(t.result&&A){const l={pptx:t.result,resultElement:A,onError:i,onLoad:e};null==(I=g(l))||I.then((()=>{C()}))}},t.onerror=g=>{l(g)},t.onabort=g=>{l(g)}}))}],["application/vnd.openxmlformats-officedocument.wordprocessingml.document",(g,C)=>{const{dom:A,onError:i,onLoad:e}=C;return Promise.resolve().then((()=>I({buffer:g,bodyContainer:A}))).then((()=>{e&&e({success:!0,message:""})})).catch((g=>{i&&i({success:!0,data:g,message:""})}))}],[E,i],[P,i]]);class t extends HTMLElement{constructor(){super(),C(this,"_loadingText"),C(this,"preview"),C(this,"previewContext"),C(this,"_slot"),C(this,"_div"),C(this,"_loadingElement"),C(this,"zoomRender"),C(this,"createLoading",(()=>{this._loadingElement=document.createElement("div"),this._loadingElement.setAttribute("class","r-preview-loading");const g=document.createElement("r-icon");return g.setAttribute("name","loading"),g.setAttribute("size","100"),g.setAttribute("color"," var(--el-loading-color)"),g.setAttribute("spin",""),this._loadingText=document.createElement("div"),this._loadingElement.appendChild(g),this._loadingText.setAttribute("class","r-preview-loading-text"),this._loadingElement.appendChild(this._loadingText),this._loadingElement})),C(this,"onProgress",(g=>{const I=g.loaded/g.total*100,C=Math.min(99,I).toFixed(2)+"%";this._loadingText&&this._loadingElement&&(this._loadingText.innerText=`Loading ${C}`,I>=100&&setTimeout((()=>{this._loadingText.innerText="Loading..."}),300))})),C(this,"onError",(g=>{var I;this.dispatchEvent(new CustomEvent("error",{detail:{error:g},bubbles:!0,composed:!0})),null==(I=this.preview)||I.removeChild(this._loadingElement)})),C(this,"onLoad",(()=>{var g;null==(g=this.preview)||g.removeChild(this._loadingElement),this.dispatchEvent(new CustomEvent("loaded",{detail:{isComplete:!0},bubbles:!0,composed:!0}))})),C(this,"handleFile",(async g=>{try{if("string"==typeof g){const{success:I,data:C,message:A}=await e(g,{onProgress:this.onProgress,onError:this.onError,responseType:"blob"});if(I&&C){g=new File([C],C.name,{type:C.type});const{type:I}=g,A=l.get(I);if(A&&this.previewContext){this.previewContext.style.setProperty("width","100%");const I={dom:this.previewContext,onError:this.onError,onLoad:this.onLoad},{zoomRender:C}=await A(g,I);this.zoomRender=C}}else _(A)}}catch(I){}})),C(this,"closePreview",(()=>{this.preview=this.preview||document.getElementById("r-preview-mask"),this.preview&&("true"===this.isContain?this._div.removeChild(this.preview):document.body.removeChild(this.preview),this.preview=void 0)})),C(this,"showPreview",(()=>{var g;if(this.src){if(this.preview)this.preview.style.display="block";else{this.preview=document.createElement("div"),this.preview.setAttribute("class","r-preview-mask"),this.preview.setAttribute("id","r-preview-mask"),"true"===this.isContain&&this.preview.classList.add("r-preview-mask-contain");const I=document.createElement("div");if(I.setAttribute("class","r-