layui/package/component/lib/index.js

34528 lines
2.5 MiB
JavaScript
Raw Normal View History

2022-12-30 08:13:19 +00:00
import { defineComponent, computed as computed$1, openBlock, createElementBlock, normalizeStyle, unref, createCommentVNode, toDisplayString as toDisplayString$1, normalizeClass, ref, watch, onMounted, nextTick, createElementVNode, Fragment, renderList, shallowRef, createTextVNode, createVNode, useSlots, inject, Transition, withCtx, createBlock, renderSlot, h, render as render$1, isVNode, getCurrentInstance, onUnmounted, isRef, Text, onBeforeUnmount, withDirectives, withModifiers, vShow, provide, reactive, toRefs, getCurrentScope, onScopeDispose, customRef, onUpdated, Teleport, useAttrs, mergeProps, cloneVNode, resolveComponent, useCssVars, toRef, normalizeProps, withKeys, createSlots, vModelSelect, vModelText, watchEffect, toHandlers, toHandlerKey, Comment } from "vue";
var index$13 = /* @__PURE__ */ (() => ":root{--global-primary-color: #009688;--global-normal-color: #1e9fff;--global-warm-color: #ffb800;--global-danger-color: #ff5722;--global-checked-color: #5fb878;--global-info-color: #31BDEC;--global-border-radius: 2px;--global-neutral-color-1: #FAFAFA;--global-neutral-color-2: #F6F6F6;--global-neutral-color-3: #eeeeee;--global-neutral-color-4: #e2e2e2;--global-neutral-color-5: #dddddd;--global-neutral-color-6: #d2d2d2;--global-neutral-color-7: #cccccc;--global-neutral-color-8: #c2c2c2;--darkreader-border--global-primary-color: #0d796f}h1,h2,h3,h4,h5,h6{font-weight:400}a,body{color:#333}li{list-style:none}.layui-inline{position:relative;display:inline-block;vertical-align:middle}.layui-btn,.layui-edge,.layui-inline{vertical-align:middle}.layui-elip,.layui-form-checkbox span,.layui-form-pane .layui-form-label{text-overflow:ellipsis;white-space:nowrap}p,dd,dl,dt,h1,h2,h3,h4,h5,h6,ul,li,ol,td,th,pre,div,form,body,input,button,textarea{margin:0;padding:0}img{border:none;display:inline-block;vertical-align:middle}table{border-collapse:collapse;border-spacing:0}h4,h5,h6{font-size:100%}button,input,optgroup,option,select,textarea{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;outline:0}body{line-height:1.6;color:#000000d9;font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif}hr{padding:0;line-height:0;margin:10px 0;border:none!important;border-bottom:1px solid #EEEEEE!important;clear:both;background:0 0}a{text-decoration:none}a:hover{color:#777}a cite{font-style:normal}.layui-border-box,.layui-border-box *{box-sizing:border-box}.layui-btn,.layui-btn-group,.layui-edge{display:inline-block}.layui-disabled,.layui-disabled:hover{color:var(--global-neutral-color-6)!important;cursor:not-allowed!important}.layui-btn,.layui-input,.layui-select,.layui-textarea,.layui-upload-button{outline:0;-webkit-appearance:none;transition:all .3s;-webkit-transition:all .3s;box-sizing:border-box}.layui-form-label,.layui-form-mid,.layui-input-block,.layui-input-inline,.layui-input-wrap,.layui-textarea{position:relative}.layui-border,.layui-colla-content,.layui-colla-item,.layui-collapse,.layui-form-pane .layui-form-item[pane],.layui-form-pane .layui-form-label,.layui-iconpicker,.layui-iconpicker-main,.layui-input-split,.layui-layedit,.layui-layedit-tool,.layui-quote-nm,.layui-tab-bar,.layui-tab-card,.layui-tab-title,.layui-tab-title .layui-this:after{border-color:var(--global-neutral-color-3)}.layui-form-checkbox,.layui-form-checkbox *,.layui-form-switch{display:inline-block;vertical-align:middle}.layui-iconpicker-list li,.layui-keyboard-list li,.layui-menu li,.layui-menu-body-title a:hover,.layui-menu-body-title>.layui-icon:hover{transition:all .3s}.layui-colorpicker-alpha-slider,.layui-colorpicker-side-slider,.layui-menu *,.layui-menu,.layui-nav{box-sizing:border-box}.layui-edge{width:0;border-width:6px;position:relative;border-style:dashed;border-color:transparent}.layui-edge-top{top:-4px;border-bottom-color:#999;border-bottom-style:solid}.layui-edge-right{border-left-color:#999;border-left-style:solid}.layui-edge-bottom{top:2px;border-top-color:#999;border-top-style:solid}.layui-edge-left{border-right-color:#999;border-right-style:solid}.layui-show{display:block!important}.layui-hide{display:none!important}.layui-border,.layui-border-black,.layui-border-blue,.layui-border-cyan,.layui-border-green,.layui-border-orange,.layui-border-red{border-width:1px;border-style:solid}.layui-border-red{border-color:#ff5722!important;color:#ff5722!important}.layui-border-orange{border-color:#ffb800!important;color:#ffb800!important}.layui-border-green{border-color:#009688!important;color:#009688!important}.layui-border-cyan{border-color:#2f4056!important;color:#2f4056!important}.layui-border-blue{border-color:#1e9fff!important;color:#1e9fff!important}.layui-border-black{border-color:#393d49!important;color:#393d49!important}.layui-bg-black,.layui-bg-blue,.layui-bg-cyan,.layui-bg-green,.layui-bg-orange,.layui-bg-red{color:#fff!important}.layui-bg-red{background-color:#ff5722!impor
2022-12-30 08:14:41 +00:00
var index$12 = /* @__PURE__ */ (() => '.layui-layer-imgbar,.layui-layer-imgtit a,.layui-layer-tab .layui-layer-title span,.layui-layer-title{text-overflow:ellipsis;white-space:nowrap;user-select:none}.layui-layer,.layui-layer-shade{position:fixed;pointer-events:auto}.layui-layer-shade{top:0;left:0;width:100%;height:100%;background-color:#000}.layui-layer{top:0;left:0;box-shadow:1px 1px 50px #0000004d;background-color:#fff;border-radius:2px;padding:0;margin:0}.layui-layer-close{position:absolute}.layui-layer-content{position:relative}.layui-layer-border{border:1px solid #eeeeee;box-shadow:1px 1px 5px #0003}.layui-layer-load{background:url(data:image/gif;base64,R0lGODlhJQAlAJECAL3L2AYrTv///wAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQFCgACACwAAAAAJQAlAAACi5SPqcvtDyGYIFpF690i8xUw3qJBwUlSadmcLqYmGQu6KDIeM13beGzYWWy3DlB4IYaMk+Dso2RWkFCfLPcRvFbZxFLUDTt21BW56TyjRep1e20+i+eYMR145W2eefj+6VFmgTQi+ECVY8iGxcg35phGo/iDFwlTyXWphwlm1imGRdcnuqhHeop6UAAAIfkEBQoAAgAsEAACAAQACwAAAgWMj6nLXAAh+QQFCgACACwVAAUACgALAAACFZQvgRi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwXABEADAADAAACBYyPqcsFACH5BAUKAAIALBUAFQAKAAsAAAITlGKZwWoMHYxqtmplxlNT7ixGAQAh+QQFCgACACwQABgABAALAAACBYyPqctcACH5BAUKAAIALAUAFQAKAAsAAAIVlC+BGL3Z3IlxUmUuhtR2LzHhsiEFACH5BAUKAAIALAEAEQAMAAMAAAIFjI+pywUAIfkEBQoAAgAsBQAFAAoACwAAAhOUYJnAagwdjGq2amXGU1PuLEYBACH5BAUKAAIALBAAAgAEAAsAAAIFhI+py1wAIfkEBQoAAgAsFQAFAAoACwAAAhWUL4AIvdnciXFSZS6G1HYvMeGyIQUAIfkEBQoAAgAsFwARAAwAAwAAAgWEj6nLBQAh+QQFCgACACwVABUACgALAAACE5RgmcBqDB2MarZqZcZTU+4sRgEAIfkEBQoAAgAsEAAYAAQACwAAAgWEj6nLXAAh+QQFCgACACwFABUACgALAAACFZQvgAi92dyJcVJlLobUdi8x4bIhBQAh+QQFCgACACwBABEADAADAAACBYSPqcsFADs=) center center no-repeat #eee}.layui-layer-ico{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANIAAAA9CAYAAADYizcVAAAACXBIWXMAAAsTAAALEwEAmpwYAAAGfGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENvcmUgNS42LWMxNDUgNzkuMTYzNDk5LCAyMDE4LzA4LzEzLTE2OjQwOjIyICAgICAgICAiPiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgeG1sbnM6cGhvdG9zaG9wPSJodHRwOi8vbnMuYWRvYmUuY29tL3Bob3Rvc2hvcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHhtcDpDcmVhdGVEYXRlPSIyMDIyLTEwLTE5VDEzOjExOjM2KzA4OjAwIiB4bXA6TW9kaWZ5RGF0ZT0iMjAyMi0xMC0yMFQxNDoyMDoxNiswODowMCIgeG1wOk1ldGFkYXRhRGF0ZT0iMjAyMi0xMC0yMFQxNDoyMDoxNiswODowMCIgZGM6Zm9ybWF0PSJpbWFnZS9wbmciIHBob3Rvc2hvcDpDb2xvck1vZGU9IjMiIHBob3Rvc2hvcDpJQ0NQcm9maWxlPSJzUkdCIElFQzYxOTY2LTIuMSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDphMGIwMjVmMy02YjkyLWQzNGUtOWM1Ni0wMTVmMjA4MjM3OGIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6YTQwNTYxOWItODQ1ZC01ODRjLWFlNTEtYzE2ODZjMmU2Yzc1IiB4bXBNTTpPcmlnaW5hbERvY3VtZW50SUQ9InhtcC5kaWQ6YTQwNTYxOWItODQ1ZC01ODRjLWFlNTEtYzE2ODZjMmU2Yzc1Ij4gPHBob3Rvc2hvcDpEb2N1bWVudEFuY2VzdG9ycz4gPHJkZjpCYWc+IDxyZGY6bGk+eG1wLmRpZDphNDA1NjE5Yi04NDVkLTU4NGMtYWU1MS1jMTY4NmMyZTZjNzU8L3JkZjpsaT4gPC9yZGY6QmFnPiA8L3Bob3Rvc2hvcDpEb2N1bWVudEFuY2VzdG9ycz4gPHhtcE1NOkhpc3Rvcnk+IDxyZGY6U2VxPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0iY3JlYXRlZCIgc3RFdnQ6aW5zdGFuY2VJRD0ieG1wLmlpZDphNDA1NjE5Yi04NDVkLTU4NGMtYWU1MS1jMTY4NmMyZTZjNzUiIHN0RXZ0OndoZW49IjIwMjItMTAtMTlUMTM6MTE6MzYrMDg6MDAiIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFkb2JlIFBob3Rvc2hvcCBDQyAyMDE5IChXaW5kb3dzKSIvPiA8cmRmOmxpIHN0RXZ0OmFjdGlvbj0ic2F2ZWQiIHN0RXZ0Omluc3RhbmNlSUQ9InhtcC5paWQ6YTBiMDI1ZjMtNmI5Mi1kMzRlLTljNTYtMDE1ZjIwODIzNzhiIiBzdEV2dDp3aGVuPSIyMDIyLTEwLTIwVDE0OjIwOjE2KzA4OjAwIiBzdEV2dDpzb2Z0d2FyZUFnZW50PSJBZG9iZSBQaG90b3Nob3AgQ0MgMjAxOSAoV2luZG93cykiIHN0RXZ0OmNoYW5nZWQ9Ii8iLz4gPC9yZGY6U2VxPiA8L3htcE1NOkhpc3Rvcnk+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+BiYglAAAKw5JREFUeJztnXl4W9W57n97a7Iky2M8JDaOnTlO4gxAICQhDAkNUCgEMtDSAdJQoLSnp7Tc3tseSu899HDa0pEDTQNhaKGQACEFCj
2022-11-15 01:16:55 +00:00
var index$11 = /* @__PURE__ */ (() => '@font-face{font-family:layui-icon;src:url(data:font/woff2;base64,d09GMgABAAAAAG+MAAsAAAAAysAAAG84AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACYSgqC3ESCmFcBNgIkA4VkC4J0AAQgBYR/B45sG52mB5TbJwXoDsCpdC3VQhRlcZZGBoKNgwD4f6ns//+UpGMMGdgGqtWt/0BUyi1WWU/IGqkpkdnXaZWkdRMu07QU4aLspsvu0r8DcmfDj1uMi/40tt0KPHQWBQkymXwS5gaxTRU5QIqTocLUzN5EhxPdvYS0BRm9jB6HjvIEznd8nd8R9eIf1nauM73yR/NTkxeNTnj81vInmdm9zhbRAYAsSwKJqsqhs73na2T1kSvoQAB06n1QYS6o0fpPMwgFEYzCwjZHglippnrTAOCp52Jz8/fAegkmGGgchhKY3e0QbLOjlWhRxAAERFBUSkVU0goQECwMwNqszYqlW+tSV+1SF/k/Xf3C/Vzk/+r335vv4rd+L6eZROXhqa1pV5dSq4mdMGuOheEv8J8l0Wr7/OEp/f5m/pREmJ6bmv2XPz0NSWGcS0L7lubn64c6qxkpPpix7Pgo91QBcUdoCCyFjkmNppXawBNDu+9tn3+QONBXUmmIYztlmUOjm4+nv6/T7ynIRUI2NiAS+KRxrbaxbaXOt95Wt+mGcrP/ZHubtH0WAV/BU7V1D/BNJFyTqwHdduXREqAmtEjdRobeqfUz6cF7o8LBgG21bAjschmWQKNxkl434SUu+Mf6lX8HbCmwYFmGQCEpJIVlCDwYnBf6yEOYOQcLuenNJQJ8W6v+1wi4zXa6cD2k5ampjoQf4mzzr6q2ApSUSKmSfa1IydN78rWy9zLeNP3/Acr4+IREgJJNEJJNSIrNYvsRpO0QpFuhSlrtACk5hGTnAZR9IeUrZKqcKl1rfbxlupfxxlvGW8bkppTbl5vmG/ajSk9lQOizcknBrSpDRUt059sClJR651ntVV8L7mmSG2kaCSMMZ3zBRMblK6/VQbbV48FV6Ss2FSMdsUjAW2TOpr4HS2vppIROqkPd+ejKHmfvw0GAxCLNkbV9d+2LxdTv3OnYoqA8rsDL8jL1N2EURmMfwdAglNoy260q5MKWKEHX9kzgQ33j5XVCBSNQopxyh46f2o1FQ1S+fsmldRlqdxJLtwaGVyACBswy67B95l7dEfkTnlUk6T61FLKJgW2cUTBohT772+OAXAWOPTv57M6zt8/+6PPz+fO57Hkisxw12vSUU2UPXhi9+HzwwP9Lu/JZ3N4/39E367E5ymWFbZoLk6v3n3pMfxNnP+UOfFJCKUUUU0Ah+eSQRy7ZZJHJQdJIJ8OekOolJSk5IdFJvKO4w4cO7N+3d89Ob7tc7XbRSKx66ewVK1etXrN23foNGzdt3rJ12/Yd4ycsU4nS8iXTFy9YuGjuzHlzZs2YP2ly+4ljOgwd1n/4iIGDunXv0alzuzatmmoZqZkWojTnobFQ44ZECNNEkGAhAgTy42+kJzc2bI2yU099DVmwNM2KtTrqMtPRmClnBowy5n+AJ9OzV+9ofbp09dXAlKkx+rrr13aAicE+RisYam3OnoOx4ZQYMBTEa4wGwy/Dov8ZP2TBvAw3FPMvGgb8RwB/EwT/EBR/Egx/ERx/EAK/ERKXCYXfyQ2/kjt+ITR+Jgw+JSx+IBx+JDx+IgK+JyKWIRK+IzK+IQq+JSq+Ig98TTTMQ574krwwF9HxBXnjc2LgM/LBJ+SLj8kPH5E/PiQmPiAW3iU2lqMAvEecY4oLvE88LECBmI74eIqC8DQJ8AgJcRcF4xkKwbMkwnMUiucpDC9QOF4kMV4iCV4mKV4hGV4lOV6jCLxOkXiDovAmKfAWReNtUuIdisH1FIsbKA6PkgpPkhqPkwZPkBaPkQ4Pkx63UTweogTcT4l4gJLwICXjHkrBHZSKeykNd1M67qQM3E6ZuI+ycBMZcDMZcZiycSOZcC2ZcYQsuEQ5uIKsxy4bcCXl4irKOy7l46AC4BQV4jTZcYaKcIyKcZxKcIhKcZAcOEBO7EYu7KcybEXl2IMqsA9VYhuqwl40DUvQdOxE1diIanAd1eIi1WELqscmNAO70EysQw1YjxqxATVhDWrGWtSCVagVq1EbrqZ2LEUdWIQ6MQN1YSbqxjU0C7PQbExGczAFzcU0NA9j0XyMQz24lRZgPFqICWgRJqLFmISWYDRaiqO0DCPQcoxCvZiP+jAUrcBwtBKD0CoMQKsxEK3FWVqPc3QQ52kI29EwLtBFnKBLOElXsBL9jKnoFW6hMn2FZ6hAYQsqCDiHChVGoeIBF1ChjT0kw7hCiRgJmTFuUQ7GFKrBuENtGAH1YOToAMYOOo3Rgp4BhqHqNkZUFsAD1AZhFRqiHyIAZQCZHaxd2HwEOPqB8sU04R/tEIGMQMAIKAVC+tCjCKpBIj2SYWTkFqiOrNEdzpAuNJGjlHREgUZ4587fEWdBgASNWSfWTMSdZEIst8TSktkI3RFjqSBPJBgKdEvMSij4oWo+SgEE32AXiANBNmyFwmI/JmhLyFkBQSkeM0FRANAlYsRGjsIgic2IPCZDaMc0sXpEyiaPHdU6qObmaXdEyMFIpyAxtjWpHtFEZ6qPS1RSkvIZuzXYP5dzGc56omf5Yb+1VdPk7+OepsZwShSGheQ0zXCOuLxAEtg5LMzuEsLpxTgCpbjoSs1ADBB+SszVEzQHc0LUCPs5DVLK8QZLagVdkslatruZW2ogyK59GsZJ7Pd3/fAJ+mO7mIl2h6Hxa6TTEd1JqU5FSrW46aU7u822DnLweCr2Xjo+7p6AqoJ3Ip5ppI5lGQJZES+BJGpPbJrzrxCCReuMmQdrbxIhHCIMUOe6zde6E2HfGvdO2Oupg5I0DjHiOhB7LhCNC/sxGm857Zk2hzbToe20T3sqz+zDIkXc6Sz9J86A3qO7sQOQMxwaXm2mqaC4sF1f7yGWBQlPouu65Ok1paFrYVbMLuC1ZdfgkXlPB818MTGLD7bOqRWJn2cJuV4v17nh3avF/IgISNmDW0nvmh8PKOIhqp5iPGRYKsCW1SMq8jHYHU1ek3ptEzIP0LNH1HmH2MD4FnRGNeS9mJ+/q119rw5djk1uZByx1PniVM+2HDpol+uWBalF5ioePeYFFP9+hLDsOljiu5GnEd5wmYUr78ktr7jUbkrOlfhjCjA+OvKu0uHozBSJHVFJWUJtWXqscPBZ1BxCM4CqDP2YEjRxmoefAUKvuXxX8n7Nw6s4KI1jRkxJJJxqYlEhzOBM1wn4c7RYNFQvJWfilNhzTJLqYtSxV+ue6b1QKd7273r3HvUPV6O1I3uyEa8fo4qiuoyXXIJjRoKtslEkS+5YTscLic6V43j1/7KbVypZr9KnbpELvticEITOF39AmxF+h5sry8a/MQ740Cofu7UMqmOJPWHYCL1fj8CmeL71c8XQIRNGrRSxIxnP76jUVolwlZKS1/pl6gYJW4Qly4QzSrnTP2nyBlizWYBa8ij27KBvFRulltc8p0iw6qMoqrdxUh/HsPSirPi4zlstH5kjWwqEYoutQ7lgwtI0cDYZQrdtU5RGhyIaEd5zmk4Q49CnE50wLQ46UE5D5A1Y+Pw+q41i/Y1Q7BAO+WB4LXqyWqN/eOWDBENedi4QOPjq1K0rvE6zXpONKjgvtXQCZqTD+LhY/mDDoD+MpbTtG457kDuHBD/iFv7hn1LKnTFZuKC1nH+HHd3Emi2dOWonXitWrDQMevpNJpieRtSYo6yXhkwx6sp6NV3moIGxpYOaJJKCBU9TlzloyFlQYMsMVp4dNk5RUa8IS2Glslb/qi5Kf4FtV18c75fmd4EqITHGCYQRQttqDoBs+U2IUrh4Eh3UFHq4q5zmkJI/NLi39LXgg1JpeuyIUd83wm/JFiLzMloWh9wFY1cVQOOf0U1XmLRXuDvRLR4ZfG+HtN76dXjaXXGN2aSGJRc5jZPNOj/1TDQ1byzwTUezhAyIClkCcNhvnrpki+N
function _defineProperty$2(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self2 = this, args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self2, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(void 0);
});
};
}
function _typeof$1(obj) {
"@babel/helpers - typeof";
return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(obj2) {
return typeof obj2;
} : function(obj2) {
return obj2 && "function" == typeof Symbol && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
}, _typeof$1(obj);
}
var runtime = { exports: {} };
(function(module) {
var runtime2 = function(exports) {
var Op = Object.prototype;
var hasOwn2 = Op.hasOwnProperty;
var undefined$1;
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
define({}, "");
} catch (err) {
define = function define2(obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self2, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context(tryLocsList || []);
generator._invoke = makeInvokeMethod(innerFn, self2, context);
return generator;
}
exports.wrap = wrap;
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
var ContinueSentinel = {};
function Generator() {
}
function GeneratorFunction() {
}
function GeneratorFunctionPrototype() {
}
var IteratorPrototype = {};
define(IteratorPrototype, iteratorSymbol, function() {
return this;
});
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn2.call(NativeIteratorPrototype, iteratorSymbol)) {
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
define(Gp, "constructor", GeneratorFunctionPrototype);
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method4) {
define(prototype, method4, function(arg) {
return this._invoke(method4, arg);
});
});
}
exports.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
exports.awrap = function(arg) {
return {
__await: arg
};
};
function AsyncIterator(generator, PromiseImpl) {
function invoke(method4, arg, resolve, reject) {
var record = tryCatch(generator[method4], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && _typeof$1(value) === "object" && hasOwn2.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value2) {
invoke("next", value2, resolve, reject);
}, function(err) {
invoke("throw", err, resolve, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
result.value = unwrapped;
resolve(result);
}, function(error) {
return invoke("throw", error, resolve, reject);
});
}
}
var previousPromise;
function enqueue(method4, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve, reject) {
invoke(method4, arg, resolve, reject);
});
}
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
this._invoke = enqueue;
}
defineIteratorMethods(AsyncIterator.prototype);
define(AsyncIterator.prototype, asyncIteratorSymbol, function() {
return this;
});
exports.AsyncIterator = AsyncIterator;
exports.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0)
PromiseImpl = Promise;
var iter = new AsyncIterator(wrap(innerFn, outerFn, self2, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self2, context) {
var state = GenStateSuspendedStart;
return function invoke(method4, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method4 === "throw") {
throw arg;
}
return doneResult();
}
context.method = method4;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel)
continue;
return delegateResult;
}
}
if (context.method === "next") {
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self2, context);
if (record.type === "normal") {
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
context.method = "throw";
context.arg = record.arg;
}
}
};
}
function maybeInvokeDelegate(delegate, context) {
var method4 = delegate.iterator[context.method];
if (method4 === undefined$1) {
context.delegate = null;
if (context.method === "throw") {
if (delegate.iterator["return"]) {
context.method = "return";
context.arg = undefined$1;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
return ContinueSentinel;
}
}
context.method = "throw";
context.arg = new TypeError("The iterator does not provide a 'throw' method");
}
return ContinueSentinel;
}
var record = tryCatch(method4, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
context[delegate.resultName] = info.value;
context.next = delegate.nextLoc;
if (context.method !== "return") {
context.method = "next";
context.arg = undefined$1;
}
} else {
return info;
}
context.delegate = null;
return ContinueSentinel;
}
defineIteratorMethods(Gp);
define(Gp, toStringTagSymbol, "Generator");
define(Gp, iteratorSymbol, function() {
return this;
});
define(Gp, "toString", function() {
return "[object Generator]";
});
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (2 in locs) {
entry.finallyLoc = locs[2];
entry.afterLoc = locs[3];
}
this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal";
delete record.arg;
entry.completion = record;
}
function Context(tryLocsList) {
this.tryEntries = [{
tryLoc: "root"
}];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports.keys = function(object4) {
var keys = [];
for (var key in object4) {
keys.push(key);
}
keys.reverse();
return function next() {
while (keys.length) {
var key2 = keys.pop();
if (key2 in object4) {
next.value = key2;
next.done = false;
return next;
}
}
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i = -1, next = function next2() {
while (++i < iterable.length) {
if (hasOwn2.call(iterable, i)) {
next2.value = iterable[i];
next2.done = false;
return next2;
}
}
next2.value = undefined$1;
next2.done = true;
return next2;
};
return next.next = next;
}
}
return {
next: doneResult
};
}
exports.values = values;
function doneResult() {
return {
value: undefined$1,
done: true
};
}
Context.prototype = {
constructor: Context,
reset: function reset22(skipTempReset) {
this.prev = 0;
this.next = 0;
this.sent = this._sent = undefined$1;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined$1;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
if (name.charAt(0) === "t" && hasOwn2.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined$1;
}
}
}
},
stop: function stop() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function dispatchException(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
context.method = "next";
context.arg = undefined$1;
}
return !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
var record = entry.completion;
if (entry.tryLoc === "root") {
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn2.call(entry, "catchLoc");
var hasFinally = hasOwn2.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function abrupt(type4, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn2.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type4 === "break" || type4 === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type4;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function complete(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function finish(finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function _catch(tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function delegateYield(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName,
nextLoc
};
if (this.method === "next") {
this.arg = undefined$1;
}
return ContinueSentinel;
}
};
return exports;
}(module.exports);
try {
regeneratorRuntime = runtime2;
} catch (accidentalStrictMode) {
if ((typeof globalThis === "undefined" ? "undefined" : _typeof$1(globalThis)) === "object") {
globalThis.regeneratorRuntime = runtime2;
} else {
Function("r", "regeneratorRuntime = r")(runtime2);
}
}
})(runtime);
var regenerator = runtime.exports;
function ownKeys$7(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$7(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$7(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$7(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var __default__$6$2 = {
name: "Shade"
};
var _sfc_main$7$1 = defineComponent(_objectSpread$7(_objectSpread$7({}, __default__$6$2), {}, {
props: {
opacity: null,
index: null,
visible: {
type: [Boolean, String]
}
},
emits: ["shadeClick"],
setup: function setup(__props, _ref) {
var emit = _ref.emit;
var props = __props;
var styles = computed$1(function() {
return {
opacity: props.opacity,
zIndex: props.index
};
});
var shadeClick = function shadeClick2() {
emit("shadeClick");
};
return function(_ctx, _cache) {
return __props.visible ? (openBlock(), createElementBlock("div", {
key: 0,
class: "layui-layer-shade",
style: normalizeStyle(unref(styles)),
onClick: shadeClick
}, null, 4)) : createCommentVNode("", true);
};
}
}));
function ownKeys$6(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$6(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$6(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var _hoisted_1$5$1 = ["src"];
var __default__$5$2 = {
name: "Iframe"
};
var _sfc_main$6$1 = defineComponent(_objectSpread$6(_objectSpread$6({}, __default__$5$2), {}, {
props: {
src: null
},
setup: function setup2(__props) {
var props = __props;
var src = computed$1(function() {
return props.src;
});
return function(_ctx, _cache) {
return openBlock(), createElementBlock("iframe", {
scrolling: "auto",
class: "layui-layer-iframe",
allowtransparency: "true",
frameborder: "0",
src: unref(src)
}, null, 8, _hoisted_1$5$1);
};
}
}));
function ownKeys$5(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$5(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$5(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$5(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var _hoisted_1$4$1 = {
class: "layui-layer-title",
style: {
"cursor": "move"
}
};
var __default__$4$2 = {
name: "Title"
};
var _sfc_main$5$1 = defineComponent(_objectSpread$5(_objectSpread$5({}, __default__$4$2), {}, {
props: {
title: {
type: [String, Boolean, Function]
}
},
setup: function setup3(__props) {
var renderContent = function renderContent2(content) {
if (typeof content === "function") {
return content();
}
return content;
};
return function(_ctx, _cache) {
return openBlock(), createElementBlock("div", _hoisted_1$4$1, toDisplayString$1(renderContent(__props.title)), 1);
};
}
}));
function ownKeys$4(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$4(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$4(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$4(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var __default__$3$2 = {
name: "CloseBtn"
};
var _sfc_main$4$1 = defineComponent(_objectSpread$4(_objectSpread$4({}, __default__$3$2), {}, {
props: {
closeBtn: {
type: [Number, String, Boolean]
}
},
emits: ["closeHandle"],
setup: function setup4(__props, _ref) {
var emit = _ref.emit;
var closeHandle = function closeHandle2() {
emit("closeHandle");
};
return function(_ctx, _cache) {
return openBlock(), createElementBlock("a", {
class: normalizeClass(["layui-layer-ico layui-layer-close layui-layer-close" + __props.closeBtn]),
href: "javascript:;",
onClick: closeHandle
}, null, 2);
};
}
}));
var _export_sfc$1 = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
var _sfc_main$3$1 = {
name: "Resize"
};
var _hoisted_1$3$1 = {
class: "layui-layer-resize"
};
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("span", _hoisted_1$3$1);
}
var Resize = /* @__PURE__ */ _export_sfc$1(_sfc_main$3$1, [["render", _sfc_render$5]]);
function ownKeys$3(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$3(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$3(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$3(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var _hoisted_1$2$1 = {
class: "layui-layer-phimg"
};
var _hoisted_2$2$1 = ["src"];
var _hoisted_3$2$1 = {
key: 0,
class: "layui-layer-imgsee"
};
var _hoisted_4$1$1 = {
key: 0,
class: "layui-layer-imguide"
};
2022-12-30 08:14:41 +00:00
var _hoisted_5$1$1 = {
2022-11-15 01:16:55 +00:00
key: 0,
class: "thumb-row"
};
2022-12-30 08:14:41 +00:00
var _hoisted_6$1$1 = ["onClick"];
var _hoisted_7$1$1 = ["src"];
2022-11-15 01:16:55 +00:00
var _hoisted_8$d = {
key: 1,
class: "layui-layer-imgtit"
};
var _hoisted_9$a = {
key: 0
};
var _hoisted_10$a = {
key: 1
};
var __default__$2$2 = {
name: "Photos"
};
var _sfc_main$2$1 = defineComponent(_objectSpread$3(_objectSpread$3({}, __default__$2$2), {}, {
props: {
imgList: null,
startIndex: {
default: 0
}
},
emits: ["resetCalculationPohtosArea"],
setup: function setup5(__props, _ref) {
var emit = _ref.emit;
var props = __props;
var index2 = ref(props.startIndex);
watch(index2, function() {
emit("resetCalculationPohtosArea", index2.value);
});
var changeIndex = function changeIndex2(step) {
var nowIndex = index2.value;
var next = nowIndex + step;
if (next < 0) {
next = props.imgList.length - 1;
}
if (next >= props.imgList.length) {
next = 0;
}
index2.value = next;
};
var showLayerImgBar = ref(false);
onMounted(function() {
nextTick(function() {
showLayerImgBar.value = true;
});
});
var ifSetThumb = computed$1(function() {
var res = false;
props.imgList.forEach(function(e) {
if (e.thumb) {
res = true;
}
});
return res;
});
return function(_ctx, _cache) {
return openBlock(), createElementBlock("div", _hoisted_1$2$1, [createElementVNode("img", {
src: __props.imgList[index2.value].src
}, null, 8, _hoisted_2$2$1), __props.imgList.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_3$2$1, [__props.imgList.length > 1 ? (openBlock(), createElementBlock("span", _hoisted_4$1$1, [createElementVNode("a", {
href: "javascript:;",
class: "layui-layer-iconext layui-layer-imgprev",
onClick: _cache[0] || (_cache[0] = function($event) {
return changeIndex(-1);
})
}), createElementVNode("a", {
href: "javascript:;",
class: "layui-layer-iconext layui-layer-imgnext",
onClick: _cache[1] || (_cache[1] = function($event) {
return changeIndex(1);
})
})])) : createCommentVNode("", true), __props.imgList.length > 1 || __props.imgList[index2.value].alt ? (openBlock(), createElementBlock("div", {
key: 1,
class: "layui-layer-imgbar",
style: normalizeStyle({
opacity: showLayerImgBar.value ? 1 : 0
})
2022-12-30 08:14:41 +00:00
}, [unref(ifSetThumb) ? (openBlock(), createElementBlock("div", _hoisted_5$1$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.imgList, function(item, i) {
2022-11-15 01:16:55 +00:00
return openBlock(), createElementBlock("div", {
class: "thumb-box",
key: "thumb-box" + i,
onClick: function onClick($event) {
return index2.value = i;
}
}, [createElementVNode("img", {
src: item.thumb
2022-12-30 08:14:41 +00:00
}, null, 8, _hoisted_7$1$1)], 8, _hoisted_6$1$1);
2022-11-15 01:16:55 +00:00
}), 128)), createElementVNode("div", {
class: "thumb-box-border",
style: normalizeStyle({
left: "calc(calc( calc(100% - ".concat(100 * __props.imgList.length, "px) / 2) + ").concat(index2.value * 100, "px)")
})
}, null, 4)])) : (openBlock(), createElementBlock("span", _hoisted_8$d, [__props.imgList[index2.value].alt ? (openBlock(), createElementBlock("span", _hoisted_9$a, toDisplayString$1(__props.imgList[index2.value].alt), 1)) : createCommentVNode("", true), __props.imgList.length > 1 ? (openBlock(), createElementBlock("em", _hoisted_10$a, toDisplayString$1(index2.value + 1) + " / " + toDisplayString$1(__props.imgList.length), 1)) : createCommentVNode("", true)]))], 4)) : createCommentVNode("", true)])) : createCommentVNode("", true)]);
};
}
}));
function ownKeys$2(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$2(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$2(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var _hoisted_1$1$1 = {
class: "title"
};
var _hoisted_2$1$1 = {
key: 0,
class: "content"
};
var _hoisted_3$1$1 = ["innerHTML"];
var __default__$1$2 = {
name: "Notifiy"
};
var _sfc_main$1$1 = defineComponent(_objectSpread$2(_objectSpread$2({}, __default__$1$2), {}, {
props: {
title: null,
content: null,
isHtmlFragment: {
type: Boolean,
default: false
},
icon: null,
iconClass: null
},
emits: ["close"],
setup: function setup6(__props, _ref) {
var emit = _ref.emit;
var notifyRef = shallowRef(null);
var close2 = function close3() {
emit("close");
};
function addClass2(obj, cls) {
var obj_class = obj.className, blank = obj_class != "" ? " " : "";
var added = obj_class + blank + cls;
obj.className = added;
}
onMounted(function() {
nextTick(function() {
setTimeout(function() {
var _notifyRef$value, _notifyRef$value$pare, _notifyRef$value2, _notifyRef$value2$par;
if (!((_notifyRef$value = notifyRef.value) !== null && _notifyRef$value !== void 0 && (_notifyRef$value$pare = _notifyRef$value.parentElement) !== null && _notifyRef$value$pare !== void 0 && _notifyRef$value$pare.parentElement))
return;
addClass2((_notifyRef$value2 = notifyRef.value) === null || _notifyRef$value2 === void 0 ? void 0 : (_notifyRef$value2$par = _notifyRef$value2.parentElement) === null || _notifyRef$value2$par === void 0 ? void 0 : _notifyRef$value2$par.parentElement, "layui-layer-notifiy-transition");
}, 300);
});
});
return function(_ctx, _cache) {
return openBlock(), createElementBlock("div", {
class: "layui-layer-notifiy-wrapper",
ref_key: "notifyRef",
ref: notifyRef
}, [createElementVNode("h2", _hoisted_1$1$1, [__props.icon ? (openBlock(), createElementBlock("i", {
key: 0,
class: normalizeClass(__props.iconClass)
}, null, 2)) : createCommentVNode("", true), createTextVNode(" " + toDisplayString$1(__props.title), 1)]), !__props.isHtmlFragment ? (openBlock(), createElementBlock("div", _hoisted_2$1$1, [createElementVNode("p", null, toDisplayString$1(__props.content), 1)])) : (openBlock(), createElementBlock("div", {
key: 1,
class: "content",
innerHTML: __props.content
}, null, 8, _hoisted_3$1$1)), createVNode(_sfc_main$4$1, {
onClick: close2
})], 512);
};
}
}));
function _arrayLikeToArray$1(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) {
arr2[i] = arr[i];
}
return arr2;
}
function _arrayWithoutHoles$1(arr) {
if (Array.isArray(arr))
return _arrayLikeToArray$1(arr);
}
function _iterableToArray$1(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _unsupportedIterableToArray$1(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray$1(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray$1(o, minLen);
}
function _nonIterableSpread$1() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toConsumableArray$1(arr) {
return _arrayWithoutHoles$1(arr) || _iterableToArray$1(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread$1();
}
function nextId() {
var s = [];
var hexDigits = "0123456789abcdef";
for (var i = 0; i < 36; i++) {
s[i] = hexDigits.substr(Math.floor(Math.random() * 16), 1);
}
s[14] = "4";
s[19] = hexDigits.substr(s[19] & 3 | 8, 1);
s[8] = s[13] = s[18] = s[23] = "-";
var uuid = s.join("");
return uuid;
}
function calculateArea(type4, area, offset) {
return type4 != "drawer" ? calculateBaseArea(area) : calculateDrawerArea(offset, area);
}
function calculateBaseArea(area) {
if (area === "auto") {
return [];
}
if (typeof area == "string") {
return [area];
}
return _toConsumableArray$1(area);
}
function calculateDrawerArea(offset) {
var drawerArea = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "30%";
if (drawerArea instanceof Array) {
return drawerArea;
}
if (drawerArea === "auto") {
drawerArea = "30%";
}
if (offset === "l" || offset === "r") {
return [drawerArea, "100%"];
} else if (offset === "t" || offset === "b") {
return ["100%", drawerArea];
}
return [drawerArea, "100%"];
}
function calculateOffset(offset, area, type4) {
var arr = ["t", "r", "b", "l", "lt", "lb", "rt", "rb"];
var t = offset[0];
var l = offset[1];
if (offset instanceof Array && type4 === "drawer") {
offset = "r";
}
if (arr.indexOf(offset) > -1) {
t = "50%";
l = "50%";
}
if (arr.indexOf(offset) != -1 || t.indexOf("%") > -1)
t = "calc(" + t + " - (" + (area === "auto" ? "100px" : area[1]) + "/2 ))";
if (arr.indexOf(offset) != -1 || l.indexOf("%") > -1)
l = "calc(" + l + " - (" + (area === "auto" ? "100px" : area[0]) + "/2 ))";
if (offset === "t")
t = "0px";
else if (offset === "r")
l = "calc(100% - " + area[0] + ")";
else if (offset === "b")
t = "calc(100% - " + area[1] + ")";
else if (offset === "l")
l = "0px";
else if (offset === "lt") {
t = "0px";
l = "0px";
} else if (offset === "lb") {
t = "calc(100% - " + area[1] + ")";
l = "0px";
} else if (offset === "rt") {
t = "0px";
l = "calc(100% - " + area[0] + ")";
} else if (offset === "rb") {
t = "calc(100% - " + area[1] + ")";
l = "calc(100% - " + area[0] + ")";
}
return [t, l];
}
function calculateType(modalType) {
if (modalType === "dialog" || modalType == 0) {
return 0;
} else if (modalType === "page" || modalType == 1) {
return 1;
} else if (modalType === "iframe" || modalType == 2) {
return 2;
} else if (modalType === "loading" || modalType == 3) {
return 3;
} else if (modalType === "drawer" || modalType == 4) {
return 4;
} else if (modalType === "photos" || modalType == 5) {
return 5;
} else if (modalType === "notifiy" || modalType == 6) {
return 6;
}
return 0;
}
function calculateContent(title2, height, btn, type4, isMessage) {
if (height && height.indexOf("%") != -1) {
height = "100%";
}
if (btn && btn.length > 0) {
if (type4 == 0) {
if (title2) {
return "calc(" + height + " - 137px)";
} else {
return "calc(" + height + " - 86px)";
}
}
if (type4 == 1 || type4 == 4) {
if (title2) {
return "calc(" + height + " - 102px)";
} else {
return "calc(" + height + " - 51px)";
}
}
if (type4 == 2) {
if (title2) {
return "calc(" + height + " - 102px)";
} else {
return "calc(" + height + " - 51px)";
}
}
} else {
if (type4 == 0) {
if (title2) {
return isMessage ? "" : "calc(" + height + " - 137px)";
} else {
return isMessage ? "" : "calc(" + height + " - 86px)";
}
}
if (type4 == 1 || type4 == 4) {
if (title2) {
return "calc(" + height + " - 51px)";
} else {
return "calc(" + height + " - 0px)";
}
}
if (type4 == 2) {
if (title2) {
return "calc(" + height + " - 51px)";
} else {
return "calc(" + height + " - 0px)";
}
}
}
}
function maxArea() {
return {
w: "100%",
h: "100%"
};
}
function maxOffset() {
return {
t: "0px",
l: "0px"
};
}
function minArea() {
return {
w: "180px",
h: "51px"
};
}
function minOffset(left) {
return {
t: "calc(100% - 51px)",
l: left + "px"
};
}
function getArea(dom) {
var width = getComputedStyle(dom, null).width;
var height = getComputedStyle(dom, null).height;
return [width, height];
}
var minArrays = [];
function updateMinArrays(id, state) {
var i = 0;
if (state) {
var index2 = minArrays.findIndex(function(v) {
return v === void 0;
});
if (index2 === -1) {
minArrays.push(id);
i = minArrays.length - 1;
} else {
minArrays[index2] = id;
i = index2;
}
} else {
delete minArrays[minArrays.findIndex(function(v) {
return v == id;
})];
i = -1;
}
return i;
}
function getDrawerAnimationClass(offset) {
var isClose = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
var prefix = "layer-drawer-anim layer-anim";
var suffix = "rl";
if (offset === "l") {
suffix = "lr";
} else if (offset === "r") {
suffix = "rl";
} else if (offset === "t") {
suffix = "tb";
} else if (offset === "b") {
suffix = "bt";
}
return isClose ? "".concat(prefix, "-").concat(suffix, "-close") : "".concat(prefix, "-").concat(suffix);
}
function calculatePhotosArea(_x, _x2) {
return _calculatePhotosArea.apply(this, arguments);
}
function _calculatePhotosArea() {
_calculatePhotosArea = _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee(url2, options) {
var img, area;
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
area = function _area(img2) {
var imgarea = [img2.width, img2.height];
var winarea = [window.innerWidth - 250, window.innerHeight - 250];
if (imgarea[0] > winarea[0] || imgarea[1] > winarea[1]) {
var wh = [imgarea[0] / winarea[0], imgarea[1] / winarea[1]];
if (wh[0] > wh[1]) {
imgarea[0] = imgarea[0] / wh[0];
imgarea[1] = imgarea[1] / wh[0];
} else if (wh[0] < wh[1]) {
imgarea[0] = imgarea[0] / wh[1];
imgarea[1] = imgarea[1] / wh[1];
}
}
return [imgarea[0] + "px", imgarea[1] + "px"];
};
img = new Image();
img.src = url2;
return _context.abrupt("return", new Promise(function(resolve, reject) {
if (img.complete) {
resolve(area(img));
return;
}
var layerId = layer.load(2);
img.onload = function() {
layer.close(layerId);
resolve(area(img));
};
img.onerror = function() {
layer.close(layerId);
layer.msg("\u56FE\u7247\u52A0\u8F7D\u5931\u8D25");
reject(false);
};
}));
case 4:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _calculatePhotosArea.apply(this, arguments);
}
function calculateNotifOffset(offset, area, layerId) {
var arr = ["lt", "lb", "rt", "rb"];
var t = "0", l = "0";
var transOffsetLeft = 15;
var transOffsetTop = 15;
window.NotifiyQueen = window.NotifiyQueen || [];
var notifiyQueen = window.NotifiyQueen;
if (typeof offset != "string" || arr.indexOf(offset) === -1) {
offset = "rt";
}
var nodeList = notifiyQueen.filter(function(e) {
if (e.offset === offset) {
return e;
}
});
var prevNode = nodeList.length > 0 ? nodeList[nodeList.length - 1] : null;
if (prevNode) {
var _document$getElementB, _document$getElementB2;
prevNode = (_document$getElementB = document.getElementById(prevNode["id"])) === null || _document$getElementB === void 0 ? void 0 : (_document$getElementB2 = _document$getElementB.firstElementChild) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.firstElementChild;
if (offset === "rt" || offset === "lt") {
transOffsetTop += prevNode.offsetHeight + parseFloat(prevNode.style["top"]);
} else {
var bottom = parseFloat(prevNode.style["top"].split(" - ")[1]);
transOffsetTop += prevNode.offsetHeight + bottom;
}
} else {
if (offset === "rb" || offset === "lb") {
transOffsetTop += parseFloat(area[1]);
}
}
if (offset === "rt") {
t = transOffsetTop + "px";
l = "calc(100% - " + (parseFloat(area[0]) + transOffsetLeft) + "px)";
} else if (offset === "rb") {
t = "calc(100vh - " + transOffsetTop + "px)";
l = "calc(100% - " + (parseFloat(area[0]) + transOffsetLeft) + "px)";
} else if (offset === "lt") {
t = transOffsetTop + "px";
l = transOffsetLeft + "px";
} else if (offset === "lb") {
t = "calc(100vh - " + transOffsetTop + "px)";
l = transOffsetLeft + "px";
}
notifiyQueen.push({
id: layerId,
offset
});
return [t, l];
}
function removeNotifiyFromQueen(layerId) {
var _document$getElementB3, _document$getElementB4;
var transOffsetTop = 15;
var notifiyDom = (_document$getElementB3 = document.getElementById(layerId)) === null || _document$getElementB3 === void 0 ? void 0 : (_document$getElementB4 = _document$getElementB3.firstElementChild) === null || _document$getElementB4 === void 0 ? void 0 : _document$getElementB4.firstElementChild;
var offsetHeight = notifiyDom.offsetHeight;
window.NotifiyQueen = window.NotifiyQueen || [];
var notifiyQueen = window.NotifiyQueen;
var index2 = notifiyQueen.findIndex(function(e) {
return e.id === layerId;
});
var offsetType = notifiyQueen[index2].offset;
var list = notifiyQueen.filter(function(e) {
if (e.offset === offsetType) {
return e;
}
});
var findIndex = list.findIndex(function(e) {
return e.id === layerId;
});
var needCalculatelist = list.slice(findIndex + 1);
needCalculatelist.forEach(function(e) {
var _document$getElementB5, _document$getElementB6;
var dom = (_document$getElementB5 = document.getElementById(e.id)) === null || _document$getElementB5 === void 0 ? void 0 : (_document$getElementB6 = _document$getElementB5.firstElementChild) === null || _document$getElementB6 === void 0 ? void 0 : _document$getElementB6.firstElementChild;
if (offsetType === "rt" || offsetType === "lt") {
dom.style["top"] = parseFloat(dom.style["top"]) - transOffsetTop - offsetHeight + "px";
} else {
var bottom = parseFloat(dom.style["top"].split(" - ")[1]) - transOffsetTop - offsetHeight;
dom.style["top"] = "calc(100vh - " + bottom + "px)";
}
});
notifiyQueen.splice(index2, 1);
}
function getNotifyAnimationClass(offset) {
var prefix = "layer-drawer-anim layer-anim";
var suffix = "";
if (offset === "lt" || offset === "lb") {
suffix = "lr";
} else {
suffix = "rl";
}
return "".concat(prefix, "-").concat(suffix);
}
var useMove$1 = function useMove(el, callback) {
if (el != null) {
el.addEventListener("mousedown", function(event) {
var path = event.composedPath && event.composedPath() || event.path;
if (path[0].className === "layui-layer-resize") {
if (event.button == 0 && el != null) {
var x = el.offsetLeft;
var y = el.offsetTop;
var move2 = function move22(moveEvent) {
if (el != null) {
var offsetX = moveEvent.clientX;
var offsetY = moveEvent.clientY;
var w = offsetX - x;
var h2 = offsetY - y;
w < 260 && (w = 260);
h2 < 115 && (h2 = 115);
el.style.width = "".concat(w, "px");
el.style.height = "".concat(h2, "px");
callback(el.style.width, el.style.height);
}
return false;
};
document.addEventListener("mousemove", move2);
var stop = function stop2() {
document.removeEventListener("mousemove", move2);
document.removeEventListener("mouseup", stop2);
};
document.addEventListener("mouseup", stop);
}
}
return false;
});
}
};
var useMove2 = function useMove3(el, callback) {
el.style.position = "fixed";
var offsetX;
var offsetY;
if (el != null) {
el.addEventListener("mousedown", function(event) {
var path = event.composedPath && event.composedPath() || event.path;
if (path[0].className === "layui-layer-title") {
if (event.button == 0 && el != null) {
var lexObj = getComputedStyle(el);
offsetX = event.pageX - el.offsetLeft + parseInt(lexObj["margin-left"]);
offsetY = event.pageY - el.offsetTop + parseInt(lexObj["margin-right"]);
var move2 = function move22(event2) {
if (el != null) {
var x = event2.pageX - offsetX;
var y = event2.pageY - offsetY;
if (x < 0) {
x = 0;
} else if (x > document.documentElement.clientWidth - el.offsetWidth) {
x = document.documentElement.clientWidth - el.offsetWidth;
}
if (y < 0) {
y = 0;
} else if (y > document.documentElement.clientHeight - el.offsetHeight) {
y = document.documentElement.clientHeight - el.offsetHeight;
}
el.style.left = "".concat(x, "px");
el.style.top = "".concat(y, "px");
callback(el.style.left, el.style.top);
}
return false;
};
document.addEventListener("mousemove", move2);
var stop = function stop2() {
document.removeEventListener("mousemove", move2);
document.removeEventListener("mouseup", stop2);
};
document.addEventListener("mouseup", stop);
}
}
return false;
});
}
};
var zIndexKey = Symbol("zIndex");
function ownKeys$1$1(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread$1(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$1$1(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1$1(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
2022-12-30 08:14:41 +00:00
var _hoisted_1$19 = {
key: 0,
style: {
"scale": "0.5"
}
};
var _hoisted_2$S = /* @__PURE__ */ createElementVNode("div", {
class: "loading"
}, null, -1);
var _hoisted_3$L = /* @__PURE__ */ createElementVNode("svg", {
xmlns: "http://www.w3.org/2000/svg",
version: "1.1"
}, [/* @__PURE__ */ createElementVNode("defs", null, [/* @__PURE__ */ createElementVNode("filter", {
id: "goo"
}, [/* @__PURE__ */ createElementVNode("feGaussianBlur", {
in: "SourceGraphic",
stdDeviation: "6.3",
result: "blur"
}), /* @__PURE__ */ createTextVNode(), /* @__PURE__ */ createElementVNode("feColorMatrix", {
in: "blur",
mode: "matrix",
values: "1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 14 -4",
result: "goo"
}), /* @__PURE__ */ createTextVNode(), /* @__PURE__ */ createElementVNode("feBlend", {
in: "SourceGraphic",
in2: "goo"
})])])], -1);
var _hoisted_4$A = ["innerHTML"];
var _hoisted_5$r = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-layer-setwin"
};
2022-12-30 08:14:41 +00:00
var _hoisted_6$k = {
2022-11-15 01:16:55 +00:00
key: 0
};
2022-12-30 08:14:41 +00:00
var _hoisted_7$h = ["onClick"];
2022-11-15 01:16:55 +00:00
var __default__$2G = {
name: "LayLayer"
};
var _sfc_main$1I = defineComponent(_objectSpread$1(_objectSpread$1({}, __default__$2G), {}, {
props: {
id: null,
title: {
type: [String, Boolean, Function],
default: "\u6807\u9898"
},
icon: null,
skin: null,
zIndex: null,
setTop: {
type: Boolean,
default: false
},
offset: {
default: function _default() {
return ["50%", "50%"];
}
},
area: {
default: "auto"
},
modelValue: {
type: Boolean,
default: false
},
maxmin: {
type: [Boolean, String],
default: false
},
btn: {
type: [Array, Boolean]
},
move: {
type: [Boolean, String],
default: true
},
resize: {
type: [Boolean, String],
default: false
},
type: {
default: 1
},
content: null,
isHtmlFragment: {
type: Boolean,
default: false
},
shade: {
type: [Boolean, String],
default: true
},
shadeClose: {
type: [Boolean, String],
default: true
},
shadeOpacity: {
default: "0.1"
},
closeBtn: {
type: [Boolean, String],
default: "1"
},
btnAlign: {
default: "r"
},
time: {
default: 0
},
load: {
default: 0
},
anim: {
default: 0
},
isOutAnim: {
type: Boolean,
default: true
},
destroy: {
type: Function,
default: function _default2() {
}
},
success: {
type: Function,
default: function _default3() {
}
},
end: {
type: Function,
default: function _default4() {
}
},
yes: null,
yesText: {
default: "\u786E\u5B9A"
},
isFunction: {
type: Boolean,
default: false
},
isMessage: {
type: Boolean,
default: false
},
appContext: null,
startIndex: {
default: 0
},
imgList: {
default: function _default5() {
return [];
}
},
min: {
type: Function,
default: function _default6() {
}
},
full: {
type: Function,
default: function _default7() {
}
},
restore: {
type: Function,
default: function _default8() {
}
}
},
emits: ["close", "update:modelValue"],
setup: function setup7(__props, _ref) {
var _props$zIndex;
var expose = _ref.expose, emit = _ref.emit;
var props = __props;
var slots = useSlots();
var max = ref(false);
var min = ref(false);
var id = ref(props.id || nextId());
var layero = ref(null);
var type4 = calculateType(props.type);
var area = ref(calculateArea(props.type, props.area, props.offset));
var offset = ref(calculateOffset(props.offset, area.value, props.type));
var contentHeight = ref(calculateContent(props.title, area.value[1], props.btn, type4, props.isMessage));
var index2 = ref((_props$zIndex = props.zIndex) !== null && _props$zIndex !== void 0 ? _props$zIndex : inject(zIndexKey, 99999));
var visible = ref(false);
var first = ref(true);
var w = ref(area.value[0]);
var h2 = ref(area.value[1]);
var t = ref(offset.value[0]);
var l = ref(offset.value[1]);
var _w = ref(area.value[0]);
var _h = ref(area.value[0]);
var _t = ref(offset.value[0]);
var _l = ref(offset.value[1]);
var firstOpenDelayCalculation = function firstOpenDelayCalculation2() {
nextTick(/* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee() {
return regenerator.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
area.value = getArea(layero.value);
if (type4 == 4) {
area.value = calculateDrawerArea(props.offset, props.area);
}
if (!(type4 == 5)) {
_context.next = 6;
break;
}
_context.next = 5;
return calculatePhotosArea(props.imgList[props.startIndex].src, props);
case 5:
area.value = _context.sent;
case 6:
offset.value = calculateOffset(props.offset, area.value, props.type);
if (type4 == 6) {
offset.value = calculateNotifOffset(props.offset, area.value, id.value);
}
w.value = area.value[0];
h2.value = area.value[1];
_w.value = area.value[0];
_l.value = area.value[1];
t.value = offset.value[0];
l.value = offset.value[1];
_t.value = offset.value[0];
_l.value = offset.value[1];
supportMove();
case 17:
case "end":
return _context.stop();
}
}
}, _callee);
})));
};
var notFirstOpenLayerInit = function notFirstOpenLayerInit2() {
w.value = _w.value;
h2.value = _h.value;
t.value = _t.value;
l.value = _l.value;
supportMove();
};
var beforeCloseSaveData = function beforeCloseSaveData2() {
if (min.value)
minHandle();
if (max.value)
maxHandle();
_w.value = w.value;
_h.value = h2.value;
_t.value = t.value;
_l.value = l.value;
};
var maxHandle = function maxHandle2() {
if (max.value) {
w.value = _w.value;
h2.value = _h.value;
t.value = _t.value;
l.value = _l.value;
props.restore(props.id);
} else {
_t.value = t.value;
_l.value = l.value;
_w.value = w.value;
_h.value = h2.value;
w.value = maxArea().w;
h2.value = maxArea().h;
t.value = maxOffset().t;
l.value = maxOffset().l;
props.full(props.id);
}
max.value = !max.value;
};
var minHandle = function minHandle2() {
var left = 180 * updateMinArrays(id.value, !min.value);
if (left > document.documentElement.clientWidth - 180) {
left = document.documentElement.clientWidth - 180;
}
if (min.value) {
w.value = _w.value;
h2.value = _h.value;
t.value = _t.value;
l.value = _l.value;
props.restore(props.id);
} else {
_w.value = w.value;
_h.value = h2.value;
_t.value = t.value;
_l.value = l.value;
h2.value = minArea().h;
w.value = minArea().w;
t.value = minOffset(left).t;
l.value = minOffset(left).l;
props.min(props.id);
}
min.value = !min.value;
};
var reset22 = function reset3() {
if (!first.value) {
min.value = false;
max.value = false;
w.value = area.value[0];
h2.value = area.value[1];
t.value = offset.value[0];
l.value = offset.value[1];
_w.value = area.value[0];
_h.value = area.value[1];
_t.value = offset.value[0];
_l.value = offset.value[1];
}
if (!props.modelValue) {
emit("update:modelValue", true);
}
};
watch(function() {
return props.modelValue;
}, function() {
visible.value = props.modelValue;
if (visible.value) {
if (first.value) {
first.value = false;
firstOpenDelayCalculation();
} else {
notFirstOpenLayerInit();
}
} else {
beforeCloseSaveData();
}
}, {
deep: true,
immediate: true
});
watch(function() {
return visible.value;
}, function() {
if (visible.value) {
if (props.isFunction) {
firstOpenDelayCalculation();
}
props.success();
}
}, {
2022-12-30 08:14:41 +00:00
immediate: true,
flush: "post"
2022-11-15 01:16:55 +00:00
});
watch(function() {
return visible.value;
}, function() {
if (!visible.value) {
props.end();
}
});
watch(function() {
return h2.value;
}, function() {
contentHeight.value = calculateContent(props.title, h2.value, props.btn, type4, props.isMessage);
});
var boxClasses = computed$1(function() {
return [{
"layui-layer-dialog": type4 === 0,
"layui-layer-page": type4 === 1,
"layui-layer-iframe": type4 === 2,
"layui-layer-loading": type4 === 3,
"layui-layer-drawer": type4 === 4,
"layui-layer-photos": type4 === 5,
"layui-layer-notifiy": type4 === 6,
"layui-layer-msg": props.isMessage,
"layui-layer-hui": props.isMessage && !props.icon
}, props.skin];
});
var supportMove = function supportMove2() {
if (props.move && type4 != 4) {
nextTick(function() {
if (!layero.value)
return;
useMove2(layero.value, function(left, top) {
l.value = left;
t.value = top;
});
useMove$1(layero.value, function(width, height) {
h2.value = height;
w.value = width;
});
});
}
};
var styles = computed$1(function() {
var style = {
top: t.value,
left: l.value,
width: w.value,
height: h2.value,
zIndex: index2.value
};
return style;
});
var contentClasses = computed$1(function() {
return [type4 === 3 ? "layui-layer-loading".concat(props.load) : "", props.icon ? "layui-layer-padding" : ""];
});
var closeHandle = function closeHandle2() {
emit("close");
emit("update:modelValue", false);
props.destroy();
if (type4 === 6) {
removeNotifiyFromQueen(props.id);
}
};
var yesHandle = function yesHandle2() {
if (props.yes != void 0)
props.yes();
else
closeHandle();
};
var shadeHandle = function shadeHandle2() {
if (props.shadeClose)
closeHandle();
};
var renderContent = function renderContent2(content) {
if (content instanceof Function) {
return content();
}
return content;
};
var iconClass = computed$1(function() {
return ["layui-layer-ico", "layui-layer-ico".concat(props.icon)];
});
var enterActiveClass = computed$1(function() {
if (type4 === 4) {
return getDrawerAnimationClass(props.offset);
}
if (type4 === 6) {
return getNotifyAnimationClass(props.offset);
}
return "layer-anim layer-anim-0".concat(props.anim);
});
var leaveActiveClass = computed$1(function() {
if (type4 === 4) {
return getDrawerAnimationClass(props.offset, true);
}
return props.isOutAnim ? "layer-anim-close" : "";
});
var open2 = function open3() {
visible.value = true;
};
var close2 = function close3() {
visible.value = false;
};
var shadeVisible = computed$1(function() {
return visible.value && props.shade && !min.value;
});
var showResize = computed$1(function() {
return props.resize && !max.value && !min.value;
});
var showTitle = computed$1(function() {
return props.title && props.type != 3 && props.type != 5 && props.type != 6;
});
var resetCalculationPohtosArea = function resetCalculationPohtosArea2(index22) {
nextTick(/* @__PURE__ */ _asyncToGenerator(/* @__PURE__ */ regenerator.mark(function _callee2() {
return regenerator.wrap(function _callee2$(_context2) {
while (1) {
switch (_context2.prev = _context2.next) {
case 0:
_context2.next = 2;
return calculatePhotosArea(props.imgList[index22].src, props);
case 2:
area.value = _context2.sent;
offset.value = calculateOffset(props.offset, area.value, props.type);
w.value = area.value[0];
h2.value = area.value[1];
t.value = offset.value[0];
l.value = offset.value[1];
_w.value = area.value[0];
_l.value = area.value[1];
_t.value = offset.value[0];
_l.value = offset.value[1];
case 12:
case "end":
return _context2.stop();
}
}
}, _callee2);
})));
};
expose({
reset: reset22,
open: open2,
close: close2
});
return function(_ctx, _cache) {
return openBlock(), createElementBlock("div", null, [createVNode(_sfc_main$7$1, {
index: index2.value,
visible: unref(shadeVisible),
opacity: __props.shadeOpacity,
onShadeClick: shadeHandle
}, null, 8, ["index", "visible", "opacity"]), createVNode(Transition, {
"enter-active-class": unref(enterActiveClass),
"leave-active-class": unref(leaveActiveClass)
}, {
default: withCtx(function() {
return [visible.value ? (openBlock(), createElementBlock("div", {
key: 0,
ref_key: "layero",
ref: layero,
class: normalizeClass(["layui-layer layui-layer-border", unref(boxClasses)]),
style: normalizeStyle(unref(styles))
}, [unref(showTitle) ? (openBlock(), createBlock(_sfc_main$5$1, {
key: 0,
title: __props.title
}, null, 8, ["title"])) : createCommentVNode("", true), createElementVNode("div", {
class: normalizeClass(["layui-layer-content", unref(contentClasses)]),
style: normalizeStyle({
height: contentHeight.value
})
2022-12-30 08:14:41 +00:00
}, [unref(type4) === 3 ? (openBlock(), createElementBlock("div", _hoisted_1$19, [_hoisted_2$S, createTextVNode(), _hoisted_3$L])) : createCommentVNode("", true), unref(type4) === 0 || unref(type4) === 1 || unref(type4) === 4 ? (openBlock(), createElementBlock(Fragment, {
key: 1
2022-11-15 01:16:55 +00:00
}, [__props.icon ? (openBlock(), createElementBlock("i", {
key: 0,
class: normalizeClass(unref(iconClass))
}, null, 2)) : createCommentVNode("", true), unref(slots).default ? renderSlot(_ctx.$slots, "default", {
key: 1
}) : (openBlock(), createElementBlock(Fragment, {
key: 2
}, [__props.isHtmlFragment ? (openBlock(), createElementBlock("span", {
key: 0,
innerHTML: renderContent(props.content)
2022-12-30 08:14:41 +00:00
}, null, 8, _hoisted_4$A)) : (openBlock(), createElementBlock(Fragment, {
2022-11-15 01:16:55 +00:00
key: 1
}, [createTextVNode(toDisplayString$1(renderContent(props.content)), 1)], 64))], 64))], 64)) : createCommentVNode("", true), unref(type4) === 2 ? (openBlock(), createBlock(_sfc_main$6$1, {
2022-12-30 08:14:41 +00:00
key: 2,
2022-11-15 01:16:55 +00:00
src: props.content
}, null, 8, ["src"])) : createCommentVNode("", true), unref(type4) === 5 ? (openBlock(), createBlock(_sfc_main$2$1, {
2022-12-30 08:14:41 +00:00
key: 3,
2022-11-15 01:16:55 +00:00
imgList: props.imgList,
startIndex: props.startIndex,
onResetCalculationPohtosArea: resetCalculationPohtosArea
}, null, 8, ["imgList", "startIndex"])) : createCommentVNode("", true), unref(type4) === 6 ? (openBlock(), createBlock(_sfc_main$1$1, {
2022-12-30 08:14:41 +00:00
key: 4,
2022-11-15 01:16:55 +00:00
onClose: closeHandle,
title: props.title,
content: props.content,
isHtmlFragment: props.isHtmlFragment,
icon: props.icon,
iconClass: unref(iconClass)
2022-12-30 08:14:41 +00:00
}, null, 8, ["title", "content", "isHtmlFragment", "icon", "iconClass"])) : createCommentVNode("", true)], 6), unref(type4) != 3 && unref(type4) != 5 && unref(type4) != 6 ? (openBlock(), createElementBlock("span", _hoisted_5$r, [__props.maxmin && !max.value ? (openBlock(), createElementBlock("a", {
2022-11-15 01:16:55 +00:00
key: 0,
class: normalizeClass(["layui-layer-min", [min.value ? "layui-layer-ico layui-layer-maxmin" : ""]]),
href: "javascript:;",
onClick: minHandle
2022-12-30 08:14:41 +00:00
}, [!min.value ? (openBlock(), createElementBlock("cite", _hoisted_6$k)) : createCommentVNode("", true)], 2)) : createCommentVNode("", true), __props.maxmin && !min.value ? (openBlock(), createElementBlock("a", {
2022-11-15 01:16:55 +00:00
key: 1,
class: normalizeClass(["layui-layer-ico layui-layer-max", [max.value ? "layui-layer-maxmin" : ""]]),
href: "javascript:;",
onClick: maxHandle
}, null, 2)) : createCommentVNode("", true), __props.closeBtn != false ? (openBlock(), createBlock(_sfc_main$4$1, {
key: 2,
"close-btn": __props.closeBtn,
onCloseHandle: closeHandle
}, null, 8, ["close-btn"])) : createCommentVNode("", true)])) : createCommentVNode("", true), (__props.btn && __props.btn.length > 0 || unref(type4) === 0) && !__props.isMessage ? (openBlock(), createElementBlock("div", {
key: 2,
class: normalizeClass(["layui-layer-btn", ["layui-layer-btn-".concat(__props.btnAlign)]])
}, [__props.btn && __props.btn.length > 0 ? (openBlock(true), createElementBlock(Fragment, {
key: 0
}, renderList(__props.btn, function(b, index22) {
return openBlock(), createElementBlock("a", {
key: index22,
class: normalizeClass(["layui-layer-btn".concat(index22)]),
onClick: function onClick($event) {
return b.callback(id.value);
}
2022-12-30 08:14:41 +00:00
}, toDisplayString$1(b.text), 11, _hoisted_7$h);
2022-11-15 01:16:55 +00:00
}), 128)) : (openBlock(), createElementBlock(Fragment, {
key: 1
}, [unref(type4) === 0 ? (openBlock(), createElementBlock("a", {
key: 0,
class: "layui-layer-btn0",
onClick: _cache[0] || (_cache[0] = function($event) {
return yesHandle();
})
}, toDisplayString$1(__props.yesText), 1)) : createCommentVNode("", true)], 64))], 2)) : createCommentVNode("", true), unref(showResize) ? (openBlock(), createBlock(Resize, {
key: 3
})) : createCommentVNode("", true)], 6)) : createCommentVNode("", true)];
}),
_: 3
}, 8, ["enter-active-class", "leave-active-class"])]);
};
}
}));
function ownKeys$8(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$8(Object(source), true).forEach(function(key) {
_defineProperty$2(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$8(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
var layerInstance = [];
var addInstance = function addInstance2(instance) {
layerInstance.push(instance);
};
var delInstance = function delInstance2(id) {
layerInstance.forEach(function(item, index2) {
if (item.modalContainer.id === id) {
layerInstance.splice(index2, 1);
}
});
};
var cleanInstance = function cleanInstance2() {
layerInstance.splice(0, layerInstance.length);
};
var isExist = function isExist2(id) {
var b = false;
layerInstance.forEach(function(item, index2) {
if (item.modalContainer.id == id) {
b = true;
}
});
return b;
};
var findById = function findById2(id) {
var instance = null;
layerInstance.forEach(function(item, index2) {
if (item.modalContainer.id === id) {
instance = item;
}
});
return instance;
};
var mergeOption = function mergeOption2(option, defaultOption) {
if (option)
defaultOption = Object.assign(defaultOption, option);
return defaultOption;
};
var createContainer = function createContainer2(options) {
var modalContainer = document.createElement("div");
modalContainer.id = options.id;
document.body.appendChild(modalContainer);
return modalContainer;
};
var modalChildrenVNode = function modalChildrenVNode2(content) {
if (typeof content === "function") {
return isVNode(content()) ? {
default: function _default9() {
return content();
}
} : void 0;
}
return isVNode(content) ? {
default: function _default9() {
return content;
}
} : void 0;
};
var layer = {
_context: null,
open: function open(option, callback) {
var defaultOption = {};
return layer.create(option, defaultOption, callback);
},
drawer: function drawer(option, callback) {
var defaultOption = {
type: "drawer"
};
return layer.create(option, defaultOption, callback);
},
msg: function msg(message, option, callback) {
var defaultOption = {
type: 0,
title: false,
content: message,
closeBtn: false,
shadeClose: false,
isMessage: true,
shade: false,
time: 1e3,
btn: false
};
return layer.create(option, defaultOption, callback);
},
load: function load(_load, option, callback) {
var defaultOption = {
type: 3,
load: _load,
anim: 5,
isOutAnim: false,
shadeClose: false
};
return layer.create(option, defaultOption, callback);
},
confirm: function confirm(msg2, option, callback) {
var defaultOption = {
type: 0,
content: msg2,
shadeClose: false
};
return layer.create(option, defaultOption, callback);
},
photos: function photos(option, callback) {
if (typeof option === "string") {
option = {
imgList: [{
src: option
}]
};
}
var defaultOption = {
type: 5,
anim: 2,
startIndex: 0,
isOutAnim: true,
shadeClose: true,
shadeOpacity: "0.7"
};
return layer.create(option, defaultOption, callback);
},
notifiy: function notifiy() {
var option = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var callback = arguments.length > 1 ? arguments[1] : void 0;
option.type = 6;
var defaultOption = {
offset: "rt",
time: 2e3,
area: "auto",
shade: false
};
return layer.create(option, defaultOption, callback);
},
create: function create(option, defaultOption, callback) {
var _modalInstance$compon3, _modalInstance$compon4;
var timer;
var options = mergeOption(option, defaultOption);
if (options.hasOwnProperty("id")) {
layer.close(options.id);
} else {
options.id = nextId();
}
var modalContainer = createContainer(options);
var modalInstance = h(_sfc_main$1I, _objectSpread(_objectSpread({}, options), {}, {
isFunction: true,
destroy: function destroy2() {
var _modalInstance$compon, _modalInstance$compon2;
clearTimeout(timer);
(_modalInstance$compon = modalInstance.component) === null || _modalInstance$compon === void 0 ? void 0 : (_modalInstance$compon2 = _modalInstance$compon.exposed) === null || _modalInstance$compon2 === void 0 ? void 0 : _modalInstance$compon2.close();
setTimeout(function() {
render$1(null, modalContainer);
if (document.body.contains(modalContainer)) {
document.body.removeChild(modalContainer);
}
}, 2e3);
delInstance(modalContainer.id);
}
}), modalChildrenVNode(options.content));
modalInstance.appContext = options.appContext || layer._context;
render$1(modalInstance, modalContainer);
(_modalInstance$compon3 = modalInstance.component) === null || _modalInstance$compon3 === void 0 ? void 0 : (_modalInstance$compon4 = _modalInstance$compon3.exposed) === null || _modalInstance$compon4 === void 0 ? void 0 : _modalInstance$compon4.open();
if (defaultOption && defaultOption.time != void 0 && defaultOption.time != 0) {
timer = setTimeout(function() {
var _modalInstance$compon5, _modalInstance$compon6;
(_modalInstance$compon5 = modalInstance.component) === null || _modalInstance$compon5 === void 0 ? void 0 : (_modalInstance$compon6 = _modalInstance$compon5.exposed) === null || _modalInstance$compon6 === void 0 ? void 0 : _modalInstance$compon6.close();
if (callback)
callback(modalContainer.id);
setTimeout(function() {
render$1(null, modalContainer);
if (document.body.contains(modalContainer)) {
document.body.removeChild(modalContainer);
}
}, 2e3);
delInstance(modalContainer.id);
if (options.type === 6) {
removeNotifiyFromQueen(options.id);
}
}, defaultOption.time);
}
addInstance({
modalContainer,
modalInstance
});
return modalContainer.id;
},
close: function close(id) {
if (id != null && isExist(id)) {
var _instance$modalInstan, _instance$modalInstan2;
var instance = findById(id);
(_instance$modalInstan = instance.modalInstance.component) === null || _instance$modalInstan === void 0 ? void 0 : (_instance$modalInstan2 = _instance$modalInstan.exposed) === null || _instance$modalInstan2 === void 0 ? void 0 : _instance$modalInstan2.close();
setTimeout(function() {
render$1(null, instance.modalContainer);
if (document.body.contains(instance.modalContainer))
document.body.removeChild(instance.modalContainer);
}, 2e3);
}
delInstance(id);
},
closeAll: function closeAll() {
layerInstance.forEach(function(item) {
var _item$modalInstance$c, _item$modalInstance$c2;
(_item$modalInstance$c = item.modalInstance.component) === null || _item$modalInstance$c === void 0 ? void 0 : (_item$modalInstance$c2 = _item$modalInstance$c.exposed) === null || _item$modalInstance$c2 === void 0 ? void 0 : _item$modalInstance$c2.close();
setTimeout(function() {
render$1(null, item.modalContainer);
if (document.body.contains(item.modalContainer))
document.body.removeChild(item.modalContainer);
}, 2e3);
});
cleanInstance();
},
reset: function reset(instance) {
var _instance$modalInstan3, _instance$modalInstan4;
(_instance$modalInstan3 = instance.modalInstance.component) === null || _instance$modalInstan3 === void 0 ? void 0 : (_instance$modalInstan4 = _instance$modalInstan3.exposed) === null || _instance$modalInstan4 === void 0 ? void 0 : _instance$modalInstan4.reset();
}
};
var install$1 = function install2(app, options) {
layer._context = app._context;
app.component(_sfc_main$1I.name, _sfc_main$1I);
app.config.globalProperties.$layer = layer;
if (options) {
app.provide(zIndexKey, options.zIndex);
}
};
var index$10 = {
install: install$1
};
/*!
* @intlify/shared v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
const hasSymbol = typeof Symbol === "function" && typeof Symbol.toStringTag === "symbol";
const makeSymbol = (name) => hasSymbol ? Symbol(name) : name;
const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source });
const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027");
const isNumber$2 = (val) => typeof val === "number" && isFinite(val);
const isDate = (val) => toTypeString(val) === "[object Date]";
const isRegExp = (val) => toTypeString(val) === "[object RegExp]";
const isEmptyObject = (val) => isPlainObject$1(val) && Object.keys(val).length === 0;
function warn(msg2, err) {
if (typeof console !== "undefined") {
console.warn(`[intlify] ` + msg2);
if (err) {
console.warn(err.stack);
}
}
}
const assign$1 = Object.assign;
let _globalThis;
const getGlobalThis = () => {
return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {});
};
function escapeHtml(rawText) {
return rawText.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;");
}
const hasOwnProperty$2 = Object.prototype.hasOwnProperty;
function hasOwn$1(obj, key) {
return hasOwnProperty$2.call(obj, key);
}
const isArray$1 = Array.isArray;
const isFunction$3 = (val) => typeof val === "function";
const isString$1 = (val) => typeof val === "string";
const isBoolean = (val) => typeof val === "boolean";
2022-12-30 08:13:19 +00:00
const isObject$4 = (val) => val !== null && typeof val === "object";
2022-11-15 01:16:55 +00:00
const objectToString = Object.prototype.toString;
const toTypeString = (value) => objectToString.call(value);
const isPlainObject$1 = (val) => toTypeString(val) === "[object Object]";
const toDisplayString = (val) => {
return val == null ? "" : isArray$1(val) || isPlainObject$1(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val);
};
/*!
* @intlify/message-resolver v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
const hasOwnProperty$1 = Object.prototype.hasOwnProperty;
function hasOwn(obj, key) {
return hasOwnProperty$1.call(obj, key);
}
2022-12-30 08:13:19 +00:00
const isObject$3 = (val) => val !== null && typeof val === "object";
2022-11-15 01:16:55 +00:00
const pathStateMachine = [];
pathStateMachine[0] = {
["w"]: [0],
["i"]: [3, 0],
["["]: [4],
["o"]: [7]
};
pathStateMachine[1] = {
["w"]: [1],
["."]: [2],
["["]: [4],
["o"]: [7]
};
pathStateMachine[2] = {
["w"]: [2],
["i"]: [3, 0],
["0"]: [3, 0]
};
pathStateMachine[3] = {
["i"]: [3, 0],
["0"]: [3, 0],
["w"]: [1, 1],
["."]: [2, 1],
["["]: [4, 1],
["o"]: [7, 1]
};
pathStateMachine[4] = {
["'"]: [5, 0],
['"']: [6, 0],
["["]: [
4,
2
],
["]"]: [1, 3],
["o"]: 8,
["l"]: [4, 0]
};
pathStateMachine[5] = {
["'"]: [4, 0],
["o"]: 8,
["l"]: [5, 0]
};
pathStateMachine[6] = {
['"']: [4, 0],
["o"]: 8,
["l"]: [6, 0]
};
const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;
function isLiteral(exp) {
return literalValueRE.test(exp);
}
function stripQuotes(str) {
const a = str.charCodeAt(0);
const b = str.charCodeAt(str.length - 1);
return a === b && (a === 34 || a === 39) ? str.slice(1, -1) : str;
}
function getPathCharType(ch) {
if (ch === void 0 || ch === null) {
return "o";
}
const code = ch.charCodeAt(0);
switch (code) {
case 91:
case 93:
case 46:
case 34:
case 39:
return ch;
case 95:
case 36:
case 45:
return "i";
case 9:
case 10:
case 13:
case 160:
case 65279:
case 8232:
case 8233:
return "w";
}
return "i";
}
function formatSubPath(path) {
const trimmed = path.trim();
if (path.charAt(0) === "0" && isNaN(parseInt(path))) {
return false;
}
return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed;
}
function parse(path) {
const keys = [];
let index2 = -1;
let mode = 0;
let subPathDepth = 0;
let c;
let key;
let newChar;
let type4;
let transition;
let action;
let typeMap;
const actions = [];
actions[0] = () => {
if (key === void 0) {
key = newChar;
} else {
key += newChar;
}
};
actions[1] = () => {
if (key !== void 0) {
keys.push(key);
key = void 0;
}
};
actions[2] = () => {
actions[0]();
subPathDepth++;
};
actions[3] = () => {
if (subPathDepth > 0) {
subPathDepth--;
mode = 4;
actions[0]();
} else {
subPathDepth = 0;
if (key === void 0) {
return false;
}
key = formatSubPath(key);
if (key === false) {
return false;
} else {
actions[1]();
}
}
};
function maybeUnescapeQuote() {
const nextChar = path[index2 + 1];
if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') {
index2++;
newChar = "\\" + nextChar;
actions[0]();
return true;
}
}
while (mode !== null) {
index2++;
c = path[index2];
if (c === "\\" && maybeUnescapeQuote()) {
continue;
}
type4 = getPathCharType(c);
typeMap = pathStateMachine[mode];
transition = typeMap[type4] || typeMap["l"] || 8;
if (transition === 8) {
return;
}
mode = transition[0];
if (transition[1] !== void 0) {
action = actions[transition[1]];
if (action) {
newChar = c;
if (action() === false) {
return;
}
}
}
if (mode === 7) {
return keys;
}
}
}
const cache = /* @__PURE__ */ new Map();
function resolveValue(obj, path) {
2022-12-30 08:13:19 +00:00
if (!isObject$3(obj)) {
2022-11-15 01:16:55 +00:00
return null;
}
let hit = cache.get(path);
if (!hit) {
hit = parse(path);
if (hit) {
cache.set(path, hit);
}
}
if (!hit) {
return null;
}
const len = hit.length;
let last = obj;
let i = 0;
while (i < len) {
const val = last[hit[i]];
if (val === void 0) {
return null;
}
last = val;
i++;
}
return last;
}
function handleFlatJson(obj) {
2022-12-30 08:13:19 +00:00
if (!isObject$3(obj)) {
2022-11-15 01:16:55 +00:00
return obj;
}
for (const key in obj) {
if (!hasOwn(obj, key)) {
continue;
}
if (!key.includes(".")) {
2022-12-30 08:13:19 +00:00
if (isObject$3(obj[key])) {
2022-11-15 01:16:55 +00:00
handleFlatJson(obj[key]);
}
} else {
const subKeys = key.split(".");
const lastIndex = subKeys.length - 1;
let currentObj = obj;
for (let i = 0; i < lastIndex; i++) {
if (!(subKeys[i] in currentObj)) {
currentObj[subKeys[i]] = {};
}
currentObj = currentObj[subKeys[i]];
}
currentObj[subKeys[lastIndex]] = obj[key];
delete obj[key];
2022-12-30 08:13:19 +00:00
if (isObject$3(currentObj[subKeys[lastIndex]])) {
2022-11-15 01:16:55 +00:00
handleFlatJson(currentObj[subKeys[lastIndex]]);
}
}
}
return obj;
}
/*!
* @intlify/runtime v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
const DEFAULT_MODIFIER = (str) => str;
const DEFAULT_MESSAGE = (ctx) => "";
const DEFAULT_MESSAGE_DATA_TYPE = "text";
const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : values.join("");
const DEFAULT_INTERPOLATE = toDisplayString;
function pluralDefault(choice, choicesLength) {
choice = Math.abs(choice);
if (choicesLength === 2) {
return choice ? choice > 1 ? 1 : 0 : 1;
}
return choice ? Math.min(choice, 2) : 0;
}
function getPluralIndex(options) {
const index2 = isNumber$2(options.pluralIndex) ? options.pluralIndex : -1;
return options.named && (isNumber$2(options.named.count) || isNumber$2(options.named.n)) ? isNumber$2(options.named.count) ? options.named.count : isNumber$2(options.named.n) ? options.named.n : index2 : index2;
}
function normalizeNamed(pluralIndex, props) {
if (!props.count) {
props.count = pluralIndex;
}
if (!props.n) {
props.n = pluralIndex;
}
}
function createMessageContext(options = {}) {
const locale = options.locale;
const pluralIndex = getPluralIndex(options);
2022-12-30 08:13:19 +00:00
const pluralRule = isObject$4(options.pluralRules) && isString$1(locale) && isFunction$3(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault;
const orgPluralRule = isObject$4(options.pluralRules) && isString$1(locale) && isFunction$3(options.pluralRules[locale]) ? pluralDefault : void 0;
2022-11-15 01:16:55 +00:00
const plural = (messages2) => messages2[pluralRule(pluralIndex, messages2.length, orgPluralRule)];
const _list = options.list || [];
const list = (index2) => _list[index2];
const _named = options.named || {};
isNumber$2(options.pluralIndex) && normalizeNamed(pluralIndex, _named);
const named = (key) => _named[key];
function message(key) {
2022-12-30 08:13:19 +00:00
const msg2 = isFunction$3(options.messages) ? options.messages(key) : isObject$4(options.messages) ? options.messages[key] : false;
2022-11-15 01:16:55 +00:00
return !msg2 ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg2;
}
const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER;
const normalize = isPlainObject$1(options.processor) && isFunction$3(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE;
const interpolate = isPlainObject$1(options.processor) && isFunction$3(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE;
const type4 = isPlainObject$1(options.processor) && isString$1(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE;
const ctx = {
["list"]: list,
["named"]: named,
["plural"]: plural,
["linked"]: (key, modifier) => {
const msg2 = message(key)(ctx);
return isString$1(modifier) ? _modifier(modifier)(msg2) : msg2;
},
["message"]: message,
["type"]: type4,
["interpolate"]: interpolate,
["normalize"]: normalize
};
return ctx;
}
/*!
* @intlify/message-compiler v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
function createCompileError(code, loc, options = {}) {
const { domain, messages: messages2, args } = options;
const msg2 = code;
const error = new SyntaxError(String(msg2));
error.code = code;
if (loc) {
error.location = loc;
}
error.domain = domain;
return error;
}
function defaultOnError(error) {
throw error;
}
function createPosition(line, column, offset) {
return { line, column, offset };
}
function createLocation(start, end, source) {
const loc = { start, end };
if (source != null) {
loc.source = source;
}
return loc;
}
const CHAR_SP = " ";
const CHAR_CR = "\r";
const CHAR_LF = "\n";
const CHAR_LS = String.fromCharCode(8232);
const CHAR_PS = String.fromCharCode(8233);
function createScanner(str) {
const _buf = str;
let _index = 0;
let _line = 1;
let _column = 1;
let _peekOffset = 0;
const isCRLF = (index3) => _buf[index3] === CHAR_CR && _buf[index3 + 1] === CHAR_LF;
const isLF = (index3) => _buf[index3] === CHAR_LF;
const isPS = (index3) => _buf[index3] === CHAR_PS;
const isLS = (index3) => _buf[index3] === CHAR_LS;
const isLineEnd = (index3) => isCRLF(index3) || isLF(index3) || isPS(index3) || isLS(index3);
const index2 = () => _index;
const line = () => _line;
const column = () => _column;
const peekOffset = () => _peekOffset;
const charAt = (offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset];
const currentChar = () => charAt(_index);
const currentPeek = () => charAt(_index + _peekOffset);
function next() {
_peekOffset = 0;
if (isLineEnd(_index)) {
_line++;
_column = 0;
}
if (isCRLF(_index)) {
_index++;
}
_index++;
_column++;
return _buf[_index];
}
function peek() {
if (isCRLF(_index + _peekOffset)) {
_peekOffset++;
}
_peekOffset++;
return _buf[_index + _peekOffset];
}
function reset3() {
_index = 0;
_line = 1;
_column = 1;
_peekOffset = 0;
}
function resetPeek(offset = 0) {
_peekOffset = offset;
}
function skipToPeek() {
const target = _index + _peekOffset;
while (target !== _index) {
next();
}
_peekOffset = 0;
}
return {
index: index2,
line,
column,
peekOffset,
charAt,
currentChar,
currentPeek,
next,
peek,
reset: reset3,
resetPeek,
skipToPeek
};
}
const EOF = void 0;
const LITERAL_DELIMITER = "'";
const ERROR_DOMAIN$1 = "tokenizer";
function createTokenizer(source, options = {}) {
const location2 = options.location !== false;
const _scnr = createScanner(source);
const currentOffset = () => _scnr.index();
const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index());
const _initLoc = currentPosition();
const _initOffset = currentOffset();
const _context = {
currentType: 14,
offset: _initOffset,
startLoc: _initLoc,
endLoc: _initLoc,
lastType: 14,
lastOffset: _initOffset,
lastStartLoc: _initLoc,
lastEndLoc: _initLoc,
braceNest: 0,
inLinked: false,
text: ""
};
const context = () => _context;
const { onError } = options;
function emitError(code, pos, offset, ...args) {
const ctx = context();
pos.column += offset;
pos.offset += offset;
if (onError) {
const loc = createLocation(ctx.startLoc, pos);
const err = createCompileError(code, loc, {
domain: ERROR_DOMAIN$1,
args
});
onError(err);
}
}
function getToken(context2, type4, value) {
context2.endLoc = currentPosition();
context2.currentType = type4;
const token = { type: type4 };
if (location2) {
token.loc = createLocation(context2.startLoc, context2.endLoc);
}
if (value != null) {
token.value = value;
}
return token;
}
const getEndToken = (context2) => getToken(context2, 14);
function eat(scnr, ch) {
if (scnr.currentChar() === ch) {
scnr.next();
return ch;
} else {
emitError(0, currentPosition(), 0, ch);
return "";
}
}
function peekSpaces(scnr) {
let buf = "";
while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) {
buf += scnr.currentPeek();
scnr.peek();
}
return buf;
}
function skipSpaces(scnr) {
const buf = peekSpaces(scnr);
scnr.skipToPeek();
return buf;
}
function isIdentifierStart(ch) {
if (ch === EOF) {
return false;
}
const cc = ch.charCodeAt(0);
return cc >= 97 && cc <= 122 || cc >= 65 && cc <= 90 || cc === 95;
}
function isNumberStart(ch) {
if (ch === EOF) {
return false;
}
const cc = ch.charCodeAt(0);
return cc >= 48 && cc <= 57;
}
function isNamedIdentifierStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 2) {
return false;
}
peekSpaces(scnr);
const ret = isIdentifierStart(scnr.currentPeek());
scnr.resetPeek();
return ret;
}
function isListIdentifierStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 2) {
return false;
}
peekSpaces(scnr);
const ch = scnr.currentPeek() === "-" ? scnr.peek() : scnr.currentPeek();
const ret = isNumberStart(ch);
scnr.resetPeek();
return ret;
}
function isLiteralStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 2) {
return false;
}
peekSpaces(scnr);
const ret = scnr.currentPeek() === LITERAL_DELIMITER;
scnr.resetPeek();
return ret;
}
function isLinkedDotStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 8) {
return false;
}
peekSpaces(scnr);
const ret = scnr.currentPeek() === ".";
scnr.resetPeek();
return ret;
}
function isLinkedModifierStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 9) {
return false;
}
peekSpaces(scnr);
const ret = isIdentifierStart(scnr.currentPeek());
scnr.resetPeek();
return ret;
}
function isLinkedDelimiterStart(scnr, context2) {
const { currentType } = context2;
if (!(currentType === 8 || currentType === 12)) {
return false;
}
peekSpaces(scnr);
const ret = scnr.currentPeek() === ":";
scnr.resetPeek();
return ret;
}
function isLinkedReferStart(scnr, context2) {
const { currentType } = context2;
if (currentType !== 10) {
return false;
}
const fn = () => {
const ch = scnr.currentPeek();
if (ch === "{") {
return isIdentifierStart(scnr.peek());
} else if (ch === "@" || ch === "%" || ch === "|" || ch === ":" || ch === "." || ch === CHAR_SP || !ch) {
return false;
} else if (ch === CHAR_LF) {
scnr.peek();
return fn();
} else {
return isIdentifierStart(ch);
}
};
const ret = fn();
scnr.resetPeek();
return ret;
}
function isPluralStart(scnr) {
peekSpaces(scnr);
const ret = scnr.currentPeek() === "|";
scnr.resetPeek();
return ret;
}
function isTextStart(scnr, reset3 = true) {
const fn = (hasSpace = false, prev = "", detectModulo = false) => {
const ch = scnr.currentPeek();
if (ch === "{") {
return prev === "%" ? false : hasSpace;
} else if (ch === "@" || !ch) {
return prev === "%" ? true : hasSpace;
} else if (ch === "%") {
scnr.peek();
return fn(hasSpace, "%", true);
} else if (ch === "|") {
return prev === "%" || detectModulo ? true : !(prev === CHAR_SP || prev === CHAR_LF);
} else if (ch === CHAR_SP) {
scnr.peek();
return fn(true, CHAR_SP, detectModulo);
} else if (ch === CHAR_LF) {
scnr.peek();
return fn(true, CHAR_LF, detectModulo);
} else {
return true;
}
};
const ret = fn();
reset3 && scnr.resetPeek();
return ret;
}
function takeChar(scnr, fn) {
const ch = scnr.currentChar();
if (ch === EOF) {
return EOF;
}
if (fn(ch)) {
scnr.next();
return ch;
}
return null;
}
function takeIdentifierChar(scnr) {
const closure = (ch) => {
const cc = ch.charCodeAt(0);
return cc >= 97 && cc <= 122 || cc >= 65 && cc <= 90 || cc >= 48 && cc <= 57 || cc === 95 || cc === 36;
};
return takeChar(scnr, closure);
}
function takeDigit(scnr) {
const closure = (ch) => {
const cc = ch.charCodeAt(0);
return cc >= 48 && cc <= 57;
};
return takeChar(scnr, closure);
}
function takeHexDigit(scnr) {
const closure = (ch) => {
const cc = ch.charCodeAt(0);
return cc >= 48 && cc <= 57 || cc >= 65 && cc <= 70 || cc >= 97 && cc <= 102;
};
return takeChar(scnr, closure);
}
function getDigits(scnr) {
let ch = "";
let num = "";
while (ch = takeDigit(scnr)) {
num += ch;
}
return num;
}
function readText(scnr) {
let buf = "";
while (true) {
const ch = scnr.currentChar();
if (ch === "{" || ch === "}" || ch === "@" || ch === "|" || !ch) {
break;
} else if (ch === "%") {
if (isTextStart(scnr)) {
buf += ch;
scnr.next();
} else {
break;
}
} else if (ch === CHAR_SP || ch === CHAR_LF) {
if (isTextStart(scnr)) {
buf += ch;
scnr.next();
} else if (isPluralStart(scnr)) {
break;
} else {
buf += ch;
scnr.next();
}
} else {
buf += ch;
scnr.next();
}
}
return buf;
}
function readNamedIdentifier(scnr) {
skipSpaces(scnr);
let ch = "";
let name = "";
while (ch = takeIdentifierChar(scnr)) {
name += ch;
}
if (scnr.currentChar() === EOF) {
emitError(6, currentPosition(), 0);
}
return name;
}
function readListIdentifier(scnr) {
skipSpaces(scnr);
let value = "";
if (scnr.currentChar() === "-") {
scnr.next();
value += `-${getDigits(scnr)}`;
} else {
value += getDigits(scnr);
}
if (scnr.currentChar() === EOF) {
emitError(6, currentPosition(), 0);
}
return value;
}
function readLiteral(scnr) {
skipSpaces(scnr);
eat(scnr, `'`);
let ch = "";
let literal = "";
const fn = (x) => x !== LITERAL_DELIMITER && x !== CHAR_LF;
while (ch = takeChar(scnr, fn)) {
if (ch === "\\") {
literal += readEscapeSequence(scnr);
} else {
literal += ch;
}
}
const current = scnr.currentChar();
if (current === CHAR_LF || current === EOF) {
emitError(2, currentPosition(), 0);
if (current === CHAR_LF) {
scnr.next();
eat(scnr, `'`);
}
return literal;
}
eat(scnr, `'`);
return literal;
}
function readEscapeSequence(scnr) {
const ch = scnr.currentChar();
switch (ch) {
case "\\":
case `'`:
scnr.next();
return `\\${ch}`;
case "u":
return readUnicodeEscapeSequence(scnr, ch, 4);
case "U":
return readUnicodeEscapeSequence(scnr, ch, 6);
default:
emitError(3, currentPosition(), 0, ch);
return "";
}
}
function readUnicodeEscapeSequence(scnr, unicode, digits) {
eat(scnr, unicode);
let sequence = "";
for (let i = 0; i < digits; i++) {
const ch = takeHexDigit(scnr);
if (!ch) {
emitError(4, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`);
break;
}
sequence += ch;
}
return `\\${unicode}${sequence}`;
}
function readInvalidIdentifier(scnr) {
skipSpaces(scnr);
let ch = "";
let identifiers = "";
const closure = (ch2) => ch2 !== "{" && ch2 !== "}" && ch2 !== CHAR_SP && ch2 !== CHAR_LF;
while (ch = takeChar(scnr, closure)) {
identifiers += ch;
}
return identifiers;
}
function readLinkedModifier(scnr) {
let ch = "";
let name = "";
while (ch = takeIdentifierChar(scnr)) {
name += ch;
}
return name;
}
function readLinkedRefer(scnr) {
const fn = (detect = false, buf) => {
const ch = scnr.currentChar();
if (ch === "{" || ch === "%" || ch === "@" || ch === "|" || !ch) {
return buf;
} else if (ch === CHAR_SP) {
return buf;
} else if (ch === CHAR_LF) {
buf += ch;
scnr.next();
return fn(detect, buf);
} else {
buf += ch;
scnr.next();
return fn(true, buf);
}
};
return fn(false, "");
}
function readPlural(scnr) {
skipSpaces(scnr);
const plural = eat(scnr, "|");
skipSpaces(scnr);
return plural;
}
function readTokenInPlaceholder(scnr, context2) {
let token = null;
const ch = scnr.currentChar();
switch (ch) {
case "{":
if (context2.braceNest >= 1) {
emitError(8, currentPosition(), 0);
}
scnr.next();
token = getToken(context2, 2, "{");
skipSpaces(scnr);
context2.braceNest++;
return token;
case "}":
if (context2.braceNest > 0 && context2.currentType === 2) {
emitError(7, currentPosition(), 0);
}
scnr.next();
token = getToken(context2, 3, "}");
context2.braceNest--;
context2.braceNest > 0 && skipSpaces(scnr);
if (context2.inLinked && context2.braceNest === 0) {
context2.inLinked = false;
}
return token;
case "@":
if (context2.braceNest > 0) {
emitError(6, currentPosition(), 0);
}
token = readTokenInLinked(scnr, context2) || getEndToken(context2);
context2.braceNest = 0;
return token;
default:
let validNamedIdentifier = true;
let validListIdentifier = true;
let validLiteral = true;
if (isPluralStart(scnr)) {
if (context2.braceNest > 0) {
emitError(6, currentPosition(), 0);
}
token = getToken(context2, 1, readPlural(scnr));
context2.braceNest = 0;
context2.inLinked = false;
return token;
}
if (context2.braceNest > 0 && (context2.currentType === 5 || context2.currentType === 6 || context2.currentType === 7)) {
emitError(6, currentPosition(), 0);
context2.braceNest = 0;
return readToken(scnr, context2);
}
if (validNamedIdentifier = isNamedIdentifierStart(scnr, context2)) {
token = getToken(context2, 5, readNamedIdentifier(scnr));
skipSpaces(scnr);
return token;
}
if (validListIdentifier = isListIdentifierStart(scnr, context2)) {
token = getToken(context2, 6, readListIdentifier(scnr));
skipSpaces(scnr);
return token;
}
if (validLiteral = isLiteralStart(scnr, context2)) {
token = getToken(context2, 7, readLiteral(scnr));
skipSpaces(scnr);
return token;
}
if (!validNamedIdentifier && !validListIdentifier && !validLiteral) {
token = getToken(context2, 13, readInvalidIdentifier(scnr));
emitError(1, currentPosition(), 0, token.value);
skipSpaces(scnr);
return token;
}
break;
}
return token;
}
function readTokenInLinked(scnr, context2) {
const { currentType } = context2;
let token = null;
const ch = scnr.currentChar();
if ((currentType === 8 || currentType === 9 || currentType === 12 || currentType === 10) && (ch === CHAR_LF || ch === CHAR_SP)) {
emitError(9, currentPosition(), 0);
}
switch (ch) {
case "@":
scnr.next();
token = getToken(context2, 8, "@");
context2.inLinked = true;
return token;
case ".":
skipSpaces(scnr);
scnr.next();
return getToken(context2, 9, ".");
case ":":
skipSpaces(scnr);
scnr.next();
return getToken(context2, 10, ":");
default:
if (isPluralStart(scnr)) {
token = getToken(context2, 1, readPlural(scnr));
context2.braceNest = 0;
context2.inLinked = false;
return token;
}
if (isLinkedDotStart(scnr, context2) || isLinkedDelimiterStart(scnr, context2)) {
skipSpaces(scnr);
return readTokenInLinked(scnr, context2);
}
if (isLinkedModifierStart(scnr, context2)) {
skipSpaces(scnr);
return getToken(context2, 12, readLinkedModifier(scnr));
}
if (isLinkedReferStart(scnr, context2)) {
skipSpaces(scnr);
if (ch === "{") {
return readTokenInPlaceholder(scnr, context2) || token;
} else {
return getToken(context2, 11, readLinkedRefer(scnr));
}
}
if (currentType === 8) {
emitError(9, currentPosition(), 0);
}
context2.braceNest = 0;
context2.inLinked = false;
return readToken(scnr, context2);
}
}
function readToken(scnr, context2) {
let token = { type: 14 };
if (context2.braceNest > 0) {
return readTokenInPlaceholder(scnr, context2) || getEndToken(context2);
}
if (context2.inLinked) {
return readTokenInLinked(scnr, context2) || getEndToken(context2);
}
const ch = scnr.currentChar();
switch (ch) {
case "{":
return readTokenInPlaceholder(scnr, context2) || getEndToken(context2);
case "}":
emitError(5, currentPosition(), 0);
scnr.next();
return getToken(context2, 3, "}");
case "@":
return readTokenInLinked(scnr, context2) || getEndToken(context2);
default:
if (isPluralStart(scnr)) {
token = getToken(context2, 1, readPlural(scnr));
context2.braceNest = 0;
context2.inLinked = false;
return token;
}
if (isTextStart(scnr)) {
return getToken(context2, 0, readText(scnr));
}
if (ch === "%") {
scnr.next();
return getToken(context2, 4, "%");
}
break;
}
return token;
}
function nextToken() {
const { currentType, offset, startLoc, endLoc } = _context;
_context.lastType = currentType;
_context.lastOffset = offset;
_context.lastStartLoc = startLoc;
_context.lastEndLoc = endLoc;
_context.offset = currentOffset();
_context.startLoc = currentPosition();
if (_scnr.currentChar() === EOF) {
return getToken(_context, 14);
}
return readToken(_scnr, _context);
}
return {
nextToken,
currentOffset,
currentPosition,
context
};
}
const ERROR_DOMAIN = "parser";
const KNOWN_ESCAPES = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g;
function fromEscapeSequence(match, codePoint4, codePoint6) {
switch (match) {
case `\\\\`:
return `\\`;
case `\\'`:
return `'`;
default: {
const codePoint = parseInt(codePoint4 || codePoint6, 16);
if (codePoint <= 55295 || codePoint >= 57344) {
return String.fromCodePoint(codePoint);
}
return "\uFFFD";
}
}
}
function createParser(options = {}) {
const location2 = options.location !== false;
const { onError } = options;
function emitError(tokenzer, code, start, offset, ...args) {
const end = tokenzer.currentPosition();
end.offset += offset;
end.column += offset;
if (onError) {
const loc = createLocation(start, end);
const err = createCompileError(code, loc, {
domain: ERROR_DOMAIN,
args
});
onError(err);
}
}
function startNode(type4, offset, loc) {
const node = {
type: type4,
start: offset,
end: offset
};
if (location2) {
node.loc = { start: loc, end: loc };
}
return node;
}
function endNode(node, offset, pos, type4) {
node.end = offset;
if (type4) {
node.type = type4;
}
if (location2 && node.loc) {
node.loc.end = pos;
}
}
function parseText(tokenizer, value) {
const context = tokenizer.context();
const node = startNode(3, context.offset, context.startLoc);
node.value = value;
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseList(tokenizer, index2) {
const context = tokenizer.context();
const { lastOffset: offset, lastStartLoc: loc } = context;
const node = startNode(5, offset, loc);
node.index = parseInt(index2, 10);
tokenizer.nextToken();
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseNamed(tokenizer, key) {
const context = tokenizer.context();
const { lastOffset: offset, lastStartLoc: loc } = context;
const node = startNode(4, offset, loc);
node.key = key;
tokenizer.nextToken();
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseLiteral(tokenizer, value) {
const context = tokenizer.context();
const { lastOffset: offset, lastStartLoc: loc } = context;
const node = startNode(9, offset, loc);
node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence);
tokenizer.nextToken();
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseLinkedModifier(tokenizer) {
const token = tokenizer.nextToken();
const context = tokenizer.context();
const { lastOffset: offset, lastStartLoc: loc } = context;
const node = startNode(8, offset, loc);
if (token.type !== 12) {
emitError(tokenizer, 11, context.lastStartLoc, 0);
node.value = "";
endNode(node, offset, loc);
return {
nextConsumeToken: token,
node
};
}
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
node.value = token.value || "";
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return {
node
};
}
function parseLinkedKey(tokenizer, value) {
const context = tokenizer.context();
const node = startNode(7, context.offset, context.startLoc);
node.value = value;
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseLinked(tokenizer) {
const context = tokenizer.context();
const linkedNode = startNode(6, context.offset, context.startLoc);
let token = tokenizer.nextToken();
if (token.type === 9) {
const parsed = parseLinkedModifier(tokenizer);
linkedNode.modifier = parsed.node;
token = parsed.nextConsumeToken || tokenizer.nextToken();
}
if (token.type !== 10) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
token = tokenizer.nextToken();
if (token.type === 2) {
token = tokenizer.nextToken();
}
switch (token.type) {
case 11:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
linkedNode.key = parseLinkedKey(tokenizer, token.value || "");
break;
case 5:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
linkedNode.key = parseNamed(tokenizer, token.value || "");
break;
case 6:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
linkedNode.key = parseList(tokenizer, token.value || "");
break;
case 7:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
linkedNode.key = parseLiteral(tokenizer, token.value || "");
break;
default:
emitError(tokenizer, 12, context.lastStartLoc, 0);
const nextContext = tokenizer.context();
const emptyLinkedKeyNode = startNode(7, nextContext.offset, nextContext.startLoc);
emptyLinkedKeyNode.value = "";
endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc);
linkedNode.key = emptyLinkedKeyNode;
endNode(linkedNode, nextContext.offset, nextContext.startLoc);
return {
nextConsumeToken: token,
node: linkedNode
};
}
endNode(linkedNode, tokenizer.currentOffset(), tokenizer.currentPosition());
return {
node: linkedNode
};
}
function parseMessage(tokenizer) {
const context = tokenizer.context();
const startOffset = context.currentType === 1 ? tokenizer.currentOffset() : context.offset;
const startLoc = context.currentType === 1 ? context.endLoc : context.startLoc;
const node = startNode(2, startOffset, startLoc);
node.items = [];
let nextToken = null;
do {
const token = nextToken || tokenizer.nextToken();
nextToken = null;
switch (token.type) {
case 0:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
node.items.push(parseText(tokenizer, token.value || ""));
break;
case 6:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
node.items.push(parseList(tokenizer, token.value || ""));
break;
case 5:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
node.items.push(parseNamed(tokenizer, token.value || ""));
break;
case 7:
if (token.value == null) {
emitError(tokenizer, 13, context.lastStartLoc, 0, getTokenCaption(token));
}
node.items.push(parseLiteral(tokenizer, token.value || ""));
break;
case 8:
const parsed = parseLinked(tokenizer);
node.items.push(parsed.node);
nextToken = parsed.nextConsumeToken || null;
break;
}
} while (context.currentType !== 14 && context.currentType !== 1);
const endOffset = context.currentType === 1 ? context.lastOffset : tokenizer.currentOffset();
const endLoc = context.currentType === 1 ? context.lastEndLoc : tokenizer.currentPosition();
endNode(node, endOffset, endLoc);
return node;
}
function parsePlural(tokenizer, offset, loc, msgNode) {
const context = tokenizer.context();
let hasEmptyMessage = msgNode.items.length === 0;
const node = startNode(1, offset, loc);
node.cases = [];
node.cases.push(msgNode);
do {
const msg2 = parseMessage(tokenizer);
if (!hasEmptyMessage) {
hasEmptyMessage = msg2.items.length === 0;
}
node.cases.push(msg2);
} while (context.currentType !== 14);
if (hasEmptyMessage) {
emitError(tokenizer, 10, loc, 0);
}
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
function parseResource(tokenizer) {
const context = tokenizer.context();
const { offset, startLoc } = context;
const msgNode = parseMessage(tokenizer);
if (context.currentType === 14) {
return msgNode;
} else {
return parsePlural(tokenizer, offset, startLoc, msgNode);
}
}
function parse2(source) {
const tokenizer = createTokenizer(source, assign$1({}, options));
const context = tokenizer.context();
const node = startNode(0, context.offset, context.startLoc);
if (location2 && node.loc) {
node.loc.source = source;
}
node.body = parseResource(tokenizer);
if (context.currentType !== 14) {
emitError(tokenizer, 13, context.lastStartLoc, 0, source[context.offset] || "");
}
endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition());
return node;
}
return { parse: parse2 };
}
function getTokenCaption(token) {
if (token.type === 14) {
return "EOF";
}
const name = (token.value || "").replace(/\r?\n/gu, "\\n");
return name.length > 10 ? name.slice(0, 9) + "\u2026" : name;
}
function createTransformer(ast, options = {}) {
const _context = {
ast,
helpers: /* @__PURE__ */ new Set()
};
const context = () => _context;
const helper = (name) => {
_context.helpers.add(name);
return name;
};
return { context, helper };
}
function traverseNodes(nodes, transformer) {
for (let i = 0; i < nodes.length; i++) {
traverseNode(nodes[i], transformer);
}
}
function traverseNode(node, transformer) {
switch (node.type) {
case 1:
traverseNodes(node.cases, transformer);
transformer.helper("plural");
break;
case 2:
traverseNodes(node.items, transformer);
break;
case 6:
const linked = node;
traverseNode(linked.key, transformer);
transformer.helper("linked");
break;
case 5:
transformer.helper("interpolate");
transformer.helper("list");
break;
case 4:
transformer.helper("interpolate");
transformer.helper("named");
break;
}
}
function transform(ast, options = {}) {
const transformer = createTransformer(ast);
transformer.helper("normalize");
ast.body && traverseNode(ast.body, transformer);
const context = transformer.context();
ast.helpers = Array.from(context.helpers);
}
function createCodeGenerator(ast, options) {
const { sourceMap, filename, breakLineCode, needIndent: _needIndent } = options;
const _context = {
source: ast.loc.source,
filename,
code: "",
column: 1,
line: 1,
offset: 0,
map: void 0,
breakLineCode,
needIndent: _needIndent,
indentLevel: 0
};
const context = () => _context;
function push(code, node) {
_context.code += code;
}
function _newline(n, withBreakLine = true) {
const _breakLineCode = withBreakLine ? breakLineCode : "";
push(_needIndent ? _breakLineCode + ` `.repeat(n) : _breakLineCode);
}
function indent(withNewLine = true) {
const level = ++_context.indentLevel;
withNewLine && _newline(level);
}
function deindent(withNewLine = true) {
const level = --_context.indentLevel;
withNewLine && _newline(level);
}
function newline() {
_newline(_context.indentLevel);
}
const helper = (key) => `_${key}`;
const needIndent = () => _context.needIndent;
return {
context,
push,
indent,
deindent,
newline,
helper,
needIndent
};
}
function generateLinkedNode(generator, node) {
const { helper } = generator;
generator.push(`${helper("linked")}(`);
generateNode(generator, node.key);
if (node.modifier) {
generator.push(`, `);
generateNode(generator, node.modifier);
}
generator.push(`)`);
}
function generateMessageNode(generator, node) {
const { helper, needIndent } = generator;
generator.push(`${helper("normalize")}([`);
generator.indent(needIndent());
const length = node.items.length;
for (let i = 0; i < length; i++) {
generateNode(generator, node.items[i]);
if (i === length - 1) {
break;
}
generator.push(", ");
}
generator.deindent(needIndent());
generator.push("])");
}
function generatePluralNode(generator, node) {
const { helper, needIndent } = generator;
if (node.cases.length > 1) {
generator.push(`${helper("plural")}([`);
generator.indent(needIndent());
const length = node.cases.length;
for (let i = 0; i < length; i++) {
generateNode(generator, node.cases[i]);
if (i === length - 1) {
break;
}
generator.push(", ");
}
generator.deindent(needIndent());
generator.push(`])`);
}
}
function generateResource(generator, node) {
if (node.body) {
generateNode(generator, node.body);
} else {
generator.push("null");
}
}
function generateNode(generator, node) {
const { helper } = generator;
switch (node.type) {
case 0:
generateResource(generator, node);
break;
case 1:
generatePluralNode(generator, node);
break;
case 2:
generateMessageNode(generator, node);
break;
case 6:
generateLinkedNode(generator, node);
break;
case 8:
generator.push(JSON.stringify(node.value), node);
break;
case 7:
generator.push(JSON.stringify(node.value), node);
break;
case 5:
generator.push(`${helper("interpolate")}(${helper("list")}(${node.index}))`, node);
break;
case 4:
generator.push(`${helper("interpolate")}(${helper("named")}(${JSON.stringify(node.key)}))`, node);
break;
case 9:
generator.push(JSON.stringify(node.value), node);
break;
case 3:
generator.push(JSON.stringify(node.value), node);
break;
}
}
const generate = (ast, options = {}) => {
const mode = isString$1(options.mode) ? options.mode : "normal";
const filename = isString$1(options.filename) ? options.filename : "message.intl";
const sourceMap = !!options.sourceMap;
const breakLineCode = options.breakLineCode != null ? options.breakLineCode : mode === "arrow" ? ";" : "\n";
const needIndent = options.needIndent ? options.needIndent : mode !== "arrow";
const helpers = ast.helpers || [];
const generator = createCodeGenerator(ast, {
mode,
filename,
sourceMap,
breakLineCode,
needIndent
});
generator.push(mode === "normal" ? `function __msg__ (ctx) {` : `(ctx) => {`);
generator.indent(needIndent);
if (helpers.length > 0) {
generator.push(`const { ${helpers.map((s) => `${s}: _${s}`).join(", ")} } = ctx`);
generator.newline();
}
generator.push(`return `);
generateNode(generator, ast);
generator.deindent(needIndent);
generator.push(`}`);
const { code, map } = generator.context();
return {
ast,
code,
map: map ? map.toJSON() : void 0
};
};
function baseCompile(source, options = {}) {
const assignedOptions = assign$1({}, options);
const parser = createParser(assignedOptions);
const ast = parser.parse(source);
transform(ast, assignedOptions);
return generate(ast, assignedOptions);
}
/*!
* @intlify/devtools-if v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
const IntlifyDevToolsHooks = {
I18nInit: "i18n:init",
FunctionTranslate: "function:translate"
};
/*!
* @intlify/core-base v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
let devtools = null;
function setDevToolsHook(hook) {
devtools = hook;
}
function initI18nDevTools(i18n2, version, meta) {
devtools && devtools.emit(IntlifyDevToolsHooks.I18nInit, {
timestamp: Date.now(),
i18n: i18n2,
version,
meta
});
}
const translateDevTools = /* @__PURE__ */ createDevToolsHook(IntlifyDevToolsHooks.FunctionTranslate);
function createDevToolsHook(hook) {
return (payloads) => devtools && devtools.emit(hook, payloads);
}
const VERSION$1 = "9.1.10";
const NOT_REOSLVED = -1;
const MISSING_RESOLVE_VALUE = "";
function getDefaultLinkedModifiers() {
return {
upper: (val) => isString$1(val) ? val.toUpperCase() : val,
lower: (val) => isString$1(val) ? val.toLowerCase() : val,
capitalize: (val) => isString$1(val) ? `${val.charAt(0).toLocaleUpperCase()}${val.substr(1)}` : val
};
}
let _compiler;
function registerMessageCompiler(compiler) {
_compiler = compiler;
}
let _additionalMeta = null;
const setAdditionalMeta = (meta) => {
_additionalMeta = meta;
};
const getAdditionalMeta = () => _additionalMeta;
let _cid = 0;
function createCoreContext(options = {}) {
const version = isString$1(options.version) ? options.version : VERSION$1;
const locale = isString$1(options.locale) ? options.locale : "en-US";
const fallbackLocale = isArray$1(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || isString$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
const messages2 = isPlainObject$1(options.messages) ? options.messages : { [locale]: {} };
const datetimeFormats = isPlainObject$1(options.datetimeFormats) ? options.datetimeFormats : { [locale]: {} };
const numberFormats = isPlainObject$1(options.numberFormats) ? options.numberFormats : { [locale]: {} };
const modifiers = assign$1({}, options.modifiers || {}, getDefaultLinkedModifiers());
const pluralRules = options.pluralRules || {};
const missing = isFunction$3(options.missing) ? options.missing : null;
const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
const fallbackFormat = !!options.fallbackFormat;
const unresolving = !!options.unresolving;
const postTranslation = isFunction$3(options.postTranslation) ? options.postTranslation : null;
const processor = isPlainObject$1(options.processor) ? options.processor : null;
const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
const escapeParameter = !!options.escapeParameter;
const messageCompiler = isFunction$3(options.messageCompiler) ? options.messageCompiler : _compiler;
const onWarn = isFunction$3(options.onWarn) ? options.onWarn : warn;
const internalOptions = options;
2022-12-30 08:13:19 +00:00
const __datetimeFormatters = isObject$4(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map();
const __numberFormatters = isObject$4(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map();
const __meta = isObject$4(internalOptions.__meta) ? internalOptions.__meta : {};
2022-11-15 01:16:55 +00:00
_cid++;
const context = {
version,
cid: _cid,
locale,
fallbackLocale,
messages: messages2,
datetimeFormats,
numberFormats,
modifiers,
pluralRules,
missing,
missingWarn,
fallbackWarn,
fallbackFormat,
unresolving,
postTranslation,
processor,
warnHtmlMessage,
escapeParameter,
messageCompiler,
onWarn,
__datetimeFormatters,
__numberFormatters,
__meta
};
if (__INTLIFY_PROD_DEVTOOLS__) {
initI18nDevTools(context, version, __meta);
}
return context;
}
function handleMissing(context, key, locale, missingWarn, type4) {
const { missing, onWarn } = context;
if (missing !== null) {
const ret = missing(context, locale, key, type4);
return isString$1(ret) ? ret : key;
} else {
return key;
}
}
function getLocaleChain(ctx, fallback, start) {
const context = ctx;
if (!context.__localeChainCache) {
context.__localeChainCache = /* @__PURE__ */ new Map();
}
let chain = context.__localeChainCache.get(start);
if (!chain) {
chain = [];
let block = [start];
while (isArray$1(block)) {
block = appendBlockToChain(chain, block, fallback);
}
const defaults = isArray$1(fallback) ? fallback : isPlainObject$1(fallback) ? fallback["default"] ? fallback["default"] : null : fallback;
block = isString$1(defaults) ? [defaults] : defaults;
if (isArray$1(block)) {
appendBlockToChain(chain, block, false);
}
context.__localeChainCache.set(start, chain);
}
return chain;
}
function appendBlockToChain(chain, block, blocks) {
let follow = true;
for (let i = 0; i < block.length && isBoolean(follow); i++) {
const locale = block[i];
if (isString$1(locale)) {
follow = appendLocaleToChain(chain, block[i], blocks);
}
}
return follow;
}
function appendLocaleToChain(chain, locale, blocks) {
let follow;
const tokens = locale.split("-");
do {
const target = tokens.join("-");
follow = appendItemToChain(chain, target, blocks);
tokens.splice(-1, 1);
} while (tokens.length && follow === true);
return follow;
}
function appendItemToChain(chain, target, blocks) {
let follow = false;
if (!chain.includes(target)) {
follow = true;
if (target) {
follow = target[target.length - 1] !== "!";
const locale = target.replace(/!/g, "");
chain.push(locale);
if ((isArray$1(blocks) || isPlainObject$1(blocks)) && blocks[locale]) {
follow = blocks[locale];
}
}
}
return follow;
}
function updateFallbackLocale(ctx, locale, fallback) {
const context = ctx;
context.__localeChainCache = /* @__PURE__ */ new Map();
getLocaleChain(ctx, fallback, locale);
}
const defaultOnCacheKey = (source) => source;
let compileCache = /* @__PURE__ */ Object.create(null);
function compileToFunction(source, options = {}) {
{
const onCacheKey = options.onCacheKey || defaultOnCacheKey;
const key = onCacheKey(source);
const cached = compileCache[key];
if (cached) {
return cached;
}
let occurred = false;
const onError = options.onError || defaultOnError;
options.onError = (err) => {
occurred = true;
onError(err);
};
const { code } = baseCompile(source, options);
const msg2 = new Function(`return ${code}`)();
return !occurred ? compileCache[key] = msg2 : msg2;
}
}
function createCoreError(code) {
return createCompileError(code, null, void 0);
}
const NOOP_MESSAGE_FUNCTION = () => "";
const isMessageFunction = (val) => isFunction$3(val);
function translate(context, ...args) {
const { fallbackFormat, postTranslation, unresolving, fallbackLocale, messages: messages2 } = context;
const [key, options] = parseTranslateArgs(...args);
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter;
const resolvedMessage = !!options.resolvedMessage;
const defaultMsgOrKey = isString$1(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : key : fallbackFormat ? key : "";
const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== "";
const locale = isString$1(options.locale) ? options.locale : context.locale;
escapeParameter && escapeParams(options);
let [format2, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [
key,
locale,
messages2[locale] || {}
];
let cacheBaseKey = key;
if (!resolvedMessage && !(isString$1(format2) || isMessageFunction(format2))) {
if (enableDefaultMsg) {
format2 = defaultMsgOrKey;
cacheBaseKey = format2;
}
}
if (!resolvedMessage && (!(isString$1(format2) || isMessageFunction(format2)) || !isString$1(targetLocale))) {
return unresolving ? NOT_REOSLVED : key;
}
let occurred = false;
const errorDetector = () => {
occurred = true;
};
const msg2 = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) : format2;
if (occurred) {
return format2;
}
const ctxOptions = getMessageContextOptions(context, targetLocale, message, options);
const msgContext = createMessageContext(ctxOptions);
const messaged = evaluateMessage(context, msg2, msgContext);
const ret = postTranslation ? postTranslation(messaged) : messaged;
if (__INTLIFY_PROD_DEVTOOLS__) {
const payloads = {
timestamp: Date.now(),
key: isString$1(key) ? key : isMessageFunction(format2) ? format2.key : "",
locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""),
format: isString$1(format2) ? format2 : isMessageFunction(format2) ? format2.source : "",
message: ret
};
payloads.meta = assign$1({}, context.__meta, getAdditionalMeta() || {});
translateDevTools(payloads);
}
return ret;
}
function escapeParams(options) {
if (isArray$1(options.list)) {
options.list = options.list.map((item) => isString$1(item) ? escapeHtml(item) : item);
2022-12-30 08:13:19 +00:00
} else if (isObject$4(options.named)) {
2022-11-15 01:16:55 +00:00
Object.keys(options.named).forEach((key) => {
if (isString$1(options.named[key])) {
options.named[key] = escapeHtml(options.named[key]);
}
});
}
}
function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) {
const { messages: messages2, onWarn } = context;
const locales = getLocaleChain(context, fallbackLocale, locale);
let message = {};
let targetLocale;
let format2 = null;
const type4 = "translate";
for (let i = 0; i < locales.length; i++) {
targetLocale = locales[i];
message = messages2[targetLocale] || {};
if ((format2 = resolveValue(message, key)) === null) {
format2 = message[key];
}
if (isString$1(format2) || isFunction$3(format2))
break;
const missingRet = handleMissing(context, key, targetLocale, missingWarn, type4);
if (missingRet !== key) {
format2 = missingRet;
}
}
return [format2, targetLocale, message];
}
function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, errorDetector) {
const { messageCompiler, warnHtmlMessage } = context;
if (isMessageFunction(format2)) {
const msg3 = format2;
msg3.locale = msg3.locale || targetLocale;
msg3.key = msg3.key || key;
return msg3;
}
const msg2 = messageCompiler(format2, getCompileOptions(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, errorDetector));
msg2.locale = targetLocale;
msg2.key = key;
msg2.source = format2;
return msg2;
}
function evaluateMessage(context, msg2, msgCtx) {
const messaged = msg2(msgCtx);
return messaged;
}
function parseTranslateArgs(...args) {
const [arg1, arg2, arg3] = args;
const options = {};
if (!isString$1(arg1) && !isNumber$2(arg1) && !isMessageFunction(arg1)) {
throw createCoreError(14);
}
const key = isNumber$2(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1;
if (isNumber$2(arg2)) {
options.plural = arg2;
} else if (isString$1(arg2)) {
options.default = arg2;
} else if (isPlainObject$1(arg2) && !isEmptyObject(arg2)) {
options.named = arg2;
} else if (isArray$1(arg2)) {
options.list = arg2;
}
if (isNumber$2(arg3)) {
options.plural = arg3;
} else if (isString$1(arg3)) {
options.default = arg3;
} else if (isPlainObject$1(arg3)) {
assign$1(options, arg3);
}
return [key, options];
}
function getCompileOptions(context, locale, key, source, warnHtmlMessage, errorDetector) {
return {
warnHtmlMessage,
onError: (err) => {
errorDetector && errorDetector(err);
{
throw err;
}
},
onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2)
};
}
function getMessageContextOptions(context, locale, message, options) {
const { modifiers, pluralRules } = context;
const resolveMessage = (key) => {
const val = resolveValue(message, key);
if (isString$1(val)) {
let occurred = false;
const errorDetector = () => {
occurred = true;
};
const msg2 = compileMessageFormat(context, key, locale, val, key, errorDetector);
return !occurred ? msg2 : NOOP_MESSAGE_FUNCTION;
} else if (isMessageFunction(val)) {
return val;
} else {
return NOOP_MESSAGE_FUNCTION;
}
};
const ctxOptions = {
locale,
modifiers,
pluralRules,
messages: resolveMessage
};
if (context.processor) {
ctxOptions.processor = context.processor;
}
if (options.list) {
ctxOptions.list = options.list;
}
if (options.named) {
ctxOptions.named = options.named;
}
if (isNumber$2(options.plural)) {
ctxOptions.pluralIndex = options.plural;
}
return ctxOptions;
}
function datetime(context, ...args) {
const { datetimeFormats, unresolving, fallbackLocale, onWarn } = context;
const { __datetimeFormatters } = context;
const [key, value, options, overrides] = parseDateTimeArgs(...args);
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
const part = !!options.part;
const locale = isString$1(options.locale) ? options.locale : context.locale;
const locales = getLocaleChain(context, fallbackLocale, locale);
if (!isString$1(key) || key === "") {
return new Intl.DateTimeFormat(locale).format(value);
}
let datetimeFormat = {};
let targetLocale;
let format2 = null;
const type4 = "datetime format";
for (let i = 0; i < locales.length; i++) {
targetLocale = locales[i];
datetimeFormat = datetimeFormats[targetLocale] || {};
format2 = datetimeFormat[key];
if (isPlainObject$1(format2))
break;
handleMissing(context, key, targetLocale, missingWarn, type4);
}
if (!isPlainObject$1(format2) || !isString$1(targetLocale)) {
return unresolving ? NOT_REOSLVED : key;
}
let id = `${targetLocale}__${key}`;
if (!isEmptyObject(overrides)) {
id = `${id}__${JSON.stringify(overrides)}`;
}
let formatter = __datetimeFormatters.get(id);
if (!formatter) {
formatter = new Intl.DateTimeFormat(targetLocale, assign$1({}, format2, overrides));
__datetimeFormatters.set(id, formatter);
}
return !part ? formatter.format(value) : formatter.formatToParts(value);
}
function parseDateTimeArgs(...args) {
const [arg1, arg2, arg3, arg4] = args;
let options = {};
let overrides = {};
let value;
if (isString$1(arg1)) {
if (!/\d{4}-\d{2}-\d{2}(T.*)?/.test(arg1)) {
throw createCoreError(16);
}
value = new Date(arg1);
try {
value.toISOString();
} catch (e) {
throw createCoreError(16);
}
} else if (isDate(arg1)) {
if (isNaN(arg1.getTime())) {
throw createCoreError(15);
}
value = arg1;
} else if (isNumber$2(arg1)) {
value = arg1;
} else {
throw createCoreError(14);
}
if (isString$1(arg2)) {
options.key = arg2;
} else if (isPlainObject$1(arg2)) {
options = arg2;
}
if (isString$1(arg3)) {
options.locale = arg3;
} else if (isPlainObject$1(arg3)) {
overrides = arg3;
}
if (isPlainObject$1(arg4)) {
overrides = arg4;
}
return [options.key || "", value, options, overrides];
}
function clearDateTimeFormat(ctx, locale, format2) {
const context = ctx;
for (const key in format2) {
const id = `${locale}__${key}`;
if (!context.__datetimeFormatters.has(id)) {
continue;
}
context.__datetimeFormatters.delete(id);
}
}
function number$1(context, ...args) {
const { numberFormats, unresolving, fallbackLocale, onWarn } = context;
const { __numberFormatters } = context;
const [key, value, options, overrides] = parseNumberArgs(...args);
const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn;
isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn;
const part = !!options.part;
const locale = isString$1(options.locale) ? options.locale : context.locale;
const locales = getLocaleChain(context, fallbackLocale, locale);
if (!isString$1(key) || key === "") {
return new Intl.NumberFormat(locale).format(value);
}
let numberFormat = {};
let targetLocale;
let format2 = null;
const type4 = "number format";
for (let i = 0; i < locales.length; i++) {
targetLocale = locales[i];
numberFormat = numberFormats[targetLocale] || {};
format2 = numberFormat[key];
if (isPlainObject$1(format2))
break;
handleMissing(context, key, targetLocale, missingWarn, type4);
}
if (!isPlainObject$1(format2) || !isString$1(targetLocale)) {
return unresolving ? NOT_REOSLVED : key;
}
let id = `${targetLocale}__${key}`;
if (!isEmptyObject(overrides)) {
id = `${id}__${JSON.stringify(overrides)}`;
}
let formatter = __numberFormatters.get(id);
if (!formatter) {
formatter = new Intl.NumberFormat(targetLocale, assign$1({}, format2, overrides));
__numberFormatters.set(id, formatter);
}
return !part ? formatter.format(value) : formatter.formatToParts(value);
}
function parseNumberArgs(...args) {
const [arg1, arg2, arg3, arg4] = args;
let options = {};
let overrides = {};
if (!isNumber$2(arg1)) {
throw createCoreError(14);
}
const value = arg1;
if (isString$1(arg2)) {
options.key = arg2;
} else if (isPlainObject$1(arg2)) {
options = arg2;
}
if (isString$1(arg3)) {
options.locale = arg3;
} else if (isPlainObject$1(arg3)) {
overrides = arg3;
}
if (isPlainObject$1(arg4)) {
overrides = arg4;
}
return [options.key || "", value, options, overrides];
}
function clearNumberFormat(ctx, locale, format2) {
const context = ctx;
for (const key in format2) {
const id = `${locale}__${key}`;
if (!context.__numberFormatters.has(id)) {
continue;
}
context.__numberFormatters.delete(id);
}
}
{
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
}
}
/*!
* vue-i18n v9.1.10
* (c) 2022 kazuya kawaguchi
* Released under the MIT License.
*/
const VERSION = "9.1.10";
function initFeatureFlags() {
if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") {
getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true;
}
if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") {
getGlobalThis().__VUE_I18N_LEGACY_API__ = true;
}
if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") {
getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
}
}
function createI18nError(code, ...args) {
return createCompileError(code, null, void 0);
}
const DEVTOOLS_META = "__INTLIFY_META__";
const TransrateVNodeSymbol = makeSymbol("__transrateVNode");
const DatetimePartsSymbol = makeSymbol("__datetimeParts");
const NumberPartsSymbol = makeSymbol("__numberParts");
makeSymbol("__enableEmitter");
makeSymbol("__disableEmitter");
const SetPluralRulesSymbol = makeSymbol("__setPluralRules");
makeSymbol("__intlifyMeta");
const InejctWithOption = makeSymbol("__injectWithOption");
let composerID = 0;
function defineCoreMissingHandler(missing) {
return (ctx, locale, key, type4) => {
return missing(locale, key, getCurrentInstance() || void 0, type4);
};
}
function getLocaleMessages(locale, options) {
const { messages: messages2, __i18n } = options;
const ret = isPlainObject$1(messages2) ? messages2 : isArray$1(__i18n) ? {} : { [locale]: {} };
if (isArray$1(__i18n)) {
__i18n.forEach(({ locale: locale2, resource }) => {
if (locale2) {
ret[locale2] = ret[locale2] || {};
deepCopy(resource, ret[locale2]);
} else {
deepCopy(resource, ret);
}
});
}
if (options.flatJson) {
for (const key in ret) {
if (hasOwn$1(ret, key)) {
handleFlatJson(ret[key]);
}
}
}
return ret;
}
2022-12-30 08:13:19 +00:00
const isNotObjectOrIsArray = (val) => !isObject$4(val) || isArray$1(val);
2022-11-15 01:16:55 +00:00
function deepCopy(src, des) {
if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) {
throw createI18nError(20);
}
for (const key in src) {
if (hasOwn$1(src, key)) {
if (isNotObjectOrIsArray(src[key]) || isNotObjectOrIsArray(des[key])) {
des[key] = src[key];
} else {
deepCopy(src[key], des[key]);
}
}
}
}
const getMetaInfo = () => {
const instance = getCurrentInstance();
return instance && instance.type[DEVTOOLS_META] ? { [DEVTOOLS_META]: instance.type[DEVTOOLS_META] } : null;
};
function createComposer(options = {}) {
const { __root } = options;
const _isGlobal = __root === void 0;
let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true;
const _locale = ref(__root && _inheritLocale ? __root.locale.value : isString$1(options.locale) ? options.locale : "en-US");
const _fallbackLocale = ref(__root && _inheritLocale ? __root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray$1(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value);
const _messages = ref(getLocaleMessages(_locale.value, options));
const _datetimeFormats = ref(isPlainObject$1(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} });
const _numberFormats = ref(isPlainObject$1(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} });
let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true;
let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true;
let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
let _fallbackFormat = !!options.fallbackFormat;
let _missing = isFunction$3(options.missing) ? options.missing : null;
let _runtimeMissing = isFunction$3(options.missing) ? defineCoreMissingHandler(options.missing) : null;
let _postTranslation = isFunction$3(options.postTranslation) ? options.postTranslation : null;
let _warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true;
let _escapeParameter = !!options.escapeParameter;
const _modifiers = __root ? __root.modifiers : isPlainObject$1(options.modifiers) ? options.modifiers : {};
let _pluralRules = options.pluralRules || __root && __root.pluralRules;
let _context;
function getCoreContext() {
return createCoreContext({
version: VERSION,
locale: _locale.value,
fallbackLocale: _fallbackLocale.value,
messages: _messages.value,
datetimeFormats: _datetimeFormats.value,
numberFormats: _numberFormats.value,
modifiers: _modifiers,
pluralRules: _pluralRules,
missing: _runtimeMissing === null ? void 0 : _runtimeMissing,
missingWarn: _missingWarn,
fallbackWarn: _fallbackWarn,
fallbackFormat: _fallbackFormat,
unresolving: true,
postTranslation: _postTranslation === null ? void 0 : _postTranslation,
warnHtmlMessage: _warnHtmlMessage,
escapeParameter: _escapeParameter,
__datetimeFormatters: isPlainObject$1(_context) ? _context.__datetimeFormatters : void 0,
__numberFormatters: isPlainObject$1(_context) ? _context.__numberFormatters : void 0,
__v_emitter: isPlainObject$1(_context) ? _context.__v_emitter : void 0,
__meta: { framework: "vue" }
});
}
_context = getCoreContext();
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
function trackReactivityValues() {
return [
_locale.value,
_fallbackLocale.value,
_messages.value,
_datetimeFormats.value,
_numberFormats.value
];
}
const locale = computed$1({
get: () => _locale.value,
set: (val) => {
_locale.value = val;
_context.locale = _locale.value;
}
});
const fallbackLocale = computed$1({
get: () => _fallbackLocale.value,
set: (val) => {
_fallbackLocale.value = val;
_context.fallbackLocale = _fallbackLocale.value;
updateFallbackLocale(_context, _locale.value, val);
}
});
const messages2 = computed$1(() => _messages.value);
const datetimeFormats = computed$1(() => _datetimeFormats.value);
const numberFormats = computed$1(() => _numberFormats.value);
function getPostTranslationHandler() {
return isFunction$3(_postTranslation) ? _postTranslation : null;
}
function setPostTranslationHandler(handler) {
_postTranslation = handler;
_context.postTranslation = handler;
}
function getMissingHandler() {
return _missing;
}
function setMissingHandler(handler) {
if (handler !== null) {
_runtimeMissing = defineCoreMissingHandler(handler);
}
_missing = handler;
_context.missing = _runtimeMissing;
}
function wrapWithDeps(fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) {
trackReactivityValues();
let ret;
if (__INTLIFY_PROD_DEVTOOLS__) {
try {
setAdditionalMeta(getMetaInfo());
ret = fn(_context);
} finally {
setAdditionalMeta(null);
}
} else {
ret = fn(_context);
}
if (isNumber$2(ret) && ret === NOT_REOSLVED) {
const [key, arg2] = argumentParser();
return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key);
} else if (successCondition(ret)) {
return ret;
} else {
throw createI18nError(14);
}
}
function t(...args) {
return wrapWithDeps((context) => translate(context, ...args), () => parseTranslateArgs(...args), "translate", (root) => root.t(...args), (key) => key, (val) => isString$1(val));
}
function rt(...args) {
const [arg1, arg2, arg3] = args;
2022-12-30 08:13:19 +00:00
if (arg3 && !isObject$4(arg3)) {
2022-11-15 01:16:55 +00:00
throw createI18nError(15);
}
return t(...[arg1, arg2, assign$1({ resolvedMessage: true }, arg3 || {})]);
}
function d(...args) {
return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root.d(...args), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
}
function n(...args) {
return wrapWithDeps((context) => number$1(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root.n(...args), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val));
}
function normalize(values) {
return values.map((val) => isString$1(val) ? createVNode(Text, null, val, 0) : val);
}
const interpolate = (val) => val;
const processor = {
normalize,
interpolate,
type: "vnode"
};
function transrateVNode(...args) {
return wrapWithDeps((context) => {
let ret;
const _context2 = context;
try {
_context2.processor = processor;
ret = translate(_context2, ...args);
} finally {
_context2.processor = null;
}
return ret;
}, () => parseTranslateArgs(...args), "translate", (root) => root[TransrateVNodeSymbol](...args), (key) => [createVNode(Text, null, key, 0)], (val) => isArray$1(val));
}
function numberParts(...args) {
return wrapWithDeps((context) => number$1(context, ...args), () => parseNumberArgs(...args), "number format", (root) => root[NumberPartsSymbol](...args), () => [], (val) => isString$1(val) || isArray$1(val));
}
function datetimeParts(...args) {
return wrapWithDeps((context) => datetime(context, ...args), () => parseDateTimeArgs(...args), "datetime format", (root) => root[DatetimePartsSymbol](...args), () => [], (val) => isString$1(val) || isArray$1(val));
}
function setPluralRules(rules2) {
_pluralRules = rules2;
_context.pluralRules = _pluralRules;
}
function te(key, locale2) {
const targetLocale = isString$1(locale2) ? locale2 : _locale.value;
const message = getLocaleMessage(targetLocale);
return resolveValue(message, key) !== null;
}
function resolveMessages(key) {
let messages3 = null;
const locales = getLocaleChain(_context, _fallbackLocale.value, _locale.value);
for (let i = 0; i < locales.length; i++) {
const targetLocaleMessages = _messages.value[locales[i]] || {};
const messageValue = resolveValue(targetLocaleMessages, key);
if (messageValue != null) {
messages3 = messageValue;
break;
}
}
return messages3;
}
function tm(key) {
const messages3 = resolveMessages(key);
return messages3 != null ? messages3 : __root ? __root.tm(key) || {} : {};
}
function getLocaleMessage(locale2) {
return _messages.value[locale2] || {};
}
function setLocaleMessage(locale2, message) {
_messages.value[locale2] = message;
_context.messages = _messages.value;
}
function mergeLocaleMessage(locale2, message) {
_messages.value[locale2] = _messages.value[locale2] || {};
deepCopy(message, _messages.value[locale2]);
_context.messages = _messages.value;
}
function getDateTimeFormat(locale2) {
return _datetimeFormats.value[locale2] || {};
}
function setDateTimeFormat(locale2, format2) {
_datetimeFormats.value[locale2] = format2;
_context.datetimeFormats = _datetimeFormats.value;
clearDateTimeFormat(_context, locale2, format2);
}
function mergeDateTimeFormat(locale2, format2) {
_datetimeFormats.value[locale2] = assign$1(_datetimeFormats.value[locale2] || {}, format2);
_context.datetimeFormats = _datetimeFormats.value;
clearDateTimeFormat(_context, locale2, format2);
}
function getNumberFormat(locale2) {
return _numberFormats.value[locale2] || {};
}
function setNumberFormat(locale2, format2) {
_numberFormats.value[locale2] = format2;
_context.numberFormats = _numberFormats.value;
clearNumberFormat(_context, locale2, format2);
}
function mergeNumberFormat(locale2, format2) {
_numberFormats.value[locale2] = assign$1(_numberFormats.value[locale2] || {}, format2);
_context.numberFormats = _numberFormats.value;
clearNumberFormat(_context, locale2, format2);
}
composerID++;
if (__root) {
watch(__root.locale, (val) => {
if (_inheritLocale) {
_locale.value = val;
_context.locale = val;
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
}
});
watch(__root.fallbackLocale, (val) => {
if (_inheritLocale) {
_fallbackLocale.value = val;
_context.fallbackLocale = val;
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
}
});
}
const composer = {
id: composerID,
locale,
fallbackLocale,
get inheritLocale() {
return _inheritLocale;
},
set inheritLocale(val) {
_inheritLocale = val;
if (val && __root) {
_locale.value = __root.locale.value;
_fallbackLocale.value = __root.fallbackLocale.value;
updateFallbackLocale(_context, _locale.value, _fallbackLocale.value);
}
},
get availableLocales() {
return Object.keys(_messages.value).sort();
},
messages: messages2,
datetimeFormats,
numberFormats,
get modifiers() {
return _modifiers;
},
get pluralRules() {
return _pluralRules || {};
},
get isGlobal() {
return _isGlobal;
},
get missingWarn() {
return _missingWarn;
},
set missingWarn(val) {
_missingWarn = val;
_context.missingWarn = _missingWarn;
},
get fallbackWarn() {
return _fallbackWarn;
},
set fallbackWarn(val) {
_fallbackWarn = val;
_context.fallbackWarn = _fallbackWarn;
},
get fallbackRoot() {
return _fallbackRoot;
},
set fallbackRoot(val) {
_fallbackRoot = val;
},
get fallbackFormat() {
return _fallbackFormat;
},
set fallbackFormat(val) {
_fallbackFormat = val;
_context.fallbackFormat = _fallbackFormat;
},
get warnHtmlMessage() {
return _warnHtmlMessage;
},
set warnHtmlMessage(val) {
_warnHtmlMessage = val;
_context.warnHtmlMessage = val;
},
get escapeParameter() {
return _escapeParameter;
},
set escapeParameter(val) {
_escapeParameter = val;
_context.escapeParameter = val;
},
t,
rt,
d,
n,
te,
tm,
getLocaleMessage,
setLocaleMessage,
mergeLocaleMessage,
getDateTimeFormat,
setDateTimeFormat,
mergeDateTimeFormat,
getNumberFormat,
setNumberFormat,
mergeNumberFormat,
getPostTranslationHandler,
setPostTranslationHandler,
getMissingHandler,
setMissingHandler,
[TransrateVNodeSymbol]: transrateVNode,
[NumberPartsSymbol]: numberParts,
[DatetimePartsSymbol]: datetimeParts,
[SetPluralRulesSymbol]: setPluralRules,
[InejctWithOption]: options.__injectWithOption
};
return composer;
}
function convertComposerOptions(options) {
const locale = isString$1(options.locale) ? options.locale : "en-US";
const fallbackLocale = isString$1(options.fallbackLocale) || isArray$1(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale;
const missing = isFunction$3(options.missing) ? options.missing : void 0;
const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true;
const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true;
const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true;
const fallbackFormat = !!options.formatFallbackMessages;
const modifiers = isPlainObject$1(options.modifiers) ? options.modifiers : {};
const pluralizationRules = options.pluralizationRules;
const postTranslation = isFunction$3(options.postTranslation) ? options.postTranslation : void 0;
const warnHtmlMessage = isString$1(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true;
const escapeParameter = !!options.escapeParameterHtml;
const inheritLocale = isBoolean(options.sync) ? options.sync : true;
let messages2 = options.messages;
if (isPlainObject$1(options.sharedMessages)) {
const sharedMessages = options.sharedMessages;
const locales = Object.keys(sharedMessages);
messages2 = locales.reduce((messages3, locale2) => {
const message = messages3[locale2] || (messages3[locale2] = {});
assign$1(message, sharedMessages[locale2]);
return messages3;
}, messages2 || {});
}
const { __i18n, __root, __injectWithOption } = options;
const datetimeFormats = options.datetimeFormats;
const numberFormats = options.numberFormats;
const flatJson = options.flatJson;
return {
locale,
fallbackLocale,
messages: messages2,
flatJson,
datetimeFormats,
numberFormats,
missing,
missingWarn,
fallbackWarn,
fallbackRoot,
fallbackFormat,
modifiers,
pluralRules: pluralizationRules,
postTranslation,
warnHtmlMessage,
escapeParameter,
inheritLocale,
__i18n,
__root,
__injectWithOption
};
}
function createVueI18n(options = {}) {
const composer = createComposer(convertComposerOptions(options));
const vueI18n = {
id: composer.id,
get locale() {
return composer.locale.value;
},
set locale(val) {
composer.locale.value = val;
},
get fallbackLocale() {
return composer.fallbackLocale.value;
},
set fallbackLocale(val) {
composer.fallbackLocale.value = val;
},
get messages() {
return composer.messages.value;
},
get datetimeFormats() {
return composer.datetimeFormats.value;
},
get numberFormats() {
return composer.numberFormats.value;
},
get availableLocales() {
return composer.availableLocales;
},
get formatter() {
return {
interpolate() {
return [];
}
};
},
set formatter(val) {
},
get missing() {
return composer.getMissingHandler();
},
set missing(handler) {
composer.setMissingHandler(handler);
},
get silentTranslationWarn() {
return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn;
},
set silentTranslationWarn(val) {
composer.missingWarn = isBoolean(val) ? !val : val;
},
get silentFallbackWarn() {
return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn;
},
set silentFallbackWarn(val) {
composer.fallbackWarn = isBoolean(val) ? !val : val;
},
get modifiers() {
return composer.modifiers;
},
get formatFallbackMessages() {
return composer.fallbackFormat;
},
set formatFallbackMessages(val) {
composer.fallbackFormat = val;
},
get postTranslation() {
return composer.getPostTranslationHandler();
},
set postTranslation(handler) {
composer.setPostTranslationHandler(handler);
},
get sync() {
return composer.inheritLocale;
},
set sync(val) {
composer.inheritLocale = val;
},
get warnHtmlInMessage() {
return composer.warnHtmlMessage ? "warn" : "off";
},
set warnHtmlInMessage(val) {
composer.warnHtmlMessage = val !== "off";
},
get escapeParameterHtml() {
return composer.escapeParameter;
},
set escapeParameterHtml(val) {
composer.escapeParameter = val;
},
get preserveDirectiveContent() {
return true;
},
set preserveDirectiveContent(val) {
},
get pluralizationRules() {
return composer.pluralRules || {};
},
__composer: composer,
t(...args) {
const [arg1, arg2, arg3] = args;
const options2 = {};
let list = null;
let named = null;
if (!isString$1(arg1)) {
throw createI18nError(15);
}
const key = arg1;
if (isString$1(arg2)) {
options2.locale = arg2;
} else if (isArray$1(arg2)) {
list = arg2;
} else if (isPlainObject$1(arg2)) {
named = arg2;
}
if (isArray$1(arg3)) {
list = arg3;
} else if (isPlainObject$1(arg3)) {
named = arg3;
}
return composer.t(key, list || named || {}, options2);
},
rt(...args) {
return composer.rt(...args);
},
tc(...args) {
const [arg1, arg2, arg3] = args;
const options2 = { plural: 1 };
let list = null;
let named = null;
if (!isString$1(arg1)) {
throw createI18nError(15);
}
const key = arg1;
if (isString$1(arg2)) {
options2.locale = arg2;
} else if (isNumber$2(arg2)) {
options2.plural = arg2;
} else if (isArray$1(arg2)) {
list = arg2;
} else if (isPlainObject$1(arg2)) {
named = arg2;
}
if (isString$1(arg3)) {
options2.locale = arg3;
} else if (isArray$1(arg3)) {
list = arg3;
} else if (isPlainObject$1(arg3)) {
named = arg3;
}
return composer.t(key, list || named || {}, options2);
},
te(key, locale) {
return composer.te(key, locale);
},
tm(key) {
return composer.tm(key);
},
getLocaleMessage(locale) {
return composer.getLocaleMessage(locale);
},
setLocaleMessage(locale, message) {
composer.setLocaleMessage(locale, message);
},
mergeLocaleMessage(locale, message) {
composer.mergeLocaleMessage(locale, message);
},
d(...args) {
return composer.d(...args);
},
getDateTimeFormat(locale) {
return composer.getDateTimeFormat(locale);
},
setDateTimeFormat(locale, format2) {
composer.setDateTimeFormat(locale, format2);
},
mergeDateTimeFormat(locale, format2) {
composer.mergeDateTimeFormat(locale, format2);
},
n(...args) {
return composer.n(...args);
},
getNumberFormat(locale) {
return composer.getNumberFormat(locale);
},
setNumberFormat(locale, format2) {
composer.setNumberFormat(locale, format2);
},
mergeNumberFormat(locale, format2) {
composer.mergeNumberFormat(locale, format2);
},
getChoiceIndex(choice, choicesLength) {
return -1;
},
__onComponentInstanceCreated(target) {
const { componentInstanceCreatedListener } = options;
if (componentInstanceCreatedListener) {
componentInstanceCreatedListener(target, vueI18n);
}
}
};
return vueI18n;
}
const baseFormatProps = {
tag: {
type: [String, Object]
},
locale: {
type: String
},
scope: {
type: String,
validator: (val) => val === "parent" || val === "global",
default: "parent"
},
i18n: {
type: Object
}
};
const Translation = {
name: "i18n-t",
props: assign$1({
keypath: {
type: String,
required: true
},
plural: {
type: [Number, String],
validator: (val) => isNumber$2(val) || !isNaN(val)
}
}, baseFormatProps),
setup(props, context) {
const { slots, attrs } = context;
const i18n2 = props.i18n || useI18n$1({
useScope: props.scope,
__useComponent: true
});
const keys = Object.keys(slots).filter((key) => key !== "_");
return () => {
const options = {};
if (props.locale) {
options.locale = props.locale;
}
if (props.plural !== void 0) {
options.plural = isString$1(props.plural) ? +props.plural : props.plural;
}
const arg = getInterpolateArg(context, keys);
const children = i18n2[TransrateVNodeSymbol](props.keypath, arg, options);
const assignedAttrs = assign$1({}, attrs);
2022-12-30 08:13:19 +00:00
return isString$1(props.tag) ? h(props.tag, assignedAttrs, children) : isObject$4(props.tag) ? h(props.tag, assignedAttrs, children) : h(Fragment, assignedAttrs, children);
2022-11-15 01:16:55 +00:00
};
}
};
function getInterpolateArg({ slots }, keys) {
if (keys.length === 1 && keys[0] === "default") {
return slots.default ? slots.default() : [];
} else {
return keys.reduce((arg, key) => {
const slot = slots[key];
if (slot) {
arg[key] = slot();
}
return arg;
}, {});
}
}
function renderFormatter(props, context, slotKeys, partFormatter) {
const { slots, attrs } = context;
return () => {
const options = { part: true };
let overrides = {};
if (props.locale) {
options.locale = props.locale;
}
if (isString$1(props.format)) {
options.key = props.format;
2022-12-30 08:13:19 +00:00
} else if (isObject$4(props.format)) {
2022-11-15 01:16:55 +00:00
if (isString$1(props.format.key)) {
options.key = props.format.key;
}
overrides = Object.keys(props.format).reduce((options2, prop) => {
return slotKeys.includes(prop) ? assign$1({}, options2, { [prop]: props.format[prop] }) : options2;
}, {});
}
const parts = partFormatter(...[props.value, options, overrides]);
let children = [options.key];
if (isArray$1(parts)) {
children = parts.map((part, index2) => {
const slot = slots[part.type];
return slot ? slot({ [part.type]: part.value, index: index2, parts }) : [part.value];
});
} else if (isString$1(parts)) {
children = [parts];
}
const assignedAttrs = assign$1({}, attrs);
2022-12-30 08:13:19 +00:00
return isString$1(props.tag) ? h(props.tag, assignedAttrs, children) : isObject$4(props.tag) ? h(props.tag, assignedAttrs, children) : h(Fragment, assignedAttrs, children);
2022-11-15 01:16:55 +00:00
};
}
const NUMBER_FORMAT_KEYS = [
"localeMatcher",
"style",
"unit",
"unitDisplay",
"currency",
"currencyDisplay",
"useGrouping",
"numberingSystem",
"minimumIntegerDigits",
"minimumFractionDigits",
"maximumFractionDigits",
"minimumSignificantDigits",
"maximumSignificantDigits",
"notation",
"formatMatcher"
];
const NumberFormat = {
name: "i18n-n",
props: assign$1({
value: {
type: Number,
required: true
},
format: {
type: [String, Object]
}
}, baseFormatProps),
setup(props, context) {
const i18n2 = props.i18n || useI18n$1({ useScope: "parent", __useComponent: true });
return renderFormatter(props, context, NUMBER_FORMAT_KEYS, (...args) => i18n2[NumberPartsSymbol](...args));
}
};
const DATETIME_FORMAT_KEYS = [
"dateStyle",
"timeStyle",
"fractionalSecondDigits",
"calendar",
"dayPeriod",
"numberingSystem",
"localeMatcher",
"timeZone",
"hour12",
"hourCycle",
"formatMatcher",
"weekday",
"era",
"year",
"month",
"day",
"hour",
"minute",
"second",
"timeZoneName"
];
const DatetimeFormat = {
name: "i18n-d",
props: assign$1({
value: {
type: [Number, Date],
required: true
},
format: {
type: [String, Object]
}
}, baseFormatProps),
setup(props, context) {
const i18n2 = props.i18n || useI18n$1({ useScope: "parent", __useComponent: true });
return renderFormatter(props, context, DATETIME_FORMAT_KEYS, (...args) => i18n2[DatetimePartsSymbol](...args));
}
};
function getComposer$2(i18n2, instance) {
const i18nInternal = i18n2;
if (i18n2.mode === "composition") {
return i18nInternal.__getInstance(instance) || i18n2.global;
} else {
const vueI18n = i18nInternal.__getInstance(instance);
return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer;
}
}
function vTDirective(i18n2) {
const bind2 = (el, { instance, value, modifiers }) => {
if (!instance || !instance.$) {
throw createI18nError(22);
}
const composer = getComposer$2(i18n2, instance.$);
const parsedValue = parseValue(value);
el.textContent = composer.t(...makeParams(parsedValue));
};
return {
beforeMount: bind2,
beforeUpdate: bind2
};
}
function parseValue(value) {
if (isString$1(value)) {
return { path: value };
} else if (isPlainObject$1(value)) {
if (!("path" in value)) {
throw createI18nError(19, "path");
}
return value;
} else {
throw createI18nError(20);
}
}
function makeParams(value) {
const { path, locale, args, choice, plural } = value;
const options = {};
const named = args || {};
if (isString$1(locale)) {
options.locale = locale;
}
if (isNumber$2(choice)) {
options.plural = choice;
}
if (isNumber$2(plural)) {
options.plural = plural;
}
return [path, named, options];
}
function apply(app, i18n2, ...options) {
const pluginOptions = isPlainObject$1(options[0]) ? options[0] : {};
const useI18nComponentName = !!pluginOptions.useI18nComponentName;
const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true;
if (globalInstall) {
app.component(!useI18nComponentName ? Translation.name : "i18n", Translation);
app.component(NumberFormat.name, NumberFormat);
app.component(DatetimeFormat.name, DatetimeFormat);
}
app.directive("t", vTDirective(i18n2));
}
function defineMixin(vuei18n, composer, i18n2) {
return {
beforeCreate() {
const instance = getCurrentInstance();
if (!instance) {
throw createI18nError(22);
}
const options = this.$options;
if (options.i18n) {
const optionsI18n = options.i18n;
if (options.__i18n) {
optionsI18n.__i18n = options.__i18n;
}
optionsI18n.__root = composer;
if (this === this.$root) {
this.$i18n = mergeToRoot(vuei18n, optionsI18n);
} else {
optionsI18n.__injectWithOption = true;
this.$i18n = createVueI18n(optionsI18n);
}
} else if (options.__i18n) {
if (this === this.$root) {
this.$i18n = mergeToRoot(vuei18n, options);
} else {
this.$i18n = createVueI18n({
__i18n: options.__i18n,
__injectWithOption: true,
__root: composer
});
}
} else {
this.$i18n = vuei18n;
}
vuei18n.__onComponentInstanceCreated(this.$i18n);
i18n2.__setInstance(instance, this.$i18n);
this.$t = (...args) => this.$i18n.t(...args);
this.$rt = (...args) => this.$i18n.rt(...args);
this.$tc = (...args) => this.$i18n.tc(...args);
this.$te = (key, locale) => this.$i18n.te(key, locale);
this.$d = (...args) => this.$i18n.d(...args);
this.$n = (...args) => this.$i18n.n(...args);
this.$tm = (key) => this.$i18n.tm(key);
},
mounted() {
},
beforeUnmount() {
const instance = getCurrentInstance();
if (!instance) {
throw createI18nError(22);
}
delete this.$t;
delete this.$rt;
delete this.$tc;
delete this.$te;
delete this.$d;
delete this.$n;
delete this.$tm;
i18n2.__deleteInstance(instance);
delete this.$i18n;
}
};
}
function mergeToRoot(root, options) {
root.locale = options.locale || root.locale;
root.fallbackLocale = options.fallbackLocale || root.fallbackLocale;
root.missing = options.missing || root.missing;
root.silentTranslationWarn = options.silentTranslationWarn || root.silentFallbackWarn;
root.silentFallbackWarn = options.silentFallbackWarn || root.silentFallbackWarn;
root.formatFallbackMessages = options.formatFallbackMessages || root.formatFallbackMessages;
root.postTranslation = options.postTranslation || root.postTranslation;
root.warnHtmlInMessage = options.warnHtmlInMessage || root.warnHtmlInMessage;
root.escapeParameterHtml = options.escapeParameterHtml || root.escapeParameterHtml;
root.sync = options.sync || root.sync;
root.__composer[SetPluralRulesSymbol](options.pluralizationRules || root.pluralizationRules);
const messages2 = getLocaleMessages(root.locale, {
messages: options.messages,
__i18n: options.__i18n
});
Object.keys(messages2).forEach((locale) => root.mergeLocaleMessage(locale, messages2[locale]));
if (options.datetimeFormats) {
Object.keys(options.datetimeFormats).forEach((locale) => root.mergeDateTimeFormat(locale, options.datetimeFormats[locale]));
}
if (options.numberFormats) {
Object.keys(options.numberFormats).forEach((locale) => root.mergeNumberFormat(locale, options.numberFormats[locale]));
}
return root;
}
function createI18n(options = {}) {
const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__;
const __globalInjection = !!options.globalInjection;
const __instances = /* @__PURE__ */ new Map();
const __global = __VUE_I18N_LEGACY_API__ && __legacyMode ? createVueI18n(options) : createComposer(options);
const symbol = makeSymbol("");
const i18n2 = {
get mode() {
return __VUE_I18N_LEGACY_API__ ? __legacyMode ? "legacy" : "composition" : "composition";
},
async install(app, ...options2) {
app.__VUE_I18N_SYMBOL__ = symbol;
app.provide(app.__VUE_I18N_SYMBOL__, i18n2);
if (!__legacyMode && __globalInjection) {
injectGlobalFields(app, i18n2.global);
}
if (__VUE_I18N_FULL_INSTALL__) {
apply(app, i18n2, ...options2);
}
if (__VUE_I18N_LEGACY_API__ && __legacyMode) {
app.mixin(defineMixin(__global, __global.__composer, i18n2));
}
},
get global() {
return __global;
},
__instances,
__getInstance(component2) {
return __instances.get(component2) || null;
},
__setInstance(component2, instance) {
__instances.set(component2, instance);
},
__deleteInstance(component2) {
__instances.delete(component2);
}
};
return i18n2;
}
function useI18n$1(options = {}) {
const instance = getCurrentInstance();
if (instance == null) {
throw createI18nError(16);
}
if (!instance.appContext.app.__VUE_I18N_SYMBOL__) {
throw createI18nError(17);
}
const i18n2 = inject(instance.appContext.app.__VUE_I18N_SYMBOL__);
if (!i18n2) {
throw createI18nError(22);
}
const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer;
const scope = isEmptyObject(options) ? "__i18n" in instance.type ? "local" : "global" : !options.useScope ? "local" : options.useScope;
if (scope === "global") {
2022-12-30 08:13:19 +00:00
let messages2 = isObject$4(options.messages) ? options.messages : {};
2022-11-15 01:16:55 +00:00
if ("__i18nGlobal" in instance.type) {
messages2 = getLocaleMessages(global2.locale.value, {
messages: messages2,
__i18n: instance.type.__i18nGlobal
});
}
const locales = Object.keys(messages2);
if (locales.length) {
locales.forEach((locale) => {
global2.mergeLocaleMessage(locale, messages2[locale]);
});
}
2022-12-30 08:13:19 +00:00
if (isObject$4(options.datetimeFormats)) {
2022-11-15 01:16:55 +00:00
const locales2 = Object.keys(options.datetimeFormats);
if (locales2.length) {
locales2.forEach((locale) => {
global2.mergeDateTimeFormat(locale, options.datetimeFormats[locale]);
});
}
}
2022-12-30 08:13:19 +00:00
if (isObject$4(options.numberFormats)) {
2022-11-15 01:16:55 +00:00
const locales2 = Object.keys(options.numberFormats);
if (locales2.length) {
locales2.forEach((locale) => {
global2.mergeNumberFormat(locale, options.numberFormats[locale]);
});
}
}
return global2;
}
if (scope === "parent") {
let composer2 = getComposer(i18n2, instance, options.__useComponent);
if (composer2 == null) {
composer2 = global2;
}
return composer2;
}
if (i18n2.mode === "legacy") {
throw createI18nError(18);
}
const i18nInternal = i18n2;
let composer = i18nInternal.__getInstance(instance);
if (composer == null) {
const type4 = instance.type;
const composerOptions = assign$1({}, options);
if (type4.__i18n) {
composerOptions.__i18n = type4.__i18n;
}
if (global2) {
composerOptions.__root = global2;
}
composer = createComposer(composerOptions);
setupLifeCycle(i18nInternal, instance);
i18nInternal.__setInstance(instance, composer);
}
return composer;
}
function getComposer(i18n2, target, useComponent = false) {
let composer = null;
const root = target.root;
let current = target.parent;
while (current != null) {
const i18nInternal = i18n2;
if (i18n2.mode === "composition") {
composer = i18nInternal.__getInstance(current);
} else {
const vueI18n = i18nInternal.__getInstance(current);
if (vueI18n != null) {
composer = vueI18n.__composer;
}
if (useComponent && composer && !composer[InejctWithOption]) {
composer = null;
}
}
if (composer != null) {
break;
}
if (root === current) {
break;
}
current = current.parent;
}
return composer;
}
function setupLifeCycle(i18n2, target, composer) {
onMounted(() => {
}, target);
onUnmounted(() => {
i18n2.__deleteInstance(target);
}, target);
}
const globalExportProps = [
"locale",
"fallbackLocale",
"availableLocales"
];
const globalExportMethods = ["t", "rt", "d", "n", "tm"];
function injectGlobalFields(app, composer) {
const i18n2 = /* @__PURE__ */ Object.create(null);
globalExportProps.forEach((prop) => {
const desc = Object.getOwnPropertyDescriptor(composer, prop);
if (!desc) {
throw createI18nError(22);
}
const wrap = isRef(desc.value) ? {
get() {
return desc.value.value;
},
set(val) {
desc.value.value = val;
}
} : {
get() {
return desc.get && desc.get();
}
};
Object.defineProperty(i18n2, prop, wrap);
});
app.config.globalProperties.$i18n = i18n2;
globalExportMethods.forEach((method4) => {
const desc = Object.getOwnPropertyDescriptor(composer, method4);
if (!desc || !desc.value) {
throw createI18nError(22);
}
Object.defineProperty(app.config.globalProperties, `$${method4}`, desc);
});
}
registerMessageCompiler(compileToFunction);
{
initFeatureFlags();
}
if (__INTLIFY_PROD_DEVTOOLS__) {
const target = getGlobalThis();
target.__INTLIFY__ = true;
setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__);
}
var zh_CN = {
input: {
placeholder: "\u8BF7\u8F93\u5165"
},
page: {
previous: "\u4E0A\u4E00\u9875",
next: "\u4E0B\u4E00\u9875",
goTo: "\u5230\u7B2C",
confirm: "\u786E\u8BA4",
page: "\u9875",
item: "\u6761",
total: "\u5171"
},
datePicker: {
year: "\u5E74",
month: "\u6708",
sunday: "\u65E5",
monday: "\u4E00",
tuesday: "\u4E8C",
wednesday: "\u4E09",
thursday: "\u56DB",
friday: "\u4E94",
saturday: "\u516D",
january: "1\u6708",
february: "2\u6708",
march: "3\u6708",
april: "4\u6708",
may: "5\u6708",
june: "6\u6708",
july: "7\u6708",
august: "8\u6708",
september: "9\u6708",
october: "10\u6708",
november: "11\u6708",
december: "12\u6708",
selectDate: "\u9009\u62E9\u65E5\u671F",
selectTime: "\u9009\u62E9\u65F6\u95F4",
selectYear: "\u9009\u62E9\u5E74\u4EFD",
selectMonth: "\u9009\u62E9\u6708\u4EFD",
clear: "\u6E05\u7A7A",
confirm: "\u786E\u8BA4",
cancel: "\u53D6\u6D88",
now: "\u73B0\u5728"
},
empty: {
description: "\u65E0\u6570\u636E"
},
upload: {
text: "\u4E0A\u4F20\u6587\u4EF6",
dragText: "\u70B9\u51FB\u4E0A\u4F20\uFF0C\u6216\u5C06\u6587\u4EF6\u62D6\u62FD\u5230\u6B64\u5904",
defaultErrorMsg: "\u4E0A\u4F20\u5931\u8D25",
urlErrorMsg: "\u4E0A\u4F20\u5730\u5740\u683C\u5F0F\u4E0D\u5408\u6CD5",
numberErrorMsg: "\u6587\u4EF6\u4E0A\u4F20\u8D85\u8FC7\u89C4\u5B9A\u7684\u4E2A\u6570",
cutInitErrorMsg: "\u526A\u88C1\u63D2\u4EF6\u521D\u59CB\u5316\u5931\u8D25",
uploadSuccess: "\u4E0A\u4F20\u6210\u529F",
cannotSupportCutMsg: "\u5F53\u524D\u7248\u672C\u6682\u4E0D\u652F\u6301\u5355\u6B21\u591A\u6587\u4EF6\u526A\u88C1,\u5C1D\u8BD5\u8BBE\u7F6E multiple \u4E3A false, \u901A\u8FC7 @done \u83B7\u53D6\u8FD4\u56DE\u6587\u4EF6\u5BF9\u8C61",
occurFileSizeErrorMsg: "\u6587\u4EF6\u5927\u5C0F\u8D85\u8FC7\u9650\u5236,\u6587\u4EF6\u6700\u5927\u4E0D\u53EF\u8D85\u8FC7\u4F20\u5165\u7684\u6307\u5B9Asize\u5C5E\u6027\u7684KB\u6570",
startUploadMsg: "\u5F00\u59CB\u4E0A\u4F20",
confirmBtn: "\u786E\u8BA4",
cancelBtn: "\u53D6\u6D88",
title: "\u6807\u9898"
}
};
var en_US = {
input: {
placeholder: "please input"
},
page: {
previous: "previous",
next: "next",
goTo: "Go to",
confirm: "confirm",
page: "page",
item: "item",
total: "total"
},
datePicker: {
year: "",
month: "month",
sunday: "SU",
monday: "MO",
tuesday: "TU",
wednesday: "WE",
thursday: "TH",
friday: "FR",
saturday: "SA",
january: "January",
february: "February",
march: "March",
april: "April",
may: "May",
june: "June",
july: "July",
august: "August",
september: "September",
october: "October",
november: "November",
december: "December",
selectDate: "select date",
selectTime: "select time",
selectYear: "select year",
selectMonth: "select month",
clear: "clear",
confirm: "confirm",
cancel: "cancel",
now: "now"
},
empty: {
description: "No data"
},
upload: {
text: "Upload files",
dragText: "Click Upload or drag the file here",
defaultErrorMsg: "Upload failed",
urlErrorMsg: "The upload address format is illegal",
numberErrorMsg: "The number of files uploaded exceeds the specified number",
cutInitErrorMsg: "Clipping plug-in initialization failed",
uploadSuccess: "Upload succeeded",
cannotSupportCutMsg: "The current version does not support single multiple file clipping. Try to set multiple to false, and get the returned file object through @ done",
occurFileSizeErrorMsg: "File size warning,The maximum file size cannot exceed target KB",
startUploadMsg: "Upload Start",
confirmBtn: "confirm",
cancelBtn: "cancel",
title: "title"
}
};
const i18n = createI18n({
legacy: false,
locale: "zh_CN",
messages: {
zh_CN,
en_US
}
});
function useI18n() {
var _a2;
let i18nInstance;
const app = (_a2 = getCurrentInstance()) == null ? void 0 : _a2.appContext.app;
try {
i18nInstance = useI18n$1();
} catch (e) {
app == null ? void 0 : app.use(i18n);
i18nInstance = useI18n$1();
}
return i18nInstance;
}
const withInstall = (comp) => {
const component2 = comp;
component2.install = (app) => {
app.component(component2.name, comp);
};
return component2;
};
2022-12-30 08:13:19 +00:00
const isElement = (vn) => {
return Boolean(vn && vn.shapeFlag & 1);
};
const isComponent = (vn, type4) => {
return Boolean(vn && vn.shapeFlag & 6);
};
const isArrayChildren = (vn, children) => {
return Boolean(vn && vn.shapeFlag & 16);
};
function convertSlotName(vm, name) {
const camelCaseName = camelCase(name);
const kebabCaseName = kebabCase(name);
return vm.slots[camelCaseName] ? camelCaseName : vm.slots[kebabCaseName] ? kebabCaseName : name;
}
function camelCase(str) {
return str.replace(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
}
function kebabCase(key) {
const result = key.replace(/([A-Z])/g, " $1").trim();
return result.split(" ").join("-").toLowerCase();
}
2022-11-15 01:16:55 +00:00
var iconfont = [{
name: "\u5B9E\u5FC3",
class: "layui-icon-heart-fill"
}, {
name: "\u7A7A\u5FC3",
class: "layui-icon-heart"
}, {
name: "\u4EAE\u5EA6/\u6674",
class: "layui-icon-light"
}, {
name: "\u65F6\u95F4/\u5386\u53F2",
class: "layui-icon-time"
}, {
name: "\u84DD\u7259",
class: "layui-icon-bluetooth"
}, {
name: "@\u827E\u7279",
class: "layui-icon-at"
}, {
name: "\u9759\u97F3",
class: "layui-icon-mute"
}, {
name: "\u5F55\u97F3/\u9EA6\u514B\u98CE",
class: "layui-icon-mike"
}, {
name: "\u5BC6\u94A5/\u94A5\u5319",
class: "layui-icon-key"
}, {
name: "\u793C\u7269/\u6D3B\u52A8",
class: "layui-icon-gift"
}, {
name: "\u90AE\u7BB1",
class: "layui-icon-email"
}, {
name: "RSS",
class: "layui-icon-rss"
}, {
name: "WiFi",
class: "layui-icon-wifi"
}, {
name: "\u9000\u51FA/\u6CE8\u9500",
class: "layui-icon-logout"
}, {
name: "Android \u5B89\u5353",
class: "layui-icon-android"
}, {
name: "Apple IOS \u82F9\u679C",
class: "layui-icon-ios"
}, {
name: "Windows",
class: "layui-icon-windows"
}, {
name: "\u7A7F\u68AD\u6846",
class: "layui-icon-transfer"
}, {
name: "\u5BA2\u670D",
class: "layui-icon-service"
}, {
name: "\u51CF",
class: "layui-icon-subtraction"
}, {
name: "\u52A0",
class: "layui-icon-addition"
}, {
name: "\u6ED1\u5757",
class: "layui-icon-slider"
}, {
name: "\u6253\u5370",
class: "layui-icon-print"
}, {
name: "\u5BFC\u51FA",
class: "layui-icon-export"
}, {
name: "\u5217",
class: "layui-icon-cols"
}, {
name: "\u9000\u51FA\u5168\u5C4F",
class: "layui-icon-screen-restore"
}, {
name: "\u5168\u5C4F",
class: "layui-icon-screen-full"
}, {
name: "\u534A\u661F",
class: "layui-icon-rate-half"
}, {
name: "\u661F\u661F-\u7A7A\u5FC3",
class: "layui-icon-rate"
}, {
name: "\u661F\u661F-\u5B9E\u5FC3",
class: "layui-icon-rate-solid"
}, {
name: "\u624B\u673A",
class: "layui-icon-cellphone"
}, {
name: "\u9A8C\u8BC1\u7801",
class: "layui-icon-vercode"
}, {
name: "\u5FAE\u4FE1",
class: "layui-icon-login-wechat"
}, {
name: "QQ",
class: "layui-icon-login-qq"
}, {
name: "\u5FAE\u535A",
class: "layui-icon-login-weibo"
}, {
name: "\u5BC6\u7801",
class: "layui-icon-password"
}, {
name: "\u7528\u6237\u540D",
class: "layui-icon-username"
}, {
name: "\u5237\u65B0-\u7C97",
class: "layui-icon-refresh-three"
}, {
name: "\u6388\u6743",
class: "layui-icon-auz"
}, {
name: "\u5DE6\u5411\u53F3\u4F38\u7F29\u83DC\u5355",
class: "layui-icon-spread-left"
}, {
name: "\u53F3\u5411\u5DE6\u4F38\u7F29\u83DC\u5355",
class: "layui-icon-shrink-right"
}, {
name: "\u96EA\u82B1",
class: "layui-icon-snowflake"
}, {
name: "\u63D0\u793A\u8BF4\u660E",
class: "layui-icon-tips"
}, {
name: "\u4FBF\u7B7E",
class: "layui-icon-note"
}, {
name: "\u4E3B\u9875",
class: "layui-icon-home"
}, {
name: "\u9AD8\u7EA7",
class: "layui-icon-senior"
}, {
name: "\u5237\u65B0",
class: "layui-icon-refresh"
}, {
name: "\u5237\u65B0",
class: "layui-icon-refresh-one"
}, {
name: "\u65D7\u5E1C",
class: "layui-icon-flag"
}, {
name: "\u4E3B\u9898",
class: "layui-icon-theme"
}, {
name: "\u6D88\u606F-\u901A\u77E5",
class: "layui-icon-notice"
}, {
name: "\u7F51\u7AD9",
class: "layui-icon-website"
}, {
name: "\u63A7\u5236\u53F0",
class: "layui-icon-console"
}, {
name: "\u8868\u60C5-\u60CA\u8BB6",
class: "layui-icon-face-surprised"
}, {
name: "\u8BBE\u7F6E-\u7A7A\u5FC3",
class: "layui-icon-set"
}, {
name: "\u6A21\u677F",
class: "layui-icon-template-one"
}, {
name: "\u5E94\u7528",
class: "layui-icon-app"
}, {
name: "\u6A21\u677F",
class: "layui-icon-template"
}, {
name: "\u8D5E",
class: "layui-icon-praise"
}, {
name: "\u8E29",
class: "layui-icon-tread"
}, {
name: "\u7537",
class: "layui-icon-male"
}, {
name: "\u5973",
class: "layui-icon-female"
}, {
name: "\u76F8\u673A-\u7A7A\u5FC3",
class: "layui-icon-camera"
}, {
name: "\u76F8\u673A-\u5B9E\u5FC3",
class: "layui-icon-camera-fill"
}, {
name: "\u83DC\u5355-\u6C34\u5E73",
class: "layui-icon-more"
}, {
name: "\u83DC\u5355-\u5782\u76F4",
class: "layui-icon-more-vertical"
}, {
name: "\u91D1\u989D-\u4EBA\u6C11\u5E01",
class: "layui-icon-rmb"
}, {
name: "\u91D1\u989D-\u7F8E\u5143",
class: "layui-icon-dollar"
}, {
name: "\u94BB\u77F3-\u7B49\u7EA7",
class: "layui-icon-diamond"
}, {
name: "\u706B",
class: "layui-icon-fire"
}, {
name: "\u8FD4\u56DE",
class: "layui-icon-return"
}, {
name: "\u4F4D\u7F6E-\u5730\u56FE",
class: "layui-icon-location"
}, {
name: "\u529E\u516C-\u9605\u8BFB",
class: "layui-icon-read"
}, {
name: "\u8C03\u67E5",
class: "layui-icon-survey"
}, {
name: "\u8868\u60C5-\u5FAE\u7B11",
class: "layui-icon-face-smile"
}, {
name: "\u8868\u60C5-\u54ED\u6CE3",
class: "layui-icon-face-cry"
}, {
name: "\u8D2D\u7269\u8F66",
class: "layui-icon-cart-simple"
}, {
name: "\u8D2D\u7269\u8F66",
class: "layui-icon-cart"
}, {
name: "\u4E0B\u4E00\u9875",
class: "layui-icon-next"
}, {
name: "\u4E0A\u4E00\u9875",
class: "layui-icon-prev"
}, {
name: "\u4E0A\u4F20-\u7A7A\u5FC3-\u62D6\u62FD",
class: "layui-icon-upload-drag"
}, {
name: "\u4E0A\u4F20-\u5B9E\u5FC3",
class: "layui-icon-upload"
}, {
name: "\u4E0B\u8F7D-\u5706\u5708",
class: "layui-icon-download-circle"
}, {
name: "\u7EC4\u4EF6",
class: "layui-icon-component"
}, {
name: "\u6587\u4EF6-\u7C97",
class: "layui-icon-file-b"
}, {
name: "\u7528\u6237",
class: "layui-icon-user"
}, {
name: "\u53D1\u73B0-\u5B9E\u5FC3",
class: "layui-icon-find-fill"
}, {
name: "loading",
class: "layui-icon-loading"
}, {
name: "loading",
class: "layui-icon-loading-one"
}, {
name: "\u6DFB\u52A0",
class: "layui-icon-add-one"
}, {
name: "\u64AD\u653E",
class: "layui-icon-play"
}, {
name: "\u6682\u505C",
class: "layui-icon-pause"
}, {
name: "\u97F3\u9891-\u8033\u673A",
class: "layui-icon-headset"
}, {
name: "\u89C6\u9891",
class: "layui-icon-video"
}, {
name: "\u8BED\u97F3-\u58F0\u97F3",
class: "layui-icon-voice"
}, {
name: "\u6D88\u606F-\u901A\u77E5-\u5587\u53ED",
class: "layui-icon-speaker"
}, {
name: "\u5220\u9664\u7EBF",
class: "layui-icon-fonts-del"
}, {
name: "\u4EE3\u7801",
class: "layui-icon-fonts-code"
}, {
name: "HTML",
class: "layui-icon-fonts-html"
}, {
name: "\u5B57\u4F53\u52A0\u7C97",
class: "layui-icon-fonts-strong"
}, {
name: "\u5220\u9664\u94FE\u63A5",
class: "layui-icon-unlink"
}, {
name: "\u56FE\u7247",
class: "layui-icon-picture"
}, {
name: "\u94FE\u63A5",
class: "layui-icon-link"
}, {
name: "\u8868\u60C5-\u7B11-\u7C97",
class: "layui-icon-face-smile-b"
}, {
name: "\u5DE6\u5BF9\u9F50",
class: "layui-icon-align-left"
}, {
name: "\u53F3\u5BF9\u9F50",
class: "layui-icon-align-right"
}, {
name: "\u5C45\u4E2D\u5BF9\u9F50",
class: "layui-icon-align-center"
}, {
name: "\u5B57\u4F53-\u4E0B\u5212\u7EBF",
class: "layui-icon-fonts-u"
}, {
name: "\u5B57\u4F53-\u659C\u4F53",
class: "layui-icon-fonts-i"
}, {
name: "Tabs \u9009\u9879\u5361",
class: "layui-icon-tabs"
}, {
name: "\u5355\u9009\u6846-\u9009\u4E2D",
class: "layui-icon-radio"
}, {
name: "\u5355\u9009\u6846-\u5019\u9009",
class: "layui-icon-circle"
}, {
name: "\u7F16\u8F91",
class: "layui-icon-edit"
}, {
name: "\u5206\u4EAB",
class: "layui-icon-share"
}, {
name: "\u5220\u9664",
class: "layui-icon-delete"
}, {
name: "\u8868\u5355",
class: "layui-icon-form"
}, {
name: "\u624B\u673A-\u7EC6\u4F53",
class: "layui-icon-cellphone-fine"
}, {
name: "\u804A\u5929 \u5BF9\u8BDD \u6C9F\u901A",
class: "layui-icon-dialogue"
}, {
name: "\u6587\u5B57\u683C\u5F0F\u5316",
class: "layui-icon-fonts-clear"
}, {
name: "\u7A97\u53E3",
class: "layui-icon-layer"
}, {
name: "\u65E5\u671F",
class: "layui-icon-date"
}, {
name: "\u6C34 \u4E0B\u96E8",
class: "layui-icon-water"
}, {
name: "\u4EE3\u7801-\u5706\u5708",
class: "layui-icon-code-circle"
}, {
name: "\u8F6E\u64AD\u7EC4\u56FE",
class: "layui-icon-carousel"
}, {
name: "\u7FFB\u9875",
class: "layui-icon-prev-circle"
}, {
name: "\u5E03\u5C40",
class: "layui-icon-layouts"
}, {
name: "\u5DE5\u5177",
class: "layui-icon-util"
}, {
name: "\u9009\u62E9\u6A21\u677F",
class: "layui-icon-templeate-one"
}, {
name: "\u4E0A\u4F20-\u5706\u5708",
class: "layui-icon-upload-circle"
}, {
name: "\u6811",
class: "layui-icon-tree"
}, {
name: "\u8868\u683C",
class: "layui-icon-table"
}, {
name: "\u56FE\u8868",
class: "layui-icon-chart"
}, {
name: "\u56FE\u6807 \u62A5\u8868 \u5C4F\u5E55",
class: "layui-icon-chart-screen"
}, {
name: "\u5F15\u64CE",
class: "layui-icon-engine"
}, {
name: "\u4E0B\u4E09\u89D2",
class: "layui-icon-triangle-d"
}, {
name: "\u53F3\u4E09\u89D2",
class: "layui-icon-triangle-r"
}, {
name: "\u6587\u4EF6",
class: "layui-icon-file"
}, {
name: "\u8BBE\u7F6E-\u5C0F\u578B",
class: "layui-icon-set-sm"
}, {
name: "\u51CF\u5C11-\u5706\u5708",
class: "layui-icon-reduce-circle"
}, {
name: "\u6DFB\u52A0-\u5706\u5708",
class: "layui-icon-add-circle"
}, {
name: "404",
class: "layui-icon-not-found"
}, {
name: "\u5173\u4E8E",
class: "layui-icon-about"
}, {
name: "\u7BAD\u5934 \u5411\u4E0A",
class: "layui-icon-up"
}, {
name: "\u7BAD\u5934 \u5411\u4E0B",
class: "layui-icon-down"
}, {
name: "\u7BAD\u5934 \u5411\u5DE6",
class: "layui-icon-left"
}, {
name: "\u7BAD\u5934 \u5411\u53F3",
class: "layui-icon-right"
}, {
name: "\u5706\u70B9",
class: "layui-icon-circle-dot"
}, {
name: "\u641C\u7D22",
class: "layui-icon-search"
}, {
name: "\u8BBE\u7F6E-\u5B9E\u5FC3",
class: "layui-icon-set-fill"
}, {
name: "\u7FA4\u7EC4",
class: "layui-icon-group"
}, {
name: "\u597D\u53CB",
class: "layui-icon-friends"
}, {
name: "\u56DE\u590D \u8BC4\u8BBA \u5B9E\u5FC3",
class: "layui-icon-reply-fill"
}, {
name: "\u83DC\u5355 \u9690\u8EAB \u5B9E\u5FC3",
class: "layui-icon-menu-fill"
}, {
name: "\u8BB0\u5F55",
class: "layui-icon-log"
}, {
name: "\u56FE\u7247-\u7EC6\u4F53",
class: "layui-icon-picture-fine"
}, {
name: "\u8868\u60C5-\u7B11-\u7EC6\u4F53",
class: "layui-icon-face-smile-fine"
}, {
name: "\u5217\u8868",
class: "layui-icon-list"
}, {
name: "\u53D1\u5E03 \u7EB8\u98DE\u673A",
class: "layui-icon-release"
}, {
name: "\u5BF9 OK",
class: "layui-icon-ok"
}, {
name: "\u5E2E\u52A9",
class: "layui-icon-help"
}, {
name: "\u5BA2\u670D",
class: "layui-icon-chat"
}, {
name: "top \u7F6E\u9876",
class: "layui-icon-top"
}, {
name: "\u6536\u85CF-\u7A7A\u5FC3",
class: "layui-icon-star"
}, {
name: "\u6536\u85CF-\u5B9E\u5FC3",
class: "layui-icon-star-fill"
}, {
name: "\u5173\u95ED-\u5B9E\u5FC3",
class: "layui-icon-close-fill"
}, {
name: "\u5173\u95ED-\u7A7A\u5FC3",
class: "layui-icon-close"
}, {
name: "\u6B63\u786E",
class: "layui-icon-ok-circle"
}, {
name: "\u6DFB\u52A0-\u5706\u5708-\u7EC6\u4F53",
class: "layui-icon-add-circle-fine"
}];
function ownKeys$1(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
enumerableOnly && (symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2$1(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys$1(Object(source), true).forEach(function(key) {
_defineProperty$1(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
function _defineProperty$1(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
var __default__$2E = {
name: "LayIcon"
};
var _sfc_main$2E = defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2E), {}, {
props: {
size: null,
type: null,
color: null,
prefix: {
default: "layui-icon"
}
},
setup: function setup8(__props) {
var props = __props;
var styles = computed$1(function() {
return {
color: props.color,
fontSize: props.size
};
});
computed$1(function() {
return {
type: props.type,
prefix: props.prefix
};
});
return function(_ctx, _cache) {
return openBlock(), createElementBlock("i", {
class: normalizeClass([__props.prefix, __props.type]),
style: normalizeStyle(unref(styles))
}, null, 6);
};
}
}));
var __default__$2D = {
name: "HeartFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2D), {}, {
props: {
color: null,
size: null
},
setup: function setup22(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-heart-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2C = {
name: "HeartIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2C), {}, {
props: {
color: null,
size: null
},
setup: function setup32(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-heart"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2B = {
name: "LightIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2B), {}, {
props: {
color: null,
size: null
},
setup: function setup42(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-light"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2A = {
name: "TimeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2A), {}, {
props: {
color: null,
size: null
},
setup: function setup52(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-time"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2z = {
name: "BluetoothIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2z), {}, {
props: {
color: null,
size: null
},
setup: function setup62(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-bluetooth"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2y = {
name: "AtIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2y), {}, {
props: {
color: null,
size: null
},
setup: function setup72(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-at"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2x = {
name: "MuteIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2x), {}, {
props: {
color: null,
size: null
},
setup: function setup82(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-mute"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2w = {
name: "MikeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2w), {}, {
props: {
color: null,
size: null
},
setup: function setup9(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-mike"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2v = {
name: "KeyIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2v), {}, {
props: {
color: null,
size: null
},
setup: function setup10(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-key"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2u = {
name: "GiftIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2u), {}, {
props: {
color: null,
size: null
},
setup: function setup11(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-gift"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2t = {
name: "EmailIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2t), {}, {
props: {
color: null,
size: null
},
setup: function setup12(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-email"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2s = {
name: "RssIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2s), {}, {
props: {
color: null,
size: null
},
setup: function setup13(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-rss"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2r = {
name: "WifiIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2r), {}, {
props: {
color: null,
size: null
},
setup: function setup14(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-wifi"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2q = {
name: "LogoutIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2q), {}, {
props: {
color: null,
size: null
},
setup: function setup15(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-logout"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2p = {
name: "AndroidIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2p), {}, {
props: {
color: null,
size: null
},
setup: function setup16(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-android"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2o = {
name: "IosIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2o), {}, {
props: {
color: null,
size: null
},
setup: function setup17(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-ios"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2n = {
name: "WindowsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2n), {}, {
props: {
color: null,
size: null
},
setup: function setup18(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-windows"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2m = {
name: "TransferIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2m), {}, {
props: {
color: null,
size: null
},
setup: function setup19(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-transfer"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2l = {
name: "ServiceIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2l), {}, {
props: {
color: null,
size: null
},
setup: function setup20(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-service"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2k = {
name: "SubtractionIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2k), {}, {
props: {
color: null,
size: null
},
setup: function setup21(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-subtraction"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2j = {
name: "AdditionIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2j), {}, {
props: {
color: null,
size: null
},
setup: function setup222(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-addition"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2i = {
name: "SliderIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2i), {}, {
props: {
color: null,
size: null
},
setup: function setup23(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-slider"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2h = {
name: "PrintIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2h), {}, {
props: {
color: null,
size: null
},
setup: function setup24(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-print"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2g = {
name: "ExportIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2g), {}, {
props: {
color: null,
size: null
},
setup: function setup25(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-export"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2f = {
name: "ColsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2f), {}, {
props: {
color: null,
size: null
},
setup: function setup26(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-cols"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2e = {
name: "ScreenRestoreIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2e), {}, {
props: {
color: null,
size: null
},
setup: function setup27(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-screen-restore"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2d = {
name: "ScreenFullIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2d), {}, {
props: {
color: null,
size: null
},
setup: function setup28(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-screen-full"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2c = {
name: "RateHalfIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2c), {}, {
props: {
color: null,
size: null
},
setup: function setup29(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-rate-half"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2b = {
name: "RateIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2b), {}, {
props: {
color: null,
size: null
},
setup: function setup30(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-rate"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2a = {
name: "RateSolidIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2a), {}, {
props: {
color: null,
size: null
},
setup: function setup31(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-rate-solid"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$29 = {
name: "CellphoneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$29), {}, {
props: {
color: null,
size: null
},
setup: function setup322(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-cellphone"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$28 = {
name: "VercodeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$28), {}, {
props: {
color: null,
size: null
},
setup: function setup33(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-vercode"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$27 = {
name: "LoginWechatIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$27), {}, {
props: {
color: null,
size: null
},
setup: function setup34(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-login-wechat"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$26 = {
name: "LoginQqIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$26), {}, {
props: {
color: null,
size: null
},
setup: function setup35(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-login-qq"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$25 = {
name: "LoginWeiboIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$25), {}, {
props: {
color: null,
size: null
},
setup: function setup36(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-login-weibo"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$24 = {
name: "PasswordIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$24), {}, {
props: {
color: null,
size: null
},
setup: function setup37(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-password"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$23 = {
name: "UsernameIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$23), {}, {
props: {
color: null,
size: null
},
setup: function setup38(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-username"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$22 = {
name: "RefreshThreeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$22), {}, {
props: {
color: null,
size: null
},
setup: function setup39(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-refresh-three"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$21 = {
name: "AuzIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$21), {}, {
props: {
color: null,
size: null
},
setup: function setup40(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-auz"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$20 = {
name: "SpreadLeftIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$20), {}, {
props: {
color: null,
size: null
},
setup: function setup41(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-spread-left"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1$ = {
name: "ShrinkRightIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1$), {}, {
props: {
color: null,
size: null
},
setup: function setup422(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-shrink-right"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1_ = {
name: "SnowflakeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1_), {}, {
props: {
color: null,
size: null
},
setup: function setup43(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-snowflake"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1Z = {
name: "TipsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1Z), {}, {
props: {
color: null,
size: null
},
setup: function setup44(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-tips"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1Y = {
name: "NoteIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1Y), {}, {
props: {
color: null,
size: null
},
setup: function setup45(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-note"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1X = {
name: "HomeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1X), {}, {
props: {
color: null,
size: null
},
setup: function setup46(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-home"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1W = {
name: "SeniorIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1W), {}, {
props: {
color: null,
size: null
},
setup: function setup47(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-senior"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1V = {
name: "RefreshIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1V), {}, {
props: {
color: null,
size: null
},
setup: function setup48(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-refresh"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1U = {
name: "RefreshOneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1U), {}, {
props: {
color: null,
size: null
},
setup: function setup49(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-refresh-one"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1T = {
name: "FlagIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1T), {}, {
props: {
color: null,
size: null
},
setup: function setup50(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-flag"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1S = {
name: "ThemeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1S), {}, {
props: {
color: null,
size: null
},
setup: function setup51(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-theme"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1R = {
name: "NoticeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1R), {}, {
props: {
color: null,
size: null
},
setup: function setup522(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-notice"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1Q = {
name: "WebsiteIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1Q), {}, {
props: {
color: null,
size: null
},
setup: function setup53(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-website"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1P = {
name: "ConsoleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1P), {}, {
props: {
color: null,
size: null
},
setup: function setup54(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-console"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1O = {
name: "FaceSurprisedIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1O), {}, {
props: {
color: null,
size: null
},
setup: function setup55(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-face-surprised"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1N = {
name: "SetIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1N), {}, {
props: {
color: null,
size: null
},
setup: function setup56(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-set"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1M = {
name: "TemplateOneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1M), {}, {
props: {
color: null,
size: null
},
setup: function setup57(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-template-one"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1L = {
name: "AppIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1L), {}, {
props: {
color: null,
size: null
},
setup: function setup58(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-app"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1K = {
name: "TemplateIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1K), {}, {
props: {
color: null,
size: null
},
setup: function setup59(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-template"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1J = {
name: "PraiseIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1J), {}, {
props: {
color: null,
size: null
},
setup: function setup60(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-praise"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1I = {
name: "TreadIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1I), {}, {
props: {
color: null,
size: null
},
setup: function setup61(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-tread"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1H = {
name: "MaleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1H), {}, {
props: {
color: null,
size: null
},
setup: function setup622(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-male"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1G = {
name: "FemaleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1G), {}, {
props: {
color: null,
size: null
},
setup: function setup63(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-female"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1F = {
name: "CameraIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1F), {}, {
props: {
color: null,
size: null
},
setup: function setup64(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-camera"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1E = {
name: "CameraFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1E), {}, {
props: {
color: null,
size: null
},
setup: function setup65(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-camera-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1D = {
name: "MoreIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1D), {}, {
props: {
color: null,
size: null
},
setup: function setup66(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-more"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1C = {
name: "MoreVerticalIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1C), {}, {
props: {
color: null,
size: null
},
setup: function setup67(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-more-vertical"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1B = {
name: "RmbIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1B), {}, {
props: {
color: null,
size: null
},
setup: function setup68(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-rmb"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1A$1 = {
name: "DollarIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1A$1), {}, {
props: {
color: null,
size: null
},
setup: function setup69(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-dollar"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1z$1 = {
name: "DiamondIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1z$1), {}, {
props: {
color: null,
size: null
},
setup: function setup70(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-diamond"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1y$1 = {
name: "FireIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1y$1), {}, {
props: {
color: null,
size: null
},
setup: function setup71(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fire"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1x$1 = {
name: "ReturnIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1x$1), {}, {
props: {
color: null,
size: null
},
setup: function setup722(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-return"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1w$1 = {
name: "LocationIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1w$1), {}, {
props: {
color: null,
size: null
},
setup: function setup73(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-location"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1v$1 = {
name: "ReadIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1v$1), {}, {
props: {
color: null,
size: null
},
setup: function setup74(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-read"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1u$1 = {
name: "SurveyIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1u$1), {}, {
props: {
color: null,
size: null
},
setup: function setup75(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-survey"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1t$1 = {
name: "FaceSmileIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1t$1), {}, {
props: {
color: null,
size: null
},
setup: function setup76(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-face-smile"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1s$1 = {
name: "FaceCryIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1s$1), {}, {
props: {
color: null,
size: null
},
setup: function setup77(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-face-cry"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1r$1 = {
name: "CartSimpleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1r$1), {}, {
props: {
color: null,
size: null
},
setup: function setup78(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-cart-simple"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1q$1 = {
name: "CartIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1q$1), {}, {
props: {
color: null,
size: null
},
setup: function setup79(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-cart"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1p$1 = {
name: "NextIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1p$1), {}, {
props: {
color: null,
size: null
},
setup: function setup80(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-next"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1o$1 = {
name: "PrevIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1o$1), {}, {
props: {
color: null,
size: null
},
setup: function setup81(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-prev"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1n$1 = {
name: "UploadDragIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1n$1), {}, {
props: {
color: null,
size: null
},
setup: function setup822(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-upload-drag"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1m$1 = {
name: "UploadIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1m$1), {}, {
props: {
color: null,
size: null
},
setup: function setup83(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-upload"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1l$1 = {
name: "DownloadCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1l$1), {}, {
props: {
color: null,
size: null
},
setup: function setup84(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-download-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1k$1 = {
name: "ComponentIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1k$1), {}, {
props: {
color: null,
size: null
},
setup: function setup85(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-component"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1j$1 = {
name: "FileBIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1j$1), {}, {
props: {
color: null,
size: null
},
setup: function setup86(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-file-b"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1i$1 = {
name: "UserIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1i$1), {}, {
props: {
color: null,
size: null
},
setup: function setup87(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-user"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1h$1 = {
name: "FindFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1h$1), {}, {
props: {
color: null,
size: null
},
setup: function setup88(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-find-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1g$1 = {
name: "LoadingIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1g$1), {}, {
props: {
color: null,
size: null
},
setup: function setup89(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-loading"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1f$1 = {
name: "LoadingOneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1f$1), {}, {
props: {
color: null,
size: null
},
setup: function setup90(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-loading-one"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1e$1 = {
name: "AddOneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1e$1), {}, {
props: {
color: null,
size: null
},
setup: function setup91(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-add-one"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1d$1 = {
name: "PlayIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1d$1), {}, {
props: {
color: null,
size: null
},
setup: function setup92(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-play"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1c$1 = {
name: "PauseIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1c$1), {}, {
props: {
color: null,
size: null
},
setup: function setup93(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-pause"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1b$1 = {
name: "HeadsetIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1b$1), {}, {
props: {
color: null,
size: null
},
setup: function setup94(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-headset"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1a$1 = {
name: "VideoIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1a$1), {}, {
props: {
color: null,
size: null
},
setup: function setup95(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-video"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$19$1 = {
name: "VoiceIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$19$1), {}, {
props: {
color: null,
size: null
},
setup: function setup96(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-voice"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$18$1 = {
name: "SpeakerIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$18$1), {}, {
props: {
color: null,
size: null
},
setup: function setup97(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-speaker"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$17$1 = {
name: "FontsDelIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$17$1), {}, {
props: {
color: null,
size: null
},
setup: function setup98(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-del"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$16$1 = {
name: "FontsCodeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$16$1), {}, {
props: {
color: null,
size: null
},
setup: function setup99(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-code"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$15$1 = {
name: "FontsHtmlIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$15$1), {}, {
props: {
color: null,
size: null
},
setup: function setup100(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-html"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$14$1 = {
name: "FontsStrongIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$14$1), {}, {
props: {
color: null,
size: null
},
setup: function setup101(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-strong"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$13$1 = {
name: "UnlinkIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$13$1), {}, {
props: {
color: null,
size: null
},
setup: function setup102(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-unlink"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$12$1 = {
name: "PictureIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$12$1), {}, {
props: {
color: null,
size: null
},
setup: function setup103(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-picture"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$11$1 = {
name: "LinkIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$11$1), {}, {
props: {
color: null,
size: null
},
setup: function setup104(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-link"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$10$1 = {
name: "FaceSmileBIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$10$1), {}, {
props: {
color: null,
size: null
},
setup: function setup105(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-face-smile-b"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$$$1 = {
name: "AlignLeftIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$$$1), {}, {
props: {
color: null,
size: null
},
setup: function setup106(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-align-left"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$_$1 = {
name: "AlignRightIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$_$1), {}, {
props: {
color: null,
size: null
},
setup: function setup107(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-align-right"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$Z$1 = {
name: "AlignCenterIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$Z$1), {}, {
props: {
color: null,
size: null
},
setup: function setup108(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-align-center"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$Y$1 = {
name: "FontsUIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$Y$1), {}, {
props: {
color: null,
size: null
},
setup: function setup109(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-u"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$X$1 = {
name: "FontsIIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$X$1), {}, {
props: {
color: null,
size: null
},
setup: function setup110(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-i"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$W$1 = {
name: "TabsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$W$1), {}, {
props: {
color: null,
size: null
},
setup: function setup111(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-tabs"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$V$1 = {
name: "RadioIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$V$1), {}, {
props: {
color: null,
size: null
},
setup: function setup112(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-radio"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$U$1 = {
name: "CircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$U$1), {}, {
props: {
color: null,
size: null
},
setup: function setup113(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$T$1 = {
name: "EditIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$T$1), {}, {
props: {
color: null,
size: null
},
setup: function setup114(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-edit"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$S$1 = {
name: "ShareIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$S$1), {}, {
props: {
color: null,
size: null
},
setup: function setup115(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-share"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$R$1 = {
name: "DeleteIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$R$1), {}, {
props: {
color: null,
size: null
},
setup: function setup116(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-delete"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$Q$1 = {
name: "FormIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$Q$1), {}, {
props: {
color: null,
size: null
},
setup: function setup117(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-form"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$P$1 = {
name: "CellphoneFineIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$P$1), {}, {
props: {
color: null,
size: null
},
setup: function setup118(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-cellphone-fine"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$O$1 = {
name: "DialogueIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$O$1), {}, {
props: {
color: null,
size: null
},
setup: function setup119(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-dialogue"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$N$1 = {
name: "FontsClearIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$N$1), {}, {
props: {
color: null,
size: null
},
setup: function setup120(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-fonts-clear"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$M$1 = {
name: "LayerIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$M$1), {}, {
props: {
color: null,
size: null
},
setup: function setup121(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-layer"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$L$1 = {
name: "DateIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$L$1), {}, {
props: {
color: null,
size: null
},
setup: function setup122(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-date"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$K$1 = {
name: "WaterIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$K$1), {}, {
props: {
color: null,
size: null
},
setup: function setup123(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-water"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$J$1 = {
name: "CodeCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$J$1), {}, {
props: {
color: null,
size: null
},
setup: function setup124(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-code-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$I$1 = {
name: "CarouselIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$I$1), {}, {
props: {
color: null,
size: null
},
setup: function setup125(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-carousel"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$H$1 = {
name: "PrevCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$H$1), {}, {
props: {
color: null,
size: null
},
setup: function setup126(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-prev-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$G$1 = {
name: "LayoutsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$G$1), {}, {
props: {
color: null,
size: null
},
setup: function setup127(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-layouts"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$F$1 = {
name: "UtilIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$F$1), {}, {
props: {
color: null,
size: null
},
setup: function setup128(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-util"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$E$1 = {
name: "TempleateOneIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$E$1), {}, {
props: {
color: null,
size: null
},
setup: function setup129(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-templeate-one"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$D$1 = {
name: "UploadCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$D$1), {}, {
props: {
color: null,
size: null
},
setup: function setup130(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-upload-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$C$1 = {
name: "TreeIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$C$1), {}, {
props: {
color: null,
size: null
},
setup: function setup131(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-tree"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$B$1 = {
name: "TableIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$B$1), {}, {
props: {
color: null,
size: null
},
setup: function setup132(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-table"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$A$1 = {
name: "ChartIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$A$1), {}, {
props: {
color: null,
size: null
},
setup: function setup133(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-chart"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$z$1 = {
name: "ChartScreenIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$z$1), {}, {
props: {
color: null,
size: null
},
setup: function setup134(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-chart-screen"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$y$1 = {
name: "EngineIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$y$1), {}, {
props: {
color: null,
size: null
},
setup: function setup135(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-engine"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$x$1 = {
name: "TriangleDIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$x$1), {}, {
props: {
color: null,
size: null
},
setup: function setup136(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-triangle-d"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$w$1 = {
name: "TriangleRIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$w$1), {}, {
props: {
color: null,
size: null
},
setup: function setup137(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-triangle-r"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$v$1 = {
name: "FileIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$v$1), {}, {
props: {
color: null,
size: null
},
setup: function setup138(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-file"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$u$1 = {
name: "SetSmIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$u$1), {}, {
props: {
color: null,
size: null
},
setup: function setup139(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-set-sm"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$t$1 = {
name: "ReduceCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$t$1), {}, {
props: {
color: null,
size: null
},
setup: function setup140(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-reduce-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$s$1 = {
name: "AddCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$s$1), {}, {
props: {
color: null,
size: null
},
setup: function setup141(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-add-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$r$1 = {
name: "NotFoundIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$r$1), {}, {
props: {
color: null,
size: null
},
setup: function setup142(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-not-found"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$q$1 = {
name: "AboutIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$q$1), {}, {
props: {
color: null,
size: null
},
setup: function setup143(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-about"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$p$1 = {
name: "UpIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$p$1), {}, {
props: {
color: null,
size: null
},
setup: function setup144(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-up"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$o$1 = {
name: "DownIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$o$1), {}, {
props: {
color: null,
size: null
},
setup: function setup145(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-down"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$n$1 = {
name: "LeftIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$n$1), {}, {
props: {
color: null,
size: null
},
setup: function setup146(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-left"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$m$1 = {
name: "RightIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$m$1), {}, {
props: {
color: null,
size: null
},
setup: function setup147(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-right"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$l$1 = {
name: "CircleDotIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$l$1), {}, {
props: {
color: null,
size: null
},
setup: function setup148(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-circle-dot"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$k$1 = {
name: "SearchIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$k$1), {}, {
props: {
color: null,
size: null
},
setup: function setup149(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-search"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$j$1 = {
name: "SetFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$j$1), {}, {
props: {
color: null,
size: null
},
setup: function setup150(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-set-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$i$1 = {
name: "GroupIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$i$1), {}, {
props: {
color: null,
size: null
},
setup: function setup151(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-group"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$h$1 = {
name: "FriendsIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$h$1), {}, {
props: {
color: null,
size: null
},
setup: function setup152(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-friends"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$g$1 = {
name: "ReplyFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$g$1), {}, {
props: {
color: null,
size: null
},
setup: function setup153(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-reply-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$f$1 = {
name: "MenuFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$f$1), {}, {
props: {
color: null,
size: null
},
setup: function setup154(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-menu-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$e$1 = {
name: "LogIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$e$1), {}, {
props: {
color: null,
size: null
},
setup: function setup155(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-log"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$d$1 = {
name: "PictureFineIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$d$1), {}, {
props: {
color: null,
size: null
},
setup: function setup156(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-picture-fine"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$c$1 = {
name: "FaceSmileFineIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$c$1), {}, {
props: {
color: null,
size: null
},
setup: function setup157(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-face-smile-fine"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$b$1 = {
name: "ListIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$b$1), {}, {
props: {
color: null,
size: null
},
setup: function setup158(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-list"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$a$1 = {
name: "ReleaseIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$a$1), {}, {
props: {
color: null,
size: null
},
setup: function setup159(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-release"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$9$1 = {
name: "OkIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$9$1), {}, {
props: {
color: null,
size: null
},
setup: function setup160(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-ok"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$8$1 = {
name: "HelpIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$8$1), {}, {
props: {
color: null,
size: null
},
setup: function setup161(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-help"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$7$1 = {
name: "ChatIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$7$1), {}, {
props: {
color: null,
size: null
},
setup: function setup162(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-chat"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$6$1 = {
name: "TopIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$6$1), {}, {
props: {
color: null,
size: null
},
setup: function setup163(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-top"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$5$1 = {
name: "StarIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$5$1), {}, {
props: {
color: null,
size: null
},
setup: function setup164(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-star"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$4$1 = {
name: "StarFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$4$1), {}, {
props: {
color: null,
size: null
},
setup: function setup165(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-star-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$3$1 = {
name: "CloseFillIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$3$1), {}, {
props: {
color: null,
size: null
},
setup: function setup166(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-close-fill"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2$1 = {
name: "CloseIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2$1), {}, {
props: {
color: null,
size: null
},
setup: function setup167(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-close"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$1$1 = {
name: "OkCircleIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$1$1), {}, {
props: {
color: null,
size: null
},
setup: function setup168(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-ok-circle"
}, null, 8, ["color", "size"]);
};
}
}));
var __default__$2F = {
name: "AddCircleFineIcon"
};
/* @__PURE__ */ defineComponent(_objectSpread2$1(_objectSpread2$1({}, __default__$2F), {}, {
props: {
color: null,
size: null
},
setup: function setup169(__props) {
var props = __props;
return function(_ctx, _cache) {
return openBlock(), createBlock(unref(_sfc_main$2E), {
color: props.color,
size: props.size,
type: "layui-icon-add-circle-fine"
}, null, 8, ["color", "size"]);
};
}
}));
var index$$ = /* @__PURE__ */ (() => ".layui-backtop{position:fixed;right:30px;bottom:40px;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:40px;background-color:#9f9f9f;color:#fff;border-radius:var(--global-border-radius);opacity:.95;z-index:999999}.layui-backtop :hover{opacity:.85}.layui-backtop-medium{width:40px;height:40px;font-size:30px}.layui-backtop-small{width:30px;height:30px;font-size:20px}\n")();
const _hoisted_1$18 = ["onClick"];
const __default__$1A = {
name: "LayBacktop"
};
const _sfc_main$1H = defineComponent({
...__default__$1A,
props: {
target: { default: "window" },
showHeight: { default: 200 },
disabled: { type: Boolean, default: false },
position: null,
right: null,
bottom: null,
size: null,
bgcolor: null,
opacity: null,
color: null,
borderRadius: null,
circle: { type: Boolean, default: false },
icon: { default: "layui-icon-top" },
iconSize: { default: 30 },
iconColor: null
},
emits: ["click"],
setup(__props, { emit }) {
const props = __props;
const backtopRef = ref(null);
const scrollTarget = shallowRef(void 0);
let visible = ref(props.showHeight === 0);
const classBacktop = computed$1(() => {
return {
"layui-backtop-medium": props.size === "medium",
"layui-backtop-small": props.size === "small"
};
});
const borderRadius = computed$1(() => {
if (props.circle) {
return "50%";
}
return typeof props.borderRadius === "number" ? `${props.borderRadius}px` : props.borderRadius;
});
const styleBacktop = computed$1(() => {
return {
position: props.position,
right: `${props.right}px`,
bottom: `${props.bottom}px`,
backgroundColor: props.bgcolor,
opacity: props.opacity,
color: props.color,
borderRadius: borderRadius.value
};
});
const easeInOut = (value) => {
return value < 0.5 ? 2 * value * value : 1 - 2 * (value - 1) * (value - 1);
};
const scrollToTop = () => {
if (!scrollTarget.value)
return;
if (scrollTarget.value instanceof Window) {
window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
} else {
const previous = Date.now();
const scrollHeight = scrollTarget.value.scrollTop;
const animationFunc = () => {
if (!scrollTarget.value || scrollTarget.value instanceof Window)
return;
const elapsed = (Date.now() - previous) / 450;
if (elapsed < 1) {
scrollTarget.value.scrollTop = scrollHeight * (1 - easeInOut(elapsed));
window.requestAnimationFrame(animationFunc);
} else {
scrollTarget.value.scrollTop = 0;
}
};
window.requestAnimationFrame(animationFunc);
}
};
const handleScroll = () => {
if (!scrollTarget.value)
return;
const scrollTop = scrollTarget.value instanceof Window ? window.pageYOffset : scrollTarget.value.scrollTop;
visible.value = scrollTop >= props.showHeight;
};
const handleClick = (event) => {
if (!props.disabled) {
scrollToTop();
}
emit("click", event);
};
const handlerMousedown = () => {
backtopRef.value.style.opacity = "1";
};
const handlerMouseup = () => {
backtopRef.value.style.opacity = "0.95";
};
const getScrollTarget = () => {
if (props.target === "window") {
return getScrollParent(backtopRef.value, false);
} else {
const targetElement = document.querySelector(props.target);
if (!targetElement) {
throw new Error(`target is not existed: ${props.target}`);
}
if (props.position === "absolute") {
if (!targetElement.parentElement) {
throw new Error(`target parent element is not existed: ${props.target}`);
}
targetElement.parentElement.style.position = "relative";
}
return targetElement;
}
};
const getScrollParent = (element, includeHidden) => {
let style = getComputedStyle(element);
let excludeStaticParent = style.position === "absolute";
let overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/;
for (let parent = element; parent = parent.parentElement; ) {
style = getComputedStyle(parent);
if (excludeStaticParent && style.position === "static") {
continue;
}
if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) {
return parent;
}
}
return window;
};
const throttle2 = (func, wait) => {
var timer = null;
return (...args) => {
if (!timer) {
timer = setTimeout(() => {
timer = null;
func.apply(this, args);
}, wait);
}
};
};
const callback = throttle2(handleScroll, 300);
onMounted(() => {
if (!props.target)
return;
scrollTarget.value = getScrollTarget();
scrollTarget.value.addEventListener("scroll", callback);
});
onBeforeUnmount(() => {
var _a2;
(_a2 = scrollTarget.value) == null ? void 0 : _a2.removeEventListener("scroll", callback);
});
return (_ctx, _cache) => {
return withDirectives((openBlock(), createElementBlock("div", {
ref_key: "backtopRef",
ref: backtopRef,
class: normalizeClass(["layui-backtop", unref(classBacktop)]),
style: normalizeStyle({ ...unref(styleBacktop) }),
onClick: withModifiers(handleClick, ["stop"]),
onMousedown: handlerMousedown,
onMouseup: handlerMouseup
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createVNode(unref(_sfc_main$2E), {
type: props.icon,
size: `${props.iconSize}px`,
color: props.iconColor
}, null, 8, ["type", "size", "color"])
])
], 46, _hoisted_1$18)), [
[vShow, unref(visible)]
]);
};
}
});
const component$1l = withInstall(_sfc_main$1H);
var index$_ = /* @__PURE__ */ (() => ".layui-avatar{font-size:14px;font-variant:tabular-nums;border-radius:var(--global-border-radius);box-sizing:border-box;color:#fff;list-style:none;position:relative;display:inline-block;background:#eeeeee;overflow:hidden;white-space:nowrap;text-align:center;width:32px;height:32px;line-height:32px;vertical-align:middle}.layui-avatar.layui-avatar-radius{border-radius:50%}.layui-avatar.layui-avatar-sm{height:30px;width:30px}.layui-avatar.layui-avatar-lg{height:36px;width:36px}.layui-avatar.layui-avatar-xs{height:28px;width:28px}.layui-avatar-list .layui-avatar{margin-left:-10px;display:inline-block}.layui-avatar>img{width:100%;height:100%;display:block;object-fit:cover}\n")();
const _hoisted_1$17 = ["src", "alt"];
const __default__$1z = {
name: "LayAvatar"
};
const _sfc_main$1G = defineComponent({
...__default__$1z,
props: {
src: null,
size: { default: "md" },
radius: { type: Boolean, default: false },
icon: { default: "layui-icon-username" },
alt: null
},
setup(__props) {
const props = __props;
const slot = useSlots();
const classes = computed$1(() => {
return [
"layui-avatar",
props.radius ? "layui-avatar-radius" : "",
props.size ? `layui-avatar-${props.size}` : ""
];
});
return (_ctx, _cache) => {
return unref(slot).default ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass(unref(classes))
}, [
renderSlot(_ctx.$slots, "default")
], 2)) : (openBlock(), createElementBlock("span", {
key: 1,
class: normalizeClass(unref(classes))
}, [
__props.src ? (openBlock(), createElementBlock("img", {
key: 0,
src: __props.src,
alt: __props.alt
}, null, 8, _hoisted_1$17)) : (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: __props.icon
}, null, 8, ["type"]))
], 2));
};
}
});
const component$1k = withInstall(_sfc_main$1G);
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _sfc_main$1F = {
name: "LayAvatarList"
};
const _hoisted_1$16 = { class: "layui-avatar-list" };
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("div", _hoisted_1$16, [
renderSlot(_ctx.$slots, "default")
]);
}
var Component = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["render", _sfc_render$4]]);
const component$1j = withInstall(Component);
var index$Z = /* @__PURE__ */ (() => ".layui-radio[size=lg] .layui-form-radio>i{font-size:24px}.layui-radio[size=md] .layui-form-radio>i{font-size:22px}.layui-radio[size=sm] .layui-form-radio>i{font-size:20px}.layui-radio[size=xs] .layui-form-radio>i{font-size:18px}.layui-radio input[type=radio]{display:none}.layui-form-radio,.layui-form-radio *{display:inline-block;vertical-align:middle}.layui-form-radio{line-height:28px;margin:6px 10px 0 0;padding-right:10px;cursor:pointer;font-size:0}.layui-form-radio *{font-size:14px}.layui-form-radio>i{margin-right:8px;font-size:22px;color:var(--global-neutral-color-8)}.layui-form-radio:hover *,.layui-form-radioed,.layui-form-radioed>i{color:var(--global-checked-color)}.layui-radio-disabled>i{color:var(--global-neutral-color-3)!important}.layui-radio-disabled *{color:var(--global-neutral-color-8)!important}\n")();
const _hoisted_1$15 = ["size"];
const _hoisted_2$R = ["value", "name"];
const _hoisted_3$K = ["onClick"];
const _hoisted_4$z = {
key: 0,
class: "layui-anim layui-icon layui-anim-scaleSpring"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$q = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-icon layui-form-radioed"
};
const __default__$1y = {
name: "LayRadio"
};
const _sfc_main$1E = defineComponent({
...__default__$1y,
props: {
name: null,
size: { default: "md" },
disabled: { type: Boolean },
modelValue: { type: [String, Boolean, Number] },
value: { type: [String, Boolean, Number] },
label: null
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const radioGroup = inject("radioGroup", {});
const isGroup = computed$1(() => {
return radioGroup != void 0 && (radioGroup == null ? void 0 : radioGroup.name) === "LayRadioGroup";
});
const naiveName = computed$1(() => {
if (radioGroup.naiveName) {
return radioGroup.naiveName;
} else {
return props.name;
}
});
const isChecked = computed$1({
get() {
if (isGroup.value) {
return radioGroup.modelValue.value === props.value;
} else {
return props.modelValue === props.value;
}
},
set(val) {
if (isGroup.value) {
radioGroup.modelValue.value = props.value;
} else {
if (val) {
emit("change", props.value);
emit("update:modelValue", props.value);
}
}
}
});
const handleClick = function() {
if (!ifDisabled.value) {
isChecked.value = !isChecked.value;
}
};
const ifDisabled = computed$1(() => {
if (props.disabled) {
return true;
}
if (radioGroup.hasOwnProperty("disabled") && radioGroup.disabled.value) {
return true;
}
return false;
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
class: "layui-radio",
size: __props.size
}, [
createElementVNode("input", {
type: "radio",
value: __props.value,
name: unref(naiveName)
}, null, 8, _hoisted_2$R),
createElementVNode("div", {
class: normalizeClass(["layui-unselect layui-form-radio", {
"layui-form-radioed": unref(isChecked),
"layui-radio-disabled layui-disabled": unref(ifDisabled)
}]),
onClick: withModifiers(handleClick, ["stop"])
}, [
2022-12-30 08:13:19 +00:00
unref(isChecked) ? (openBlock(), createElementBlock("i", _hoisted_4$z, "\uE643")) : (openBlock(), createElementBlock("i", _hoisted_5$q, "\uE63F")),
2022-11-15 01:16:55 +00:00
createElementVNode("span", null, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(__props.label), 1)
])
])
], 10, _hoisted_3$K)
], 8, _hoisted_1$15);
};
}
});
const component$1i = withInstall(_sfc_main$1E);
const _hoisted_1$14 = { class: "layui-radio-group" };
const __default__$1x = {
name: "LayRadioGroup"
};
const _sfc_main$1D = defineComponent({
...__default__$1x,
props: {
modelValue: { type: [String, Boolean, Number] },
name: null,
disabled: { type: Boolean, default: false }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const modelValue = ref(props.modelValue);
const disabled = ref(props.disabled);
provide("radioGroup", {
name: "LayRadioGroup",
modelValue,
naiveName: props.name,
disabled
});
watch(() => modelValue, (val) => {
emit("change", modelValue.value);
emit("update:modelValue", modelValue.value);
}, { deep: true });
watch(() => props.modelValue, (val) => modelValue.value = val);
watch(() => props.disabled, (val) => disabled.value = val);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$14, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$1h = withInstall(_sfc_main$1D);
var index$Y = /* @__PURE__ */ (() => ":root{--button-primary-text-color: #fff;--button-primary-background-color: var(--global-primary-color);--button-primary-border-color: var(--global-primary-color);--button-normal-text-color: #fff;--button-normal-background-color: var(--global-normal-color);--button-normal-border-color: var(--global-normal-color);--button-warm-text-color: #fff;--button-warm-background-color: var(--global-warm-color);--button-warm-border-color: var(--global-warm-color);--button-danger-text-color: #fff;--button-danger-background-color: var(--global-danger-color);--button-danger-border-color: var(--global-danger-color);--button-border-radius: var(--global-border-radius);--button-border-color: var(--global-neutral-color-6);--button-background-color: 0 0;--button-text-color: #666}.layui-btn{height:38px;line-height:36px;padding:0 18px;font-size:14px;text-align:center;white-space:nowrap;color:var(--button-text-color);background:var(--button-background-color);border-radius:var(--button-border-radius);border-color:var(--button-border-color);border-width:1px;border-style:solid;cursor:pointer}.layui-btn-primary{color:var(--button-primary-text-color);background-color:var(--button-primary-background-color);border-color:var(--button-primary-border-color)}.layui-btn-normal{color:var(--button-normal-text-color);background-color:var(--button-normal-background-color);border-color:var(--button-normal-border-color)}.layui-btn-warm{color:var(--button-warm-text-color);background-color:var(--button-warm-background-color);border-color:var(--button-warm-border-color)}.layui-btn-danger{color:var(--button-danger-text-color);background-color:var(--button-danger-background-color);border-color:var(--button-danger-border-color)}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80)}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-fluid{width:100%}.layui-btn-radius{border-radius:100px}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn+.layui-btn{margin-left:10px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\\ ;vertical-align:bottom}\n")();
const ButtonEmits = {
click: (evt) => evt instanceof MouseEvent
};
const _hoisted_1$13 = ["type"];
const __default__$1w = {
name: "LayButton"
};
const _sfc_main$1C = defineComponent({
...__default__$1w,
props: {
type: null,
size: null,
prefixIcon: null,
suffixIcon: null,
loadingIcon: { default: "layui-icon-loading-one" },
borderStyle: { default: "soild" },
border: null,
fluid: { type: Boolean, default: false },
radius: { type: Boolean, default: false },
loading: { type: Boolean, default: false },
disabled: { type: Boolean },
nativeType: { default: "button" }
},
emits: ButtonEmits,
setup(__props, { emit: emits }) {
const props = __props;
const onClick = (event) => {
if (!props.disabled) {
emits("click", event);
}
};
const styles = computed$1(() => {
return {
border: `1px ${props.borderStyle}`
};
});
const classes = computed$1(() => {
return [
{
"layui-btn-fluid": props.fluid,
"layui-btn-radius": props.radius,
"layui-btn-disabled": props.disabled
},
props.type ? `layui-btn-${props.type}` : "",
props.size ? `layui-btn-${props.size}` : "",
props.border ? `layui-border-${props.border}` : ""
];
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("button", {
class: normalizeClass(["layui-btn", unref(classes)]),
style: normalizeStyle(unref(styles)),
type: __props.nativeType,
onClick
}, [
__props.prefixIcon ? (openBlock(), createElementBlock("i", {
key: 0,
class: normalizeClass(`layui-icon ${__props.prefixIcon}`)
}, null, 2)) : createCommentVNode("", true),
__props.loading ? (openBlock(), createElementBlock("i", {
key: 1,
class: normalizeClass([__props.loadingIcon, "layui-icon layui-anim layui-anim-rotate layui-anim-loop"])
}, null, 2)) : renderSlot(_ctx.$slots, "default", { key: 2 }),
__props.suffixIcon ? (openBlock(), createElementBlock("i", {
key: 3,
class: normalizeClass(`layui-icon ${__props.suffixIcon}`)
}, null, 2)) : createCommentVNode("", true)
], 14, _hoisted_1$13);
};
}
});
const component$1g = withInstall(_sfc_main$1C);
var index$X = /* @__PURE__ */ (() => ".layui-btn-container{font-size:0}.layui-btn-container .layui-btn{margin-right:10px;margin-bottom:10px}.layui-btn-container .layui-btn+.layui-btn{margin-left:0}\n")();
const _hoisted_1$12 = { class: "layui-btn-container" };
const __default__$1v = {
name: "LayButtonContainer"
};
const _sfc_main$1B = /* @__PURE__ */ defineComponent({
...__default__$1v,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$12, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$1f = withInstall(_sfc_main$1B);
var index$W = /* @__PURE__ */ (() => ":root{--button-primary-color: var(--global-primary-color);--button-border-radius: var(--global-border-radius)}.layui-btn-group{vertical-align:middle;font-size:0}.layui-btn-group .layui-btn{margin-left:0!important;margin-right:0!important;border-radius:0}.layui-btn-group .layui-btn:not(:last-child){border-right:none!important}.layui-btn-group .layui-btn.layui-btn-primary:not(:first-child),.layui-btn-group .layui-btn.layui-btn-normal:not(:first-child),.layui-btn-group .layui-btn.layui-btn-warm:not(:first-child),.layui-btn-group .layui-btn.layui-btn-danger:not(:first-child){border-left:1px solid rgba(255,255,255,.5)}.layui-btn-group .layui-btn:first-child{border-radius:var(--button-border-radius) 0 0 var(--button-border-radius)}.layui-btn-group .layui-btn:last-child{border-radius:0 var(--button-border-radius) var(--button-border-radius) 0}.layui-btn-group .layui-btn+.layui-btn{margin-left:0}.layui-btn-group+.layui-btn-group{margin-left:10px}\n")();
const _hoisted_1$11 = { class: "layui-btn-group" };
const __default__$1u = {
name: "LayButtonGroup"
};
const _sfc_main$1A = /* @__PURE__ */ defineComponent({
...__default__$1u,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$11, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$1e = withInstall(_sfc_main$1A);
const component$1d = withInstall(_sfc_main$2E);
2022-12-30 08:13:19 +00:00
var index$V = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--icon-picker-border-radius: var(--global-border-radius);--icon-picker-checked-color: var(--global-checked-color)}.layui-iconpicker{position:relative;height:38px;line-height:38px;border-width:1px;border-style:solid;border-radius:var(--icon-picker-border-radius);cursor:pointer}.layui-iconpicker .layui-inline{height:36px;line-height:36px;vertical-align:top}.layui-iconpicker-title{padding-left:5px}.layui-iconpicker-main{padding:0 10px}.layui-iconpicker-main .layui-icon{font-size:20px}.layui-iconpicker-main .layui-inline{vertical-align:top}.layui-iconpicker-split .layui-iconpicker-main{padding:0 15px;border-right-width:1px;border-right-style:solid}.layui-iconpicker-suffix{position:relative;width:35px;text-align:center}.layui-iconpicker-suffix .layui-icon{font-size:14px;color:#00000080;transition:all .3s;display:inline-block}.layui-iconpicker-down .layui-iconpicker-suffix .layui-icon-down{transform:rotate(180deg)}.layui-iconpicker-search{padding:10px;box-shadow:0 2px 8px #f0f1f2;border-bottom:1px solid whitesmoke}.layui-iconpicker-list{width:321px}.layui-iconpicker-list ul{margin:6px}.layui-iconpicker-list li{vertical-align:top;display:inline-block;width:60px;margin:2.5px;padding:5px;overflow:hidden;border:1px solid #eee;border-radius:2px;cursor:pointer;text-align:center}.layui-iconpicker-list li:hover{background-color:var(--global-neutral-color-1);color:#00000080}.layui-iconpicker-list li.layui-this{border-color:var(--icon-picker-checked-color);color:var(--icon-picker-checked-color)}.layui-iconpicker-list li .layui-icon{font-size:20px}.layui-iconpicker-list li .layui-elip{margin-top:2px;line-height:20px;font-size:12px}.layui-iconpicker-list .layui-none{margin:30px 0 35px}.layui-iconpicker-scroll .layui-iconpicker-list{max-height:200px}.layui-iconpicker-page{position:relative;padding:10px 10px 5px;border-top:1px solid #eee;text-align:right}.layui-iconpicker-page .layui-laypage{margin:0}.layui-iconpicker-page .layui-laypage a,.layui-iconpicker-page .layui-laypage span{padding:0 10px;color:#666}.layui-iconpicker-page .layui-laypage-count{position:absolute;left:10px}.layui-iconpicker-page .layui-laypage-curr .layui-laypage-em{background:0 0}.layui-iconpicker-page .layui-laypage-curr em{color:#666;color:#0009}.layui-iconpicker-page .layui-laypage-first,.layui-iconpicker-page .layui-laypage-last,.layui-iconpicker-page .layui-laypage-spr{display:none}.layui-icon-picker-clear{color:#00000073;padding:0 0 0 10px}.layui-icon-picker-clear:hover,.layui-colorpicker-disabled{opacity:.6}.layui-colorpicker-disabled,.layui-colorpicker-disabled *{cursor:not-allowed!important}.transform{transform:rotate(180deg)}\n")();
2022-11-15 01:16:55 +00:00
var index$U = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}\n")();
2022-12-30 08:13:19 +00:00
var _a$1;
const isClient$1 = typeof window !== "undefined";
const toString$1 = Object.prototype.toString;
2022-11-15 01:16:55 +00:00
const isFunction$2 = (val) => typeof val === "function";
const isNumber$1 = (val) => typeof val === "number";
const isString = (val) => typeof val === "string";
2022-12-30 08:13:19 +00:00
const isObject$2 = (val) => toString$1.call(val) === "[object Object]";
2022-11-15 01:16:55 +00:00
const clamp = (n, min, max) => Math.min(max, Math.max(min, n));
const noop = () => {
};
2022-12-30 08:13:19 +00:00
isClient$1 && ((_a$1 = window == null ? void 0 : window.navigator) == null ? void 0 : _a$1.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
2022-11-15 01:16:55 +00:00
function resolveUnref(r) {
return typeof r === "function" ? r() : unref(r);
}
function createFilterWrapper(filter, fn) {
function wrapper(...args) {
filter(() => fn.apply(this, args), { fn, thisArg: this, args });
}
return wrapper;
}
function throttleFilter(ms, trailing = true, leading = true) {
let lastExec = 0;
let timer;
let isLeading = true;
const clear2 = () => {
if (timer) {
clearTimeout(timer);
timer = void 0;
}
};
const filter = (invoke) => {
const duration = resolveUnref(ms);
const elapsed = Date.now() - lastExec;
clear2();
if (duration <= 0) {
lastExec = Date.now();
return invoke();
}
if (elapsed > duration && (leading || !isLeading)) {
lastExec = Date.now();
invoke();
} else if (trailing) {
timer = setTimeout(() => {
lastExec = Date.now();
isLeading = true;
clear2();
invoke();
}, duration);
}
if (!leading && !timer)
timer = setTimeout(() => isLeading = true, duration);
isLeading = false;
};
return filter;
}
function identity(arg) {
return arg;
}
function tryOnScopeDispose(fn) {
if (getCurrentScope()) {
onScopeDispose(fn);
return true;
}
return false;
}
function toReactive(objectRef) {
if (!isRef(objectRef))
return reactive(objectRef);
const proxy = new Proxy({}, {
get(_, p, receiver) {
return unref(Reflect.get(objectRef.value, p, receiver));
},
set(_, p, value) {
if (isRef(objectRef.value[p]) && !isRef(value))
objectRef.value[p].value = value;
else
objectRef.value[p] = value;
return true;
},
deleteProperty(_, p) {
return Reflect.deleteProperty(objectRef.value, p);
},
has(_, p) {
return Reflect.has(objectRef.value, p);
},
ownKeys() {
return Object.keys(objectRef.value);
},
getOwnPropertyDescriptor() {
return {
enumerable: true,
configurable: true
};
}
});
return reactive(proxy);
}
function reactiveComputed(fn) {
return toReactive(computed$1(fn));
}
function reactiveOmit(obj, ...keys) {
const flatKeys = keys.flat();
return reactiveComputed(() => Object.fromEntries(Object.entries(toRefs(obj)).filter((e) => !flatKeys.includes(e[0]))));
}
function useThrottleFn(fn, ms = 200, trailing = false, leading = true) {
return createFilterWrapper(throttleFilter(ms, trailing, leading), fn);
}
function tryOnMounted(fn, sync = true) {
if (getCurrentInstance())
onMounted(fn);
else if (sync)
fn();
else
nextTick(fn);
}
function useTimeoutFn(cb, interval, options = {}) {
const {
immediate = true
} = options;
const isPending = ref(false);
let timer = null;
function clear2() {
if (timer) {
clearTimeout(timer);
timer = null;
}
}
function stop() {
isPending.value = false;
clear2();
}
function start(...args) {
clear2();
isPending.value = true;
timer = setTimeout(() => {
isPending.value = false;
timer = null;
cb(...args);
}, resolveUnref(interval));
}
if (immediate) {
isPending.value = true;
2022-12-30 08:13:19 +00:00
if (isClient$1)
2022-11-15 01:16:55 +00:00
start();
}
tryOnScopeDispose(stop);
return {
isPending,
start,
stop
};
}
function unrefElement(elRef) {
var _a2;
const plain = resolveUnref(elRef);
return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain;
}
2022-12-30 08:13:19 +00:00
const defaultWindow = isClient$1 ? window : void 0;
2022-11-15 01:16:55 +00:00
function useEventListener(...args) {
let target;
let event;
let listener;
let options;
if (isString(args[0])) {
[event, listener, options] = args;
target = defaultWindow;
} else {
[target, event, listener, options] = args;
}
if (!target)
return noop;
let cleanup = noop;
const stopWatch = watch(() => unrefElement(target), (el) => {
cleanup();
if (!el)
return;
el.addEventListener(event, listener, options);
cleanup = () => {
el.removeEventListener(event, listener, options);
cleanup = noop;
};
}, { immediate: true, flush: "post" });
const stop = () => {
stopWatch();
cleanup();
};
tryOnScopeDispose(stop);
return stop;
}
function onClickOutside(target, handler, options = {}) {
const { window: window2 = defaultWindow, ignore, capture = true, detectIframe = false } = options;
if (!window2)
return;
const shouldListen = ref(true);
let fallback;
const listener = (event) => {
window2.clearTimeout(fallback);
const el = unrefElement(target);
const composedPath = event.composedPath();
if (!el || el === event.target || composedPath.includes(el) || !shouldListen.value)
return;
if (ignore && ignore.length > 0) {
if (ignore.some((target2) => {
const el2 = unrefElement(target2);
return el2 && (event.target === el2 || composedPath.includes(el2));
}))
return;
}
handler(event);
};
const cleanup = [
useEventListener(window2, "click", listener, { passive: true, capture }),
useEventListener(window2, "pointerdown", (e) => {
const el = unrefElement(target);
shouldListen.value = !!el && !e.composedPath().includes(el);
}, { passive: true }),
useEventListener(window2, "pointerup", (e) => {
if (e.button === 0) {
const path = e.composedPath();
e.composedPath = () => path;
fallback = window2.setTimeout(() => listener(e), 50);
}
}, { passive: true }),
detectIframe && useEventListener(window2, "blur", (event) => {
var _a2;
const el = unrefElement(target);
if (((_a2 = document.activeElement) == null ? void 0 : _a2.tagName) === "IFRAME" && !(el == null ? void 0 : el.contains(document.activeElement)))
handler(event);
})
].filter(Boolean);
const stop = () => cleanup.forEach((fn) => fn());
return stop;
}
function templateRef(key, initialValue = null) {
const instance = getCurrentInstance();
let _trigger = () => {
};
const element = customRef((track, trigger) => {
_trigger = trigger;
return {
get() {
var _a2, _b;
track();
return (_b = (_a2 = instance == null ? void 0 : instance.proxy) == null ? void 0 : _a2.$refs[key]) != null ? _b : initialValue;
},
set() {
}
};
});
tryOnMounted(_trigger);
onUpdated(_trigger);
return element;
}
function useSupported(callback, sync = false) {
const isSupported = ref();
const update = () => isSupported.value = Boolean(callback());
update();
tryOnMounted(update, sync);
return isSupported;
}
const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
const globalKey = "__vueuse_ssr_handlers__";
_global[globalKey] = _global[globalKey] || {};
_global[globalKey];
var __getOwnPropSymbols$f = Object.getOwnPropertySymbols;
var __hasOwnProp$f = Object.prototype.hasOwnProperty;
var __propIsEnum$f = Object.prototype.propertyIsEnumerable;
var __objRest$2 = (source, exclude) => {
var target = {};
for (var prop in source)
if (__hasOwnProp$f.call(source, prop) && exclude.indexOf(prop) < 0)
target[prop] = source[prop];
if (source != null && __getOwnPropSymbols$f)
for (var prop of __getOwnPropSymbols$f(source)) {
if (exclude.indexOf(prop) < 0 && __propIsEnum$f.call(source, prop))
target[prop] = source[prop];
}
return target;
};
function useResizeObserver(target, callback, options = {}) {
const _a2 = options, { window: window2 = defaultWindow } = _a2, observerOptions = __objRest$2(_a2, ["window"]);
let observer;
const isSupported = useSupported(() => window2 && "ResizeObserver" in window2);
const cleanup = () => {
if (observer) {
observer.disconnect();
observer = void 0;
}
};
const stopWatch = watch(() => unrefElement(target), (el) => {
cleanup();
if (isSupported.value && window2 && el) {
observer = new ResizeObserver(callback);
observer.observe(el, observerOptions);
}
}, { immediate: true, flush: "post" });
const stop = () => {
cleanup();
stopWatch();
};
tryOnScopeDispose(stop);
return {
isSupported,
stop
};
}
function useRafFn(fn, options = {}) {
const {
immediate = true,
window: window2 = defaultWindow
} = options;
const isActive = ref(false);
let rafId = null;
function loop() {
if (!isActive.value || !window2)
return;
fn();
rafId = window2.requestAnimationFrame(loop);
}
function resume() {
if (!isActive.value && window2) {
isActive.value = true;
loop();
}
}
function pause() {
isActive.value = false;
if (rafId != null && window2) {
window2.cancelAnimationFrame(rafId);
rafId = null;
}
}
if (immediate)
resume();
tryOnScopeDispose(pause);
return {
isActive,
pause,
resume
};
}
function useEyeDropper(options = {}) {
const { initialValue = "" } = options;
const isSupported = useSupported(() => typeof window !== "undefined" && "EyeDropper" in window);
const sRGBHex = ref(initialValue);
async function open2(openOptions) {
if (!isSupported.value)
return;
const eyeDropper = new window.EyeDropper();
const result = await eyeDropper.open(openOptions);
sRGBHex.value = result.sRGBHex;
return result;
}
return { isSupported, sRGBHex, open: open2 };
}
function useMousePressed(options = {}) {
const {
touch = true,
drag = true,
initialValue = false,
window: window2 = defaultWindow
} = options;
const pressed = ref(initialValue);
const sourceType = ref(null);
if (!window2) {
return {
pressed,
sourceType
};
}
const onPressed = (srcType) => () => {
pressed.value = true;
sourceType.value = srcType;
};
const onReleased = () => {
pressed.value = false;
sourceType.value = null;
};
const target = computed$1(() => unrefElement(options.target) || window2);
useEventListener(target, "mousedown", onPressed("mouse"), { passive: true });
useEventListener(window2, "mouseleave", onReleased, { passive: true });
useEventListener(window2, "mouseup", onReleased, { passive: true });
if (drag) {
useEventListener(target, "dragstart", onPressed("mouse"), { passive: true });
useEventListener(window2, "drop", onReleased, { passive: true });
useEventListener(window2, "dragend", onReleased, { passive: true });
}
if (touch) {
useEventListener(target, "touchstart", onPressed("touch"), { passive: true });
useEventListener(window2, "touchend", onReleased, { passive: true });
useEventListener(window2, "touchcancel", onReleased, { passive: true });
}
return {
pressed,
sourceType
};
}
var SwipeDirection;
(function(SwipeDirection2) {
SwipeDirection2["UP"] = "UP";
SwipeDirection2["RIGHT"] = "RIGHT";
SwipeDirection2["DOWN"] = "DOWN";
SwipeDirection2["LEFT"] = "LEFT";
SwipeDirection2["NONE"] = "NONE";
})(SwipeDirection || (SwipeDirection = {}));
var __defProp = Object.defineProperty;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
const _TransitionPresets = {
easeInSine: [0.12, 0, 0.39, 0],
easeOutSine: [0.61, 1, 0.88, 1],
easeInOutSine: [0.37, 0, 0.63, 1],
easeInQuad: [0.11, 0, 0.5, 0],
easeOutQuad: [0.5, 1, 0.89, 1],
easeInOutQuad: [0.45, 0, 0.55, 1],
easeInCubic: [0.32, 0, 0.67, 0],
easeOutCubic: [0.33, 1, 0.68, 1],
easeInOutCubic: [0.65, 0, 0.35, 1],
easeInQuart: [0.5, 0, 0.75, 0],
easeOutQuart: [0.25, 1, 0.5, 1],
easeInOutQuart: [0.76, 0, 0.24, 1],
easeInQuint: [0.64, 0, 0.78, 0],
easeOutQuint: [0.22, 1, 0.36, 1],
easeInOutQuint: [0.83, 0, 0.17, 1],
easeInExpo: [0.7, 0, 0.84, 0],
easeOutExpo: [0.16, 1, 0.3, 1],
easeInOutExpo: [0.87, 0, 0.13, 1],
easeInCirc: [0.55, 0, 1, 0.45],
easeOutCirc: [0, 0.55, 0.45, 1],
easeInOutCirc: [0.85, 0, 0.15, 1],
easeInBack: [0.36, 0, 0.66, -0.56],
easeOutBack: [0.34, 1.56, 0.64, 1],
easeInOutBack: [0.68, -0.6, 0.32, 1.6]
};
const TransitionPresets = __spreadValues({
linear: identity
}, _TransitionPresets);
function createEasingFunction([p0, p1, p2, p3]) {
const a = (a1, a2) => 1 - 3 * a2 + 3 * a1;
const b = (a1, a2) => 3 * a2 - 6 * a1;
const c = (a1) => 3 * a1;
const calcBezier = (t, a1, a2) => ((a(a1, a2) * t + b(a1, a2)) * t + c(a1)) * t;
const getSlope = (t, a1, a2) => 3 * a(a1, a2) * t * t + 2 * b(a1, a2) * t + c(a1);
const getTforX = (x) => {
let aGuessT = x;
for (let i = 0; i < 4; ++i) {
const currentSlope = getSlope(aGuessT, p0, p2);
if (currentSlope === 0)
return aGuessT;
const currentX = calcBezier(aGuessT, p0, p2) - x;
aGuessT -= currentX / currentSlope;
}
return aGuessT;
};
return (x) => p0 === p1 && p2 === p3 ? x : calcBezier(getTforX(x), p1, p3);
}
function useTransition(source, options = {}) {
const {
delay = 0,
disabled = false,
duration = 1e3,
onFinished = noop,
onStarted = noop,
transition = identity
} = options;
const currentTransition = computed$1(() => {
const t = unref(transition);
return isFunction$2(t) ? t : createEasingFunction(t);
});
const sourceValue = computed$1(() => {
const s = unref(source);
return isNumber$1(s) ? s : s.map(unref);
});
const sourceVector = computed$1(() => isNumber$1(sourceValue.value) ? [sourceValue.value] : sourceValue.value);
const outputVector = ref(sourceVector.value.slice(0));
let currentDuration;
let diffVector;
let endAt;
let startAt;
let startVector;
const { resume, pause } = useRafFn(() => {
const now = Date.now();
const progress = clamp(1 - (endAt - now) / currentDuration, 0, 1);
outputVector.value = startVector.map((val, i) => {
var _a2;
return val + ((_a2 = diffVector[i]) != null ? _a2 : 0) * currentTransition.value(progress);
});
if (progress >= 1) {
pause();
onFinished();
}
}, { immediate: false });
const start = () => {
pause();
currentDuration = unref(duration);
diffVector = outputVector.value.map((n, i) => {
var _a2, _b;
return ((_a2 = sourceVector.value[i]) != null ? _a2 : 0) - ((_b = outputVector.value[i]) != null ? _b : 0);
});
startVector = outputVector.value.slice(0);
startAt = Date.now();
endAt = startAt + currentDuration;
resume();
onStarted();
};
const timeout = useTimeoutFn(start, delay, { immediate: false });
watch(sourceVector, () => {
if (unref(disabled)) {
outputVector.value = sourceVector.value.slice(0);
} else {
if (unref(delay) <= 0)
start();
else
timeout.start();
}
}, { deep: true });
return computed$1(() => {
const targetVector = unref(disabled) ? sourceVector : outputVector;
return isNumber$1(sourceValue.value) ? targetVector.value[0] : targetVector.value;
});
}
function useWindowSize(options = {}) {
const {
window: window2 = defaultWindow,
initialWidth = Infinity,
initialHeight = Infinity,
listenOrientation = true,
includeScrollbar = true
} = options;
const width = ref(initialWidth);
const height = ref(initialHeight);
const update = () => {
if (window2) {
if (includeScrollbar) {
width.value = window2.innerWidth;
height.value = window2.innerHeight;
} else {
width.value = window2.document.documentElement.clientWidth;
height.value = window2.document.documentElement.clientHeight;
}
}
};
update();
tryOnMounted(update);
useEventListener("resize", update, { passive: true });
if (listenOrientation)
useEventListener("orientationchange", update, { passive: true });
return { width, height };
}
const dropdownInjectionKey = Symbol("dropdownInjectKey");
const __default__$1t = {
name: "TeleportWrapper"
};
const _sfc_main$1z = defineComponent({
...__default__$1t,
props: {
to: { default: "" },
disabled: { type: Boolean, default: false }
},
setup(__props) {
const props = __props;
const target = ref(null);
onMounted(() => {
const observer = new MutationObserver((mutationList, observer2) => {
for (const mutation of mutationList) {
if (mutation.type !== "childList")
continue;
const el = document.querySelector(props.to);
if (!el)
continue;
target.value = el;
observer2.disconnect();
break;
}
});
observer.observe(document, { childList: true, subtree: true });
return () => observer.disconnect();
});
return (_ctx, _cache) => {
return openBlock(), createBlock(Teleport, {
to: target.value,
disabled: !target.value || __props.disabled
}, [
renderSlot(_ctx.$slots, "default")
], 8, ["to", "disabled"]);
};
}
});
const isScrollElement = (element) => {
return element.scrollHeight > element.offsetHeight || element.scrollWidth > element.offsetWidth;
};
const getScrollElements = (container) => {
var _a2;
const scrollElements = [];
let element = container;
while (element && element !== document.documentElement) {
if (isScrollElement(element)) {
scrollElements.push(element);
}
element = (_a2 = element.parentElement) != null ? _a2 : void 0;
}
return scrollElements;
};
const getChildrenArray = (vn) => {
if (isArrayChildren(vn, vn.children)) {
return vn.children;
}
if (Array.isArray(vn)) {
return vn;
}
return void 0;
};
const getFirstElementFromVNode = (vn) => {
var _a2, _b;
if (isElement(vn)) {
return vn.el;
}
if (isComponent(vn)) {
if (((_a2 = vn.el) == null ? void 0 : _a2.nodeType) === 1) {
return vn.el;
}
if ((_b = vn.component) == null ? void 0 : _b.subTree) {
const ele = getFirstElementFromVNode(vn.component.subTree);
if (ele)
return ele;
}
} else {
const children = getChildrenArray(vn);
return getFirstElementFromChildren(children);
}
return void 0;
};
const getFirstElementFromChildren = (children) => {
if (children && children.length > 0) {
for (const child of children) {
const element = getFirstElementFromVNode(child);
if (element)
return element;
}
}
return void 0;
};
const useFirstElement = () => {
const children = {};
const firstElement = ref();
const getFirstElement = () => {
const element = getFirstElementFromChildren(children.value);
if (element !== firstElement.value) {
firstElement.value = element;
}
};
onMounted(() => getFirstElement());
onUpdated(() => getFirstElement());
return {
children,
firstElement
};
};
const transformPlacement = (placement) => {
const shouldTransform = placement.includes("-");
const placementMap = {
top: "start",
left: "start",
bottom: "end",
right: "end"
};
if (shouldTransform) {
const separated = placement.split("-");
return `${separated[0]}-${placementMap[separated[1]] || separated[1]}`;
}
return placement;
};
var RenderFunction = defineComponent({
name: "RenderFunction",
props: {
renderFunc: {
type: Function,
default: null
}
},
setup(props, ctx) {
return () => {
if (typeof props.renderFunc !== "function") {
return null;
}
return props.renderFunc(ctx.attrs);
};
}
});
const __default__$1s = {
name: "LayDropdown",
inheritAttrs: false
};
const _sfc_main$1y = defineComponent({
...__default__$1s,
props: {
visible: { type: Boolean, default: false },
trigger: { default: "click" },
placement: { default: "bottom-start" },
disabled: { type: Boolean, default: false },
autoFitPosition: { type: Boolean, default: true },
autoFitWidth: { type: Boolean, default: false },
autoFitMinWidth: { type: Boolean, default: true },
updateAtScroll: { type: Boolean, default: false },
autoFixPosition: { type: Boolean, default: true },
clickToClose: { type: Boolean, default: true },
blurToClose: { type: Boolean, default: true },
clickOutsideToClose: { type: Boolean, default: true },
contentOffset: { default: 2 },
mouseEnterDelay: { default: 150 },
mouseLeaveDelay: { default: 150 },
focusDelay: { default: 150 },
alignPoint: { type: Boolean, default: false },
contentClass: null,
contentStyle: null,
popupContainer: { default: "body" }
},
emits: ["show", "hide"],
setup(__props, { expose, emit }) {
const props = __props;
const slots = useSlots();
const attrs = useAttrs();
const childrenRefs = /* @__PURE__ */ new Set();
const dropdownCtx = inject(dropdownInjectionKey, void 0);
const { children, firstElement: dropdownRef } = useFirstElement();
const contentRef = shallowRef();
const contentStyle = ref({});
const { width: windowWidth, height: windowHeight } = useWindowSize();
const mousePosition = reactive({
x: 0,
y: 0
});
const { x: mouseLeft, y: mouseTop } = toRefs(mousePosition);
const openState = ref(false);
let scrollElements;
const containerRef = computed$1(() => {
var _a2;
return props.popupContainer ? (_a2 = document.querySelector(props.popupContainer)) != null ? _a2 : document.body : dropdownRef.value;
});
const triggerMethods = computed$1(() => [].concat(props.trigger));
const computedPlacement = computed$1(() => {
return transformPlacement(props.placement);
});
let delayTimer = 0;
const cleanDelayTimer = () => {
if (delayTimer) {
window.clearTimeout(delayTimer);
delayTimer = 0;
}
};
const show = (delay) => {
if (props.disabled == false) {
changeVisible(true, delay);
emit("show");
}
};
const hide = (delay) => {
changeVisible(false, delay);
emit("hide");
};
const toggle = () => {
if (props.disabled == false)
if (openState.value) {
hide();
} else {
show();
}
};
const changeVisible = (visible, delay) => {
if (visible === openState.value && delayTimer === 0) {
return;
}
const update = () => {
openState.value = visible;
nextTick(() => {
updateContentStyle();
});
};
if (delay) {
cleanDelayTimer();
if (visible !== openState.value) {
delayTimer = window.setTimeout(update, delay);
}
} else {
update();
}
};
const getElementScrollRect = (element, containerRect) => {
const rect = element.getBoundingClientRect();
return {
top: rect.top,
bottom: rect.bottom,
left: rect.left,
right: rect.right,
width: rect.width,
height: rect.height,
scrollTop: rect.top - containerRect.top,
scrollBottom: rect.bottom - containerRect.top,
scrollLeft: rect.left - containerRect.left,
scrollRight: rect.right - containerRect.left
};
};
const getTriggerRect = () => {
return {
top: mouseTop.value,
bottom: mouseTop.value,
left: mouseLeft.value,
right: mouseLeft.value,
scrollTop: mouseTop.value,
scrollBottom: mouseTop.value,
scrollLeft: mouseLeft.value,
scrollRight: mouseLeft.value,
width: 0,
height: 0
};
};
const updateContentStyle = () => {
if (!containerRef.value || !dropdownRef.value || !contentRef.value) {
return;
}
const containerRect = containerRef.value.getBoundingClientRect();
const triggerRect = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
const contentRect = getElementScrollRect(contentRef.value, containerRect);
const { style } = getContentStyle(computedPlacement.value, triggerRect, contentRect);
if (props.autoFitMinWidth) {
style.minWidth = `${triggerRect.width}px`;
}
if (props.autoFitWidth) {
style.width = `${triggerRect.width}px`;
}
contentStyle.value = style;
if (props.autoFitPosition) {
nextTick(() => {
const triggerRect2 = props.alignPoint ? getTriggerRect() : getElementScrollRect(dropdownRef.value, containerRect);
const contentRect2 = getElementScrollRect(contentRef.value, containerRect);
let { top, left } = style;
top = Number(top.toString().replace("px", ""));
left = Number(left.toString().replace("px", ""));
const { top: fitTop, left: fitLeft } = getFitPlacement(top, left, computedPlacement.value, triggerRect2, contentRect2);
style.top = `${fitTop}px`;
style.left = `${fitLeft}px`;
contentStyle.value = {
...style
};
});
}
};
const updateMousePosition = (e) => {
if (props.alignPoint) {
const { pageX, pageY } = e;
mousePosition.x = pageX;
mousePosition.y = pageY;
}
};
const getContentStyle = (placement, triggerRect, contentRect, {
customStyle = {}
} = {}) => {
let { top, left } = getContentOffset(placement, triggerRect, contentRect);
const style = {
top: `${top}px`,
left: `${left}px`,
...customStyle
};
return {
style
};
};
const getPosition = (placement) => {
if (["top", "top-start", "top-end"].includes(placement)) {
return "top";
}
if (["bottom", "bottom-start", "bottom-end"].includes(placement)) {
return "bottom";
}
if (["left", "left-start", "left-end"].includes(placement)) {
return "left";
}
if (["right", "right-start", "right-end"].includes(placement)) {
return "right";
}
return "bottom";
};
const getFitPlacement = (top, left, placement, triggerRect, contentRect) => {
const position = getPosition(placement);
if (["top", "bottom"].includes(position)) {
if (contentRect.bottom > windowHeight.value) {
top = triggerRect.scrollTop - contentRect.height - props.contentOffset;
}
if (contentRect.top < 0) {
top = triggerRect.scrollBottom + props.contentOffset;
}
if (contentRect.left < 0) {
left = left + (0 - contentRect.left);
}
if (contentRect.right > windowWidth.value) {
left = left - (contentRect.right - windowWidth.value);
}
}
if (["left", "right"].includes(position)) {
if (contentRect.bottom > windowHeight.value) {
top = top - (contentRect.bottom - windowHeight.value);
}
if (contentRect.top < 0) {
top = top + (0 - contentRect.top);
}
if (contentRect.left < 0) {
left = triggerRect.scrollRight + props.contentOffset;
}
if (contentRect.right > windowWidth.value) {
left = triggerRect.scrollLeft - contentRect.width - props.contentOffset;
}
}
return {
top,
left
};
};
const getContentOffset = (placement, triggerRect, contentRect) => {
switch (placement) {
case "top":
return {
top: triggerRect.scrollTop - contentRect.height - props.contentOffset,
left: triggerRect.scrollLeft + Math.round((triggerRect.width - contentRect.width) / 2)
};
case "top-start":
return {
top: triggerRect.scrollTop - contentRect.height - props.contentOffset,
left: triggerRect.scrollLeft
};
case "top-end":
return {
top: triggerRect.scrollTop - contentRect.height - props.contentOffset,
left: triggerRect.scrollRight - contentRect.width
};
case "bottom":
return {
top: triggerRect.scrollBottom + props.contentOffset,
left: triggerRect.scrollLeft + Math.round((triggerRect.width - contentRect.width) / 2)
};
case "bottom-start":
return {
top: triggerRect.scrollBottom + props.contentOffset,
left: triggerRect.scrollLeft
};
case "bottom-end":
return {
top: triggerRect.scrollBottom + props.contentOffset,
left: triggerRect.scrollRight - contentRect.width
};
case "right":
return {
top: triggerRect.scrollTop + Math.round((triggerRect.height - contentRect.height) / 2),
left: triggerRect.scrollRight + props.contentOffset
};
case "right-start":
return {
top: triggerRect.scrollTop,
left: triggerRect.scrollRight + props.contentOffset
};
case "right-end":
return {
top: triggerRect.scrollBottom - contentRect.height,
left: triggerRect.scrollRight + props.contentOffset
};
case "left":
return {
top: triggerRect.scrollTop + Math.round((triggerRect.height - contentRect.height) / 2),
left: triggerRect.scrollLeft - contentRect.width - props.contentOffset
};
case "left-start":
return {
top: triggerRect.scrollTop,
left: triggerRect.scrollLeft - contentRect.width - props.contentOffset
};
case "left-end":
return {
top: triggerRect.scrollBottom - contentRect.height,
left: triggerRect.scrollLeft - contentRect.width - props.contentOffset
};
default:
return {
left: 0,
top: 0
};
}
};
const handleScroll = useThrottleFn(() => {
if (openState.value) {
updateContentStyle();
}
}, 10);
const handleClick = (e) => {
if (props.disabled || openState.value && !props.clickToClose) {
return;
}
if (triggerMethods.value.includes("click")) {
updateMousePosition(e);
toggle();
}
};
const handleContextMenuClick = (e) => {
if (props.disabled || openState.value && !props.clickToClose) {
return;
}
if (triggerMethods.value.includes("contextMenu")) {
e.preventDefault();
if (props.alignPoint) {
hide();
}
updateMousePosition(e);
toggle();
}
};
const handleMouseEnter = (e) => {
if (props.disabled || !triggerMethods.value.includes("hover")) {
return;
}
show(props.mouseEnterDelay);
};
const handleMouseEnterWithContext = (e) => {
if (!props.popupContainer) {
return;
}
dropdownCtx == null ? void 0 : dropdownCtx.onMouseenter(e);
handleMouseEnter();
};
const handleMouseLeave = (e) => {
if (props.disabled || !triggerMethods.value.includes("hover")) {
return;
}
hide(props.mouseLeaveDelay);
};
const handleMouseLeaveWithContext = (e) => {
if (!props.popupContainer) {
return;
}
dropdownCtx == null ? void 0 : dropdownCtx.onMouseleave(e);
handleMouseLeave();
};
const handleFocusin = () => {
if (props.disabled || !triggerMethods.value.includes("focus")) {
return;
}
show(props.focusDelay);
};
const handleFocusout = () => {
if (props.disabled || !triggerMethods.value.includes("focus")) {
return;
}
if (!props.blurToClose) {
return;
}
hide();
};
const handleContextHide = () => {
hide();
dropdownCtx == null ? void 0 : dropdownCtx.hide();
};
const addChildRef = (ref2) => {
childrenRefs.add(ref2);
dropdownCtx == null ? void 0 : dropdownCtx.addChildRef(ref2);
};
const removeChildRef = (ref2) => {
childrenRefs.delete(ref2);
dropdownCtx == null ? void 0 : dropdownCtx.removeChildRef(ref2);
};
dropdownCtx == null ? void 0 : dropdownCtx.addChildRef(contentRef);
const { stop: removeContentResizeObserver } = useResizeObserver(contentRef, () => {
if (openState.value && props.autoFixPosition) {
updateContentStyle();
}
});
const { stop: removeTriggerResizeObserver } = useResizeObserver(dropdownRef, () => {
if (openState.value && props.autoFixPosition) {
updateContentStyle();
}
});
onClickOutside(dropdownRef, (e) => {
var _a2, _b, _c;
if (!props.clickOutsideToClose || !openState.value || ((_a2 = dropdownRef.value) == null ? void 0 : _a2.contains(e.target)) || ((_b = contentRef.value) == null ? void 0 : _b.contains(e.target))) {
return;
}
for (const item of childrenRefs) {
if ((_c = item.value) == null ? void 0 : _c.contains(e.target)) {
return;
}
}
hide();
});
const onlyChildRenderFunc = () => {
const slotContent = slots.default ? slots.default() : [];
const transformedSlotContent = slotContent.map((vnode) => cloneVNode(vnode, {
onClick: handleClick,
onContextmenu: handleContextMenuClick,
onMouseenter: handleMouseEnter,
onMouseleave: handleMouseLeave,
onFocusin: handleFocusin,
onFocusout: handleFocusout,
...attrs
}, true));
children.value = transformedSlotContent;
return h(Fragment, children.value);
};
onMounted(() => {
if (props.updateAtScroll) {
scrollElements = getScrollElements(dropdownRef.value);
for (const item of scrollElements) {
item.addEventListener("scroll", handleScroll);
}
}
window.addEventListener("resize", handleScroll);
});
onBeforeUnmount(() => {
dropdownCtx == null ? void 0 : dropdownCtx.removeChildRef(contentRef);
if (scrollElements) {
for (const item of scrollElements) {
item.removeEventListener("scroll", handleScroll);
}
scrollElements = void 0;
}
removeContentResizeObserver();
removeTriggerResizeObserver();
window.removeEventListener("resize", handleScroll);
});
watch(() => props.visible, (newVal, oldVal) => {
openState.value = newVal;
}, { immediate: true });
provide(dropdownInjectionKey, reactive({
onMouseenter: handleMouseEnterWithContext,
onMouseleave: handleMouseLeaveWithContext,
addChildRef,
removeChildRef,
hide: handleContextHide
}));
provide("openState", openState);
expose({ show, hide, toggle });
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
createVNode(unref(RenderFunction), mergeProps({ renderFunc: onlyChildRenderFunc }, _ctx.$attrs), null, 16),
createVNode(_sfc_main$1z, {
to: __props.popupContainer,
disabled: __props.disabled
}, {
default: withCtx(() => {
var _a2;
return [
openState.value ? (openBlock(), createElementBlock("div", {
key: 0,
ref_key: "contentRef",
ref: contentRef,
class: normalizeClass([
"layui-dropdown-content",
"layui-anim",
"layui-anim-upbit",
props.contentClass
]),
style: normalizeStyle([contentStyle.value, (_a2 = props.contentStyle) != null ? _a2 : ""]),
onMouseenter: handleMouseEnterWithContext,
onMouseleave: handleMouseLeaveWithContext
}, [
renderSlot(_ctx.$slots, "content")
], 38)) : createCommentVNode("", true)
];
}),
_: 3
}, 8, ["to", "disabled"])
], 64);
};
}
});
var index$T = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}\n")();
const _sfc_main$1x = {};
const _hoisted_1$10 = {
focusable: "false",
class: "",
"data-icon": "eye-invisible",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
};
const _hoisted_2$Q = /* @__PURE__ */ createElementVNode("path", { d: "M942.2 486.2Q889.47 375.11 816.7 305l-50.88 50.88C807.31 395.53 843.45 447.4 874.7 512 791.5 684.2 673.4 766 512 766q-72.67 0-133.87-22.38L323 798.75Q408 838 512 838q288.3 0 430.2-300.3a60.29 60.29 0 000-51.5zm-63.57-320.64L836 122.88a8 8 0 00-11.32 0L715.31 232.2Q624.86 186 512 186q-288.3 0-430.2 300.3a60.3 60.3 0 000 51.5q56.69 119.4 136.5 191.41L112.48 835a8 8 0 000 11.31L155.17 889a8 8 0 0011.31 0l712.15-712.12a8 8 0 000-11.32zM149.3 512C232.6 339.8 350.7 258 512 258c54.54 0 104.13 9.36 149.12 28.39l-70.3 70.3a176 176 0 00-238.13 238.13l-83.42 83.42C223.1 637.49 183.3 582.28 149.3 512zm246.7 0a112.11 112.11 0 01146.2-106.69L401.31 546.2A112 112 0 01396 512z" }, null, -1);
const _hoisted_3$J = /* @__PURE__ */ createElementVNode("path", { d: "M508 624c-3.46 0-6.87-.16-10.25-.47l-52.82 52.82a176.09 176.09 0 00227.42-227.42l-52.82 52.82c.31 3.38.47 6.79.47 10.25a111.94 111.94 0 01-112 112z" }, null, -1);
const _hoisted_4$y = [
_hoisted_2$Q,
_hoisted_3$J
];
function _sfc_render$3(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$10, _hoisted_4$y);
}
var PasswordIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["render", _sfc_render$3]]);
const _sfc_main$1w = {};
const _hoisted_1$$ = {
focusable: "false",
class: "",
"data-icon": "eye",
width: "1em",
height: "1em",
fill: "currentColor",
"aria-hidden": "true",
viewBox: "64 64 896 896"
};
const _hoisted_2$P = /* @__PURE__ */ createElementVNode("path", { d: "M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z" }, null, -1);
const _hoisted_3$I = [
_hoisted_2$P
];
function _sfc_render$2(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$$, _hoisted_3$I);
}
var UnPasswordIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["render", _sfc_render$2]]);
const _hoisted_1$_ = ["size"];
const _hoisted_2$O = {
key: 0,
class: "layui-input-prepend"
};
const _hoisted_3$H = { class: "layui-input-wrapper" };
const _hoisted_4$x = {
key: 0,
class: "layui-input-prefix"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$p = ["type", "name", "disabled", "placeholder", "autofocus", "autocomplete", "maxlength", "max", "min", "readonly", "value"];
2022-11-15 01:16:55 +00:00
const _hoisted_6$j = {
key: 2,
class: "layui-input-clear"
};
const _hoisted_7$g = {
key: 3,
class: "layui-input-suffix"
};
const _hoisted_8$c = {
key: 1,
class: "layui-input-append"
};
const __default__$1r = {
name: "LayInput"
};
const _sfc_main$1v = defineComponent({
...__default__$1r,
props: {
name: null,
type: null,
prefixIcon: null,
suffixIcon: null,
modelValue: { default: "" },
allowClear: { type: Boolean, default: false },
autocomplete: null,
placeholder: null,
autofocus: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
readonly: { type: Boolean, default: false },
password: { type: Boolean, default: false },
size: { default: "md" },
maxlength: null,
max: null,
2022-12-30 08:13:19 +00:00
min: null,
qfw: { type: Boolean, default: false }
2022-11-15 01:16:55 +00:00
},
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
setup(__props, { emit }) {
const props = __props;
const slots = useSlots();
const type4 = ref(props.type);
const currentValue = ref(String(props.modelValue == null ? "" : props.modelValue));
const hasContent = computed$1(() => {
var _a2;
return ((_a2 = props.modelValue) == null ? void 0 : _a2.length) > 0;
});
const isPassword = computed$1(() => type4.value == "password");
const composing = ref(false);
2022-12-30 08:14:41 +00:00
const formatMoney = function(s) {
2023-01-11 07:58:59 +00:00
if (s == "") {
return "";
}
2022-12-30 08:14:41 +00:00
var noNegative = true;
s = parseFloat((s + "").replace(/[^\d\.-]/g, "")) + "";
if (parseFloat(s) < 0) {
s = Math.abs(s) + "";
noNegative = false;
}
var l = s.split(".")[0].split("").reverse(), r = s.split(".")[1];
var t = "";
for (let i = 0; i < l.length; i++) {
if (i % 3 == 2 && i != l.length - 1) {
t += l[i] + ",";
} else {
t += l[i] + "";
}
}
let z = (noNegative ? "" : "-") + t.split("").reverse().join("");
if (r) {
return z + "." + r;
} else {
return isNaN(parseInt(z)) ? 0 : z;
}
};
2022-11-15 01:16:55 +00:00
watch(() => props.type, () => {
type4.value = props.type;
});
2022-12-30 08:14:41 +00:00
const input = ref();
2022-11-15 01:16:55 +00:00
watch(() => props.modelValue, () => {
2022-12-30 08:14:41 +00:00
console.log(input);
if (!(input.value == document.activeElement) && props.qfw) {
currentValue.value = formatMoney(props.modelValue.toString());
2022-12-30 08:13:19 +00:00
return;
}
2022-11-15 01:16:55 +00:00
currentValue.value = String(props.modelValue == null ? "" : props.modelValue);
});
const onInput = function(event) {
const inputElement = event.target;
2022-12-30 08:13:19 +00:00
let value = inputElement.value;
2022-11-15 01:16:55 +00:00
emit("input", value);
if (composing.value)
return;
2022-12-30 08:13:19 +00:00
if (props.qfw) {
value = value.replace(/,/g, "");
}
2022-11-15 01:16:55 +00:00
emit("update:modelValue", value);
};
const onClear = () => {
emit("update:modelValue", "");
emit("clear");
};
const onFocus = (event) => {
2022-12-30 08:13:19 +00:00
currentValue.value = new String(props.modelValue).replace(/,/g, "");
2022-11-15 01:16:55 +00:00
emit("focus", event);
};
const onChange = (event) => {
const inputElement = event.target;
2022-12-30 08:13:19 +00:00
let value = inputElement.value;
if (props.qfw) {
value = value.replace(/,/g, "");
}
2022-11-15 01:16:55 +00:00
emit("change", value);
};
const onBlur = (event) => {
if (props.type === "number") {
onNumberBlur(event);
}
2022-12-30 08:14:41 +00:00
if (props.qfw) {
try {
let reg = /\d{1,3}(?=(\d{3})+$)/g;
console.log("\u6DFB\u52A0\uFF0C", formatMoney(props.modelValue.toString()));
currentValue.value = formatMoney(props.modelValue.toString());
} catch {
currentValue.value = "\u8F93\u5165\u9519\u8BEF";
}
}
2022-11-15 01:16:55 +00:00
emit("blur", event);
};
const onNumberBlur = (event) => {
let value = event.target.value;
if (value === "") {
value = props.min ? String(props.min) : "0";
} else {
if (props.max && props.max < Number(value))
value = props.max.toString();
if (props.min && props.min > Number(value))
value = props.min.toString();
}
2022-12-30 08:13:19 +00:00
if (props.qfw) {
value = value.replace(/,/g, "");
}
2022-11-15 01:16:55 +00:00
emit("update:modelValue", value);
};
const onCompositionstart = () => {
composing.value = true;
};
const onCompositionend = (event) => {
composing.value = false;
onInput(event);
};
const classes = computed$1(() => {
return {
"layui-input-disabled": props.disabled,
"layui-input-has-prefix": slots.prefix || props.prefixIcon
};
});
const showPassword = () => {
if (isPassword.value) {
type4.value = "text";
} else {
type4.value = "password";
}
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-input", unref(classes)]),
size: __props.size
}, [
unref(slots).prepend ? (openBlock(), createElementBlock("div", _hoisted_2$O, [
renderSlot(_ctx.$slots, "prepend")
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_3$H, [
unref(slots).prefix || props.prefixIcon ? (openBlock(), createElementBlock("span", _hoisted_4$x, [
unref(slots).prefix ? renderSlot(_ctx.$slots, "prefix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: props.prefixIcon,
class: "layui-input-prefix-icon"
}, null, 8, ["type"]))
])) : createCommentVNode("", true),
createElementVNode("input", {
type: type4.value,
name: __props.name,
disabled: __props.disabled,
placeholder: __props.placeholder,
autofocus: __props.autofocus,
autocomplete: __props.autocomplete,
maxlength: __props.maxlength,
max: __props.max,
min: __props.min,
readonly: __props.readonly,
value: currentValue.value,
onInput,
onChange,
onFocus,
onBlur,
onCompositionstart,
2022-12-30 08:14:41 +00:00
onCompositionend,
ref_key: "input",
ref: input
2022-12-30 08:13:19 +00:00
}, null, 40, _hoisted_5$p),
2022-11-15 01:16:55 +00:00
__props.password && unref(hasContent) ? (openBlock(), createElementBlock("span", {
key: 1,
class: "layui-input-password",
onClick: showPassword
}, [
unref(isPassword) ? (openBlock(), createBlock(PasswordIcon, { key: 0 })) : (openBlock(), createBlock(UnPasswordIcon, { key: 1 }))
])) : createCommentVNode("", true),
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_6$j, [
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-close-fill",
onClick: withModifiers(onClear, ["stop"])
}, null, 8, ["onClick"])
])) : createCommentVNode("", true),
unref(slots).suffix || props.suffixIcon ? (openBlock(), createElementBlock("span", _hoisted_7$g, [
unref(slots).suffix ? renderSlot(_ctx.$slots, "suffix", { key: 0 }) : (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: props.suffixIcon,
class: "layui-input-suffix-icon"
}, null, 8, ["type"]))
])) : createCommentVNode("", true)
]),
unref(slots).append ? (openBlock(), createElementBlock("div", _hoisted_8$c, [
renderSlot(_ctx.$slots, "append")
])) : createCommentVNode("", true)
], 10, _hoisted_1$_);
};
}
});
var index$S = /* @__PURE__ */ (() => ".layui-scroll{height:100%;overflow:hidden!important}.layui-scroll-y{position:relative;height:100%}.layui-scroll-y .layui-scroll-wrap{height:100%;overflow-y:scroll;scrollbar-width:none;-ms-overflow-style:none}.layui-scroll-y .layui-scroll-track{position:absolute;top:0;right:0;bottom:0;border-radius:8px;z-index:20}.layui-scroll-y .layui-scroll-track .layui-scroll-thumb{margin:0 auto;border-radius:6px;cursor:default}.layui-scroll-y ::-webkit-scrollbar{display:none}\n")();
const _hoisted_1$Z = { class: "layui-scroll-y" };
const _hoisted_2$N = ["onMousedown"];
const __default__$1q = {
name: "LayScroll"
};
const _sfc_main$1u = defineComponent({
...__default__$1q,
props: {
height: { default: "100%" },
trackColor: { default: "rgba(0,0,0,0)" },
thumbColor: { default: "#eeeeee" },
thumbWidth: { default: 6 }
},
emits: ["arrive"],
setup(__props, { emit }) {
const scrollRef = ref();
const barRef = ref();
const data = reactive({
translateY: 0,
heightPre: 0,
barHeight: 0,
winWidth: document.body.clientWidth
});
let time;
let isMove = false;
let moveClientY = 0;
let trackHeight = 0;
let wrapHeight = 0;
let wrapContentHeight = 0;
onMounted(() => {
monitorWindow();
monitorScrollBar();
nextTick(() => {
calculationLength();
});
});
onUnmounted(() => {
window.clearInterval(time);
});
const monitorWindow = function() {
let time2;
window.addEventListener("resize", () => {
data.winWidth = document.body.clientWidth;
clearTimeout(time2);
time2 = setTimeout(() => {
initScrollListner();
}, 500);
});
};
const monitorScrollBar = function() {
let MutationObserver2 = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
const observer = new MutationObserver2((mutations) => {
initScrollListner();
});
observer.observe(scrollRef.value, {
attributes: true,
childList: true,
subtree: true
});
};
const calculationLength = function() {
time = setInterval(() => {
initScrollListner();
}, 50);
setTimeout(() => {
window.clearInterval(time);
}, 2e3);
};
const initScrollListner = function() {
let scroll = scrollRef.value;
let bar = barRef.value;
if (scroll && bar) {
wrapContentHeight = scroll.scrollHeight;
wrapHeight = scroll.clientHeight;
trackHeight = bar.clientHeight;
data.heightPre = wrapHeight / wrapContentHeight;
data.barHeight = data.heightPre * trackHeight;
}
};
const onMosewheel = (e) => {
data.translateY = e.target.scrollTop * data.heightPre;
if (data.translateY == 0) {
arrive("top");
} else if (e.target.scrollTop + e.target.offsetHeight == e.target.scrollHeight) {
arrive("bottom");
}
};
const arrive = (tb) => {
emit("arrive", tb);
};
const moveStart = (e) => {
isMove = true;
moveClientY = e.clientY - data.translateY;
moveTo2();
moveEnd();
};
const moveTo2 = () => {
document.onmousemove = (e) => {
if (isMove) {
if (e.clientY - moveClientY > trackHeight - data.barHeight) {
data.translateY = trackHeight - data.barHeight;
} else if (e.clientY - moveClientY < 0) {
data.translateY = 0;
} else {
data.translateY = e.clientY - moveClientY;
}
if (scrollRef.value) {
scrollRef.value.scrollTop = data.translateY / data.heightPre;
}
}
};
};
const moveEnd = function() {
document.onmouseup = (e) => {
if (isMove) {
isMove = false;
}
};
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-scroll", { hide: data.winWidth < 500 }]),
style: normalizeStyle({ height: __props.height })
}, [
createElementVNode("div", _hoisted_1$Z, [
createElementVNode("div", {
ref_key: "scrollRef",
ref: scrollRef,
class: "layui-scroll-wrap",
onScroll: onMosewheel
}, [
renderSlot(_ctx.$slots, "default")
], 544),
createElementVNode("div", {
ref_key: "barRef",
ref: barRef,
class: "layui-scroll-track",
style: normalizeStyle({
backgroundColor: data.heightPre == 1 ? "transparent" : __props.trackColor
})
}, [
createElementVNode("div", {
style: normalizeStyle({
height: data.barHeight + "px",
width: __props.thumbWidth + "px",
transform: "translateY(" + data.translateY + "px)",
backgroundColor: data.heightPre == 1 ? "transparent" : __props.thumbColor
}),
class: "layui-scroll-thumb",
onMousedown: withModifiers(moveStart, ["stop", "prevent"])
}, null, 44, _hoisted_2$N)
], 4)
])
], 6);
};
}
});
const _hoisted_1$Y = { class: "layui-inline layui-iconpicker-main" };
2022-12-30 08:13:19 +00:00
const _hoisted_2$M = {
key: 0,
class: "layui-icon-picker-clear"
};
const _hoisted_3$G = { class: "layui-inline layui-iconpicker-suffix" };
const _hoisted_4$w = { class: "layui-iconpicker-view layui-iconpicker-scroll" };
const _hoisted_5$o = {
2022-11-15 01:16:55 +00:00
key: 0,
class: "layui-iconpicker-search"
};
2022-12-30 08:13:19 +00:00
const _hoisted_6$i = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-search" }, null, -1);
const _hoisted_7$f = { class: "layui-iconpicker-list" };
const _hoisted_8$b = ["onClick"];
const _hoisted_9$9 = { class: "layui-elip" };
const _hoisted_10$9 = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-iconpicker-page"
};
2022-12-30 08:13:19 +00:00
const _hoisted_11$9 = {
2022-11-15 01:16:55 +00:00
id: "layui-laypage-1",
class: "layui-laypage layui-laypage-default"
};
2022-12-30 08:13:19 +00:00
const _hoisted_12$7 = { class: "layui-laypage-count" };
const _hoisted_13$7 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-left" }, null, -1);
const _hoisted_14$4 = [
_hoisted_13$7
2022-11-15 01:16:55 +00:00
];
2022-12-30 08:13:19 +00:00
const _hoisted_15$3 = { class: "layui-laypage-curr" };
const _hoisted_16$3 = /* @__PURE__ */ createElementVNode("em", { class: "layui-laypage-em" }, null, -1);
const _hoisted_17$3 = /* @__PURE__ */ createElementVNode("span", { class: "layui-laypage-spr" }, "\u2026", -1);
const _hoisted_18$2 = /* @__PURE__ */ createElementVNode("a", {
2022-11-15 01:16:55 +00:00
href: "javascript:;",
class: "layui-laypage-last",
title: "\u5C3E\u9875"
}, "14", -1);
2022-12-30 08:13:19 +00:00
const _hoisted_19$2 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-right" }, null, -1);
const _hoisted_20$2 = [
_hoisted_19$2
2022-11-15 01:16:55 +00:00
];
const __default__$1p = {
name: "LayIconPicker"
};
const _sfc_main$1t = defineComponent({
...__default__$1p,
props: {
page: { type: Boolean, default: false },
modelValue: { default: "layui-icon-face-smile" },
disabled: { type: Boolean, default: false },
showSearch: { type: Boolean },
2022-12-30 08:13:19 +00:00
allowClear: { type: Boolean },
2022-11-15 01:16:55 +00:00
contentClass: null,
contentStyle: null
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const selectedIcon = computed$1(() => props.modelValue);
const dropdownRef = ref(null);
2022-12-30 08:13:19 +00:00
const openState = ref(false);
2022-11-15 01:16:55 +00:00
const selectIcon = function(icon) {
var _a2;
emit("update:modelValue", icon);
emit("change", icon);
(_a2 = dropdownRef.value) == null ? void 0 : _a2.hide();
};
2022-12-30 08:13:19 +00:00
const onClear = function() {
emit("update:modelValue", "");
};
const hasContent = computed$1(() => {
return props.modelValue != null && props.modelValue != "";
});
2022-11-15 01:16:55 +00:00
const icones = ref([]);
const total = ref(iconfont.length);
const totalPage = ref(total.value / 12);
const currentPage = ref(1);
if (props.page) {
icones.value = iconfont.slice(0, 12);
} else {
icones.value = iconfont;
}
const next = () => {
if (currentPage.value === totalPage.value) {
return;
}
currentPage.value = currentPage.value + 1;
const start = (currentPage.value - 1) * 12;
const end = start + 12;
icones.value = iconfont.slice(start, end);
};
const prev = () => {
if (currentPage.value === 1) {
return;
}
currentPage.value = currentPage.value - 1;
const start = (currentPage.value - 1) * 12;
const end = start + 12;
icones.value = iconfont.slice(start, end);
};
const clear2 = () => {
const start = (currentPage.value - 1) * 12;
const end = start + 12;
if (props.page) {
icones.value = iconfont.slice(start, end);
total.value = iconfont.length;
totalPage.value = Math.ceil(iconfont.length / 12);
} else {
icones.value = iconfont;
}
};
const search = (e) => {
currentPage.value = 1;
const start = (currentPage.value - 1) * 12;
const end = start + 12;
const text = e;
if (text) {
if (props.page) {
icones.value = searchList(text, iconfont).slice(start, end);
total.value = searchList(text, iconfont).length;
totalPage.value = Math.ceil(searchList(text, iconfont).length / 12);
} else {
icones.value = searchList(text, iconfont);
}
} else {
if (props.page) {
icones.value = iconfont.slice(start, end);
total.value = iconfont.length;
totalPage.value = Math.ceil(iconfont.length / 12);
} else {
icones.value = iconfont;
}
}
};
const searchList = (str, container) => {
var newList = [];
var startChar = str.charAt(0);
var strLen = str.length;
for (var i = 0; i < container.length; i++) {
var obj = container[i];
var isMatch = false;
for (var p in obj) {
if (typeof obj[p] == "function") {
obj[p]();
} else {
var curItem = "";
if (obj[p] != null) {
curItem = obj[p];
}
for (var j = 0; j < curItem.length; j++) {
if (curItem.charAt(j) == startChar) {
if (curItem.substring(j).substring(0, strLen) == str) {
isMatch = true;
break;
}
}
}
}
}
if (isMatch) {
newList.push(obj);
}
}
return newList;
};
return (_ctx, _cache) => {
2022-12-30 08:13:19 +00:00
const _component_lay_icon = resolveComponent("lay-icon");
2022-11-15 01:16:55 +00:00
return openBlock(), createBlock(_sfc_main$1y, {
ref_key: "dropdownRef",
ref: dropdownRef,
disabled: __props.disabled,
contentClass: __props.contentClass,
contentStyle: __props.contentStyle,
2022-12-30 08:13:19 +00:00
onHide: _cache[2] || (_cache[2] = ($event) => openState.value = false),
onShow: _cache[3] || (_cache[3] = ($event) => openState.value = true),
2022-11-15 01:16:55 +00:00
updateAtScroll: ""
}, {
content: withCtx(() => [
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_4$w, [
__props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_5$o, [
2022-11-15 01:16:55 +00:00
createVNode(_sfc_main$1v, {
onInput: search,
onClear: clear2,
autocomplete: "true",
"allow-clear": true
}, {
prefix: withCtx(() => [
2022-12-30 08:13:19 +00:00
_hoisted_6$i
2022-11-15 01:16:55 +00:00
]),
_: 1
})
])) : createCommentVNode("", true),
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_7$f, [
2022-11-15 01:16:55 +00:00
createVNode(_sfc_main$1u, {
style: { "height": "200px" },
thumbColor: "rgb(238, 238, 238)"
}, {
default: withCtx(() => [
createElementVNode("ul", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(icones.value, (icon) => {
return openBlock(), createElementBlock("li", {
key: icon,
class: normalizeClass([unref(selectedIcon) === icon.class ? "layui-this" : ""]),
onClick: ($event) => selectIcon(icon.class)
}, [
createElementVNode("i", {
class: normalizeClass(["layui-icon", [icon.class]])
}, null, 2),
2022-12-30 08:13:19 +00:00
createElementVNode("p", _hoisted_9$9, toDisplayString$1(icon.name), 1)
], 10, _hoisted_8$b);
2022-11-15 01:16:55 +00:00
}), 128))
])
]),
_: 1
})
]),
2022-12-30 08:13:19 +00:00
__props.page ? (openBlock(), createElementBlock("div", _hoisted_10$9, [
createElementVNode("div", _hoisted_11$9, [
createElementVNode("span", _hoisted_12$7, "\u5171 " + toDisplayString$1(total.value) + " \u4E2A", 1),
2022-11-15 01:16:55 +00:00
createElementVNode("a", {
href: "javascript:;",
class: normalizeClass(["layui-laypage-prev", [currentPage.value === 1 ? "layui-disabled" : ""]]),
onClick: _cache[0] || (_cache[0] = ($event) => prev())
2022-12-30 08:13:19 +00:00
}, _hoisted_14$4, 2),
createElementVNode("span", _hoisted_15$3, [
_hoisted_16$3,
2022-11-15 01:16:55 +00:00
createElementVNode("em", null, toDisplayString$1(currentPage.value) + " / " + toDisplayString$1(totalPage.value), 1)
]),
_hoisted_17$3,
2022-12-30 08:13:19 +00:00
_hoisted_18$2,
2022-11-15 01:16:55 +00:00
createElementVNode("a", {
href: "javascript:;",
class: normalizeClass([[currentPage.value === totalPage.value ? "layui-disabled" : ""], "layui-laypage-next"]),
onClick: _cache[1] || (_cache[1] = ($event) => next())
2022-12-30 08:13:19 +00:00
}, _hoisted_20$2, 2)
2022-11-15 01:16:55 +00:00
])
])) : createCommentVNode("", true)
])
]),
default: withCtx(() => [
createElementVNode("div", {
class: normalizeClass(["layui-inline layui-border-box layui-iconpicker layui-iconpicker-split", [{ "layui-colorpicker-disabled": __props.disabled }]])
}, [
createElementVNode("div", _hoisted_1$Y, [
createElementVNode("i", {
class: normalizeClass(["layui-inline layui-icon", [unref(selectedIcon)]])
}, null, 2)
]),
2022-12-30 08:13:19 +00:00
__props.allowClear && unref(hasContent) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_2$M, [
createVNode(_component_lay_icon, {
type: "layui-icon-close-fill",
onClick: withModifiers(onClear, ["stop"])
}, null, 8, ["onClick"])
])) : createCommentVNode("", true),
createElementVNode("span", _hoisted_3$G, [
createElementVNode("i", {
class: normalizeClass(["layui-icon layui-icon-down", [openState.value ? "transform" : ""]])
}, null, 2)
])
2022-11-15 01:16:55 +00:00
], 2)
]),
_: 1
}, 8, ["disabled", "contentClass", "contentStyle"]);
};
}
});
const component$1c = withInstall(_sfc_main$1t);
var index$R = /* @__PURE__ */ (() => ":root{--card-border-radius: var(--global-border-radius)}.layui-card{margin-bottom:15px;background-color:#fff;border-radius:var(--card-border-radius)}.layui-card .layui-card-header{height:42px;line-height:42px;padding:0 15px;border-bottom:1px solid #f6f6f6;font-size:14px}.layui-card .layui-card-footer{height:42px;line-height:42px;padding:0 15px;border-top:1px solid #f6f6f6;font-size:14px}.layui-card .layui-card-header .layui-card-header-extra{float:right}.layui-card .layui-card-body{padding:10px 15px;line-height:24px}.layui-card:last-child{margin-bottom:0}.layui-card.is-hover-shadow:hover,.layui-card.shadow{box-shadow:0 1px 2px #0000000d}\n")();
const _hoisted_1$X = {
key: 0,
class: "layui-card-header"
};
const _hoisted_2$L = { class: "layui-card-header-title" };
const _hoisted_3$F = {
key: 0,
class: "layui-card-header-extra"
};
const _hoisted_4$v = { class: "layui-card-body" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$n = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-card-footer"
};
const __default__$1o = {
name: "LayCard"
};
const _sfc_main$1s = defineComponent({
...__default__$1o,
props: {
title: null,
shadow: { default: "always" }
},
setup(__props) {
const props = __props;
const slots = useSlots();
const classes = computed$1(() => {
return {
shadow: props.shadow === "always",
"is-hover-shadow": props.shadow === "hover"
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-card", unref(classes)])
}, [
unref(slots).title || __props.title || unref(slots).extra ? (openBlock(), createElementBlock("div", _hoisted_1$X, [
createElementVNode("span", _hoisted_2$L, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString$1(__props.title), 1)
])
]),
unref(slots).extra ? (openBlock(), createElementBlock("span", _hoisted_3$F, [
renderSlot(_ctx.$slots, "extra")
])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_4$v, [
unref(slots).body ? renderSlot(_ctx.$slots, "body", { key: 0 }) : renderSlot(_ctx.$slots, "default", { key: 1 })
]),
2022-12-30 08:13:19 +00:00
unref(slots).footer ? (openBlock(), createElementBlock("div", _hoisted_5$n, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "footer")
])) : createCommentVNode("", true)
], 2);
};
}
});
const component$1b = withInstall(_sfc_main$1s);
var index$Q = /* @__PURE__ */ (() => ".layui-header{box-sizing:border-box;height:60px}\n")();
const _hoisted_1$W = { class: "layui-header" };
const __default__$1n = {
name: "LayHeader"
};
const _sfc_main$1r = /* @__PURE__ */ defineComponent({
...__default__$1n,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$W, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
var index$P = /* @__PURE__ */ (() => ".layui-footer{box-sizing:border-box}\n")();
const _hoisted_1$V = { class: "layui-footer" };
const __default__$1m = {
name: "LayFooter"
};
const _sfc_main$1q = /* @__PURE__ */ defineComponent({
...__default__$1m,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$V, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
var index$O = /* @__PURE__ */ (() => ".layui-header{box-sizing:border-box;height:60px}.layui-layout{flex:1;display:flex;flex-basis:auto;box-sizing:border-box}.layui-layout-vertical{flex-direction:column}.layui-layout-left{position:absolute!important;left:200px;top:0}.layui-layout-right{position:absolute!important;right:0;top:0}\n")();
const __default__$1l = {
name: "LayLayout"
};
const _sfc_main$1p = defineComponent({
...__default__$1l,
props: {
isVertical: { type: Boolean, default: false }
},
setup(__props) {
const slots = useSlots();
const isVertical = computed$1(() => {
if (!slots.default)
return false;
const vNodes = slots.default();
return vNodes.some((vNode) => {
const componentName = vNode.type.name;
if (!componentName)
return false;
return [_sfc_main$1r.name].includes(componentName) || [_sfc_main$1q.name].includes(componentName);
});
});
const classes = computed$1(() => {
return ["layui-layout", { "layui-layout-vertical": isVertical.value }];
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("section", {
class: normalizeClass(unref(classes))
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$1a = withInstall(_sfc_main$1p);
var index$N = /* @__PURE__ */ (() => ".layui-side{overflow:auto;overflow-x:hidden;box-sizing:border-box;min-height:300px}\n")();
const __default__$1k = {
name: "LaySide"
};
const _sfc_main$1o = defineComponent({
...__default__$1k,
props: {
width: { default: "200px" }
},
setup(__props) {
const props = __props;
const styles = computed$1(() => {
return {
flex: `0 0 ${props.width}`,
width: `${props.width}`
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: "layui-side",
style: normalizeStyle(unref(styles))
}, [
renderSlot(_ctx.$slots, "default")
], 4);
};
}
});
const component$19 = withInstall(_sfc_main$1o);
var index$M = /* @__PURE__ */ (() => ".layui-body{display:block;flex:1;overflow:auto;height:100%;box-sizing:border-box;min-height:300px}\n")();
const _hoisted_1$U = { class: "layui-body" };
const __default__$1j = {
name: "LayBody"
};
const _sfc_main$1n = /* @__PURE__ */ defineComponent({
...__default__$1j,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$U, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$18 = withInstall(_sfc_main$1n);
const component$17 = withInstall(_sfc_main$1r);
const component$16 = withInstall(_sfc_main$1q);
var index$L = /* @__PURE__ */ (() => ".layui-logo{left:0;top:0;width:200px;height:60px;line-height:60px;text-align:center;color:var(--global-primary-color);font-size:16px}\n")();
const _hoisted_1$T = { class: "layui-logo" };
const __default__$1i = {
name: "LayLogo"
};
const _sfc_main$1m = /* @__PURE__ */ defineComponent({
...__default__$1i,
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$T, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$15 = withInstall(_sfc_main$1m);
2022-12-09 08:41:41 +00:00
var index$K = /* @__PURE__ */ (() => ":root{--panel-border-color: var(--global-neutral-color-3);--panel-border-radius: var(--global-border-radius)}.layui-panel{border-width:1px;border-style:solid;margin-bottom:15px;border-radius:var(--panel-border-radius);border-color:var(--panel-border-color);background-color:#fff;padding:12px}.layui-panel.is-hover-shadow:hover,.layui-panel.shadow{box-shadow:1px 1px 4px #00000014}\n")();
2022-11-15 01:16:55 +00:00
const __default__$1h = {
name: "LayPanel"
};
const _sfc_main$1l = defineComponent({
...__default__$1h,
props: {
shadow: { default: "always" }
},
setup(__props) {
const props = __props;
const classes = computed$1(() => {
return {
shadow: props.shadow === "always",
"is-hover-shadow": props.shadow === "hover"
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-panel", unref(classes)])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$14 = withInstall(_sfc_main$1l);
var index$J = /* @__PURE__ */ (() => ".layui-progress{position:relative;height:6px;border-radius:20px;background-color:var(--global-neutral-color-3)}.layui-progress-bar{position:absolute;left:0;top:0;width:0;max-width:100%;height:6px;border-radius:20px;text-align:right;background-color:var(--global-checked-color);transition:all .3s;-webkit-transition:all .3s}.layui-progress-big,.layui-progress-big .layui-progress-bar{height:18px;line-height:18px}.layui-progress-text{position:relative;top:-20px;line-height:18px;font-size:12px;color:#666}.layui-progress-big .layui-progress-text{position:static;padding:0 10px;color:#fff}.lay-progress-circle-container{position:relative;display:inline-block}.lay-progress-circle{position:relative;border-radius:50%;display:inline-block}.lay-progress-circle__text{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}\n")();
const _hoisted_1$S = {
key: 0,
class: "lay-progress-circle"
};
const _hoisted_2$K = ["viewBox", "width", "height"];
const _hoisted_3$E = ["d"];
const _hoisted_4$u = ["d"];
2022-12-30 08:13:19 +00:00
const _hoisted_5$m = {
2022-11-15 01:16:55 +00:00
key: 0,
class: "layui-progress-text lay-progress-circle__text"
};
const _hoisted_6$h = {
key: 0,
class: "layui-progress-text"
};
const __default__$1g = {
name: "LayProgress"
};
const _sfc_main$1k = defineComponent({
...__default__$1g,
props: {
percent: null,
theme: null,
color: null,
size: null,
showText: { type: Boolean },
text: null,
circle: { type: Boolean, default: false },
circleSize: { default: 150 },
circleWidth: { default: 6 }
},
setup(__props) {
const props = __props;
const styles = computed$1(() => {
return [
props.color ? "background-color: " + props.color : "",
{
width: props.percent + "%"
}
];
});
const getCircleColor = computed$1(() => {
let color;
switch (props.theme) {
case "red":
color = "#ff5722";
break;
case "orange":
color = "#ffb800";
break;
case "green":
color = "#009688";
break;
case "cyan":
color = "#2f4056";
break;
case "blue":
color = "#1e9fff";
break;
case "black":
color = "#393d49";
break;
case "gray":
color = "#fafafa";
break;
default:
color = "#5FB878";
break;
}
color = props.color ? props.color : color;
return color;
});
computed$1(() => {
let percent;
if (typeof props.percent == "string") {
percent = parseInt(props.percent);
} else {
percent = props.percent;
}
return percent / 100 * 360;
});
const getStrokeDasharray = computed$1(() => {
let percent;
if (typeof props.percent == "string") {
percent = parseInt(props.percent);
} else {
percent = props.percent;
}
let radii = props.circleSize / 2 - props.circleWidth / 2;
let perimeter = Math.PI * 2 * radii;
return `${percent / 100 * perimeter}px ${perimeter}px`;
});
const getPathD = computed$1(() => {
let circleSize = props.circleSize;
let circleWidth = props.circleWidth;
return `M ${circleSize / 2} ${circleSize / 2} m 0, -${(circleSize - circleWidth) / 2} a ${(circleSize - circleWidth) / 2}, ${(circleSize - circleWidth) / 2} 0 1, 1 0, ${circleSize - circleWidth} a ${(circleSize - circleWidth) / 2}, ${(circleSize - circleWidth) / 2} 0 1, 1 0, -${circleSize - circleWidth}`;
});
return (_ctx, _cache) => {
return __props.circle ? (openBlock(), createElementBlock("div", _hoisted_1$S, [
(openBlock(), createElementBlock("svg", {
viewBox: `0 0 ${__props.circleSize} ${__props.circleSize}`,
width: __props.circleSize,
height: __props.circleSize
}, [
createElementVNode("path", {
d: unref(getPathD),
style: normalizeStyle([{ "fill": "none", "stroke": "var(--global-neutral-color-3)" }, { strokeWidth: `${__props.circleWidth}px` }])
}, null, 12, _hoisted_3$E),
createElementVNode("path", {
d: unref(getPathD),
style: normalizeStyle([{ "fill": "none", "stroke-linecap": "round" }, {
strokeDasharray: unref(getStrokeDasharray),
stroke: unref(getCircleColor),
strokeWidth: `${__props.circleWidth}px`
}])
}, null, 12, _hoisted_4$u)
], 8, _hoisted_2$K)),
2022-12-30 08:13:19 +00:00
__props.showText ? (openBlock(), createElementBlock("div", _hoisted_5$m, toDisplayString$1(__props.text ? __props.text : __props.percent + "%"), 1)) : createCommentVNode("", true)
2022-11-15 01:16:55 +00:00
])) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass(["layui-progress", "layui-progress-" + __props.size])
}, [
createElementVNode("div", {
class: normalizeClass(["layui-progress-bar", "layui-bg-" + __props.theme]),
style: normalizeStyle(unref(styles))
}, [
__props.showText ? (openBlock(), createElementBlock("span", _hoisted_6$h, toDisplayString$1(__props.text ? __props.text : __props.percent + "%"), 1)) : createCommentVNode("", true)
], 6)
], 2));
};
}
});
const component$13 = withInstall(_sfc_main$1k);
const __default__$1f = {
name: "LayCol"
};
const _sfc_main$1j = defineComponent({
...__default__$1f,
props: {
md: null,
xs: null,
sm: null,
lg: null,
mdOffset: null,
xsOffset: null,
smOffset: null,
lgOffset: null
},
setup(__props) {
const props = __props;
const classes = computed$1(() => {
return [
props.md ? `layui-col-md${props.md}` : "",
props.xs ? `layui-col-xs${props.xs}` : "",
props.sm ? `layui-col-sm${props.sm}` : "",
props.lg ? `layui-col-lg${props.lg}` : "",
props.mdOffset ? `layui-col-md-offset${props.mdOffset}` : "",
props.xsOffset ? `layui-col-xs-offset${props.xsOffset}` : "",
props.smOffset ? `layui-col-sm-offset${props.smOffset}` : "",
props.lgOffset ? `layui-col-lg-offset${props.lgOffset}` : ""
];
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-col", unref(classes)])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$12 = withInstall(_sfc_main$1j);
var index$I = /* @__PURE__ */ (() => '.layui-row:after,.layui-row:before{content:"";display:block;clear:both}.layui-col-space1{margin:-.5px}.layui-col-space1>*{padding:.5px}.layui-col-space2{margin:-1px}.layui-col-space2>*{padding:1px}.layui-col-space3{margin:-1.5px}.layui-col-space3>*{padding:1.5px}.layui-col-space4{margin:-2px}.layui-col-space4>*{padding:2px}.layui-col-space5{margin:-2.5px}.layui-col-space5>*{padding:2.5px}.layui-col-space6{margin:-3px}.layui-col-space6>*{padding:3px}.layui-col-space7{margin:-3.5px}.layui-col-space7>*{padding:3.5px}.layui-col-space8{margin:-4px}.layui-col-space8>*{padding:4px}.layui-col-space9{margin:-4.5px}.layui-col-space9>*{padding:4.5px}.layui-col-space10{margin:-5px}.layui-col-space10>*{padding:5px}.layui-col-space11{margin:-5.5px}.layui-col-space11>*{padding:5.5px}.layui-col-space12{margin:-6px}.layui-col-space12>*{padding:6px}.layui-col-space13{margin:-6.5px}.layui-col-space13>*{padding:6.5px}.layui-col-space14{margin:-7px}.layui-col-space14>*{padding:7px}.layui-col-space15{margin:-7.5px}.layui-col-space15>*{padding:7.5px}.layui-col-space16{margin:-8px}.layui-col-space16>*{padding:8px}.layui-col-space17{margin:-8.5px}.layui-col-space17>*{padding:8.5px}.layui-col-space18{margin:-9px}.layui-col-space18>*{padding:9px}.layui-col-space19{margin:-9.5px}.layui-col-space19>*{padding:9.5px}.layui-col-space20{margin:-10px}.layui-col-space20>*{padding:10px}.layui-col-space21{margin:-10.5px}.layui-col-space21>*{padding:10.5px}.layui-col-space22{margin:-11px}.layui-col-space22>*{padding:11px}.layui-col-space23{margin:-11.5px}.layui-col-space23>*{padding:11.5px}.layui-col-space24{margin:-12px}.layui-col-space24>*{padding:12px}.layui-col-space25{margin:-12.5px}.layui-col-space25>*{padding:12.5px}.layui-col-space26{margin:-13px}.layui-col-space26>*{padding:13px}.layui-col-space27{margin:-13.5px}.layui-col-space27>*{padding:13.5px}.layui-col-space28{margin:-14px}.layui-col-space28>*{padding:14px}.layui-col-space29{margin:-14.5px}.layui-col-space29>*{padding:14.5px}.layui-col-space30{margin:-15px}.layui-col-space30>*{padding:15px}@media screen and (max-width: 768px){.layui-col-xs1{float:left;display:block;position:relative;box-sizing:border-box;width:4.16666667%}.layui-col-xs-offset1{margin-left:4.16666667%}.layui-col-xs2{float:left;display:block;position:relative;box-sizing:border-box;width:8.33333333%}.layui-col-xs-offset2{margin-left:8.33333333%}.layui-col-xs3{float:left;display:block;position:relative;box-sizing:border-box;width:12.5%}.layui-col-xs-offset3{margin-left:12.5%}.layui-col-xs4{float:left;display:block;position:relative;box-sizing:border-box;width:16.66666667%}.layui-col-xs-offset4{margin-left:16.66666667%}.layui-col-xs5{float:left;display:block;position:relative;box-sizing:border-box;width:20.83333333%}.layui-col-xs-offset5{margin-left:20.83333333%}.layui-col-xs6{float:left;display:block;position:relative;box-sizing:border-box;width:25%}.layui-col-xs-offset6{margin-left:25%}.layui-col-xs7{float:left;display:block;position:relative;box-sizing:border-box;width:29.16666667%}.layui-col-xs-offset7{margin-left:29.16666667%}.layui-col-xs8{float:left;display:block;position:relative;box-sizing:border-box;width:33.33333333%}.layui-col-xs-offset8{margin-left:33.33333333%}.layui-col-xs9{float:left;display:block;position:relative;box-sizing:border-box;width:37.5%}.layui-col-xs-offset9{margin-left:37.5%}.layui-col-xs10{float:left;display:block;position:relative;box-sizing:border-box;width:41.66666667%}.layui-col-xs-offset10{margin-left:41.66666667%}.layui-col-xs11{float:left;display:block;position:relative;box-sizing:border-box;width:45.83333333%}.layui-col-xs-offset11{margin-left:45.83333333%}.layui-col-xs12{float:left;display:block;position:relative;box-sizing:border-box;width:50%}.layui-col-xs-offset12{margin-left:50%}.layui-col-xs13{float:left;display:block;position:relative;box-sizing:border-box;width:54.16666667%}.layui-col-xs-offset13{margin-left:54.16666667%}.layui-col-xs14{float:left;display:block;position:relative;box-sizing:border-box;width:58.33333333%}.layui-col-xs-offset14{margin
const __default__$1e = {
name: "LayRow"
};
const _sfc_main$1i = defineComponent({
...__default__$1e,
props: {
space: null
},
setup(__props) {
const props = __props;
const classes = computed$1(() => {
return [props.space ? `layui-col-space${props.space}` : ""];
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-row", unref(classes)])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$11 = withInstall(_sfc_main$1i);
const component$10 = withInstall(_sfc_main$1v);
var index$H = /* @__PURE__ */ (() => ".layui-badge,.layui-badge-dot,.layui-badge-rim{position:relative;display:inline-block;padding:0 6px;font-size:12px;text-align:center;background-color:#ff5722;color:#fff;border-radius:var(--global-border-radius)}.layui-badge{height:18px;line-height:18px}.layui-badge-dot{width:8px;height:8px;padding:0;border-radius:50%}.layui-badge-rim{height:18px;line-height:18px;border-width:1px;border-style:solid;background-color:#fff;border-color:var(--global-neutral-color-3);color:#666}.layui-badge-dot-ripple>span{position:absolute;top:0;left:0;width:100%;height:100%;display:block;border-radius:50%;box-sizing:border-box;animation:layui-badge-dot-anim-ripple 1.2s ease-in-out infinite}@keyframes layui-badge-dot-anim-ripple{0%{transform:scale(.8);opacity:.6}to{transform:scale(2.4);opacity:0}}.layui-btn .layui-badge,.layui-btn .layui-badge-dot{margin-left:5px}.layui-nav .layui-badge,.layui-nav .layui-badge-dot{position:absolute;top:50%;margin:-5px 6px 0}.layui-nav .layui-badge{margin-top:-10px}.layui-tab-title .layui-badge,.layui-tab-title .layui-badge-dot{left:5px;top:-2px}\n")();
const __default__$1d = {
name: "LayBadge"
};
const _sfc_main$1h = defineComponent({
...__default__$1d,
props: {
type: null,
theme: null,
color: null,
ripple: { type: Boolean }
},
setup(__props) {
const props = __props;
const classes = computed$1(() => {
return [
{
"layui-badge": !props.type,
"layui-badge-dot": props.type == "dot",
"layui-badge-rim": props.type == "rim",
"layui-badge-dot-ripple": props.ripple
},
`layui-bg-${props.theme}`
];
});
const styles = computed$1(() => {
return [props.color ? `background-color: ${props.color}` : ""];
});
return (_ctx, _cache) => {
var _a2;
return openBlock(), createElementBlock("span", {
class: normalizeClass(unref(classes)),
style: normalizeStyle(unref(styles))
}, [
__props.type === "dot" ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass(props.theme ? `layui-bg-${props.theme}` : ``),
style: normalizeStyle((_a2 = unref(styles)) != null ? _a2 : `background-color: #ff5722;`)
}, null, 6)) : createCommentVNode("", true),
__props.type != "dot" ? renderSlot(_ctx.$slots, "default", { key: 1 }) : createCommentVNode("", true)
], 6);
};
}
});
const component$$ = withInstall(_sfc_main$1h);
var index$G = /* @__PURE__ */ (() => ":root{--block-default-color: var(--global-checked-color);--block-border-radius: var(--global-border-radius)}.layui-quote{padding:15px;line-height:1.6;margin-bottom:10px;border-left:5px solid var(--block-default-color);border-radius:var(--block-border-radius);background-color:var(--global-neutral-color-1)}.layui-quote-nm{border-left:5px solid #eee}\n")();
const __default__$1c = {
name: "LayQuote"
};
const _sfc_main$1g = defineComponent({
...__default__$1c,
props: {
type: null
},
setup(__props) {
const props = __props;
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-quote", [__props.type ? `layui-quote-${props.type}` : ""]])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$_ = withInstall(_sfc_main$1g);
var index$F = /* @__PURE__ */ (() => ".layui-line-horizontal{position:relative;clear:both;width:100%;min-width:100%;max-width:100%;margin:var(--layui-line-margin) 0;border-bottom:var(--layui-line-border-width) var(--layui-line-border-style) var(--global-neutral-color-5);border-top-style:none;border-left-style:none;border-right-style:none}.layui-line-horizontal.layui-line-with-text{margin:14px 0}.layui-line-vertical{display:inline-block;min-width:1px;max-width:1px;height:1em;margin:0 var(--layui-line-margin);vertical-align:middle;border-left:var(--layui-line-border-width) var(--layui-line-border-style) var(--global-neutral-color-5);border-top-style:none;border-bottom-style:none;border-right-style:none}.layui-line-text{position:absolute;top:50%;box-sizing:border-box;padding:0 10px;color:currentColor;line-height:2;background-color:#fff;transform:translateY(-50%)}.layui-line-text-center{left:var(--layui-line-text-offset);transform:translate(-50%,-50%)}.layui-line-text-left{left:var(--layui-line-text-offset)}.layui-line-text-right{right:var(--layui-line-text-offset)}\n")();
const __default__$1b = {
name: "LayLine"
};
const _sfc_main$1f = defineComponent({
...__default__$1b,
props: {
direction: { default: "horizontal" },
contentPosition: { default: "center" },
borderWidth: { default: "1px" },
borderStyle: { default: "solid" },
offset: { default: "25px" },
theme: null,
margin: { default: "8px" }
},
setup(__props) {
var _a2;
const props = __props;
const slots = useSlots();
const lineTheme = [
"red",
"orange",
"green",
"cyan",
"blue",
"black",
"gray"
];
const isBuiltInColor = lineTheme.includes((_a2 = props.theme) != null ? _a2 : "");
const lineClass = computed$1(() => [
`layui-line-${props.direction}`,
{
[`layui-border-${props.theme}`]: isBuiltInColor,
[`layui-line-with-text`]: Boolean(slots.default)
}
]);
const lineStyle = computed$1(() => ({
"border-color": !isBuiltInColor ? props.theme : void 0,
"--layui-line-border-width": props.borderWidth,
"--layui-line-border-style": props.borderStyle,
"--layui-line-margin": props.margin
}));
const lineTextStyle = computed$1(() => ({
"--layui-line-text-offset": props.contentPosition != "center" ? props.offset : "50%",
transform: calcTranslate()
}));
function calcTranslate() {
if (props.offset.includes("%")) {
return props.contentPosition === "right" ? "translate(50%, -50%)" : "translate(-50%, -50%)";
}
return void 0;
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(lineClass)),
style: normalizeStyle(unref(lineStyle))
}, [
_ctx.$slots.default && __props.direction === "horizontal" ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass([`layui-line-text layui-line-text-${__props.contentPosition}`]),
style: normalizeStyle(unref(lineTextStyle))
}, [
renderSlot(_ctx.$slots, "default")
], 6)) : createCommentVNode("", true)
], 6);
};
}
});
const component$Z = withInstall(_sfc_main$1f);
var index$E = /* @__PURE__ */ (() => '.layui-timeline{padding-left:5px}.layui-timeline-item{position:relative;padding-bottom:20px}.layui-timeline-axis{position:absolute;left:-5px;top:0;z-index:10;width:20px;height:20px;line-height:20px;background-color:#fff;color:var(--global-checked-color);border-radius:50%;text-align:center;cursor:pointer}.layui-timeline-axis:hover{color:#ff5722}.layui-timeline-item:before{content:"";position:absolute;left:5px;top:0;z-index:0;width:1px;height:100%}.layui-timeline-item:first-child:before{display:block}.layui-timeline-item:last-child:before{display:none}.layui-timeline-content{padding-left:25px}.layui-timeline-title{position:relative;margin-bottom:10px;line-height:22px}.layui-timeline-item:before{background-color:#eee}.layui-timeline-horizontal .layui-timeline-item{display:inline-block;width:25%;text-align:center;padding-top:10px;vertical-align:top}.layui-timeline-horizontal .layui-timeline-axis{left:47%;top:-4px}.layui-timeline-horizontal .layui-timeline-item:before{left:0px;top:5px;width:100%;height:1px}.layui-timeline-horizontal .layui-timeline-item:first-child:before{display:block}.layui-timeline-horizontal .layui-timeline-item:last-child:before{display:block}.layui-timeline-horizontal .layui-timeline-content{padding:15px}.layui-timeline-horizontal .layui-timeline-title{text-align:center;position:relative;margin-bottom:10px;line-height:22px}\n')();
const __default__$1a = {
name: "LayTimeline"
};
const _sfc_main$1e = defineComponent({
...__default__$1a,
props: {
direction: { default: "vertical" }
},
setup(__props) {
const props = __props;
const timeLineClass = computed$1(() => [
"layui-timeline",
props.direction === "horizontal" ? "layui-timeline-horizontal" : ""
]);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("ul", {
class: normalizeClass(unref(timeLineClass))
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$Y = withInstall(_sfc_main$1e);
const _hoisted_1$R = { class: "layui-timeline-item" };
const _hoisted_2$J = { class: "layui-icon layui-timeline-axis" };
const _hoisted_3$D = { class: "layui-timeline-content layui-text" };
const _hoisted_4$t = {
key: 0,
class: "layui-timeline-title"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$l = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-timeline-title"
};
const __default__$19 = {
name: "LayTimelineItem"
};
const _sfc_main$1d = defineComponent({
...__default__$19,
props: {
title: null,
simple: { type: Boolean }
},
setup(__props) {
useSlots();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", _hoisted_1$R, [
createElementVNode("i", _hoisted_2$J, [
renderSlot(_ctx.$slots, "dot", {}, () => [
createTextVNode("\uE63F")
])
]),
createElementVNode("div", _hoisted_3$D, [
__props.simple ? (openBlock(), createElementBlock("div", _hoisted_4$t, [
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString$1(__props.title), 1)
])
2022-12-30 08:13:19 +00:00
])) : (openBlock(), createElementBlock("h3", _hoisted_5$l, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "title", {}, () => [
createTextVNode(toDisplayString$1(__props.title), 1)
])
])),
renderSlot(_ctx.$slots, "default")
])
]);
};
}
});
const component$X = withInstall(_sfc_main$1d);
2022-12-30 08:13:19 +00:00
var _a;
const isClient = typeof window !== "undefined";
const toString = Object.prototype.toString;
const isObject$1 = (val) => toString.call(val) === "[object Object]";
isClient && ((_a = window == null ? void 0 : window.navigator) == null ? void 0 : _a.userAgent) && /iP(ad|hone|od)/.test(window.navigator.userAgent);
var index$D = /* @__PURE__ */ (() => ":root{--textarea-border-radius: var(--global-border-radius);--textarea-border-color: var(--global-neutral-color-3)}.layui-textarea{border-width:1px;border-style:solid;background-color:#fff;color:#000000d9;border-radius:var(--textarea-border-radius);border-color:var(--textarea-border-color);display:block;width:100%;height:auto;line-height:20px;min-height:100px;padding:6px 10px;resize:vertical;position:relative;transition:none;-webkit-transition:none}.layui-textarea-wrapper{position:relative}.layui-textarea:hover,.layui-textarea:focus{border-color:#d2d2d2!important}.layui-textarea-clear{position:absolute;color:#00000073;right:10px;top:10px}.layui-textarea::-webkit-input-placeholder{line-height:1.3}.layui-texterea-count{color:inherit;white-space:nowrap;pointer-events:none;text-align:right;margin-top:4px}.layui-textarea-disabled{cursor:not-allowed!important;opacity:.6}\n")();
2022-11-15 01:16:55 +00:00
const _hoisted_1$Q = { class: "layui-textarea-wrapper" };
const _hoisted_2$I = ["value", "placeholder", "name", "disabled", "maxlength"];
const _hoisted_3$C = {
key: 0,
class: "layui-textarea-clear"
};
const _hoisted_4$s = {
key: 1,
class: "layui-texterea-count"
};
const __default__$18 = {
name: "LayTextarea"
};
const _sfc_main$1c = defineComponent({
...__default__$18,
props: {
name: null,
modelValue: null,
placeholder: null,
disabled: { type: Boolean },
showCount: { type: Boolean },
allowClear: { type: Boolean },
2022-12-30 08:13:19 +00:00
maxlength: null,
autosize: { type: [Boolean, Object] }
2022-11-15 01:16:55 +00:00
},
emits: ["blur", "input", "update:modelValue", "change", "focus", "clear"],
setup(__props, { emit }) {
const props = __props;
2022-12-30 08:13:19 +00:00
const textareaRef = ref(null);
2022-11-15 01:16:55 +00:00
const composing = ref(false);
const onInput = function(event) {
const inputElement = event.target;
emit("input", inputElement.value);
if (composing.value) {
return;
}
emit("update:modelValue", inputElement.value);
};
const onFocus = function(event) {
emit("focus", event);
};
const onBlur = function(event) {
emit("blur", event);
};
const onChange = (event) => {
const inputElement = event.target;
emit("change", inputElement.value);
};
const onClear = function() {
emit("update:modelValue", "");
emit("clear");
};
const onCompositionstart = () => {
composing.value = true;
};
const onCompositionend = (event) => {
composing.value = false;
onInput(event);
};
const hasContent = computed$1(() => {
var _a2;
return ((_a2 = props.modelValue) == null ? void 0 : _a2.length) > 0;
});
const wordCount = computed$1(() => {
var _a2, _b;
let count = String((_b = (_a2 = props.modelValue) == null ? void 0 : _a2.length) != null ? _b : 0);
if (props.maxlength) {
count += "/" + props.maxlength;
}
return count;
});
2022-12-30 08:13:19 +00:00
watch([() => props.modelValue, textareaRef], () => {
var _a2, _b;
if (!textareaRef.value || !props.autosize)
return;
const height = ((_a2 = textareaRef.value) == null ? void 0 : _a2.scrollHeight) + 2;
if (isObject$1(props.autosize)) {
const { minHeight, maxHeight } = props.autosize;
if (height < minHeight || height > maxHeight)
return;
}
textareaRef.value.style.height = "1px";
textareaRef.value.style.height = `${((_b = textareaRef.value) == null ? void 0 : _b.scrollHeight) + 2}px`;
}, {
immediate: true
});
2022-11-15 01:16:55 +00:00
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$Q, [
createElementVNode("textarea", {
2022-12-30 08:13:19 +00:00
ref_key: "textareaRef",
ref: textareaRef,
2022-11-15 01:16:55 +00:00
class: normalizeClass(["layui-textarea", { "layui-textarea-disabled": __props.disabled }]),
value: __props.modelValue,
placeholder: __props.placeholder,
name: __props.name,
disabled: __props.disabled,
maxlength: __props.maxlength,
onCompositionstart,
onCompositionend,
onInput,
onFocus,
onChange,
onBlur
}, null, 42, _hoisted_2$I),
__props.allowClear && unref(hasContent) ? (openBlock(), createElementBlock("span", _hoisted_3$C, [
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-close-fill",
onClick: onClear
})
])) : createCommentVNode("", true),
__props.showCount ? (openBlock(), createElementBlock("div", _hoisted_4$s, toDisplayString$1(unref(wordCount)), 1)) : createCommentVNode("", true)
]);
};
}
});
const component$W = withInstall(_sfc_main$1c);
var index$C = /* @__PURE__ */ (() => ".layui-switch-container[size=lg] .layui-form-switch{height:24px;min-width:42px}.layui-switch-container[size=lg] .layui-form-switch span{width:20px;height:20px;transition:all .1s linear}.layui-switch-container[size=lg] .layui-form-switch em{margin-left:21px}.layui-switch-container[size=lg] .layui-form-onswitch span{left:calc(100% - 23px)}.layui-switch-container[size=lg] .layui-form-onswitch em{margin-right:21px;margin-left:0}.layui-switch-container[size=md] .layui-form-switch{height:22px;min-width:37px}.layui-switch-container[size=md] .layui-form-switch span{width:18px;height:18px;transition:all .1s linear}.layui-switch-container[size=md] .layui-form-switch em{margin-left:19px}.layui-switch-container[size=md] .layui-form-onswitch span{left:calc(100% - 21px)}.layui-switch-container[size=md] .layui-form-onswitch em{margin-right:19px;margin-left:0}.layui-switch-container[size=sm] .layui-form-switch{height:20px;min-width:32px}.layui-switch-container[size=sm] .layui-form-switch span{width:16px;height:16px;transition:all .1s linear}.layui-switch-container[size=sm] .layui-form-switch em{margin-left:17px}.layui-switch-container[size=sm] .layui-form-onswitch span{left:calc(100% - 19px)}.layui-switch-container[size=sm] .layui-form-onswitch em{margin-right:17px;margin-left:0}.layui-switch-container[size=xs] .layui-form-switch{height:18px;min-width:27px}.layui-switch-container[size=xs] .layui-form-switch span{width:14px;height:14px;transition:all .1s linear}.layui-switch-container[size=xs] .layui-form-switch em{margin-left:15px}.layui-switch-container[size=xs] .layui-form-onswitch span{left:calc(100% - 17px)}.layui-switch-container[size=xs] .layui-form-onswitch em{margin-right:15px;margin-left:0}.layui-switch-container .layui-switch-input{display:none}.layui-form-switch{position:relative;height:22px;line-height:22px;min-width:35px;padding:0 4px;border-radius:20px;cursor:pointer;background-color:var(--global-neutral-color-6);-webkit-transition:all .1s linear;transition:all .1s linear}.layui-form-switch span{position:absolute;display:flex;align-items:center;justify-content:center;left:3px;top:2px;width:18px;height:18px;line-height:18px;border-radius:20px;background-color:#fff;box-shadow:0 2px 4px #00230b33;-webkit-transition:all .1s linear;transition:all .1s linear}.layui-form-switch em{position:relative;padding:0 2px;text-align:center!important;color:#999!important;font-style:normal!important;font-size:12px;width:25px;top:0}.layui-form-onswitch{border-color:var(--global-checked-color);background-color:var(--global-checked-color)}.layui-form-onswitch span{background-color:#fff}.layui-form-onswitch em{color:#fff!important}.layui-switch-disabled{opacity:.6}.layui-switch-disabled,.layui-switch-disabled *{cursor:not-allowed!important}\n")();
const _hoisted_1$P = ["onClick", "size"];
const _hoisted_2$H = ["name", "value"];
const _hoisted_3$B = { key: 0 };
const __default__$17 = {
name: "LaySwitch"
};
const _sfc_main$1b = defineComponent({
...__default__$17,
props: {
name: null,
disabled: { type: Boolean, default: false },
modelValue: { type: [String, Number, Boolean] },
onswitchText: null,
unswitchText: null,
onswitchColor: null,
unswitchColor: null,
onswitchValue: { type: [String, Number, Boolean], default: true },
unswitchValue: { type: [String, Number, Boolean], default: false },
size: { default: "md" },
loadingIcon: { default: "layui-icon-loading-one" },
loading: { type: Boolean }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const isActive = computed$1({
get() {
return props.modelValue === props.onswitchValue;
},
set(val) {
if (val) {
emit("change", props.onswitchValue);
emit("update:modelValue", props.onswitchValue);
} else {
emit("change", props.unswitchValue);
emit("update:modelValue", props.unswitchValue);
}
}
});
const handleClick = () => {
if (!props.disabled) {
isActive.value = !isActive.value;
}
};
const styles = computed$1(() => {
return {
"background-color": isActive.value ? props.onswitchColor : props.unswitchColor
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
onClick: withModifiers(handleClick, ["stop"]),
class: "layui-switch-container",
size: __props.size
}, [
createElementVNode("input", {
class: "layui-switch-input",
name: __props.name,
value: __props.modelValue
}, null, 8, _hoisted_2$H),
createElementVNode("div", {
class: normalizeClass(["layui-unselect layui-form-switch", {
"layui-form-onswitch": unref(isActive),
"layui-switch-disabled": __props.disabled
}]),
style: normalizeStyle(unref(styles))
}, [
__props.onswitchText || __props.unswitchText ? (openBlock(), createElementBlock("em", _hoisted_3$B, toDisplayString$1(unref(isActive) == true ? __props.onswitchText : __props.unswitchText), 1)) : createCommentVNode("", true),
createElementVNode("span", null, [
createElementVNode("div", null, [
__props.loading ? (openBlock(), createElementBlock("i", {
key: 0,
class: normalizeClass(["layui-icon layui-anim layui-anim-rotate layui-anim-loop", __props.loadingIcon])
}, null, 2)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
unref(isActive) ? renderSlot(_ctx.$slots, "onswitch-icon", { key: 0 }) : renderSlot(_ctx.$slots, "unswitch-icon", { key: 1 })
], 64))
])
])
], 6)
], 8, _hoisted_1$P);
};
}
});
const component$V = withInstall(_sfc_main$1b);
var index$B = /* @__PURE__ */ (() => ".layui-collapse{border-width:1px;border-style:solid;border-radius:2px}.layui-colla-content,.layui-colla-item{border-top-width:1px;border-top-style:solid}.layui-colla-item:first-child{border-top:none}.layui-colla-title{position:relative;height:42px;line-height:42px;padding:0 15px 0 35px;color:#333;background-color:var(--global-neutral-color-1);cursor:pointer;font-size:14px;overflow:hidden}.layui-colla-content{padding:10px 15px;line-height:1.6;color:#666}.layui-colla-icon{left:15px;top:0;font-size:14px;position:absolute}\n")();
const _hoisted_1$O = { class: "layui-collapse" };
const __default__$16 = {
name: "LayCollapse"
};
const _sfc_main$1a = defineComponent({
...__default__$16,
props: {
accordion: { type: Boolean, default: false },
modelValue: { default: () => [] },
collapseTransition: { type: Boolean, default: true }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
watch(() => props.modelValue, (val) => {
activeValues.value = [].concat(val);
});
const activeValues = ref([].concat(props.modelValue));
provide("layCollapse", {
accordion: props.accordion,
collapseTransition: props.collapseTransition,
activeValues,
emit
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$O, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$U = withInstall(_sfc_main$1a);
const __default__$15 = {
name: "LayCollapseTransition"
};
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
...__default__$15,
setup(__props) {
const time = inject("time");
const elTransition = `${time}s height ease-in-out, ${time}s padding-top ease-in-out, ${time}s padding-bottom ease-in-out`;
const beforeEnter = (el) => {
el.style.transition = elTransition;
if (!el.dataset)
el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
el.style.height = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
};
const enter = (el) => {
el.dataset.oldOverflow = el.style.overflow;
if (el.scrollHeight !== 0) {
el.style.height = el.scrollHeight + "px";
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
} else {
el.style.height = "";
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
}
el.style.overflow = "hidden";
};
const afterEnter = (el) => {
el.style.transition = "";
el.style.height = "";
el.style.overflow = el.dataset.oldOverflow;
};
const beforeLeave = (el) => {
if (!el.dataset)
el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
el.dataset.oldOverflow = el.style.overflow;
var computedStyle = getComputedStyle(el, null);
el.style.height = el.scrollHeight - parseInt(computedStyle.paddingTop) - parseInt(computedStyle.paddingBottom) + "px";
el.style.overflow = "hidden";
};
const leave = (el) => {
if (el.scrollHeight !== 0) {
el.style.transition = elTransition;
el.style.height = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
}
};
const afterLeave = (el) => {
el.style.transition = "";
el.style.height = "";
el.style.overflow = el.dataset.oldOverflow;
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
};
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, {
onBeforeEnter: beforeEnter,
onEnter: enter,
onAfterEnter: afterEnter,
onBeforeLeave: beforeLeave,
onLeave: leave,
onAfterLeave: afterLeave
}, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
});
};
}
});
2022-12-09 08:41:41 +00:00
var fadeTransition_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => ".fade-enter-from,.fade-leave-to{opacity:0}.fade-enter-to,.fade-leave-from{opacity:1}.fade-enter-active,.fade-leave-active{transition:var(--ee595422)}\n")();
2022-11-15 01:16:55 +00:00
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
__name: "fadeTransition",
setup(__props) {
useCssVars((_ctx) => ({
2022-12-09 08:41:41 +00:00
"ee595422": transition.value
2022-11-15 01:16:55 +00:00
}));
const time = inject("time");
const transition = ref(`opacity ${time}s ease`);
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, { name: "fade" }, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
});
};
}
});
const __default__$14 = {
name: "LayTransition"
};
const _sfc_main$17 = defineComponent({
...__default__$14,
props: {
type: { default: "collapse" },
enable: { type: Boolean, default: true },
time: { default: 0.3 }
},
setup(__props) {
const props = __props;
provide("time", props.time);
return (_ctx, _cache) => {
return __props.enable ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
__props.type === "collapse" ? (openBlock(), createBlock(_sfc_main$19, { key: 0 }, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
})) : createCommentVNode("", true),
__props.type === "fade" ? (openBlock(), createBlock(_sfc_main$18, { key: 1 }, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
})) : createCommentVNode("", true)
], 64)) : renderSlot(_ctx.$slots, "default", { key: 1 });
};
}
});
const _hoisted_1$N = { class: "layui-colla-item" };
const _hoisted_2$G = { key: 0 };
const _hoisted_3$A = { class: "layui-colla-content" };
const __default__$13 = {
name: "LayCollapseItem"
};
const _sfc_main$16 = defineComponent({
...__default__$13,
props: {
id: null,
title: null,
disabled: { type: Boolean, default: false }
},
setup(__props) {
const props = __props;
const { accordion, activeValues, emit, collapseTransition } = inject("layCollapse");
let isShow = computed$1(() => {
return activeValues.value.includes(props.id);
});
const showHandle = function() {
if (props.disabled) {
return;
}
const _isShow = isShow.value;
if (accordion) {
activeValues.value = !_isShow ? [props.id] : [];
} else if (_isShow) {
activeValues.value.splice(activeValues.value.indexOf(props.id), 1);
} else {
activeValues.value.push(props.id);
}
emit("update:modelValue", accordion ? activeValues.value[0] || null : activeValues.value);
emit("change", props.id, !_isShow, activeValues.value);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$N, [
createElementVNode("h2", {
class: normalizeClass(["layui-colla-title", { "layui-disabled": __props.disabled }]),
onClick: showHandle
}, [
renderSlot(_ctx.$slots, "title", { props }, () => [
createTextVNode(toDisplayString$1(__props.title), 1)
]),
createElementVNode("i", {
class: "layui-icon layui-colla-icon layui-icon-right",
style: normalizeStyle({
transform: unref(isShow) ? "rotate(90deg)" : "none",
transition: unref(collapseTransition) ? "all 0.2s ease 0s" : ""
})
}, null, 4)
], 2),
createVNode(_sfc_main$17, { enable: unref(collapseTransition) }, {
default: withCtx(() => [
unref(isShow) ? (openBlock(), createElementBlock("div", _hoisted_2$G, [
createElementVNode("div", _hoisted_3$A, [
createElementVNode("p", null, [
renderSlot(_ctx.$slots, "default", { props })
])
])
])) : createCommentVNode("", true)
]),
_: 3
}, 8, ["enable"])
]);
};
}
});
const component$T = withInstall(_sfc_main$16);
var index$A = /* @__PURE__ */ (() => ".layui-container{position:relative;margin:0 auto;padding:0 15px;box-sizing:border-box}.layui-fluid{position:relative;margin:0 auto;padding:0 15px}\n")();
const __default__$12 = {
name: "LayContainer"
};
const _sfc_main$15 = defineComponent({
...__default__$12,
props: {
fluid: { default: false }
},
setup(__props) {
const props = __props;
const classes = computed$1(() => props.fluid ? "layui-fluid" : "layui-container");
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(classes))
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$S = withInstall(_sfc_main$15);
const __default__$11 = {
name: "LayCountUp"
};
const _sfc_main$14 = defineComponent({
...__default__$11,
props: {
startVal: { default: 0 },
endVal: { default: 0 },
decimal: { default: "." },
decimalPlaces: { default: 0 },
useGrouping: { type: Boolean, default: true },
separator: { default: "," },
autoplay: { type: Boolean, default: true },
useEasing: { type: Boolean, default: true },
easingFn: { default: TransitionPresets.easeInOutCubic },
duration: { default: 2e3 },
prefix: { default: "" },
suffix: { default: "" }
},
setup(__props, { expose }) {
const props = __props;
let localStartVal = ref(props.startVal);
const isNumber2 = (val) => !isNaN(parseFloat(val));
const formatNumber = (num) => {
if (typeof num != "number")
return "0";
num = num.toFixed(props.decimalPlaces);
num += "";
const x = num.split(".");
let x1 = x[0];
const x2 = x.length > 1 ? props.decimal + x[1] : "";
const rgx = /(\d+)(\d{3})/;
if (props.useGrouping && props.separator && !isNumber2(props.separator)) {
while (rgx.test(x1)) {
x1 = x1.replace(rgx, "$1" + props.separator + "$2");
}
}
return props.prefix + x1 + x2 + props.suffix;
};
const printVal = useTransition(localStartVal, {
delay: 0,
duration: props.duration,
disabled: !props.useEasing,
transition: typeof props.easingFn === "string" ? TransitionPresets[props.easingFn] : props.easingFn
});
const displayValue = computed$1(() => formatNumber(printVal.value));
const start = function() {
localStartVal.value = props.endVal;
};
watch(() => props.endVal, () => {
if (props.autoplay) {
localStartVal.value = props.endVal;
}
});
onMounted(() => {
if (props.autoplay) {
start();
}
});
expose({
start
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
renderSlot(_ctx.$slots, "prefix"),
createElementVNode("span", null, toDisplayString$1(unref(displayValue)), 1),
renderSlot(_ctx.$slots, "suffix")
], 64);
};
}
});
const component$R = withInstall(_sfc_main$14);
const LevelInjectionKey = Symbol("menuLevelKey");
function provideLevel(level) {
const computedLevel = computed$1(() => isRef(level) ? level.value : level);
provide(LevelInjectionKey, reactive({
level: computedLevel
}));
}
function useLevel(props) {
const { provideNextLevel } = props || {};
const levelContext = inject(LevelInjectionKey);
const level = computed$1(() => levelContext.level || 1);
if (provideNextLevel) {
const nextLevel = computed$1(() => level.value + 1);
provideLevel(nextLevel);
}
return {
level
};
}
var index$z = /* @__PURE__ */ (() => '.layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}.layui-popper{position:fixed;padding:10px;border-radius:3px;word-wrap:break-word;min-width:12px;min-height:12px;font-size:14px;box-sizing:border-box;box-shadow:0 2px 12px #00000026;background-color:#fff;color:#3a3a3a;border:1px solid #cecece;max-width:300px;z-index:99999}.layui-popper[position=top]{margin-bottom:6px}.layui-popper[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#cecece}.layui-popper[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#fff}.layui-popper[position=bottom]{margin-top:6px}.layui-popper[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#cecece}.layui-popper[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#fff}.layui-popper[position=right]{margin-left:6px}.layui-popper[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#cecece}.layui-popper[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#fff}.layui-popper[position=left]{margin-right:6px}.layui-popper[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#cecece}.layui-popper[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#fff}.layui-popper[position=top] .layui-popper-arrow,.layui-popper[position=bottom] .layui-popper-arrow{left:-moz-calc(44%);left:-webkit-calc(44%);left:calc(50% - 6px)}.layui-popper[position=left] .layui-popper-arrow,.layui-popper[position=right] .layui-popper-arrow{top:-moz-calc(44%);top:-webkit-calc(44%);top:calc(50% - 6px)}.layui-popper:after{content:" ";position:absolute;display:block}.layui-popper[position=top]:after{bottom:-7px;left:0;width:100%;height:7px}.layui-popper[position=bottom]:after{top:-7px;left:0;width:100%;height:7px}.layui-popper[position=left]:after{right:-7px;bottom:0;height:100%;width:7px}.layui-popper[position=right]:after{left:-7px;bottom:0;height:100%;width:7px}.layui-popper .layui-popper-arrow,.layui-popper .layui-popper-arrow:after{position:absolute;display:block;width:0;height:0;border-width:6px;border-style:solid;border-color:transparent}.layui-popper .layui-popper-arrow:after{content:" "}.layui-popper.layui-dark{background-color:#353535;color:#fff;border:1px solid #353535}.layui-popper.layui-dark[position=top]{margin-bottom:6px}.layui-popper.layui-dark[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#353535}.layui-popper.layui-dark[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#353535}.layui-popper.layui-dark[position=bottom]{margin-top:6px}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#353535}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-botto
const __default__$10 = {
name: "LayMenu"
};
const _sfc_main$13 = defineComponent({
...__default__$10,
props: {
selectedKey: { default: "" },
openKeys: { default: () => [] },
tree: { type: Boolean, default: false },
theme: { default: "dark" },
inverted: { type: [Boolean, String], default: false },
level: { type: [Boolean, String], default: true },
collapse: { type: [Boolean, String], default: false },
collapseTransition: { type: [Boolean, String], default: true },
indent: { type: [Boolean, String], default: false }
},
emits: [
"update:selectedKey",
"update:openKeys",
"changeSelectedKey",
"changeOpenKeys"
],
setup(__props, { emit }) {
const props = __props;
const isTree = computed$1(() => props.tree);
const isCollapse = computed$1(() => props.collapse);
const isCollapseTransition = computed$1(() => props.collapseTransition);
const oldOpenKeys = ref(props.openKeys);
const menuTheme = computed$1(() => props.theme);
const openKeys = computed$1({
get() {
return props.collapse ? [] : props.openKeys;
},
set(val) {
emit("update:openKeys", val);
emit("changeOpenKeys", val);
}
});
const selectedKey = computed$1({
get() {
return props.selectedKey;
},
set(val) {
emit("update:selectedKey", val);
emit("changeSelectedKey", val);
}
});
const indent = computed$1(() => {
return props.indent;
});
watch(() => props.collapse, () => {
if (props.collapse) {
oldOpenKeys.value = props.openKeys;
openKeys.value = [];
} else {
openKeys.value = oldOpenKeys.value;
}
});
provideLevel(1);
provide("isTree", isTree);
provide("selectedKey", selectedKey);
provide("openKeys", openKeys);
provide("isCollapse", isCollapse);
provide("isCollapseTransition", isCollapseTransition);
provide("menuTheme", menuTheme);
provide("indent", indent);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("ul", {
class: normalizeClass(["layui-nav", [
__props.level ? "" : "not-level",
__props.inverted ? "inverted" : "",
__props.tree ? "layui-nav-tree" : "",
__props.theme === "dark" ? "layui-nav-dark" : "layui-nav-light",
__props.collapse ? "layui-nav-collapse" : ""
]])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$Q = withInstall(_sfc_main$13);
function indentHandle(obj) {
const { indent, level, basePadding = 0, isTree } = obj;
const least = level - 1;
if (isTree && indent && least > 0) {
const px = typeof indent === "boolean" ? `${basePadding + 10 * least}px` : indent.replace(/\d+/g, (s) => (basePadding + least * +s).toString());
return `padding-left: ${px}`;
}
return "";
}
var index$y = /* @__PURE__ */ (() => ".lay-tooltip-content{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}\n")();
var index$x = /* @__PURE__ */ (() => '.layui-popper{position:fixed;padding:10px;border-radius:3px;word-wrap:break-word;min-width:12px;min-height:12px;font-size:14px;box-sizing:border-box;box-shadow:0 2px 12px #00000026;background-color:#fff;color:#3a3a3a;border:1px solid #cecece;max-width:300px;z-index:99999}.layui-popper[position=top]{margin-bottom:6px}.layui-popper[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#cecece}.layui-popper[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#fff}.layui-popper[position=bottom]{margin-top:6px}.layui-popper[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#cecece}.layui-popper[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#fff}.layui-popper[position=right]{margin-left:6px}.layui-popper[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#cecece}.layui-popper[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#fff}.layui-popper[position=left]{margin-right:6px}.layui-popper[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#cecece}.layui-popper[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#fff}.layui-popper[position=top] .layui-popper-arrow,.layui-popper[position=bottom] .layui-popper-arrow{left:-moz-calc(44%);left:-webkit-calc(44%);left:calc(50% - 6px)}.layui-popper[position=left] .layui-popper-arrow,.layui-popper[position=right] .layui-popper-arrow{top:-moz-calc(44%);top:-webkit-calc(44%);top:calc(50% - 6px)}.layui-popper:after{content:" ";position:absolute;display:block}.layui-popper[position=top]:after{bottom:-7px;left:0;width:100%;height:7px}.layui-popper[position=bottom]:after{top:-7px;left:0;width:100%;height:7px}.layui-popper[position=left]:after{right:-7px;bottom:0;height:100%;width:7px}.layui-popper[position=right]:after{left:-7px;bottom:0;height:100%;width:7px}.layui-popper .layui-popper-arrow,.layui-popper .layui-popper-arrow:after{position:absolute;display:block;width:0;height:0;border-width:6px;border-style:solid;border-color:transparent}.layui-popper .layui-popper-arrow:after{content:" "}.layui-popper.layui-dark{background-color:#353535;color:#fff;border:1px solid #353535}.layui-popper.layui-dark[position=top]{margin-bottom:6px}.layui-popper.layui-dark[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#353535}.layui-popper.layui-dark[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#353535}.layui-popper.layui-dark[position=bottom]{margin-top:6px}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#353535}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#353535}.layui-popper.layui-dark[position=right]{margin-left:6px}.layui-popper.layui-dark[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#353535}.layui-popper.layui-dark[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#353535}.layui-popper.layui-dark[position=left]{margin-right:6px}.layui-popper.layui-dark[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#353535}.layui-popper.layui-dark[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#353535}\n')();
const postionFns = {
top(el, popper, innnerPosition, called) {
let { top, left, bottom } = el.getBoundingClientRect();
if ((top = top - popper.offsetHeight - 6) < 0 && bottom > popper.offsetHeight) {
innnerPosition.value = "bottom";
top = bottom;
} else {
innnerPosition.value = "top";
}
return {
top: `${top}px`,
left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px`
};
},
bottom(el, popper, innnerPosition, called) {
let { top, left, bottom } = el.getBoundingClientRect();
if (window.innerHeight - bottom < popper.offsetHeight + 6) {
innnerPosition.value = "top";
bottom = top - popper.offsetHeight - 6;
} else {
innnerPosition.value = "bottom";
}
return {
top: `${bottom}px`,
left: `${left - (popper.offsetWidth - el.offsetWidth) / 2}px`
};
},
left(el, popper, innnerPosition, called) {
let { top, left, right } = el.getBoundingClientRect();
left = left - popper.offsetWidth - 6;
if (left < 0) {
innnerPosition.value = "right";
left = right;
} else {
innnerPosition.value = "left";
}
return {
top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`,
left: `${left}px`
};
},
right(el, popper, innnerPosition, called) {
let { top, left, right } = el.getBoundingClientRect();
if (window.innerWidth < right + popper.offsetWidth + 6) {
innnerPosition.value = "left";
right = left - popper.offsetWidth - 6;
} else {
innnerPosition.value = "right";
}
return {
top: `${top - (popper.offsetHeight - el.offsetHeight) / 2}px`,
left: `${right}px`
};
}
};
const _hoisted_1$M = ["position"];
const _hoisted_2$F = /* @__PURE__ */ createElementVNode("div", { class: "layui-popper-arrow" }, null, -1);
const NAME = "LayPopper";
const __default__$$ = {
name: NAME
};
const _sfc_main$12 = defineComponent({
...__default__$$,
props: {
el: null,
position: { default: "top" },
enterable: { type: Boolean, default: true },
isDark: { type: Boolean, default: true },
disabled: { type: Boolean, default: false },
isCanHide: { type: Boolean, default: true },
isAutoShow: { type: Boolean, default: false },
visible: { type: Boolean, default: false },
content: null,
trigger: { default: "hover" },
popperClass: null,
popperStyle: null
},
setup(__props) {
const props = __props;
useSlots();
const style = ref({ top: -window.innerHeight + "px", left: 0 });
const triggerRefEl = toRef(props, "el");
const popperRefEl = shallowRef({});
const innnerPosition = ref(props.position);
const innerVisible = ref(props.visible);
const isExist3 = ref(props.visible);
let scrollElements;
const triggerMethods = computed$1(() => [].concat(props.trigger));
const doShow = function() {
if (!props.disabled) {
if (!isExist3.value) {
isExist3.value = true;
nextTick(() => {
innerVisible.value = true;
});
} else {
innerVisible.value = true;
}
}
};
const doHidden = function(e) {
if (props.isCanHide === false) {
return;
}
innerVisible.value = false;
innnerPosition.value = props.position;
style.value = { top: -window.innerHeight + "px", left: 0 };
};
const calcPosistion = function() {
postionFns[props.position] && (style.value = postionFns[props.position](triggerRefEl.value, popperRefEl.value, innnerPosition));
};
const updatePosistion = function() {
if (innerVisible.value) {
popperRefEl.value.offsetWidth === 0 ? nextTick(() => calcPosistion()) : calcPosistion();
nextTick(() => {
calcPosistion();
});
}
};
const handlerPopperMouseEnter = function() {
if (triggerMethods.value.includes("hover") && props.enterable) {
doShow();
}
};
const handlerPopperMouseLeave = function() {
if (triggerMethods.value.includes("hover") && props.enterable) {
doHidden();
}
};
const handlerTriggerClick = function() {
if (!triggerMethods.value.includes("click"))
return;
if (innerVisible.value) {
doHidden();
} else {
doShow();
}
};
const handleTriggerContextMenu = function(e) {
if (!triggerMethods.value.includes("contextMenu"))
return;
e.preventDefault();
if (innerVisible.value) {
doHidden();
} else {
doShow();
}
};
const handlerTriggerMouseEnter = function() {
if (!triggerMethods.value.includes("hover"))
return;
doShow();
};
const handlerTriggerMouseLeave = function() {
if (!triggerMethods.value.includes("hover"))
return;
doHidden();
};
const handleTriggerFocusin = function() {
if (triggerMethods.value.includes("focus") && props.enterable) {
doShow();
}
};
const handleTriggerFocusout = function() {
if (triggerMethods.value.includes("focus") && props.enterable) {
doHidden();
}
};
const handlerTriggerEventRegist = function() {
useEventListener(triggerRefEl.value, "click", handlerTriggerClick);
useEventListener(triggerRefEl.value, "contextmenu", handleTriggerContextMenu);
useEventListener(triggerRefEl.value, "mouseenter", handlerTriggerMouseEnter);
useEventListener(triggerRefEl.value, "mouseleave", handlerTriggerMouseLeave);
useEventListener(triggerRefEl.value, "focusin", handleTriggerFocusin);
useEventListener(triggerRefEl.value, "focusout", handleTriggerFocusout);
};
const handleScroll = useThrottleFn(() => {
if (innerVisible.value) {
updatePosistion();
}
}, 15);
onClickOutside(triggerRefEl.value, (e) => {
if (!innerVisible.value || triggerRefEl.value.contains(e.target) || popperRefEl.value.contains(e.target)) {
return;
}
doHidden();
}, {
ignore: [popperRefEl.value]
});
useResizeObserver(triggerRefEl, () => {
updatePosistion();
});
let popperObserver = void 0;
watch(innerVisible, (isShow) => {
updatePosistion();
if (isShow) {
popperObserver = useResizeObserver(popperRefEl, () => {
updatePosistion();
});
} else {
popperObserver && popperObserver.stop();
}
});
watch(() => props.visible, (isShow) => isShow ? doShow() : doHidden());
watch(() => props.content, () => {
updatePosistion();
});
const isScrollElement2 = function(element) {
return element.scrollHeight > element.offsetHeight || element.scrollWidth > element.offsetWidth;
};
const getScrollElements2 = function(container) {
var _a2;
const scrollElements2 = [];
let element = container;
while (element && element !== document.documentElement) {
if (isScrollElement2(element)) {
scrollElements2.push(element);
}
element = (_a2 = element.parentElement) != null ? _a2 : void 0;
}
return scrollElements2;
};
onMounted(() => {
updatePosistion();
scrollElements = getScrollElements2(triggerRefEl.value);
for (const item of scrollElements) {
useEventListener(item, "scroll", handleScroll);
}
useEventListener("resize", handleScroll);
handlerTriggerEventRegist();
});
return (_ctx, _cache) => {
return isExist3.value ? (openBlock(), createBlock(Teleport, {
key: 0,
to: "body"
}, [
withDirectives(createVNode(Transition, null, {
default: withCtx(() => {
var _a2;
return [
createElementVNode("div", {
ref_key: "popperRefEl",
ref: popperRefEl,
class: normalizeClass(["layui-popper", { "layui-dark": __props.isDark }, props.popperClass]),
style: normalizeStyle([style.value, (_a2 = props.popperStyle) != null ? _a2 : ""]),
position: innnerPosition.value,
onMouseenter: handlerPopperMouseEnter,
onMouseleave: handlerPopperMouseLeave
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(__props.content), 1)
]),
_hoisted_2$F
], 46, _hoisted_1$M)
];
}),
_: 3
}, 512), [
[vShow, innerVisible.value]
])
])) : createCommentVNode("", true);
};
}
});
const __default__$_ = {
name: "LayTooltip",
inheritAttrs: false
};
const _sfc_main$11 = defineComponent({
...__default__$_,
props: {
content: {
type: [Number, String],
required: false
},
position: {
type: String,
default: "top"
},
isDark: {
type: Boolean,
default: true
},
disabled: {
type: Boolean,
default: false
},
isCanHide: {
type: Boolean,
default: true
},
isAutoShow: {
type: Boolean,
default: false
},
visible: {
type: Boolean,
default: false
},
trigger: {
type: String,
default: "hover"
},
enterable: {
type: Boolean,
default: true
},
popperClass: {
type: [String, Array, Object]
},
popperStyle: {
type: [String, Object]
}
},
setup(__props) {
const props = __props;
const vm = getCurrentInstance();
const isMounted = ref(false);
const tooltipRefEl = shallowRef(void 0);
const innerProps = computed$1(() => {
return { el: vm.proxy.$el.nextElementSibling, ...vm.proxy.$props };
});
const setEllipsis = function() {
var _a2;
if (tooltipRefEl.value) {
let tooltipHtml = tooltipRefEl.value;
if (tooltipHtml.offsetWidth >= ((_a2 = tooltipHtml.firstChild) == null ? void 0 : _a2.offsetWidth)) {
isMounted.value = false;
} else {
isMounted.value = true;
}
} else {
isMounted.value = true;
}
};
onMounted(() => {
if (props.isAutoShow) {
useEventListener("resize", () => {
setEllipsis();
});
}
nextTick(() => {
setEllipsis();
});
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
__props.isAutoShow ? (openBlock(), createElementBlock("div", {
key: 0,
ref_key: "tooltipRefEl",
ref: tooltipRefEl,
class: "lay-tooltip-content"
}, [
createElementVNode("span", null, [
renderSlot(_ctx.$slots, "default")
])
], 512)) : renderSlot(_ctx.$slots, "default", { key: 1 }),
isMounted.value ? (openBlock(), createBlock(_sfc_main$12, normalizeProps(mergeProps({ key: 2 }, unref(innerProps))), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "content")
]),
_: 3
}, 16)) : createCommentVNode("", true)
], 64);
};
}
});
const _hoisted_1$L = { href: "javascript:void(0)" };
const _hoisted_2$E = { key: 0 };
const _hoisted_3$z = { key: 0 };
const _hoisted_4$r = {
key: 1,
href: "javascript:void(0)"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$k = {
2022-11-15 01:16:55 +00:00
key: 0,
class: "layui-sub-menu-icon"
};
const _hoisted_6$g = { key: 1 };
const _hoisted_7$e = { key: 2 };
const __default__$Z = {
name: "LayMenuItem"
};
const _sfc_main$10 = defineComponent({
...__default__$Z,
props: {
id: null,
title: null
},
setup(__props) {
const props = __props;
const slots = useSlots();
const { level } = useLevel();
const selectedKey = inject("selectedKey");
const isTree = inject("isTree");
const isCollapse = inject("isCollapse");
const theme = inject("menuTheme");
const indent = inject("indent");
const dropdownCtx = inject(dropdownInjectionKey, void 0);
const selectHandle = function() {
selectedKey.value = props.id;
dropdownCtx == null ? void 0 : dropdownCtx.hide();
};
const needTooltip = computed$1(() => isTree.value && (isCollapse.value === true || isCollapse.value === "true") && level.value === 1);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
class: normalizeClass(["layui-nav-item", { "layui-this": unref(selectedKey) === __props.id }]),
style: normalizeStyle(unref(indentHandle)({ indent: unref(indent), level: unref(level), isTree: unref(isTree) })),
onClick: _cache[0] || (_cache[0] = ($event) => selectHandle())
}, [
unref(needTooltip) ? (openBlock(), createBlock(_sfc_main$11, {
key: 0,
position: "right",
isDark: unref(theme) !== "light"
}, {
content: withCtx(() => [
unref(slots).title ? (openBlock(), createElementBlock("span", _hoisted_3$z, [
renderSlot(_ctx.$slots, "title")
])) : createCommentVNode("", true)
]),
default: withCtx(() => [
createElementVNode("a", _hoisted_1$L, [
unref(slots).icon ? (openBlock(), createElementBlock("i", _hoisted_2$E, [
renderSlot(_ctx.$slots, "icon")
])) : createCommentVNode("", true)
])
]),
_: 3
}, 8, ["isDark"])) : (openBlock(), createElementBlock("a", _hoisted_4$r, [
2022-12-30 08:13:19 +00:00
unref(slots).icon ? (openBlock(), createElementBlock("i", _hoisted_5$k, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "icon")
])) : createCommentVNode("", true),
unref(slots).title ? (openBlock(), createElementBlock("span", _hoisted_6$g, [
renderSlot(_ctx.$slots, "title")
])) : (openBlock(), createElementBlock("span", _hoisted_7$e, [
renderSlot(_ctx.$slots, "default")
]))
]))
], 6);
};
}
});
const component$P = withInstall(_sfc_main$10);
2022-12-30 08:13:19 +00:00
var index$w = /* @__PURE__ */ (() => ".layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border-top:1px solid var(--global-neutral-color-6);border-bottom:1px solid var(--global-neutral-color-6);border-right:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}\n")();
2022-11-15 01:16:55 +00:00
const _hoisted_1$K = ["onClick", "size"];
const _hoisted_2$D = ["name", "value"];
const _hoisted_3$y = ["lay-skin"];
const _hoisted_4$q = {
key: 0,
class: "layui-checkbox-label"
};
const __default__$Y = {
name: "LayCheckbox"
};
const _sfc_main$$ = defineComponent({
...__default__$Y,
props: {
name: null,
skin: null,
label: { default: "" },
value: null,
modelValue: { type: [Boolean, Array], default: false },
isIndeterminate: { type: Boolean, default: false },
size: { default: "md" },
disabled: { type: Boolean, default: false }
},
emits: ["update:modelValue", "change"],
setup(__props, { expose, emit }) {
const props = __props;
const checkboxGroup = inject("checkboxGroup", {});
const isGroup = computed$1(() => {
return checkboxGroup != void 0 && (checkboxGroup == null ? void 0 : checkboxGroup.name) === "LayCheckboxGroup";
});
const slots = useSlots();
const isChecked = computed$1({
get() {
if (isGroup.value) {
return checkboxGroup.modelValue.value.includes(props.value);
} else {
if (Array.isArray(props.modelValue)) {
return props.modelValue.includes(props.value);
} else {
return props.modelValue;
}
}
},
set(val) {
if (isGroup.value) {
setGroupModelValue(val);
} else {
if (Array.isArray(props.modelValue)) {
setArrayModelValue(val);
} else {
emit("change", val);
emit("update:modelValue", val);
}
}
}
});
const arrayModelValue = computed$1(() => {
if (Array.isArray(props.modelValue)) {
return [...props.modelValue];
} else {
return [];
}
});
const setGroupModelValue = function(checked) {
let groupModelValue = [...checkboxGroup.modelValue.value];
if (!checked) {
groupModelValue.splice(groupModelValue.indexOf(props.value), 1);
} else {
groupModelValue.push(props.value);
}
checkboxGroup.modelValue.value = groupModelValue;
};
const setArrayModelValue = function(checked) {
let arr = [...arrayModelValue.value];
if (!checked) {
arr.splice(arr.indexOf(props.value), 1);
} else {
arr.push(props.value);
}
emit("change", arr);
emit("update:modelValue", arr);
};
const handleClick = function() {
if (!isDisabled.value) {
isChecked.value = !isChecked.value;
}
};
const isDisabled = computed$1(() => {
if (props.disabled) {
return true;
}
if (checkboxGroup.hasOwnProperty("disabled") && checkboxGroup.disabled.value) {
return true;
}
return false;
});
expose({ toggle: handleClick });
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", {
onClick: withModifiers(handleClick, ["stop"]),
class: "layui-checkbox",
size: __props.size
}, [
createElementVNode("input", {
type: "checkbox",
name: __props.name,
value: __props.value
}, null, 8, _hoisted_2$D),
createElementVNode("div", {
class: normalizeClass(["layui-form-checkbox", {
"layui-form-checked": unref(isChecked),
"layui-checkbox-disabled layui-disabled": unref(isDisabled)
}]),
"lay-skin": __props.skin
}, [
unref(slots).default || __props.label ? (openBlock(), createElementBlock("span", _hoisted_4$q, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(__props.label), 1)
])
])) : createCommentVNode("", true),
createVNode(unref(_sfc_main$2E), {
type: props.isIndeterminate && unref(isChecked) ? "layui-icon-subtraction" : unref(isChecked) ? "layui-icon-ok" : ""
}, null, 8, ["type"])
], 10, _hoisted_3$y)
], 8, _hoisted_1$K);
};
}
});
const component$O = withInstall(_sfc_main$$);
const __default__$X = {
name: "LayCheckboxGroup"
};
const _sfc_main$_ = defineComponent({
...__default__$X,
props: {
modelValue: { default: () => [] },
disabled: { type: Boolean, default: false }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const modelValue = ref(props.modelValue);
const disabled = ref(props.disabled);
provide("checkboxGroup", {
name: "LayCheckboxGroup",
modelValue,
disabled
});
watch(() => modelValue, (val) => {
emit("change", modelValue.value);
emit("update:modelValue", modelValue.value);
}, { deep: true });
watch(() => props.modelValue, (val) => modelValue.value = val);
watch(() => props.disabled, (val) => disabled.value = val);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-checkbox-group", { "layui-checkbox-group-disabled": disabled.value }])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$N = withInstall(_sfc_main$_);
var index$v = /* @__PURE__ */ (() => '.layui-form-item{margin-bottom:20px;clear:both}.layui-form-item-right .layui-form-label{text-align:right}.layui-form-item-left .layui-form-label{text-align:left}.layui-form-item-top .layui-form-label{text-align:left;float:none}.layui-form-item-top>div{margin-left:0}.layui-form-item:after{content:" ";clear:both;display:block;height:0}.layui-form-label{float:left;display:block;width:95px;padding-right:15px;line-height:38px;font-weight:400}.layui-form-label-col{display:block;float:none;padding:9px 0;line-height:20px;text-align:left}.layui-form-item .layui-inline{margin-bottom:5px;margin-right:10px}.layui-input-block{margin-left:110px;min-height:36px}.layui-input-inline{display:inline-block;vertical-align:middle}.layui-form-item .layui-input-inline{float:left;width:190px;margin-right:10px}.layui-form-text .layui-input-inline{width:auto}.layui-form-mid{float:left;display:block;padding:9px 0!important;line-height:20px;margin-right:10px}.layui-form-danger+.layui-form-select .layui-input,.layui-form-danger:focus{border-color:#ff5722!important}.layui-form-item .layui-form-checkbox{margin-top:4px}.layui-form-item .layui-form-checkbox[lay-skin=primary]{margin-top:10px}.layui-required{color:#ff5722;font-size:12px;line-height:1}.layui-form .layui-form-item .layui-input-block .layui-form-danger,.layui-form .layui-form-item .layui-input-inline .layui-form-danger,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-textarea,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-textarea,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-tag-input,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-tag-input,.layui-form .layui-form-item .layui-input-block .layui-form-danger .layui-input,.layui-form .layui-form-item .layui-input-inline .layui-form-danger .layui-input{border-color:#ff5722!important}.layui-error-message{color:#ff5722;font-size:12px;line-height:1;padding-top:5px;position:absolute;top:100%;left:0}.layui-error-message-anim{-ms-transform-origin:0 0;-webkit-transform-origin:0 0;transform-origin:0 0;-webkit-animation:layui-top-show-anim .3s ease 1;animation:layui-top-show-anim .3s ease 1}@keyframes layui-top-show-anim{0%{opacity:.3;transform:rotateX(45deg)}to{opacity:1;transform:rotateX(0)}}\n')();
const __default__$W = {
name: "LayForm"
};
const _sfc_main$Z = defineComponent({
...__default__$W,
props: {
model: { default: function() {
return {};
} },
required: { type: Boolean },
rules: null,
initValidate: { type: Boolean, default: false },
requiredIcons: { default: "" },
requiredErrorMessage: null,
validateMessage: null,
useCN: { type: Boolean, default: true }
},
emits: ["submit"],
setup(__props, { expose, emit }) {
const props = __props;
const formItems = [];
const formItemMap = {};
onMounted(() => {
var _a2;
props.initValidate && ((_a2 = validate()) == null ? void 0 : _a2.catch((err) => {
}));
});
const submit = function() {
let _isValidate = false;
validate((isValidate, model, errors) => {
_isValidate = isValidate;
emit("submit", isValidate, model, errors);
});
return _isValidate;
};
const validate = function(fields, callback) {
let validateItems = formItems;
if (typeof fields === "function") {
callback = fields;
} else if (typeof fields === "string" || Array.isArray(fields) && fields.length > 0) {
validateItems = [];
const validateFields = !fields ? [] : [].concat(fields);
validateFields.forEach((field) => formItemMap[field] && validateItems.push(formItemMap[field]));
}
let errorsArrs = [];
validateItems.forEach((filed) => {
filed.validate((errors, _fields) => {
errorsArrs = errorsArrs.concat(errors);
});
});
const isValidate = errorsArrs.length === 0;
if (typeof callback === "function") {
isValidate ? callback(true, props.model, null) : callback(false, props.model, errorsArrs);
return null;
}
return new Promise((resolve, reject) => {
const callbackParams = {
isValidate,
model: props.model,
errors: isValidate ? null : errorsArrs
};
callbackParams.isValidate ? resolve(callbackParams) : reject(callbackParams);
});
};
const clearValidate = function(fields) {
const clearFields = !fields ? [] : [].concat(fields);
if (clearFields.length === 0) {
formItems.forEach((filed) => filed.clearValidate());
} else {
clearFields.forEach((field) => formItemMap[field] && formItemMap[field].clearValidate());
}
};
const reset3 = function() {
for (const key in props.model) {
props.model[key] = null;
}
setTimeout(() => {
var _a2;
return (_a2 = validate()) == null ? void 0 : _a2.catch((err) => {
});
}, 0);
};
const addField = function(item) {
formItems.push(item);
formItemMap[item.prop] = item;
};
expose({ validate, clearValidate, reset: reset3 });
provide("LayForm", reactive({
formItems,
addField,
clearValidate,
validate,
...toRefs(props)
}));
return (_ctx, _cache) => {
return openBlock(), createElementBlock("form", {
class: "layui-form",
onsubmit: submit
}, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$M = withInstall(_sfc_main$Z);
var index$u = /* @__PURE__ */ (() => ".layui-breadcrumb{font-size:0}.layui-breadcrumb>*{font-size:14px}.layui-breadcrumb a{color:#999}.layui-breadcrumb a:hover{color:var(--global-checked-color)!important}.layui-breadcrumb a:nth-last-child(2){color:#666;font-style:normal}.layui-breadcrumb span:last-child{display:none}.layui-breadcrumb span[lay-separator]{margin:0 10px;color:var(--global-neutral-color-7)}\n")();
const _hoisted_1$J = { class: "layui-breadcrumb" };
const __default__$V = {
name: "LayBreadcrumb"
};
const _sfc_main$Y = defineComponent({
...__default__$V,
props: {
separator: { default: "/" }
},
setup(__props) {
const props = __props;
provide("separator", props.separator);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("span", _hoisted_1$J, [
renderSlot(_ctx.$slots, "default")
]);
};
}
});
const component$L = withInstall(_sfc_main$Y);
const _hoisted_1$I = { "lay-separator": "" };
const __default__$U = {
name: "LayBreadcrumbItem"
};
const _sfc_main$X = defineComponent({
...__default__$U,
props: {
title: null
},
setup(__props) {
const separator = inject("separator");
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
createElementVNode("a", mergeProps({ href: "javascript:void(0);" }, _ctx.$attrs), [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(__props.title), 1)
])
], 16),
createElementVNode("span", _hoisted_1$I, toDisplayString$1(unref(separator)), 1)
], 64);
};
}
});
const component$K = withInstall(_sfc_main$X);
var index$t = /* @__PURE__ */ (() => ":root{--field-border-color: var(--global-neutral-color-3);--field-border-radius: var(--global-border-radius)}.layui-field{margin-bottom:10px;padding:0;border-width:1px;border-color:var(--field-border-color);border-style:solid}.layui-field legend{margin-left:20px;padding:0 10px;font-size:20px;font-weight:300}.layui-field-title{margin:10px 0 20px;border-width:1px 0 0}.layui-field-box{padding:15px}.layui-field-title .layui-field-box{padding:10px 0}\n")();
const _hoisted_1$H = {
key: 0,
class: "layui-field"
};
const _hoisted_2$C = { class: "layui-field-box" };
const _hoisted_3$x = {
key: 1,
class: "layui-field layui-field-title"
};
const _hoisted_4$p = { name: "docend" };
const __default__$T = {
name: "LayField"
};
const _sfc_main$W = defineComponent({
...__default__$T,
props: {
title: null
},
setup(__props) {
const slot = useSlots();
return (_ctx, _cache) => {
return unref(slot).default ? (openBlock(), createElementBlock("fieldset", _hoisted_1$H, [
createElementVNode("legend", null, toDisplayString$1(__props.title), 1),
createElementVNode("div", _hoisted_2$C, [
renderSlot(_ctx.$slots, "default")
])
])) : (openBlock(), createElementBlock("fieldset", _hoisted_3$x, [
createElementVNode("legend", null, [
createElementVNode("a", _hoisted_4$p, toDisplayString$1(__props.title), 1)
])
]));
};
}
});
const component$J = withInstall(_sfc_main$W);
2022-12-30 08:13:19 +00:00
var index$s = /* @__PURE__ */ (() => '.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border-top:1px solid var(--global-neutral-color-6);border-bottom:1px solid var(--global-neutral-color-6);border-right:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}:root{--input-border-radius: var(--global-border-radius);--
var index$r = /* @__PURE__ */ (() => '.layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag .layui-tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffab
var index$q = /* @__PURE__ */ (() => ".layui-tag{--layui-tag-bg-color: #fafafa;--layui-tag-border-color: #f0f0f0;--layui-tag-hover-color: #FFF;--layui-tag-text-color: currentColor;display:inline-flex;align-items:baseline;vertical-align:middle;box-sizing:border-box;height:26px;line-height:26px;padding:0 8px;font-size:14px;font-weight:500;color:var(--layui-tag-text-color);background-color:var(--layui-tag-bg-color);border-width:1px;border-style:solid;border-color:transparent;border-radius:var(--global-border-radius)}.layui-tag-icon{margin-right:4px}.layui-tag-bordered{border-color:var(--layui-tag-border-color)}.layui-tag-disabled{opacity:.4;cursor:not-allowed}.layui-tag-disabled .layui-tag-close-icon .layui-icon:hover{cursor:not-allowed!important;opacity:1}.layui-tag-shap-square{border-radius:var(--global-border-radius)}.layui-tag-shap-round{border-radius:12px}.layui-tag .layui-tag-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.layui-tag .layui-tag-close-icon{margin-left:4px;font-size:14px}.layui-tag .layui-tag-close-icon .layui-icon:hover{cursor:pointer;opacity:.5}.layui-tag-size-lg{height:30px;font-size:14px;line-height:30px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-md{height:26px;font-size:14px;line-height:26px}.layui-tag .layui-icon{font-size:14px}.layui-tag-size-sm{height:22px;font-size:12px;line-height:22px}.layui-tag-size-xs{height:18px;font-size:12px;line-height:18px}.layui-tag .layui-icon{font-size:12px}.layui-tag-primary{--layui-tag-bg-color: #009688;--layui-tag-border-color: transparent;--layui-tag-hover-color: #009688;--layui-tag-text-color: #FFF}.layui-tag-primary-bordered{--layui-tag-border-color: #009688}.layui-tag-primary.layui-tag-variant-light{--layui-tag-bg-color: #e6f5f3;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e6f5f3;--layui-tag-text-color: #009688}.layui-tag-primary.layui-tag-variant-light-bordered{--layui-tag-border-color: #80cbc4}.layui-tag-primary.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #009688;--layui-tag-border-color: transparent}.layui-tag-primary.layui-tag-variant-plain-bordered{--layui-tag-border-color: #009688}.layui-tag-normal{--layui-tag-bg-color: #1e9fff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #1e9fff;--layui-tag-text-color: #FFF}.layui-tag-normal-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light{--layui-tag-bg-color: #e9f5ff;--layui-tag-border-color: transparent;--layui-tag-hover-color: #e9f5ff;--layui-tag-text-color: #1e9fff}.layui-tag-normal.layui-tag-variant-light-bordered{--layui-tag-border-color: #8fcfff}.layui-tag-normal.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #1e9fff;--layui-tag-border-color: transparent}.layui-tag-normal.layui-tag-variant-plain-bordered{--layui-tag-border-color: #1e9fff}.layui-tag-warm{--layui-tag-bg-color: #ffb800;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffb800;--layui-tag-text-color: #FFF}.layui-tag-warm-bordered{--layui-tag-border-color: #ffb800}.layui-tag-warm.layui-tag-variant-light{--layui-tag-bg-color: #fff8e6;--layui-tag-border-color: transparent;--layui-tag-hover-color: #fff8e6;--layui-tag-text-color: #ffb800}.layui-tag-warm.layui-tag-variant-light-bordered{--layui-tag-border-color: #ffdc80}.layui-tag-warm.layui-tag-variant-plain{--layui-tag-bg-color: transparent;--layui-tag-hover-color: transparent;--layui-tag-text-color: #ffb800;--layui-tag-border-color: transparent}.layui-tag-warm.layui-tag-variant-plain-bordered{--layui-tag-border-color: #ffb800}.layui-tag-danger{--layui-tag-bg-color: #ff5722;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ff5722;--layui-tag-text-color: #FFF}.layui-tag-danger-bordered{--layui-tag-border-color: #ff5722}.layui-tag-danger.layui-tag-variant-light{--layui-tag-bg-color: #ffeee9;--layui-tag-border-color: transparent;--layui-tag-hover-color: #ffeee9;--layui-tag-text-color: #ff5722}.layui-tag-danger.layui-tag-variant-light-bo
2022-11-15 01:16:55 +00:00
function bound01(n, max) {
if (isOnePointZero(n)) {
n = "100%";
}
var isPercent = isPercentage(n);
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
if (isPercent) {
n = parseInt(String(n * max), 10) / 100;
}
if (Math.abs(n - max) < 1e-6) {
return 1;
}
if (max === 360) {
n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
} else {
n = n % max / parseFloat(String(max));
}
return n;
}
function clamp01(val) {
return Math.min(1, Math.max(0, val));
}
function isOnePointZero(n) {
return typeof n === "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
}
function isPercentage(n) {
return typeof n === "string" && n.indexOf("%") !== -1;
}
function boundAlpha(a) {
a = parseFloat(a);
if (isNaN(a) || a < 0 || a > 1) {
a = 1;
}
return a;
}
function convertToPercentage(n) {
if (n <= 1) {
return "".concat(Number(n) * 100, "%");
}
return n;
}
function pad2(c) {
return c.length === 1 ? "0" + c : String(c);
}
function rgbToRgb(r, g, b) {
return {
r: bound01(r, 255) * 255,
g: bound01(g, 255) * 255,
b: bound01(b, 255) * 255
};
}
function rgbToHsl(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var h2 = 0;
var s = 0;
var l = (max + min) / 2;
if (max === min) {
s = 0;
h2 = 0;
} else {
var d = max - min;
s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
switch (max) {
case r:
h2 = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h2 = (b - r) / d + 2;
break;
case b:
h2 = (r - g) / d + 4;
break;
}
h2 /= 6;
}
return { h: h2, s, l };
}
function hue2rgb(p, q, t) {
if (t < 0) {
t += 1;
}
if (t > 1) {
t -= 1;
}
if (t < 1 / 6) {
return p + (q - p) * (6 * t);
}
if (t < 1 / 2) {
return q;
}
if (t < 2 / 3) {
return p + (q - p) * (2 / 3 - t) * 6;
}
return p;
}
function hslToRgb(h2, s, l) {
var r;
var g;
var b;
h2 = bound01(h2, 360);
s = bound01(s, 100);
l = bound01(l, 100);
if (s === 0) {
g = l;
b = l;
r = l;
} else {
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
var p = 2 * l - q;
r = hue2rgb(p, q, h2 + 1 / 3);
g = hue2rgb(p, q, h2);
b = hue2rgb(p, q, h2 - 1 / 3);
}
return { r: r * 255, g: g * 255, b: b * 255 };
}
function rgbToHsv(r, g, b) {
r = bound01(r, 255);
g = bound01(g, 255);
b = bound01(b, 255);
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var h2 = 0;
var v = max;
var d = max - min;
var s = max === 0 ? 0 : d / max;
if (max === min) {
h2 = 0;
} else {
switch (max) {
case r:
h2 = (g - b) / d + (g < b ? 6 : 0);
break;
case g:
h2 = (b - r) / d + 2;
break;
case b:
h2 = (r - g) / d + 4;
break;
}
h2 /= 6;
}
return { h: h2, s, v };
}
function hsvToRgb(h2, s, v) {
h2 = bound01(h2, 360) * 6;
s = bound01(s, 100);
v = bound01(v, 100);
var i = Math.floor(h2);
var f = h2 - i;
var p = v * (1 - s);
var q = v * (1 - f * s);
var t = v * (1 - (1 - f) * s);
var mod = i % 6;
var r = [v, q, p, p, t, v][mod];
var g = [t, v, v, q, p, p][mod];
var b = [p, p, t, v, v, q][mod];
return { r: r * 255, g: g * 255, b: b * 255 };
}
function rgbToHex(r, g, b, allow3Char) {
var hex2 = [
pad2(Math.round(r).toString(16)),
pad2(Math.round(g).toString(16)),
pad2(Math.round(b).toString(16))
];
if (allow3Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1))) {
return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0);
}
return hex2.join("");
}
function rgbaToHex(r, g, b, a, allow4Char) {
var hex2 = [
pad2(Math.round(r).toString(16)),
pad2(Math.round(g).toString(16)),
pad2(Math.round(b).toString(16)),
pad2(convertDecimalToHex(a))
];
if (allow4Char && hex2[0].startsWith(hex2[0].charAt(1)) && hex2[1].startsWith(hex2[1].charAt(1)) && hex2[2].startsWith(hex2[2].charAt(1)) && hex2[3].startsWith(hex2[3].charAt(1))) {
return hex2[0].charAt(0) + hex2[1].charAt(0) + hex2[2].charAt(0) + hex2[3].charAt(0);
}
return hex2.join("");
}
function convertDecimalToHex(d) {
return Math.round(parseFloat(d) * 255).toString(16);
}
function convertHexToDecimal(h2) {
return parseIntFromHex(h2) / 255;
}
function parseIntFromHex(val) {
return parseInt(val, 16);
}
function numberInputToObject(color) {
return {
r: color >> 16,
g: (color & 65280) >> 8,
b: color & 255
};
}
var names = {
aliceblue: "#f0f8ff",
antiquewhite: "#faebd7",
aqua: "#00ffff",
aquamarine: "#7fffd4",
azure: "#f0ffff",
beige: "#f5f5dc",
bisque: "#ffe4c4",
black: "#000000",
blanchedalmond: "#ffebcd",
blue: "#0000ff",
blueviolet: "#8a2be2",
brown: "#a52a2a",
burlywood: "#deb887",
cadetblue: "#5f9ea0",
chartreuse: "#7fff00",
chocolate: "#d2691e",
coral: "#ff7f50",
cornflowerblue: "#6495ed",
cornsilk: "#fff8dc",
crimson: "#dc143c",
cyan: "#00ffff",
darkblue: "#00008b",
darkcyan: "#008b8b",
darkgoldenrod: "#b8860b",
darkgray: "#a9a9a9",
darkgreen: "#006400",
darkgrey: "#a9a9a9",
darkkhaki: "#bdb76b",
darkmagenta: "#8b008b",
darkolivegreen: "#556b2f",
darkorange: "#ff8c00",
darkorchid: "#9932cc",
darkred: "#8b0000",
darksalmon: "#e9967a",
darkseagreen: "#8fbc8f",
darkslateblue: "#483d8b",
darkslategray: "#2f4f4f",
darkslategrey: "#2f4f4f",
darkturquoise: "#00ced1",
darkviolet: "#9400d3",
deeppink: "#ff1493",
deepskyblue: "#00bfff",
dimgray: "#696969",
dimgrey: "#696969",
dodgerblue: "#1e90ff",
firebrick: "#b22222",
floralwhite: "#fffaf0",
forestgreen: "#228b22",
fuchsia: "#ff00ff",
gainsboro: "#dcdcdc",
ghostwhite: "#f8f8ff",
goldenrod: "#daa520",
gold: "#ffd700",
gray: "#808080",
green: "#008000",
greenyellow: "#adff2f",
grey: "#808080",
honeydew: "#f0fff0",
hotpink: "#ff69b4",
indianred: "#cd5c5c",
indigo: "#4b0082",
ivory: "#fffff0",
khaki: "#f0e68c",
lavenderblush: "#fff0f5",
lavender: "#e6e6fa",
lawngreen: "#7cfc00",
lemonchiffon: "#fffacd",
lightblue: "#add8e6",
lightcoral: "#f08080",
lightcyan: "#e0ffff",
lightgoldenrodyellow: "#fafad2",
lightgray: "#d3d3d3",
lightgreen: "#90ee90",
lightgrey: "#d3d3d3",
lightpink: "#ffb6c1",
lightsalmon: "#ffa07a",
lightseagreen: "#20b2aa",
lightskyblue: "#87cefa",
lightslategray: "#778899",
lightslategrey: "#778899",
lightsteelblue: "#b0c4de",
lightyellow: "#ffffe0",
lime: "#00ff00",
limegreen: "#32cd32",
linen: "#faf0e6",
magenta: "#ff00ff",
maroon: "#800000",
mediumaquamarine: "#66cdaa",
mediumblue: "#0000cd",
mediumorchid: "#ba55d3",
mediumpurple: "#9370db",
mediumseagreen: "#3cb371",
mediumslateblue: "#7b68ee",
mediumspringgreen: "#00fa9a",
mediumturquoise: "#48d1cc",
mediumvioletred: "#c71585",
midnightblue: "#191970",
mintcream: "#f5fffa",
mistyrose: "#ffe4e1",
moccasin: "#ffe4b5",
navajowhite: "#ffdead",
navy: "#000080",
oldlace: "#fdf5e6",
olive: "#808000",
olivedrab: "#6b8e23",
orange: "#ffa500",
orangered: "#ff4500",
orchid: "#da70d6",
palegoldenrod: "#eee8aa",
palegreen: "#98fb98",
paleturquoise: "#afeeee",
palevioletred: "#db7093",
papayawhip: "#ffefd5",
peachpuff: "#ffdab9",
peru: "#cd853f",
pink: "#ffc0cb",
plum: "#dda0dd",
powderblue: "#b0e0e6",
purple: "#800080",
rebeccapurple: "#663399",
red: "#ff0000",
rosybrown: "#bc8f8f",
royalblue: "#4169e1",
saddlebrown: "#8b4513",
salmon: "#fa8072",
sandybrown: "#f4a460",
seagreen: "#2e8b57",
seashell: "#fff5ee",
sienna: "#a0522d",
silver: "#c0c0c0",
skyblue: "#87ceeb",
slateblue: "#6a5acd",
slategray: "#708090",
slategrey: "#708090",
snow: "#fffafa",
springgreen: "#00ff7f",
steelblue: "#4682b4",
tan: "#d2b48c",
teal: "#008080",
thistle: "#d8bfd8",
tomato: "#ff6347",
turquoise: "#40e0d0",
violet: "#ee82ee",
wheat: "#f5deb3",
white: "#ffffff",
whitesmoke: "#f5f5f5",
yellow: "#ffff00",
yellowgreen: "#9acd32"
};
function inputToRGB(color) {
var rgb = { r: 0, g: 0, b: 0 };
var a = 1;
var s = null;
var v = null;
var l = null;
var ok = false;
var format2 = false;
if (typeof color === "string") {
color = stringInputToObject(color);
}
if (typeof color === "object") {
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
rgb = rgbToRgb(color.r, color.g, color.b);
ok = true;
format2 = String(color.r).substr(-1) === "%" ? "prgb" : "rgb";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
s = convertToPercentage(color.s);
v = convertToPercentage(color.v);
rgb = hsvToRgb(color.h, s, v);
ok = true;
format2 = "hsv";
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
s = convertToPercentage(color.s);
l = convertToPercentage(color.l);
rgb = hslToRgb(color.h, s, l);
ok = true;
format2 = "hsl";
}
if (Object.prototype.hasOwnProperty.call(color, "a")) {
a = color.a;
}
}
a = boundAlpha(a);
return {
ok,
format: color.format || format2,
r: Math.min(255, Math.max(rgb.r, 0)),
g: Math.min(255, Math.max(rgb.g, 0)),
b: Math.min(255, Math.max(rgb.b, 0)),
a
};
}
var CSS_INTEGER = "[-\\+]?\\d+%?";
var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?";
var CSS_UNIT = "(?:".concat(CSS_NUMBER, ")|(?:").concat(CSS_INTEGER, ")");
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?");
var matchers = {
CSS_UNIT: new RegExp(CSS_UNIT),
rgb: new RegExp("rgb" + PERMISSIVE_MATCH3),
rgba: new RegExp("rgba" + PERMISSIVE_MATCH4),
hsl: new RegExp("hsl" + PERMISSIVE_MATCH3),
hsla: new RegExp("hsla" + PERMISSIVE_MATCH4),
hsv: new RegExp("hsv" + PERMISSIVE_MATCH3),
hsva: new RegExp("hsva" + PERMISSIVE_MATCH4),
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
};
function stringInputToObject(color) {
color = color.trim().toLowerCase();
if (color.length === 0) {
return false;
}
var named = false;
if (names[color]) {
color = names[color];
named = true;
} else if (color === "transparent") {
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
}
var match = matchers.rgb.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3] };
}
match = matchers.rgba.exec(color);
if (match) {
return { r: match[1], g: match[2], b: match[3], a: match[4] };
}
match = matchers.hsl.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3] };
}
match = matchers.hsla.exec(color);
if (match) {
return { h: match[1], s: match[2], l: match[3], a: match[4] };
}
match = matchers.hsv.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3] };
}
match = matchers.hsva.exec(color);
if (match) {
return { h: match[1], s: match[2], v: match[3], a: match[4] };
}
match = matchers.hex8.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
a: convertHexToDecimal(match[4]),
format: named ? "name" : "hex8"
};
}
match = matchers.hex6.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1]),
g: parseIntFromHex(match[2]),
b: parseIntFromHex(match[3]),
format: named ? "name" : "hex"
};
}
match = matchers.hex4.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1] + match[1]),
g: parseIntFromHex(match[2] + match[2]),
b: parseIntFromHex(match[3] + match[3]),
a: convertHexToDecimal(match[4] + match[4]),
format: named ? "name" : "hex8"
};
}
match = matchers.hex3.exec(color);
if (match) {
return {
r: parseIntFromHex(match[1] + match[1]),
g: parseIntFromHex(match[2] + match[2]),
b: parseIntFromHex(match[3] + match[3]),
format: named ? "name" : "hex"
};
}
return false;
}
function isValidCSSUnit(color) {
return Boolean(matchers.CSS_UNIT.exec(String(color)));
}
var TinyColor = function() {
function TinyColor2(color, opts) {
if (color === void 0) {
color = "";
}
if (opts === void 0) {
opts = {};
}
var _a2;
if (color instanceof TinyColor2) {
return color;
}
if (typeof color === "number") {
color = numberInputToObject(color);
}
this.originalInput = color;
var rgb = inputToRGB(color);
this.originalInput = color;
this.r = rgb.r;
this.g = rgb.g;
this.b = rgb.b;
this.a = rgb.a;
this.roundA = Math.round(100 * this.a) / 100;
this.format = (_a2 = opts.format) !== null && _a2 !== void 0 ? _a2 : rgb.format;
this.gradientType = opts.gradientType;
if (this.r < 1) {
this.r = Math.round(this.r);
}
if (this.g < 1) {
this.g = Math.round(this.g);
}
if (this.b < 1) {
this.b = Math.round(this.b);
}
this.isValid = rgb.ok;
}
TinyColor2.prototype.isDark = function() {
return this.getBrightness() < 128;
};
TinyColor2.prototype.isLight = function() {
return !this.isDark();
};
TinyColor2.prototype.getBrightness = function() {
var rgb = this.toRgb();
return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1e3;
};
TinyColor2.prototype.getLuminance = function() {
var rgb = this.toRgb();
var R;
var G;
var B;
var RsRGB = rgb.r / 255;
var GsRGB = rgb.g / 255;
var BsRGB = rgb.b / 255;
if (RsRGB <= 0.03928) {
R = RsRGB / 12.92;
} else {
R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);
}
if (GsRGB <= 0.03928) {
G = GsRGB / 12.92;
} else {
G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);
}
if (BsRGB <= 0.03928) {
B = BsRGB / 12.92;
} else {
B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);
}
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
};
TinyColor2.prototype.getAlpha = function() {
return this.a;
};
TinyColor2.prototype.setAlpha = function(alpha) {
this.a = boundAlpha(alpha);
this.roundA = Math.round(100 * this.a) / 100;
return this;
};
TinyColor2.prototype.toHsv = function() {
var hsv = rgbToHsv(this.r, this.g, this.b);
return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this.a };
};
TinyColor2.prototype.toHsvString = function() {
var hsv = rgbToHsv(this.r, this.g, this.b);
var h2 = Math.round(hsv.h * 360);
var s = Math.round(hsv.s * 100);
var v = Math.round(hsv.v * 100);
return this.a === 1 ? "hsv(".concat(h2, ", ").concat(s, "%, ").concat(v, "%)") : "hsva(".concat(h2, ", ").concat(s, "%, ").concat(v, "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toHsl = function() {
var hsl = rgbToHsl(this.r, this.g, this.b);
return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this.a };
};
TinyColor2.prototype.toHslString = function() {
var hsl = rgbToHsl(this.r, this.g, this.b);
var h2 = Math.round(hsl.h * 360);
var s = Math.round(hsl.s * 100);
var l = Math.round(hsl.l * 100);
return this.a === 1 ? "hsl(".concat(h2, ", ").concat(s, "%, ").concat(l, "%)") : "hsla(".concat(h2, ", ").concat(s, "%, ").concat(l, "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toHex = function(allow3Char) {
if (allow3Char === void 0) {
allow3Char = false;
}
return rgbToHex(this.r, this.g, this.b, allow3Char);
};
TinyColor2.prototype.toHexString = function(allow3Char) {
if (allow3Char === void 0) {
allow3Char = false;
}
return "#" + this.toHex(allow3Char);
};
TinyColor2.prototype.toHex8 = function(allow4Char) {
if (allow4Char === void 0) {
allow4Char = false;
}
return rgbaToHex(this.r, this.g, this.b, this.a, allow4Char);
};
TinyColor2.prototype.toHex8String = function(allow4Char) {
if (allow4Char === void 0) {
allow4Char = false;
}
return "#" + this.toHex8(allow4Char);
};
TinyColor2.prototype.toRgb = function() {
return {
r: Math.round(this.r),
g: Math.round(this.g),
b: Math.round(this.b),
a: this.a
};
};
TinyColor2.prototype.toRgbString = function() {
var r = Math.round(this.r);
var g = Math.round(this.g);
var b = Math.round(this.b);
return this.a === 1 ? "rgb(".concat(r, ", ").concat(g, ", ").concat(b, ")") : "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(this.roundA, ")");
};
TinyColor2.prototype.toPercentageRgb = function() {
var fmt = function(x) {
return "".concat(Math.round(bound01(x, 255) * 100), "%");
};
return {
r: fmt(this.r),
g: fmt(this.g),
b: fmt(this.b),
a: this.a
};
};
TinyColor2.prototype.toPercentageRgbString = function() {
var rnd = function(x) {
return Math.round(bound01(x, 255) * 100);
};
return this.a === 1 ? "rgb(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%)") : "rgba(".concat(rnd(this.r), "%, ").concat(rnd(this.g), "%, ").concat(rnd(this.b), "%, ").concat(this.roundA, ")");
};
TinyColor2.prototype.toName = function() {
if (this.a === 0) {
return "transparent";
}
if (this.a < 1) {
return false;
}
var hex2 = "#" + rgbToHex(this.r, this.g, this.b, false);
for (var _i = 0, _a2 = Object.entries(names); _i < _a2.length; _i++) {
var _b = _a2[_i], key = _b[0], value = _b[1];
if (hex2 === value) {
return key;
}
}
return false;
};
TinyColor2.prototype.toString = function(format2) {
var formatSet = Boolean(format2);
format2 = format2 !== null && format2 !== void 0 ? format2 : this.format;
var formattedString = false;
var hasAlpha = this.a < 1 && this.a >= 0;
var needsAlphaFormat = !formatSet && hasAlpha && (format2.startsWith("hex") || format2 === "name");
if (needsAlphaFormat) {
if (format2 === "name" && this.a === 0) {
return this.toName();
}
return this.toRgbString();
}
if (format2 === "rgb") {
formattedString = this.toRgbString();
}
if (format2 === "prgb") {
formattedString = this.toPercentageRgbString();
}
if (format2 === "hex" || format2 === "hex6") {
formattedString = this.toHexString();
}
if (format2 === "hex3") {
formattedString = this.toHexString(true);
}
if (format2 === "hex4") {
formattedString = this.toHex8String(true);
}
if (format2 === "hex8") {
formattedString = this.toHex8String();
}
if (format2 === "name") {
formattedString = this.toName();
}
if (format2 === "hsl") {
formattedString = this.toHslString();
}
if (format2 === "hsv") {
formattedString = this.toHsvString();
}
return formattedString || this.toHexString();
};
TinyColor2.prototype.toNumber = function() {
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
};
TinyColor2.prototype.clone = function() {
return new TinyColor2(this.toString());
};
TinyColor2.prototype.lighten = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.l += amount / 100;
hsl.l = clamp01(hsl.l);
return new TinyColor2(hsl);
};
TinyColor2.prototype.brighten = function(amount) {
if (amount === void 0) {
amount = 10;
}
var rgb = this.toRgb();
rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));
rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));
rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));
return new TinyColor2(rgb);
};
TinyColor2.prototype.darken = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.l -= amount / 100;
hsl.l = clamp01(hsl.l);
return new TinyColor2(hsl);
};
TinyColor2.prototype.tint = function(amount) {
if (amount === void 0) {
amount = 10;
}
return this.mix("white", amount);
};
TinyColor2.prototype.shade = function(amount) {
if (amount === void 0) {
amount = 10;
}
return this.mix("black", amount);
};
TinyColor2.prototype.desaturate = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.s -= amount / 100;
hsl.s = clamp01(hsl.s);
return new TinyColor2(hsl);
};
TinyColor2.prototype.saturate = function(amount) {
if (amount === void 0) {
amount = 10;
}
var hsl = this.toHsl();
hsl.s += amount / 100;
hsl.s = clamp01(hsl.s);
return new TinyColor2(hsl);
};
TinyColor2.prototype.greyscale = function() {
return this.desaturate(100);
};
TinyColor2.prototype.spin = function(amount) {
var hsl = this.toHsl();
var hue = (hsl.h + amount) % 360;
hsl.h = hue < 0 ? 360 + hue : hue;
return new TinyColor2(hsl);
};
TinyColor2.prototype.mix = function(color, amount) {
if (amount === void 0) {
amount = 50;
}
var rgb1 = this.toRgb();
var rgb2 = new TinyColor2(color).toRgb();
var p = amount / 100;
var rgba = {
r: (rgb2.r - rgb1.r) * p + rgb1.r,
g: (rgb2.g - rgb1.g) * p + rgb1.g,
b: (rgb2.b - rgb1.b) * p + rgb1.b,
a: (rgb2.a - rgb1.a) * p + rgb1.a
};
return new TinyColor2(rgba);
};
TinyColor2.prototype.analogous = function(results, slices) {
if (results === void 0) {
results = 6;
}
if (slices === void 0) {
slices = 30;
}
var hsl = this.toHsl();
var part = 360 / slices;
var ret = [this];
for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results; ) {
hsl.h = (hsl.h + part) % 360;
ret.push(new TinyColor2(hsl));
}
return ret;
};
TinyColor2.prototype.complement = function() {
var hsl = this.toHsl();
hsl.h = (hsl.h + 180) % 360;
return new TinyColor2(hsl);
};
TinyColor2.prototype.monochromatic = function(results) {
if (results === void 0) {
results = 6;
}
var hsv = this.toHsv();
var h2 = hsv.h;
var s = hsv.s;
var v = hsv.v;
var res = [];
var modification = 1 / results;
while (results--) {
res.push(new TinyColor2({ h: h2, s, v }));
v = (v + modification) % 1;
}
return res;
};
TinyColor2.prototype.splitcomplement = function() {
var hsl = this.toHsl();
var h2 = hsl.h;
return [
this,
new TinyColor2({ h: (h2 + 72) % 360, s: hsl.s, l: hsl.l }),
new TinyColor2({ h: (h2 + 216) % 360, s: hsl.s, l: hsl.l })
];
};
TinyColor2.prototype.onBackground = function(background) {
var fg = this.toRgb();
var bg = new TinyColor2(background).toRgb();
return new TinyColor2({
r: bg.r + (fg.r - bg.r) * fg.a,
g: bg.g + (fg.g - bg.g) * fg.a,
b: bg.b + (fg.b - bg.b) * fg.a
});
};
TinyColor2.prototype.triad = function() {
return this.polyad(3);
};
TinyColor2.prototype.tetrad = function() {
return this.polyad(4);
};
TinyColor2.prototype.polyad = function(n) {
var hsl = this.toHsl();
var h2 = hsl.h;
var result = [this];
var increment = 360 / n;
for (var i = 1; i < n; i++) {
result.push(new TinyColor2({ h: (h2 + i * increment) % 360, s: hsl.s, l: hsl.l }));
}
return result;
};
TinyColor2.prototype.equals = function(color) {
return this.toRgbString() === new TinyColor2(color).toRgbString();
};
return TinyColor2;
}();
const _hoisted_1$G = {
key: 0,
class: "layui-tag-icon"
};
2022-12-30 08:13:19 +00:00
const _hoisted_2$B = { class: "layui-tag-text" };
const _hoisted_3$w = ["onClick"];
2022-11-15 01:16:55 +00:00
const __default__$S = {
name: "LayTag"
};
const _sfc_main$V = defineComponent({
...__default__$S,
props: {
type: null,
color: null,
closable: { type: Boolean },
size: { default: "md" },
bordered: { type: Boolean, default: true },
disabled: { type: Boolean },
shape: { default: "square" },
maxWidth: null,
variant: { default: "dark" }
},
emits: ["close", "check", "update:checked"],
setup(__props, { emit }) {
const props = __props;
const visible = ref(true);
const handleClose = (e) => {
if (props.disabled)
return;
emit("close", e);
};
const classTag = computed$1(() => [
"layui-tag",
`layui-tag-size-${props.size}`,
`layui-tag-shap-${props.shape}`,
{
[`layui-tag-variant-${props.variant}`]: props.variant,
[`layui-tag-variant-${props.variant}-bordered`]: props.bordered,
[`layui-tag-${props.type}-bordered`]: props.bordered,
[`layui-tag-${props.type}`]: props.type,
"layui-tag-bordered": props.bordered,
2022-12-30 08:13:19 +00:00
"layui-tag-disabled": props.disabled
2022-11-15 01:16:55 +00:00
}
]);
const styleTag = computed$1(() => {
var _a2;
return [
{
2022-12-30 08:13:19 +00:00
"max-width": (_a2 = props.maxWidth) != null ? _a2 : "100%",
2022-11-15 01:16:55 +00:00
...useTagCustomStyle(props).value
}
];
});
function useTagCustomStyle(props2) {
return computed$1(() => {
let styles = {};
const tagColor = props2.color;
if (tagColor) {
const color = new TinyColor(tagColor);
if (props2.variant === "dark") {
const isDark = color.getBrightness() < 190;
const textColor = isDark ? "#FFF" : "#000000";
styles = {
"--layui-tag-bg-color": tagColor,
"--layui-tag-border-color": props2.bordered ? tagColor : "transparent",
"--layui-tag-hover-color": tagColor,
"--layui-tag-text-color": textColor
};
} else if (props2.variant === "light") {
styles = {
"--layui-tag-bg-color": color.tint(90).toString(),
"--layui-tag-border-color": props2.bordered ? color.tint(50).toString() : "transparent",
"--layui-tag-hover-color": color.tint(90).toString(),
"--layui-tag-text-color": tagColor
};
} else if (props2.variant === "plain") {
styles = {
"--layui-tag-bg-color": "transparent",
"--layui-tag-border-color": props2.bordered ? tagColor : "transparent",
"--layui-tag-hover-color": "transparent",
"--layui-tag-text-color": tagColor
};
}
}
return styles;
});
}
return (_ctx, _cache) => {
return visible.value ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass(unref(classTag)),
style: normalizeStyle(unref(styleTag))
}, [
_ctx.$slots.icon ? (openBlock(), createElementBlock("span", _hoisted_1$G, [
renderSlot(_ctx.$slots, "icon")
])) : createCommentVNode("", true),
2022-12-30 08:13:19 +00:00
createElementVNode("span", _hoisted_2$B, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "default")
2022-12-30 08:13:19 +00:00
]),
2022-11-15 01:16:55 +00:00
__props.closable ? (openBlock(), createElementBlock("span", {
2022-12-30 08:13:19 +00:00
key: 1,
2022-11-15 01:16:55 +00:00
class: "layui-tag-close-icon",
onClick: withModifiers(handleClose, ["stop"])
}, [
renderSlot(_ctx.$slots, "close-icon", {}, () => [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-close" })
])
2022-12-30 08:13:19 +00:00
], 8, _hoisted_3$w)) : createCommentVNode("", true)
2022-11-15 01:16:55 +00:00
], 6)) : createCommentVNode("", true);
};
}
});
const _hoisted_1$F = { key: 0 };
const _hoisted_2$A = { class: "layui-tag-input-inner" };
2022-12-30 08:13:19 +00:00
const _hoisted_3$v = { class: "layui-tag-input-collapsed-panel" };
2022-11-15 01:16:55 +00:00
const _hoisted_4$o = ["disabled", "placeholder", "readonly", "onKeydown"];
2022-12-30 08:13:19 +00:00
const _hoisted_5$j = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-tag-input-clear"
};
const _hoisted_6$f = {
key: 2,
class: "layui-tag-input-suffix"
};
const __default__$R = {
name: "LayTagInput"
};
const _sfc_main$U = defineComponent({
...__default__$R,
props: {
modelValue: null,
inputValue: null,
disabled: { type: Boolean },
placeholder: { default: void 0 },
readonly: { type: Boolean },
allowClear: { type: Boolean },
max: null,
minCollapsedNum: { default: 0 },
collapseTagsTooltip: { type: Boolean },
size: { default: "md" },
tagProps: null,
disabledInput: { type: Boolean }
},
emits: [
"update:modelValue",
"update:inputValue",
"change",
"inputValueChange",
"remove",
"clear",
"focus",
"blur",
"pressEnter"
],
setup(__props, { expose, emit }) {
var _a2;
const props = __props;
const mirrorRefEl = shallowRef(void 0);
const inputRefEl = shallowRef(void 0);
const oldInputValue = ref("");
const compositionValue = ref("");
const isComposing = ref(false);
const inputStyle = reactive({ width: "15px" });
const _tagProps = reactive((_a2 = props.tagProps) != null ? _a2 : {});
const tagProps = reactiveOmit(_tagProps, "closable", "size", "disabled");
const inputValue = computed$1({
get() {
return props.inputValue;
},
set(val) {
emit("update:inputValue", val);
emit("inputValueChange", val);
}
});
const tagData = computed$1({
get() {
return props.modelValue;
},
set(val) {
emit("update:modelValue", val);
emit("change", val);
}
});
const normalizedTags = computed$1(() => {
var _a3;
return normalizedTagData((_a3 = tagData.value) != null ? _a3 : []);
});
const computedTagData = computed$1(() => {
var _a3;
if (!normalizedTags.value)
return;
return props.minCollapsedNum ? (_a3 = normalizedTags.value) == null ? void 0 : _a3.slice(0, props.minCollapsedNum) : normalizedTags.value;
});
const collapsedTagData = computed$1(() => {
var _a3, _b;
if (!normalizedTags.value)
return;
return props.minCollapsedNum && ((_a3 = normalizedTags.value) == null ? void 0 : _a3.length) > props.minCollapsedNum ? (_b = normalizedTags.value) == null ? void 0 : _b.slice(props.minCollapsedNum) : [];
});
const handleInput = function(e) {
if (isComposing.value) {
return;
}
inputValue.value = e.target.value;
};
const handleComposition = (e) => {
var _a3;
if (e.type === "compositionend") {
isComposing.value = false;
compositionValue.value = "";
handleInput(e);
} else {
isComposing.value = true;
compositionValue.value = inputValue.value + ((_a3 = e.data) != null ? _a3 : "");
}
};
const handleEnter = (e) => {
var _a3;
e.preventDefault();
const valueStr = inputValue.value ? String(inputValue.value).trim() : "";
if (!valueStr || !tagData.value)
return;
const isLimit = props.max && ((_a3 = tagData.value) == null ? void 0 : _a3.length) >= props.max;
if (!isLimit) {
tagData.value = tagData.value instanceof Array ? tagData.value.concat(String(valueStr)) : [valueStr];
inputValue.value = "";
}
emit("pressEnter", inputValue.value, e);
};
const handleBackspaceKeyUp = (e) => {
var _a3;
if (!tagData.value || !tagData.value.length)
return;
if (!oldInputValue.value && ["Backspace", "Delete"].includes(e.code)) {
const lastIndex = normalizedTags.value.length - 1;
handleClose(normalizedTags.value[lastIndex].value, lastIndex, e);
}
oldInputValue.value = (_a3 = inputValue.value) != null ? _a3 : "";
};
const handleFocus = (e) => {
var _a3;
emit("focus", e);
(_a3 = inputRefEl.value) == null ? void 0 : _a3.focus();
};
const handleBlur = (e) => {
var _a3;
emit("blur", e);
(_a3 = inputRefEl.value) == null ? void 0 : _a3.blur();
};
const handleClearClick = (e) => {
if (props.disabled || props.readonly || !props.allowClear) {
return;
}
tagData.value = [];
emit("clear", e);
};
const handleClose = (value, index2, e) => {
if (!tagData.value)
return;
const arr = [...tagData.value];
arr.splice(index2, 1);
tagData.value = arr;
emit("remove", value, e);
};
const handleMouseDown = (e) => {
if (inputRefEl.value) {
e.preventDefault();
inputRefEl.value.focus();
}
};
const setInputWidth = (width) => {
if (width > 15) {
inputStyle.width = `${width}px`;
} else {
inputStyle.width = "15px";
}
};
const handleResize = () => {
if (mirrorRefEl.value) {
setInputWidth(mirrorRefEl.value.offsetWidth);
}
};
const cls = computed$1(() => [
`layui-tag-input`,
`layui-tag-input-${props.size}`,
{
"layui-tag-input-disabled": props.disabled
}
]);
const normalizedTagData = (value) => value.map((item) => {
2022-12-30 08:13:19 +00:00
if (isObject$2(item))
2022-11-15 01:16:55 +00:00
return item;
return {
value: item,
label: String(item),
closable: true
};
});
useResizeObserver(mirrorRefEl, () => {
handleResize();
});
watch(() => inputValue.value, (val) => {
if (inputRefEl.value && !isComposing.value) {
nextTick(() => {
inputRefEl.value.value = val != null ? val : "";
});
}
});
const moreCount = computed$1(() => {
if (tagData.value && computedTagData.value) {
return tagData.value.length - computedTagData.value.length;
}
});
onMounted(() => {
handleResize();
});
expose({
focus: handleFocus,
blur: handleBlur
});
return (_ctx, _cache) => {
var _a3, _b, _c;
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(cls)),
onMousedown: handleMouseDown
}, [
createElementVNode("span", {
ref_key: "mirrorRefEl",
ref: mirrorRefEl,
class: "layui-tag-input-mirror"
}, toDisplayString$1(compositionValue.value || unref(inputValue) || __props.placeholder), 513),
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_1$F, [
renderSlot(_ctx.$slots, "prefix")
])) : createCommentVNode("", true),
createElementVNode("span", _hoisted_2$A, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(computedTagData), (item, index2) => {
return openBlock(), createBlock(_sfc_main$V, mergeProps({
key: `${item}-${index2}`
}, unref(tagProps), {
closable: !__props.readonly && !__props.disabled && item.closable,
size: __props.size,
onClose: ($event) => handleClose(item.value, index2, $event)
}), {
default: withCtx(() => [
createTextVNode(toDisplayString$1(item.label), 1)
]),
_: 2
}, 1040, ["closable", "size", "onClose"]);
}), 128)),
((_a3 = unref(computedTagData)) == null ? void 0 : _a3.length) != ((_b = unref(tagData)) == null ? void 0 : _b.length) ? (openBlock(), createBlock(_sfc_main$11, {
key: 0,
isDark: false,
trigger: "hover",
popperStyle: "padding:6px",
disabled: !__props.collapseTagsTooltip
}, {
content: withCtx(() => [
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_3$v, [
2022-11-15 01:16:55 +00:00
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(collapsedTagData), (item, index2) => {
return openBlock(), createBlock(_sfc_main$V, mergeProps({
key: `${item}-${index2}`
}, unref(tagProps), {
closable: !__props.readonly && !__props.disabled && item.closable,
size: __props.size,
onClose: ($event) => {
var _a4;
return handleClose(item.value, index2 + ((_a4 = __props.minCollapsedNum) != null ? _a4 : 0), $event);
}
}), {
default: withCtx(() => [
createTextVNode(toDisplayString$1(item.label), 1)
]),
_: 2
}, 1040, ["closable", "size", "onClose"]);
}), 128))
])
]),
default: withCtx(() => [
createVNode(_sfc_main$V, mergeProps(unref(tagProps), {
key: "more",
closable: false,
size: __props.size
}), {
default: withCtx(() => [
createTextVNode(" +" + toDisplayString$1(unref(moreCount)) + "... ", 1)
]),
_: 1
}, 16, ["size"])
]),
_: 1
}, 8, ["disabled"])) : createCommentVNode("", true),
2022-12-30 08:13:19 +00:00
createElementVNode("input", {
2022-11-15 01:16:55 +00:00
ref_key: "inputRefEl",
ref: inputRefEl,
class: "layui-tag-input-inner-input",
style: normalizeStyle(inputStyle),
2022-12-30 08:13:19 +00:00
disabled: __props.disabled || __props.disabledInput,
2022-11-15 01:16:55 +00:00
placeholder: __props.placeholder,
readonly: __props.readonly,
onKeydown: withKeys(handleEnter, ["enter"]),
onKeyup: handleBackspaceKeyUp,
onInput: handleInput,
onFocus: handleFocus,
onBlur: handleBlur,
onCompositionstart: handleComposition,
onCompositionupdate: handleComposition,
onCompositionend: handleComposition
2022-12-30 08:13:19 +00:00
}, null, 44, _hoisted_4$o)
2022-11-15 01:16:55 +00:00
]),
2022-12-30 08:13:19 +00:00
__props.allowClear && ((_c = unref(tagData)) == null ? void 0 : _c.length) && !__props.disabled ? (openBlock(), createElementBlock("span", _hoisted_5$j, [
2022-11-15 01:16:55 +00:00
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-close-fill",
onClick: withModifiers(handleClearClick, ["stop"])
}, null, 8, ["onClick"])
])) : createCommentVNode("", true),
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_6$f, [
renderSlot(_ctx.$slots, "suffix")
])) : createCommentVNode("", true)
], 34);
};
}
});
const __default__$Q = {
name: "LaySelectOption"
};
const _sfc_main$T = defineComponent({
...__default__$Q,
props: {
label: { default: "" },
value: null,
disabled: { type: Boolean, default: false },
keyword: { default: "" }
},
setup(__props) {
const props = __props;
const searchValue = inject("searchValue");
const selectRef = inject("selectRef");
2022-12-30 08:13:19 +00:00
const searchMethod = inject("searchMethod");
2022-11-15 01:16:55 +00:00
const selectedValue = inject("selectedValue");
const multiple = inject("multiple");
const checkboxRef = ref();
const handleSelect = () => {
var _a2;
if (multiple.value) {
if (!props.disabled) {
(_a2 = checkboxRef.value) == null ? void 0 : _a2.toggle();
}
} else {
if (!props.disabled) {
selectRef.value.hide();
selectedValue.value = props.value;
}
}
};
const selected = computed$1(() => {
if (multiple.value) {
return selectedValue.value.indexOf(props.value) != -1;
} else {
return selectedValue.value === props.value;
}
});
2022-12-30 08:13:19 +00:00
const first = ref(true);
2022-11-15 01:16:55 +00:00
const display = computed$1(() => {
var _a2, _b;
2022-12-30 08:13:19 +00:00
if (searchMethod && !first.value) {
return searchMethod(searchValue.value, props);
}
first.value = false;
2022-11-15 01:16:55 +00:00
return ((_a2 = props.keyword) == null ? void 0 : _a2.toString().indexOf(searchValue.value)) > -1 || ((_b = props.label) == null ? void 0 : _b.toString().indexOf(searchValue.value)) > -1;
});
const classes = computed$1(() => {
return [
"layui-select-option",
{
"layui-this": selected.value,
"layui-disabled": props.disabled
}
];
});
return (_ctx, _cache) => {
return withDirectives((openBlock(), createElementBlock("dd", {
class: normalizeClass(unref(classes)),
onClick: handleSelect
}, [
unref(multiple) ? (openBlock(), createBlock(_sfc_main$$, {
key: 0,
skin: "primary",
ref_key: "checkboxRef",
ref: checkboxRef,
modelValue: unref(selectedValue),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(selectedValue) ? selectedValue.value = $event : null),
disabled: __props.disabled,
value: __props.value
}, null, 8, ["modelValue", "disabled", "value"])) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(__props.label), 1)
])
], 2)), [
[vShow, unref(display)]
]);
};
}
});
const _hoisted_1$E = { class: "layui-select" };
const _hoisted_2$z = { class: "layui-select-content" };
const __default__$P = {
name: "LaySelect"
};
const _sfc_main$S = defineComponent({
...__default__$P,
props: {
name: null,
disabled: { type: Boolean, default: false },
placeholder: null,
searchPlaceholder: null,
2022-12-30 08:13:19 +00:00
searchMethod: null,
2022-11-15 01:16:55 +00:00
modelValue: { default: null },
multiple: { type: Boolean, default: false },
items: null,
size: { default: "md" },
collapseTagsTooltip: { type: Boolean, default: true },
minCollapsedNum: { default: 3 },
allowClear: { type: Boolean, default: false },
showSearch: { type: Boolean, default: false },
contentClass: null,
contentStyle: null
},
emits: ["update:modelValue", "change", "search"],
setup(__props, { emit: emits }) {
const props = __props;
const slots = useSlots();
const selectRef = ref();
const searchValue = ref("");
const singleValue = ref("");
const multipleValue = ref([]);
const openState = ref(false);
const options = ref([]);
const composing = ref(false);
var timer;
const getOption = (nodes, newOptions) => {
nodes == null ? void 0 : nodes.map((item) => {
2022-12-30 08:13:19 +00:00
if (isArrayChildren(item, item.children)) {
2022-11-15 01:16:55 +00:00
getOption(item.children, newOptions);
} else {
2022-12-30 08:13:19 +00:00
if (item.type.name == _sfc_main$T.name) {
2022-11-15 01:16:55 +00:00
if (item.children) {
const label = item.children.default()[0].children;
if (typeof label == "string") {
item.props.label = label;
}
}
newOptions.push(item.props);
}
}
});
};
const intOption = () => {
const newOptions = [];
if (slots.default) {
getOption(slots.default(), newOptions);
}
Object.assign(newOptions, props.items);
if (JSON.stringify(newOptions) != JSON.stringify(options.value)) {
options.value = newOptions;
}
};
const handleRemove = (value) => {
if (Array.isArray(selectedValue.value)) {
selectedValue.value = selectedValue.value.filter((item) => item != value);
}
};
const onCompositionstart = () => {
composing.value = true;
};
const onCompositionend = (event) => {
composing.value = false;
handleSearch(event.target.value);
};
onMounted(() => {
intOption();
timer = setInterval(intOption, 500);
watch([selectedValue, options], () => {
var _a2, _b;
if (multiple.value) {
multipleValue.value = (_a2 = selectedValue.value) == null ? void 0 : _a2.map((value) => {
return options.value.find((item) => {
item.disabled == "" || item.disabled == true ? item.closable = false : item.closable = true;
return item.value === value;
});
});
} else {
searchValue.value = "";
singleValue.value = (_b = options.value.find((item) => {
return item.value === selectedValue.value;
})) == null ? void 0 : _b.label;
}
}, { immediate: true, deep: true });
});
onUnmounted(() => {
clearInterval(timer);
});
const selectedValue = computed$1({
get() {
return props.modelValue;
},
set(value) {
emits("update:modelValue", value);
emits("change", value);
}
});
const multiple = computed$1(() => {
return props.multiple;
});
const handleSearch = (value) => {
if (composing.value)
return;
emits("search", value);
searchValue.value = value;
};
const handleClear = () => {
if (multiple.value) {
selectedValue.value = [];
} else {
selectedValue.value = "";
}
};
2022-12-30 08:13:19 +00:00
const handleHide = () => {
searchValue.value = "";
openState.value = false;
};
2022-11-15 01:16:55 +00:00
provide("selectRef", selectRef);
provide("openState", openState);
provide("selectedValue", selectedValue);
provide("searchValue", searchValue);
provide("multiple", multiple);
2022-12-30 08:13:19 +00:00
provide("searchMethod", props.searchMethod);
2022-11-15 01:16:55 +00:00
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$E, [
createVNode(_sfc_main$1y, {
ref_key: "selectRef",
ref: selectRef,
disabled: __props.disabled,
contentClass: __props.contentClass,
contentStyle: __props.contentStyle,
"update-at-scroll": true,
autoFitWidth: true,
2022-12-30 08:13:19 +00:00
onHide: handleHide,
onShow: _cache[5] || (_cache[5] = ($event) => openState.value = true)
2022-11-15 01:16:55 +00:00
}, {
content: withCtx(() => [
createElementVNode("dl", _hoisted_2$z, [
2022-12-30 08:13:19 +00:00
__props.items ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(__props.items, (item, index2) => {
2022-11-15 01:16:55 +00:00
return openBlock(), createBlock(_sfc_main$T, mergeProps(item, { key: index2 }), null, 16);
}), 128)) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "default")
])
]),
default: withCtx(() => [
unref(multiple) ? (openBlock(), createBlock(_sfc_main$U, {
key: 0,
modelValue: multipleValue.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => multipleValue.value = $event),
2022-12-30 08:13:19 +00:00
"input-value": searchValue.value,
"onUpdate:input-value": _cache[1] || (_cache[1] = ($event) => searchValue.value = $event),
2022-11-15 01:16:55 +00:00
"allow-clear": __props.allowClear,
placeholder: __props.placeholder,
collapseTagsTooltip: __props.collapseTagsTooltip,
minCollapsedNum: __props.minCollapsedNum,
disabled: __props.disabled,
2022-12-30 08:13:19 +00:00
disabledInput: !__props.showSearch,
2022-11-15 01:16:55 +00:00
size: __props.size,
class: normalizeClass({ "layui-unselect": true }),
onRemove: handleRemove,
2022-12-30 08:13:19 +00:00
onClear: handleClear,
onInputValueChange: handleSearch,
onKeyupCapture: [
_cache[2] || (_cache[2] = withKeys(withModifiers(() => {
}, ["prevent", "stop"]), ["delete"])),
_cache[3] || (_cache[3] = withKeys(withModifiers(() => {
}, ["prevent", "stop"]), ["backspace"]))
],
onKeydownCapture: _cache[4] || (_cache[4] = withKeys(withModifiers(() => {
}, ["prevent", "stop"]), ["enter"]))
2022-11-15 01:16:55 +00:00
}, {
suffix: withCtx(() => [
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-triangle-d",
class: normalizeClass({ triangle: openState.value })
}, null, 8, ["class"])
]),
_: 1
2022-12-30 08:13:19 +00:00
}, 8, ["modelValue", "input-value", "allow-clear", "placeholder", "collapseTagsTooltip", "minCollapsedNum", "disabled", "disabledInput", "size"])) : (openBlock(), createBlock(_sfc_main$1v, {
2022-11-15 01:16:55 +00:00
key: 1,
2022-12-30 08:13:19 +00:00
size: __props.size,
disabled: __props.disabled,
readonly: !__props.showSearch,
2022-11-15 01:16:55 +00:00
modelValue: singleValue.value,
"allow-clear": __props.allowClear,
2022-12-30 08:13:19 +00:00
placeholder: __props.placeholder,
2022-11-15 01:16:55 +00:00
class: normalizeClass({ "layui-unselect": !__props.showSearch }),
onCompositionstart,
onCompositionend,
onInput: handleSearch,
onClear: handleClear
}, {
suffix: withCtx(() => [
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-triangle-d",
class: normalizeClass({ triangle: openState.value })
}, null, 8, ["class"])
]),
_: 1
2022-12-30 08:13:19 +00:00
}, 8, ["size", "disabled", "readonly", "modelValue", "allow-clear", "placeholder", "class"]))
2022-11-15 01:16:55 +00:00
]),
_: 3
}, 8, ["disabled", "contentClass", "contentStyle"])
]);
};
}
});
const component$I = withInstall(_sfc_main$S);
const component$H = withInstall(_sfc_main$T);
const component$G = withInstall(_sfc_main$1u);
var _imports_0 = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjYyMHB4IiBoZWlnaHQ9IjIwMHB4IiB2aWV3Qm94PSIwIDAgNjIwIDIwMCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4NCiAgICA8dGl0bGU+R3JvdXAgMzU8L3RpdGxlPg0KICAgIDxkZWZzPg0KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjEwMCUiIHkxPSIyOC4zODU1MzY1JSIgeDI9IjUwJSIgeTI9IjYwLjEyODI3NjglIiBpZD0ibGluZWFyR3JhZGllbnQtMSI+DQogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjQTNCMUJGIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCUiPjwvc3RvcD4NCiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNBM0IxQkYiIG9mZnNldD0iMTAwJSI+PC9zdG9wPg0KICAgICAgICA8L2xpbmVhckdyYWRpZW50Pg0KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9Ii0xLjExMDIyMzAyZS0xNCUiIHkxPSI1MCUiIHgyPSIxMDAlIiB5Mj0iNTAlIiBpZD0ibGluZWFyR3JhZGllbnQtMiI+DQogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjQTNCMUJGIiBzdG9wLW9wYWNpdHk9IjAiIG9mZnNldD0iMCUiPjwvc3RvcD4NCiAgICAgICAgICAgIDxzdG9wIHN0b3AtY29sb3I9IiNBM0IxQkYiIG9mZnNldD0iMTAwJSI+PC9zdG9wPg0KICAgICAgICA8L2xpbmVhckdyYWRpZW50Pg0KICAgICAgICA8bGluZWFyR3JhZGllbnQgeDE9IjEwMCUiIHkxPSI1MCUiIHgyPSIyLjc3MDUwMjE3JSIgeTI9IjUwJSIgaWQ9ImxpbmVhckdyYWRpZW50LTMiPg0KICAgICAgICAgICAgPHN0b3Agc3RvcC1jb2xvcj0iI0EzQjFCRiIgc3RvcC1vcGFjaXR5PSIwIiBvZmZzZXQ9IjAlIj48L3N0b3A+DQogICAgICAgICAgICA8c3RvcCBzdG9wLWNvbG9yPSIjQTNCMUJGIiBvZmZzZXQ9IjEwMCUiPjwvc3RvcD4NCiAgICAgICAgPC9saW5lYXJHcmFkaWVudD4NCiAgICA8L2RlZnM+DQogICAgPGcgaWQ9IuahhuaetuiuvuiuoS3ov4fnqIvniYgiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPg0KICAgICAgICA8ZyBpZD0i57y655yB5Zu+IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMTU0My4wMDAwMDAsIC0xNTQuMDAwMDAwKSI+DQogICAgICAgICAgICA8ZyBpZD0iR3JvdXAtMzUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDE1NDMuMDAwMDAwLCAxNTQuMDAwMDAwKSI+DQogICAgICAgICAgICAgICAgPGcgaWQ9IuaaguaXoOaVsOaNriIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoNTcuMDAwMDAwLCAzLjAwMDAwMCkiPg0KICAgICAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMTI3LjQyNDAyMSw1OS41Mzg4MTI4IEMxMjYuNjA2NTk5LDU4LjQwNjM5MjcgMTI1LjQzODI2Myw1Ny40MjgwMTE0IDEyMy45NTg3ODUsNTcuNDI4MDExNCBDMTIzLjM0NDI5MSw1Ny40MjgwMTE0IDEyMi41NDA3NzQsNTcuNTYzMzQwNyAxMjEuOTc2Mzc4LDU3LjgwMDE3NDggTDEyMS4yODY2NDksNTguMTUzMTI1NiBMMTIxLjEyMDUwMSw1Ny40MjgwMTE0IEMxMjAuNjQyMzM3LDU1LjU3MDcyODcgMTE4LjU1NDY4Niw1My44NTc4MDU0IDExNi4zMzk1OTEsNTMuODU3ODA1NCBDMTE0LjQ0MDMwNCw1My44NTc4MDU0IDExMi42NDcyODIsNTQuNzgwNjg2NCAxMTEuODkzMjc0LDU2LjQ1Njc4OTkgTDExMS42ODU5MDcsNTYuOTE4ODkwMyBDMTEwLjg3OTQ4NCw1Ni44MzkwMjEzIDExMC40MDg4NDIsNTYuNzk5MDg2OCAxMTAuMjczOTc5LDU2Ljc5OTA4NjggQzEwOC44MDcxODQsNTYuNzk5MDg2OCAxMDcuOTE4MjM3LDU4LjE3MDc3NjMgMTA3Ljc2MDMzMyw1OS41Mzg4MTI4IEwxMjcuNDI0MDIxLDU5LjUzODgxMjggWiBNMTE2LjI1NjMxNyw1MS42MjQwNDg3IEMxMTguODM4MzU2LDUxLjYyNDA0ODcgMTIxLjIxMjE3Nyw1My4wNjMzMTgxIDEyMi40MjgwMDYsNTUuMzI4MTU4MyBDMTIyLjcwMjU4OCw1NS4yOTQwNjM5IDEyMi45ODAyMTMsNTUuMjc3MDE2NyAxMjMuMjU3ODM5LDU1LjI3NzAxNjcgQzEyNi4xOTQ4MjUsNTUuMjc3MDE2NyAxMjguNzYyMjUzLDU3LjE2MDczMDYgMTI5LjY0NjI3MSw1OS45NjQzODM2IEwxMjkuNjc0Mjc3LDYwLjA1Mzg4MTMgTDEyOS42NzQyNzcsNjEuNjM3MTU4NyBMOTEuOTMwODA1Myw2MS42MzcxNTg3IEw5MS45MzA4MDUzLDU5LjUzODgxMjggTDEwNS42MTA5NTksNTkuNTM4ODEyOCBDMTA1Ljc2MzE2Niw1Ni45MjYzMzE4IDEwNy44NjE3OTYsNTQuODI4MzEwNSAxMTAuNDc0Mjc3LDU0LjY3NjcxMjMgQzExMS43Nzk2MDQsNTIuNzU4OTA0MSAxMTMuOTE3MTk5LDUxLjYyNDA0ODcgMTE2LjI1NjMxNyw1MS42MjQwNDg3IFogTTk4LjAxNTIyMDcsNTUuMjc3MDE2NyBMOTguMDE1MjIwNyw1Ny4zMzg5NDYgTDg1LjgzODY2MDYsNTcuMzM4OTQ2IEw4NS44Mzg2NjA2LDU1LjI3NzAxNjcgTDk4LjAxNTIyMDcsNTUuMjc3MDE2NyBaIiBpZD0iY2xvdWQ0LWNvcHkiIGZpbGw9IiNBM0IxQkYiPjwvcGF0aD4NCiAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTQxLjU4NTM2MDgsMTI4LjkxNDc2NCBDNDAuNzY3OTM4MSwxMjcuNzgyMzQ0IDM5LjU5OTYwMjcsMTI2LjgwMzk2MyAzOC4xMjAxMjQ2LDEyNi44MDM5NjMgQzM3LjUwNTYzMDcsMTI2LjgwMzk2MyAzNi43MDIxMTM0LDEyNi45MzkyOTIgMzYuMTM3NzE3NiwxMjcuMTc2MTI2IEwzNS40NDc5ODg3LDEyNy41MjkwNzcgTDM1LjI4MTg0MDcsMTI2LjgwMzk2MyBDMzQuODAzNjc2OCwxMjQuOTQ2NjggMzIuNzE2MDI1NiwxMjMuMjMzNzU3IDMwLjUwMDkzMDUsMTIzLjIzMzc1NyBDMjguNjAxNjQzNCwxMjMuMjMzNzU3IDI2LjgwODYyMTQsMTI0LjE1NjYzOCAyNi4wNTQ2MTM5LDEyNS44MzI3NDEgTDI1Ljg0NzI0NiwxMjYuMjk0ODQyIEMyNS4wNDA4MjM4LDEyNi4yMTQ5NzMgMjQuNTcwMTgxMSwxMjYuMTc1MDM4IDI0LjQzNTMxOCwxMjYuMTc1MDM4IEMyMi45Njg1MjMsMTI2LjE3NTAzOCAyMi4wNzk1NzY4LDE
var index$p = /* @__PURE__ */ (() => ".layui-empty{margin:0 8px;font-size:14px;line-height:22px;text-align:center}.layui-empty-image{margin-bottom:8px}.layui-empty-image img{height:100px;margin:auto}.layui-empty-description{margin:0}.layui-empty-extra{margin-top:30px}\n")();
const NOOP = () => {
};
const isArray = Array.isArray;
const isFunction$1 = (val) => typeof val === "function";
const isSymbol = (val) => typeof val === "symbol";
let activeEffectScope;
function recordEffectScope(effect, scope = activeEffectScope) {
if (scope && scope.active) {
scope.effects.push(effect);
}
}
const createDep = (effects) => {
const dep = new Set(effects);
dep.w = 0;
dep.n = 0;
return dep;
};
const wasTracked = (dep) => (dep.w & trackOpBit) > 0;
const newTracked = (dep) => (dep.n & trackOpBit) > 0;
const initDepMarkers = ({ deps }) => {
if (deps.length) {
for (let i = 0; i < deps.length; i++) {
deps[i].w |= trackOpBit;
}
}
};
const finalizeDepMarkers = (effect) => {
const { deps } = effect;
if (deps.length) {
let ptr = 0;
for (let i = 0; i < deps.length; i++) {
const dep = deps[i];
if (wasTracked(dep) && !newTracked(dep)) {
dep.delete(effect);
} else {
deps[ptr++] = dep;
}
dep.w &= ~trackOpBit;
dep.n &= ~trackOpBit;
}
deps.length = ptr;
}
};
let effectTrackDepth = 0;
let trackOpBit = 1;
const maxMarkerBits = 30;
let activeEffect;
class ReactiveEffect {
constructor(fn, scheduler = null, scope) {
this.fn = fn;
this.scheduler = scheduler;
this.active = true;
this.deps = [];
this.parent = void 0;
recordEffectScope(this, scope);
}
run() {
if (!this.active) {
return this.fn();
}
let parent = activeEffect;
let lastShouldTrack = shouldTrack;
while (parent) {
if (parent === this) {
return;
}
parent = parent.parent;
}
try {
this.parent = activeEffect;
activeEffect = this;
shouldTrack = true;
trackOpBit = 1 << ++effectTrackDepth;
if (effectTrackDepth <= maxMarkerBits) {
initDepMarkers(this);
} else {
cleanupEffect(this);
}
return this.fn();
} finally {
if (effectTrackDepth <= maxMarkerBits) {
finalizeDepMarkers(this);
}
trackOpBit = 1 << --effectTrackDepth;
activeEffect = this.parent;
shouldTrack = lastShouldTrack;
this.parent = void 0;
if (this.deferStop) {
this.stop();
}
}
}
stop() {
if (activeEffect === this) {
this.deferStop = true;
} else if (this.active) {
cleanupEffect(this);
if (this.onStop) {
this.onStop();
}
this.active = false;
}
}
}
function cleanupEffect(effect) {
const { deps } = effect;
if (deps.length) {
for (let i = 0; i < deps.length; i++) {
deps[i].delete(effect);
}
deps.length = 0;
}
}
let shouldTrack = true;
function trackEffects(dep, debuggerEventExtraInfo) {
let shouldTrack2 = false;
if (effectTrackDepth <= maxMarkerBits) {
if (!newTracked(dep)) {
dep.n |= trackOpBit;
shouldTrack2 = !wasTracked(dep);
}
} else {
shouldTrack2 = !dep.has(activeEffect);
}
if (shouldTrack2) {
dep.add(activeEffect);
activeEffect.deps.push(dep);
}
}
function triggerEffects(dep, debuggerEventExtraInfo) {
const effects = isArray(dep) ? dep : [...dep];
for (const effect of effects) {
if (effect.computed) {
triggerEffect(effect);
}
}
for (const effect of effects) {
if (!effect.computed) {
triggerEffect(effect);
}
}
}
function triggerEffect(effect, debuggerEventExtraInfo) {
if (effect !== activeEffect || effect.allowRecurse) {
if (effect.scheduler) {
effect.scheduler();
} else {
effect.run();
}
}
}
new Set(/* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol));
function toRaw(observed) {
const raw = observed && observed["__v_raw"];
return raw ? toRaw(raw) : observed;
}
function trackRefValue(ref2) {
if (shouldTrack && activeEffect) {
ref2 = toRaw(ref2);
{
trackEffects(ref2.dep || (ref2.dep = createDep()));
}
}
}
function triggerRefValue(ref2, newVal) {
ref2 = toRaw(ref2);
if (ref2.dep) {
{
triggerEffects(ref2.dep);
}
}
}
class ComputedRefImpl {
constructor(getter, _setter, isReadonly, isSSR) {
this._setter = _setter;
this.dep = void 0;
this.__v_isRef = true;
this._dirty = true;
this.effect = new ReactiveEffect(getter, () => {
if (!this._dirty) {
this._dirty = true;
triggerRefValue(this);
}
});
this.effect.computed = this;
this.effect.active = this._cacheable = !isSSR;
this["__v_isReadonly"] = isReadonly;
}
get value() {
const self2 = toRaw(this);
trackRefValue(self2);
if (self2._dirty || !self2._cacheable) {
self2._dirty = false;
self2._value = self2.effect.run();
}
return self2._value;
}
set value(newValue) {
this._setter(newValue);
}
}
function computed(getterOrOptions, debugOptions, isSSR = false) {
let getter;
let setter;
const onlyGetter = isFunction$1(getterOrOptions);
if (onlyGetter) {
getter = getterOrOptions;
setter = NOOP;
} else {
getter = getterOrOptions.get;
setter = getterOrOptions.set;
}
const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter, isSSR);
return cRef;
}
const _hoisted_1$D = { class: "layui-empty" };
const _hoisted_2$y = { class: "layui-empty-image" };
const _hoisted_3$u = {
key: 1,
class: "layui-empty-image-default",
src: _imports_0
};
const _hoisted_4$n = { class: "layui-empty-description" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$i = { class: "layui-empty-extra" };
2022-11-15 01:16:55 +00:00
const __default__$O = {
name: "LayEmpty"
};
const _sfc_main$R = defineComponent({
...__default__$O,
props: {
description: null,
image: null
},
setup(__props) {
const props = __props;
const { t } = useI18n();
const slots = useSlots();
const description = computed(() => props.description ? props.description : t("empty.description"));
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$D, [
createElementVNode("div", _hoisted_2$y, [
unref(slots).image ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock("img", _hoisted_3$u))
]),
createElementVNode("div", _hoisted_4$n, toDisplayString$1(unref(description)), 1),
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_5$i, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "extra")
])
]);
};
}
});
const component$F = withInstall(_sfc_main$R);
function _extends() {
_extends = Object.assign || function(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i];
for (var key in source) {
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf2(o2) {
return o2.__proto__ || Object.getPrototypeOf(o2);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf2(o2, p2) {
o2.__proto__ = p2;
return o2;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct)
return false;
if (Reflect.construct.sham)
return false;
if (typeof Proxy === "function")
return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
}));
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct;
} else {
_construct = function _construct2(Parent2, args2, Class2) {
var a = [null];
a.push.apply(a, args2);
var Constructor = Function.bind.apply(Parent2, a);
var instance = new Constructor();
if (Class2)
_setPrototypeOf(instance, Class2.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _isNativeFunction(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? /* @__PURE__ */ new Map() : void 0;
_wrapNativeSuper = function _wrapNativeSuper2(Class2) {
if (Class2 === null || !_isNativeFunction(Class2))
return Class2;
if (typeof Class2 !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class2))
return _cache.get(Class2);
_cache.set(Class2, Wrapper);
}
function Wrapper() {
return _construct(Class2, arguments, _getPrototypeOf(this).constructor);
}
Wrapper.prototype = Object.create(Class2.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _setPrototypeOf(Wrapper, Class2);
};
return _wrapNativeSuper(Class);
}
var formatRegExp = /%[sdj%]/g;
var warning = function warning2() {
};
if (typeof process !== "undefined" && process.env && false) {
warning = function warning3(type4, errors) {
if (typeof console !== "undefined" && console.warn && typeof ASYNC_VALIDATOR_NO_WARNING === "undefined") {
if (errors.every(function(e) {
return typeof e === "string";
})) {
console.warn(type4, errors);
}
}
};
}
function convertFieldsError(errors) {
if (!errors || !errors.length)
return null;
var fields = {};
errors.forEach(function(error) {
var field = error.field;
fields[field] = fields[field] || [];
fields[field].push(error);
});
return fields;
}
function format(template) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
var i = 0;
var len = args.length;
if (typeof template === "function") {
return template.apply(null, args);
}
if (typeof template === "string") {
var str = template.replace(formatRegExp, function(x) {
if (x === "%%") {
return "%";
}
if (i >= len) {
return x;
}
switch (x) {
case "%s":
return String(args[i++]);
case "%d":
return Number(args[i++]);
case "%j":
try {
return JSON.stringify(args[i++]);
} catch (_) {
return "[Circular]";
}
break;
default:
return x;
}
});
return str;
}
return template;
}
function isNativeStringType(type4) {
return type4 === "string" || type4 === "url" || type4 === "hex" || type4 === "email" || type4 === "date" || type4 === "pattern";
}
function isEmptyValue(value, type4) {
if (value === void 0 || value === null) {
return true;
}
if (type4 === "array" && Array.isArray(value) && !value.length) {
return true;
}
if (isNativeStringType(type4) && typeof value === "string" && !value) {
return true;
}
return false;
}
function asyncParallelArray(arr, func, callback) {
var results = [];
var total = 0;
var arrLength = arr.length;
function count(errors) {
results.push.apply(results, errors || []);
total++;
if (total === arrLength) {
callback(results);
}
}
arr.forEach(function(a) {
func(a, count);
});
}
function asyncSerialArray(arr, func, callback) {
var index2 = 0;
var arrLength = arr.length;
function next(errors) {
if (errors && errors.length) {
callback(errors);
return;
}
var original = index2;
index2 = index2 + 1;
if (original < arrLength) {
func(arr[original], next);
} else {
callback([]);
}
}
next([]);
}
function flattenObjArr(objArr) {
var ret = [];
Object.keys(objArr).forEach(function(k) {
ret.push.apply(ret, objArr[k] || []);
});
return ret;
}
var AsyncValidationError = /* @__PURE__ */ function(_Error) {
_inheritsLoose(AsyncValidationError2, _Error);
function AsyncValidationError2(errors, fields) {
var _this;
_this = _Error.call(this, "Async Validation Error") || this;
_this.errors = errors;
_this.fields = fields;
return _this;
}
return AsyncValidationError2;
}(/* @__PURE__ */ _wrapNativeSuper(Error));
function asyncMap(objArr, option, func, callback, source) {
if (option.first) {
var _pending = new Promise(function(resolve, reject) {
var next = function next2(errors) {
callback(errors);
return errors.length ? reject(new AsyncValidationError(errors, convertFieldsError(errors))) : resolve(source);
};
var flattenArr = flattenObjArr(objArr);
asyncSerialArray(flattenArr, func, next);
});
_pending["catch"](function(e) {
return e;
});
return _pending;
}
var firstFields = option.firstFields === true ? Object.keys(objArr) : option.firstFields || [];
var objArrKeys = Object.keys(objArr);
var objArrLength = objArrKeys.length;
var total = 0;
var results = [];
var pending = new Promise(function(resolve, reject) {
var next = function next2(errors) {
results.push.apply(results, errors);
total++;
if (total === objArrLength) {
callback(results);
return results.length ? reject(new AsyncValidationError(results, convertFieldsError(results))) : resolve(source);
}
};
if (!objArrKeys.length) {
callback(results);
resolve(source);
}
objArrKeys.forEach(function(key) {
var arr = objArr[key];
if (firstFields.indexOf(key) !== -1) {
asyncSerialArray(arr, func, next);
} else {
asyncParallelArray(arr, func, next);
}
});
});
pending["catch"](function(e) {
return e;
});
return pending;
}
function isErrorObj(obj) {
return !!(obj && obj.message !== void 0);
}
function getValue(value, path) {
var v = value;
for (var i = 0; i < path.length; i++) {
if (v == void 0) {
return v;
}
v = v[path[i]];
}
return v;
}
function complementError(rule, source) {
return function(oe) {
var fieldValue;
if (rule.fullFields) {
fieldValue = getValue(source, rule.fullFields);
} else {
fieldValue = source[oe.field || rule.fullField];
}
if (isErrorObj(oe)) {
oe.field = oe.field || rule.fullField;
oe.fieldValue = fieldValue;
return oe;
}
return {
message: typeof oe === "function" ? oe() : oe,
fieldValue,
field: oe.field || rule.fullField
};
};
}
function deepMerge(target, source) {
if (source) {
for (var s in source) {
if (source.hasOwnProperty(s)) {
var value = source[s];
if (typeof value === "object" && typeof target[s] === "object") {
target[s] = _extends({}, target[s], value);
} else {
target[s] = value;
}
}
}
}
return target;
}
var required$1 = function required(rule, value, source, errors, options, type4) {
if (rule.required && (!source.hasOwnProperty(rule.field) || isEmptyValue(value, type4 || rule.type))) {
errors.push(format(options.messages.required, rule.fullField));
}
};
var whitespace = function whitespace2(rule, value, source, errors, options) {
if (/^\s+$/.test(value) || value === "") {
errors.push(format(options.messages.whitespace, rule.fullField));
}
};
var pattern$2 = {
email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,
url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-*)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
};
var types = {
integer: function integer(value) {
return types.number(value) && parseInt(value, 10) === value;
},
"float": function float(value) {
return types.number(value) && !types.integer(value);
},
array: function array(value) {
return Array.isArray(value);
},
regexp: function regexp(value) {
if (value instanceof RegExp) {
return true;
}
try {
return !!new RegExp(value);
} catch (e) {
return false;
}
},
date: function date(value) {
return typeof value.getTime === "function" && typeof value.getMonth === "function" && typeof value.getYear === "function" && !isNaN(value.getTime());
},
number: function number(value) {
if (isNaN(value)) {
return false;
}
return typeof value === "number";
},
object: function object(value) {
return typeof value === "object" && !types.array(value);
},
method: function method(value) {
return typeof value === "function";
},
email: function email(value) {
return typeof value === "string" && value.length <= 320 && !!value.match(pattern$2.email);
},
url: function url(value) {
return typeof value === "string" && value.length <= 2048 && !!value.match(pattern$2.url);
},
hex: function hex(value) {
return typeof value === "string" && !!value.match(pattern$2.hex);
}
};
var type$1 = function type(rule, value, source, errors, options) {
if (rule.required && value === void 0) {
required$1(rule, value, source, errors, options);
return;
}
var custom = ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"];
var ruleType = rule.type;
if (custom.indexOf(ruleType) > -1) {
if (!types[ruleType](value)) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
}
} else if (ruleType && typeof value !== rule.type) {
errors.push(format(options.messages.types[ruleType], rule.fullField, rule.type));
}
};
var range = function range2(rule, value, source, errors, options) {
var len = typeof rule.len === "number";
var min = typeof rule.min === "number";
var max = typeof rule.max === "number";
var spRegexp = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
var val = value;
var key = null;
var num = typeof value === "number";
var str = typeof value === "string";
var arr = Array.isArray(value);
if (num) {
key = "number";
} else if (str) {
key = "string";
} else if (arr) {
key = "array";
}
if (!key) {
return false;
}
if (arr) {
val = value.length;
}
if (str) {
val = value.replace(spRegexp, "_").length;
}
if (len) {
if (val !== rule.len) {
errors.push(format(options.messages[key].len, rule.fullField, rule.len));
}
} else if (min && !max && val < rule.min) {
errors.push(format(options.messages[key].min, rule.fullField, rule.min));
} else if (max && !min && val > rule.max) {
errors.push(format(options.messages[key].max, rule.fullField, rule.max));
} else if (min && max && (val < rule.min || val > rule.max)) {
errors.push(format(options.messages[key].range, rule.fullField, rule.min, rule.max));
}
};
var ENUM$1 = "enum";
var enumerable$1 = function enumerable(rule, value, source, errors, options) {
rule[ENUM$1] = Array.isArray(rule[ENUM$1]) ? rule[ENUM$1] : [];
if (rule[ENUM$1].indexOf(value) === -1) {
errors.push(format(options.messages[ENUM$1], rule.fullField, rule[ENUM$1].join(", ")));
}
};
var pattern$1 = function pattern(rule, value, source, errors, options) {
if (rule.pattern) {
if (rule.pattern instanceof RegExp) {
rule.pattern.lastIndex = 0;
if (!rule.pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
} else if (typeof rule.pattern === "string") {
var _pattern = new RegExp(rule.pattern);
if (!_pattern.test(value)) {
errors.push(format(options.messages.pattern.mismatch, rule.fullField, value, rule.pattern));
}
}
}
};
var rules = {
required: required$1,
whitespace,
type: type$1,
range,
"enum": enumerable$1,
pattern: pattern$1
};
var string = function string2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "string") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, "string");
if (!isEmptyValue(value, "string")) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
rules.pattern(rule, value, source, errors, options);
if (rule.whitespace === true) {
rules.whitespace(rule, value, source, errors, options);
}
}
}
callback(errors);
};
var method2 = function method3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var number2 = function number3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (value === "") {
value = void 0;
}
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var _boolean = function _boolean2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var regexp2 = function regexp3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var integer2 = function integer3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var floatFn = function floatFn2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var array2 = function array3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if ((value === void 0 || value === null) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, "array");
if (value !== void 0 && value !== null) {
rules.type(rule, value, source, errors, options);
rules.range(rule, value, source, errors, options);
}
}
callback(errors);
};
var object2 = function object3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var ENUM = "enum";
var enumerable2 = function enumerable3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (value !== void 0) {
rules[ENUM](rule, value, source, errors, options);
}
}
callback(errors);
};
var pattern2 = function pattern3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "string") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "string")) {
rules.pattern(rule, value, source, errors, options);
}
}
callback(errors);
};
var date2 = function date3(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, "date") && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
if (!isEmptyValue(value, "date")) {
var dateObject;
if (value instanceof Date) {
dateObject = value;
} else {
dateObject = new Date(value);
}
rules.type(rule, dateObject, source, errors, options);
if (dateObject) {
rules.range(rule, dateObject.getTime(), source, errors, options);
}
}
}
callback(errors);
};
var required2 = function required3(rule, value, callback, source, options) {
var errors = [];
var type4 = Array.isArray(value) ? "array" : typeof value;
rules.required(rule, value, source, errors, options, type4);
callback(errors);
};
var type2 = function type3(rule, value, callback, source, options) {
var ruleType = rule.type;
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value, ruleType) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options, ruleType);
if (!isEmptyValue(value, ruleType)) {
rules.type(rule, value, source, errors, options);
}
}
callback(errors);
};
var any = function any2(rule, value, callback, source, options) {
var errors = [];
var validate = rule.required || !rule.required && source.hasOwnProperty(rule.field);
if (validate) {
if (isEmptyValue(value) && !rule.required) {
return callback();
}
rules.required(rule, value, source, errors, options);
}
callback(errors);
};
var validators = {
string,
method: method2,
number: number2,
"boolean": _boolean,
regexp: regexp2,
integer: integer2,
"float": floatFn,
array: array2,
object: object2,
"enum": enumerable2,
pattern: pattern2,
date: date2,
url: type2,
hex: type2,
email: type2,
required: required2,
any
};
function newMessages() {
return {
"default": "Validation error on field %s",
required: "%s is required",
"enum": "%s must be one of %s",
whitespace: "%s cannot be empty",
date: {
format: "%s date %s is invalid for format %s",
parse: "%s date could not be parsed, %s is invalid ",
invalid: "%s date %s is invalid"
},
types: {
string: "%s is not a %s",
method: "%s is not a %s (function)",
array: "%s is not an %s",
object: "%s is not an %s",
number: "%s is not a %s",
date: "%s is not a %s",
"boolean": "%s is not a %s",
integer: "%s is not an %s",
"float": "%s is not a %s",
regexp: "%s is not a valid %s",
email: "%s is not a valid %s",
url: "%s is not a valid %s",
hex: "%s is not a valid %s"
},
string: {
len: "%s must be exactly %s characters",
min: "%s must be at least %s characters",
max: "%s cannot be longer than %s characters",
range: "%s must be between %s and %s characters"
},
number: {
len: "%s must equal %s",
min: "%s cannot be less than %s",
max: "%s cannot be greater than %s",
range: "%s must be between %s and %s"
},
array: {
len: "%s must be exactly %s in length",
min: "%s cannot be less than %s in length",
max: "%s cannot be greater than %s in length",
range: "%s must be between %s and %s in length"
},
pattern: {
mismatch: "%s value %s does not match pattern %s"
},
clone: function clone() {
var cloned = JSON.parse(JSON.stringify(this));
cloned.clone = this.clone;
return cloned;
}
};
}
var messages = newMessages();
var Schema = /* @__PURE__ */ function() {
function Schema2(descriptor) {
this.rules = null;
this._messages = messages;
this.define(descriptor);
}
var _proto = Schema2.prototype;
_proto.define = function define(rules2) {
var _this = this;
if (!rules2) {
throw new Error("Cannot configure a schema with no rules");
}
if (typeof rules2 !== "object" || Array.isArray(rules2)) {
throw new Error("Rules must be an object");
}
this.rules = {};
Object.keys(rules2).forEach(function(name) {
var item = rules2[name];
_this.rules[name] = Array.isArray(item) ? item : [item];
});
};
_proto.messages = function messages2(_messages) {
if (_messages) {
this._messages = deepMerge(newMessages(), _messages);
}
return this._messages;
};
_proto.validate = function validate(source_, o, oc) {
var _this2 = this;
if (o === void 0) {
o = {};
}
if (oc === void 0) {
oc = function oc2() {
};
}
var source = source_;
var options = o;
var callback = oc;
if (typeof options === "function") {
callback = options;
options = {};
}
if (!this.rules || Object.keys(this.rules).length === 0) {
if (callback) {
callback(null, source);
}
return Promise.resolve(source);
}
function complete(results) {
var errors = [];
var fields = {};
function add2(e) {
if (Array.isArray(e)) {
var _errors;
errors = (_errors = errors).concat.apply(_errors, e);
} else {
errors.push(e);
}
}
for (var i = 0; i < results.length; i++) {
add2(results[i]);
}
if (!errors.length) {
callback(null, source);
} else {
fields = convertFieldsError(errors);
callback(errors, fields);
}
}
if (options.messages) {
var messages$1 = this.messages();
if (messages$1 === messages) {
messages$1 = newMessages();
}
deepMerge(messages$1, options.messages);
options.messages = messages$1;
} else {
options.messages = this.messages();
}
var series = {};
var keys = options.keys || Object.keys(this.rules);
keys.forEach(function(z) {
var arr = _this2.rules[z];
var value = source[z];
arr.forEach(function(r) {
var rule = r;
if (typeof rule.transform === "function") {
if (source === source_) {
source = _extends({}, source);
}
value = source[z] = rule.transform(value);
}
if (typeof rule === "function") {
rule = {
validator: rule
};
} else {
rule = _extends({}, rule);
}
rule.validator = _this2.getValidationMethod(rule);
if (!rule.validator) {
return;
}
rule.field = z;
rule.fullField = rule.fullField || z;
rule.type = _this2.getType(rule);
series[z] = series[z] || [];
series[z].push({
rule,
value,
source,
field: z
});
});
});
var errorFields = {};
return asyncMap(series, options, function(data, doIt) {
var rule = data.rule;
var deep = (rule.type === "object" || rule.type === "array") && (typeof rule.fields === "object" || typeof rule.defaultField === "object");
deep = deep && (rule.required || !rule.required && data.value);
rule.field = data.field;
function addFullField(key, schema) {
return _extends({}, schema, {
fullField: rule.fullField + "." + key,
fullFields: rule.fullFields ? [].concat(rule.fullFields, [key]) : [key]
});
}
function cb(e) {
if (e === void 0) {
e = [];
}
var errorList = Array.isArray(e) ? e : [e];
if (!options.suppressWarning && errorList.length) {
Schema2.warning("async-validator:", errorList);
}
if (errorList.length && rule.message !== void 0) {
errorList = [].concat(rule.message);
}
var filledErrors = errorList.map(complementError(rule, source));
if (options.first && filledErrors.length) {
errorFields[rule.field] = 1;
return doIt(filledErrors);
}
if (!deep) {
doIt(filledErrors);
} else {
if (rule.required && !data.value) {
if (rule.message !== void 0) {
filledErrors = [].concat(rule.message).map(complementError(rule, source));
} else if (options.error) {
filledErrors = [options.error(rule, format(options.messages.required, rule.field))];
}
return doIt(filledErrors);
}
var fieldsSchema = {};
if (rule.defaultField) {
Object.keys(data.value).map(function(key) {
fieldsSchema[key] = rule.defaultField;
});
}
fieldsSchema = _extends({}, fieldsSchema, data.rule.fields);
var paredFieldsSchema = {};
Object.keys(fieldsSchema).forEach(function(field) {
var fieldSchema = fieldsSchema[field];
var fieldSchemaList = Array.isArray(fieldSchema) ? fieldSchema : [fieldSchema];
paredFieldsSchema[field] = fieldSchemaList.map(addFullField.bind(null, field));
});
var schema = new Schema2(paredFieldsSchema);
schema.messages(options.messages);
if (data.rule.options) {
data.rule.options.messages = options.messages;
data.rule.options.error = options.error;
}
schema.validate(data.value, data.rule.options || options, function(errs) {
var finalErrors = [];
if (filledErrors && filledErrors.length) {
finalErrors.push.apply(finalErrors, filledErrors);
}
if (errs && errs.length) {
finalErrors.push.apply(finalErrors, errs);
}
doIt(finalErrors.length ? finalErrors : null);
});
}
}
var res;
if (rule.asyncValidator) {
res = rule.asyncValidator(rule, data.value, cb, data.source, options);
} else if (rule.validator) {
try {
res = rule.validator(rule, data.value, cb, data.source, options);
} catch (error) {
console.error == null ? void 0 : console.error(error);
setTimeout(function() {
throw error;
}, 0);
cb(error.message);
}
if (res === true) {
cb();
} else if (res === false) {
cb(typeof rule.message === "function" ? rule.message(rule.fullField || rule.field) : rule.message || (rule.fullField || rule.field) + " fails");
} else if (res instanceof Array) {
cb(res);
} else if (res instanceof Error) {
cb(res.message);
}
}
if (res && res.then) {
res.then(function() {
return cb();
}, function(e) {
return cb(e);
});
}
}, function(results) {
complete(results);
}, source);
};
_proto.getType = function getType(rule) {
if (rule.type === void 0 && rule.pattern instanceof RegExp) {
rule.type = "pattern";
}
if (typeof rule.validator !== "function" && rule.type && !validators.hasOwnProperty(rule.type)) {
throw new Error(format("Unknown rule type %s", rule.type));
}
return rule.type || "string";
};
_proto.getValidationMethod = function getValidationMethod(rule) {
if (typeof rule.validator === "function") {
return rule.validator;
}
var keys = Object.keys(rule);
var messageIndex = keys.indexOf("message");
if (messageIndex !== -1) {
keys.splice(messageIndex, 1);
}
if (keys.length === 1 && keys[0] === "required") {
return validators.required;
}
return validators[this.getType(rule)] || void 0;
};
return Schema2;
}();
Schema.register = function register(type4, validator) {
if (typeof validator !== "function") {
throw new Error("Cannot register a validator by type, validator is not a function");
}
validators[type4] = validator;
};
Schema.warning = warning;
Schema.messages = messages;
Schema.validators = validators;
var cnValidateMessage = {
default: "%s\u9A8C\u8BC1\u5931\u8D25",
required: "%s\u4E0D\u80FD\u4E3A\u7A7A",
enum: "%s\u4E0D\u5728\u679A\u4E3E%s\u91CC\u9762",
whitespace: "%s\u4E0D\u80FD\u4E3A\u7A7A",
date: {
format: "%s\u65E5\u671F%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u683C\u5F0F\u7684\u65E5\u671F%s",
parse: "%s\u65E0\u6CD5\u89E3\u6790\u4E3A\u65E5\u671F,%s\u662F\u65E0\u6548\u7684",
invalid: "%s\u65E5\u671F%s\u662F\u65E0\u6548\u7684"
},
types: {
number: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u6570\u5B57",
boolean: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u5E03\u5C14\u7C7B\u578B",
method: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u65B9\u6CD5",
regexp: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u6B63\u5219\u8868\u8FBE\u5F0F",
integer: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u6574\u578B\u6570\u5B57",
float: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u6D6E\u70B9\u5C0F\u6570",
array: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u6570\u7EC4",
object: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u5BF9\u8C61",
enum: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u679A\u4E3E",
date: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u65E5\u671F",
url: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684url",
hex: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u5341\u516D\u8FDB\u5236",
email: "%s\u4E0D\u662F\u4E00\u4E2A\u6709\u6548\u7684\u90AE\u7BB1"
},
string: {
len: "%s\u5FC5\u987B\u662F\u957F\u5EA6\u4E3A%s\u4E2A\u5B57\u7B26",
min: "%s\u6700\u5C0F\u957F\u5EA6\u4E3A%s\u4E2A\u5B57\u7B26",
max: "%s\u6700\u957F%s\u4E2A\u5B57\u7B26",
range: "%s\u5B57\u7B26\u957F\u5EA6\u9700\u8981\u5728%s\u548C%s\u4E4B\u95F4"
},
number: {
len: "%s\u957F\u5EA6\u5FC5\u987B\u4E3A%s",
min: "%s\u5FC5\u987B\u5C0F\u4E8E%s",
max: "%s\u5FC5\u987B\u5927\u4E8E%s",
range: "%s\u9700\u8981\u5728%s\u548C%s\u4E4B\u95F4"
},
array: {
len: "%s\u957F\u5EA6\u5FC5\u987B\u4E3A%s",
min: "%s\u957F\u5EA6\u5FC5\u987B\u5C0F\u4E8E%s",
max: "%s\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E%s",
range: "%s\u957F\u5EA6\u9700\u8981\u5728%s\u548C%s\u4E4B\u95F4"
},
pattern: {
mismatch: "%s\u503C%s\u4E0D\u80FD\u5339\u914D%s"
}
};
const __default__$N = {
name: "LayFormItem"
};
const _sfc_main$Q = defineComponent({
...__default__$N,
props: {
prop: null,
mode: { default: "block" },
label: null,
labelPosition: { default: "right" },
labelWidth: { default: 95 },
errorMessage: null,
rules: null,
required: { type: Boolean },
requiredErrorMessage: null
},
setup(__props, { expose }) {
const props = __props;
const layForm = inject("LayForm", {});
const formItemRef = ref();
const slotParent = ref();
const isRequired = computed$1(() => {
return props.required || layForm.required;
});
const ruleItems = computed$1(() => {
const prop = props.prop;
if (!prop) {
return {};
}
let rulesArrs = [];
if (isRequired.value) {
rulesArrs.push({ required: true });
}
if (props.rules) {
rulesArrs = rulesArrs.concat(props.rules);
}
if (layForm.rules && layForm.rules[prop]) {
rulesArrs = rulesArrs.concat(layForm.rules[prop]);
}
return rulesArrs;
});
const filedValue = computed$1(() => props.prop ? layForm.model[props.prop] : void 0);
watch(() => filedValue.value, (val) => validate(), { deep: true });
const errorMsg = ref();
const errorStatus = ref(false);
const validate = (callback) => {
if (props.prop && ruleItems.value.length > 0) {
const descriptor = {};
descriptor[layForm.useCN ? props.label || props.prop : props.prop] = ruleItems.value;
const validator = new Schema(descriptor);
let model = {};
let validateMessage = null;
if (layForm.useCN) {
validateMessage = Object.assign({}, cnValidateMessage, layForm.validateMessage);
model[props.label || props.prop] = filedValue.value;
} else {
layForm.validateMessage && (validateMessage = layForm.validateMessage);
model[props.prop] = filedValue.value;
}
layForm.requiredErrorMessage && (validateMessage = Object.assign(validateMessage, {
required: layForm.requiredErrorMessage
}));
props.requiredErrorMessage && (validateMessage = Object.assign(validateMessage, {
required: props.requiredErrorMessage
}));
validateMessage && validator.messages(validateMessage);
validator.validate(model, (errors, fields) => {
var _a2, _b;
errorStatus.value = errors !== null && errors.length > 0;
const slotParentDiv = slotParent.value;
if (errorStatus.value) {
const _errors = errors;
layForm.useCN && _errors.forEach((error) => {
error.label = props.label;
error.field = props.prop;
});
errorMsg.value = (_a2 = props.errorMessage) != null ? _a2 : _errors[0].message;
(slotParentDiv == null ? void 0 : slotParentDiv.childElementCount) > 0 && ((_b = slotParentDiv == null ? void 0 : slotParentDiv.firstElementChild) == null ? void 0 : _b.classList.add("layui-form-danger"));
callback && callback(_errors, fields);
} else {
clearValidate();
}
});
}
};
const clearValidate = () => {
var _a2;
errorStatus.value = false;
errorMsg.value = "";
const slotParentDiv = slotParent.value;
(slotParentDiv == null ? void 0 : slotParentDiv.childElementCount) > 0 && ((_a2 = slotParentDiv == null ? void 0 : slotParentDiv.firstElementChild) == null ? void 0 : _a2.classList.remove("layui-form-danger"));
};
expose({ validate, clearValidate });
onMounted(() => {
if (props.prop) {
layForm.addField(reactive({
...toRefs(props),
$el: formItemRef,
validate,
clearValidate
}));
}
});
const getMarginLeft = computed$1(() => {
if (props.mode == "block") {
if (props.labelPosition != "top") {
let labelWidth = typeof props.labelWidth === "string" ? parseFloat(props.labelWidth) : props.labelWidth;
labelWidth += 15;
return {
"margin-left": `${labelWidth}px`
};
} else {
return {
"margin-left": "0px"
};
}
}
});
return (_ctx, _cache) => {
var _a2;
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-form-item", [`layui-form-item-${__props.labelPosition}`]]),
ref_key: "formItemRef",
ref: formItemRef
}, [
createElementVNode("label", {
class: "layui-form-label",
style: normalizeStyle({ width: __props.labelWidth + "px" })
}, [
props.prop && unref(isRequired) ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass(["layui-required", "layui-icon"].concat((_a2 = unref(layForm).requiredIcons) != null ? _a2 : ""))
}, [
renderSlot(_ctx.$slots, "required", {
props: { ...props, model: unref(layForm).model }
}, () => [
createTextVNode(toDisplayString$1(unref(layForm).requiredIcons ? "" : "*"), 1)
])
], 2)) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "label", {
props: { ...props, model: unref(layForm).model }
}, () => [
createTextVNode(toDisplayString$1(__props.label), 1)
])
], 4),
createElementVNode("div", {
class: normalizeClass([__props.mode ? "layui-input-" + __props.mode : ""]),
style: normalizeStyle(unref(getMarginLeft))
}, [
createElementVNode("div", {
ref_key: "slotParent",
ref: slotParent
}, [
renderSlot(_ctx.$slots, "default", {
props: { ...props, model: unref(layForm).model }
})
], 512),
errorStatus.value ? (openBlock(), createElementBlock("span", {
key: 0,
class: normalizeClass([
"layui-error-message",
{ "layui-error-message-anim": errorStatus.value }
])
}, toDisplayString$1(errorMsg.value), 3)) : createCommentVNode("", true)
], 6)
], 2);
};
}
});
const component$E = withInstall(_sfc_main$Q);
var index$o = /* @__PURE__ */ (() => ".layui-rate,.layui-rate *{display:inline-block;vertical-align:middle}.layui-rate{padding:10px 5px 10px 0;font-size:0}.layui-rate li i.layui-icon{font-size:20px;color:#ffb800;margin-right:5px;transition:all .3s;-webkit-transition:all .3s}.layui-rate li i:hover{cursor:pointer;transform:scale(1.12);-webkit-transform:scale(1.12)}.layui-rate[readonly] li i:hover{cursor:default;transform:scale(1)}.layui-rate-clear-icon{display:inline-block;color:#c6c6c6;padding-top:3px;font-size:18px;vertical-align:middle}.layui-rate-clear-icon:hover{cursor:pointer;color:#ff4949}\n")();
const _hoisted_1$C = ["onMousemove", "onClick"];
const _hoisted_2$x = {
key: 0,
class: "layui-inline"
};
const __default__$M = {
name: "LayRate"
};
const _sfc_main$P = defineComponent({
...__default__$M,
props: {
theme: null,
length: { default: 5 },
modelValue: { default: 0 },
readonly: { type: [Boolean, String], default: false },
half: { type: Boolean, default: false },
text: { type: Boolean, default: false },
isBlock: { type: Boolean, default: false },
allowClear: { type: Boolean, default: false },
clearIcon: { default: "layui-icon-close-fill" },
icons: { default: () => [
"layui-icon-rate",
"layui-icon-rate-half",
"layui-icon-rate-solid"
] }
},
emits: ["update:modelValue", "select", "clear"],
setup(__props, { emit }) {
const props = __props;
const currentValue = ref(props.modelValue);
const tempValue = ref(currentValue.value);
const isHalf = computed$1(() => props.half && Math.round(currentValue.value) !== currentValue.value);
watch(() => props.modelValue, () => {
currentValue.value = props.modelValue;
tempValue.value = props.modelValue;
});
const getValue2 = function(index2, event) {
if (!props.half) {
return index2;
}
return index2 - (event.offsetX <= event.target.offsetWidth / 2 ? 0.5 : 0);
};
const mousemove = function(index2, event) {
if (props.readonly) {
return false;
}
currentValue.value = getValue2(index2, event);
};
const mouseleave = function() {
if (props.readonly) {
return false;
}
currentValue.value = tempValue.value;
};
const action = function(index2, event) {
if (props.readonly) {
return false;
}
currentValue.value = getValue2(index2, event);
tempValue.value = currentValue.value;
emit("update:modelValue", currentValue.value);
emit("select", currentValue.value);
};
const showClearIcon = computed$1(() => !props.readonly && props.allowClear);
const clearRate = function() {
tempValue.value = 0;
currentValue.value = 0;
emit("clear", currentValue.value);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(__props.isBlock ? "layui-block" : "layui-inline")
}, [
createElementVNode("ul", {
class: "layui-rate",
onMouseleave: mouseleave
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.length, (index2) => {
return openBlock(), createElementBlock("li", {
key: index2,
class: "layui-inline",
onMousemove: ($event) => mousemove(index2, $event),
onClick: ($event) => action(index2, $event)
}, [
index2 <= Math.ceil(currentValue.value) ? (openBlock(), createElementBlock("i", {
key: 0,
class: normalizeClass([
"layui-icon",
`${__props.icons[__props.icons.length - (unref(isHalf) && index2 === Math.ceil(currentValue.value) ? 2 : 1)]}`
]),
style: normalizeStyle({ color: __props.theme })
}, null, 6)) : (openBlock(), createElementBlock("i", {
key: 1,
class: normalizeClass(["layui-icon"].concat(__props.icons[0])),
style: normalizeStyle({ color: __props.theme })
}, null, 6))
], 40, _hoisted_1$C);
}), 128))
], 32),
__props.text ? (openBlock(), createElementBlock("span", _hoisted_2$x, [
renderSlot(_ctx.$slots, "default", { value: currentValue.value }, () => [
createTextVNode(toDisplayString$1(currentValue.value + "\u661F"), 1)
])
])) : createCommentVNode("", true),
unref(showClearIcon) ? (openBlock(), createElementBlock("i", {
key: 1,
class: normalizeClass(["layui-icon", "layui-rate-clear-icon", __props.clearIcon]),
onClick: clearRate,
title: "\u6E05\u9664\u8BC4\u5206"
}, null, 2)) : createCommentVNode("", true)
], 2);
};
}
});
const component$D = withInstall(_sfc_main$P);
const component$C = withInstall(_sfc_main$1y);
const _sfc_main$O = {
name: "LayDropdownMenu"
};
const _hoisted_1$B = { class: "layui-menu layui-dropdown-menu" };
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
return openBlock(), createElementBlock("ul", _hoisted_1$B, [
renderSlot(_ctx.$slots, "default")
]);
}
var LayDropdownMenu = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$1]]);
const component$B = withInstall(LayDropdownMenu);
const _hoisted_1$A = { class: "layui-menu-body-title" };
const _hoisted_2$w = {
key: 0,
class: "layui-dropdown-menu-prefix"
};
const _hoisted_3$t = {
key: 0,
class: "layui-dropdown-menu-suffix"
};
const __default__$L = {
name: "LayDropdownMenuItem"
};
const _sfc_main$N = defineComponent({
...__default__$L,
props: {
disabled: { type: Boolean, default: false }
},
setup(__props) {
const props = __props;
inject("openState");
const dropdownCtx = inject(dropdownInjectionKey, void 0);
const handleClick = () => {
if (props.disabled) {
return;
}
dropdownCtx == null ? void 0 : dropdownCtx.hide();
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
onClick: handleClick,
class: normalizeClass({ "layui-disabled": __props.disabled }),
style: normalizeStyle(_ctx.$slots.suffix ? `justify-content: space-between;` : "")
}, [
createElementVNode("span", _hoisted_1$A, [
_ctx.$slots.prefix ? (openBlock(), createElementBlock("span", _hoisted_2$w, [
renderSlot(_ctx.$slots, "prefix")
])) : createCommentVNode("", true),
renderSlot(_ctx.$slots, "default")
]),
_ctx.$slots.suffix ? (openBlock(), createElementBlock("span", _hoisted_3$t, [
renderSlot(_ctx.$slots, "suffix")
])) : createCommentVNode("", true)
], 6);
};
}
});
const component$A = withInstall(_sfc_main$N);
const __default__$K = {
name: "LayDropdownSubMenu"
};
const _sfc_main$M = defineComponent({
...__default__$K,
props: {
trigger: { default: "hover" },
placement: { default: "right-start" },
disabled: { type: Boolean, default: false },
contentOffset: { default: 2 }
},
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createBlock(_sfc_main$1y, {
trigger: __props.trigger,
placement: __props.placement,
"auto-fit-min-width": false,
contentOffset: __props.contentOffset,
disabled: __props.disabled,
updateAtScroll: ""
}, {
content: withCtx(() => [
createVNode(LayDropdownMenu, null, {
default: withCtx(() => [
renderSlot(_ctx.$slots, "content")
]),
_: 3
})
]),
default: withCtx(() => [
createVNode(_sfc_main$N, { disabled: __props.disabled }, createSlots({
suffix: withCtx(() => [
renderSlot(_ctx.$slots, "suffix", {}, () => [
createVNode(unref(_sfc_main$2E), {
type: "layui-icon-right",
size: "14px"
})
])
]),
_: 2
}, [
_ctx.$slots.prefix ? {
name: "prefix",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "prefix")
]),
key: "0"
} : void 0,
_ctx.$slots.default ? {
name: "default",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
key: "1"
} : void 0
]), 1032, ["disabled"])
]),
_: 3
}, 8, ["trigger", "placement", "contentOffset", "disabled"]);
};
}
});
const component$z = withInstall(_sfc_main$M);
var index$n = /* @__PURE__ */ (() => '.layui-tab{display:flex;margin:10px 0;text-align:left!important}.layui-tab[overflow]>.layui-tab-head>.layui-tab-title{overflow:hidden}.layui-tab.is-left{flex-direction:row}.layui-tab.is-right{flex-direction:row-reverse;justify-content:space-between}.layui-tab.is-top{flex-direction:column}.layui-tab.is-bottom{flex-direction:column-reverse}.layui-tab-head{display:inline-block;overflow:hidden}.layui-tab-card .layui-tab-head{background-color:var(--global-neutral-color-1)}.layui-tab-title{position:relative;left:0;height:40px;white-space:nowrap;font-size:0;border-bottom-width:1px;border-bottom-style:solid;transition:all .2s;-webkit-transition:all .2s}.layui-tab-title li{display:inline-block;vertical-align:middle;font-size:14px;transition:all .2s;-webkit-transition:all .2s;position:relative;line-height:40px;min-width:65px;padding:0 15px;text-align:center;cursor:pointer;user-select:none}.layui-tab-title li a{display:block;padding:0 15px;margin:0 -15px}.layui-tab-head.is-top,.layui-tab-head.is-bottom,.layui-tab-title.is-top,.layui-tab-title.is-bottom{width:100%;position:relative}.layui-tab-title.is-right,.layui-tab-title.is-left{height:100%;min-width:60px;border-bottom-width:0px;border-bottom-style:none}.layui-tab-title.is-left li{display:list-item;margin-right:-1px}.layui-tab-title.is-right li{display:list-item;margin-left:-1px}.layui-tab-title.is-top li,.layui-tab-title.is-bottom li{border-bottom:1px solid #eeeeee}.layui-tab-title.is-right{border-left:1px solid var(--global-neutral-color-3)}.layui-tab-title.is-left{border-right:1px solid var(--global-neutral-color-3)}.layui-tab-title .layui-this{color:#000;background-color:#fff}.layui-tab-title .layui-this:after{position:absolute;left:0;top:0;content:"";width:100%;height:41px;border-width:1px;border-style:solid;border-bottom-color:#fff;border-radius:2px 2px 0 0;box-sizing:border-box;pointer-events:none}.layui-tab-title.is-left .layui-this:after{border:1px solid var(--global-neutral-color-3);border-right-color:#fff}.layui-tab-title.is-right .layui-this:after{border:1px solid var(--global-neutral-color-3);border-left-color:#fff}.layui-tab-brief>.layui-tab-head{background-color:transparent}.layui-tab-brief>.layui-tab-head>.layui-tab-title .layui-this{color:var(--global-primary-color)}.layui-tab-brief>.layui-tab-head>.layui-tab-more li.layui-this:after,.layui-tab-brief>.layui-tab-head>.layui-tab-title .layui-this:after{border:none;border-radius:0}.layui-tab-brief>.layui-tab-head.is-right>.layui-tab-title{border-left:1px solid var(--global-neutral-color-3)}.layui-tab-brief>.layui-tab-head.is-left>.layui-tab-title{border-right:1px solid var(--global-neutral-color-3)}.layui-tab-brief[overflow]>.layui-tab-head>.layui-tab-title .layui-this:after{top:-1px}.layui-tab-brief>.layui-tab-head.is-right>.layui-tab-title li,.layui-tab-brief>.layui-tab-head.is-left>.layui-tab-title li{margin-right:0}.layui-tab-brief>.layui-tab-head.is-top>.layui-tab-title li,.layui-tab-brief>.layui-tab-head.is-top>.layui-tab-title li{margin-top:0;margin-bottom:0}.layui-tab-card{border-width:1px;border-style:solid;border-radius:2px;box-shadow:0 2px 5px #0000001a}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-top{margin-top:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-right,.layui-tab-card>.layui-tab-head>.layui-tab-title.is-left{margin-right:-1px;margin-left:-1px}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-bottom li{margin-top:-1px}.layui-tab-card>.layui-tab-head>.layui-tab-title .layui-this:after{border-radius:0}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-bottom{border-top:1px solid var(--global-neutral-color-3);margin-bottom:-2px;margin-left:-1px}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-left li,.layui-tab-card>.layui-tab-head>.layui-tab-title.is-right li{margin-top:-1px;margin-bottom:-1px}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-top .layui-this:after{border:1px solid var(--global-neutral-color-3);border-bottom-color:#fff}.layui-tab-card>.layui-tab-head>.layui-tab-title.is-bottom .layui-this:after{border
const TabInjectKey = Symbol("layuiTab");
const __default__$J = {
name: "LayTabItem"
};
const _sfc_main$L = defineComponent({
...__default__$J,
props: {
id: null,
title: null,
icon: null,
closable: { type: [Boolean, String], default: true }
},
setup(__props) {
var _a2;
const props = __props;
const instance = getCurrentInstance();
const slots = useSlots();
const active = inject("active");
const tabsCtx = inject(TabInjectKey, {});
const data = reactive({
id: props.id,
title: props.title,
icon: props.icon,
closable: props.closable,
slots
});
if (instance == null ? void 0 : instance.uid) {
(_a2 = tabsCtx.addItem) == null ? void 0 : _a2.call(tabsCtx, props.id, data);
}
onBeforeUnmount(() => {
var _a3;
if (instance == null ? void 0 : instance.uid) {
(_a3 = tabsCtx.removeItem) == null ? void 0 : _a3.call(tabsCtx, props.id);
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-tab-item", [unref(active) === __props.id ? "layui-show" : ""]])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const _hoisted_1$z = ["onClick"];
const _hoisted_2$v = ["onClick"];
const _hoisted_3$s = { class: "layui-tab-content" };
const __default__$I = {
name: "LayTab"
};
const _sfc_main$K = defineComponent({
...__default__$I,
props: {
type: null,
modelValue: null,
allowClose: { type: Boolean },
tabPosition: { default: "top" },
beforeClose: null,
beforeLeave: null,
activeBarTransition: { type: Boolean }
},
emits: ["update:modelValue", "change", "close"],
setup(__props, { emit }) {
const props = __props;
const slot = useSlots();
const tabMap = reactive(/* @__PURE__ */ new Map());
2022-12-30 08:13:19 +00:00
const childrens = ref([]);
2022-11-15 01:16:55 +00:00
const setItemInstanceBySlot = function(nodes) {
nodes == null ? void 0 : nodes.map((item) => {
2022-12-30 08:13:19 +00:00
if (isArrayChildren(item, item.children)) {
2022-11-15 01:16:55 +00:00
setItemInstanceBySlot(item.children);
} else {
2022-12-30 08:13:19 +00:00
if (item.type.name == _sfc_main$L.name) {
2022-11-15 01:16:55 +00:00
childrens.value.push(item);
}
}
});
};
const active = computed$1({
get() {
return props.modelValue;
},
set(val) {
emit("update:modelValue", val);
}
});
const tabItems = computed$1(() => {
const tabData = [];
childrens.value.forEach((item) => {
var _a2;
const tab = tabMap.get((_a2 = item.props) == null ? void 0 : _a2.id);
if (tab)
tabData.push(tab);
});
return tabData;
});
const addItem = (id, data) => {
tabMap.set(id, data);
};
const removeItem = (id) => {
tabMap.delete(id);
};
provide(TabInjectKey, reactive({
active,
addItem,
removeItem
}));
const change3 = function(id) {
if (props.beforeLeave && props.beforeLeave(id) === false) {
return;
}
emit("update:modelValue", id);
emit("change", id);
};
const close2 = function(index2, id) {
if (props.beforeClose && props.beforeClose(id) === false) {
return;
}
childrens.value.splice(index2, 1);
if (active.value === id) {
const nextChildren = childrens.value[index2 === childrens.value.length ? 0 : index2];
change3(nextChildren && nextChildren.props ? nextChildren.props.id : "");
}
emit("close", id);
};
const activeBarRef = shallowRef(void 0);
const activeEl = shallowRef(void 0);
const tabBarStyle = ref();
const getBarStyle = () => {
let offset = 0;
let tabSize = 0;
const sizeName2 = props.tabPosition === "top" || props.tabPosition === "bottom" ? "width" : "height";
const axis = sizeName2 === "width" ? "X" : "Y";
const position = axis === "X" ? "left" : "top";
const el = activeEl.value;
const activeElParentElement = navRef.value;
if (!el || !activeElParentElement)
return;
const rect = el == null ? void 0 : el.getBoundingClientRect();
const parentRect = activeElParentElement == null ? void 0 : activeElParentElement.getBoundingClientRect();
offset = rect[position] - parentRect[position];
tabSize = el.getBoundingClientRect()[sizeName2];
return {
[sizeName2]: `${tabSize}px`,
transform: `translate${axis}(${offset}px)`,
transition: props.activeBarTransition ? `transform .3s` : ""
};
};
const navRef = shallowRef(void 0);
const scrollable = ref(false);
const navOffset = ref(0);
const navStyle = computed$1(() => {
var _a2, _b;
const axis = props.tabPosition === "top" || props.tabPosition === "bottom" ? "X" : "Y";
const position = axis === "X" ? "left" : "top";
const scrollPrevSize = (_b = (_a2 = scrollPrevRef.value) == null ? void 0 : _a2[`offset${sizeName.value}`]) != null ? _b : 0;
return {
transform: `translate${axis}(-${navOffset.value}px)`,
[position]: scrollable.value ? `${scrollPrevSize}px` : 0
};
});
const sizeName = computed$1(() => {
return props.tabPosition === "top" || props.tabPosition === "bottom" ? "Width" : "Height";
});
const getNavSize = function() {
var _a2;
let size = 0;
const nodeList = (_a2 = navRef.value) == null ? void 0 : _a2.querySelectorAll("li");
nodeList == null ? void 0 : nodeList.forEach((item) => {
size += item[`offset${sizeName.value}`];
});
return size;
};
const scrollPrev = function() {
if (!navRef.value)
return;
const containerSize = navRef.value[`offset${sizeName.value}`];
const currentOffset = navOffset.value;
if (!currentOffset)
return;
let newOffset = currentOffset > containerSize ? currentOffset - containerSize : 0;
navOffset.value = newOffset;
};
const scrollNextRef = shallowRef(void 0);
const scrollPrevRef = shallowRef(void 0);
const scrollNext = function() {
var _a2, _b, _c, _d;
if (!navRef.value)
return;
const navSize = getNavSize();
const containerSize = navRef.value[`offset${sizeName.value}`];
const currentOffset = navOffset.value;
const scrollNextSize = (_b = (_a2 = scrollNextRef.value) == null ? void 0 : _a2[`offset${sizeName.value}`]) != null ? _b : 0;
const scrollPrevSize = (_d = (_c = scrollPrevRef.value) == null ? void 0 : _c[`offset${sizeName.value}`]) != null ? _d : 0;
if (navSize - currentOffset <= containerSize)
return;
let newOffset = navSize - currentOffset > containerSize * 2 ? currentOffset + containerSize : navSize - containerSize + scrollNextSize + scrollPrevSize;
navOffset.value = newOffset;
};
const headRef = shallowRef(void 0);
const scrollToActiveTab = function() {
var _a2, _b, _c, _d;
if (!scrollable.value)
return;
const activeTab = activeEl.value;
const container = headRef.value;
if (!activeTab || !container)
return;
const activeTabRect = activeTab == null ? void 0 : activeTab.getBoundingClientRect();
const containerRect = container == null ? void 0 : container.getBoundingClientRect();
const isHorizontal = ["top", "bottom"].includes(props.tabPosition);
const currentOffset = navOffset.value;
let newOffset = currentOffset;
const navSize = getNavSize();
const scrollNextSize = (_b = (_a2 = scrollNextRef.value) == null ? void 0 : _a2[`offset${sizeName.value}`]) != null ? _b : 0;
const scrollPrevSize = (_d = (_c = scrollPrevRef.value) == null ? void 0 : _c[`offset${sizeName.value}`]) != null ? _d : 0;
const maxOffset2 = isHorizontal ? navSize - containerRect.width + scrollNextSize + scrollPrevSize : navSize - containerRect.height + scrollNextSize + scrollPrevSize;
if (isHorizontal) {
if (activeTabRect.left < containerRect.left) {
newOffset = currentOffset - (containerRect.left - activeTabRect.left);
newOffset -= scrollPrevSize;
}
if (activeTabRect.right > containerRect.right) {
newOffset = currentOffset + activeTabRect.right - containerRect.right;
newOffset += scrollNextSize;
}
} else {
if (activeTabRect.top < containerRect.top) {
newOffset = currentOffset - (containerRect.top - activeTabRect.top);
}
if (activeTabRect.bottom > containerRect.bottom) {
newOffset = currentOffset + (activeTabRect.bottom - containerRect.bottom);
}
}
newOffset = Math.max(newOffset, 0);
navOffset.value = Math.min(newOffset, maxOffset2);
};
const update = () => {
var _a2, _b, _c, _d, _e;
if (!navRef.value)
return;
activeEl.value = (_a2 = navRef.value) == null ? void 0 : _a2.querySelector(".layui-this");
tabBarStyle.value = getBarStyle();
if (props.tabPosition !== "top" && props.tabPosition !== "bottom")
return;
const navSize = getNavSize();
const containerSize = navRef.value[`offset${sizeName.value}`];
const currentOffset = navOffset.value;
const scrollNextSize = (_c = (_b = scrollNextRef.value) == null ? void 0 : _b[`offset${sizeName.value}`]) != null ? _c : 0;
const scrollPrevSize = (_e = (_d = scrollPrevRef.value) == null ? void 0 : _d[`offset${sizeName.value}`]) != null ? _e : 0;
if (containerSize < navSize) {
const currentOffset2 = navOffset.value;
scrollable.value = true;
if (navSize - currentOffset2 < containerSize) {
navOffset.value = navSize - containerSize + scrollNextSize + scrollPrevSize;
}
scrollToActiveTab();
} else {
scrollable.value = false;
if (currentOffset > 0) {
navOffset.value = 0;
}
}
};
2022-12-30 08:13:19 +00:00
const horizontalScroll = (e) => {
var _a2, _b;
e.preventDefault();
const navSize = getNavSize();
const containerSize = navRef.value[`offset${sizeName.value}`];
const currentOffset = navOffset.value;
const scrollNextSize = (_b = (_a2 = scrollNextRef.value) == null ? void 0 : _a2[`offset${sizeName.value}`]) != null ? _b : 0;
const direction = Math.abs(e.deltaX) >= Math.abs(e.deltaY) ? e.deltaX : e.deltaY;
const distance = 50 * (direction > 0 ? 1 : -1);
const newOffset = Math.max(currentOffset + distance, 0);
if (navSize - currentOffset <= containerSize - scrollNextSize && direction > 0)
return;
navOffset.value = newOffset;
};
2022-11-15 01:16:55 +00:00
const renderTabIcon = (attrs) => {
const tab = attrs.tabData;
if (typeof tab.icon === "function") {
return tab.icon();
} else if (typeof tab.icon === "string") {
return h(_sfc_main$2E, {
type: tab.icon,
style: "margin-right: 8px;"
});
}
};
const renderTabTitle = (attrs) => {
var _a2, _b;
const tab = attrs.tabData;
if ((_a2 = tab.slots) == null ? void 0 : _a2.title) {
return h(Fragment, ((_b = tab.slots) == null ? void 0 : _b.title) && tab.slots.title());
}
if (typeof tab.title === "function") {
return tab.title();
} else if (typeof tab.title === "string") {
return createTextVNode(tab.title);
}
};
useResizeObserver(navRef, update);
2022-12-30 08:13:19 +00:00
watch(tabMap, () => {
2022-11-15 01:16:55 +00:00
childrens.value = [];
setItemInstanceBySlot(slot.default && slot.default());
}, { immediate: true });
watch(() => [
props.modelValue,
props.tabPosition,
props.type,
childrens.value.length
], async () => {
await nextTick();
update();
});
onMounted(() => {
update();
scrollToActiveTab();
});
provide("active", active);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-tab", [
__props.type ? "layui-tab-" + __props.type : "",
props.tabPosition ? `is-${__props.tabPosition}` : ""
]])
}, [
createElementVNode("div", {
ref_key: "headRef",
ref: headRef,
class: normalizeClass(["layui-tab-head", props.tabPosition ? `is-${__props.tabPosition}` : ""])
}, [
createElementVNode("ul", {
ref_key: "navRef",
ref: navRef,
2022-12-30 08:13:19 +00:00
onWheel: horizontalScroll,
2022-11-15 01:16:55 +00:00
class: normalizeClass([
"layui-tab-title",
props.tabPosition ? `is-${__props.tabPosition}` : ""
]),
style: normalizeStyle(unref(navStyle))
}, [
__props.type === "brief" ? (openBlock(), createElementBlock("div", {
key: 0,
ref_key: "activeBarRef",
ref: activeBarRef,
class: "layui-tab-active-bar",
style: normalizeStyle(tabBarStyle.value)
}, null, 4)) : createCommentVNode("", true),
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(tabItems), (child, index2) => {
return openBlock(), createElementBlock("li", {
key: child.id,
class: normalizeClass([child.id === unref(active) ? "layui-this" : ""]),
onClick: withModifiers(($event) => change3(child.id), ["stop"])
}, [
createElementVNode("span", null, [
child["icon"] ? (openBlock(), createBlock(unref(RenderFunction), {
key: 0,
renderFunc: renderTabIcon,
tabData: child
}, null, 8, ["tabData"])) : createCommentVNode("", true),
createVNode(unref(RenderFunction), {
renderFunc: renderTabTitle,
tabData: child
}, null, 8, ["tabData"])
]),
__props.allowClose && child.closable != false ? (openBlock(), createElementBlock("i", {
key: 0,
class: "layui-icon layui-icon-close layui-unselect layui-tab-close",
onClick: withModifiers(($event) => close2(index2, child.id), ["stop"])
}, null, 8, _hoisted_2$v)) : createCommentVNode("", true)
], 10, _hoisted_1$z);
}), 128))
2022-12-30 08:13:19 +00:00
], 38),
2022-11-15 01:16:55 +00:00
scrollable.value ? (openBlock(), createElementBlock("span", {
key: 0,
ref_key: "scrollPrevRef",
ref: scrollPrevRef,
class: "layui-unselect layui-tab-bar prev",
onClick: scrollPrev
}, [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-left" })
], 512)) : createCommentVNode("", true),
scrollable.value ? (openBlock(), createElementBlock("span", {
key: 1,
ref_key: "scrollNextRef",
ref: scrollNextRef,
class: "layui-unselect layui-tab-bar",
onClick: scrollNext
}, [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-right" })
], 512)) : createCommentVNode("", true)
], 2),
createElementVNode("div", _hoisted_3$s, [
renderSlot(_ctx.$slots, "default")
])
], 2);
};
}
});
const component$y = withInstall(_sfc_main$K);
const component$x = withInstall(_sfc_main$L);
const _hoisted_1$y = ["onClick"];
const _hoisted_2$u = { class: "layui-tree-main" };
const _hoisted_3$r = ["onClick"];
const _hoisted_4$m = {
key: 0,
class: "layui-tree-pack layui-tree-showLine",
style: { "display": "block" }
};
const __default__$H = {
name: "TreeNode"
};
const _sfc_main$J = defineComponent({
...__default__$H,
props: {
tree: null,
nodeList: null,
showCheckbox: { type: Boolean },
showLine: { type: Boolean },
selectedKey: null,
checkStrictly: { type: [Boolean, String] },
collapseTransition: { type: Boolean },
onlyIconControl: { type: Boolean }
},
emits: ["node-click"],
setup(__props, { emit }) {
const props = __props;
useSlots();
function renderLineShort(node) {
return !node.hasNextSibling && node.parentNode && (!node.parentNode.hasNextSibling || node.parentNode.hasNextSibling && !node.parentNode.children);
}
const nodeIconType = (node) => {
if (!props.showLine) {
if (node.children.length > 0) {
return "layui-tree-iconArrow ";
}
return "";
}
if (node.children.length !== 0) {
return !node.isLeaf ? "layui-icon-addition" : "layui-icon-subtraction";
}
return "layui-icon-file";
};
function recursiveNodeClick(node) {
emit("node-click", node);
}
function handleChange(checked, node) {
props.tree.setCheckedKeys(checked, props.checkStrictly, node);
}
function handleIconClick(node) {
node.isLeaf = !node.isLeaf;
}
function handleTitleClick(node) {
if (!props.onlyIconControl) {
handleIconClick(node);
}
if (!node.isDisabled) {
emit("node-click", node);
}
}
function handleRowClick(node) {
if (!props.showLine) {
handleTitleClick(node);
}
}
const isChildAllSelected = computed$1(() => {
function _isChildAllSelected(node) {
if (!props.showCheckbox) {
return false;
}
let childSelectNum = 0;
let res = false;
for (const item of node.children) {
if (item.isChecked)
childSelectNum++;
}
if (childSelectNum > 0)
node.isChecked = true;
if (childSelectNum == node.children.length) {
for (const item of node.children) {
res = _isChildAllSelected(item);
if (res)
break;
}
} else {
res = true;
}
return res;
}
return (node) => {
if (props.checkStrictly) {
return false;
} else {
let res = _isChildAllSelected(node);
return res;
}
};
});
return (_ctx, _cache) => {
const _component_tree_node = resolveComponent("tree-node", true);
return openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodeList, (node, nodeIndex) => {
return openBlock(), createElementBlock("div", {
key: nodeIndex,
class: normalizeClass({
"layui-tree-set": true,
"layui-tree-setLineShort": renderLineShort(node),
"layui-tree-setHide": node.isRoot
})
}, [
createElementVNode("div", {
class: "layui-tree-entry",
onClick: ($event) => handleRowClick(node)
}, [
createElementVNode("div", _hoisted_2$u, [
createElementVNode("span", {
class: normalizeClass([
__props.showLine && node.children.length > 0 ? "layui-tree-icon" : "",
{ "layui-tree-iconClick": true }
])
}, [
createVNode(unref(_sfc_main$2E), {
type: nodeIconType(node),
onClick: withModifiers(($event) => handleIconClick(node), ["stop"])
}, null, 8, ["type", "onClick"])
], 2),
__props.showCheckbox ? (openBlock(), createBlock(_sfc_main$$, {
key: 0,
value: "",
skin: "primary",
modelValue: node.isChecked,
disabled: node.isDisabled,
isIndeterminate: unref(isChildAllSelected)(node),
onChange: (checked) => handleChange(checked, node)
}, null, 8, ["modelValue", "disabled", "isIndeterminate", "onChange"])) : createCommentVNode("", true),
createElementVNode("span", {
class: normalizeClass({
"layui-tree-txt": true,
"layui-disabled": node.isDisabled,
"layui-this": __props.selectedKey === node.id
}),
onClick: withModifiers(($event) => handleTitleClick(node), ["stop"])
}, [
renderSlot(_ctx.$slots, "title", { data: node }, () => [
createTextVNode(toDisplayString$1(node.title), 1)
])
], 10, _hoisted_3$r)
])
], 8, _hoisted_1$y),
createVNode(_sfc_main$17, { enable: __props.collapseTransition }, {
default: withCtx(() => [
node.isLeaf ? (openBlock(), createElementBlock("div", _hoisted_4$m, [
createVNode(_component_tree_node, {
tree: __props.tree,
"node-list": node.children,
"show-checkbox": __props.showCheckbox,
"show-line": __props.showLine,
"selected-key": __props.selectedKey,
"collapse-transition": __props.collapseTransition,
checkStrictly: __props.checkStrictly,
"only-icon-control": __props.onlyIconControl,
onNodeClick: recursiveNodeClick
}, createSlots({ _: 2 }, [
_ctx.$slots.title ? {
name: "title",
fn: withCtx((slotProp) => [
renderSlot(_ctx.$slots, "title", {
data: slotProp.data
})
]),
key: "0"
} : void 0
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selected-key", "collapse-transition", "checkStrictly", "only-icon-control"])
])) : createCommentVNode("", true)
]),
_: 2
}, 1032, ["enable"])
], 2);
}), 128);
};
}
});
class Tree {
constructor(config, origin) {
this.config = config;
this.treeData = [];
this.init(origin);
}
init(origin) {
const tree = this.createTree(origin);
this.treeData = tree;
}
createTree(origin, parentKey = "") {
let data;
if (!Array.isArray(origin)) {
data = Array.of(Object.assign({}, origin));
} else {
data = origin;
}
const nodeList = [];
const { children } = this.config.replaceFields;
const len = data.length;
for (let i = 0; i < len; i++) {
const node = this.getNode(data[i], parentKey, i < len - 1);
const nodeChildren = Reflect.get(node, children);
const nodeHasChildren = !!Reflect.get(node, children);
if (nodeHasChildren) {
Reflect.set(node, children, this.createTree(nodeChildren, node.id));
}
nodeList.push(node);
}
return nodeList;
}
getNode(origin, parentKey, hasNextSibling) {
const {
nodeMap,
originMap,
checkedKeys,
expandKeys,
checkStrictly,
replaceFields: { children, id, title }
} = this.config;
const nodeKey = Reflect.get(origin, id);
const nodeTitle = Reflect.get(origin, title);
const nodeChildren = Reflect.get(origin, children);
const nodeDisabled = !!Reflect.get(origin, "disabled");
const nodeIsLeaf = !!Reflect.get(origin, "spread");
const parentNode = nodeMap.get(parentKey);
const node = Object.assign({}, origin, {
id: nodeKey,
title: nodeTitle,
children: nodeChildren ? nodeChildren : [],
parentKey,
isRoot: parentKey === "",
isDisabled: false,
isChecked: false,
isLeaf: false,
hasNextSibling,
parentNode: parentNode || null
});
node.isDisabled = nodeDisabled;
node.isChecked = checkedKeys.includes(nodeKey);
node.isLeaf = parentNode ? parentNode.isLeaf : expandKeys.includes(nodeKey);
node.isLeaf = nodeIsLeaf;
if (!nodeMap.has(nodeKey)) {
nodeMap.set(nodeKey, node);
}
if (!originMap.has(nodeKey)) {
originMap.set(nodeKey, origin);
}
return node;
}
treeForeach(tree, func) {
tree.forEach((data) => {
data.children && this.treeForeach(data.children, func);
func(data);
});
}
setChildrenChecked(checked, nodes) {
var ableCount = 0;
var checkCount = 0;
const len = nodes.length;
this.treeForeach(nodes, (node) => {
if (!node.isDisabled) {
ableCount = ableCount + 1;
if (node.isChecked) {
checkCount = checkCount + 1;
}
}
});
checkCount < ableCount ? checked = true : checked = false;
for (let i = 0; i < len; i++) {
if (!nodes[i].isDisabled || nodes[i].isDisabled && nodes[i].children.length > 0) {
nodes[i].isChecked = checked;
}
nodes[i].children && nodes[i].children.length > 0 && this.setChildrenChecked(checked, nodes[i].children);
}
}
setParentChecked(checked, parent) {
if (!parent) {
return;
}
parent.isChecked = checked;
const pChild = parent.children;
const pChildChecked = pChild.some((c) => c.isChecked);
if (pChildChecked) {
parent.isChecked = true;
}
if (parent.parentNode) {
this.setParentChecked(checked, parent.parentNode);
}
}
setCheckedKeys(checked, checkStrictly, node) {
node.isChecked = checked;
if (!checkStrictly) {
if (node.parentNode) {
this.setParentChecked(checked, node.parentNode);
}
if (node.children) {
this.setChildrenChecked(checked, node.children);
}
}
}
getData() {
return this.treeData;
}
getKeys() {
const checkedKeys = [];
const expandKeys = [];
const iterator = this.config.nodeMap[Symbol.iterator]();
let next = iterator.next();
while (!next.done) {
const [, node] = next.value;
const id = Reflect.get(node, this.config.replaceFields.id);
if (node.isChecked) {
checkedKeys.push(id);
}
if (node.isLeaf) {
expandKeys.push(id);
}
next = iterator.next();
}
return { checkedKeys, expandKeys };
}
getOriginData(key) {
return this.config.originMap.get(key);
}
}
const useTree = (props, emit) => {
var _a2, _b, _c, _d;
const tree = new Tree({
nodeMap: /* @__PURE__ */ new Map(),
originMap: /* @__PURE__ */ new Map(),
replaceFields: {
id: "id",
title: "title",
children: "children"
},
showCheckbox: (_a2 = props.showCheckbox) != null ? _a2 : false,
checkedKeys: (_b = props.checkedKeys) != null ? _b : [],
expandKeys: (_c = props.expandKeys) != null ? _c : [],
checkStrictly: (_d = props.checkStrictly) != null ? _d : false
}, props.data);
const nodeList = computed$1(() => {
const nodes = tree.getData();
return nodes;
});
return {
tree,
nodeList
};
};
2022-12-30 08:13:19 +00:00
var index$m = /* @__PURE__ */ (() => '.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border-top:1px solid var(--global-neutral-color-6);border-bottom:1px solid var(--global-neutral-color-6);border-right:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}.layui-tree{line-height:22px}.layui-tree .layui-form-checkb
2022-11-15 01:16:55 +00:00
const __default__$G = {
name: "LayTree"
};
const _sfc_main$I = defineComponent({
...__default__$G,
props: {
data: null,
disabled: { type: Boolean, default: false },
edit: { default: false },
checkedKeys: { default: () => {
return [];
} },
checkStrictly: { type: [Boolean, String], default: false },
collapseTransition: { type: Boolean, default: true },
onlyIconControl: { type: Boolean, default: false },
selectedKey: null,
showLine: { type: Boolean, default: true },
showCheckbox: { type: Boolean, default: false },
replaceFields: { default: () => {
return {
id: "id",
children: "children",
title: "title"
};
} }
},
emits: ["update:checkedKeys", "update:expandKeys", "node-click"],
setup(__props, { emit }) {
const props = __props;
useSlots();
const className = computed$1(() => {
return {
"layui-tree": true,
"layui-form": props.showCheckbox,
"layui-tree-line": props.showLine
};
});
let tree = ref();
let nodeList = ref();
const unWatch = ref(false);
const initStatus = ref(false);
const loadNodeList = () => {
let { tree: _tree, nodeList: _nodeList } = useTree(props);
tree.value = _tree;
nodeList.value = _nodeList.value;
};
watch(() => props.data, () => {
loadNodeList();
}, { deep: true, immediate: true });
watch(() => props.checkedKeys, () => {
if (!unWatch.value) {
loadNodeList();
}
});
watch(tree, () => {
if (initStatus.value) {
const { checkedKeys } = tree.value.getKeys();
unWatch.value = true;
emit("update:checkedKeys", checkedKeys);
setTimeout(() => {
unWatch.value = false;
}, 0);
}
}, { deep: true });
onMounted(() => {
nextTick(() => {
initStatus.value = true;
});
});
function handleClick(node) {
const originNode = tree.value.getOriginData(node.id);
emit("node-click", originNode);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(unref(className))
}, [
createVNode(_sfc_main$J, {
tree: unref(tree),
"node-list": unref(nodeList),
"show-checkbox": __props.showCheckbox,
"show-line": __props.showLine,
selectedKey: __props.selectedKey,
"check-strictly": __props.checkStrictly,
"collapse-transition": __props.collapseTransition,
"only-icon-control": __props.onlyIconControl,
onNodeClick: handleClick
}, createSlots({ _: 2 }, [
_ctx.$slots.title ? {
name: "title",
fn: withCtx(({ data }) => [
renderSlot(_ctx.$slots, "title", { data })
]),
key: "0"
} : void 0
]), 1032, ["tree", "node-list", "show-checkbox", "show-line", "selectedKey", "check-strictly", "collapse-transition", "only-icon-control"])
], 2);
};
}
});
const component$w = withInstall(_sfc_main$I);
var index$l = /* @__PURE__ */ (() => ".layui-tree-select{width:220px}.layui-tree-select-content{padding:10px}.layui-tree-select .layui-icon-triangle-d{transition:all .3s;-webkit-transition:all .3s;color:var(--global-neutral-color-8)}.layui-tree-select .layui-icon-triangle-d.triangle{transform:rotate(180deg)}\n")();
function getNode(root, id) {
let resultNode = null;
findNode(root, id);
function findNode(root2, id2) {
if (!!root2) {
let type4 = Object.prototype.toString.call(root2);
if (type4 === "[object Object]") {
if (root2.id && root2.id === id2) {
resultNode = root2;
} else {
let node = root2.children || null;
findNode(node, id2);
}
} else if (type4 === "[object Array]") {
let needNode = root2.find((i) => !!i === true && i.id === id2);
if (!!needNode) {
resultNode = needNode;
} else {
if (root2.length) {
root2.forEach((item) => {
if (item && item.children) {
let node = item.children;
if (node && node.length) {
findNode(node, id2);
}
}
});
}
}
}
}
}
return resultNode;
}
const _hoisted_1$x = { class: "layui-tree-select-content" };
const __default__$F = {
name: "LayTreeSelect"
};
const _sfc_main$H = defineComponent({
...__default__$F,
props: {
data: null,
modelValue: null,
disabled: { type: Boolean, default: false },
placeholder: { default: "\u8BF7\u9009\u62E9" },
multiple: { type: Boolean, default: false },
allowClear: { type: Boolean, default: false },
collapseTagsTooltip: { type: Boolean, default: true },
minCollapsedNum: { default: 3 },
size: { default: "md" },
checkStrictly: { type: Boolean, default: true }
},
emits: ["update:modelValue", "change", "search"],
setup(__props, { emit: emits }) {
const props = __props;
const singleValue = ref();
const multipleValue = ref(["1"]);
const openState = ref(false);
const dropdownRef = ref();
const selectedValue = computed$1({
get() {
return props.modelValue;
},
set(value) {
emits("update:modelValue", value);
emits("change", value);
}
});
const checkedKeys = computed$1({
get() {
return props.multiple ? props.modelValue : [];
},
set(value) {
if (props.multiple) {
emits("update:modelValue", value);
emits("change", value);
}
}
});
watch(selectedValue, () => {
if (props.multiple) {
multipleValue.value = selectedValue.value.map((value) => {
const node = getNode(props.data, value);
node.label = node.title;
node.closable = !node.disabled;
return node;
});
} else {
const node = getNode(props.data, selectedValue.value);
if (node) {
singleValue.value = node.title;
}
}
}, { immediate: true, deep: true });
const handleClick = (node) => {
dropdownRef.value.hide();
selectedValue.value = node.id;
};
return (_ctx, _cache) => {
const _component_lay_icon = resolveComponent("lay-icon");
const _component_lay_tag_input = resolveComponent("lay-tag-input");
const _component_lay_input = resolveComponent("lay-input");
const _component_lay_tree = resolveComponent("lay-tree");
const _component_lay_dropdown = resolveComponent("lay-dropdown");
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-tree-select", { "layui-disabled": __props.disabled }])
}, [
createVNode(_component_lay_dropdown, {
ref_key: "dropdownRef",
ref: dropdownRef,
disabled: __props.disabled,
"update-at-scroll": true,
onShow: _cache[4] || (_cache[4] = ($event) => openState.value = true),
onHide: _cache[5] || (_cache[5] = ($event) => openState.value = false)
}, {
content: withCtx(() => [
createElementVNode("div", _hoisted_1$x, [
createVNode(_component_lay_tree, {
data: __props.data,
onlyIconControl: true,
"show-checkbox": __props.multiple,
"check-strictly": __props.checkStrictly,
selectedKey: unref(selectedValue),
"onUpdate:selectedKey": _cache[2] || (_cache[2] = ($event) => isRef(selectedValue) ? selectedValue.value = $event : null),
checkedKeys: unref(checkedKeys),
"onUpdate:checkedKeys": _cache[3] || (_cache[3] = ($event) => isRef(checkedKeys) ? checkedKeys.value = $event : null),
onNodeClick: handleClick
}, null, 8, ["data", "show-checkbox", "check-strictly", "selectedKey", "checkedKeys"])
])
]),
default: withCtx(() => [
__props.multiple ? (openBlock(), createBlock(_component_lay_tag_input, {
key: 0,
size: __props.size,
"allow-clear": __props.allowClear,
placeholder: __props.placeholder,
collapseTagsTooltip: __props.collapseTagsTooltip,
minCollapsedNum: __props.minCollapsedNum,
disabledInput: true,
modelValue: multipleValue.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => multipleValue.value = $event)
}, {
suffix: withCtx(() => [
createVNode(_component_lay_icon, {
type: "layui-icon-triangle-d",
class: normalizeClass({ triangle: openState.value })
}, null, 8, ["class"])
]),
_: 1
}, 8, ["size", "allow-clear", "placeholder", "collapseTagsTooltip", "minCollapsedNum", "modelValue"])) : (openBlock(), createBlock(_component_lay_input, {
key: 1,
modelValue: singleValue.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => singleValue.value = $event),
placeholder: __props.placeholder,
disabled: __props.disabled,
readonly: true,
size: __props.size
}, {
suffix: withCtx(() => [
createVNode(_component_lay_icon, {
type: "layui-icon-triangle-d",
class: normalizeClass({ triangle: openState.value })
}, null, 8, ["class"])
]),
_: 1
}, 8, ["modelValue", "placeholder", "disabled", "size"]))
]),
_: 1
}, 8, ["disabled"])
], 2);
};
}
});
const component$v = withInstall(_sfc_main$H);
2022-12-30 08:13:19 +00:00
var index$k = /* @__PURE__ */ (() => '.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:#fff;overflow:hidden}.layui-form-checkbox:hover span{background-color:var(--global-neutral-color-8)}.layui-form-checkbox i{top:0;right:0;width:29px;height:28px;position:absolute;border-top:1px solid var(--global-neutral-color-6);border-bottom:1px solid var(--global-neutral-color-6);border-right:1px solid var(--global-neutral-color-6);border-radius:0 2px 2px 0;color:#fff;font-size:20px;text-align:center}.layui-form-checkbox:hover i{border-color:var(--global-neutral-color-8);color:var(--global-neutral-color-8)}.layui-form-checkbox[lay-skin=primary]{height:auto!important;line-height:normal!important;min-width:18px;min-height:18px;border:none!important;margin-right:0;padding-left:28px;padding-right:0;background:0 0}.layui-form-checkbox[lay-skin=primary] span{padding-left:0;padding-right:15px;line-height:18px;background:0 0;color:#666}.layui-form-checkbox[lay-skin=primary] i{right:auto;left:0;width:16px;height:16px;line-height:16px;border:1px solid var(--global-neutral-color-6);font-size:12px;border-radius:2px;background-color:#fff;-webkit-transition:.1s linear;transition:.1s linear}.layui-form-checkbox[lay-skin=primary]:hover i{border-color:var(--global-checked-color);color:#fff}.layui-form-checked,.layui-form-checked:hover{border-color:var(--global-checked-color)}.layui-form-checked i,.layui-form-checked:hover i{color:var(--global-checked-color)}.layui-form-checked span,.layui-form-checked:hover span{background-color:var(--global-checked-color)}.layui-form-checked[lay-skin=primary] i{border-color:var(--global-checked-color);background-color:var(--global-checked-color);color:#fff}.layui-form-checked[lay-skin=primary] span{background:0 0!important}.layui-checkbox-disabled[lay-skin=primary] span{background:0 0!important;color:var(--global-neutral-color-8)!important}.layui-checkbox-disabled[lay-skin=primary]:hover i{border-color:var(--global-neutral-color-6)}.layui-checkbox-disabled,.layui-checkbox-disabled i{border-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled span{background-color:var(--global-neutral-color-3)!important}.layui-checkbox-disabled em{color:var(--global-neutral-color-6)!important}.layui-checkbox-disabled:hover i{color:#fff!important}.layui-checkbox-disabled .layui-icon-ok,.layui-checkbox-disabled .layui-icon-subtraction{background-color:var(--global-neutral-color-3)!important;border-color:var(--global-neutral-color-3)!important}.layui-radio[size=lg] .layui-form-radio>i{font-size:24px}.l
2022-11-15 01:16:55 +00:00
const _hoisted_1$w = ["colspan", "rowspan"];
const _hoisted_2$t = {
key: 1,
class: "layui-table-cell-expand-icon-spaced"
};
const _hoisted_3$q = ["colspan", "rowspan"];
const _hoisted_4$l = {
key: 1,
class: "layui-table-cell-expand-icon-spaced"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$h = ["colspan", "rowspan"];
2022-11-15 01:16:55 +00:00
const _hoisted_6$e = {
key: 1,
class: "layui-table-cell-expand-icon-spaced"
};
const _hoisted_7$d = ["colspan", "rowspan"];
const _hoisted_8$a = {
key: 1,
class: "layui-table-cell-expand-icon-spaced"
};
const _hoisted_9$8 = ["colspan", "rowspan"];
const _hoisted_10$8 = {
key: 1,
class: "layui-table-cell-expand-icon-spaced"
};
2022-12-09 08:41:41 +00:00
const _hoisted_11$8 = { key: 4 };
2022-11-15 01:16:55 +00:00
const _hoisted_12$6 = {
key: 0,
class: "layui-table-cell-expand"
};
const _hoisted_13$6 = ["colspan"];
const __default__$E = {
name: "TableRow"
};
const _sfc_main$G = defineComponent({
...__default__$E,
props: {
index: null,
indentSize: null,
currentIndentSize: null,
expandSpace: { type: Boolean },
expandIndex: null,
selectedKeys: null,
selectedKey: null,
tableColumnKeys: null,
childrenColumnName: { default: "children" },
columns: null,
checkbox: { type: Boolean, default: false },
cellClassName: { type: [String, Function], default: "" },
cellStyle: { type: [String, Function], default: "" },
rowClassName: null,
rowStyle: null,
id: null,
data: null,
spanMethod: null,
defaultExpandAll: { type: Boolean },
expandKeys: null,
getCheckboxProps: null,
getRadioProps: null
},
emits: [
"row",
"row-double",
"row-contextmenu",
"update:expandKeys",
"update:selectedKeys",
"update:selectedKey"
],
setup(__props, { emit }) {
const props = __props;
const slot = useSlots();
const tableExpandAll = ref(props.defaultExpandAll);
const tableExpandKeys = computed$1({
get() {
return [...props.expandKeys];
},
set(val) {
emit("update:expandKeys", val);
}
});
const tableSelectedKeys = computed$1({
get() {
return [...props.selectedKeys];
},
set(val) {
emit("update:selectedKeys", val);
}
});
const tableSelectedKey = computed$1({
get() {
return props.selectedKey;
},
set(val) {
emit("update:selectedKey", val);
}
});
const isExpand = computed$1({
get() {
return tableExpandAll.value ? true : tableExpandKeys.value.includes(props.data[props.id]);
},
set(val) {
let newTableExpandKeys = [...tableExpandKeys.value];
if (!val) {
newTableExpandKeys.splice(newTableExpandKeys.indexOf(props.data[props.id]), 1);
} else {
newTableExpandKeys.push(props.data[props.id]);
}
tableExpandAll.value = false;
tableExpandKeys.value = newTableExpandKeys;
}
});
const slotsData = ref([]);
props.columns.map((value) => {
if (value.customSlot) {
slotsData.value.push(value.customSlot);
}
});
const rowClick = function(data, evt) {
emit("row", data, evt);
};
const rowDoubleClick = function(data, evt) {
emit("row-double", data, evt);
};
const rowContextmenu = function(data, evt) {
emit("row-contextmenu", data, evt);
};
const expandIconType = computed$1(() => {
return isExpand.value ? "layui-icon-subtraction" : "layui-icon-addition";
});
const handleExpand = () => {
isExpand.value = !isExpand.value;
};
const renderCellStyle = (row, column, rowIndex, columnIndex) => {
if (typeof props.cellStyle === "string") {
return props.cellStyle;
}
return props.cellStyle(row, column, rowIndex, columnIndex);
};
const renderCellClassName = (row, column, rowIndex, columnIndex) => {
if (typeof props.cellClassName === "string") {
return props.cellClassName;
}
return props.cellClassName(row, column, rowIndex, columnIndex);
};
const renderRowStyle = (data, index2) => {
if (typeof props.rowStyle === "string") {
return props.rowStyle;
}
return props.rowStyle(data, index2);
};
const renderRowClassName = (data, index2) => {
if (typeof props.rowClassName === "string") {
return props.rowClassName;
}
return props.rowClassName(data, index2);
};
const childrenIndentSize = computed$1(() => props.currentIndentSize + props.indentSize);
const renderFixedStyle = (column, columnIndex) => {
var _a2, _b, _c, _d;
if (column.fixed) {
if (column.fixed == "left") {
var left = 0;
for (var i = 0; i < columnIndex; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "left" && props.tableColumnKeys.includes(props.columns[i].key)) {
left = left + Number((_b = (_a2 = props.columns[i]) == null ? void 0 : _a2.width) == null ? void 0 : _b.replace("px", ""));
}
}
return { left: `${left}px` };
} else {
var right = 0;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right" && props.tableColumnKeys.includes(props.columns[i].key)) {
right = right + Number((_d = (_c = props.columns[i]) == null ? void 0 : _c.width) == null ? void 0 : _d.replace("px", ""));
}
}
return { right: `${right}px` };
}
} else {
var isLast = true;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed == void 0 && props.tableColumnKeys.includes(props.columns[i].key)) {
isLast = false;
}
}
return isLast ? { "border-right": "none" } : {};
}
};
const renderFixedClassName = (column, columnIndex) => {
if (column.fixed) {
if (column.fixed == "left") {
var left = true;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "left" && props.tableColumnKeys.includes(props.columns[i].key)) {
left = false;
}
}
return left ? `layui-table-fixed-left-last` : "";
} else {
var right = true;
for (var i = 0; i < columnIndex; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right" && props.tableColumnKeys.includes(props.columns[i].key)) {
right = false;
}
}
return right ? `layui-table-fixed-right-first` : "";
}
}
};
const spanMethodAttr = (row, column, rowIndex, columnIndex) => {
const attrs = props.spanMethod(row, column, rowIndex, columnIndex);
if (attrs instanceof Array) {
return { rowspan: attrs[0], colspan: attrs[1] };
} else if (attrs instanceof Object) {
return attrs;
} else {
return { rowspan: 1, colspan: 1 };
}
};
const isAutoShow = (row, column, rowIndex, columnIndex) => {
const attrs = spanMethodAttr(row, column, rowIndex, columnIndex);
if (attrs.colspan == 0 && attrs.rowspan == 0) {
return false;
} else {
return true;
}
};
const checkboxProps = props.getCheckboxProps(props.data, props.index);
const radioProps = props.getRadioProps(props.data, props.index);
return (_ctx, _cache) => {
const _component_table_row = resolveComponent("table-row", true);
return openBlock(), createElementBlock(Fragment, null, [
createElementVNode("tr", {
style: normalizeStyle([renderRowStyle(__props.data, __props.index)]),
class: normalizeClass([renderRowClassName(__props.data, __props.index)]),
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => rowClick(__props.data, $event), ["stop"])),
onDblclick: _cache[3] || (_cache[3] = withModifiers(($event) => rowDoubleClick(__props.data, $event), ["stop"])),
onContextmenu: _cache[4] || (_cache[4] = withModifiers(($event) => rowContextmenu(__props.data, $event), ["stop"]))
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, columnIndex) => {
return openBlock(), createElementBlock(Fragment, { key: columnIndex }, [
__props.tableColumnKeys.includes(column.key) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
column.type ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
column.type == "radio" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
isAutoShow(__props.data, column, __props.index, columnIndex) ? (openBlock(), createElementBlock("td", {
key: 0,
class: normalizeClass(["layui-table-cell layui-table-cell-radio", [
renderFixedClassName(column, columnIndex),
renderCellClassName(__props.data, column, __props.index, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]]),
colspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).colspan,
rowspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).rowspan,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex),
renderCellStyle(__props.data, column, __props.index, columnIndex)
])
}, [
__props.expandSpace && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", {
key: 0,
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
}, null, 4)) : createCommentVNode("", true),
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_2$t)) : createCommentVNode("", true),
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 2,
class: "layui-table-cell-expand-icon",
type: unref(expandIconType),
onClick: handleExpand
}, null, 8, ["type"])) : createCommentVNode("", true),
createVNode(_sfc_main$1E, mergeProps({
modelValue: unref(tableSelectedKey),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(tableSelectedKey) ? tableSelectedKey.value = $event : null)
}, unref(radioProps), {
value: __props.data[__props.id]
}), null, 16, ["modelValue", "value"])
], 14, _hoisted_1$w)) : createCommentVNode("", true)
], 64)) : createCommentVNode("", true),
column.type == "checkbox" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
isAutoShow(__props.data, column, __props.index, columnIndex) ? (openBlock(), createElementBlock("td", {
key: 0,
class: normalizeClass(["layui-table-cell layui-table-cell-checkbox", [
renderFixedClassName(column, columnIndex),
renderCellClassName(__props.data, column, __props.index, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]]),
colspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).colspan,
rowspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).rowspan,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex),
renderCellStyle(__props.data, column, __props.index, columnIndex)
])
}, [
__props.expandSpace && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", {
key: 0,
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
}, null, 4)) : createCommentVNode("", true),
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_4$l)) : createCommentVNode("", true),
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 2,
class: "layui-table-cell-expand-icon",
type: unref(expandIconType),
onClick: handleExpand
}, null, 8, ["type"])) : createCommentVNode("", true),
createVNode(_sfc_main$$, mergeProps({
modelValue: unref(tableSelectedKeys),
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(tableSelectedKeys) ? tableSelectedKeys.value = $event : null)
}, unref(checkboxProps), {
value: __props.data[__props.id],
skin: "primary"
}), null, 16, ["modelValue", "value"])
], 14, _hoisted_3$q)) : createCommentVNode("", true)
], 64)) : createCommentVNode("", true),
column.type == "number" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
isAutoShow(__props.data, column, __props.index, columnIndex) ? (openBlock(), createElementBlock("td", {
key: 0,
class: normalizeClass(["layui-table-cell layui-table-cell-number", [
renderFixedClassName(column, columnIndex),
renderCellClassName(__props.data, column, __props.index, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]]),
colspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).colspan,
rowspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).rowspan,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex),
renderCellStyle(__props.data, column, __props.index, columnIndex)
])
}, [
__props.expandSpace && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", {
key: 0,
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
}, null, 4)) : createCommentVNode("", true),
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_6$e)) : createCommentVNode("", true),
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 2,
class: "layui-table-cell-expand-icon",
type: unref(expandIconType),
onClick: handleExpand
}, null, 8, ["type"])) : createCommentVNode("", true),
createTextVNode(" " + toDisplayString$1(__props.index + 1), 1)
2022-12-30 08:13:19 +00:00
], 14, _hoisted_5$h)) : createCommentVNode("", true)
2022-11-15 01:16:55 +00:00
], 64)) : createCommentVNode("", true)
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
column.customSlot ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
isAutoShow(__props.data, column, __props.index, columnIndex) ? (openBlock(), createElementBlock("td", {
key: 0,
class: normalizeClass(["layui-table-cell", [
renderFixedClassName(column, columnIndex),
renderCellClassName(__props.data, column, __props.index, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]]),
colspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).colspan,
rowspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).rowspan,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex),
renderCellStyle(__props.data, column, __props.index, columnIndex)
])
}, [
2022-12-30 08:13:19 +00:00
createElementVNode("div", {
style: normalizeStyle([{ "display": "flex" }, [
{ textAlign: column.align, justifyContent: column.align }
]])
}, [
__props.expandSpace && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", {
key: 0,
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
}, null, 4)) : createCommentVNode("", true),
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_8$a)) : createCommentVNode("", true),
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 2,
class: "layui-table-cell-expand-icon",
type: unref(expandIconType),
onClick: handleExpand
}, null, 8, ["type"])) : createCommentVNode("", true),
column.ellipsisTooltip ? (openBlock(), createBlock(_sfc_main$11, {
key: 3,
isAutoShow: true
}, {
content: withCtx(() => [
renderSlot(_ctx.$slots, column.customSlot, {
data: __props.data,
column
})
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, column.customSlot, {
data: __props.data,
column
})
]),
_: 2
}, 1024)) : renderSlot(_ctx.$slots, column.customSlot, {
key: 4,
data: __props.data,
column
})
], 4)
2022-11-15 01:16:55 +00:00
], 14, _hoisted_7$d)) : createCommentVNode("", true)
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
isAutoShow(__props.data, column, __props.index, columnIndex) ? (openBlock(), createElementBlock("td", {
key: 0,
class: normalizeClass(["layui-table-cell", [
renderFixedClassName(column, columnIndex),
renderCellClassName(__props.data, column, __props.index, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]]),
colspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).colspan,
rowspan: spanMethodAttr(__props.data, column, __props.index, columnIndex).rowspan,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex),
renderCellStyle(__props.data, column, __props.index, columnIndex)
])
}, [
2022-12-30 08:13:19 +00:00
createElementVNode("div", {
style: normalizeStyle([{ "display": "flex" }, [
{ textAlign: column.align, justifyContent: column.align }
]])
}, [
__props.expandSpace && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", {
key: 0,
style: normalizeStyle({ "margin-right": __props.currentIndentSize + "px" })
}, null, 4)) : createCommentVNode("", true),
__props.expandSpace && !__props.data[__props.childrenColumnName] && !unref(slot).expand && columnIndex === __props.expandIndex ? (openBlock(), createElementBlock("span", _hoisted_10$8)) : createCommentVNode("", true),
(unref(slot).expand || __props.data[__props.childrenColumnName]) && columnIndex === __props.expandIndex ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 2,
class: "layui-table-cell-expand-icon",
type: unref(expandIconType),
onClick: handleExpand
}, null, 8, ["type"])) : createCommentVNode("", true),
column.ellipsisTooltip ? (openBlock(), createBlock(_sfc_main$11, {
key: 3,
content: __props.data[column.key],
isAutoShow: true
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(__props.data[column.key]), 1)
]),
_: 2
}, 1032, ["content"])) : (openBlock(), createElementBlock("span", _hoisted_11$8, toDisplayString$1(__props.data[column.key]), 1))
], 4)
2022-11-15 01:16:55 +00:00
], 14, _hoisted_9$8)) : createCommentVNode("", true)
], 64))
], 64))
], 64)) : createCommentVNode("", true)
], 64);
}), 128))
], 38),
unref(slot).expand && unref(isExpand) ? (openBlock(), createElementBlock("tr", _hoisted_12$6, [
createElementVNode("td", {
class: "layui-table-cell",
colspan: __props.columns.length
}, [
renderSlot(_ctx.$slots, "expand", { data: __props.data })
], 8, _hoisted_13$6)
])) : createCommentVNode("", true),
__props.data[__props.childrenColumnName] && unref(isExpand) ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(__props.data[__props.childrenColumnName], (children, childrenIndex) => {
return openBlock(), createBlock(_component_table_row, {
key: childrenIndex,
id: __props.id,
data: children,
index: childrenIndex,
columns: __props.columns,
"indent-size": __props.indentSize,
"current-indent-size": unref(childrenIndentSize),
checkbox: __props.checkbox,
tableColumnKeys: __props.tableColumnKeys,
expandSpace: __props.expandSpace,
expandIndex: __props.expandIndex,
cellStyle: __props.cellStyle,
cellClassName: __props.cellClassName,
rowStyle: __props.rowStyle,
rowClassName: __props.rowClassName,
spanMethod: __props.spanMethod,
defaultExpandAll: __props.defaultExpandAll,
getCheckboxProps: __props.getCheckboxProps,
getRadioProps: __props.getRadioProps,
onRow: rowClick,
onRowDouble: rowDoubleClick,
onRowContextmenu: rowContextmenu,
expandKeys: unref(tableExpandKeys),
"onUpdate:expandKeys": _cache[5] || (_cache[5] = ($event) => isRef(tableExpandKeys) ? tableExpandKeys.value = $event : null),
selectedKeys: unref(tableSelectedKeys),
"onUpdate:selectedKeys": _cache[6] || (_cache[6] = ($event) => isRef(tableSelectedKeys) ? tableSelectedKeys.value = $event : null),
selectedKey: unref(tableSelectedKey),
"onUpdate:selectedKey": _cache[7] || (_cache[7] = ($event) => isRef(tableSelectedKey) ? tableSelectedKey.value = $event : null)
}, createSlots({ _: 2 }, [
renderList(slotsData.value, (name) => {
return {
name,
fn: withCtx((slotProp) => [
renderSlot(_ctx.$slots, name, {
data: slotProp.data,
column: slotProp.column
})
])
};
}),
unref(slot).expand ? {
name: "expand",
fn: withCtx((slotProp) => [
renderSlot(_ctx.$slots, "expand", {
data: slotProp.data,
column: slotProp.column
})
]),
key: "0"
} : void 0
]), 1032, ["id", "data", "index", "columns", "indent-size", "current-indent-size", "checkbox", "tableColumnKeys", "expandSpace", "expandIndex", "cellStyle", "cellClassName", "rowStyle", "rowClassName", "spanMethod", "defaultExpandAll", "getCheckboxProps", "getRadioProps", "expandKeys", "selectedKeys", "selectedKey"]);
}), 128)) : createCommentVNode("", true)
], 64);
};
}
});
var index$j = /* @__PURE__ */ (() => ".layui-laypage{display:inline-block;vertical-align:middle;margin:10px 0;font-size:0}.layui-laypage>a:first-child,.layui-laypage>a:first-child em{border-radius:2px 0 0 2px}.layui-laypage>a:last-child,.layui-laypage>a:last-child em{border-radius:0 2px 2px 0}.layui-laypage>:first-child{margin-left:0!important}.layui-laypage>:last-child{margin-right:0!important}.layui-laypage a,.layui-laypage button,.layui-laypage input,.layui-laypage select,.layui-laypage span{border:1px solid var(--global-neutral-color-3)}.layui-laypage a,.layui-laypage span{display:inline-block;vertical-align:middle;padding:0 15px;height:28px;line-height:28px;margin:0 -1px 5px 0;background-color:#fff;color:#333;font-size:12px}.layui-laypage a:hover{color:var(--global-primary-color)}.layui-laypage-a-red:hover{color:#ff5722!important}.layui-laypage-a-orange:hover{color:#ffb800!important}.layui-laypage-a-green:hover{color:#009688!important}.layui-laypage-a-cyan:hover{color:#2f4056!important}.layui-laypage-a-blue:hover{color:#01aaed!important}.layui-laypage-a-black:hover{color:#000!important}.layui-laypage-a-gray:hover{color:#c2c2c2!important}.layui-laypage em{font-style:normal}.layui-laypage .layui-laypage-spr{color:#999;font-weight:700}.layui-laypage a{text-decoration:none}.layui-laypage .layui-laypage-curr{position:relative}.layui-laypage .layui-laypage-curr em{position:relative;color:#fff}.layui-laypage .layui-laypage-curr .layui-laypage-em{position:absolute;left:-1px;top:-1px;padding:1px;width:100%;height:100%;background-color:var(--global-primary-color)}.layui-laypage-em{border-radius:2px}.layui-laypage-next em,.layui-laypage-prev em{font-family:Sim sun;font-size:16px}.layui-laypage .layui-laypage-count,.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh,.layui-laypage .layui-laypage-skip{margin-left:10px;margin-right:10px;padding:0;border:none}.layui-laypage .layui-laypage-limits,.layui-laypage .layui-laypage-refresh{vertical-align:top}.layui-laypage .layui-laypage-refresh i{font-size:18px;cursor:pointer}.layui-laypage select{height:22px;padding:3px;margin-top:4px;border-radius:2px;cursor:pointer}.layui-laypage .layui-laypage-skip{height:30px;line-height:30px;color:#999}.layui-laypage button,.layui-laypage input{height:30px;line-height:30px;border-radius:2px;vertical-align:top;background-color:#fff;box-sizing:border-box}.layui-laypage input{display:inline-block;width:40px;margin:0 10px;padding:0 3px;text-align:center}.layui-laypage input::-webkit-outer-spin-button,.layui-laypage input::-webkit-inner-spin-button{-webkit-appearance:none}.layui-laypage input:focus,.layui-laypage select:focus{border-color:var(--global-primary-color)!important}.layui-laypage button{margin-left:10px;padding:0 10px;cursor:pointer}\n")();
const _hoisted_1$v = { class: "layui-laypage layui-laypage-default" };
const _hoisted_2$s = {
key: 0,
class: "layui-laypage-count"
};
const _hoisted_3$p = {
key: 0,
class: "layui-laypage-curr"
};
const _hoisted_4$k = ["onClick"];
2022-12-30 08:13:19 +00:00
const _hoisted_5$g = {
2022-11-15 01:16:55 +00:00
key: 2,
class: "layui-laypage-limits"
};
const _hoisted_6$d = ["value"];
const _hoisted_7$c = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-refresh" }, null, -1);
const _hoisted_8$9 = [
_hoisted_7$c
];
const _hoisted_9$7 = {
key: 4,
class: "layui-laypage-skip"
};
const _hoisted_10$7 = ["disabled"];
2022-12-09 08:41:41 +00:00
const _hoisted_11$7 = { key: 5 };
2022-11-15 01:16:55 +00:00
const __default__$D = {
name: "LayPage"
};
const _sfc_main$F = defineComponent({
...__default__$D,
props: {
total: null,
limit: { default: 10 },
theme: { default: "green" },
showPage: { type: Boolean, default: false },
showSkip: { type: Boolean, default: false },
showCount: { type: Boolean, default: false },
showLimit: { type: Boolean, default: true },
showInput: { type: Boolean, default: false },
showRefresh: { type: Boolean, default: false },
pages: { default: 10 },
limits: { default: () => [10, 20, 30, 40, 50] },
2022-12-09 08:41:41 +00:00
modelValue: { default: 1 },
count: null
2022-11-15 01:16:55 +00:00
},
emits: ["update:modelValue", "update:limit", "change"],
setup(__props, { emit }) {
const props = __props;
const { t } = useI18n();
const slots = useSlots();
const maxPage = ref(0);
const limits = ref(props.limits);
const pages = computed$1(() => Math.floor(props.pages / 2));
const currentPage = ref(props.modelValue);
const currentPageShow = ref(currentPage.value);
const inlimit = ref(props.limit);
watch(() => props.limit, () => {
inlimit.value = props.limit;
});
const totalPage = computed$1(() => {
maxPage.value = Math.ceil(props.total / inlimit.value);
let r = [];
let start = maxPage.value <= props.pages ? 1 : currentPage.value > pages.value ? maxPage.value - currentPage.value + 1 < pages.value ? currentPage.value - (pages.value + (pages.value - (maxPage.value - currentPage.value + 1))) : currentPage.value - pages.value : 1;
for (let i = start; ; i++) {
if (r.length >= props.pages || i > maxPage.value) {
break;
}
r.push(i);
}
return r;
});
const prev = () => {
if (currentPage.value === 1) {
return;
}
currentPage.value--;
emit("change", { current: currentPage.value, limit: inlimit.value });
};
const next = () => {
if (currentPage.value === maxPage.value || maxPage.value === 0) {
return;
}
currentPage.value++;
emit("change", { current: currentPage.value, limit: inlimit.value });
};
const jump = (page) => {
currentPage.value = page;
emit("change", { current: currentPage.value, limit: inlimit.value });
};
const jumpPage = () => {
currentPage.value = currentPageShow.value;
emit("change", { current: currentPage.value, limit: inlimit.value });
};
const changelimit = () => {
const maxPage2 = Math.ceil(props.total / inlimit.value);
if (currentPage.value > maxPage2) {
currentPage.value = maxPage2;
}
emit("change", { current: currentPage.value, limit: inlimit.value });
};
const refresh = () => {
emit("change", { current: currentPage.value, limit: inlimit.value });
};
watch(inlimit, () => {
emit("update:limit", inlimit.value);
});
watch(currentPage, () => {
const min = totalPage.value[0];
const max = totalPage.value[totalPage.value.length - 1];
if (currentPage.value > max)
currentPage.value = max;
if (currentPage.value < min)
currentPage.value = min;
currentPageShow.value = currentPage.value;
emit("update:modelValue", currentPage.value);
});
watch(() => props.modelValue, () => {
currentPage.value = props.modelValue;
currentPageShow.value = currentPage.value;
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$v, [
__props.showCount ? (openBlock(), createElementBlock("span", _hoisted_2$s, toDisplayString$1(unref(t)("page.total")) + " " + toDisplayString$1(__props.total) + " " + toDisplayString$1(unref(t)("page.item")) + " " + toDisplayString$1(maxPage.value) + " " + toDisplayString$1(unref(t)("page.page")), 1)) : createCommentVNode("", true),
createElementVNode("a", {
href: "javascript:;",
class: normalizeClass(["layui-laypage-prev", [
currentPage.value === 1 ? "layui-disabled" : "",
__props.theme && currentPage.value !== 1 ? "layui-laypage-a-" + __props.theme : ""
]]),
onClick: _cache[0] || (_cache[0] = ($event) => prev())
}, [
unref(slots).prev ? renderSlot(_ctx.$slots, "prev", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(unref(t)("page.previous")), 1)
], 64))
], 2),
__props.showPage ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(unref(totalPage), (index2) => {
return openBlock(), createElementBlock(Fragment, { key: index2 }, [
index2 === currentPage.value ? (openBlock(), createElementBlock("span", _hoisted_3$p, [
createElementVNode("em", {
class: normalizeClass(["layui-laypage-em", [__props.theme ? "layui-bg-" + __props.theme : ""]])
}, null, 2),
createElementVNode("em", null, toDisplayString$1(index2), 1)
])) : (openBlock(), createElementBlock("a", {
key: 1,
href: "javascript:;",
onClick: ($event) => jump(index2),
class: normalizeClass([__props.theme ? "layui-laypage-a-" + __props.theme : ""])
}, toDisplayString$1(index2), 11, _hoisted_4$k))
], 64);
}), 128)) : createCommentVNode("", true),
createElementVNode("a", {
href: "javascript:;",
class: normalizeClass(["layui-laypage-next", [
currentPage.value === maxPage.value || maxPage.value === 0 ? "layui-disabled" : "",
__props.theme && currentPage.value !== maxPage.value && maxPage.value !== 0 ? "layui-laypage-a-" + __props.theme : ""
]]),
onClick: _cache[1] || (_cache[1] = ($event) => next())
}, [
unref(slots).next ? renderSlot(_ctx.$slots, "next", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(unref(t)("page.next")), 1)
], 64))
], 2),
2022-12-30 08:13:19 +00:00
__props.showLimit ? (openBlock(), createElementBlock("span", _hoisted_5$g, [
2022-11-15 01:16:55 +00:00
withDirectives(createElementVNode("select", {
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => inlimit.value = $event),
onChange: changelimit
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList(limits.value, (val) => {
return openBlock(), createElementBlock("option", {
key: val,
value: val
}, toDisplayString$1(val) + " " + toDisplayString$1(unref(t)("page.item")) + "/" + toDisplayString$1(unref(t)("page.page")), 9, _hoisted_6$d);
}), 128))
], 544), [
[vModelSelect, inlimit.value]
])
])) : createCommentVNode("", true),
__props.showRefresh ? (openBlock(), createElementBlock("a", {
key: 3,
href: "javascript:;",
onClick: refresh,
class: "layui-laypage-refresh"
}, _hoisted_8$9)) : createCommentVNode("", true),
props.showSkip ? (openBlock(), createElementBlock("span", _hoisted_9$7, [
createTextVNode(toDisplayString$1(unref(t)("page.goTo")) + " ", 1),
withDirectives(createElementVNode("input", {
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => currentPageShow.value = $event),
onKeypress: _cache[4] || (_cache[4] = withKeys(($event) => jumpPage(), ["enter"])),
type: "number",
class: "layui-input layui-input-number"
}, null, 544), [
[vModelText, currentPageShow.value]
]),
createTextVNode(toDisplayString$1(unref(t)("page.page")) + " ", 1),
createElementVNode("button", {
type: "button",
class: "layui-laypage-btn",
onClick: _cache[5] || (_cache[5] = ($event) => jumpPage()),
disabled: currentPageShow.value > maxPage.value || currentPageShow.value == currentPage.value
}, toDisplayString$1(unref(t)("page.confirm")), 9, _hoisted_10$7)
2022-12-09 08:41:41 +00:00
])) : createCommentVNode("", true),
__props.count ? (openBlock(), createElementBlock("span", _hoisted_11$7, "\u5171" + toDisplayString$1(__props.count) + "\u6761", 1)) : createCommentVNode("", true)
2022-11-15 01:16:55 +00:00
]);
};
}
});
const __default__$C = {
name: "TablePage"
};
const _sfc_main$E = defineComponent({
...__default__$C,
props: {
showPage: { type: Boolean, default: true },
showSkip: { type: Boolean, default: true },
showLimit: { type: Boolean, default: true },
showCount: { type: Boolean },
showRefresh: { type: Boolean },
current: null,
limits: null,
pages: null,
total: null,
limit: null,
2022-12-09 08:41:41 +00:00
theme: null,
count: null
2022-11-15 01:16:55 +00:00
},
emits: ["update:current", "update:limit", "change"],
setup(__props, { emit }) {
const props = __props;
const current = computed$1({
get() {
return props.current;
},
set(val) {
emit("update:current", val);
}
});
const limit = computed$1({
get() {
return props.limit;
},
set(val) {
emit("update:limit", val);
}
});
const change3 = (pageData) => {
emit("change", pageData);
};
return (_ctx, _cache) => {
return openBlock(), createBlock(_sfc_main$F, {
total: __props.total,
"show-page": __props.showPage,
"show-skip": __props.showSkip,
"show-limit": __props.showLimit,
"show-count": __props.showCount,
"show-refresh": __props.showRefresh,
limits: __props.limits,
theme: __props.theme,
pages: __props.pages,
2022-12-09 08:41:41 +00:00
count: __props.count,
2022-11-15 01:16:55 +00:00
modelValue: unref(current),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(current) ? current.value = $event : null),
limit: unref(limit),
"onUpdate:limit": _cache[1] || (_cache[1] = ($event) => isRef(limit) ? limit.value = $event : null),
onChange: change3
}, {
prev: withCtx(() => [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-left" })
]),
next: withCtx(() => [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-right" })
]),
_: 1
2022-12-09 08:41:41 +00:00
}, 8, ["total", "show-page", "show-skip", "show-limit", "show-count", "show-refresh", "limits", "theme", "pages", "count", "modelValue", "limit"]);
2022-11-15 01:16:55 +00:00
};
}
});
const _hoisted_1$u = /* @__PURE__ */ createElementVNode("table", {
class: "layui-hide",
"lay-filter": "test"
}, null, -1);
const _hoisted_2$r = {
key: 0,
class: "layui-table-tool"
};
const _hoisted_3$o = { class: "layui-table-tool-temp" };
const _hoisted_4$j = {
key: 0,
class: "layui-table-tool-self"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$f = /* @__PURE__ */ createElementVNode("div", {
2022-11-15 01:16:55 +00:00
class: "layui-inline",
title: "\u7B5B\u9009",
"lay-event": ""
}, [
/* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-slider" })
], -1);
const _hoisted_6$c = { class: "layui-table-tool-checkbox" };
const _hoisted_7$b = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-export" }, null, -1);
const _hoisted_8$8 = [
_hoisted_7$b
];
const _hoisted_9$6 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-print" }, null, -1);
const _hoisted_10$6 = [
_hoisted_9$6
];
const _hoisted_11$6 = {
key: 1,
class: "layui-table-box-header"
};
const _hoisted_12$5 = { class: "layui-table-box" };
const _hoisted_13$5 = ["lay-size", "lay-skin"];
const _hoisted_14$3 = ["width"];
const _hoisted_15$2 = ["colspan", "rowspan"];
const _hoisted_16$2 = {
key: 0,
class: "layui-table-sort layui-inline",
"lay-sort": ""
};
const _hoisted_17$2 = ["onClick"];
const _hoisted_18$1 = ["onClick"];
const _hoisted_19$1 = ["lay-size", "lay-skin"];
const _hoisted_20$1 = ["width"];
const _hoisted_21$1 = {
key: 0,
class: "layui-table-total"
};
const _hoisted_22 = ["innerHTML"];
const _hoisted_23 = {
key: 2,
class: "layui-table-loading"
};
const _hoisted_24 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop" }, null, -1);
const _hoisted_25 = [
_hoisted_24
];
const _hoisted_26 = {
key: 0,
class: "layui-table-footer"
};
const _hoisted_27 = {
key: 2,
class: "layui-table-page"
};
const __default__$B = {
name: "LayTable"
};
const _sfc_main$D = defineComponent({
...__default__$B,
props: {
id: { default: "id" },
skin: null,
size: { default: "md" },
page: null,
columns: null,
dataSource: { default: () => [] },
2022-12-30 08:13:19 +00:00
defaultToolbar: { type: [Boolean, Array], default: false },
2022-11-15 01:16:55 +00:00
selectedKey: { default: "" },
selectedKeys: { default: () => [] },
indentSize: { default: 30 },
childrenColumnName: { default: "children" },
height: null,
maxHeight: { default: "auto" },
even: { type: Boolean, default: false },
expandIndex: { default: 0 },
rowClassName: { type: [String, Function], default: "" },
cellClassName: { type: [String, Function], default: "" },
rowStyle: { type: [String, Function], default: "" },
cellStyle: { type: [String, Function], default: "" },
spanMethod: { type: Function, default: () => {
} },
defaultExpandAll: { type: Boolean, default: false },
expandKeys: { default: () => [] },
loading: { type: Boolean, default: false },
getCheckboxProps: { type: Function, default: () => {
} },
getRadioProps: { type: Function, default: () => {
} }
},
emits: [
"change",
"update:expandKeys",
"update:selectedKeys",
"update:selectedKey",
"row-contextmenu",
"row-double",
"row"
],
setup(__props, { emit }) {
const props = __props;
const slot = useSlots();
slot.default && slot.default();
const tableRef = ref();
const s = "";
const allChecked = ref(false);
const hasChecked = ref(false);
const tableDataSource = ref([...props.dataSource]);
const tableColumns = computed$1(() => {
return [...props.columns];
});
const tableHeadColumns = ref([]);
const tableBodyColumns = ref([]);
const getLevel = (arr) => {
let maxLevel = 0;
(function callBack(arr2, level) {
++level;
maxLevel = Math.max(level, maxLevel);
for (let i = 0; i < arr2.length; i++) {
let item = arr2[i];
if (item.children && item.children.length > 0) {
callBack(item.children, level);
} else {
delete item.children;
}
}
})(arr, 0);
return maxLevel;
};
function getLeafCountTree(json) {
if (!json.children || json.children.length == 0) {
json.colspan = 1;
return 1;
} else {
var leafCount = 0;
for (var i = 0; i < json.children.length; i++) {
leafCount = leafCount + getLeafCountTree(json.children[i]);
}
json.colspan = leafCount;
return leafCount;
}
}
const findFindNode = (columns) => {
columns.forEach((column) => {
if (column.children) {
findFindNode(column.children);
} else {
tableBodyColumns.value.push(column);
}
});
};
findFindNode(tableColumns.value);
const tableColumnKeys = ref([]);
const findFindNodes = (columns) => {
columns.forEach((column) => {
if (column.children) {
tableColumnKeys.value.push(column.key);
findFindNodes(column.children);
} else {
if (!column.hide) {
tableColumnKeys.value.push(column.key);
}
}
});
};
findFindNodes(tableColumns.value);
const findFinalNode = (level, columns) => {
columns.forEach((column) => {
if (column.children) {
const colSpan = getLeafCountTree(column);
column.colspan = colSpan;
if (!tableHeadColumns.value[level]) {
tableHeadColumns.value[level] = [];
}
if (column.fixed && !column.width) {
column.type ? column.width = "50px" : column.width = "100px";
}
tableHeadColumns.value[level].push(column);
findFinalNode(level + 1, column.children);
} else {
const rowSpan = getLevel(columns);
column.rowspan = rowSpan;
if (!tableHeadColumns.value[level]) {
tableHeadColumns.value[level] = [];
}
if (column.fixed && !column.width) {
column.type ? column.width = "50px" : column.width = "100px";
}
tableHeadColumns.value[level].push(column);
}
});
};
findFinalNode(0, tableColumns.value);
const tableSelectedKeys = ref([...props.selectedKeys]);
const tableExpandKeys = ref([...props.expandKeys]);
watch(() => props.selectedKeys, () => {
tableSelectedKeys.value = props.selectedKeys;
}, { deep: true });
watch(() => props.expandKeys, () => {
tableExpandKeys.value = props.expandKeys;
}, { deep: true });
const tableSelectedKey = computed$1({
get() {
return props.selectedKey;
},
set(val) {
emit("update:selectedKey", val);
}
});
watch(() => props.dataSource, () => {
tableDataSource.value = [...props.dataSource];
tableSelectedKeys.value = [];
tableSelectedKey.value = s;
}, { deep: true });
const changeAll = (isChecked) => {
if (isChecked) {
const datasources = props.dataSource.filter((item, index2) => {
var _a2;
return !((_a2 = props.getCheckboxProps(item, index2)) == null ? void 0 : _a2.disabled);
});
const ids = datasources.map((item) => {
return item[props.id];
});
tableSelectedKeys.value = [...ids];
} else {
tableSelectedKeys.value = [];
}
};
watch(tableSelectedKeys, () => {
if (tableSelectedKeys.value.length === props.dataSource.length) {
allChecked.value = true;
} else {
allChecked.value = false;
}
if (tableSelectedKeys.value.length > 0) {
hasChecked.value = true;
} else {
hasChecked.value = false;
}
emit("update:selectedKeys", tableSelectedKeys.value);
}, { deep: true, immediate: true });
watch(tableExpandKeys, () => {
emit("update:expandKeys", tableExpandKeys.value);
}, { deep: true, immediate: true });
const change3 = function(page) {
emit("change", page);
};
const rowClick = function(data, evt) {
emit("row", data, evt);
};
const rowDoubleClick = function(data, evt) {
emit("row-double", data, evt);
};
const rowContextmenu = (data, evt) => {
emit("row-contextmenu", data, evt);
};
const print = () => {
let subOutputRankPrint = tableRef.value;
let newContent = subOutputRankPrint.innerHTML;
let oldContent = document.body.innerHTML;
document.body.innerHTML = newContent;
window.print();
window.location.reload();
document.body.innerHTML = oldContent;
};
const exportData = () => {
var tableStr = ``;
for (let tableHeadColumn of tableHeadColumns.value) {
tableStr += "<tr>";
for (let column of tableHeadColumn) {
tableStr += `<td colspan=${column.colspan} rowspan=${column.rowspan}>${column.title}</td>`;
}
tableStr += "</tr>";
}
tableDataSource.value.forEach((item, rowIndex) => {
tableStr += "<tr>";
tableBodyColumns.value.forEach((tableColumn, columnIndex) => {
Object.keys(item).forEach((name) => {
if (tableColumn.key === name) {
const rowColSpan = props.spanMethod(item, tableColumn, rowIndex, columnIndex);
const rowspan = rowColSpan ? rowColSpan[0] : 1;
const colspan = rowColSpan ? rowColSpan[1] : 1;
if (rowspan != 0 && colspan != 0) {
tableStr += `<td colspan=${colspan} rowspan=${rowspan}>${item[name]}</td>`;
}
}
});
});
tableStr += "</tr>";
});
var worksheet = "Sheet1";
var uri = "data:application/vnd.ms-excel;base64,";
var exportTemplate = `<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40">
<head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet>
<x:Name>${worksheet}</x:Name>
<x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet>
</x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]-->
</head>
<body>
<table syle="table-layout: fixed;word-wrap: break-word; word-break: break-all;">${tableStr}</table>
</body>
</html>`;
window.location.href = uri + base64(exportTemplate);
return;
};
function base64(s2) {
return window.btoa(unescape(encodeURIComponent(s2)));
}
const sortTable = (e, key, sort) => {
let currentSort = e.target.parentNode.getAttribute("lay-sort");
if (sort === "desc") {
if (currentSort === sort) {
e.target.parentNode.setAttribute("lay-sort", "");
tableDataSource.value = [...props.dataSource];
} else {
e.target.parentNode.setAttribute("lay-sort", "desc");
tableDataSource.value.sort((x, y) => {
if (x[key] < y[key])
return 1;
else if (x[key] > y[key])
return -1;
else
return 0;
});
}
} else {
if (currentSort === sort) {
e.target.parentNode.setAttribute("lay-sort", "");
tableDataSource.value = [...props.dataSource];
} else {
e.target.parentNode.setAttribute("lay-sort", "asc");
tableDataSource.value.sort((x, y) => {
if (x[key] < y[key])
return -1;
else if (x[key] > y[key])
return 1;
else
return 0;
});
}
}
};
let tableBody = ref(null);
let tableHeader = ref(null);
let tableHeaderTable = ref(null);
const tableBodyEmptyWidth = ref();
let scrollWidthCell = ref(0);
const getScrollWidth = () => {
var _a2, _b, _c;
const clientWidth = ((_a2 = tableBody.value) == null ? void 0 : _a2.clientWidth) || 0;
const offsetWidth = ((_b = tableBody.value) == null ? void 0 : _b.offsetWidth) || 0;
if (clientWidth < offsetWidth) {
scrollWidthCell.value = offsetWidth - clientWidth;
} else {
scrollWidthCell.value = 0;
}
tableBodyEmptyWidth.value = ((_c = tableHeaderTable.value) == null ? void 0 : _c.offsetWidth) + "px";
};
const hasl = ref(false);
const hasr = ref(false);
const classes = computed$1(() => {
return [
hasl.value ? "layui-table-has-fixed-left" : "",
hasr.value ? "layui-table-has-fixed-right" : ""
];
});
watch(() => [props.height, props.maxHeight, props.dataSource], () => {
nextTick(() => {
getScrollWidth();
});
});
onMounted(() => {
var _a2, _b;
getScrollWidth();
getFixedColumn();
(_a2 = tableBody.value) == null ? void 0 : _a2.addEventListener("scroll", () => {
getFixedColumn();
});
(_b = tableBody.value) == null ? void 0 : _b.addEventListener("transitionend", () => {
getScrollWidth();
});
window.onresize = () => {
getScrollWidth();
getFixedColumn();
};
});
const getFixedColumn = () => {
var _a2, _b, _c, _d, _e, _f, _g;
tableHeader.value.scrollLeft = ((_a2 = tableBody.value) == null ? void 0 : _a2.scrollLeft) || 0;
if (((_b = tableBody.value) == null ? void 0 : _b.scrollWidth) > ((_c = tableBody.value) == null ? void 0 : _c.clientWidth)) {
if (((_d = tableBody.value) == null ? void 0 : _d.scrollLeft) == 0) {
hasl.value = false;
hasr.value = true;
} else {
const t = ((_e = tableBody.value) == null ? void 0 : _e.scrollLeft) + ((_f = tableBody.value) == null ? void 0 : _f.offsetWidth) + 2;
const s2 = (_g = tableBody.value) == null ? void 0 : _g.scrollWidth;
if (t > s2) {
hasl.value = true;
hasr.value = false;
} else {
hasl.value = true;
hasr.value = true;
}
}
} else {
hasl.value = false;
hasr.value = false;
}
};
const slotsData = ref([]);
props.columns.map((value) => {
if (value.customSlot) {
slotsData.value.push(value.customSlot);
}
});
const currentIndentSize = ref(0);
const childrenExpandSpace = computed$1(() => {
return props.dataSource.find((value) => {
if (value[props.childrenColumnName]) {
return true;
}
}) != void 0;
});
const renderFixedStyle = (column, columnIndex) => {
var _a2, _b, _c, _d;
if (column.fixed) {
if (column.fixed == "left") {
var left = 0;
for (var i = 0; i < columnIndex; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "left" && tableColumnKeys.value.includes(props.columns[i].key)) {
left = left + Number((_b = (_a2 = props.columns[i]) == null ? void 0 : _a2.width) == null ? void 0 : _b.replace("px", ""));
}
}
return { left: `${left}px` };
} else {
var right = 0;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right" && tableColumnKeys.value.includes(props.columns[i].key)) {
right = right + Number((_d = (_c = props.columns[i]) == null ? void 0 : _c.width) == null ? void 0 : _d.replace("px", ""));
}
}
return { right: `${right}px` };
}
} else {
var isLast = true;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed == void 0 && tableColumnKeys.value.includes(props.columns[i].key)) {
isLast = false;
}
}
return isLast ? { "border-right": "none" } : {};
}
};
2022-12-30 08:13:19 +00:00
const renderHeadFixedStyle = (column, columnIndex, tableHeadColumn) => {
var _a2, _b, _c, _d;
if (column.fixed) {
if (column.fixed == "left") {
var left = 0;
for (var i = 0; i < columnIndex; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "left" && tableColumnKeys.value.includes(props.columns[i].key)) {
left = left + Number((_b = (_a2 = props.columns[i]) == null ? void 0 : _a2.width) == null ? void 0 : _b.replace("px", ""));
}
}
return { left: `${left}px` };
} else {
var right = 0;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right" && tableColumnKeys.value.includes(props.columns[i].key)) {
right = right + Number((_d = (_c = props.columns[i]) == null ? void 0 : _c.width) == null ? void 0 : _d.replace("px", ""));
}
}
return { right: `${right}px` };
}
} else {
var isLast = true;
for (var i = columnIndex + 1; i < tableHeadColumn.length; i++) {
if (tableHeadColumn[i].fixed == void 0 && tableColumnKeys.value.includes(tableHeadColumn[i].key)) {
isLast = false;
}
}
return isLast ? { "border-right": "none" } : {};
}
};
2022-11-15 01:16:55 +00:00
const renderFixedClassName = (column, columnIndex) => {
if (column.fixed) {
if (column.fixed == "left") {
var left = true;
for (var i = columnIndex + 1; i < props.columns.length; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "left" && tableColumnKeys.value.includes(props.columns[i].key)) {
left = false;
}
}
return left ? `layui-table-fixed-left-last` : "";
} else {
var right = true;
for (var i = 0; i < columnIndex; i++) {
if (props.columns[i].fixed && props.columns[i].fixed == "right" && tableColumnKeys.value.includes(props.columns[i].key)) {
right = false;
}
}
return right ? `layui-table-fixed-right-first` : "";
}
}
};
const hasTotalRow = computed$1(() => {
let b = false;
props.columns.forEach((item) => {
if (item.totalRow) {
b = true;
}
});
return b;
});
const renderTotalRowCell = (column) => {
if (column.totalRow) {
if (column.totalRow != true) {
return column.totalRow;
} else {
if (column.totalRowMethod) {
return column.totalRowMethod(column, tableDataSource.value);
} else {
return totalRowMethod(column, tableDataSource.value);
}
}
}
};
const totalRowMethod = (column, dataSource) => {
let total = 0;
dataSource.forEach((item) => {
total = total + Number(item[column.key]);
});
return total;
};
2022-12-30 08:13:19 +00:00
const showToolbar = (toolbarName) => {
if (props.defaultToolbar instanceof Array) {
return props.defaultToolbar.includes(toolbarName);
}
return props.defaultToolbar;
};
const toolbarStyle = (toolbarName) => {
if (props.defaultToolbar instanceof Array) {
return { order: props.defaultToolbar.indexOf(toolbarName) };
}
};
2022-11-15 01:16:55 +00:00
onBeforeUnmount(() => {
window.onresize = null;
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "tableRef",
ref: tableRef
}, [
_hoisted_1$u,
createElementVNode("div", {
class: normalizeClass(["layui-form layui-border-box layui-table-view", unref(classes)])
}, [
__props.defaultToolbar || unref(slot).toolbar ? (openBlock(), createElementBlock("div", _hoisted_2$r, [
createElementVNode("div", _hoisted_3$o, [
renderSlot(_ctx.$slots, "toolbar")
]),
__props.defaultToolbar ? (openBlock(), createElementBlock("div", _hoisted_4$j, [
2022-12-30 08:13:19 +00:00
showToolbar("filter") ? (openBlock(), createBlock(_sfc_main$1y, {
key: 0,
updateAtScroll: "",
style: normalizeStyle(toolbarStyle("filter"))
}, {
2022-11-15 01:16:55 +00:00
content: withCtx(() => [
createElementVNode("div", _hoisted_6$c, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableHeadColumns.value[0], (column) => {
return openBlock(), createBlock(_sfc_main$$, {
modelValue: tableColumnKeys.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tableColumnKeys.value = $event),
skin: "primary",
disabled: column.children,
key: column.key,
value: column.key
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(column.title), 1)
]),
_: 2
}, 1032, ["modelValue", "disabled", "value"]);
}), 128))
])
]),
default: withCtx(() => [
2022-12-30 08:13:19 +00:00
_hoisted_5$f
2022-11-15 01:16:55 +00:00
]),
_: 1
2022-12-30 08:13:19 +00:00
}, 8, ["style"])) : createCommentVNode("", true),
showToolbar("export") ? (openBlock(), createElementBlock("div", {
key: 1,
2022-11-15 01:16:55 +00:00
class: "layui-inline",
title: "\u5BFC\u51FA",
"lay-event": "",
2022-12-30 08:13:19 +00:00
style: normalizeStyle(toolbarStyle("export")),
2022-11-15 01:16:55 +00:00
onClick: _cache[1] || (_cache[1] = ($event) => exportData())
2022-12-30 08:13:19 +00:00
}, _hoisted_8$8, 4)) : createCommentVNode("", true),
showToolbar("print") ? (openBlock(), createElementBlock("div", {
key: 2,
style: normalizeStyle(toolbarStyle("print")),
2022-11-15 01:16:55 +00:00
class: "layui-inline",
title: "\u6253\u5370",
"lay-event": "",
onClick: _cache[2] || (_cache[2] = ($event) => print())
2022-12-30 08:13:19 +00:00
}, _hoisted_10$6, 4)) : createCommentVNode("", true)
2022-11-15 01:16:55 +00:00
])) : createCommentVNode("", true)
])) : createCommentVNode("", true),
unref(slot).header ? (openBlock(), createElementBlock("div", _hoisted_11$6, [
renderSlot(_ctx.$slots, "header")
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_12$5, [
createElementVNode("div", {
class: "layui-table-header",
style: normalizeStyle([{ "padding-right": `${unref(scrollWidthCell)}px` }])
}, [
createElementVNode("div", {
class: "layui-table-header-wrapper",
ref_key: "tableHeader",
ref: tableHeader
}, [
createElementVNode("table", {
class: "layui-table",
"lay-size": __props.size,
"lay-skin": __props.skin,
ref_key: "tableHeaderTable",
ref: tableHeaderTable
}, [
createElementVNode("colgroup", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableBodyColumns.value, (column) => {
return openBlock(), createElementBlock(Fragment, { key: column }, [
tableColumnKeys.value.includes(column.key) ? (openBlock(), createElementBlock("col", {
key: 0,
width: column.width,
style: normalizeStyle({
minWidth: column.minWidth ? column.minWidth : "50px"
})
}, null, 12, _hoisted_14$3)) : createCommentVNode("", true)
], 64);
}), 128))
]),
createElementVNode("thead", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableHeadColumns.value, (tableHeadColumn, tableHeadColumnIndex) => {
return openBlock(), createElementBlock("tr", { key: tableHeadColumnIndex }, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableHeadColumn, (column, columnIndex) => {
return openBlock(), createElementBlock(Fragment, { key: column }, [
tableColumnKeys.value.includes(column.key) ? (openBlock(), createElementBlock("th", {
key: 0,
colspan: column.colspan,
rowspan: column.rowspan,
class: normalizeClass(["layui-table-cell", [
renderFixedClassName(column, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : "",
column.type == "checkbox" ? "layui-table-cell-checkbox" : "",
column.type == "radio" ? "layui-table-cell-radio" : "",
column.type == "number" ? "layui-table-cell-number" : ""
]]),
style: normalizeStyle([
{
textAlign: column.align
},
2022-12-30 08:13:19 +00:00
renderHeadFixedStyle(column, columnIndex, tableHeadColumn)
2022-11-15 01:16:55 +00:00
])
}, [
column.type == "checkbox" ? (openBlock(), createBlock(_sfc_main$$, {
key: 0,
modelValue: hasChecked.value,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => hasChecked.value = $event),
"is-indeterminate": !allChecked.value,
skin: "primary",
value: "all",
onChange: changeAll
}, null, 8, ["modelValue", "is-indeterminate"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createElementVNode("span", null, [
column.titleSlot ? renderSlot(_ctx.$slots, column.titleSlot, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(column.title), 1)
], 64))
]),
column.sort ? (openBlock(), createElementBlock("span", _hoisted_16$2, [
createElementVNode("i", {
onClick: withModifiers(($event) => sortTable($event, column.key, "asc"), ["stop"]),
class: "layui-edge layui-table-sort-asc",
title: "\u5347\u5E8F"
}, null, 8, _hoisted_17$2),
createElementVNode("i", {
onClick: withModifiers(($event) => sortTable($event, column.key, "desc"), ["stop"]),
class: "layui-edge layui-table-sort-desc",
title: "\u964D\u5E8F"
}, null, 8, _hoisted_18$1)
])) : createCommentVNode("", true)
], 64))
], 14, _hoisted_15$2)) : createCommentVNode("", true)
], 64);
}), 128))
]);
}), 128))
])
], 8, _hoisted_13$5)
], 512)
], 4),
createElementVNode("div", {
class: "layui-table-body layui-table-main",
style: normalizeStyle({ height: __props.height, maxHeight: __props.maxHeight }),
ref_key: "tableBody",
ref: tableBody
}, [
tableDataSource.value.length > 0 && __props.loading == false ? (openBlock(), createElementBlock("table", {
key: 0,
class: normalizeClass(["layui-table", { "layui-table-even": props.even }]),
"lay-size": __props.size,
"lay-skin": __props.skin
}, [
createElementVNode("colgroup", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableBodyColumns.value, (column, columnIndex) => {
return openBlock(), createElementBlock(Fragment, { key: columnIndex }, [
tableColumnKeys.value.includes(column.key) ? (openBlock(), createElementBlock("col", {
key: 0,
width: column.width,
style: normalizeStyle({
minWidth: column.minWidth ? column.minWidth : "50px"
})
}, null, 12, _hoisted_20$1)) : createCommentVNode("", true)
], 64);
}), 128))
]),
createElementVNode("tbody", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(tableDataSource.value, (children, index2) => {
return openBlock(), createBlock(_sfc_main$G, {
key: index2,
id: __props.id,
index: index2,
data: children,
columns: tableBodyColumns.value,
"indent-size": __props.indentSize,
currentIndentSize: currentIndentSize.value,
tableColumnKeys: tableColumnKeys.value,
expandSpace: unref(childrenExpandSpace),
expandIndex: __props.expandIndex,
cellStyle: __props.cellStyle,
cellClassName: __props.cellClassName,
rowStyle: __props.rowStyle,
rowClassName: __props.rowClassName,
spanMethod: __props.spanMethod,
defaultExpandAll: __props.defaultExpandAll,
getCheckboxProps: __props.getCheckboxProps,
getRadioProps: __props.getRadioProps,
expandKeys: tableExpandKeys.value,
"onUpdate:expandKeys": _cache[4] || (_cache[4] = ($event) => tableExpandKeys.value = $event),
selectedKeys: tableSelectedKeys.value,
"onUpdate:selectedKeys": _cache[5] || (_cache[5] = ($event) => tableSelectedKeys.value = $event),
selectedKey: unref(tableSelectedKey),
"onUpdate:selectedKey": _cache[6] || (_cache[6] = ($event) => isRef(tableSelectedKey) ? tableSelectedKey.value = $event : null),
onRow: rowClick,
onRowDouble: rowDoubleClick,
onRowContextmenu: rowContextmenu
}, createSlots({ _: 2 }, [
renderList(slotsData.value, (name) => {
return {
name,
fn: withCtx(({ data }) => [
renderSlot(_ctx.$slots, name, { data })
])
};
}),
unref(slot).expand ? {
name: "expand",
fn: withCtx(({ data }) => [
renderSlot(_ctx.$slots, "expand", { data })
]),
key: "0"
} : void 0
]), 1032, ["id", "index", "data", "columns", "indent-size", "currentIndentSize", "tableColumnKeys", "expandSpace", "expandIndex", "cellStyle", "cellClassName", "rowStyle", "rowClassName", "spanMethod", "defaultExpandAll", "getCheckboxProps", "getRadioProps", "expandKeys", "selectedKeys", "selectedKey"]);
}), 128)),
unref(hasTotalRow) ? (openBlock(), createElementBlock("tr", _hoisted_21$1, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.columns, (column, columnIndex) => {
return openBlock(), createElementBlock(Fragment, { key: columnIndex }, [
tableColumnKeys.value.includes(column.key) ? (openBlock(), createElementBlock("td", {
key: 0,
style: normalizeStyle([
{
textAlign: column.align,
whiteSpace: column.ellipsisTooltip ? "nowrap" : "normal"
},
renderFixedStyle(column, columnIndex)
]),
class: normalizeClass([
"layui-table-cell",
renderFixedClassName(column, columnIndex),
column.fixed ? `layui-table-fixed-${column.fixed}` : ""
]),
innerHTML: renderTotalRowCell(column)
}, null, 14, _hoisted_22)) : createCommentVNode("", true)
], 64);
}), 128))
])) : createCommentVNode("", true)
])
], 10, _hoisted_19$1)) : createCommentVNode("", true),
tableDataSource.value.length == 0 && __props.loading == false ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createVNode(_sfc_main$R),
createElementVNode("div", {
style: normalizeStyle({ width: tableBodyEmptyWidth.value })
}, null, 4)
], 64)) : createCommentVNode("", true),
__props.loading == true ? (openBlock(), createElementBlock("div", _hoisted_23, _hoisted_25)) : createCommentVNode("", true)
], 4),
unref(slot).footer ? (openBlock(), createElementBlock("div", _hoisted_26, [
renderSlot(_ctx.$slots, "footer")
])) : createCommentVNode("", true)
]),
__props.page && __props.page.total > 0 ? (openBlock(), createElementBlock("div", _hoisted_27, [
createVNode(_sfc_main$E, {
total: __props.page.total,
pages: __props.page.pages,
theme: __props.page.theme,
limits: __props.page.limits,
showSkip: __props.page.showSkip,
"show-page": __props.page.showPage,
showRefresh: __props.page.showRefresh,
showLimit: __props.page.showLimit,
showCount: __props.page.showCount,
2022-12-09 08:41:41 +00:00
count: __props.page.count,
2022-11-15 01:16:55 +00:00
current: __props.page.current,
"onUpdate:current": _cache[7] || (_cache[7] = ($event) => __props.page.current = $event),
limit: __props.page.limit,
"onUpdate:limit": _cache[8] || (_cache[8] = ($event) => __props.page.limit = $event),
onChange: change3
2022-12-09 08:41:41 +00:00
}, null, 8, ["total", "pages", "theme", "limits", "showSkip", "show-page", "showRefresh", "showLimit", "showCount", "count", "current", "limit"])
2022-11-15 01:16:55 +00:00
])) : createCommentVNode("", true)
], 2)
], 512);
};
}
});
const component$u = withInstall(_sfc_main$D);
const component$t = withInstall(_sfc_main$F);
2022-12-30 08:13:19 +00:00
var index$i = /* @__PURE__ */ (() => ":root{--button-primary-text-color: #fff;--button-primary-background-color: var(--global-primary-color);--button-primary-border-color: var(--global-primary-color);--button-normal-text-color: #fff;--button-normal-background-color: var(--global-normal-color);--button-normal-border-color: var(--global-normal-color);--button-warm-text-color: #fff;--button-warm-background-color: var(--global-warm-color);--button-warm-border-color: var(--global-warm-color);--button-danger-text-color: #fff;--button-danger-background-color: var(--global-danger-color);--button-danger-border-color: var(--global-danger-color);--button-border-radius: var(--global-border-radius);--button-border-color: var(--global-neutral-color-6);--button-background-color: 0 0;--button-text-color: #666}.layui-btn{height:38px;line-height:36px;padding:0 18px;font-size:14px;text-align:center;white-space:nowrap;color:var(--button-text-color);background:var(--button-background-color);border-radius:var(--button-border-radius);border-color:var(--button-border-color);border-width:1px;border-style:solid;cursor:pointer}.layui-btn-primary{color:var(--button-primary-text-color);background-color:var(--button-primary-background-color);border-color:var(--button-primary-border-color)}.layui-btn-normal{color:var(--button-normal-text-color);background-color:var(--button-normal-background-color);border-color:var(--button-normal-border-color)}.layui-btn-warm{color:var(--button-warm-text-color);background-color:var(--button-warm-background-color);border-color:var(--button-warm-border-color)}.layui-btn-danger{color:var(--button-danger-text-color);background-color:var(--button-danger-background-color);border-color:var(--button-danger-border-color)}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80)}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-fluid{width:100%}.layui-btn-radius{border-radius:100px}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn+.layui-btn{margin-left:10px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\\ ;vertical-align:bottom}.layui-checkbox[size=lg]{height:18px;line-height:18px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:18px;height:18px;font-size:16px}.layui-checkbox[size=lg] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:18px;line-height:18px;font-size:16px}.layui-checkbox[size=md]{height:16px;line-height:16px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:16px;height:16px;font-size:14px}.layui-checkbox[size=md] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:16px;line-height:16px;font-size:14px}.layui-checkbox[size=sm]{height:14px;line-height:14px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:14px;height:14px;font-size:12px}.layui-checkbox[size=sm] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:14px;line-height:14px;font-size:12px}.layui-checkbox[size=xs]{height:12px;line-height:12px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-icon{width:12px;height:12px;font-size:10px}.layui-checkbox[size=xs] .layui-form-checkbox[lay-skin=primary] .layui-checkbox-label{height:12px;line-height:12px;font-size:10px}.layui-checkbox input[type=checkbox]{display:none}.layui-form-checkbox{position:relative;height:30px;line-height:30px;margin-right:10px;padding-right:30px;cursor:pointer;font-size:0;-webkit-transition:.1s linear;transition:.1s linear;box-sizing:border-box}.layui-form-checkbox span{padding:0 10px;height:100%;font-size:14px;border-radius:2px 0 0 2px;background-color:var(--global-neutral-color-6);color:
2022-11-15 01:16:55 +00:00
const _hoisted_1$t = { class: "layui-transfer layui-form layui-border-box" };
const _hoisted_2$q = { class: "layui-transfer-header" };
const _hoisted_3$n = {
key: 0,
class: "layui-transfer-search"
};
const _hoisted_4$i = { class: "layui-transfer-data" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$e = {
2022-11-15 01:16:55 +00:00
key: 1,
class: "layui-transfer-footer"
};
const _hoisted_6$b = { class: "layui-transfer-active" };
const _hoisted_7$a = { class: "layui-transfer-button-group" };
const _hoisted_8$7 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-next" }, null, -1);
const _hoisted_9$5 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-icon-prev" }, null, -1);
const _hoisted_10$5 = { class: "layui-transfer-header" };
const _hoisted_11$5 = {
key: 0,
class: "layui-transfer-search"
};
const _hoisted_12$4 = { class: "layui-transfer-data" };
const _hoisted_13$4 = {
key: 1,
class: "layui-transfer-footer"
};
const __default__$A = {
name: "LayTransfer"
};
const _sfc_main$C = defineComponent({
...__default__$A,
props: {
id: { default: "id" },
title: { default: () => ["\u4E3B\u5217\u8868", "\u526F\u5217\u8868"] },
width: { default: "200px" },
height: { default: "360px" },
showSearch: { default: false },
dataSource: { default: () => [] },
modelValue: { default: () => [] }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit: emits }) {
const props = __props;
const slots = useSlots();
const leftDataSource = ref([]);
const rightDataSource = ref([]);
const _leftDataSource = ref([]);
const _rightDataSource = ref([]);
const leftSelectedKeys = ref([]);
const rightSelectedKeys = ref([]);
const allLeftChecked = ref(false);
const allRightChecked = ref(false);
const hasLeftChecked = ref(false);
const hasRightChecked = ref(false);
const allLeftChange = (isChecked) => {
if (isChecked) {
const datasources = leftDataSource.value.filter((item) => {
return !item.disabled;
});
const ids = datasources.map((item) => {
return item[props.id];
});
leftSelectedKeys.value = [...ids];
} else {
leftSelectedKeys.value = [];
}
};
watch(() => [props.modelValue, props.dataSource], () => {
let targetDataSource = [];
props.dataSource.forEach((ds) => {
if (props.modelValue.includes(ds[props.id])) {
targetDataSource.push(ds);
}
});
leftDataSource.value = props.dataSource.filter((item) => !props.modelValue.includes(item[props.id]));
_leftDataSource.value = props.dataSource.filter((item) => !props.modelValue.includes(item[props.id]));
rightDataSource.value = [...targetDataSource];
_rightDataSource.value = [...targetDataSource];
}, { immediate: true });
watch(leftSelectedKeys, () => {
if (leftDataSource.value.length === leftSelectedKeys.value.length && leftDataSource.value.length != 0) {
allLeftChecked.value = true;
} else {
allLeftChecked.value = false;
}
if (leftSelectedKeys.value.length > 0 && leftDataSource.value.length != 0) {
hasLeftChecked.value = true;
} else {
hasLeftChecked.value = false;
}
}, { deep: true });
const allRightChange = (checked) => {
if (checked) {
const datasources = rightDataSource.value.filter((item) => {
return !item.disabled;
});
const ids = datasources.map((item) => {
return item[props.id];
});
rightSelectedKeys.value = [...ids];
} else {
rightSelectedKeys.value = [];
}
};
watch(rightSelectedKeys, () => {
if (rightDataSource.value.length === rightSelectedKeys.value.length && rightDataSource.value.length > 0) {
allRightChecked.value = true;
} else {
allRightChecked.value = false;
}
if (rightSelectedKeys.value.length > 0 && rightDataSource.value.length != 0) {
hasRightChecked.value = true;
} else {
hasRightChecked.value = false;
}
}, { deep: true });
const add2 = () => {
if (leftSelectedKeys.value.length === 0) {
return;
}
let targetKeys = [];
leftDataSource.value.forEach((item) => {
if (leftSelectedKeys.value.indexOf(item[props.id]) != -1) {
targetKeys.push(item[props.id]);
}
});
rightDataSource.value.forEach((item) => {
targetKeys.push(item[props.id]);
});
emits("change", targetKeys);
emits("update:modelValue", targetKeys);
leftSelectedKeys.value = [];
};
const remove = () => {
if (rightSelectedKeys.value.length === 0) {
return;
}
let targetKeys = [];
rightDataSource.value.forEach((item) => {
if (rightSelectedKeys.value.indexOf(item[props.id]) == -1) {
targetKeys.push(item[props.id]);
}
});
emits("change", targetKeys);
emits("update:modelValue", targetKeys);
rightSelectedKeys.value = [];
};
const searchLeft = (e) => {
if (e === "") {
leftDataSource.value = _leftDataSource.value;
}
leftDataSource.value = _leftDataSource.value.filter((item) => {
if (item.title.indexOf(e) != -1) {
return item;
}
});
};
const searchRight = (e) => {
if (e === "") {
rightDataSource.value = _rightDataSource.value;
}
rightDataSource.value = _rightDataSource.value.filter((item) => {
if (item.title.indexOf(e) != -1) {
return item;
}
});
};
const boxStyle = computed$1(() => {
return {
width: props.width,
height: props.height
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
createElementVNode("div", _hoisted_1$t, [
createElementVNode("div", {
class: "layui-transfer-box",
style: normalizeStyle(unref(boxStyle))
}, [
createElementVNode("div", _hoisted_2$q, [
createVNode(_sfc_main$$, {
modelValue: hasLeftChecked.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => hasLeftChecked.value = $event),
"is-indeterminate": !allLeftChecked.value,
skin: "primary",
value: "all",
onChange: allLeftChange
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(__props.title[0]), 1)
]),
_: 1
}, 8, ["modelValue", "is-indeterminate"])
]),
__props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_3$n, [
createVNode(_sfc_main$1v, {
"prefix-icon": "layui-icon-search",
onInput: searchLeft,
placeholder: "\u5173\u952E\u8BCD\u641C\u7D22"
})
])) : createCommentVNode("", true),
createElementVNode("ul", _hoisted_4$i, [
(openBlock(true), createElementBlock(Fragment, null, renderList(leftDataSource.value, (dataSource) => {
return openBlock(), createElementBlock("li", { key: dataSource }, [
createVNode(_sfc_main$$, {
modelValue: leftSelectedKeys.value,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => leftSelectedKeys.value = $event),
skin: "primary",
disabled: dataSource.disabled,
value: dataSource[__props.id]
}, {
default: withCtx(() => [
unref(slots).item ? renderSlot(_ctx.$slots, "item", {
key: 0,
data: dataSource
}) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(dataSource.title), 1)
], 64))
]),
_: 2
}, 1032, ["modelValue", "disabled", "value"])
]);
}), 128))
]),
2022-12-30 08:13:19 +00:00
unref(slots).leftFooter ? (openBlock(), createElementBlock("div", _hoisted_5$e, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "leftFooter")
])) : createCommentVNode("", true)
], 4),
createElementVNode("div", _hoisted_6$b, [
createElementVNode("div", _hoisted_7$a, [
createVNode(_sfc_main$1C, {
type: "primary",
disabled: leftSelectedKeys.value.length == 0,
onClick: add2
}, {
default: withCtx(() => [
_hoisted_8$7
]),
_: 1
}, 8, ["disabled"]),
createVNode(_sfc_main$1C, {
type: "primary",
disabled: rightSelectedKeys.value.length == 0,
onClick: remove
}, {
default: withCtx(() => [
_hoisted_9$5
]),
_: 1
}, 8, ["disabled"])
])
]),
createElementVNode("div", {
class: "layui-transfer-box",
style: normalizeStyle(unref(boxStyle))
}, [
createElementVNode("div", _hoisted_10$5, [
createVNode(_sfc_main$$, {
modelValue: hasRightChecked.value,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => hasRightChecked.value = $event),
"is-indeterminate": !allRightChecked.value,
skin: "primary",
value: "all",
onChange: allRightChange
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(__props.title[1]), 1)
]),
_: 1
}, 8, ["modelValue", "is-indeterminate"])
]),
__props.showSearch ? (openBlock(), createElementBlock("div", _hoisted_11$5, [
createVNode(_sfc_main$1v, {
"prefix-icon": "layui-icon-search",
onInput: searchRight,
placeholder: "\u5173\u952E\u8BCD\u641C\u7D22"
})
])) : createCommentVNode("", true),
createElementVNode("ul", _hoisted_12$4, [
(openBlock(true), createElementBlock(Fragment, null, renderList(rightDataSource.value, (dataSource) => {
return openBlock(), createElementBlock("li", { key: dataSource }, [
createVNode(_sfc_main$$, {
skin: "primary",
modelValue: rightSelectedKeys.value,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => rightSelectedKeys.value = $event),
disabled: dataSource.disabled,
value: dataSource[__props.id]
}, {
default: withCtx(() => [
unref(slots).item ? renderSlot(_ctx.$slots, "item", {
key: 0,
data: dataSource
}) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(dataSource.title), 1)
], 64))
]),
_: 2
}, 1032, ["modelValue", "disabled", "value"])
]);
}), 128))
]),
unref(slots).rightFooter ? (openBlock(), createElementBlock("div", _hoisted_13$4, [
renderSlot(_ctx.$slots, "rightFooter")
])) : createCommentVNode("", true)
], 4)
])
]);
};
}
});
const component$s = withInstall(_sfc_main$C);
var index$h = /* @__PURE__ */ (() => '.layui-popper{position:fixed;padding:10px;border-radius:3px;word-wrap:break-word;min-width:12px;min-height:12px;font-size:14px;box-sizing:border-box;box-shadow:0 2px 12px #00000026;background-color:#fff;color:#3a3a3a;border:1px solid #cecece;max-width:300px;z-index:99999}.layui-popper[position=top]{margin-bottom:6px}.layui-popper[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#cecece}.layui-popper[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#fff}.layui-popper[position=bottom]{margin-top:6px}.layui-popper[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#cecece}.layui-popper[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#fff}.layui-popper[position=right]{margin-left:6px}.layui-popper[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#cecece}.layui-popper[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#fff}.layui-popper[position=left]{margin-right:6px}.layui-popper[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#cecece}.layui-popper[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#fff}.layui-popper[position=top] .layui-popper-arrow,.layui-popper[position=bottom] .layui-popper-arrow{left:-moz-calc(44%);left:-webkit-calc(44%);left:calc(50% - 6px)}.layui-popper[position=left] .layui-popper-arrow,.layui-popper[position=right] .layui-popper-arrow{top:-moz-calc(44%);top:-webkit-calc(44%);top:calc(50% - 6px)}.layui-popper:after{content:" ";position:absolute;display:block}.layui-popper[position=top]:after{bottom:-7px;left:0;width:100%;height:7px}.layui-popper[position=bottom]:after{top:-7px;left:0;width:100%;height:7px}.layui-popper[position=left]:after{right:-7px;bottom:0;height:100%;width:7px}.layui-popper[position=right]:after{left:-7px;bottom:0;height:100%;width:7px}.layui-popper .layui-popper-arrow,.layui-popper .layui-popper-arrow:after{position:absolute;display:block;width:0;height:0;border-width:6px;border-style:solid;border-color:transparent}.layui-popper .layui-popper-arrow:after{content:" "}.layui-popper.layui-dark{background-color:#353535;color:#fff;border:1px solid #353535}.layui-popper.layui-dark[position=top]{margin-bottom:6px}.layui-popper.layui-dark[position=top] .layui-popper-arrow{bottom:-6px;border-bottom-width:0;border-top-color:#353535}.layui-popper.layui-dark[position=top] .layui-popper-arrow:after{bottom:1px;border-bottom-width:0;margin-left:-6px;border-top-color:#353535}.layui-popper.layui-dark[position=bottom]{margin-top:6px}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow{top:-6px;border-top-width:0;border-bottom-color:#353535}.layui-popper.layui-dark[position=bottom] .layui-popper-arrow:after{top:1px;border-top-width:0;margin-left:-6px;border-bottom-color:#353535}.layui-popper.layui-dark[position=right]{margin-left:6px}.layui-popper.layui-dark[position=right] .layui-popper-arrow{left:-6px;border-left-width:0;border-right-color:#353535}.layui-popper.layui-dark[position=right] .layui-popper-arrow:after{left:1px;border-left-width:0;margin-top:-6px;border-right-color:#353535}.layui-popper.layui-dark[position=left]{margin-right:6px}.layui-popper.layui-dark[position=left] .layui-popper-arrow{right:-6px;border-right-width:0;border-left-color:#353535}.layui-popper.layui-dark[position=left] .layui-popper-arrow:after{right:1px;border-right-width:0;margin-top:-6px;border-left-color:#353535}.layui-slider-v{width:100%;height:18px;margin-bottom:8px}.layui-slider-track-v{width:100%;height:16px;position:relative;cursor:pointer;z-index:30}.layui-slider-btn-v{width:12px;height:12px;background-color:#fff;position:absolute;border:2px solid var(--global-primary-color);border-radius:50%;cursor:pointer;left:0%;z-index:2}.layui-slider-rate-v{width:0%;height:4px;position:absolute;top:6px;left:0;b
const traps = {
mousemoveoutside: /* @__PURE__ */ new WeakMap(),
clickoutside: /* @__PURE__ */ new WeakMap()
};
function createTrapHandler(name, el, originalHandler) {
if (name === "mousemoveoutside") {
const moveHandler = (e) => {
if (el.contains(e.target))
return;
originalHandler(e);
};
return {
mousemove: moveHandler,
touchstart: moveHandler
};
} else if (name === "clickoutside") {
let mouseDownOutside = false;
const downHandler = (e) => {
mouseDownOutside = !el.contains(e.target);
};
const upHanlder = (e) => {
if (!mouseDownOutside)
return;
if (el.contains(e.target))
return;
originalHandler(e);
};
return {
mousedown: downHandler,
mouseup: upHanlder,
touchstart: downHandler,
touchend: upHanlder
};
}
console.error(`[evtd/create-trap-handler]: name \`${name}\` is invalid. This could be a bug of evtd.`);
return {};
}
function ensureTrapHandlers(name, el, handler) {
const handlers2 = traps[name];
let elHandlers = handlers2.get(el);
if (elHandlers === void 0) {
handlers2.set(el, elHandlers = /* @__PURE__ */ new WeakMap());
}
let trapHandler = elHandlers.get(handler);
if (trapHandler === void 0) {
elHandlers.set(handler, trapHandler = createTrapHandler(name, el, handler));
}
return trapHandler;
}
function trapOn(name, el, handler, options) {
if (name === "mousemoveoutside" || name === "clickoutside") {
const trapHandlers = ensureTrapHandlers(name, el, handler);
Object.keys(trapHandlers).forEach((key) => {
on(key, document, trapHandlers[key], options);
});
return true;
}
return false;
}
function trapOff(name, el, handler, options) {
if (name === "mousemoveoutside" || name === "clickoutside") {
const trapHandlers = ensureTrapHandlers(name, el, handler);
Object.keys(trapHandlers).forEach((key) => {
off(key, document, trapHandlers[key], options);
});
return true;
}
return false;
}
function createDelegate() {
if (typeof window === "undefined") {
return {
on: () => {
},
off: () => {
}
};
}
const propagationStopped = /* @__PURE__ */ new WeakMap();
const immediatePropagationStopped = /* @__PURE__ */ new WeakMap();
function trackPropagation() {
propagationStopped.set(this, true);
}
function trackImmediate() {
propagationStopped.set(this, true);
immediatePropagationStopped.set(this, true);
}
function spy(event, propName, fn) {
const source = event[propName];
event[propName] = function() {
fn.apply(event, arguments);
return source.apply(event, arguments);
};
return event;
}
function unspy(event, propName) {
event[propName] = Event.prototype[propName];
}
const currentTargets = /* @__PURE__ */ new WeakMap();
const currentTargetDescriptor = Object.getOwnPropertyDescriptor(Event.prototype, "currentTarget");
function getCurrentTarget() {
var _a2;
return (_a2 = currentTargets.get(this)) !== null && _a2 !== void 0 ? _a2 : null;
}
function defineCurrentTarget(event, getter) {
if (currentTargetDescriptor === void 0)
return;
Object.defineProperty(event, "currentTarget", {
configurable: true,
enumerable: true,
get: getter !== null && getter !== void 0 ? getter : currentTargetDescriptor.get
});
}
const phaseToTypeToElToHandlers = {
bubble: {},
capture: {}
};
const typeToWindowEventHandlers = {};
function createUnifiedHandler() {
const delegeteHandler = function(e) {
const { type: type4, eventPhase, target, bubbles } = e;
if (eventPhase === 2)
return;
const phase = eventPhase === 1 ? "capture" : "bubble";
let cursor = target;
const path = [];
while (true) {
if (cursor === null)
cursor = window;
path.push(cursor);
if (cursor === window) {
break;
}
cursor = cursor.parentNode || null;
}
const captureElToHandlers = phaseToTypeToElToHandlers.capture[type4];
const bubbleElToHandlers = phaseToTypeToElToHandlers.bubble[type4];
spy(e, "stopPropagation", trackPropagation);
spy(e, "stopImmediatePropagation", trackImmediate);
defineCurrentTarget(e, getCurrentTarget);
if (phase === "capture") {
if (captureElToHandlers === void 0)
return;
for (let i = path.length - 1; i >= 0; --i) {
if (propagationStopped.has(e))
break;
const target2 = path[i];
const handlers2 = captureElToHandlers.get(target2);
if (handlers2 !== void 0) {
currentTargets.set(e, target2);
for (const handler of handlers2) {
if (immediatePropagationStopped.has(e))
break;
handler(e);
}
}
if (i === 0 && !bubbles && bubbleElToHandlers !== void 0) {
const bubbleHandlers = bubbleElToHandlers.get(target2);
if (bubbleHandlers !== void 0) {
for (const handler of bubbleHandlers) {
if (immediatePropagationStopped.has(e))
break;
handler(e);
}
}
}
}
} else if (phase === "bubble") {
if (bubbleElToHandlers === void 0)
return;
for (let i = 0; i < path.length; ++i) {
if (propagationStopped.has(e))
break;
const target2 = path[i];
const handlers2 = bubbleElToHandlers.get(target2);
if (handlers2 !== void 0) {
currentTargets.set(e, target2);
for (const handler of handlers2) {
if (immediatePropagationStopped.has(e))
break;
handler(e);
}
}
}
}
unspy(e, "stopPropagation");
unspy(e, "stopImmediatePropagation");
defineCurrentTarget(e);
};
delegeteHandler.displayName = "evtdUnifiedHandler";
return delegeteHandler;
}
function createUnifiedWindowEventHandler() {
const delegateHandler = function(e) {
const { type: type4, eventPhase } = e;
if (eventPhase !== 2)
return;
const handlers2 = typeToWindowEventHandlers[type4];
if (handlers2 === void 0)
return;
handlers2.forEach((handler) => handler(e));
};
delegateHandler.displayName = "evtdUnifiedWindowEventHandler";
return delegateHandler;
}
const unifiedHandler = createUnifiedHandler();
const unfiendWindowEventHandler = createUnifiedWindowEventHandler();
function ensureElToHandlers(phase, type4) {
const phaseHandlers = phaseToTypeToElToHandlers[phase];
if (phaseHandlers[type4] === void 0) {
phaseHandlers[type4] = /* @__PURE__ */ new Map();
window.addEventListener(type4, unifiedHandler, phase === "capture");
}
return phaseHandlers[type4];
}
function ensureWindowEventHandlers(type4) {
const windowEventHandlers = typeToWindowEventHandlers[type4];
if (windowEventHandlers === void 0) {
typeToWindowEventHandlers[type4] = /* @__PURE__ */ new Set();
window.addEventListener(type4, unfiendWindowEventHandler);
}
return typeToWindowEventHandlers[type4];
}
function ensureHandlers(elToHandlers, el) {
let elHandlers = elToHandlers.get(el);
if (elHandlers === void 0) {
elToHandlers.set(el, elHandlers = /* @__PURE__ */ new Set());
}
return elHandlers;
}
function handlerExist(el, phase, type4, handler) {
const elToHandlers = phaseToTypeToElToHandlers[phase][type4];
if (elToHandlers !== void 0) {
const handlers2 = elToHandlers.get(el);
if (handlers2 !== void 0) {
if (handlers2.has(handler))
return true;
}
}
return false;
}
function windowEventHandlerExist(type4, handler) {
const handlers2 = typeToWindowEventHandlers[type4];
if (handlers2 !== void 0) {
if (handlers2.has(handler)) {
return true;
}
}
return false;
}
function on2(type4, el, handler, options) {
let mergedHandler;
if (typeof options === "object" && options.once === true) {
mergedHandler = (e) => {
off2(type4, el, mergedHandler, options);
handler(e);
};
} else {
mergedHandler = handler;
}
const trapped = trapOn(type4, el, mergedHandler, options);
if (trapped)
return;
const phase = options === true || typeof options === "object" && options.capture === true ? "capture" : "bubble";
const elToHandlers = ensureElToHandlers(phase, type4);
const handlers2 = ensureHandlers(elToHandlers, el);
if (!handlers2.has(mergedHandler))
handlers2.add(mergedHandler);
if (el === window) {
const windowEventHandlers = ensureWindowEventHandlers(type4);
if (!windowEventHandlers.has(mergedHandler)) {
windowEventHandlers.add(mergedHandler);
}
}
}
function off2(type4, el, handler, options) {
const trapped = trapOff(type4, el, handler, options);
if (trapped)
return;
const capture = options === true || typeof options === "object" && options.capture === true;
const phase = capture ? "capture" : "bubble";
const elToHandlers = ensureElToHandlers(phase, type4);
const handlers2 = ensureHandlers(elToHandlers, el);
if (el === window) {
const mirrorPhase = capture ? "bubble" : "capture";
if (!handlerExist(el, mirrorPhase, type4, handler) && windowEventHandlerExist(type4, handler)) {
const windowEventHandlers = typeToWindowEventHandlers[type4];
windowEventHandlers.delete(handler);
if (windowEventHandlers.size === 0) {
window.removeEventListener(type4, unfiendWindowEventHandler);
typeToWindowEventHandlers[type4] = void 0;
}
}
}
if (handlers2.has(handler))
handlers2.delete(handler);
if (handlers2.size === 0) {
elToHandlers.delete(el);
}
if (elToHandlers.size === 0) {
window.removeEventListener(type4, unifiedHandler, phase === "capture");
phaseToTypeToElToHandlers[phase][type4] = void 0;
}
}
return {
on: on2,
off: off2
};
}
const { on, off } = createDelegate();
function throttle(func) {
let timer = null;
return function(args) {
if (!timer) {
timer = setTimeout(() => {
timer = null;
func(args);
}, 30);
}
};
}
function handle_select(e) {
e.preventDefault();
}
function makeDots(props) {
if (props.step === 0)
return [];
let val = 0;
let dots = [0];
let count = Math.floor(100 / props.step) - 1;
for (let i = 0; i < count; i++) {
val += props.step;
dots.push(val);
}
dots.push(100);
return dots;
}
const _hoisted_1$s = ["onMousedown"];
const _hoisted_2$p = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-line-v" }, null, -1);
const _hoisted_3$m = ["onClick"];
const __default__$z = {
name: "StandardVue"
};
const _sfc_main$B = defineComponent({
...__default__$z,
props: {
val: { default: 0 },
disabled: { type: Boolean, default: false },
step: { default: 0 },
min: { default: 0 },
max: { default: 100 },
showDots: { type: Boolean, default: false }
},
emits: ["link-val-hook"],
setup(__props, { emit }) {
const props = __props;
const moveAction = throttle(standardMove);
function handle_mouseup() {
off("selectstart", document, handle_select);
off("mouseup", window, handle_mouseup);
off("mousemove", window, moveAction);
tooptipHide.value = true;
}
function handle_mousedown() {
on("selectstart", window, handle_select, { once: true });
on("mouseup", window, handle_mouseup);
on("mousemove", window, moveAction);
}
const tracker = ref(null);
let standard_style = ref(props.val);
const tooptipHide = ref(true);
function standardMove(e) {
tooptipHide.value = false;
if (!tracker.value) {
return;
}
let tracker_rect = tracker.value.getBoundingClientRect();
let origin_left = tracker_rect.left;
let point_left = e.clientX;
let distance = point_left - origin_left;
if (distance < props.min) {
standard_style.value = props.min;
} else {
let rate = distance / tracker_rect.width * 100;
calcWithStep(rate, standard_style);
if (standard_style.value > props.max) {
standard_style.value = props.max;
}
}
emit("link-val-hook", standard_style.value);
}
function calcWithStep(rate, val) {
if (typeof rate === "undefined")
return false;
if (typeof val.value === "number") {
let r = rate - val.value;
if (Math.abs(r) < props.step) {
return false;
}
if (props.step === 0)
val.value = Math.floor(rate);
if (r < 0 && props.step !== 0) {
val.value -= props.step;
} else {
val.value += props.step;
}
}
}
const dots = makeDots(props);
const focusDot = (val) => {
emit("link-val-hook", val);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "tracker",
ref: tracker,
onMousedown: withModifiers(handle_mousedown, ["stop"]),
class: normalizeClass(["layui-slider-track-v", [__props.disabled ? "layui-slider-disabled" : ""]])
}, [
createVNode(_sfc_main$11, {
content: "" + __props.val,
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ left: __props.val + "%" }),
class: normalizeClass(["layui-slider-btn-v", [__props.disabled ? "layui-slider-disabled disable-btn" : ""]])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
createElementVNode("div", {
style: normalizeStyle({ width: __props.val + "%" }),
class: normalizeClass(["layui-slider-rate-v", [__props.disabled ? "layui-slider-disabled disable-line" : ""]])
}, null, 6),
_hoisted_2$p,
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
return withDirectives((openBlock(), createElementBlock("div", {
onClick: ($event) => focusDot(item),
class: "layui-slider-dots",
key: index2,
style: normalizeStyle({ left: item + "%" })
}, null, 12, _hoisted_3$m)), [
[vShow, __props.showDots]
]);
}), 128))
], 42, _hoisted_1$s);
};
}
});
const _hoisted_1$r = ["onMousedown"];
const _hoisted_2$o = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-line-v" }, null, -1);
const _hoisted_3$l = ["onClick"];
const __default__$y = {
name: "StandardRange"
};
const _sfc_main$A = defineComponent({
...__default__$y,
props: {
rangeValue: null,
disabled: { type: Boolean, default: false },
step: { default: 0 },
min: { default: 0 },
max: { default: 100 },
showDots: { type: Boolean, default: true }
},
emits: ["link-val-hook"],
setup(__props, { emit }) {
const props = __props;
let rv = toRef(props, "rangeValue");
const moveAction = throttle(rangeMove);
let currbtn = -1;
function handle_mousedown() {
currbtn = -1;
tooptipHide.value = false;
on("selectstart", window, handle_select2, { once: true });
on("mouseup", window, handle_mouseup);
on("mousemove", window, moveAction);
}
function handle_mouseup() {
tooptipHide.value = true;
off("selectstart", document, handle_select2);
off("mouseup", window, handle_mouseup);
off("mousemove", window, moveAction);
}
function handle_select2(e) {
e.preventDefault();
}
const tracker = ref(null);
const tooptipHide = ref(true);
function rangeMove(e) {
if (!tracker.value) {
return;
}
let tracker_rect = tracker.value.getBoundingClientRect();
let origin_left = tracker_rect.left;
let point_left = e.clientX;
let distance = point_left - origin_left;
if (distance < props.min) {
rv.value[0] = props.min;
} else {
let rate = distance / tracker_rect.width * 100;
let idx = -1;
if (currbtn === -1) {
currbtn = moveNeighbors(Math.floor(rate), rv);
idx = currbtn;
} else {
idx = currbtn;
}
calcWithStep(rate, rv, idx);
if (rv.value[1] > props.max) {
rv.value[1] = props.max;
}
if (rv.value[0] < props.min) {
rv.value[0] = props.min;
}
}
emit("link-val-hook", rv.value);
}
function moveNeighbors(rate, rangeValues) {
let d1 = Math.abs(rate - rangeValues.value[0]);
let d2 = Math.abs(rate - rangeValues.value[1]);
if (d1 > d2) {
return 1;
} else {
return 0;
}
}
function calcWithStep(rate, val, idx = -1) {
if (typeof rate === "undefined")
return false;
if (typeof val.value === "object") {
let r = rate - val.value[idx];
if (Math.abs(r) < props.step) {
return false;
}
if (props.step === 0)
val.value[idx] = Math.floor(rate);
if (Array.isArray(val.value)) {
if (r < 0 && props.step !== 0) {
val.value[idx] -= props.step;
} else {
val.value[idx] += props.step;
}
cross(val);
}
}
}
function cross(val) {
if (val.value[0] > val.value[1]) {
let tmp = val.value[0];
val.value[0] = val.value[1];
val.value[1] = tmp;
currbtn = currbtn === 0 ? 1 : 0;
}
}
const dots = makeDots(props);
const focusDot = (item) => {
let currbtn2 = moveNeighbors(item, rv);
rv.value[currbtn2] = item;
emit("link-val-hook", rv.value);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
ref_key: "tracker",
ref: tracker,
onMousedown: withModifiers(handle_mousedown, ["stop"]),
class: normalizeClass(["layui-slider-srange", [__props.disabled ? "layui-slider-disabled" : ""]])
}, [
createVNode(_sfc_main$11, {
content: "" + unref(rv)[0],
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ left: unref(rv)[0] + "%" }),
class: normalizeClass(["layui-slider-btn-v", [props.disabled ? "layui-slider-disabled disable-btn" : ""]])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
createVNode(_sfc_main$11, {
content: "" + unref(rv)[1],
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ left: unref(rv)[1] + "%" }),
class: normalizeClass(["layui-slider-btn-v", [props.disabled ? "layui-slider-disabled disable-btn" : ""]])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
_hoisted_2$o,
createElementVNode("div", {
style: normalizeStyle({
width: unref(rv)[1] - unref(rv)[0] + "%",
left: unref(rv)[0] + "%"
}),
class: normalizeClass(["layui-slider-rate-v", [props.disabled ? "layui-slider-disabled disable-line" : ""]])
}, null, 6),
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
return withDirectives((openBlock(), createElementBlock("div", {
onClick: ($event) => focusDot(item),
class: "layui-slider-dots",
key: index2,
style: normalizeStyle({ left: item + "%" })
}, null, 12, _hoisted_3$l)), [
[vShow, __props.showDots]
]);
}), 128))
], 42, _hoisted_1$r);
};
}
});
const _hoisted_1$q = { class: "layui-slider-vertical" };
const _hoisted_2$n = ["onMousedown"];
const _hoisted_3$k = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-vertical-line" }, null, -1);
const _hoisted_4$h = ["onClick"];
const __default__$x = {
name: "Vertical"
};
const _sfc_main$z = defineComponent({
...__default__$x,
props: {
val: { default: 0 },
disabled: { type: Boolean, default: true },
step: { default: 0 },
min: { default: 0 },
max: { default: 100 },
showDots: { type: Boolean, default: false }
},
emits: ["link-val-hook"],
setup(__props, { emit }) {
const props = __props;
const moveAction = throttle(verticalMove);
function handle_mouseup() {
off("selectstart", document, handle_select2);
off("mouseup", window, handle_mouseup);
off("mousemove", window, moveAction);
tooptipHide.value = true;
}
function handle_select2(e) {
e.preventDefault();
}
function handle_mousedown() {
on("selectstart", window, handle_select2, { once: true });
on("mouseup", window, handle_mouseup);
on("mousemove", window, moveAction);
}
const tracker = ref(null);
let vertical_style = ref(props.val);
const tooptipHide = ref(true);
function verticalMove(e) {
tooptipHide.value = false;
if (!tracker.value) {
return;
}
let tracker_rect = tracker.value.getBoundingClientRect();
let origin_bottom = tracker_rect.bottom;
let point_bottom = e.clientY;
let distance = (point_bottom - origin_bottom) * -1;
if (distance < props.min) {
vertical_style.value = props.min;
} else {
let rate = distance / tracker_rect.height * 100;
calcWithStep(rate, vertical_style);
if (vertical_style.value > props.max) {
vertical_style.value = props.max;
}
}
emit("link-val-hook", vertical_style.value);
}
function calcWithStep(rate, val) {
if (typeof rate === "undefined")
return false;
if (typeof val.value === "number") {
let r = rate - val.value;
if (Math.abs(r) < props.step) {
return false;
}
if (props.step === 0)
val.value = Math.floor(rate);
if (r < 0 && props.step !== 0) {
val.value -= props.step;
} else {
val.value += props.step;
}
}
}
const makeDots2 = () => {
if (props.step === 0)
return [];
let val = 0;
let dots2 = [];
let count = Math.floor(100 / props.step) - 1;
for (let i = 0; i < count; i++) {
val += props.step;
dots2.push(val);
}
return dots2;
};
const dots = makeDots2();
const focusDot = (val) => {
emit("link-val-hook", val);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$q, [
createElementVNode("div", {
onMousedown: withModifiers(handle_mousedown, ["stop"]),
ref_key: "tracker",
ref: tracker,
class: normalizeClass([[__props.disabled ? "layui-slider-disabled" : ""], "layui-slider-vertical-track"])
}, [
createVNode(_sfc_main$11, {
content: "" + __props.val,
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ bottom: __props.val + "%" }),
class: normalizeClass([[props.disabled ? "layui-slider-disabled disable-btn" : ""], "layui-slider-vertical-btn"])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
createElementVNode("div", {
style: normalizeStyle({ height: __props.val + "%" }),
class: normalizeClass([[props.disabled ? "layui-slider-disabled disable-line" : ""], "layui-slider-vertical-rate"])
}, null, 6),
_hoisted_3$k,
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
return withDirectives((openBlock(), createElementBlock("div", {
onClick: ($event) => focusDot(item),
class: "layui-slider-vertical-dots",
key: index2,
style: normalizeStyle({ bottom: item + "%" })
}, null, 12, _hoisted_4$h)), [
[vShow, __props.showDots]
]);
}), 128))
], 42, _hoisted_2$n)
]);
};
}
});
const _hoisted_1$p = { class: "layui-slider-vertical" };
const _hoisted_2$m = ["onMousedown"];
const _hoisted_3$j = /* @__PURE__ */ createElementVNode("div", { class: "layui-slider-vertical-line" }, null, -1);
const _hoisted_4$g = ["onClick"];
const __default__$w = {
name: "VerticalRange"
};
const _sfc_main$y = defineComponent({
...__default__$w,
props: {
rangeValue: null,
disabled: { type: Boolean, default: false },
step: { default: 0 },
min: { default: 0 },
max: { default: 100 },
showDots: { type: Boolean, default: false }
},
emits: ["link-val-hook"],
setup(__props, { emit }) {
const props = __props;
let rv = toRef(props, "rangeValue");
const moveAction = throttle(rangeMove);
let currbtn = -1;
function handle_mousedown() {
currbtn = -1;
tooptipHide.value = false;
on("selectstart", window, handle_select2, { once: true });
on("mouseup", window, handle_mouseup);
on("mousemove", window, moveAction);
}
function handle_mouseup() {
tooptipHide.value = true;
off("selectstart", document, handle_select2);
off("mouseup", window, handle_mouseup);
off("mousemove", window, moveAction);
}
function handle_select2(e) {
e.preventDefault();
}
const tracker = ref(null);
const tooptipHide = ref(true);
function rangeMove(e) {
if (!tracker.value) {
return;
}
let tracker_rect = tracker.value.getBoundingClientRect();
let origin_bottom = tracker_rect.bottom;
let point_bottom = e.clientY;
let distance = (point_bottom - origin_bottom) * -1;
if (distance < props.min) {
rv.value[0] = props.min;
} else {
let rate = distance / tracker_rect.height * 100;
let idx = -1;
if (currbtn === -1) {
currbtn = moveNeighbors(Math.floor(rate), rv);
idx = currbtn;
} else {
idx = currbtn;
}
calcWithStep(rate, rv, idx);
if (rv.value[1] > props.max) {
rv.value[1] = props.max;
}
if (rv.value[0] < props.min) {
rv.value[0] = props.min;
}
}
emit("link-val-hook", rv.value);
}
function moveNeighbors(rate, rangeValues) {
let d1 = Math.abs(rate - rangeValues.value[0]);
let d2 = Math.abs(rate - rangeValues.value[1]);
if (d1 > d2) {
return 1;
} else {
return 0;
}
}
function calcWithStep(rate, val, idx = -1) {
if (typeof rate === "undefined")
return false;
if (typeof val.value === "object") {
let r = rate - val.value[idx];
if (Math.abs(r) < props.step) {
return false;
}
if (props.step === 0)
val.value[idx] = Math.floor(rate);
if (Array.isArray(val.value)) {
if (r < 0 && props.step !== 0) {
val.value[idx] -= props.step;
} else {
val.value[idx] += props.step;
}
cross(val);
}
}
}
function cross(val) {
if (val.value[0] > val.value[1]) {
let tmp = val.value[0];
val.value[0] = val.value[1];
val.value[1] = tmp;
currbtn = currbtn === 0 ? 1 : 0;
}
}
const dots = makeDots(props);
const focusDot = (item) => {
let currbtn2 = moveNeighbors(item, rv);
rv.value[currbtn2] = item;
emit("link-val-hook", rv.value);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$p, [
createElementVNode("div", {
ref_key: "tracker",
ref: tracker,
onMousedown: withModifiers(handle_mousedown, ["stop"]),
class: normalizeClass(["layui-slider-vrange", [__props.disabled ? "layui-slider-disabled" : ""]])
}, [
createVNode(_sfc_main$11, {
content: "" + unref(rv)[1],
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ bottom: unref(rv)[1] + "%" }),
class: normalizeClass(["layui-slider-vertical-btn", [props.disabled ? "layui-slider-disabled disable-btn" : ""]])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
createVNode(_sfc_main$11, {
content: "" + unref(rv)[0],
"is-can-hide": tooptipHide.value
}, {
default: withCtx(() => [
createElementVNode("div", {
style: normalizeStyle({ bottom: unref(rv)[0] + "%" }),
class: normalizeClass(["layui-slider-vertical-btn", [props.disabled ? "layui-slider-disabled disable-btn" : ""]])
}, null, 6)
]),
_: 1
}, 8, ["content", "is-can-hide"]),
_hoisted_3$j,
createElementVNode("div", {
style: normalizeStyle({
height: unref(rv)[1] - unref(rv)[0] + "%",
bottom: unref(rv)[0] + "%"
}),
class: normalizeClass(["layui-slider-vertical-rate", [props.disabled ? "layui-slider-disabled disable-line" : ""]])
}, null, 6),
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(dots), (item, index2) => {
return withDirectives((openBlock(), createElementBlock("div", {
onClick: ($event) => focusDot(item),
class: "layui-slider-vertical-dots",
key: index2,
style: normalizeStyle({ bottom: item + "%" })
}, null, 12, _hoisted_4$g)), [
[vShow, __props.showDots]
]);
}), 128))
], 42, _hoisted_2$m)
]);
};
}
});
const _hoisted_1$o = { key: 0 };
const _hoisted_2$l = { key: 0 };
const _hoisted_3$i = { key: 1 };
const _hoisted_4$f = { key: 1 };
2022-12-30 08:13:19 +00:00
const _hoisted_5$d = { key: 0 };
2022-11-15 01:16:55 +00:00
const _hoisted_6$a = { key: 1 };
const __default__$v = {
name: "LaySlider"
};
const _sfc_main$x = defineComponent({
...__default__$v,
props: {
vertical: { type: Boolean, default: false },
modelValue: { default: 0 },
min: { default: 0 },
max: { default: 100 },
step: { default: 0 },
disabled: { type: Boolean, default: false },
range: { type: Boolean },
rangeValue: null,
showDots: { type: Boolean, default: false }
},
emits: ["update:modelValue"],
setup(__props, { emit }) {
const props = __props;
let rangeValues = toRef(props, "rangeValue");
function valHook(val) {
emit("update:modelValue", val);
}
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", null, [
__props.vertical ? (openBlock(), createElementBlock("div", _hoisted_1$o, [
__props.range ? (openBlock(), createElementBlock("div", _hoisted_2$l, [
createVNode(_sfc_main$y, {
step: __props.step,
onLinkValHook: valHook,
disabled: __props.disabled,
rangeValue: unref(rangeValues),
min: __props.min,
max: __props.max,
showDots: __props.showDots
}, null, 8, ["step", "disabled", "rangeValue", "min", "max", "showDots"])
])) : (openBlock(), createElementBlock("div", _hoisted_3$i, [
createVNode(_sfc_main$z, {
step: __props.step,
onLinkValHook: valHook,
disabled: __props.disabled,
val: __props.modelValue,
min: __props.min,
max: __props.max,
showDots: __props.showDots
}, null, 8, ["step", "disabled", "val", "min", "max", "showDots"])
]))
])) : (openBlock(), createElementBlock("div", _hoisted_4$f, [
2022-12-30 08:13:19 +00:00
__props.range ? (openBlock(), createElementBlock("div", _hoisted_5$d, [
2022-11-15 01:16:55 +00:00
createVNode(_sfc_main$A, {
step: __props.step,
onLinkValHook: valHook,
disabled: __props.disabled,
rangeValue: unref(rangeValues),
min: __props.min,
max: __props.max,
showDots: __props.showDots
}, null, 8, ["step", "disabled", "rangeValue", "min", "max", "showDots"])
])) : (openBlock(), createElementBlock("div", _hoisted_6$a, [
createVNode(_sfc_main$B, {
val: __props.modelValue,
onLinkValHook: valHook,
disabled: __props.disabled,
step: __props.step,
min: __props.min,
max: __props.max,
showDots: __props.showDots
}, null, 8, ["val", "disabled", "step", "min", "max", "showDots"])
]))
]))
]);
};
}
});
const component$r = withInstall(_sfc_main$x);
var index$g = /* @__PURE__ */ (() => '.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:"\\e63d";left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:var(--global-neutral-color-8);font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s;overflow:hidden;visibility:hidden}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\\ ;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:#0003;color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:#00000059}.layui-carousel:hover .layui-carousel-arrow{display:block\\ ;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:#00000080}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:#0003;border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:var(--global-neutral-color-3);background-color:#ffffff80;border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:#ffffffb3}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto;transform:translateY(-50%)}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-carousel[lay-anim=updown]>[carouse
const _hoisted_1$n = ["data-id"];
const __default__$u = {
name: "LayCarouselItem"
};
const _sfc_main$w = defineComponent({
...__default__$u,
props: {
id: null
},
setup(__props) {
const props = __props;
const active = inject("active");
const slotsChange = inject("slotsChange");
slotsChange.value = !slotsChange.value;
const anim = inject("anim");
const item = ref();
const getStyle = computed$1(() => {
if (item.value) {
let allChild = item.value.parentNode.children;
let allChildNum = allChild.length;
let activeIndex = 0;
let currentIndex = 0;
for (let index2 = 0; index2 < allChild.length; index2++) {
const element = allChild[index2];
if (element.getAttribute("data-id") === active.value) {
activeIndex = index2;
}
if (element.getAttribute("data-id") === props.id) {
currentIndex = index2;
}
}
let prevIndex = activeIndex > 0 ? activeIndex - 1 : allChildNum - 1;
let nextIndex = activeIndex + 1 < allChildNum ? activeIndex + 1 : 0;
let animation = anim.value;
if (activeIndex === currentIndex) {
if (animation === "updown") {
return {
transform: "translateY(0)",
visibility: "inherit"
};
} else if (animation.includes("fade")) {
return {
opacity: 1,
visibility: "inherit"
};
} else {
return {
transform: "translateX(0)",
visibility: "inherit"
};
}
}
if (prevIndex === currentIndex) {
if (animation === "updown") {
return {
transform: "translateY(-100%)"
};
} else if (animation.includes("fade")) {
return {
opacity: 0
};
} else {
return {
transform: "translateX(-100%)"
};
}
}
if (nextIndex === currentIndex) {
if (animation === "updown") {
return {
transform: "translateY(100%)"
};
} else if (animation.includes("fade")) {
return {
opacity: 0
};
} else {
return {
transform: "translateX(100%)"
};
}
}
return {
display: "none"
};
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("li", {
ref_key: "item",
ref: item,
style: normalizeStyle(unref(getStyle)),
"data-id": __props.id
}, [
renderSlot(_ctx.$slots, "default")
], 12, _hoisted_1$n);
};
}
});
const _hoisted_1$m = ["lay-anim", "lay-indicator", "lay-arrow"];
const _hoisted_2$k = { "carousel-item": "" };
const _hoisted_3$h = { class: "layui-carousel-ind" };
const _hoisted_4$e = ["onClick"];
const __default__$t = {
name: "LayCarousel"
};
const _sfc_main$v = defineComponent({
...__default__$t,
props: {
width: { default: "100%" },
height: { default: "280px" },
modelValue: null,
autoplay: { type: Boolean, default: true },
arrow: { default: "hover" },
anim: { default: "default" },
indicator: { default: "inside" },
pauseOnHover: { type: Boolean, default: true },
interval: { default: 3e3 }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
const slot = useSlots();
const slots = slot.default && slot.default();
const active = computed$1({
get() {
return props.modelValue;
},
set(val) {
emit("update:modelValue", val);
}
});
const anim = computed$1(() => props.anim);
const change3 = function(id) {
emit("change", id);
active.value = id;
};
const childrens = ref([]);
const slotsChange = ref(true);
const setItemInstanceBySlot = function(nodes) {
const showNodes = nodes == null ? void 0 : nodes.filter((item) => {
return item.children != "v-if";
});
showNodes == null ? void 0 : showNodes.map((item) => {
let component2 = item.type;
if (component2.name != _sfc_main$w.name) {
setItemInstanceBySlot(item.children);
} else {
childrens.value.push(item);
}
});
};
watch(slotsChange, () => {
childrens.value = [];
setItemInstanceBySlot(slot.default && slot.default());
}, { immediate: true, deep: true });
const sub2 = () => {
var _a2, _b, _c;
for (var i = 0; i < childrens.value.length; i++) {
if (((_a2 = childrens.value[i].props) == null ? void 0 : _a2.id) === active.value) {
if (i === 0) {
active.value = (_b = childrens.value[slots.length - 1].props) == null ? void 0 : _b.id;
} else {
active.value = (_c = childrens.value[i - 1].props) == null ? void 0 : _c.id;
}
break;
}
}
};
const add2 = () => {
var _a2, _b, _c;
for (var i = 0; i < childrens.value.length; i++) {
if (((_a2 = childrens.value[i].props) == null ? void 0 : _a2.id) === active.value) {
if (i === childrens.value.length - 1) {
active.value = (_b = childrens.value[0].props) == null ? void 0 : _b.id;
} else {
active.value = (_c = childrens.value[i + 1].props) == null ? void 0 : _c.id;
}
break;
}
}
};
const autoplay = () => {
var _a2, _b, _c;
for (var i = 0; i < childrens.value.length; i++) {
if (((_a2 = childrens.value[i].props) == null ? void 0 : _a2.id) === active.value) {
if (i === childrens.value.length - 1) {
active.value = (_b = childrens.value[0].props) == null ? void 0 : _b.id;
} else {
active.value = (_c = childrens.value[i + 1].props) == null ? void 0 : _c.id;
}
break;
}
}
};
let intervalTimer = 0;
const cleanIntervalTimer = () => {
if (intervalTimer) {
window.clearInterval(intervalTimer);
intervalTimer = 0;
}
};
const handleMouseEnter = () => {
if (props.autoplay && props.pauseOnHover) {
cleanIntervalTimer();
}
};
const handleMouseLeave = () => {
if (props.autoplay && props.pauseOnHover) {
intervalTimer = window.setInterval(autoplay, props.interval);
}
};
watch(() => props.autoplay, () => {
if (props.autoplay) {
intervalTimer = window.setInterval(autoplay, props.interval);
}
}, { immediate: true });
provide("active", active);
provide("slotsChange", slotsChange);
provide("anim", anim);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: "layui-carousel",
"lay-anim": unref(anim),
"lay-indicator": __props.indicator,
"lay-arrow": __props.arrow,
style: normalizeStyle({ width: __props.width, height: __props.height }),
onMouseenter: handleMouseEnter,
onMouseleave: handleMouseLeave
}, [
createElementVNode("div", _hoisted_2$k, [
renderSlot(_ctx.$slots, "default")
]),
createElementVNode("div", _hoisted_3$h, [
createElementVNode("ul", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(childrens.value, (ss, index2) => {
var _a2;
return openBlock(), createElementBlock("li", {
key: index2,
class: normalizeClass([((_a2 = ss.props) == null ? void 0 : _a2.id) === unref(active) ? "layui-this" : ""]),
onClick: withModifiers(($event) => {
var _a3;
return change3((_a3 = ss.props) == null ? void 0 : _a3.id);
}, ["stop"])
}, null, 10, _hoisted_4$e);
}), 128))
])
]),
createElementVNode("button", {
class: "layui-icon layui-carousel-arrow",
"lay-type": "sub",
onClick: sub2
}, toDisplayString$1(unref(anim) === "updown" ? "\uE619" : "\uE603"), 1),
createElementVNode("button", {
class: "layui-icon layui-carousel-arrow",
"lay-type": "add",
onClick: add2
}, toDisplayString$1(unref(anim) === "updown" ? "\uE61A" : "\uE602"), 1)
], 44, _hoisted_1$m);
};
}
});
const component$q = withInstall(_sfc_main$v);
const component$p = withInstall(_sfc_main$w);
var index$f = /* @__PURE__ */ (() => ".layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}.layui-color-picker{position:relative;user-select:none;width:320px;background:#fff;padding:8px}.saturation-value{cursor:pointer;width:100%;height:200px;position:relative;margin-bottom:10px;box-shadow:1px 1px 1px #0000001a}.saturation-value>div{position:absolute;top:0;left:0;width:100%;height:100%}.point{box-sizing:border-box;width:6px;height:6px;background-color:transparent;border:2px solid #ccc;border-radius:50%;transform:translate(-50%,-50%);position:absolute;z-index:9}.saturation-value-2{background:linear-gradient(to right,white,#ffffff00)}.saturation-value-3{background:linear-gradient(to top,black,#ffffff00)}.layui-color-picker-middle{width:100%;display:flex;margin-bottom:10px}.hue-slider{position:relative;margin-bottom:6px;height:10px;background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);box-shadow:1px 1px 1px #0000001a}.alpha-slider{position:relative;height:10px;box-shadow:1px 1px 1px #0000001a;background:#fff url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg==);background-size:10px 10px}.slider{position:absolute;box-shadow:0 0 2px #0009;box-sizing:border-box;width:6px;height:100%;background-color:#fff}.color-diamond{position:relative;margin-left:5px;width:26px;height:26px;border-radius:2px;overflow:hidden;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg==);background-size:10px 10px}.layui-colorpicker>span{width:26px;height:26px;display:block;border-radius:var(--global-border-radius);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAWElEQVRIiWM8fubkfwYygKWJOSM5+mCAhRLNoxaPWjxq8ajFoxbTyeL/DAfJ0Xjs3Cl7Siwmu4Yht1aDgZEYx6MWj1o8avGoxaMWD3qLya5X//4nqx6HAQC7RBGFzolqTAAAAABJRU5ErkJggg==);background-size:10px 10px}.color-value{width:100%;display:flex;justify-content:space-between}.color-value div{padding:0 3px;text-align:center}.color-value input{font-size:12px;box-sizing:border-box;width:34px;height:24px;padding:0;margin:0;outline:none;text-align:center;border-radius:2px;border:1px solid #eee}.color-value p{font-size:12px;margin:3px 0 0}.color-value .rgba-a{padding-right:0}.color-value .hex{flex:1;padding-left:0}.color-value .hex input{width:100%;height:24px}.preset{width:100%;padding:0;margin:10px 0 0;list-style:none;display:flex;flex-wrap:wrap;justify-content:flex-start}.preset li{width:20px;height:20px;padding:0;margin-right:6px;margin-bottom:6px;border:1px solid #eee;border-radius:2px}.layui-colorpicker{border:1px solid var(--global-neutral-color-3);padding:5px;border-radius:var(--global-border-radius);line-height:24px;display:inline-block;cursor:
const _sfc_main$u = {};
const _hoisted_1$l = {
t: "1651169382813",
class: "icon",
viewBox: "0 0 1024 1024",
version: "1.1",
xmlns: "http://www.w3.org/2000/svg",
"p-id": "2529",
width: "27",
height: "27"
};
const _hoisted_2$j = /* @__PURE__ */ createElementVNode("path", {
d: "M769.3 409.1c-4.3-16.2-14.7-29.7-29.2-38l-51.3-29.6-10 17.3c-3.7 6.4-10.4 10-17.3 10-3.4 0-6.8-0.9-10-2.7l68.6 39.6c5.2 3 9 7.9 10.5 13.7 1.6 5.8 0.8 11.9-2.3 17.2l-6.6 11.5c-6.2 10.8-20.1 14.5-30.9 8.3L441 312.2c-5.2-3-9-7.9-10.5-13.7-1.6-5.8-0.8-11.9 2.3-17.2l6.6-11.5c3-5.2 7.9-9 13.7-10.5 1.9-0.5 3.9-0.8 5.9-0.8 3.9 0 7.8 1 11.3 3l69.3 40c-9.6-5.5-12.8-17.8-7.3-27.3l10-17.3-52-30c-14.5-8.4-31.4-10.6-47.5-6.3-16.2 4.3-29.7 14.7-38 29.2l-6.6 11.5c-8.4 14.5-10.6 31.4-6.3 47.5 4.3 16.2 14.7 29.7 29.2 38l52 30 10-17.3c5.5-9.6 17.8-12.8 27.3-7.3 9.6 5.5 12.8 17.8 7.3 27.3l-10 17.3 77.2 44.6 10-17.3c5.5-9.6 17.8-12.8 27.3-7.3 9.6 5.5 12.8 17.8 7.3 27.3l-10 17.3 51.3 29.6c9.8 5.7 20.6 8.4 31.2 8.4 21.7 0 42.7-11.2 54.3-31.3l6.6-11.5c8.5-14.5 10.7-31.4 6.4-47.5z",
fill: "#515151",
"p-id": "2530"
}, null, -1);
const _hoisted_3$g = /* @__PURE__ */ createElementVNode("path", {
d: "M644.2 338.8l10-17.3-77.2-44.6-10 17.3c-5.5 9.6-17.8 12.8-27.3 7.3l111.8 64.6c-9.6-5.5-12.9-17.8-7.3-27.3zM539.6 301.5zM651.5 366.1z",
fill: "#515151",
"p-id": "2531"
}, null, -1);
const _hoisted_4$d = /* @__PURE__ */ createElementVNode("path", {
d: "M624.1 195.2c12.3-21.3 39.6-28.6 60.9-16.3 10.3 6 17.7 15.6 20.8 27.1s1.5 23.5-4.5 33.8l-47.2 81.7 34.6 20 47.2-81.7c11.3-19.6 14.3-42.4 8.5-64.2-5.8-21.8-19.8-40.1-39.4-51.4-40.4-23.3-92.2-9.4-115.5 31l-47.2 81.7 34.6 20 47.2-81.7z",
fill: "#515151",
"p-id": "2532"
}, null, -1);
2022-12-30 08:13:19 +00:00
const _hoisted_5$c = /* @__PURE__ */ createElementVNode("path", {
2022-11-15 01:16:55 +00:00
d: "M644.2 338.8c-5.5 9.6-2.2 21.8 7.3 27.3 3.1 1.8 6.6 2.7 10 2.7 6.9 0 13.6-3.6 17.3-10l10-17.3-34.6-20-10 17.3zM539.6 301.5c9.6 5.5 21.8 2.2 27.3-7.3l10-17.3-34.6-20-10 17.3c-5.5 9.6-2.2 21.8 7.3 27.3z",
fill: "#515151",
"p-id": "2533"
}, null, -1);
const _hoisted_6$9 = /* @__PURE__ */ createElementVNode("path", {
d: "M395.4 769.6c-2.6 4.4-6.5 7.6-11 9-2.3 0.7-6.9 1.5-11.3-1-9.6-5.5-21.8-2.2-27.3 7.3l-23.1 40c-1.7 2.9-4.2 5-7.1 5.8-1.7 0.5-4.1 0.8-6.5-0.5-2.4-1.4-3.3-3.7-3.7-5.4-0.7-2.9-0.1-6.2 1.5-9l22.9-39.7c5.6-9.7 2.3-22.2-7.4-27.8-7.3-4.2-9.2-14.7-4.2-23.3l189.5-328.2-34.6-20L283.6 705c-12.4 21.4-10.1 47.2 3.7 64.8l-15 26c-6.7 11.6-8.8 25.1-5.9 37.9 3 13.4 11.1 24.4 22.7 31.1 7.3 4.2 15.4 6.4 23.7 6.4 4.9 0 9.8-0.7 14.6-2.2 12.6-3.9 23.2-12.4 29.9-24.1l15-26c7.8 1.1 15.9 0.4 23.8-2 14.2-4.4 26.2-14.1 33.8-27.3l189.5-328.2-34.6-20-189.4 328.2z",
fill: "#515151",
"p-id": "2534"
}, null, -1);
const _hoisted_7$9 = /* @__PURE__ */ createElementVNode("path", {
d: "M622.2 416.8c-9.6-5.5-21.8-2.2-27.3 7.3l-10 17.3 34.6 20 10-17.3c5.6-9.6 2.3-21.8-7.3-27.3zM517.7 379.5c5.5-9.6 2.2-21.8-7.3-27.3-9.6-5.5-21.8-2.2-27.3 7.3l-10 17.3 34.6 20 10-17.3z",
fill: "#515151",
"p-id": "2535"
}, null, -1);
const _hoisted_8$6 = [
_hoisted_2$j,
_hoisted_3$g,
_hoisted_4$d,
2022-12-30 08:13:19 +00:00
_hoisted_5$c,
2022-11-15 01:16:55 +00:00
_hoisted_6$9,
_hoisted_7$9
];
function _sfc_render(_ctx, _cache) {
return openBlock(), createElementBlock("svg", _hoisted_1$l, _hoisted_8$6);
}
var EyeDropper = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["render", _sfc_render]]);
const _hoisted_1$k = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon layui-colorpicker-trigger-i layui-icon-down" }, null, -1);
const _hoisted_2$i = [
_hoisted_1$k
];
const _hoisted_3$f = { class: "layui-color-picker" };
const _hoisted_4$c = /* @__PURE__ */ createElementVNode("div", { class: "saturation-value-2" }, null, -1);
2022-12-30 08:13:19 +00:00
const _hoisted_5$b = /* @__PURE__ */ createElementVNode("div", { class: "saturation-value-3" }, null, -1);
2022-11-15 01:16:55 +00:00
const _hoisted_6$8 = { class: "layui-color-picker-middle" };
const _hoisted_7$8 = { style: { "flex": "auto" } };
const _hoisted_8$5 = { class: "color-diamond" };
const _hoisted_9$4 = { class: "color-value" };
const _hoisted_10$4 = { class: "hex" };
const _hoisted_11$4 = ["value"];
const _hoisted_12$3 = { class: "rgba-r" };
const _hoisted_13$3 = ["value"];
const _hoisted_14$2 = { class: "rgba-g" };
const _hoisted_15$1 = ["value"];
const _hoisted_16$1 = { class: "rgba-b" };
const _hoisted_17$1 = ["value"];
const _hoisted_18 = { class: "rgba-a" };
const _hoisted_19 = ["value"];
const _hoisted_20 = { class: "preset" };
const _hoisted_21 = ["onClick"];
const __default__$s = {
name: "LayColorPicker"
};
const _sfc_main$t = defineComponent({
...__default__$s,
props: {
modelValue: { default: { r: 255, g: 255, b: 255, a: 1 } },
preset: { default: ["#009688", "#1e9fff", "#ffb800", "#ff5722", "#5fb878"] },
disabled: { type: Boolean, default: false },
eyeDropper: { type: Boolean },
contentClass: null,
contentStyle: null
},
emits: ["update:modelValue"],
setup(__props, { emit }) {
const props = __props;
const saturationValue = ref(null);
const hueSlider = ref(null);
const alphaSlider = ref(null);
const { isSupported, open: open2, sRGBHex } = useEyeDropper();
let pointStyle = ref("top: 25%;left: 80%;");
let hueSliderStyle = ref("left: 0;");
let alphaSliderStyle = ref("left: calc(100% - 6px);");
let hue = ref(0);
let saturation = ref(1);
let value = ref(1);
let red = ref(255);
let green = ref(0);
let blue = ref(0);
let alpha = ref(1);
const openEyeDropper = function() {
if (isSupported) {
open2();
} else {
console.warn("LayColorPicker: Eye dropper not supported by your browser!");
}
};
onMounted(() => {
let { r, g, b, a } = parseColor(props.modelValue);
red.value = r;
green.value = g;
blue.value = b;
alpha.value = a;
});
watch(sRGBHex, (sRGBHex2) => {
let { r, g, b, a } = hex2rgba(sRGBHex2);
red.value = r;
green.value = g;
blue.value = b;
alpha.value = a;
});
watch([red, green, blue], (newValue) => {
emit("update:modelValue", rgba2hex(red.value, green.value, blue.value, alpha.value));
let { h: h2, s, v } = rgb2hsv(red.value, green.value, blue.value);
hue.value = h2;
saturation.value = s;
value.value = v;
pointStyle.value = `top: ${100 - v * 100}%;left: ${s * 100}%;`;
hueSliderStyle.value = `left: ${hue.value / 360 * 100}%;`;
});
watch(alpha, () => {
emit("update:modelValue", rgba2hex(red.value, green.value, blue.value, alpha.value));
alphaSliderStyle.value = `left: ${alpha.value >= 1 ? "calc(100% - 6px)" : alpha.value * 100 + "%"};`;
});
let colorObj = computed$1(() => {
let r = red.value;
let g = green.value;
let b = blue.value;
let a = alpha.value;
let h2 = hue.value;
let s = saturation.value;
let v = value.value;
return {
rgb: `rgba(${r},${g},${b})`,
rgba: `rgba(${r},${g},${b},${a})`,
hex6: rgba2hex(r, g, b),
hex8: rgba2hex(r, g, b, a),
hsv: `hsv(${h2},${s},${v})`,
hsl: ``
};
});
function hexChange(e) {
let v = e.target.value;
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(v)) {
let { r, g, b, a } = hex2rgba(v);
red.value = r;
green.value = g;
blue.value = b;
alpha.value = a;
}
}
function redChange(e) {
let v = e.target.value;
if (v !== "") {
v > 255 && (red.value = 255);
v < 0 && (red.value = 0);
v >= 0 && v <= 255 && (red.value = parseInt(v));
}
}
function greenChange(e) {
let v = e.target.value;
if (v !== "") {
v > 255 && (green.value = 255);
v < 0 && (green.value = 0);
v >= 0 && v <= 255 && (green.value = parseInt(v));
}
}
function blueChange(e) {
let v = e.target.value;
if (v !== "") {
v > 255 && (blue.value = 255);
v < 0 && (blue.value = 0);
v >= 0 && v <= 255 && (blue.value = parseInt(v));
}
}
function alphaChange(e) {
let v = e.target.value;
if (v !== "") {
v = parseFloat(v);
alpha.value = v;
v > 1 && (alpha.value = 1);
v < 0 && (alpha.value = 0);
v >= 0 && v <= 1 && (alpha.value = v);
}
}
function presetChange(item) {
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(item)) {
let { r, g, b, a } = hex2rgba(item);
red.value = r;
green.value = g;
blue.value = b;
alpha.value = a;
}
}
function handleChangeSV(e) {
let w = saturationValue.value.clientWidth;
let h2 = saturationValue.value.clientHeight;
let x = e.pageX - saturationValue.value.getBoundingClientRect().left;
let y = e.pageY - saturationValue.value.getBoundingClientRect().top;
x = x < w && x > 0 ? x : x > w ? w : 0;
y = y < h2 && y > 0 ? y : y > h2 ? h2 : 0;
saturation.value = Math.floor(x / w * 100 + 0.5) / 100;
value.value = Math.floor((1 - y / h2) * 100 + 0.5) / 100;
let { r, g, b } = hsv2rgb(hue.value, saturation.value, value.value);
red.value = r;
green.value = g;
blue.value = b;
pointStyle.value = `top: ${y}px;left: ${x}px;`;
}
function mousedownSV(e) {
handleChangeSV(e);
window.addEventListener("mousemove", handleChangeSV);
window.addEventListener("mouseup", mouseupSV);
}
function mouseupSV(e) {
window.removeEventListener("mousemove", handleChangeSV);
window.removeEventListener("mouseup", mouseupSV);
}
function handleChangeHue(e) {
let w = hueSlider.value.clientWidth;
let x = e.pageX - saturationValue.value.getBoundingClientRect().left;
x = x < w && x > 0 ? x : x > w ? w : 0;
hue.value = Math.floor(x / w * 360 + 0.5);
let { r, g, b } = hsv2rgb(hue.value, saturation.value, value.value);
red.value = r;
green.value = g;
blue.value = b;
hueSliderStyle.value = `left: ${x >= w - 6 ? w - 6 : x}px;`;
}
function mousedownHue(e) {
handleChangeHue(e);
window.addEventListener("mousemove", handleChangeHue);
window.addEventListener("mouseup", mouseupHue);
}
function mouseupHue(e) {
window.removeEventListener("mousemove", handleChangeHue);
window.removeEventListener("mouseup", mouseupHue);
}
function handleChangeAlpha(e) {
let w = alphaSlider.value.clientWidth;
let x = e.pageX - saturationValue.value.getBoundingClientRect().left;
x = x < w && x > 0 ? x : x > w ? w : 0;
alpha.value = Math.floor(x / w * 100 + 0.5) / 100;
alphaSliderStyle.value = `left: ${x >= w - 6 ? w - 6 : x}px;`;
}
function mousedownAlpha(e) {
handleChangeAlpha(e);
window.addEventListener("mousemove", handleChangeAlpha);
window.addEventListener("mouseup", mouseupAlpha);
}
function mouseupAlpha(e) {
window.removeEventListener("mousemove", handleChangeAlpha);
window.removeEventListener("mouseup", mouseupAlpha);
}
function parseColor(color) {
if (color) {
let r, g, b, a;
if (typeof color === "string") {
if (/^#?([0-9a-fA-F]{6}|[0-9a-fA-F]{8}|[0-9a-fA-F]{3}|[0-9a-fA-F]{4})$/.test(color)) {
return hex2rgba(color);
}
} else {
r = color.r > 255 ? 255 : color.r < 0 ? 0 : color.r;
g = color.g > 255 ? 255 : color.g < 0 ? 0 : color.g;
b = color.b > 255 ? 255 : color.b < 0 ? 0 : color.b;
a = color.a > 1 ? 1 : color.a < 0 ? 0 : color.a;
return { r, g, b, a };
}
} else {
return null;
}
}
function hsv2rgb(h2, s, v) {
h2 === 360 && (h2 = 0);
let i = Math.floor(h2 / 60) % 6;
let f = h2 / 60 - i;
let p = v * (1 - s);
let q = v * (1 - s * f);
let t = v * (1 - s * (1 - f));
let r, g, b;
if (i === 0) {
r = v;
g = t;
b = p;
} else if (i === 1) {
r = q;
g = v;
b = p;
} else if (i === 2) {
r = p;
g = v;
b = t;
} else if (i === 3) {
r = p;
g = q;
b = v;
} else if (i === 4) {
r = t;
g = p;
b = v;
} else if (i === 5) {
r = v;
g = p;
b = q;
}
r = Math.floor(r * 255 + 0.5);
g = Math.floor(g * 255 + 0.5);
b = Math.floor(b * 255 + 0.5);
return { r, g, b };
}
function rgb2hsv(r, g, b) {
let r1 = r / 255;
let g1 = g / 255;
let b1 = b / 255;
let cmax = Math.max(r1, g1, b1);
let cmin = Math.min(r1, g1, b1);
let d = cmax - cmin;
let h2, s, v;
if (d === 0) {
h2 = 0;
} else if (cmax === r1) {
h2 = (60 * (g1 - b1) / d + 360) % 360;
} else if (cmax === g1) {
h2 = 60 * ((b1 - r1) / d + 2);
} else if (cmax === b1) {
h2 = 60 * ((r1 - g1) / d + 4);
}
if (cmax === 0) {
s = 0;
} else {
s = d / cmax;
}
v = cmax;
h2 = Math.floor(h2 + 0.5);
s = Math.floor(s * 100 + 0.5) / 100;
v = Math.floor(v * 100 + 0.5) / 100;
return { h: h2, s, v };
}
function rgba2hex(r, g, b, a = 1) {
r = parseInt(r);
let r1 = r.toString(16).length !== 2 ? "0" + r.toString(16) : r.toString(16);
g = parseInt(g);
let g1 = g.toString(16).length !== 2 ? "0" + g.toString(16) : g.toString(16);
b = parseInt(b);
let b1 = b.toString(16).length !== 2 ? "0" + b.toString(16) : b.toString(16);
a = parseFloat(a);
let a1 = "";
if (a !== 1) {
let temp = Math.floor(256 * a);
a1 = temp.toString(16).length !== 2 ? "0" + temp.toString(16) : temp.toString(16);
}
return `#${r1}${g1}${b1}${a1}`.toUpperCase();
}
function hex2rgba(s) {
if (/^#?[0-9a-fA-F]{3}$/.test(s)) {
let b = s.substring(s.length - 1, s.length);
let g = s.substring(s.length - 2, s.length - 1);
let r = s.substring(s.length - 3, s.length - 2);
return hex2rgba(`${r + r}${g + g}${b + b}`);
}
if (/^#?[0-9a-fA-F]{4}$/.test(s)) {
let a = s.substring(s.length - 1, s.length);
let b = s.substring(s.length - 2, s.length - 1);
let g = s.substring(s.length - 3, s.length - 2);
let r = s.substring(s.length - 4, s.length - 3);
return hex2rgba(`${r + r}${g + g}${b + b}${a + a}`);
}
if (/^#?[0-9a-fA-F]{6}$/.test(s)) {
let b = parseInt("0x" + s.substring(s.length - 2, s.length));
let g = parseInt("0x" + s.substring(s.length - 4, s.length - 2));
let r = parseInt("0x" + s.substring(s.length - 6, s.length - 4));
return { r, g, b, a: 1 };
}
if (/^#?[0-9a-fA-F]{8}$/.test(s)) {
let a = parseInt("0x" + s.substring(s.length - 2, s.length));
a = a / 255;
let b = parseInt("0x" + s.substring(s.length - 4, s.length - 2));
let g = parseInt("0x" + s.substring(s.length - 6, s.length - 4));
let r = parseInt("0x" + s.substring(s.length - 8, s.length - 6));
return { r, g, b, a };
}
}
return (_ctx, _cache) => {
return openBlock(), createBlock(_sfc_main$1y, {
disabled: __props.disabled,
contentClass: __props.contentClass,
contentStyle: __props.contentStyle,
updateAtScroll: ""
}, {
content: withCtx(() => [
createElementVNode("div", _hoisted_3$f, [
createElementVNode("div", {
class: "saturation-value",
ref_key: "saturationValue",
ref: saturationValue,
onMousedown: mousedownSV
}, [
createElementVNode("div", {
style: normalizeStyle(`background-color: hsl(${unref(hue)}, 100%, 50%);`)
}, [
createElementVNode("div", {
class: "point",
style: normalizeStyle(unref(pointStyle))
}, null, 4)
], 4),
_hoisted_4$c,
2022-12-30 08:13:19 +00:00
_hoisted_5$b
2022-11-15 01:16:55 +00:00
], 544),
createElementVNode("div", _hoisted_6$8, [
createElementVNode("div", _hoisted_7$8, [
createElementVNode("div", {
class: "hue-slider",
ref_key: "hueSlider",
ref: hueSlider,
onMousedown: mousedownHue
}, [
createElementVNode("div", {
class: "slider",
style: normalizeStyle(unref(hueSliderStyle))
}, null, 4)
], 544),
createElementVNode("div", {
class: "alpha-slider",
ref_key: "alphaSlider",
ref: alphaSlider,
onMousedown: mousedownAlpha
}, [
createElementVNode("div", {
class: "slider",
style: normalizeStyle(unref(alphaSliderStyle))
}, null, 4),
createElementVNode("div", {
style: normalizeStyle(`background: linear-gradient(to right, rgba(0,0,0,0), ${unref(colorObj).rgb});width: 100%;height: 100%`)
}, null, 4)
], 544)
]),
__props.eyeDropper ? (openBlock(), createElementBlock("div", {
key: 0,
onClick: openEyeDropper,
style: { "margin-left": "5px" }
}, [
createVNode(EyeDropper)
])) : createCommentVNode("", true),
createElementVNode("div", _hoisted_8$5, [
createElementVNode("div", {
style: normalizeStyle(`background-color: ${unref(colorObj).rgba};width: 100%;height: 100%;box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), inset 0 0 4px rgba(0, 0, 0, .25);`)
}, null, 4)
])
]),
createElementVNode("div", _hoisted_9$4, [
createElementVNode("div", _hoisted_10$4, [
createElementVNode("label", null, [
createElementVNode("input", {
value: unref(colorObj).hex8,
onInput: hexChange,
spellcheck: "false"
}, null, 40, _hoisted_11$4)
])
]),
createElementVNode("div", _hoisted_12$3, [
createElementVNode("label", null, [
createElementVNode("input", {
value: unref(red),
onInput: redChange
}, null, 40, _hoisted_13$3)
])
]),
createElementVNode("div", _hoisted_14$2, [
createElementVNode("label", null, [
createElementVNode("input", {
value: unref(green),
onInput: greenChange
}, null, 40, _hoisted_15$1)
])
]),
createElementVNode("div", _hoisted_16$1, [
createElementVNode("label", null, [
createElementVNode("input", {
value: unref(blue),
onInput: blueChange
}, null, 40, _hoisted_17$1)
])
]),
createElementVNode("div", _hoisted_18, [
createElementVNode("label", null, [
createElementVNode("input", {
value: unref(alpha),
onInput: alphaChange
}, null, 40, _hoisted_19)
])
])
]),
createElementVNode("ul", _hoisted_20, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.preset, (item) => {
return openBlock(), createElementBlock("li", {
key: item,
style: normalizeStyle(`background-color: ${item}`),
onClick: ($event) => presetChange(item)
}, null, 12, _hoisted_21);
}), 128))
])
])
]),
default: withCtx(() => [
createElementVNode("div", {
class: normalizeClass(["layui-unselect layui-colorpicker", [{ "layui-colorpicker-disabled": __props.disabled }]])
}, [
createElementVNode("span", null, [
createElementVNode("span", {
class: "layui-colorpicker-trigger-span",
"lay-type": "",
style: normalizeStyle(`background-color: ${unref(colorObj).rgba}`)
}, _hoisted_2$i, 4)
])
], 2)
]),
_: 1
}, 8, ["disabled", "contentClass", "contentStyle"]);
};
}
});
const component$o = withInstall(_sfc_main$t);
const component$n = withInstall(_sfc_main$11);
var index$e = /* @__PURE__ */ (() => ":root{--button-primary-text-color: #fff;--button-primary-background-color: var(--global-primary-color);--button-primary-border-color: var(--global-primary-color);--button-normal-text-color: #fff;--button-normal-background-color: var(--global-normal-color);--button-normal-border-color: var(--global-normal-color);--button-warm-text-color: #fff;--button-warm-background-color: var(--global-warm-color);--button-warm-border-color: var(--global-warm-color);--button-danger-text-color: #fff;--button-danger-background-color: var(--global-danger-color);--button-danger-border-color: var(--global-danger-color);--button-border-radius: var(--global-border-radius);--button-border-color: var(--global-neutral-color-6);--button-background-color: 0 0;--button-text-color: #666}.layui-btn{height:38px;line-height:36px;padding:0 18px;font-size:14px;text-align:center;white-space:nowrap;color:var(--button-text-color);background:var(--button-background-color);border-radius:var(--button-border-radius);border-color:var(--button-border-color);border-width:1px;border-style:solid;cursor:pointer}.layui-btn-primary{color:var(--button-primary-text-color);background-color:var(--button-primary-background-color);border-color:var(--button-primary-border-color)}.layui-btn-normal{color:var(--button-normal-text-color);background-color:var(--button-normal-background-color);border-color:var(--button-normal-border-color)}.layui-btn-warm{color:var(--button-warm-text-color);background-color:var(--button-warm-background-color);border-color:var(--button-warm-border-color)}.layui-btn-danger{color:var(--button-danger-text-color);background-color:var(--button-danger-background-color);border-color:var(--button-danger-border-color)}.layui-btn:hover{opacity:.8;filter:alpha(opacity=80)}.layui-btn:active{opacity:1;filter:alpha(opacity=100)}.layui-btn-lg{height:44px;line-height:44px;padding:0 25px;font-size:16px}.layui-btn-sm{height:30px;line-height:30px;padding:0 10px;font-size:12px}.layui-btn-xs{height:22px;line-height:22px;padding:0 5px;font-size:12px}.layui-btn-xs i{font-size:12px!important}.layui-btn-fluid{width:100%}.layui-btn-radius{border-radius:100px}.layui-btn-disabled,.layui-btn-disabled:active,.layui-btn-disabled:hover{border-color:#eee!important;background-color:#fbfbfb!important;color:#d2d2d2!important;cursor:not-allowed!important;opacity:1}.layui-btn+.layui-btn{margin-left:10px}.layui-btn .layui-icon{padding:0 2px;vertical-align:middle\\ ;vertical-align:bottom}:root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input
function add(arg1, arg2) {
var r1, r2, m, c;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
c = Math.abs(r1 - r2);
m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
var cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", "")) * cm;
} else {
arg1 = Number(arg1.toString().replace(".", "")) * cm;
arg2 = Number(arg2.toString().replace(".", ""));
}
} else {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", ""));
}
return (arg1 + arg2) / m;
}
function sub(arg1, arg2) {
var r1, r2, m, c;
try {
r1 = arg1.toString().split(".")[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = arg2.toString().split(".")[1].length;
} catch (e) {
r2 = 0;
}
c = Math.abs(r1 - r2);
m = Math.pow(10, Math.max(r1, r2));
if (c > 0) {
var cm = Math.pow(10, c);
if (r1 > r2) {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", "")) * cm;
} else {
arg1 = Number(arg1.toString().replace(".", "")) * cm;
arg2 = Number(arg2.toString().replace(".", ""));
}
} else {
arg1 = Number(arg1.toString().replace(".", ""));
arg2 = Number(arg2.toString().replace(".", ""));
}
return (arg1 - arg2) / m;
}
const _hoisted_1$j = ["position", "size"];
const _hoisted_2$h = { class: "layui-input-number-input" };
const __default__$r = {
name: "LayInputNumber"
};
const _sfc_main$s = defineComponent({
...__default__$r,
props: {
modelValue: { default: 0 },
name: null,
disabled: { type: Boolean, default: false },
disabledInput: { type: Boolean, default: false },
size: { default: "md" },
step: { default: 1 },
position: null,
min: { default: -Infinity },
max: { default: Infinity }
},
emits: ["update:modelValue", "change"],
setup(__props, { emit }) {
const props = __props;
let num = ref(props.modelValue);
watch(num, (val) => {
if (props.max !== Infinity && val > props.max) {
num.value = props.max;
return;
}
if (props.min !== -Infinity && val < props.min) {
num.value = props.min;
return;
}
if (isNumber2(num.value)) {
tempValue.value = Number(num.value);
emit("update:modelValue", tempValue.value);
emit("change", tempValue.value);
}
});
watch(() => props.modelValue, (val) => {
if (val !== num.value) {
num.value = props.modelValue;
}
});
let timer = 0;
const tempValue = ref(0);
const minControl = computed$1(() => {
if (props.disabled) {
return true;
}
if (props.min !== -Infinity) {
return Number(props.min) >= num.value;
}
});
const maxControl = computed$1(() => {
if (props.disabled) {
return true;
}
if (props.max !== Infinity) {
return Number(props.max) <= num.value;
}
});
const addition = function() {
num.value = add(num.value, props.step);
};
const subtraction = function() {
num.value = sub(num.value, props.step);
};
const longDown = function(fn) {
cancelLongDown();
if (props.disabled) {
return;
}
timer = setInterval(() => fn.call(timer), 150);
fn.call(timer);
};
const cancelLongDown = function() {
clearInterval(timer);
};
const inputChange = function() {
if (isNumber2(num.value)) {
tempValue.value = Number(num.value);
return;
}
num.value = tempValue.value;
};
const isNumber2 = function(num2) {
return !isNaN(num2);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: "layui-input-number",
position: __props.position,
size: __props.size
}, [
createVNode(_sfc_main$1C, {
size: "lg",
onMouseup: cancelLongDown,
onMousedown: _cache[0] || (_cache[0] = ($event) => longDown(subtraction)),
onBlur: cancelLongDown,
disabled: unref(minControl),
class: "layui-control-btn layui-subtraction-btn"
}, {
default: withCtx(() => [
createVNode(unref(_sfc_main$2E), {
type: __props.position === "right" ? "layui-icon-down" : "layui-icon-subtraction"
}, null, 8, ["type"])
]),
_: 1
}, 8, ["disabled"]),
createElementVNode("div", _hoisted_2$h, [
createVNode(_sfc_main$1v, {
max: __props.max,
min: __props.min,
name: __props.name,
modelValue: unref(num),
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef(num) ? num.value = $event : num = $event),
readonly: __props.disabledInput || __props.disabled,
disabled: __props.disabledInput || __props.disabled,
onInput: inputChange,
type: "number"
}, null, 8, ["max", "min", "name", "modelValue", "readonly", "disabled"])
]),
createVNode(_sfc_main$1C, {
size: "lg",
onMouseup: cancelLongDown,
onMousedown: _cache[2] || (_cache[2] = ($event) => longDown(addition)),
onBlur: cancelLongDown,
disabled: unref(maxControl),
class: "layui-control-btn layui-addition-btn"
}, {
default: withCtx(() => [
createVNode(unref(_sfc_main$2E), {
type: __props.position === "right" ? "layui-icon-up" : "layui-icon-addition"
}, null, 8, ["type"])
]),
_: 1
}, 8, ["disabled"])
], 8, _hoisted_1$j);
};
}
});
const component$m = withInstall(_sfc_main$s);
var index$d = /* @__PURE__ */ (() => ".lay-skeleton .lay-skeleton-item,.lay-skeleton .lay-skeleton-type--p{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee}.lay-skeleton .lay-skeleton-type--image{width:240px;height:240px;background:#eeeeee;display:flex;justify-content:center;align-items:center}.lay-skeleton .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-type--image{width:240px;height:240px!important;display:flex;justify-content:center;align-items:center}.lay-skeleton-animated .lay-skeleton-type--image i{font-size:40px}.lay-skeleton-animated .lay-skeleton-item{height:16px;border-radius:5px;margin-bottom:16px;background:#eeeeee;background:linear-gradient(90deg,#f2f2f2 25%,#ececec 37%,#f2f2f2 63%);background-size:400% 100%;animation:lay-skeleton-loading 1.2s ease infinite}.lay-skeleton-first{width:30%}.lay-skeleton-last{width:62.8%}@keyframes lay-skeleton-loading{0%{background-position:100% 50%}to{background-position:0 50%}}\n")();
const _hoisted_1$i = { key: 0 };
const __default__$q = {
name: "LaySkeletonItem"
};
const _sfc_main$r = defineComponent({
...__default__$q,
props: {
type: { default: "p" }
},
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", mergeProps({
class: ["lay-skeleton-item", `lay-skeleton-type--${__props.type}`]
}, _ctx.$attrs), [
__props.type === "image" ? (openBlock(), createElementBlock("div", _hoisted_1$i, [
createVNode(unref(_sfc_main$2E), { type: "layui-icon-picture" })
])) : createCommentVNode("", true)
], 16);
};
}
});
const __default__$p = {
name: "LaySkeleton"
};
const _sfc_main$q = defineComponent({
...__default__$p,
props: {
rows: { default: 4 },
loading: { type: Boolean, default: false },
animated: { type: Boolean, default: false }
},
setup(__props) {
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", mergeProps({
class: ["lay-skeleton", __props.animated ? "lay-skeleton-animated" : ""]
}, _ctx.$attrs), [
__props.loading ? renderSlot(_ctx.$slots, "skeleton", { key: 0 }, () => [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.rows, (item) => {
return openBlock(), createBlock(_sfc_main$r, {
key: item,
class: normalizeClass([
item === 1 ? "lay-skeleton-first" : "",
item === __props.rows ? "lay-skeleton-last" : ""
]),
type: "p"
}, null, 8, ["class"]);
}), 128))
]) : renderSlot(_ctx.$slots, "default", { key: 1 })
], 16);
};
}
});
const component$l = withInstall(_sfc_main$q);
const component$k = withInstall(_sfc_main$r);
var index$c = /* @__PURE__ */ (() => '.lay-step{display:flex;flex-wrap:nowrap}.lay-step .lay-step-item{flex-grow:1;position:relative}.lay-step .is-item-center{text-align:center}.lay-step .lay-step-item-last{flex-grow:0!important}.lay-step .lay-step-item-pace{position:relative;z-index:10;cursor:pointer;width:24px;height:24px;border:1px #8d8d8d solid;border-radius:50%;text-align:center;line-height:24px;background:#ffffff}.lay-step .is-center{margin:0 auto}.lay-step .lay-step-item-active{border:1px #5fb878 solid;color:#5fb878}.lay-step .lay-step-item-wait{border:1px #000000 solid;color:#000}.lay-step .lay-step-item--success{border:1px #5fb878 solid;color:#fff;background:#5fb878}.lay-step .lay-step-item--fail{border:1px #ff5722 solid;color:#fff;background:#ff5722}.lay-step .lay-step-item--warning{border:1px #ffb800 solid;color:#fff;background:#ffb800}.lay-step .lay-step-item--primary{border:1px #1e9fff solid;color:#fff;background:#1e9fff}.lay-step .lay-step-item-success{border:1px #5fb878 solid;color:#fff;background:#5fb878}.lay-step .lay-step-item-fail{border:1px #ff5722 solid;color:#fff;background:#ff5722}.lay-step .lay-step-item-warning{border:1px #ffb800 solid;color:#fff;background:#ffb800}.lay-step .lay-step-item-primary{border:1px #1e9fff solid;color:#fff;background:#1e9fff}.lay-step .lay-step-item-content{color:#8d8d8d;cursor:pointer}.lay-step .lay-step-item-content .lay-step-item-content-title{font-weight:700;font-size:16px}.lay-step .lay-step-item-content-row{color:#8d8d8d;position:absolute;top:5px;left:24px;width:calc(100% - 26px)}.lay-step .lay-step-item-content-row .lay-step-item-content-title{word-wrap:break-word;max-width:calc(100% - 8px);font-weight:700;display:inline-block;margin-left:2px;background:#ffffff;padding:0 8px;font-size:16px}.lay-step .lay-step-item-content-active,.lay-step .lay-step-item-content--success{color:#5fb878}.lay-step .lay-step-item-content--fail{color:#ff5722}.lay-step .lay-step-item-content--warning{color:#ffb800}.lay-step .lay-step-item-content--primary{color:#1e9fff}.lay-step .lay-step-item-content-wait{color:#000}.lay-step .lay-step-item-content-success{color:#5fb878}.lay-step .lay-step-item-content-fail{color:#ff5722}.lay-step .lay-step-item-content-warning{color:#ffb800}.lay-step .lay-step-item-content-primary{color:#1e9fff}.lay-step .lay-step-item-line{position:relative}.lay-step .lay-step-item-line:before{content:"";position:absolute;top:50%;display:block;height:1px;width:100%;background:#c9c5c5}.lay-step .is-line-center:before{left:50%}.lay-step .lay-step-item-line-active:before{transition:background .15s;background:#5fb878!important}.lay-step .lay-step-item-line-fail:before{transition:background .15s;background:#ff5722!important}.lay-step .lay-step-item-line-warning:before{transition:background .15s;background:#ffb800!important}.lay-step .lay-step-item-line-primary:before{transition:background .15s;background:#1e9fff!important}.lay-step .lay-step-simple{height:30px;padding:0 8px;line-height:30px;color:#fff;background-color:#cecece;cursor:pointer}.lay-step .lay-step-item-simple{padding:0 18px}.lay-step .lay-step-item-simple:after{content:"";position:absolute;top:0;left:0;right:auto;bottom:auto;border:15px solid;border-color:transparent transparent transparent #cecece;background-color:transparent;border-radius:0;display:block;height:auto;width:auto}.lay-step .lay-step-item-simple:before{content:"";position:absolute;top:0;left:0;right:auto;bottom:auto;border:15px solid;border-color:transparent transparent transparent #cecece;background-color:transparent;border-radius:0;display:block;height:auto;width:auto}.lay-step .lay-step-item-simple-border:before{left:1px;border-color:transparent transparent transparent #ffffff}.lay-step .lay-step-item-simple-active{background-color:#9fd4ae}.lay-step .lay-step-item-simple-success{background-color:#5fb878}.lay-step .lay-step-item-simple-fail{background-color:#ff5722}.lay-step .lay-step-item-simple-warning{background-color:#ffb800}.lay-step .lay-step-item-simple-primary{background-color:#1e9fff}.lay-step .lay-step-item-simple-active-border:aft
const __default__$o = {
name: "LayStep"
};
const _sfc_main$p = defineComponent({
...__default__$o,
props: {
active: { default: 0 },
center: { type: Boolean, default: false },
direction: { default: "horizontal" },
space: { default: "auto" },
currentStatus: { default: "success" },
composition: { default: "default" },
simple: { type: Boolean, default: false }
},
emits: ["onChange"],
setup(__props, { emit: emits }) {
const props = __props;
const steps = ref([]);
const change3 = (index2) => {
emits("onChange", index2 - 1);
};
watch(steps, () => {
steps.value.forEach((instance, index2) => {
instance.setIndex(index2);
});
});
provide("LayStep", {
props,
steps,
change: change3
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["lay-step", __props.direction !== "vertical" ? "" : "lay-step-column"])
}, [
renderSlot(_ctx.$slots, "default")
], 2);
};
}
});
const component$j = withInstall(_sfc_main$p);
const _hoisted_1$h = { key: 0 };
const _hoisted_2$g = { class: "lay-step-item-content-title" };
const __default__$n = {
name: "LayStepItem"
};
const _sfc_main$o = defineComponent({
...__default__$n,
props: {
title: { default: "" },
content: { default: "" },
icon: { default: "" },
status: { default: "" }
},
setup(__props) {
const index2 = ref(-1);
const parents = inject("LayStep");
const currentInstance = getCurrentInstance();
const setIndex = (val) => {
index2.value = val;
};
const onChange = (index22) => {
parents.change(index22);
};
const stepsCount = computed$1(() => {
return parents.steps.value.length;
});
const currentStatus = computed$1(() => {
return parents.props.currentStatus;
});
const simple = computed$1(() => {
return parents.props.simple;
});
const composition = computed$1(() => {
return parents.props.composition;
});
const isCurrent = computed$1(() => {
return parents.props.active;
});
const isCurrentBorder = computed$1(() => {
return parents.props.active + 1;
});
const space = computed$1(() => {
return parents.props.space;
});
const isVertical = computed$1(() => {
return parents.props.direction === "vertical";
});
const isCenter = computed$1(() => {
return parents.props.center;
});
const isLineActive = computed$1(() => {
return index2.value <= parents.props.active - 1;
});
const isWait = computed$1(() => {
return index2.value === parents.props.active + 1;
});
const isSimpleActive = computed$1(() => {
return index2.value - 1 <= parents.props.active;
});
const isActive = computed$1(() => {
return index2.value <= parents.props.active;
});
const isLast = computed$1(() => {
var _a2;
return ((_a2 = parents.steps.value[stepsCount.value - 1]) == null ? void 0 : _a2.itemId) === currentInstance.uid;
});
const isStart = computed$1(() => {
var _a2;
return ((_a2 = parents.steps.value[0]) == null ? void 0 : _a2.itemId) === currentInstance.uid;
});
const stepItemState = reactive({
itemId: computed$1(() => currentInstance == null ? void 0 : currentInstance.uid),
setIndex
});
parents.steps.value = [...parents.steps.value, stepItemState];
onMounted(() => {
});
onBeforeUnmount(() => {
parents.steps.value = parents.steps.value.filter((instance) => instance.itemId !== currentInstance.uid);
});
return (_ctx, _cache) => {
return !unref(simple) ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass([
"lay-step-item",
unref(isLast) && !unref(isCenter) && unref(composition) !== "row" ? "lay-step-item-last" : "",
unref(isCenter) ? "is-item-center" : "",
unref(isVertical) ? "is-vertical" : ""
]),
style: normalizeStyle({ flexBasis: unref(space), flexGrow: unref(space) === "auto" ? 1 : 0 })
}, [
createElementVNode("div", {
class: normalizeClass([
!unref(isLast) ? unref(isLineActive) ? `lay-step-item-line lay-step-item-line-${__props.status || "active"}` : "lay-step-item-line" : "",
unref(isCenter) ? "is-line-center" : ""
])
}, [
createElementVNode("div", {
class: normalizeClass([
"lay-step-item-pace",
unref(isActive) ? `lay-step-item-active` : "",
unref(isCurrent) === index2.value ? `lay-step-item--${unref(currentStatus)}` : "",
__props.status ? `lay-step-item-${__props.status}` : "",
unref(isWait) ? "lay-step-item-wait" : "",
unref(isCenter) ? "is-center" : ""
]),
onClick: _cache[0] || (_cache[0] = ($event) => onChange(index2.value + 1))
}, [
renderSlot(_ctx.$slots, "pace", {}, () => [
__props.icon ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 0,
type: __props.icon
}, null, 8, ["type"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
!unref(isActive) ? (openBlock(), createElementBlock("span", _hoisted_1$h, toDisplayString$1(index2.value + 1), 1)) : (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: __props.status === "fail" ? "layui-icon-close" : "layui-icon-ok"
}, null, 8, ["type"]))
], 64))
])
], 2)
], 2),
createElementVNode("div", {
class: normalizeClass([
"lay-step-item-content",
unref(composition) === "row" ? "lay-step-item-content-row" : "",
unref(isActive) ? `lay-step-item-content-active` : "",
unref(isCurrent) === index2.value ? `lay-step-item-content--${unref(currentStatus)}` : "",
__props.status ? `lay-step-item-content-${__props.status}` : "",
unref(isWait) ? "lay-step-item-content-wait" : ""
]),
onClick: _cache[1] || (_cache[1] = ($event) => onChange(index2.value + 1))
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createElementVNode("div", _hoisted_2$g, toDisplayString$1(__props.title), 1),
createElementVNode("p", null, toDisplayString$1(__props.content), 1)
])
], 2)
], 6)) : (openBlock(), createElementBlock("div", {
key: 1,
class: normalizeClass([
"lay-step-item",
"lay-step-simple",
!unref(isStart) ? "lay-step-item-simple" : "",
"lay-step-item-simple-border",
unref(isActive) ? "lay-step-item-simple-active" : "",
unref(isCurrent) === index2.value ? `lay-step-item-simple-${unref(currentStatus)}` : "",
unref(isCurrentBorder) === index2.value ? `lay-step-item-simple-${unref(currentStatus)}-border` : "",
unref(isSimpleActive) ? "lay-step-item-simple-active-border" : ""
]),
onClick: _cache[2] || (_cache[2] = ($event) => onChange(index2.value + 1))
}, [
renderSlot(_ctx.$slots, "default", {}, () => [
createTextVNode(toDisplayString$1(index2.value + 1) + "." + toDisplayString$1(__props.title), 1)
])
], 2));
};
}
});
const component$i = withInstall(_sfc_main$o);
const _hoisted_1$g = { class: "layui-nav-item" };
const _hoisted_2$f = {
href: "javascript:void(0)",
style: { "justify-content": "space-between" }
};
const _hoisted_3$e = {
key: 0,
class: "layui-sub-menu-icon"
};
const _hoisted_4$b = { key: 1 };
2022-12-30 08:13:19 +00:00
const _hoisted_5$a = {
2022-11-15 01:16:55 +00:00
key: 0,
class: "layui-nav-more"
};
const __default__$m = {
name: "SubMenuPopup"
};
const _sfc_main$n = defineComponent({
...__default__$m,
props: {
id: null,
title: null
},
setup(__props) {
const { level } = useLevel();
const isTree = inject("isTree");
const theme = inject("menuTheme");
const computedTheme = computed$1(() => {
return theme.value === "light" ? "-light" : "";
});
const computedExpandIcon = computed$1(() => {
if (isTree.value)
return "layui-icon-right";
return level.value === 2 ? "layui-icon-down" : "layui-icon-right";
});
const computedPlacement = computed$1(() => {
return !isTree.value && level.value === 2 ? "bottom" : "right-start";
});
return (_ctx, _cache) => {
return openBlock(), createBlock(_sfc_main$1y, {
trigger: "hover",
class: "layui-sub-menu-popup",
placement: unref(computedPlacement),
autoFitMinWidth: false,
updateAtScroll: true,
contentOffset: 3
}, {
content: withCtx(() => [
createElementVNode("div", {
class: normalizeClass([
"layui-sub-menu-popup-content",
`layui-sub-menu-popup-theme${unref(computedTheme)}`
])
}, [
renderSlot(_ctx.$slots, "default")
], 2)
]),
default: withCtx(() => [
createElementVNode("li", _hoisted_1$g, [
createElementVNode("a", _hoisted_2$f, [
createElementVNode("div", null, [
_ctx.$slots.icon ? (openBlock(), createElementBlock("i", _hoisted_3$e, [
renderSlot(_ctx.$slots, "icon")
])) : createCommentVNode("", true),
_ctx.$slots.title ? (openBlock(), createElementBlock("span", _hoisted_4$b, [
renderSlot(_ctx.$slots, "title")
])) : createCommentVNode("", true)
]),
2022-12-30 08:13:19 +00:00
_ctx.$slots.expandIcon ? (openBlock(), createElementBlock("span", _hoisted_5$a, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "expandIcon", {}, () => [
createVNode(unref(_sfc_main$2E), { type: unref(computedExpandIcon) }, null, 8, ["type"])
])
])) : createCommentVNode("", true)
])
])
]),
_: 3
}, 8, ["placement"]);
};
}
});
const _hoisted_1$f = {
key: 0,
class: "layui-nav-item"
};
const _hoisted_2$e = {
key: 0,
class: "layui-sub-menu-icon"
};
const _hoisted_3$d = {
key: 1,
class: "layui-nav-more"
};
const _hoisted_4$a = { key: 0 };
2022-12-30 08:13:19 +00:00
const _hoisted_5$9 = { class: "layui-nav-child" };
2022-11-15 01:16:55 +00:00
const __default__$l = {
name: "LaySubMenu"
};
const _sfc_main$m = defineComponent({
...__default__$l,
props: {
id: null,
title: null
},
setup(__props) {
const props = __props;
const slots = useSlots();
const { level } = useLevel();
const isTree = inject("isTree");
inject("selectedKey");
const openKeys = inject("openKeys");
const indent = inject("indent");
const isCollapse = inject("isCollapse");
const isCollapseTransition = inject("isCollapseTransition");
const isOpen = computed$1(() => {
return openKeys.value.includes(props.id);
});
const nextLevel = computed$1(() => level.value + 1);
provideLevel(nextLevel);
const needPopup = ref(false);
watchEffect(() => {
if (isTree.value) {
const _isCollapse = isCollapse.value === true || isCollapse.value === "true";
if (_isCollapse && level.value === 1) {
setTimeout(() => {
needPopup.value = isTree.value && _isCollapse;
}, 200);
} else {
needPopup.value = isTree.value && _isCollapse;
}
} else if (slots.default && slots.default().length > 0) {
needPopup.value = true;
}
});
const openHandle = function() {
if (!isCollapse.value) {
let newOpenKeys = [...openKeys.value];
if (openKeys.value.includes(props.id)) {
newOpenKeys.splice(newOpenKeys.indexOf(props.id), 1);
} else {
newOpenKeys.push(props.id);
}
openKeys.value = newOpenKeys;
}
};
return (_ctx, _cache) => {
return !needPopup.value ? (openBlock(), createElementBlock("li", _hoisted_1$f, [
createElementVNode("a", {
href: "javascript:void(0)",
onClick: _cache[0] || (_cache[0] = ($event) => openHandle()),
style: normalizeStyle(unref(indentHandle)({ indent: unref(indent), level: unref(level), basePadding: 23, isTree: unref(isTree) }))
}, [
unref(slots).icon ? (openBlock(), createElementBlock("i", _hoisted_2$e, [
renderSlot(_ctx.$slots, "icon")
])) : createCommentVNode("", true),
createElementVNode("span", null, [
unref(slots).title ? renderSlot(_ctx.$slots, "title", { key: 0 }) : createCommentVNode("", true)
]),
unref(slots).expandIcon ? (openBlock(), createElementBlock("i", _hoisted_3$d, [
renderSlot(_ctx.$slots, "expandIcon", { isExpand: unref(isOpen) })
])) : (openBlock(), createElementBlock("i", {
key: 2,
class: normalizeClass([
unref(isOpen) ? "layui-nav-mored" : "",
"layui-icon layui-icon-down",
"layui-nav-more"
])
}, null, 2))
], 4),
unref(isTree) ? (openBlock(), createBlock(_sfc_main$17, {
key: 0,
enable: unref(isCollapseTransition)
}, {
default: withCtx(() => [
unref(isOpen) ? (openBlock(), createElementBlock("div", _hoisted_4$a, [
2022-12-30 08:13:19 +00:00
createElementVNode("dl", _hoisted_5$9, [
2022-11-15 01:16:55 +00:00
renderSlot(_ctx.$slots, "default")
])
])) : createCommentVNode("", true)
]),
_: 3
}, 8, ["enable"])) : createCommentVNode("", true)
])) : (openBlock(), createBlock(_sfc_main$n, {
key: 1,
id: __props.id
}, createSlots({
expandIcon: withCtx(() => [
renderSlot(_ctx.$slots, "expandIcon")
]),
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 2
}, [
unref(slots).icon ? {
name: "icon",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "icon")
]),
key: "0"
} : void 0,
unref(slots).title ? {
name: "title",
fn: withCtx(() => [
renderSlot(_ctx.$slots, "title")
]),
key: "1"
} : void 0
]), 1032, ["id"]));
};
}
});
const component$h = withInstall(_sfc_main$m);
var index$b = /* @__PURE__ */ (() => '.lay-split-panel{height:100%;display:flex;position:relative}.lay-split-panel .lay-split-panel-item{height:100%;border:1px #eeeeee solid}.lay-split-panel .lay-split-panel-item-move{user-select:none;pointer-events:none;cursor:col-resize}.lay-split-panel .lay-split-panel-line{height:100%;width:3px;border:1px #eeeeee solid;background-color:var(--global-neutral-color-1);border-left:none;border-right:none;cursor:col-resize;display:flex;align-items:center}.lay-split-panel .lay-split-panel-line:before{content:"";height:6px;width:100%;border:2px solid #dcdee2;border-left:0;border-right:0}.lay-split-panel-vertical{flex-direction:column;position:relative}.lay-split-panel-vertical .lay-split-panel-item-move{user-select:none;pointer-events:none;cursor:row-resize}.lay-split-panel-vertical .lay-split-panel-line{display:flex;justify-content:center;width:100%;height:3px;cursor:row-resize;border:1px #eeeeee solid;background-color:var(--global-neutral-color-1);border-top:none;border-bottom:none}.lay-split-panel-vertical .lay-split-panel-line:before{content:"";height:100%;width:6px;border:2px solid #dcdee2;border-top:none;border-bottom:none}\n')();
const __default__$k = {
name: "LaySplitPanel"
};
const _sfc_main$l = defineComponent({
...__default__$k,
props: {
vertical: { type: Boolean, default: false },
minSize: { default: 50 }
},
setup(__props) {
const props = __props;
const target = ref();
const { pressed } = useMousePressed({ target });
let domEvent = ref();
let domStatus = ref(pressed);
let parentVertical = ref();
onMounted(() => {
const boxWidth = target.value.offsetWidth;
const boxHeight = target.value.offsetHeight;
target.value.addEventListener("mousemove", (event) => {
if (domStatus.value && domEvent.value) {
const prevDom = domEvent.value.target.previousElementSibling;
const nextDom = domEvent.value.target.nextElementSibling;
if (!props.vertical) {
const prevDomLeft = domEvent.value.target.previousElementSibling.offsetLeft;
const prevDomWidth = domEvent.value.target.previousElementSibling.offsetWidth;
const nextDomWidth = domEvent.value.target.nextElementSibling.offsetWidth;
const otherWidth = boxWidth - (prevDomWidth + nextDomWidth + 5);
const otherWidthPercentage = (prevDomWidth + nextDomWidth + 5) / boxWidth * 100;
if (event.layerX - prevDomLeft < props.minSize || boxWidth - (event.layerX - prevDomLeft) - otherWidth < props.minSize) {
return false;
}
prevDom.style.flexBasis = (event.layerX - prevDomLeft) / (prevDomWidth + nextDomWidth + 5) * otherWidthPercentage + "%";
nextDom.style.flexBasis = (boxWidth - (event.layerX - prevDomLeft) - otherWidth) / (prevDomWidth + nextDomWidth + 5) * otherWidthPercentage + "%";
} else {
const prevDomTop = domEvent.value.target.previousElementSibling.offsetTop;
const prevDomHeight = domEvent.value.target.previousElementSibling.offsetHeight;
const nextDomHeight = domEvent.value.target.nextElementSibling.offsetHeight;
const otherHeight = boxHeight - (prevDomHeight + nextDomHeight + 5);
const otherHeightPercentage = (prevDomHeight + nextDomHeight + 5) / boxHeight * 100;
if (event.layerY - prevDomTop < props.minSize || boxHeight - (event.layerY - prevDomTop) - otherHeight < props.minSize) {
return false;
}
prevDom.style.flexBasis = (event.layerY - prevDomTop) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
nextDom.style.flexBasis = (boxHeight - (event.layerY - prevDomTop) - otherHeight) / (prevDomHeight + nextDomHeight + 5) * otherHeightPercentage + "%";
}
}
});
});
const moveChange = (event, status, isVertical) => {
domEvent.value = event;
domStatus.value = status;
parentVertical.value = isVertical;
};
const mouseup = () => {
domStatus.value = false;
domEvent.value = null;
parentVertical.value = false;
};
const steps = ref([]);
watch(steps, () => {
steps.value.forEach((instance, index2) => {
instance.setIndex(index2);
});
});
provide("laySplitPanel", {
props,
steps,
target,
moveChange
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", mergeProps({
ref_key: "target",
ref: target,
class: ["lay-split-panel", __props.vertical ? "lay-split-panel-vertical" : ""],
style: {
cursor: unref(domStatus) ? !__props.vertical ? "col-resize" : "row-resize" : ""
}
}, toHandlers({ mouseup }, true)), [
renderSlot(_ctx.$slots, "default")
], 16);
};
}
});
const component$g = withInstall(_sfc_main$l);
const __default__$j = {
name: "LaySplitPanelItem"
};
const _sfc_main$k = defineComponent({
...__default__$j,
props: {
space: { default: 0 }
},
setup(__props) {
const props = __props;
const index2 = ref(-1);
const parents = inject("laySplitPanel");
const currentInstance = getCurrentInstance();
const moveStatus = ref(false);
const setIndex = (val) => {
index2.value = val;
};
const mouseup = (event) => {
moveStatus.value = false;
};
const stepsCount = computed$1(() => {
return parents.steps.value.length;
});
const initSpace = (parentSpace, key) => {
const childList = Array.from(parentElement.value.children);
childList.forEach((item, index22) => {
if (index22 === 0 || index22 % 2 === 0) {
item.style.flexBasis = item[key] / parentSpace * 100 + "%";
item.style.flexGrow = 0;
}
});
};
const mousedown = (event) => {
let parentSpace = 0;
if (!isVertical.value) {
parentSpace = parentElement.value.offsetWidth;
initSpace(parentSpace, "offsetWidth");
} else {
parentSpace = parentElement.value.offsetHeight;
initSpace(parentSpace, "offsetHeight");
}
moveStatus.value = true;
parents.moveChange(event, true, isVertical.value);
};
const parentElement = computed$1(() => {
return parents.target.value;
});
const isVertical = computed$1(() => {
return parents.props.vertical;
});
computed$1(() => {
var _a2;
return ((_a2 = parents.steps.value[stepsCount.value - 1]) == null ? void 0 : _a2.itemId) === currentInstance.uid;
});
const isStart = computed$1(() => {
var _a2;
return ((_a2 = parents.steps.value[0]) == null ? void 0 : _a2.itemId) === currentInstance.uid;
});
const stepItemState = reactive({
itemId: computed$1(() => currentInstance == null ? void 0 : currentInstance.uid),
setIndex,
space: props.space
});
parents.steps.value = [...parents.steps.value, stepItemState];
onMounted(() => {
});
onBeforeUnmount(() => {
parents.steps.value = parents.steps.value.filter((instance) => instance.itemId !== currentInstance.uid);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock(Fragment, null, [
!unref(isStart) ? (openBlock(), createElementBlock("div", mergeProps({
key: 0,
class: [!unref(isStart) ? "lay-split-panel-line" : ""],
ref: "el"
}, toHandlers({ mousedown, mouseup }, true)), null, 16)) : createCommentVNode("", true),
unref(isVertical) ? (openBlock(), createElementBlock("div", {
key: 1,
ref: "laySplitPanelItem",
class: normalizeClass(["lay-split-panel-item"]),
style: normalizeStyle({ flexBasis: `${__props.space}px`, flexGrow: __props.space ? 0 : 1 })
}, [
renderSlot(_ctx.$slots, "default")
], 4)) : (openBlock(), createElementBlock("div", {
key: 2,
class: normalizeClass(["lay-split-panel-item"]),
style: normalizeStyle({ flexBasis: `${__props.space}px`, flexGrow: __props.space ? 0 : 1 })
}, [
renderSlot(_ctx.$slots, "default")
], 4))
], 64);
};
}
});
const component$f = withInstall(_sfc_main$k);
var index$a = /* @__PURE__ */ (() => ".layui-exception .layui-exception-image{width:50%;display:inline-block;vertical-align:top}.layui-exception .layui-exception-image>div{height:200px;background-size:100% 100%;background-repeat:no-repeat}.layui-exception .layui-exception-image .error-401{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCjxzdmcgd2lkdGg9IjgzMnB4IiBoZWlnaHQ9IjgyMXB4IiB2aWV3Qm94PSIwIDAgODMyIDgyMSIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4NCiAgICA8dGl0bGU+NDAxPC90aXRsZT4NCiAgICA8ZyBpZD0i5qGG5p626K6+6K6hLei/h+eoi+eJiCIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+DQogICAgICAgIDxnIGlkPSLnvLrnnIHlm74iIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0xMzM3LjAwMDAwMCwgLTMwMDAuMDAwMDAwKSI+DQogICAgICAgICAgICA8ZyBpZD0iNDAxIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMzM3LjAwMDAwMCwgMzAwMC4wMDAwMDApIj4NCiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNNDI1LjI0MDcsMjU0LjA2NTQgQzQyNS4yMjU3LDI1NC4wNjU0IDQyNS4yMTE3LDI1NC4wNjU0IDQyNS4xOTY3LDI1NC4wNjQ0IEM0MjMuMjI0NywyNTQuMDA4NCA0MjEuMjM3NywyNTMuOTg1NCA0MTkuMjU2NywyNTQuMDA2NCBMNDE5LjI0MDcsMjU0LjAwNjQgQzQxOC40MTk3LDI1NC4wMDY0IDQxNy43NDk3LDI1My4zNDU0IDQxNy43NDA3LDI1Mi41MjI0IEM0MTcuNzMxNywyNTEuNjkzNCA0MTguMzk2NywyNTEuMDE1NCA0MTkuMjI0NywyNTEuMDA2NCBDNDIxLjI1MTcsMjUwLjk4NjQgNDIzLjI3MDcsMjUxLjAwODQgNDI1LjI4MjcsMjUxLjA2NjQgQzQyNi4xMTA3LDI1MS4wODk0IDQyNi43NjE3LDI1MS43ODA0IDQyNi43Mzg3LDI1Mi42MDg0IEM0MjYuNzE2NywyNTMuNDIxNCA0MjYuMDQ5NywyNTQuMDY1NCA0MjUuMjQwNywyNTQuMDY1NCBMNDI1LjI0MDcsMjU0LjA2NTQgWiBNNDA3LjI1ODcsMjU0LjU2MTQgQzQwNi40ODY3LDI1NC41NjE0IDQwNS44MzE3LDI1My45Njk0IDQwNS43NjQ3LDI1My4xODc0IEM0MDUuNjk1NywyNTIuMzYyNCA0MDYuMzA4NywyNTEuNjM2NCA0MDcuMTM0NywyNTEuNTY2NCBDNDA5LjEyNzcsMjUxLjM5OTQgNDExLjE2MDcsMjUxLjI2NjQgNDEzLjE3NTcsMjUxLjE3MzQgQzQxMy45OTI3LDI1MS4xNTU0IDQxNC43MDQ3LDI1MS43NzU0IDQxNC43NDI3LDI1Mi42MDI0IEM0MTQuNzgxNywyNTMuNDI5NCA0MTQuMTQwNywyNTQuMTMxNCA0MTMuMzEzNywyNTQuMTY5NCBDNDExLjMzNjcsMjU0LjI2MTQgNDA5LjM0MjcsMjU0LjM5MTQgNDA3LjM4NjcsMjU0LjU1NjQgQzQwNy4zNDM3LDI1NC41NTk0IDQwNy4zMDA3LDI1NC41NjE0IDQwNy4yNTg3LDI1NC41NjE0IEw0MDcuMjU4NywyNTQuNTYxNCBaIE00MzcuMjA5NywyNTQuODUzNCBDNDM3LjE1NzcsMjU0Ljg1MzQgNDM3LjEwNDcsMjU0Ljg1MDQgNDM3LjA1MjcsMjU0Ljg0NTQgQzQzNS4xMDc3LDI1NC42NDM0IDQzMy4xMTU3LDI1NC40NzM0IDQzMS4xMzI3LDI1NC4zNDI0IEM0MzAuMzA1NywyNTQuMjg3NCA0MjkuNjc5NywyNTMuNTczNCA0MjkuNzM0NywyNTIuNzQ2NCBDNDI5Ljc4OTcsMjUxLjkxOTQgNDMwLjUyMDcsMjUxLjI5MTQgNDMxLjMzMTcsMjUxLjM0ODQgQzQzMy4zNTE3LDI1MS40ODM0IDQzNS4zODE3LDI1MS42NTU0IDQzNy4zNjI3LDI1MS44NjE0IEM0MzguMTg2NywyNTEuOTQ3NCA0MzguNzg1NywyNTIuNjg0NCA0MzguNjk5NywyNTMuNTA4NCBDNDM4LjYxOTcsMjU0LjI4MDQgNDM3Ljk2ODcsMjU0Ljg1MzQgNDM3LjIwOTcsMjU0Ljg1MzQgTDQzNy4yMDk3LDI1NC44NTM0IFogTTM5NS4zNTM3LDI1Ni4wMTg0IEMzOTQuNjMwNywyNTYuMDE4NCAzOTMuOTkzNywyNTUuNDk0NCAzOTMuODc1NywyNTQuNzU3NCBDMzkzLjc0MzcsMjUzLjkzOTQgMzk0LjI5OTcsMjUzLjE2OTQgMzk1LjExNjcsMjUzLjAzODQgQzM5Ny4wOTQ3LDI1Mi43MTg0IDM5OS4xMTE3LDI1Mi40MzM0IDQwMS4xMTI3LDI1Mi4xODg0IEM0MDEuOTI4NywyNTIuMTAwNCA0MDIuNjgyNywyNTIuNjczNCA0MDIuNzgzNywyNTMuNDk2NCBDNDAyLjg4NDcsMjU0LjMxODQgNDAyLjI5ODcsMjU1LjA2NjQgNDAxLjQ3NTcsMjU1LjE2NzQgQzM5OS41MTI3LDI1NS40MDY0IDM5Ny41MzQ3LDI1NS42ODY0IDM5NS41OTQ3LDI1NS45OTk0IEMzOTUuNTEzNywyNTYuMDEyNCAzOTUuNDMyNywyNTYuMDE4NCAzOTUuMzUzNywyNTYuMDE4NCBMMzk1LjM1MzcsMjU2LjAxODQgWiBNNDQ5LjA4MjcsMjU2LjU0NDQgQzQ0OC45OTM3LDI1Ni41NDQ0IDQ0OC45MDM3LDI1Ni41Mzc0IDQ0OC44MTI3LDI1Ni41MjA0IEM0NDYuODc5NywyNTYuMTY5NCA0NDQuOTA2NywyNTUuODUxNCA0NDIuOTQ3NywyNTUuNTcyNCBDNDQyLjEyNzcsMjU1LjQ1NTQgNDQxLjU1NzcsMjU0LjY5NTQgNDQxLjY3NDcsMjUzLjg3NTQgQzQ0MS43OTI3LDI1My4wNTQ0IDQ0Mi41NDM3LDI1Mi40OTE0IDQ0My4zNzE3LDI1Mi42MDE0IEM0NDUuMzY2NywyNTIuODg2NCA0NDcuMzc3NywyNTMuMjExNCA0NDkuMzQ3NywyNTMuNTY5NCBDNDUwLjE2MzcsMjUzLjcxNjQgNDUwLjcwNDcsMjU0LjQ5NzQgNDUwLjU1NTcsMjU1LjMxMjQgQzQ1MC40MjU3LDI1Ni4wMzc0IDQ0OS43OTM3LDI1Ni41NDQ0IDQ0OS4wODI3LDI1Ni41NDQ0IEw0NDkuMDgyNywyNTYuNTQ0NCBaIE0zODMuNTk1NywyNTguMzc3NCBDMzgyLjkxODcsMjU4LjM3NzQgMzgyLjMwMzcsMjU3LjkxNTQgMzgyLjEzODcsMjU3LjIyNzQgQzM4MS45NDQ3LDI1Ni40MjE0IDM4Mi40NDA3LDI1NS42MTI0IDM4My4yNDY3LDI1NS40MTk0IEMzODUuMTk2NywyNTQuOTQ5NCAzODcuMTg1NywyNTQuNTEwNCAzODkuMTU4NywyNTQuMTE1NC
const _hoisted_1$e = { class: "layui-exception" };
const _hoisted_2$d = { class: "layui-exception-image" };
const _hoisted_3$c = {
key: 0,
class: "error-401"
};
const _hoisted_4$9 = {
key: 1,
class: "error-403"
};
2022-12-30 08:13:19 +00:00
const _hoisted_5$8 = {
2022-11-15 01:16:55 +00:00
key: 2,
class: "error-404"
};
const _hoisted_6$7 = {
key: 3,
class: "error-500"
};
const _hoisted_7$7 = { class: "layui-exception-details" };
const _hoisted_8$4 = { class: "layui-exception-details-content" };
const _hoisted_9$3 = { class: "layui-exception-details-title" };
const _hoisted_10$3 = { class: "layui-exception-details-describe" };
const _hoisted_11$3 = { class: "layui-exception-details-extra" };
const __default__$i = {
name: "LayException"
};
const _sfc_main$j = defineComponent({
...__default__$i,
props: {
title: { default: "exception" },
status: null,
describe: { default: "describe" }
},
setup(__props) {
const slots = useSlots();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$e, [
createElementVNode("div", _hoisted_2$d, [
unref(slots).default ? renderSlot(_ctx.$slots, "image", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
__props.status == "401" ? (openBlock(), createElementBlock("div", _hoisted_3$c)) : createCommentVNode("", true),
__props.status == "403" ? (openBlock(), createElementBlock("div", _hoisted_4$9)) : createCommentVNode("", true),
2022-12-30 08:13:19 +00:00
__props.status == "404" ? (openBlock(), createElementBlock("div", _hoisted_5$8)) : createCommentVNode("", true),
2022-11-15 01:16:55 +00:00
__props.status == "500" ? (openBlock(), createElementBlock("div", _hoisted_6$7)) : createCommentVNode("", true)
], 64))
]),
createElementVNode("div", _hoisted_7$7, [
createElementVNode("div", _hoisted_8$4, [
createElementVNode("div", _hoisted_9$3, toDisplayString$1(__props.title), 1),
createElementVNode("div", _hoisted_10$3, toDisplayString$1(__props.describe), 1),
createElementVNode("div", _hoisted_11$3, [
renderSlot(_ctx.$slots, "extra")
])
])
])
]);
};
}
});
const component$e = withInstall(_sfc_main$j);
var index$9 = /* @__PURE__ */ (() => ".result{text-align:center}.result .success svg{color:#32c682;text-align:center;margin-top:40px}.result .failure svg{color:#f56c6c;text-align:center;margin-top:40px}.result .title{margin-top:25px}.result .desc{margin-top:25px;width:60%;margin-left:20%;color:#00000073}.result .content{margin-top:20px;width:80%;border-radius:10px;background-color:#fff;margin-left:10%}.result .extra{padding-top:10px;border-top:1px whitesmoke solid;margin-top:25px}\n")();
const _hoisted_1$d = { class: "result" };
const _hoisted_2$c = {
key: 0,
viewBox: "64 64 896 896",
"data-icon": "close-circle",
width: "80px",
height: "80px",
fill: "currentColor",
"aria-hidden": "true",
focusable: "false",
class: ""
};
const _hoisted_3$b = /* @__PURE__ */ createElementVNode("path", { d: "M685.4 354.8c0-4.4-3.6-8-8-8l-66 .3L512 465.6l-99.3-118.4-66.1-.3c-4.4 0-8 3.5-8 8 0 1.9.7 3.7 1.9 5.2l130.1 155L340.5 670a8.32 8.32 0 0 0-1.9 5.2c0 4.4 3.6 8 8 8l66.1-.3L512 564.4l99.3 118.4 66 .3c4.4 0 8-3.5 8-8 0-1.9-.7-3.7-1.9-5.2L553.5 515l130.1-155c1.2-1.4 1.8-3.3 1.8-5.2z" }, null, -1);
const _hoisted_4$8 = /* @__PURE__ */ createElementVNode("path", { d: "M512 65C264.6 65 64 265.6 64 513s200.6 448 448 448 448-200.6 448-448S759.4 65 512 65zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1);
2022-12-30 08:13:19 +00:00
const _hoisted_5$7 = [
2022-11-15 01:16:55 +00:00
_hoisted_3$b,
_hoisted_4$8
];
const _hoisted_6$6 = {
key: 1,
viewBox: "64 64 896 896",
"data-icon": "check-circle",
width: "80px",
height: "80px",
fill: "currentColor",
"aria-hidden": "true",
focusable: "false",
class: ""
};
const _hoisted_7$6 = /* @__PURE__ */ createElementVNode("path", { d: "M699 353h-46.9c-10.2 0-19.9 4.9-25.9 13.3L469 584.3l-71.2-98.8c-6-8.3-15.6-13.3-25.9-13.3H325c-6.5 0-10.3 7.4-6.5 12.7l124.6 172.8a31.8 31.8 0 0 0 51.7 0l210.6-292c3.9-5.3.1-12.7-6.4-12.7z" }, null, -1);
const _hoisted_8$3 = /* @__PURE__ */ createElementVNode("path", { d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm0 820c-205.4 0-372-166.6-372-372s166.6-372 372-372 372 166.6 372 372-166.6 372-372 372z" }, null, -1);
const _hoisted_9$2 = [
_hoisted_7$6,
_hoisted_8$3
];
const _hoisted_10$2 = { class: "title" };
const _hoisted_11$2 = { class: "desc" };
const _hoisted_12$2 = { class: "content" };
const _hoisted_13$2 = { class: "extra" };
const __default__$h = {
name: "LayResult"
};
const _sfc_main$i = defineComponent({
...__default__$h,
props: {
title: { default: "\u63D0\u4EA4\u4FE1\u606F" },
status: { default: "success" },
describe: { default: "\u8BF7\u6838\u5BF9\u5E76\u4FEE\u6539\u4EE5\u4E0B\u4FE1\u606F\u540E\uFF0C\u518D\u91CD\u65B0\u63D0\u4EA4\u3002" }
},
setup(__props) {
useSlots();
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$d, [
createElementVNode("div", {
class: normalizeClass([__props.status])
}, [
2022-12-30 08:13:19 +00:00
__props.status === "failure" ? (openBlock(), createElementBlock("svg", _hoisted_2$c, _hoisted_5$7)) : (openBlock(), createElementBlock("svg", _hoisted_6$6, _hoisted_9$2))
2022-11-15 01:16:55 +00:00
], 2),
createElementVNode("h2", _hoisted_10$2, toDisplayString$1(__props.title), 1),
createElementVNode("p", _hoisted_11$2, toDisplayString$1(__props.describe), 1),
createElementVNode("div", _hoisted_12$2, [
renderSlot(_ctx.$slots, "content")
]),
createElementVNode("div", _hoisted_13$2, [
renderSlot(_ctx.$slots, "extra")
])
]);
};
}
});
const component$d = withInstall(_sfc_main$i);
var index$8 = /* @__PURE__ */ (() => ".layui-fullscreen{top:0;left:0;width:100%;height:100%;position:fixed;overflow:auto;z-index:10}\n")();
const __default__$g = {
name: "LayFullscreen"
};
const _sfc_main$h = defineComponent({
...__default__$g,
props: {
target: null,
immersive: { type: Boolean, default: true },
position: null,
zIndex: null
},
emits: ["fullscreenchange"],
setup(__props, { emit }) {
const props = __props;
const methodMap = [
[
"requestFullscreen",
"exitFullscreen",
"fullscreenElement",
"fullscreenEnabled",
"fullscreenchange",
"fullscreenerror"
],
[
"webkitRequestFullscreen",
"webkitExitFullscreen",
"webkitFullscreenElement",
"webkitFullscreenEnabled",
"webkitfullscreenchange",
"webkitfullscreenerror"
],
[
"webkitRequestFullScreen",
"webkitCancelFullScreen",
"webkitCurrentFullScreenElement",
"webkitCancelFullScreen",
"webkitfullscreenchange",
"webkitfullscreenerror"
],
[
"mozRequestFullScreen",
"mozCancelFullScreen",
"mozFullScreenElement",
"mozFullScreenEnabled",
"mozfullscreenchange",
"mozfullscreenerror"
],
[
"msRequestFullscreen",
"msExitFullscreen",
"msFullscreenElement",
"msFullscreenEnabled",
"MSFullscreenChange",
"MSFullscreenError"
]
];
const defaultElement = document.documentElement;
let targetEl = ref(props.target || defaultElement);
const isFullscreen = ref(false);
let isSupported = false;
const unprefixedMethods = methodMap[0];
const fullscreenAPI = {};
for (const methodList of methodMap) {
if (methodList[1] in document) {
for (const [index2, method4] of methodList.entries()) {
fullscreenAPI[unprefixedMethods[index2]] = method4;
}
isSupported = true;
break;
}
}
async function enter(targetEl2) {
if (!isSupported)
return;
if (!targetEl2)
targetEl2 = activeEl.value || defaultElement;
let fullscreenEnter = null;
if (props.immersive) {
fullscreenEnter = Promise.resolve(targetEl2[fullscreenAPI.requestFullscreen]());
} else {
styleLayFullscreen(targetEl2, false);
fullscreenEnter = Promise.resolve(targetEl2 == null ? void 0 : targetEl2.classList.add("layui-fullscreen"));
}
return await (fullscreenEnter == null ? void 0 : fullscreenEnter.then(() => {
isFullscreen.value = true;
emit("fullscreenchange", isFullscreen.value);
return !!document.fullscreenElement;
}));
}
async function exit(targetEl2) {
if (!isSupported)
return;
if (!targetEl2)
targetEl2 = activeEl.value || document;
let fullscreenExit = null;
if (props.immersive) {
fullscreenExit = Promise.resolve(document[fullscreenAPI.exitFullscreen]());
} else {
if (targetEl2 instanceof Document)
return;
styleLayFullscreen(targetEl2, true);
fullscreenExit = Promise.resolve(targetEl2 == null ? void 0 : targetEl2.classList.remove("layui-fullscreen"));
}
return await (fullscreenExit == null ? void 0 : fullscreenExit.then(() => {
isFullscreen.value = false;
emit("fullscreenchange", isFullscreen.value);
return !!document.fullscreenElement;
}));
}
async function toggle() {
if (isFullscreen.value) {
await exit(activeEl.value);
} else {
await enter(activeEl.value);
}
}
const styleLayFullscreen = function(el, isRemove = false) {
el.style.position = isRemove ? "" : props.position || "";
el.style.zIndex = isRemove ? "" : props.zIndex || "";
};
const activeEl = computed$1(() => targetEl.value = props.target);
const onFullscreenchange = function(event) {
if (isFullscreen.value && !document.fullscreenElement) {
if (props.immersive) {
isFullscreen.value = false;
emit("fullscreenchange", isFullscreen.value);
} else if (event.key === "Escape") {
exit(activeEl.value);
}
}
};
const onKeydownF11 = function(event) {
let isRootNodeFullscreen = props.immersive && (!activeEl.value || activeEl.value === defaultElement);
if (event.key === "F11" && isRootNodeFullscreen) {
event.preventDefault();
toggle();
}
};
onMounted(() => {
document.addEventListener(fullscreenAPI.fullscreenchange, onFullscreenchange);
document.addEventListener("keydown", onFullscreenchange);
document.addEventListener("keydown", onKeydownF11);
});
onBeforeUnmount(() => {
document.removeEventListener(fullscreenAPI.fullscreenchange, onFullscreenchange);
document.removeEventListener("keydown", onFullscreenchange);
document.removeEventListener("keydown", onKeydownF11);
});
return (_ctx, _cache) => {
return renderSlot(_ctx.$slots, "default", {
isFullscreen: isFullscreen.value,
enter,
exit,
toggle
});
};
}
});
const component$c = withInstall(_sfc_main$h);
2022-12-09 08:41:41 +00:00
var index$7 = /* @__PURE__ */ (() => '.layui-dropdown{position:relative;display:inline-block}.layui-dropdown-content{position:absolute;z-index:99999;background-color:#fff;box-sizing:border-box;border:1px solid #e4e7ed;border-radius:2px;box-shadow:0 2px 12px #0000001a}.layui-dropdown-content>.layui-dropdown-menu{border-radius:var(--global-border-radius);margin:5px 0}.layui-dropdown-content .layui-menu{position:relative;background-color:#fff}.layui-dropdown-content .layui-menu li,.layui-dropdown-content .layui-menu-body-title a{padding:5px 15px}.layui-dropdown-content .layui-menu li{position:relative;display:flex;margin:1px 0;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;cursor:pointer}.layui-dropdown-content .layui-menu li:hover{background-color:var(--global-neutral-color-2)}.layui-dropdown-content .layui-menu-body-title{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.layui-dropdown-menu-prefix{margin-right:8px}.layui-dropdown-menu-suffix{margin-left:15px}.layui-dropdown-content .layui-menu li.layui-disabled:hover{background-color:inherit}:root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}.layui-date-picker[size=lg]{width:260px;height:44px}.layui-date-picker[size=lg] .layui-input{height:44px;line-height:44px}.layui-date-picker[size=md]{width:220px;height:38px}.layui-date-picker[size=md] .layui-input{height:38px;line-height:38px}.layui-date-picker[size=sm]{width:180px;height:32px}.layui-date-picker[size=sm] .layui-input{height:32px;line-height:32px}.layui-date-picker[size=xs]{width:140px;height:26px}.layui-date-picker[size=xs] .layui-input{height:26px;line-height:26px}.layui-date-range-picker[size=lg]{width:520px;height:44px}.layui-date-range-picker[size=lg] .layui-input{height:44px;line-height:44px}.layui-date-range-picker[size=md]{width:440px;height:38px}.layui-date-range-picker[size=md] .layui-input{height:38px;line-height:38px}.layui-date-range-picker[size=sm]{width:360px;height:32px}.layui-date-range-picker[size=sm] .layui-input{height:32px;line-height:32px}.layui-date-range-picker[size=xs]{width:280px;height:26px}.layui-date-range-picker[size=xs] .layui-input{height:26px;line-height:26px}@font-face{font-family:laydate-icon;src:url(data
2022-11-15 01:16:55 +00:00
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var dayjs_min = { exports: {} };
(function(module, exports) {
!function(t, e) {
module.exports = e();
}(commonjsGlobal, function() {
var t = 1e3, e = 6e4, n = 36e5, r = "millisecond", i = "second", s = "minute", u = "hour", a = "day", o = "week", f = "month", h2 = "quarter", c = "year", d = "date", $ = "Invalid Date", l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, M = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_") }, m = function(t2, e2, n2) {
var r2 = String(t2);
return !r2 || r2.length >= e2 ? t2 : "" + Array(e2 + 1 - r2.length).join(n2) + t2;
}, g = { s: m, z: function(t2) {
var e2 = -t2.utcOffset(), n2 = Math.abs(e2), r2 = Math.floor(n2 / 60), i2 = n2 % 60;
return (e2 <= 0 ? "+" : "-") + m(r2, 2, "0") + ":" + m(i2, 2, "0");
}, m: function t2(e2, n2) {
if (e2.date() < n2.date())
return -t2(n2, e2);
var r2 = 12 * (n2.year() - e2.year()) + (n2.month() - e2.month()), i2 = e2.clone().add(r2, f), s2 = n2 - i2 < 0, u2 = e2.clone().add(r2 + (s2 ? -1 : 1), f);
return +(-(r2 + (n2 - i2) / (s2 ? i2 - u2 : u2 - i2)) || 0);
}, a: function(t2) {
return t2 < 0 ? Math.ceil(t2) || 0 : Math.floor(t2);
}, p: function(t2) {
return { M: f, y: c, w: o, d: a, D: d, h: u, m: s, s: i, ms: r, Q: h2 }[t2] || String(t2 || "").toLowerCase().replace(/s$/, "");
}, u: function(t2) {
return void 0 === t2;
} }, v = "en", D = {};
D[v] = M;
var p = function(t2) {
return t2 instanceof _;
}, S = function t2(e2, n2, r2) {
var i2;
if (!e2)
return v;
if ("string" == typeof e2) {
var s2 = e2.toLowerCase();
D[s2] && (i2 = s2), n2 && (D[s2] = n2, i2 = s2);
var u2 = e2.split("-");
if (!i2 && u2.length > 1)
return t2(u2[0]);
} else {
var a2 = e2.name;
D[a2] = e2, i2 = a2;
}
return !r2 && i2 && (v = i2), i2 || !r2 && v;
}, w = function(t2, e2) {
if (p(t2))
return t2.clone();
var n2 = "object" == typeof e2 ? e2 : {};
return n2.date = t2, n2.args = arguments, new _(n2);
}, O = g;
O.l = S, O.i = p, O.w = function(t2, e2) {
return w(t2, { locale: e2.$L, utc: e2.$u, x: e2.$x, $offset: e2.$offset });
};
var _ = function() {
function M2(t2) {
this.$L = S(t2.locale, null, true), this.parse(t2);
}
var m2 = M2.prototype;
return m2.parse = function(t2) {
this.$d = function(t3) {
var e2 = t3.date, n2 = t3.utc;
if (null === e2)
return new Date(NaN);
if (O.u(e2))
return new Date();
if (e2 instanceof Date)
return new Date(e2);
if ("string" == typeof e2 && !/Z$/i.test(e2)) {
var r2 = e2.match(l);
if (r2) {
var i2 = r2[2] - 1 || 0, s2 = (r2[7] || "0").substring(0, 3);
return n2 ? new Date(Date.UTC(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2)) : new Date(r2[1], i2, r2[3] || 1, r2[4] || 0, r2[5] || 0, r2[6] || 0, s2);
}
}
return new Date(e2);
}(t2), this.$x = t2.x || {}, this.init();
}, m2.init = function() {
var t2 = this.$d;
this.$y = t2.getFullYear(), this.$M = t2.getMonth(), this.$D = t2.getDate(), this.$W = t2.getDay(), this.$H = t2.getHours(), this.$m = t2.getMinutes(), this.$s = t2.getSeconds(), this.$ms = t2.getMilliseconds();
}, m2.$utils = function() {
return O;
}, m2.isValid = function() {
return !(this.$d.toString() === $);
}, m2.isSame = function(t2, e2) {
var n2 = w(t2);
return this.startOf(e2) <= n2 && n2 <= this.endOf(e2);
}, m2.isAfter = function(t2, e2) {
return w(t2) < this.startOf(e2);
}, m2.isBefore = function(t2, e2) {
return this.endOf(e2) < w(t2);
}, m2.$g = function(t2, e2, n2) {
return O.u(t2) ? this[e2] : this.set(n2, t2);
}, m2.unix = function() {
return Math.floor(this.valueOf() / 1e3);
}, m2.valueOf = function() {
return this.$d.getTime();
}, m2.startOf = function(t2, e2) {
var n2 = this, r2 = !!O.u(e2) || e2, h3 = O.p(t2), $2 = function(t3, e3) {
var i2 = O.w(n2.$u ? Date.UTC(n2.$y, e3, t3) : new Date(n2.$y, e3, t3), n2);
return r2 ? i2 : i2.endOf(a);
}, l2 = function(t3, e3) {
return O.w(n2.toDate()[t3].apply(n2.toDate("s"), (r2 ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e3)), n2);
}, y2 = this.$W, M3 = this.$M, m3 = this.$D, g2 = "set" + (this.$u ? "UTC" : "");
switch (h3) {
case c:
return r2 ? $2(1, 0) : $2(31, 11);
case f:
return r2 ? $2(1, M3) : $2(0, M3 + 1);
case o:
var v2 = this.$locale().weekStart || 0, D2 = (y2 < v2 ? y2 + 7 : y2) - v2;
return $2(r2 ? m3 - D2 : m3 + (6 - D2), M3);
case a:
case d:
return l2(g2 + "Hours", 0);
case u:
return l2(g2 + "Minutes", 1);
case s:
return l2(g2 + "Seconds", 2);
case i:
return l2(g2 + "Milliseconds", 3);
default:
return this.clone();
}
}, m2.endOf = function(t2) {
return this.startOf(t2, false);
}, m2.$set = function(t2, e2) {
var n2, o2 = O.p(t2), h3 = "set" + (this.$u ? "UTC" : ""), $2 = (n2 = {}, n2[a] = h3 + "Date", n2[d] = h3 + "Date", n2[f] = h3 + "Month", n2[c] = h3 + "FullYear", n2[u] = h3 + "Hours", n2[s] = h3 + "Minutes", n2[i] = h3 + "Seconds", n2[r] = h3 + "Milliseconds", n2)[o2], l2 = o2 === a ? this.$D + (e2 - this.$W) : e2;
if (o2 === f || o2 === c) {
var y2 = this.clone().set(d, 1);
y2.$d[$2](l2), y2.init(), this.$d = y2.set(d, Math.min(this.$D, y2.daysInMonth())).$d;
} else
$2 && this.$d[$2](l2);
return this.init(), this;
}, m2.set = function(t2, e2) {
return this.clone().$set(t2, e2);
}, m2.get = function(t2) {
return this[O.p(t2)]();
}, m2.add = function(r2, h3) {
var d2, $2 = this;
r2 = Number(r2);
var l2 = O.p(h3), y2 = function(t2) {
var e2 = w($2);
return O.w(e2.date(e2.date() + Math.round(t2 * r2)), $2);
};
if (l2 === f)
return this.set(f, this.$M + r2);
if (l2 === c)
return this.set(c, this.$y + r2);
if (l2 === a)
return y2(1);
if (l2 === o)
return y2(7);
var M3 = (d2 = {}, d2[s] = e, d2[u] = n, d2[i] = t, d2)[l2] || 1, m3 = this.$d.getTime() + r2 * M3;
return O.w(m3, this);
}, m2.subtract = function(t2, e2) {
return this.add(-1 * t2, e2);
}, m2.format = function(t2) {
var e2 = this, n2 = this.$locale();
if (!this.isValid())
return n2.invalidDate || $;
var r2 = t2 || "YYYY-MM-DDTHH:mm:ssZ", i2 = O.z(this), s2 = this.$H, u2 = this.$m, a2 = this.$M, o2 = n2.weekdays, f2 = n2.months, h3 = function(t3, n3, i3, s3) {
return t3 && (t3[n3] || t3(e2, r2)) || i3[n3].substr(0, s3);
}, c2 = function(t3) {
return O.s(s2 % 12 || 12, t3, "0");
}, d2 = n2.meridiem || function(t3, e3, n3) {
var r3 = t3 < 12 ? "AM" : "PM";
return n3 ? r3.toLowerCase() : r3;
}, l2 = { YY: String(this.$y).slice(-2), YYYY: this.$y, M: a2 + 1, MM: O.s(a2 + 1, 2, "0"), MMM: h3(n2.monthsShort, a2, f2, 3), MMMM: h3(f2, a2), D: this.$D, DD: O.s(this.$D, 2, "0"), d: String(this.$W), dd: h3(n2.weekdaysMin, this.$W, o2, 2), ddd: h3(n2.weekdaysShort, this.$W, o2, 3), dddd: o2[this.$W], H: String(s2), HH: O.s(s2, 2, "0"), h: c2(1), hh: c2(2), a: d2(s2, u2, true), A: d2(s2, u2, false), m: String(u2), mm: O.s(u2, 2, "0"), s: String(this.$s), ss: O.s(this.$s, 2, "0"), SSS: O.s(this.$ms, 3, "0"), Z: i2 };
return r2.replace(y, function(t3, e3) {
return e3 || l2[t3] || i2.replace(":", "");
});
}, m2.utcOffset = function() {
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
}, m2.diff = function(r2, d2, $2) {
var l2, y2 = O.p(d2), M3 = w(r2), m3 = (M3.utcOffset() - this.utcOffset()) * e, g2 = this - M3, v2 = O.m(this, M3);
return v2 = (l2 = {}, l2[c] = v2 / 12, l2[f] = v2, l2[h2] = v2 / 3, l2[o] = (g2 - m3) / 6048e5, l2[a] = (g2 - m3) / 864e5, l2[u] = g2 / n, l2[s] = g2 / e, l2[i] = g2 / t, l2)[y2] || g2, $2 ? v2 : O.a(v2);
}, m2.daysInMonth = function() {
return this.endOf(f).$D;
}, m2.$locale = function() {
return D[this.$L];
}, m2.locale = function(t2, e2) {
if (!t2)
return this.$L;
var n2 = this.clone(), r2 = S(t2, e2, true);
return r2 && (n2.$L = r2), n2;
}, m2.clone = function() {
return O.w(this.$d, this);
}, m2.toDate = function() {
return new Date(this.valueOf());
}, m2.toJSON = function() {
return this.isValid() ? this.toISOString() : null;
}, m2.toISOString = function() {
return this.$d.toISOString();
}, m2.toString = function() {
return this.$d.toUTCString();
}, M2;
}(), b = _.prototype;
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function(t2) {
b[t2[1]] = function(e2) {
return this.$g(e2, t2[0], t2[1]);
};
}), w.extend = function(t2, e2) {
return t2.$i || (t2(e2, _, w), t2.$i = true), w;
}, w.locale = S, w.isDayjs = p, w.unix = function(t2) {
return w(1e3 * t2);
}, w.en = D[v], w.Ls = D, w.p = {}, w;
});
})(dayjs_min);
var dayjs = dayjs_min.exports;
const getYears = () => {
let years = [];
for (let i = 1970; i < getYear() + 100; i++) {
years.push(i);
}
return years;
};
const getDate = (val = "") => {
if (val) {
return new Date(val);
} else {
return new Date();
}
};
const getYear = (val = "") => {
return getDate(val).getFullYear();
};
const getMonth = (val = "") => {
return getDate(val).getMonth();
};
const getDay = (val = "") => {
if (val) {
return new Date(getDate(val).toDateString()).getTime();
} else {
return -1;
}
};
const getDayLength = (year, month) => {
return new Date(year, month + 1, 0).getDate();
};
const setDateList = (year, month) => {
const curDays = getDayLength(year, month);
const prevDays = getDayLength(year, month - 1);
const curFirstDayWeek = new Date(year, month, 1).getDay();
const list = [];
for (let i = prevDays - curFirstDayWeek + 1; i <= prevDays; i++) {
list.push({
day: i,
value: +new Date(year, month - 1, i),
isRange: false,
isSelected: false,
type: "prev"
});
}
for (let i = 1; i <= curDays; i++) {
list.push({
day: i,
value: +new Date(year, month, i),
isRange: false,
isSelected: false,
type: "current"
});
}
const nextDays = 7 - list.length % 7;
if (nextDays !== 7) {
for (let i = 1; i <= nextDays; i++) {
list.push({
day: i,
value: +new Date(year, month + 1, i),
isRange: false,
isSelected: false,
type: "next"
});
}
}
return list;
};
const _hoisted_1$c = { class: "layui-laydate-footer" };
const _hoisted_2$b = { class: "laydate-footer-btns" };
const __default__$f = {
name: "PanelFoot"
};
const _sfc_main$g = /* @__PURE__ */ defineComponent({
...__default__$f,
emits: ["ok", "clear", "now"],
setup(__props, { emit: emits }) {
const { t } = useI18n();
const handelOk = () => {
emits("ok");
};
const handelNow = () => {
emits("now");
};
const handelClear = () => {
emits("clear");
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$c, [
renderSlot(_ctx.$slots, "default"),
createElementVNode("div", _hoisted_2$b, [
createElementVNode("span", {
"lay-type": "clear",
class: "laydate-btns-clear",
onClick: handelClear
}, toDisplayString$1(unref(t)("datePicker.clear")), 1),
createElementVNode("span", {
"lay-type": "now",
class: "laydate-btns-now",
onClick: handelNow
}, toDisplayString$1(unref(t)("datePicker.now")), 1),
createElementVNode("span", {
"lay-type": "confirm",
class: "laydate-btns-confirm",
onClick: handelOk
}, toDisplayString$1(unref(t)("datePicker.confirm")), 1)
])
]);
};
}
});
const _hoisted_1$b = { class: "layui-laydate-content" };
const _hoisted_2$a = { style: { "width": "100%" } };
const _hoisted_3$a = ["data-unix", "onClick", "onMouseenter"];
const __default__$e = {
name: "DateContent"
};
const _sfc_main$f = defineComponent({
...__default__$e,
props: {
dateList: { default: [] },
modelValue: { default: -1 },
startDate: { default: -1 },
endDate: { default: -1 },
hoverDate: { default: -1 }
},
emits: [
"update:modelValue",
"update:startDate",
"update:endDate",
"update:hoverDate",
"simple"
],
setup(__props, { emit: emits }) {
const props = __props;
const { t } = useI18n();
const WEEK_NAME = computed$1(() => [
t("datePicker.sunday"),
t("datePicker.monday"),
t("datePicker.tuesday"),
t("datePicker.wednesday"),
t("datePicker.thursday"),
t("datePicker.friday"),
t("datePicker.saturday")
]);
const datePicker = inject("datePicker");
const handleDayClick = (item) => {
if (datePicker.range) {
if (item.type !== "current") {
return;
}
if (props.startDate === -1 && props.endDate === -1) {
emits("update:startDate", item.value);
} else if (props.startDate !== -1 && props.endDate !== -1) {
emits("update:hoverDate", item.value);
emits("update:startDate", item.value);
emits("update:endDate", -1);
} else if (props.startDate !== -1 && props.endDate === -1) {
emits("update:endDate", item.value);
if (item.value < props.startDate) {
const first = props.startDate;
const last = item.value;
emits("update:startDate", last);
emits("update:endDate", first);
}
}
} else {
emits("update:modelValue", item.value);
if (item.type !== "current") {
datePicker.currentMonth.value = item.type === "prev" ? datePicker.currentMonth.value - 1 : datePicker.currentMonth.value + 1;
}
if (datePicker.simple) {
emits("simple");
}
}
};
const dayItemMouseEnter = (event, item) => {
if (!datePicker.range) {
return;
}
if (props.startDate === -1) {
return;
}
if (item.type !== "current") {
return;
}
if (props.startDate !== -1 && props.endDate !== -1) {
emits("update:hoverDate", -1);
return;
}
emits("update:hoverDate", parseInt(event.target.dataset.unix));
};
const ifHasRangeHoverClass = computed$1(() => {
return function(item) {
if (!datePicker.range) {
return false;
}
if (props.startDate === -1) {
return false;
}
if (item.type !== "current") {
return false;
}
if (props.hoverDate === -1 && props.endDate === -1) {
return false;
}
let hover = props.endDate !== -1 ? props.endDate : props.hoverDate;
let max = props.startDate > hover ? props.startDate : hover;
let min = props.startDate < hover ? props.startDate : hover;
if (item.value >= min && item.value <= max) {
return true;
}
return false;
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$b, [
createElementVNode("table", _hoisted_2$a, [
createElementVNode("thead", null, [
createElementVNode("tr", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(WEEK_NAME), (item) => {
return openBlock(), createElementBlock("th", { key: item }, toDisplayString$1(item), 1);
}), 128))
])
]),
createElementVNode("tbody", null, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dateList.length % 7 == 0 ? __props.dateList.length / 7 : Math.floor(__props.dateList.length / 7) + 1, (o, i) => {
return openBlock(), createElementBlock("tr", { key: i }, [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.dateList.slice(i * 7, i * 7 + 7), (item, index2) => {
return openBlock(), createElementBlock("td", {
key: index2,
"data-unix": item.value,
class: normalizeClass({
"laydate-day-prev": item.type !== "current",
"layui-this": item.value === __props.modelValue || unref(datePicker).range && item.type === "current" && (item.value == __props.startDate || item.value == __props.endDate),
"laydate-range-hover": unref(ifHasRangeHoverClass)(item),
2022-12-09 08:41:41 +00:00
"layui-disabled": item.type !== "current" && unref(datePicker).range,
"layui-laydate-current": __props.modelValue === -1 && item.value === unref(dayjs)().startOf("day").valueOf()
2022-11-15 01:16:55 +00:00
}),
onClick: ($event) => handleDayClick(item),
onMouseenter: ($event) => dayItemMouseEnter($event, item)
}, toDisplayString$1(item.day), 43, _hoisted_3$a);
}), 128))
]);
}), 128))
])
])
]);
};
}
});
const _hoisted_1$a = { class: "layui-laydate" };
const _hoisted_2$9 = { class: "layui-laydate-main laydate-main-list-0" };
const _hoisted_3$9 = { class: "layui-laydate-header" };
const _hoisted_4$7 = { class: "laydate-set-ym" };
const __default__$d = {
name: "DatePanel"
};
const _sfc_main$e = defineComponent({
...__default__$d,
props: {
modelValue: null
},
emits: ["update:modelValue", "ok"],
setup(__props, { emit: emits }) {
const props = __props;
const { t } = useI18n();
const Day = ref(props.modelValue);
const datePicker = inject("datePicker");
const dateList = ref([]);
const MONTH_NAME = computed$1(() => [
t("datePicker.january"),
t("datePicker.february"),
t("datePicker.march"),
t("datePicker.april"),
t("datePicker.may"),
t("datePicker.june"),
t("datePicker.july"),
t("datePicker.august"),
t("datePicker.september"),
t("datePicker.october"),
t("datePicker.november"),
t("datePicker.december")
]);
watch([datePicker.currentYear, datePicker.currentMonth], () => {
dateList.value = setDateList(datePicker.currentYear.value, datePicker.currentMonth.value);
}, { immediate: true });
watch(() => props.modelValue, () => {
Day.value = props.modelValue;
});
const changeYearOrMonth = (type4, num) => {
if (type4 === "year") {
datePicker.currentYear.value += num;
} else {
let month = datePicker.currentMonth.value + num;
if (month > 11) {
month = 0;
datePicker.currentYear.value++;
} else if (month < 0) {
month = 11;
datePicker.currentYear.value--;
}
datePicker.currentMonth.value = month;
}
};
const footOnOk = () => {
emits("update:modelValue", Day.value);
datePicker.ok();
};
const footOnNow = () => {
datePicker.currentYear.value = dayjs().year();
datePicker.currentMonth.value = dayjs().month();
Day.value = new Date(new Date().toDateString()).getTime();
};
const footOnClear = () => {
Day.value = -1;
};
const ChildUpdateModelValue = () => {
emits("update:modelValue", Day.value);
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$a, [
createElementVNode("div", _hoisted_2$9, [
createElementVNode("div", _hoisted_3$9, [
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-prev-y",
onClick: _cache[0] || (_cache[0] = ($event) => changeYearOrMonth("year", -1))
}, "\uE65A"),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-prev-m",
onClick: _cache[1] || (_cache[1] = ($event) => changeYearOrMonth("month", -1))
}, "\uE603"),
createElementVNode("div", _hoisted_4$7, [
createElementVNode("span", {
onClick: _cache[2] || (_cache[2] = ($event) => unref(datePicker).showPanel.value = "year")
}, toDisplayString$1(unref(datePicker).currentYear.value) + " " + toDisplayString$1(unref(t)("datePicker.year")), 1),
createElementVNode("span", {
onClick: _cache[3] || (_cache[3] = ($event) => unref(datePicker).showPanel.value = "month")
}, toDisplayString$1(unref(MONTH_NAME)[unref(datePicker).currentMonth.value]), 1)
]),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-next-m",
onClick: _cache[4] || (_cache[4] = ($event) => changeYearOrMonth("month", 1))
}, "\uE602"),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-next-y",
onClick: _cache[5] || (_cache[5] = ($event) => changeYearOrMonth("year", 1))
}, "\uE65B")
]),
createVNode(_sfc_main$f, {
"date-list": dateList.value,
modelValue: Day.value,
"onUpdate:modelValue": [
_cache[6] || (_cache[6] = ($event) => Day.value = $event),
ChildUpdateModelValue
],
onSimple: footOnOk
}, null, 8, ["date-list", "modelValue"]),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
unref(datePicker).type === "datetime" ? (openBlock(), createElementBlock("span", {
key: 0,
onClick: _cache[7] || (_cache[7] = ($event) => unref(datePicker).showPanel.value = "time"),
class: "laydate-btns-time"
}, toDisplayString$1(unref(t)("datePicker.selectTime")), 1)) : createCommentVNode("", true)
]),
_: 1
})
])
]);
};
}
});
const _hoisted_1$9 = { class: "layui-laydate" };
const _hoisted_2$8 = { class: "layui-laydate-main laydate-main-list-0 laydate-time-show" };
const _hoisted_3$8 = { class: "layui-laydate-header" };
const _hoisted_4$6 = { class: "laydate-set-ym" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$6 = { class: "laydate-time-text" };
2022-11-15 01:16:55 +00:00
const _hoisted_6$5 = {
class: "layui-laydate-content",
style: { "height": "210px" }
};
const _hoisted_7$5 = ["data-type"];
const _hoisted_8$2 = ["id", "data-value", "data-type"];
const __default__$c = {
name: "TimePanel"
};
const _sfc_main$d = defineComponent({
...__default__$c,
props: {
modelValue: null
},
emits: ["update:modelValue", "ok"],
setup(__props, { emit: emits }) {
const props = __props;
const datePicker = inject("datePicker");
const { t } = useI18n();
const els = [
{ count: 24, type: "hh" },
{ count: 60, type: "mm" },
{ count: 60, type: "ss" }
];
const hms = ref({
hh: props.modelValue.hh,
mm: props.modelValue.mm,
ss: props.modelValue.ss
});
const chooseTime = (e) => {
if (e.target.nodeName == "LI") {
let { value, type: type4 } = e.target.dataset;
hms.value[type4] = parseInt(value);
}
};
const timePanelRef = ref();
onMounted(() => {
scrollTo();
});
watch(() => props.modelValue, () => {
hms.value = {
hh: props.modelValue.hh,
mm: props.modelValue.mm,
ss: props.modelValue.ss
};
}, { deep: true });
const scrollTo = () => {
nextTick(() => {
timePanelRef.value.childNodes.forEach((element) => {
if (element.nodeName === "LI") {
let scrollTop = 0;
let parentDom = element.firstElementChild;
let childList = parentDom.childNodes;
for (let index2 = 0; index2 < childList.length; index2++) {
const child = childList[index2];
if (child.nodeName !== "LI") {
continue;
}
if (child.classList && child.classList.contains("layui-this")) {
scrollTop = child.offsetTop - (parentDom.offsetHeight - child.offsetHeight) / 2;
parentDom.scrollTo(0, scrollTop);
break;
}
}
}
});
});
};
const footOnOk = () => {
emits("update:modelValue", hms.value);
if (datePicker.range) {
emits("ok");
return;
} else {
datePicker.ok();
if (datePicker.type === "datetime") {
datePicker.showPanel.value = "date";
}
}
};
const footOnNow = () => {
hms.value.hh = dayjs().hour();
hms.value.mm = dayjs().minute();
hms.value.ss = dayjs().second();
scrollTo();
};
const footOnClear = () => {
hms.value.hh = 0;
hms.value.mm = 0;
hms.value.ss = 0;
scrollTo();
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$9, [
createElementVNode("div", _hoisted_2$8, [
createElementVNode("div", _hoisted_3$8, [
createElementVNode("div", _hoisted_4$6, [
2022-12-30 08:13:19 +00:00
createElementVNode("span", _hoisted_5$6, toDisplayString$1(unref(t)("datePicker.selectTime")), 1)
2022-11-15 01:16:55 +00:00
])
]),
createElementVNode("div", _hoisted_6$5, [
createElementVNode("ul", {
class: "layui-laydate-list laydate-time-list",
ref_key: "timePanelRef",
ref: timePanelRef
}, [
(openBlock(), createElementBlock(Fragment, null, renderList(els, (item) => {
return createElementVNode("li", {
class: "num-list",
key: item.type,
"data-type": item.type
}, [
createElementVNode("ol", {
class: "scroll",
onClick: chooseTime
}, [
(openBlock(true), createElementBlock(Fragment, null, renderList(item.count, (it, index2) => {
return openBlock(), createElementBlock("li", {
id: item.type + index2.toString(),
"data-value": index2.toString().padStart(2, "0"),
"data-type": item.type,
key: it,
class: normalizeClass(["num", index2 == hms.value[item.type] ? "layui-this" : ""])
}, toDisplayString$1(index2.toString().padStart(2, "0")), 11, _hoisted_8$2);
}), 128))
])
], 8, _hoisted_7$5);
}), 64))
], 512)
])
]),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
unref(datePicker).type === "datetime" && !unref(datePicker).range ? (openBlock(), createElementBlock("span", {
key: 0,
onClick: _cache[0] || (_cache[0] = ($event) => unref(datePicker).showPanel.value = "datetime"),
class: "laydate-btns-time"
}, toDisplayString$1(unref(t)("datePicker.selectDate")), 1)) : !isNaN(hms.value.hh) && !isNaN(hms.value.mm) && !isNaN(hms.value.ss) ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(unref(dayjs)().hour(hms.value.hh).minute(hms.value.mm).second(hms.value.ss).format("HH:mm:ss")), 1)
], 64)) : createCommentVNode("", true)
]),
_: 1
})
]);
};
}
});
const _hoisted_1$8 = { class: "layui-laydate" };
const _hoisted_2$7 = { class: "layui-laydate-main laydate-main-list-0 laydate-ym-show" };
const _hoisted_3$7 = { class: "layui-laydate-header" };
const _hoisted_4$5 = { class: "laydate-set-ym" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$5 = { class: "laydate-time-text" };
2022-11-15 01:16:55 +00:00
const _hoisted_6$4 = { class: "layui-laydate-list laydate-year-list" };
const _hoisted_7$4 = ["onClick"];
const __default__$b = {
name: "YearPanel"
};
const _sfc_main$c = defineComponent({
...__default__$b,
props: {
modelValue: null,
max: { default: dayjs().year() + 100 }
},
emits: ["update:modelValue", "ok"],
setup(__props, { emit: emits }) {
const props = __props;
const datePicker = inject("datePicker");
const yearList = ref(getYears());
const unWatch = ref(false);
const Year = ref(props.modelValue);
const { t } = useI18n();
const handleYearClick = (item) => {
unWatch.value = true;
Year.value = item;
if (!datePicker.range) {
if (datePicker.type === "year") {
datePicker.currentDay.value = dayjs().year(item).valueOf();
} else if (datePicker.type === "yearmonth") {
datePicker.currentDay.value = dayjs().year(item).valueOf();
datePicker.showPanel.value = "month";
emits("update:modelValue", Year.value);
} else {
emits("update:modelValue", Year.value);
datePicker.showPanel.value = datePicker.type;
}
}
setTimeout(() => {
unWatch.value = false;
}, 0);
if (datePicker.simple) {
footOnOk();
}
};
const ScrollRef = ref();
onMounted(() => {
scrollTo();
});
watch(() => Year, () => {
Year.value = props.modelValue;
});
const scrollTo = () => {
nextTick(() => {
let scrollTop = 0;
for (const child of ScrollRef.value.firstElementChild.childNodes) {
if (child.classList && child.classList.contains("layui-this")) {
scrollTop = child.offsetTop - (ScrollRef.value.offsetHeight - child.offsetHeight) / 2;
break;
}
}
ScrollRef.value.scrollTo(0, scrollTop);
});
};
const footOnOk = () => {
emits("update:modelValue", Year.value ? Year.value : -1);
if (datePicker.range) {
emits("ok");
return;
} else {
if (datePicker.type === "datetime" || datePicker.type === "date") {
datePicker.showPanel.value = datePicker.type;
} else {
datePicker.ok();
}
}
};
const footOnNow = () => {
Year.value = dayjs().year();
if (datePicker.type === "yearmonth") {
datePicker.currentMonth.value = dayjs().month();
}
scrollTo();
};
const footOnClear = () => {
Year.value = "";
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$8, [
createElementVNode("div", _hoisted_2$7, [
createElementVNode("div", _hoisted_3$7, [
createElementVNode("div", _hoisted_4$5, [
2022-12-30 08:13:19 +00:00
createElementVNode("span", _hoisted_5$5, toDisplayString$1(unref(t)("datePicker.selectYear")), 1)
2022-11-15 01:16:55 +00:00
])
])
]),
createElementVNode("div", {
class: "layui-laydate-content",
style: { "height": "220px", "overflow-y": "auto" },
ref_key: "ScrollRef",
ref: ScrollRef
}, [
createElementVNode("ul", _hoisted_6$4, [
(openBlock(true), createElementBlock(Fragment, null, renderList(yearList.value, (item) => {
return openBlock(), createElementBlock("li", {
key: item,
2022-12-09 08:41:41 +00:00
class: normalizeClass({
"layui-this": Year.value === item,
"layui-laydate-current": !Year.value && item === unref(dayjs)().year()
}),
2022-11-15 01:16:55 +00:00
onClick: ($event) => handleYearClick(item)
}, toDisplayString$1(item), 11, _hoisted_7$4);
}), 128))
])
], 512),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
unref(datePicker).type === "yearmonth" ? (openBlock(), createElementBlock("span", {
key: 0,
onClick: _cache[0] || (_cache[0] = ($event) => unref(datePicker).showPanel.value = "month"),
class: "laydate-btns-time"
}, toDisplayString$1(unref(t)("datePicker.selectMonth")), 1)) : Year.value > 0 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(Year.value), 1)
], 64)) : createCommentVNode("", true)
]),
_: 1
})
]);
};
}
});
const _hoisted_1$7 = { class: "layui-laydate" };
const _hoisted_2$6 = { class: "layui-laydate-main laydate-main-list-0 laydate-ym-show" };
const _hoisted_3$6 = { class: "layui-laydate-header" };
const _hoisted_4$4 = { class: "laydate-set-ym" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$4 = {
2022-11-15 01:16:55 +00:00
class: "layui-laydate-content",
style: { "height": "220px" }
};
const _hoisted_6$3 = { class: "layui-laydate-list laydate-month-list" };
const _hoisted_7$3 = ["onClick"];
const __default__$a = {
name: "TimePanel"
};
const _sfc_main$b = defineComponent({
...__default__$a,
props: {
modelValue: null,
max: { default: dayjs().year() + 100 }
},
emits: ["update:modelValue", "ok"],
setup(__props, { emit: emits }) {
const props = __props;
const datePicker = inject("datePicker");
const Month = ref(props.modelValue);
const { t } = useI18n();
const MONTH_NAME = computed$1(() => [
t("datePicker.january"),
t("datePicker.february"),
t("datePicker.march"),
t("datePicker.april"),
t("datePicker.may"),
t("datePicker.june"),
t("datePicker.july"),
t("datePicker.august"),
t("datePicker.september"),
t("datePicker.october"),
t("datePicker.november"),
t("datePicker.december")
]);
const handleMonthClick = (item) => {
Month.value = MONTH_NAME.value.indexOf(item);
if (!datePicker.range) {
if (datePicker.type === "yearmonth") {
datePicker.currentDay.value = dayjs(datePicker.currentDay.value).month(MONTH_NAME.value.indexOf(item)).valueOf();
}
if (datePicker.type === "date" || datePicker.type === "datetime") {
emits("update:modelValue", MONTH_NAME.value.indexOf(item));
datePicker.showPanel.value = datePicker.type;
}
}
if (datePicker.simple) {
footOnOk();
}
};
watch(() => props.modelValue, () => {
Month.value = props.modelValue;
});
const footOnOk = () => {
emits("update:modelValue", Month.value ? Month.value : -1);
if (datePicker.range) {
emits("ok");
return;
} else {
if (datePicker.type === "datetime" || datePicker.type === "date") {
datePicker.showPanel.value = datePicker.type;
} else {
datePicker.ok();
}
}
};
const footOnNow = () => {
Month.value = dayjs().month();
};
const footOnClear = () => {
Month.value = "";
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$7, [
createElementVNode("div", _hoisted_2$6, [
createElementVNode("div", _hoisted_3$6, [
createElementVNode("div", _hoisted_4$4, [
createElementVNode("span", {
onClick: _cache[0] || (_cache[0] = ($event) => unref(datePicker).showPanel.value = "month")
}, toDisplayString$1(typeof Month.value !== "string" ? unref(MONTH_NAME)[Month.value] : unref(t)("datePicker.selectMonth")), 1)
])
])
]),
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_5$4, [
2022-11-15 01:16:55 +00:00
createElementVNode("ul", _hoisted_6$3, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(MONTH_NAME), (item) => {
return openBlock(), createElementBlock("li", {
key: item,
2022-12-09 08:41:41 +00:00
class: normalizeClass({
"layui-this": unref(MONTH_NAME).indexOf(item) === Month.value,
"layui-laydate-current": Month.value === "" && parseInt(item) - 1 === unref(dayjs)().month()
}),
2022-11-15 01:16:55 +00:00
onClick: ($event) => handleMonthClick(item)
}, toDisplayString$1(item.slice(0, 3)), 11, _hoisted_7$3);
}), 128))
])
]),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
unref(datePicker).type === "yearmonth" ? (openBlock(), createElementBlock("span", {
key: 0,
onClick: _cache[1] || (_cache[1] = ($event) => unref(datePicker).showPanel.value = "year"),
class: "laydate-btns-time"
}, toDisplayString$1(unref(t)("datePicker.selectYear")), 1)) : createCommentVNode("", true)
]),
_: 1
})
]);
};
}
});
const _hoisted_1$6 = { style: { "display": "flex" } };
const _hoisted_2$5 = { class: "layui-laydate-main laydate-main-list-0" };
const _hoisted_3$5 = { class: "layui-laydate-header" };
const _hoisted_4$3 = { class: "laydate-set-ym" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$3 = { class: "laydate-range-time" };
2022-11-15 01:16:55 +00:00
const _hoisted_6$2 = { class: "laydate-range-time" };
const _hoisted_7$2 = { class: "laydate-range-time" };
const _hoisted_8$1 = { class: "layui-laydate-main laydate-main-list-0" };
const _hoisted_9$1 = { class: "layui-laydate-header" };
const _hoisted_10$1 = { class: "laydate-set-ym" };
const _hoisted_11$1 = { class: "laydate-range-time" };
const _hoisted_12$1 = { class: "laydate-range-time" };
const _hoisted_13$1 = { class: "laydate-range-time" };
const _hoisted_14$1 = {
key: 0,
class: "layui-laydate-preview"
};
const __default__$9 = {
name: "DateRange"
};
const _sfc_main$a = defineComponent({
...__default__$9,
props: {
startTime: null,
endTime: null
},
emits: [
"update:modelValue",
"update:startTime",
"update:endTime"
],
setup(__props, { emit: emits }) {
const props = __props;
const datePicker = inject("datePicker");
const { t } = useI18n();
const MONTH_NAME = computed$1(() => [
t("datePicker.january"),
t("datePicker.february"),
t("datePicker.march"),
t("datePicker.april"),
t("datePicker.may"),
t("datePicker.june"),
t("datePicker.july"),
t("datePicker.august"),
t("datePicker.september"),
t("datePicker.october"),
t("datePicker.november"),
t("datePicker.december")
]);
const prevDateList = ref([]);
const nextDateList = ref([]);
const startTime = reactive({
year: props.startTime ? dayjs(props.startTime).year() : dayjs().year(),
month: props.startTime ? dayjs(props.startTime).month() : dayjs().month(),
day: props.startTime ? dayjs(props.startTime).startOf("day").valueOf() : -1,
hms: {
hh: props.startTime ? dayjs(props.startTime).hour() : 0,
mm: props.startTime ? dayjs(props.startTime).minute() : 0,
ss: props.startTime ? dayjs(props.startTime).second() : 0
}
});
const endTime = reactive({
year: props.endTime ? dayjs(props.endTime).year() : dayjs().year(),
month: props.endTime ? dayjs(props.endTime).month() : dayjs().month(),
day: props.endTime ? dayjs(props.endTime).startOf("day").valueOf() : -1,
hms: {
hh: props.endTime ? dayjs(props.endTime).hour() : 0,
mm: props.endTime ? dayjs(props.endTime).minute() : 0,
ss: props.endTime ? dayjs(props.endTime).second() : 0
}
});
const hoverDate = ref(-1);
const changeYearOrMonth = (type4, num) => {
if (type4 === "year") {
startTime.year += num;
} else {
let month = startTime.month + num;
if (month > 11) {
month = 0;
startTime.year++;
} else if (month < 0) {
month = 11;
startTime.year--;
}
startTime.month = month;
}
};
watch(() => [startTime.year, startTime.month], () => {
prevDateList.value = setDateList(startTime.year, startTime.month);
nextDateList.value = setDateList(startTime.year, startTime.month + 1);
}, { immediate: true });
const dropdownTimePanelRefLeft = ref();
const dropdownTimePanelRefRight = ref();
const dropdownYearPanelRefLeft = ref();
const dropdownYearPanelRefRight = ref();
const dropdownMonthPanelRefLeft = ref();
const dropdownMonthPanelRefRight = ref();
const closeTimePanel = () => {
if (dropdownTimePanelRefLeft.value)
dropdownTimePanelRefLeft.value.hide();
if (dropdownTimePanelRefRight.value)
dropdownTimePanelRefRight.value.hide();
if (dropdownYearPanelRefLeft.value)
dropdownYearPanelRefLeft.value.hide();
if (dropdownMonthPanelRefLeft.value)
dropdownMonthPanelRefLeft.value.hide();
};
const closeRightYearPanel = () => {
if (dropdownYearPanelRefRight.value)
dropdownYearPanelRefRight.value.hide();
startTime.year = endTime.year;
};
const closeRightMonthPanel = () => {
dropdownMonthPanelRefRight.value.hide();
let month = endTime.month - 1;
if (month > 11) {
month = 0;
startTime.year++;
} else if (month < 0) {
month = 11;
startTime.year--;
}
startTime.month = month;
};
const footOnOk = () => {
let format2 = datePicker.type === "datetime" ? "YYYY-MM-DD HH:mm:ss" : "YYYY-MM-DD";
let startTimeVal = startTime.day !== -1 && endTime.day !== -1 ? dayjs(startTime.day).hour(startTime.hms.hh).minute(startTime.hms.mm).second(startTime.hms.ss).format(format2) : "";
let endTimeVal = startTime.day !== -1 && endTime.day !== -1 ? dayjs(endTime.day).hour(endTime.hms.hh).minute(endTime.hms.mm).second(endTime.hms.ss).format(format2) : "";
emits("update:startTime", startTimeVal);
emits("update:endTime", endTimeVal);
datePicker.ok();
};
const footOnNow = () => {
startTime.year = dayjs().year();
startTime.month = dayjs().month();
startTime.day = new Date(new Date().toDateString()).getTime();
startTime.hms.hh = dayjs().hour();
startTime.hms.mm = dayjs().minute();
startTime.hms.ss = dayjs().second();
endTime.day = -1;
};
const footOnClear = () => {
startTime.day = -1;
endTime.day = -1;
};
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-laydate layui-laydate-range", "layui-laydate-range-" + unref(datePicker).showPanel.value])
}, [
createElementVNode("div", _hoisted_1$6, [
createElementVNode("div", _hoisted_2$5, [
createElementVNode("div", _hoisted_3$5, [
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-prev-y",
onClick: _cache[0] || (_cache[0] = ($event) => changeYearOrMonth("year", -1))
}, "\uE65A"),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-prev-m",
onClick: _cache[1] || (_cache[1] = ($event) => changeYearOrMonth("month", -1))
}, "\uE603"),
createElementVNode("div", _hoisted_4$3, [
createVNode(_sfc_main$1y, {
ref_key: "dropdownYearPanelRefLeft",
ref: dropdownYearPanelRefLeft
}, {
content: withCtx(() => [
createVNode(_sfc_main$c, {
class: "time-panel",
modelValue: startTime.year,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => startTime.year = $event),
onOk: closeTimePanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
2022-12-30 08:13:19 +00:00
createElementVNode("span", _hoisted_5$3, toDisplayString$1(startTime.year || "--") + " " + toDisplayString$1(unref(t)("datePicker.year")), 1)
2022-11-15 01:16:55 +00:00
]),
_: 1
}, 512),
createVNode(_sfc_main$1y, {
ref_key: "dropdownMonthPanelRefLeft",
ref: dropdownMonthPanelRefLeft
}, {
content: withCtx(() => [
createVNode(_sfc_main$b, {
class: "time-panel",
modelValue: startTime.month,
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => startTime.month = $event),
onOk: closeTimePanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_6$2, toDisplayString$1(unref(MONTH_NAME)[startTime.month]), 1)
]),
_: 1
}, 512),
unref(datePicker).type === "datetime" ? (openBlock(), createBlock(_sfc_main$1y, {
key: 0,
ref_key: "dropdownTimePanelRefLeft",
ref: dropdownTimePanelRefLeft
}, {
content: withCtx(() => [
createVNode(_sfc_main$d, {
modelValue: startTime.hms,
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => startTime.hms = $event),
class: "time-panel",
onOk: closeTimePanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_7$2, toDisplayString$1(unref(dayjs)().hour(startTime.hms.hh).minute(startTime.hms.mm).second(startTime.hms.ss).format("HH:mm:ss")), 1)
]),
_: 1
}, 512)) : createCommentVNode("", true)
])
]),
createVNode(_sfc_main$f, {
"date-list": prevDateList.value,
hoverDate: hoverDate.value,
"onUpdate:hoverDate": _cache[5] || (_cache[5] = ($event) => hoverDate.value = $event),
startDate: startTime.day,
"onUpdate:startDate": _cache[6] || (_cache[6] = ($event) => startTime.day = $event),
endDate: endTime.day,
"onUpdate:endDate": _cache[7] || (_cache[7] = ($event) => endTime.day = $event)
}, null, 8, ["date-list", "hoverDate", "startDate", "endDate"])
]),
createElementVNode("div", _hoisted_8$1, [
createElementVNode("div", _hoisted_9$1, [
createElementVNode("div", _hoisted_10$1, [
createVNode(_sfc_main$1y, {
ref_key: "dropdownYearPanelRefRight",
ref: dropdownYearPanelRefRight
}, {
content: withCtx(() => [
createVNode(_sfc_main$c, {
class: "time-panel",
modelValue: endTime.year,
"onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => endTime.year = $event),
onOk: closeRightYearPanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_11$1, toDisplayString$1(startTime.month + 1 > 11 ? startTime.year + 1 : startTime.year) + " " + toDisplayString$1(unref(t)("datePicker.year")), 1)
]),
_: 1
}, 512),
createVNode(_sfc_main$1y, {
ref_key: "dropdownMonthPanelRefRight",
ref: dropdownMonthPanelRefRight
}, {
content: withCtx(() => [
createVNode(_sfc_main$b, {
class: "time-panel",
modelValue: endTime.month,
"onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => endTime.month = $event),
onOk: closeRightMonthPanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_12$1, toDisplayString$1(unref(MONTH_NAME)[startTime.month + 1 > 11 ? startTime.month + 1 - 12 : startTime.month + 1]), 1)
]),
_: 1
}, 512),
unref(datePicker).type === "datetime" ? (openBlock(), createBlock(_sfc_main$1y, {
key: 0,
ref_key: "dropdownTimePanelRefRight",
ref: dropdownTimePanelRefRight
}, {
content: withCtx(() => [
createVNode(_sfc_main$d, {
modelValue: endTime.hms,
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => endTime.hms = $event),
class: "time-panel",
onOk: closeTimePanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_13$1, toDisplayString$1(unref(dayjs)().hour(endTime.hms.hh).minute(endTime.hms.mm).second(endTime.hms.ss).format("HH:mm:ss")), 1)
]),
_: 1
}, 512)) : createCommentVNode("", true)
]),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-next-m",
onClick: _cache[11] || (_cache[11] = ($event) => changeYearOrMonth("month", 1))
}, "\uE602"),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-next-y",
onClick: _cache[12] || (_cache[12] = ($event) => changeYearOrMonth("year", 1))
}, "\uE65B")
]),
createVNode(_sfc_main$f, {
"date-list": nextDateList.value,
hoverDate: hoverDate.value,
"onUpdate:hoverDate": _cache[13] || (_cache[13] = ($event) => hoverDate.value = $event),
startDate: startTime.day,
"onUpdate:startDate": _cache[14] || (_cache[14] = ($event) => startTime.day = $event),
endDate: endTime.day,
"onUpdate:endDate": _cache[15] || (_cache[15] = ($event) => endTime.day = $event)
}, null, 8, ["date-list", "hoverDate", "startDate", "endDate"])
])
]),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
startTime.day !== -1 ? (openBlock(), createElementBlock("span", _hoisted_14$1, [
createTextVNode(toDisplayString$1(unref(dayjs)(startTime.day).format("YYYY-MM-DD")) + " ", 1),
unref(datePicker).type === "datetime" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createTextVNode(toDisplayString$1(unref(dayjs)().hour(startTime.hms.hh).minute(startTime.hms.mm).second(startTime.hms.ss).format("HH:mm:ss")), 1)
], 64)) : createCommentVNode("", true),
createTextVNode(" " + toDisplayString$1(unref(datePicker).rangeSeparator) + " ", 1),
endTime.day !== -1 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(unref(dayjs)(endTime.day).format("YYYY-MM-DD")) + " ", 1),
unref(datePicker).type === "datetime" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createTextVNode(toDisplayString$1(unref(dayjs)().hour(endTime.hms.hh).minute(endTime.hms.mm).second(endTime.hms.ss).format("HH:mm:ss")), 1)
], 64)) : createCommentVNode("", true)
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
createTextVNode(" -- ")
], 64))
])) : createCommentVNode("", true)
]),
_: 1
})
], 2);
};
}
});
const _hoisted_1$5 = { class: "layui-laydate layui-laydate-range" };
const _hoisted_2$4 = { style: { "display": "flex" } };
const _hoisted_3$4 = { class: "layui-laydate-main laydate-main-list-0" };
const _hoisted_4$2 = { class: "layui-laydate-header" };
2022-12-30 08:13:19 +00:00
const _hoisted_5$2 = { class: "laydate-set-ym" };
2022-11-15 01:16:55 +00:00
const _hoisted_6$1 = { class: "laydate-range-time" };
const _hoisted_7$1 = {
class: "layui-laydate-content",
style: { "height": "220px" }
};
const _hoisted_8 = { class: "layui-laydate-list laydate-month-list" };
const _hoisted_9 = ["data-unix", "onClick", "onMouseenter"];
const _hoisted_10 = { class: "layui-laydate-main laydate-main-list-0" };
const _hoisted_11 = { class: "layui-laydate-header" };
const _hoisted_12 = { class: "laydate-set-ym" };
const _hoisted_13 = { class: "laydate-range-time" };
const _hoisted_14 = {
class: "layui-laydate-content",
style: { "height": "220px" }
};
const _hoisted_15 = { class: "layui-laydate-list laydate-month-list" };
const _hoisted_16 = ["data-unix", "onClick", "onMouseenter"];
const _hoisted_17 = {
key: 0,
class: "layui-laydate-preview"
};
const __default__$8 = {
name: "MonthRange"
};
const _sfc_main$9 = defineComponent({
...__default__$8,
props: {
startTime: null,
endTime: null
},
emits: [
"update:modelValue",
"update:startTime",
"update:endTime"
],
setup(__props, { emit: emits }) {
const props = __props;
const { t } = useI18n();
const datePicker = inject("datePicker");
const startTime = reactive({
year: props.startTime ? dayjs(props.startTime).year() : dayjs().year(),
unix: props.startTime ? dayjs(props.startTime).hour(0).minute(0).second(0).valueOf() : -1
});
const endTime = reactive({
year: props.endTime ? dayjs(props.endTime).year() : dayjs().year() + 1,
unix: props.startTime ? dayjs(props.endTime).hour(0).minute(0).second(0).valueOf() : -1
});
let hoverMonth = ref(-1);
const MONTH_NAME = computed$1(() => [
t("datePicker.january"),
t("datePicker.february"),
t("datePicker.march"),
t("datePicker.april"),
t("datePicker.may"),
t("datePicker.june"),
t("datePicker.july"),
t("datePicker.august"),
t("datePicker.september"),
t("datePicker.october"),
t("datePicker.november"),
t("datePicker.december")
]);
const changeYear = (num) => {
startTime.year += num;
};
const handleMonthClick = (item) => {
if (startTime.unix === -1 && endTime.unix === -1) {
startTime.unix = item;
} else if (startTime.unix !== -1 && endTime.unix !== -1) {
hoverMonth.value = -1;
startTime.unix = item;
endTime.unix = -1;
} else if (startTime.unix !== -1 && endTime.unix === -1) {
endTime.unix = item;
if (item < startTime.unix) {
const first = startTime.unix;
const last = item;
startTime.unix = last;
endTime.unix = first;
}
}
};
watch(() => [props.startTime, props.endTime], () => {
startTime.year = props.startTime ? dayjs(props.startTime).year() : dayjs().year();
startTime.unix = props.startTime ? dayjs(props.startTime).hour(0).minute(0).second(0).valueOf() : -1;
endTime.year = props.endTime ? dayjs(props.endTime).year() : dayjs().year();
endTime.unix = props.startTime ? dayjs(props.endTime).hour(0).minute(0).second(0).valueOf() : -1;
});
const dropdownYearPanelRefLeft = ref();
const dropdownYearPanelRefRight = ref();
const closeLeftYearPanel = () => {
if (dropdownYearPanelRefLeft.value)
dropdownYearPanelRefLeft.value.hide();
};
const closeRightYearPanel = () => {
if (dropdownYearPanelRefRight.value)
dropdownYearPanelRefRight.value.hide();
startTime.year = endTime.year;
};
const footOnOk = () => {
let format2 = "YYYY-MM";
let startTimeVal = startTime.unix !== -1 && endTime.unix !== -1 ? dayjs(startTime.unix).format(format2) : "";
let endTimeVal = endTime.unix !== -1 && endTime.unix !== -1 ? dayjs(endTime.unix).format(format2) : "";
emits("update:startTime", startTimeVal);
emits("update:endTime", endTimeVal);
datePicker.ok();
};
const footOnNow = () => {
startTime.year = dayjs().year();
startTime.unix = dayjs(startTime.year + "-" + (dayjs().month() + 1)).valueOf();
endTime.unix = -1;
hoverMonth.value = -1;
};
const footOnClear = () => {
startTime.unix = -1;
endTime.unix = -1;
hoverMonth.value = -1;
};
const monthItemMouseEnter = (event, item) => {
if (!datePicker.range) {
return;
}
if (startTime.unix === -1) {
return;
}
if (hoverMonth.value !== -1 && endTime.unix !== -1) {
hoverMonth.value = -1;
return;
}
hoverMonth.value = parseInt(event.target.dataset.unix);
};
const ifHasRangeHoverClass = computed$1(() => {
return function(item) {
if (!datePicker.range) {
return false;
}
if (startTime.unix === -1) {
return false;
}
if (hoverMonth.value === -1 && endTime.unix === -1) {
return false;
}
let hover = endTime.unix !== -1 ? endTime.unix : hoverMonth.value;
let max = startTime.unix > hover ? startTime.unix : hover;
let min = startTime.unix < hover ? startTime.unix : hover;
if (item >= min && item <= max) {
return true;
}
return false;
};
});
const getUnix = computed$1(() => {
return function(item, position) {
let month = MONTH_NAME.value.indexOf(item);
let year = position === "left" ? startTime.year : startTime.year + 1;
return dayjs(year + "-" + (month + 1)).valueOf();
};
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$5, [
createElementVNode("div", _hoisted_2$4, [
createElementVNode("div", _hoisted_3$4, [
createElementVNode("div", _hoisted_4$2, [
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-prev-y",
onClick: _cache[0] || (_cache[0] = ($event) => changeYear(-1))
}, "\uE65A"),
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_5$2, [
2022-11-15 01:16:55 +00:00
createVNode(_sfc_main$1y, {
ref_key: "dropdownYearPanelRefLeft",
ref: dropdownYearPanelRefLeft
}, {
content: withCtx(() => [
createVNode(_sfc_main$c, {
class: "time-panel",
modelValue: startTime.year,
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => startTime.year = $event),
onOk: closeLeftYearPanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_6$1, toDisplayString$1(startTime.year || "--") + " " + toDisplayString$1(unref(t)("datePicker.year")), 1)
]),
_: 1
}, 512)
])
]),
createElementVNode("div", _hoisted_7$1, [
createElementVNode("ul", _hoisted_8, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(MONTH_NAME), (item) => {
return openBlock(), createElementBlock("li", {
key: item,
"data-unix": unref(getUnix)(item, "left"),
class: normalizeClass({
"layui-this": unref(getUnix)(item, "left") === startTime.unix || unref(getUnix)(item, "left") === endTime.unix,
2022-12-09 08:41:41 +00:00
"laydate-range-hover": unref(ifHasRangeHoverClass)(unref(getUnix)(item, "left")),
"layui-laydate-current": (startTime.unix === -1 || endTime.unix === -1) && unref(getUnix)(item, "left") === unref(dayjs)().startOf("month").valueOf()
2022-11-15 01:16:55 +00:00
}),
onClick: ($event) => handleMonthClick(unref(getUnix)(item, "left")),
onMouseenter: ($event) => monthItemMouseEnter($event)
}, toDisplayString$1(item.slice(0, 3)), 43, _hoisted_9);
}), 128))
])
])
]),
createElementVNode("div", _hoisted_10, [
createElementVNode("div", _hoisted_11, [
createElementVNode("div", _hoisted_12, [
createVNode(_sfc_main$1y, {
ref_key: "dropdownYearPanelRefRight",
ref: dropdownYearPanelRefRight
}, {
content: withCtx(() => [
createVNode(_sfc_main$c, {
class: "time-panel",
modelValue: endTime.year,
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => endTime.year = $event),
onOk: closeRightYearPanel
}, null, 8, ["modelValue"])
]),
default: withCtx(() => [
createElementVNode("span", _hoisted_13, toDisplayString$1(startTime.year + 1) + " " + toDisplayString$1(unref(t)("datePicker.year")), 1)
]),
_: 1
}, 512)
]),
createElementVNode("i", {
class: "layui-icon laydate-icon laydate-next-y",
onClick: _cache[3] || (_cache[3] = ($event) => changeYear(1))
}, "\uE65B")
]),
createElementVNode("div", _hoisted_14, [
createElementVNode("ul", _hoisted_15, [
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(MONTH_NAME), (item) => {
return openBlock(), createElementBlock("li", {
key: item,
"data-unix": unref(getUnix)(item, "right"),
class: normalizeClass({
"layui-this": unref(getUnix)(item, "right") === startTime.unix || unref(getUnix)(item, "right") === endTime.unix,
2022-12-09 08:41:41 +00:00
"laydate-range-hover": unref(ifHasRangeHoverClass)(unref(getUnix)(item, "right")),
"layui-laydate-current": (startTime.unix === -1 || endTime.unix === -1) && unref(getUnix)(item, "right") === unref(dayjs)().startOf("month").valueOf()
2022-11-15 01:16:55 +00:00
}),
onClick: ($event) => handleMonthClick(unref(getUnix)(item, "right")),
onMouseenter: ($event) => monthItemMouseEnter($event)
}, toDisplayString$1(item.slice(0, 3)), 43, _hoisted_16);
}), 128))
])
])
])
]),
createVNode(_sfc_main$g, {
onOk: footOnOk,
onNow: footOnNow,
onClear: footOnClear
}, {
default: withCtx(() => [
startTime.unix !== -1 ? (openBlock(), createElementBlock("span", _hoisted_17, [
createTextVNode(toDisplayString$1(unref(dayjs)(startTime.unix).format("YYYY-MM-DD")) + " " + toDisplayString$1(unref(datePicker).rangeSeparator) + " ", 1),
endTime.unix !== -1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
createTextVNode(toDisplayString$1(unref(dayjs)(endTime.unix).format("YYYY-MM-DD")), 1)
], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(" -- ")
], 64))
])) : createCommentVNode("", true)
]),
_: 1
})
]);
};
}
});
const _hoisted_1$4 = ["size"];
const _hoisted_2$3 = {
key: 1,
class: "laydate-range-inputs"
};
const _hoisted_3$3 = { class: "range-separator" };
const __default__$7 = {
name: "LayDatePicker"
};
const _sfc_main$8 = defineComponent({
...__default__$7,
props: {
type: { default: "date" },
placeholder: null,
modelValue: { default: "" },
disabled: { type: Boolean, default: false },
simple: { type: Boolean, default: false },
name: null,
max: null,
min: null,
range: { type: Boolean, default: false },
rangeSeparator: { default: "\u81F3" },
readonly: { type: Boolean, default: false },
allowClear: { type: Boolean, default: false },
size: { default: "md" },
prefixIcon: { default: "layui-icon-date" },
suffixIcon: { default: "" },
timestamp: { type: Boolean, default: false },
contentClass: null,
contentStyle: null
},
emits: ["update:modelValue", "change", "blur", "focus"],
setup(__props, { emit: $emits }) {
const props = __props;
const startPlaceholder = computed(() => {
if (Array.isArray(props.placeholder)) {
return props.placeholder[0];
}
return props.placeholder;
});
const endPlaceholder = computed(() => {
if (Array.isArray(props.placeholder)) {
return props.placeholder[1];
}
return props.placeholder;
});
const dropdownRef = ref(null);
const hms = ref({
hh: 0,
mm: 0,
ss: 0
});
const currentYear = ref(0);
const currentMonth = ref(0);
const currentDay = ref(0);
const showPanel = ref("date");
const rangeValue = reactive({ first: "", last: "" });
let unWatch = false;
const dateValue = props.range ? ref(["", ""]) : ref("");
const getDateValue = () => {
unWatch = true;
let dayjsVal;
switch (props.type) {
case "date":
dayjsVal = currentDay.value !== -1 ? dayjs(currentDay.value).format("YYYY-MM-DD") : "";
break;
case "datetime":
dayjsVal = currentDay.value !== -1 ? dayjs(currentDay.value).hour(hms.value.hh).minute(hms.value.mm).second(hms.value.ss).format("YYYY-MM-DD HH:mm:ss") : "";
break;
case "year":
dayjsVal = currentYear.value !== -1 ? dayjs().year(currentYear.value).format("YYYY") : "";
break;
case "month":
dayjsVal = currentMonth.value !== -1 ? (currentMonth.value + 1).toString() : "";
break;
case "time":
dayjsVal = dayjs().hour(hms.value.hh).minute(hms.value.mm).second(hms.value.ss).format("HH:mm:ss");
break;
case "yearmonth":
dayjsVal = currentYear.value !== -1 && currentMonth.value !== -1 ? dayjs().year(currentYear.value).month(currentMonth.value).format("YYYY-MM") : "";
break;
default:
dayjsVal = currentDay.value !== -1 ? dayjs(currentDay.value).hour(hms.value.hh).minute(hms.value.mm).second(hms.value.ss).format() : "";
break;
}
dateValue.value = dayjsVal !== "Invalid Date" ? dayjsVal : "";
if (dayjsVal === "Invalid Date") {
unWatch = false;
$emits("update:modelValue", "");
return;
}
if (props.timestamp) {
$emits("update:modelValue", dayjs(dayjsVal).unix() * 1e3);
$emits("change", dayjs(dayjsVal).unix() * 1e3);
} else {
$emits("update:modelValue", dayjsVal);
$emits("change", dayjsVal);
}
setTimeout(() => {
unWatch = false;
}, 0);
};
const getDateValueByRange = () => {
unWatch = true;
if (rangeValue.first === "" || rangeValue.last === "") {
dateValue.value = ["", ""];
$emits("update:modelValue", dateValue.value);
$emits("change", dateValue.value);
return;
}
let format2 = "YYYY-MM-DD";
switch (props.type) {
case "date":
format2 = "YYYY-MM-DD";
break;
case "datetime":
format2 = "YYYY-MM-DD HH:mm:ss";
break;
case "yearmonth":
format2 = "YYYY-MM";
break;
}
dateValue.value = [
dayjs(rangeValue.first).format(format2),
dayjs(rangeValue.last).format(format2)
];
$emits("update:modelValue", dateValue.value);
$emits("change", dateValue.value);
setTimeout(() => {
unWatch = false;
}, 0);
};
const ok = () => {
if (!props.range) {
getDateValue();
} else {
getDateValueByRange();
}
if (dropdownRef.value)
dropdownRef.value.hide();
showPanel.value = props.type;
};
watch(() => props.type, () => {
showPanel.value = props.type;
if (props.type === "yearmonth" && !props.range) {
showPanel.value = "year";
}
}, { immediate: true });
watch(() => props.modelValue, () => {
if (unWatch) {
return;
}
let initModelValue = props.range && props.modelValue ? props.modelValue[0] || "" : props.modelValue;
if (props.type === "month" || props.type === "year") {
initModelValue += "";
}
hms.value.hh = isNaN(dayjs(initModelValue).hour()) ? 0 : dayjs(initModelValue).hour();
hms.value.mm = isNaN(dayjs(initModelValue).minute()) ? 0 : dayjs(initModelValue).minute();
hms.value.ss = isNaN(dayjs(initModelValue).second()) ? 0 : dayjs(initModelValue).second();
if (initModelValue.length === 8 && props.type === "time") {
let modelValue = initModelValue;
modelValue = "1970-01-01 " + modelValue;
hms.value.hh = dayjs(modelValue).hour();
hms.value.mm = dayjs(modelValue).minute();
hms.value.ss = dayjs(modelValue).second();
}
currentYear.value = initModelValue ? getYear(initModelValue) : -1;
currentMonth.value = initModelValue ? getMonth(initModelValue) : -1;
currentDay.value = initModelValue ? getDay(initModelValue) : -1;
if (props.type === "date" || props.type === "datetime") {
if (currentYear.value === -1)
currentYear.value = dayjs().year();
if (currentMonth.value === -1)
currentMonth.value = dayjs().month();
if (props.timestamp) {
currentDay.value = initModelValue ? dayjs(parseInt(initModelValue)).startOf("date").unix() * 1e3 : -1;
}
}
rangeValue.first = initModelValue;
rangeValue.last = props.range && props.modelValue ? props.modelValue[1] || "" : "";
if (!props.range) {
getDateValue();
} else {
getDateValueByRange();
}
}, { immediate: true });
const onChange = () => {
if (dropdownRef.value)
dropdownRef.value.hide();
$emits("update:modelValue", dateValue.value);
};
provide("datePicker", {
currentYear,
currentMonth,
currentDay,
dateValue,
type: props.type,
showPanel,
hms,
ok: () => ok(),
getDateValue: () => getDateValue,
range: props.range,
rangeValue,
rangeSeparator: props.rangeSeparator,
simple: props.simple,
timestamp: props.timestamp
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-date-picker", { "layui-date-range-picker": __props.range }]),
size: __props.size
}, [
createVNode(_sfc_main$1y, {
ref_key: "dropdownRef",
ref: dropdownRef,
disabled: __props.disabled,
autoFitMinWidth: false,
contentClass: __props.contentClass,
contentStyle: __props.contentStyle,
updateAtScroll: ""
}, {
content: withCtx(() => [
!__props.range && (showPanel.value === "date" || showPanel.value === "datetime") ? (openBlock(), createBlock(_sfc_main$e, {
key: 0,
modelValue: currentDay.value,
"onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => currentDay.value = $event)
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
!__props.range && showPanel.value === "time" ? (openBlock(), createBlock(_sfc_main$d, {
key: 1,
modelValue: hms.value,
"onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => hms.value = $event)
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
!__props.range && (showPanel.value === "year" || showPanel.value === "yearmonth") ? (openBlock(), createBlock(_sfc_main$c, {
key: 2,
modelValue: currentYear.value,
"onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => currentYear.value = $event)
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
!__props.range && showPanel.value === "month" ? (openBlock(), createBlock(_sfc_main$b, {
key: 3,
modelValue: currentMonth.value,
"onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => currentMonth.value = $event)
}, null, 8, ["modelValue"])) : createCommentVNode("", true),
__props.range && (showPanel.value === "date" || showPanel.value === "datetime") ? (openBlock(), createBlock(_sfc_main$a, {
key: 4,
startTime: rangeValue.first,
"onUpdate:startTime": _cache[15] || (_cache[15] = ($event) => rangeValue.first = $event),
endTime: rangeValue.last,
"onUpdate:endTime": _cache[16] || (_cache[16] = ($event) => rangeValue.last = $event)
}, null, 8, ["startTime", "endTime"])) : createCommentVNode("", true),
__props.range && showPanel.value === "yearmonth" ? (openBlock(), createBlock(_sfc_main$9, {
key: 5,
startTime: rangeValue.first,
"onUpdate:startTime": _cache[17] || (_cache[17] = ($event) => rangeValue.first = $event),
endTime: rangeValue.last,
"onUpdate:endTime": _cache[18] || (_cache[18] = ($event) => rangeValue.last = $event)
}, null, 8, ["startTime", "endTime"])) : createCommentVNode("", true)
]),
default: withCtx(() => [
!__props.range ? (openBlock(), createBlock(_sfc_main$1v, {
key: 0,
name: __props.name,
readonly: __props.readonly,
placeholder: unref(startPlaceholder),
"prefix-icon": __props.prefixIcon,
"suffix-icon": __props.suffixIcon,
disabled: __props.disabled,
modelValue: unref(dateValue),
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(dateValue) ? dateValue.value = $event : null),
onChange,
onBlur: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("blur")),
onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("focus")),
"allow-clear": !__props.disabled && __props.allowClear,
size: __props.size,
onClear: _cache[3] || (_cache[3] = ($event) => {
dateValue.value = "";
onChange();
})
}, null, 8, ["name", "readonly", "placeholder", "prefix-icon", "suffix-icon", "disabled", "modelValue", "allow-clear", "size"])) : (openBlock(), createElementBlock("div", _hoisted_2$3, [
createVNode(_sfc_main$1v, {
readonly: __props.readonly,
name: __props.name,
modelValue: unref(dateValue)[0],
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => unref(dateValue)[0] = $event),
placeholder: unref(startPlaceholder),
disabled: __props.disabled,
onChange,
onBlur: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("blur")),
onFocus: _cache[6] || (_cache[6] = ($event) => _ctx.$emit("focus")),
class: "start-input",
size: __props.size
}, null, 8, ["readonly", "name", "modelValue", "placeholder", "disabled", "size"]),
createElementVNode("span", _hoisted_3$3, toDisplayString$1(__props.rangeSeparator), 1),
createVNode(_sfc_main$1v, {
readonly: __props.readonly,
name: __props.name,
"allow-clear": __props.disabled && __props.allowClear,
placeholder: unref(endPlaceholder),
modelValue: unref(dateValue)[1],
"onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => unref(dateValue)[1] = $event),
disabled: __props.disabled,
onChange,
onBlur: _cache[8] || (_cache[8] = ($event) => _ctx.$emit("blur")),
onFocus: _cache[9] || (_cache[9] = ($event) => _ctx.$emit("focus")),
class: "end-input",
size: __props.size,
onClear: _cache[10] || (_cache[10] = ($event) => {
dateValue.value = [];
onChange();
})
}, null, 8, ["readonly", "name", "allow-clear", "placeholder", "modelValue", "disabled", "size"])
]))
]),
_: 1
}, 8, ["disabled", "contentClass", "contentStyle"])
], 10, _hoisted_1$4);
};
}
});
const component$b = withInstall(_sfc_main$8);
const component$a = withInstall(_sfc_main$17);
var index$6 = /* @__PURE__ */ (() => '/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:11.623Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{image-orientation:0deg;display:block;height:100%;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-canvas,.cropper-crop-box,.cropper-drag-box,.cropper-modal,.cropper-wrap-box{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-canvas,.cropper-wrap-box{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:#3399ffbf;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:33.33333%;left:0;top:33.33333%;width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:33.33333%;top:0;width:33.33333%}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:after,.cropper-center:before{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width:768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width:992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width:1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}:root{--button-primary-text-color: #fff;--button-primary-background-color: var(--global-primary-color);--button-primary-border-color: var(--global-primary-color);--button-normal-text-color: #fff;--button-normal-background-color: var(--global-normal-color);--button-normal-border-color: var(--global-normal-color);--butto
/*!
* Cropper.js v1.5.12
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2021-06-12T08:00:17.411Z
*/
function ownKeys(object4, enumerableOnly) {
var keys = Object.keys(object4);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object4);
if (enumerableOnly) {
symbols = symbols.filter(function(sym) {
return Object.getOwnPropertyDescriptor(object4, sym).enumerable;
});
}
keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
if (i % 2) {
ownKeys(Object(source), true).forEach(function(key) {
_defineProperty(target, key, source[key]);
});
} else if (Object.getOwnPropertyDescriptors) {
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
} else {
ownKeys(Object(source)).forEach(function(key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
}
return target;
}
function _typeof(obj) {
"@babel/helpers - typeof";
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function(obj2) {
return typeof obj2;
};
} else {
_typeof = function(obj2) {
return obj2 && typeof Symbol === "function" && obj2.constructor === Symbol && obj2 !== Symbol.prototype ? "symbol" : typeof obj2;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps)
_defineProperties(Constructor.prototype, protoProps);
if (staticProps)
_defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr))
return _arrayLikeToArray(arr);
}
function _iterableToArray(iter) {
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null)
return Array.from(iter);
}
function _unsupportedIterableToArray(o, minLen) {
if (!o)
return;
if (typeof o === "string")
return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor)
n = o.constructor.name;
if (n === "Map" || n === "Set")
return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length)
len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++)
arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
var IS_BROWSER = typeof window !== "undefined" && typeof window.document !== "undefined";
var WINDOW = IS_BROWSER ? window : {};
var IS_TOUCH_DEVICE = IS_BROWSER && WINDOW.document.documentElement ? "ontouchstart" in WINDOW.document.documentElement : false;
var HAS_POINTER_EVENT = IS_BROWSER ? "PointerEvent" in WINDOW : false;
var NAMESPACE = "cropper";
var ACTION_ALL = "all";
var ACTION_CROP = "crop";
var ACTION_MOVE = "move";
var ACTION_ZOOM = "zoom";
var ACTION_EAST = "e";
var ACTION_WEST = "w";
var ACTION_SOUTH = "s";
var ACTION_NORTH = "n";
var ACTION_NORTH_EAST = "ne";
var ACTION_NORTH_WEST = "nw";
var ACTION_SOUTH_EAST = "se";
var ACTION_SOUTH_WEST = "sw";
var CLASS_CROP = "".concat(NAMESPACE, "-crop");
var CLASS_DISABLED = "".concat(NAMESPACE, "-disabled");
var CLASS_HIDDEN = "".concat(NAMESPACE, "-hidden");
var CLASS_HIDE = "".concat(NAMESPACE, "-hide");
var CLASS_INVISIBLE = "".concat(NAMESPACE, "-invisible");
var CLASS_MODAL = "".concat(NAMESPACE, "-modal");
var CLASS_MOVE = "".concat(NAMESPACE, "-move");
var DATA_ACTION = "".concat(NAMESPACE, "Action");
var DATA_PREVIEW = "".concat(NAMESPACE, "Preview");
var DRAG_MODE_CROP = "crop";
var DRAG_MODE_MOVE = "move";
var DRAG_MODE_NONE = "none";
var EVENT_CROP = "crop";
var EVENT_CROP_END = "cropend";
var EVENT_CROP_MOVE = "cropmove";
var EVENT_CROP_START = "cropstart";
var EVENT_DBLCLICK = "dblclick";
var EVENT_TOUCH_START = IS_TOUCH_DEVICE ? "touchstart" : "mousedown";
var EVENT_TOUCH_MOVE = IS_TOUCH_DEVICE ? "touchmove" : "mousemove";
var EVENT_TOUCH_END = IS_TOUCH_DEVICE ? "touchend touchcancel" : "mouseup";
var EVENT_POINTER_DOWN = HAS_POINTER_EVENT ? "pointerdown" : EVENT_TOUCH_START;
var EVENT_POINTER_MOVE = HAS_POINTER_EVENT ? "pointermove" : EVENT_TOUCH_MOVE;
var EVENT_POINTER_UP = HAS_POINTER_EVENT ? "pointerup pointercancel" : EVENT_TOUCH_END;
var EVENT_READY = "ready";
var EVENT_RESIZE = "resize";
var EVENT_WHEEL = "wheel";
var EVENT_ZOOM = "zoom";
var MIME_TYPE_JPEG = "image/jpeg";
var REGEXP_ACTIONS = /^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;
var REGEXP_DATA_URL = /^data:/;
var REGEXP_DATA_URL_JPEG = /^data:image\/jpeg;base64,/;
var REGEXP_TAG_NAME = /^img|canvas$/i;
var MIN_CONTAINER_WIDTH = 200;
var MIN_CONTAINER_HEIGHT = 100;
var DEFAULTS = {
viewMode: 0,
dragMode: DRAG_MODE_CROP,
initialAspectRatio: NaN,
aspectRatio: NaN,
data: null,
preview: "",
responsive: true,
restore: true,
checkCrossOrigin: true,
checkOrientation: true,
modal: true,
guides: true,
center: true,
highlight: true,
background: true,
autoCrop: true,
autoCropArea: 0.8,
movable: true,
rotatable: true,
scalable: true,
zoomable: true,
zoomOnTouch: true,
zoomOnWheel: true,
wheelZoomRatio: 0.1,
cropBoxMovable: true,
cropBoxResizable: true,
toggleDragModeOnDblclick: true,
minCanvasWidth: 0,
minCanvasHeight: 0,
minCropBoxWidth: 0,
minCropBoxHeight: 0,
minContainerWidth: MIN_CONTAINER_WIDTH,
minContainerHeight: MIN_CONTAINER_HEIGHT,
ready: null,
cropstart: null,
cropmove: null,
cropend: null,
crop: null,
zoom: null
};
var TEMPLATE = '<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';
var isNaN$1 = Number.isNaN || WINDOW.isNaN;
function isNumber(value) {
return typeof value === "number" && !isNaN$1(value);
}
var isPositiveNumber = function isPositiveNumber2(value) {
return value > 0 && value < Infinity;
};
function isUndefined(value) {
return typeof value === "undefined";
}
function isObject(value) {
return _typeof(value) === "object" && value !== null;
}
var hasOwnProperty = Object.prototype.hasOwnProperty;
function isPlainObject(value) {
if (!isObject(value)) {
return false;
}
try {
var _constructor = value.constructor;
var prototype = _constructor.prototype;
return _constructor && prototype && hasOwnProperty.call(prototype, "isPrototypeOf");
} catch (error) {
return false;
}
}
function isFunction(value) {
return typeof value === "function";
}
var slice = Array.prototype.slice;
function toArray(value) {
return Array.from ? Array.from(value) : slice.call(value);
}
function forEach(data, callback) {
if (data && isFunction(callback)) {
if (Array.isArray(data) || isNumber(data.length)) {
toArray(data).forEach(function(value, key) {
callback.call(data, value, key, data);
});
} else if (isObject(data)) {
Object.keys(data).forEach(function(key) {
callback.call(data, data[key], key, data);
});
}
}
return data;
}
var assign = Object.assign || function assign2(target) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
if (isObject(target) && args.length > 0) {
args.forEach(function(arg) {
if (isObject(arg)) {
Object.keys(arg).forEach(function(key) {
target[key] = arg[key];
});
}
});
}
return target;
};
var REGEXP_DECIMALS = /\.\d*(?:0|9){12}\d*$/;
function normalizeDecimalNumber(value) {
var times = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 1e11;
return REGEXP_DECIMALS.test(value) ? Math.round(value * times) / times : value;
}
var REGEXP_SUFFIX = /^width|height|left|top|marginLeft|marginTop$/;
function setStyle(element, styles) {
var style = element.style;
forEach(styles, function(value, property) {
if (REGEXP_SUFFIX.test(property) && isNumber(value)) {
value = "".concat(value, "px");
}
style[property] = value;
});
}
function hasClass(element, value) {
return element.classList ? element.classList.contains(value) : element.className.indexOf(value) > -1;
}
function addClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
forEach(element, function(elem) {
addClass(elem, value);
});
return;
}
if (element.classList) {
element.classList.add(value);
return;
}
var className = element.className.trim();
if (!className) {
element.className = value;
} else if (className.indexOf(value) < 0) {
element.className = "".concat(className, " ").concat(value);
}
}
function removeClass(element, value) {
if (!value) {
return;
}
if (isNumber(element.length)) {
forEach(element, function(elem) {
removeClass(elem, value);
});
return;
}
if (element.classList) {
element.classList.remove(value);
return;
}
if (element.className.indexOf(value) >= 0) {
element.className = element.className.replace(value, "");
}
}
function toggleClass(element, value, added) {
if (!value) {
return;
}
if (isNumber(element.length)) {
forEach(element, function(elem) {
toggleClass(elem, value, added);
});
return;
}
if (added) {
addClass(element, value);
} else {
removeClass(element, value);
}
}
var REGEXP_CAMEL_CASE = /([a-z\d])([A-Z])/g;
function toParamCase(value) {
return value.replace(REGEXP_CAMEL_CASE, "$1-$2").toLowerCase();
}
function getData(element, name) {
if (isObject(element[name])) {
return element[name];
}
if (element.dataset) {
return element.dataset[name];
}
return element.getAttribute("data-".concat(toParamCase(name)));
}
function setData(element, name, data) {
if (isObject(data)) {
element[name] = data;
} else if (element.dataset) {
element.dataset[name] = data;
} else {
element.setAttribute("data-".concat(toParamCase(name)), data);
}
}
function removeData(element, name) {
if (isObject(element[name])) {
try {
delete element[name];
} catch (error) {
element[name] = void 0;
}
} else if (element.dataset) {
try {
delete element.dataset[name];
} catch (error) {
element.dataset[name] = void 0;
}
} else {
element.removeAttribute("data-".concat(toParamCase(name)));
}
}
var REGEXP_SPACES = /\s\s*/;
var onceSupported = function() {
var supported = false;
if (IS_BROWSER) {
var once = false;
var listener = function listener2() {
};
var options = Object.defineProperty({}, "once", {
get: function get() {
supported = true;
return once;
},
set: function set(value) {
once = value;
}
});
WINDOW.addEventListener("test", listener, options);
WINDOW.removeEventListener("test", listener, options);
}
return supported;
}();
function removeListener(element, type4, listener) {
var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
var handler = listener;
type4.trim().split(REGEXP_SPACES).forEach(function(event) {
if (!onceSupported) {
var listeners = element.listeners;
if (listeners && listeners[event] && listeners[event][listener]) {
handler = listeners[event][listener];
delete listeners[event][listener];
if (Object.keys(listeners[event]).length === 0) {
delete listeners[event];
}
if (Object.keys(listeners).length === 0) {
delete element.listeners;
}
}
}
element.removeEventListener(event, handler, options);
});
}
function addListener(element, type4, listener) {
var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
var _handler = listener;
type4.trim().split(REGEXP_SPACES).forEach(function(event) {
if (options.once && !onceSupported) {
var _element$listeners = element.listeners, listeners = _element$listeners === void 0 ? {} : _element$listeners;
_handler = function handler() {
delete listeners[event][listener];
element.removeEventListener(event, _handler, options);
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
listener.apply(element, args);
};
if (!listeners[event]) {
listeners[event] = {};
}
if (listeners[event][listener]) {
element.removeEventListener(event, listeners[event][listener], options);
}
listeners[event][listener] = _handler;
element.listeners = listeners;
}
element.addEventListener(event, _handler, options);
});
}
function dispatchEvent(element, type4, data) {
var event;
if (isFunction(Event) && isFunction(CustomEvent)) {
event = new CustomEvent(type4, {
detail: data,
bubbles: true,
cancelable: true
});
} else {
event = document.createEvent("CustomEvent");
event.initCustomEvent(type4, true, true, data);
}
return element.dispatchEvent(event);
}
function getOffset(element) {
var box = element.getBoundingClientRect();
return {
left: box.left + (window.pageXOffset - document.documentElement.clientLeft),
top: box.top + (window.pageYOffset - document.documentElement.clientTop)
};
}
var location$1 = WINDOW.location;
var REGEXP_ORIGINS = /^(\w+:)\/\/([^:/?#]*):?(\d*)/i;
function isCrossOriginURL(url2) {
var parts = url2.match(REGEXP_ORIGINS);
return parts !== null && (parts[1] !== location$1.protocol || parts[2] !== location$1.hostname || parts[3] !== location$1.port);
}
function addTimestamp(url2) {
var timestamp = "timestamp=".concat(new Date().getTime());
return url2 + (url2.indexOf("?") === -1 ? "?" : "&") + timestamp;
}
function getTransforms(_ref) {
var rotate2 = _ref.rotate, scaleX2 = _ref.scaleX, scaleY2 = _ref.scaleY, translateX = _ref.translateX, translateY = _ref.translateY;
var values = [];
if (isNumber(translateX) && translateX !== 0) {
values.push("translateX(".concat(translateX, "px)"));
}
if (isNumber(translateY) && translateY !== 0) {
values.push("translateY(".concat(translateY, "px)"));
}
if (isNumber(rotate2) && rotate2 !== 0) {
values.push("rotate(".concat(rotate2, "deg)"));
}
if (isNumber(scaleX2) && scaleX2 !== 1) {
values.push("scaleX(".concat(scaleX2, ")"));
}
if (isNumber(scaleY2) && scaleY2 !== 1) {
values.push("scaleY(".concat(scaleY2, ")"));
}
var transform2 = values.length ? values.join(" ") : "none";
return {
WebkitTransform: transform2,
msTransform: transform2,
transform: transform2
};
}
function getMaxZoomRatio(pointers) {
var pointers2 = _objectSpread2({}, pointers);
var maxRatio = 0;
forEach(pointers, function(pointer, pointerId) {
delete pointers2[pointerId];
forEach(pointers2, function(pointer2) {
var x1 = Math.abs(pointer.startX - pointer2.startX);
var y1 = Math.abs(pointer.startY - pointer2.startY);
var x2 = Math.abs(pointer.endX - pointer2.endX);
var y2 = Math.abs(pointer.endY - pointer2.endY);
var z1 = Math.sqrt(x1 * x1 + y1 * y1);
var z2 = Math.sqrt(x2 * x2 + y2 * y2);
var ratio = (z2 - z1) / z1;
if (Math.abs(ratio) > Math.abs(maxRatio)) {
maxRatio = ratio;
}
});
});
return maxRatio;
}
function getPointer(_ref2, endOnly) {
var pageX = _ref2.pageX, pageY = _ref2.pageY;
var end = {
endX: pageX,
endY: pageY
};
return endOnly ? end : _objectSpread2({
startX: pageX,
startY: pageY
}, end);
}
function getPointersCenter(pointers) {
var pageX = 0;
var pageY = 0;
var count = 0;
forEach(pointers, function(_ref3) {
var startX = _ref3.startX, startY = _ref3.startY;
pageX += startX;
pageY += startY;
count += 1;
});
pageX /= count;
pageY /= count;
return {
pageX,
pageY
};
}
function getAdjustedSizes(_ref4) {
var aspectRatio = _ref4.aspectRatio, height = _ref4.height, width = _ref4.width;
var type4 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "contain";
var isValidWidth = isPositiveNumber(width);
var isValidHeight = isPositiveNumber(height);
if (isValidWidth && isValidHeight) {
var adjustedWidth = height * aspectRatio;
if (type4 === "contain" && adjustedWidth > width || type4 === "cover" && adjustedWidth < width) {
height = width / aspectRatio;
} else {
width = height * aspectRatio;
}
} else if (isValidWidth) {
height = width / aspectRatio;
} else if (isValidHeight) {
width = height * aspectRatio;
}
return {
width,
height
};
}
function getRotatedSizes(_ref5) {
var width = _ref5.width, height = _ref5.height, degree = _ref5.degree;
degree = Math.abs(degree) % 180;
if (degree === 90) {
return {
width: height,
height: width
};
}
var arc = degree % 90 * Math.PI / 180;
var sinArc = Math.sin(arc);
var cosArc = Math.cos(arc);
var newWidth = width * cosArc + height * sinArc;
var newHeight = width * sinArc + height * cosArc;
return degree > 90 ? {
width: newHeight,
height: newWidth
} : {
width: newWidth,
height: newHeight
};
}
function getSourceCanvas(image, _ref6, _ref7, _ref8) {
var imageAspectRatio = _ref6.aspectRatio, imageNaturalWidth = _ref6.naturalWidth, imageNaturalHeight = _ref6.naturalHeight, _ref6$rotate = _ref6.rotate, rotate2 = _ref6$rotate === void 0 ? 0 : _ref6$rotate, _ref6$scaleX = _ref6.scaleX, scaleX2 = _ref6$scaleX === void 0 ? 1 : _ref6$scaleX, _ref6$scaleY = _ref6.scaleY, scaleY2 = _ref6$scaleY === void 0 ? 1 : _ref6$scaleY;
var aspectRatio = _ref7.aspectRatio, naturalWidth = _ref7.naturalWidth, naturalHeight = _ref7.naturalHeight;
var _ref8$fillColor = _ref8.fillColor, fillColor = _ref8$fillColor === void 0 ? "transparent" : _ref8$fillColor, _ref8$imageSmoothingE = _ref8.imageSmoothingEnabled, imageSmoothingEnabled = _ref8$imageSmoothingE === void 0 ? true : _ref8$imageSmoothingE, _ref8$imageSmoothingQ = _ref8.imageSmoothingQuality, imageSmoothingQuality = _ref8$imageSmoothingQ === void 0 ? "low" : _ref8$imageSmoothingQ, _ref8$maxWidth = _ref8.maxWidth, maxWidth = _ref8$maxWidth === void 0 ? Infinity : _ref8$maxWidth, _ref8$maxHeight = _ref8.maxHeight, maxHeight = _ref8$maxHeight === void 0 ? Infinity : _ref8$maxHeight, _ref8$minWidth = _ref8.minWidth, minWidth = _ref8$minWidth === void 0 ? 0 : _ref8$minWidth, _ref8$minHeight = _ref8.minHeight, minHeight = _ref8$minHeight === void 0 ? 0 : _ref8$minHeight;
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
var maxSizes = getAdjustedSizes({
aspectRatio,
width: maxWidth,
height: maxHeight
});
var minSizes = getAdjustedSizes({
aspectRatio,
width: minWidth,
height: minHeight
}, "cover");
var width = Math.min(maxSizes.width, Math.max(minSizes.width, naturalWidth));
var height = Math.min(maxSizes.height, Math.max(minSizes.height, naturalHeight));
var destMaxSizes = getAdjustedSizes({
aspectRatio: imageAspectRatio,
width: maxWidth,
height: maxHeight
});
var destMinSizes = getAdjustedSizes({
aspectRatio: imageAspectRatio,
width: minWidth,
height: minHeight
}, "cover");
var destWidth = Math.min(destMaxSizes.width, Math.max(destMinSizes.width, imageNaturalWidth));
var destHeight = Math.min(destMaxSizes.height, Math.max(destMinSizes.height, imageNaturalHeight));
var params = [-destWidth / 2, -destHeight / 2, destWidth, destHeight];
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
context.fillStyle = fillColor;
context.fillRect(0, 0, width, height);
context.save();
context.translate(width / 2, height / 2);
context.rotate(rotate2 * Math.PI / 180);
context.scale(scaleX2, scaleY2);
context.imageSmoothingEnabled = imageSmoothingEnabled;
context.imageSmoothingQuality = imageSmoothingQuality;
context.drawImage.apply(context, [image].concat(_toConsumableArray(params.map(function(param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
context.restore();
return canvas;
}
var fromCharCode = String.fromCharCode;
function getStringFromCharCode(dataView, start, length) {
var str = "";
length += start;
for (var i = start; i < length; i += 1) {
str += fromCharCode(dataView.getUint8(i));
}
return str;
}
var REGEXP_DATA_URL_HEAD = /^data:.*,/;
function dataURLToArrayBuffer(dataURL) {
var base64 = dataURL.replace(REGEXP_DATA_URL_HEAD, "");
var binary = atob(base64);
var arrayBuffer = new ArrayBuffer(binary.length);
var uint8 = new Uint8Array(arrayBuffer);
forEach(uint8, function(value, i) {
uint8[i] = binary.charCodeAt(i);
});
return arrayBuffer;
}
function arrayBufferToDataURL(arrayBuffer, mimeType) {
var chunks = [];
var chunkSize = 8192;
var uint8 = new Uint8Array(arrayBuffer);
while (uint8.length > 0) {
chunks.push(fromCharCode.apply(null, toArray(uint8.subarray(0, chunkSize))));
uint8 = uint8.subarray(chunkSize);
}
return "data:".concat(mimeType, ";base64,").concat(btoa(chunks.join("")));
}
function resetAndGetOrientation(arrayBuffer) {
var dataView = new DataView(arrayBuffer);
var orientation;
try {
var littleEndian;
var app1Start;
var ifdStart;
if (dataView.getUint8(0) === 255 && dataView.getUint8(1) === 216) {
var length = dataView.byteLength;
var offset = 2;
while (offset + 1 < length) {
if (dataView.getUint8(offset) === 255 && dataView.getUint8(offset + 1) === 225) {
app1Start = offset;
break;
}
offset += 1;
}
}
if (app1Start) {
var exifIDCode = app1Start + 4;
var tiffOffset = app1Start + 10;
if (getStringFromCharCode(dataView, exifIDCode, 4) === "Exif") {
var endianness = dataView.getUint16(tiffOffset);
littleEndian = endianness === 18761;
if (littleEndian || endianness === 19789) {
if (dataView.getUint16(tiffOffset + 2, littleEndian) === 42) {
var firstIFDOffset = dataView.getUint32(tiffOffset + 4, littleEndian);
if (firstIFDOffset >= 8) {
ifdStart = tiffOffset + firstIFDOffset;
}
}
}
}
}
if (ifdStart) {
var _length = dataView.getUint16(ifdStart, littleEndian);
var _offset;
var i;
for (i = 0; i < _length; i += 1) {
_offset = ifdStart + i * 12 + 2;
if (dataView.getUint16(_offset, littleEndian) === 274) {
_offset += 8;
orientation = dataView.getUint16(_offset, littleEndian);
dataView.setUint16(_offset, 1, littleEndian);
break;
}
}
}
} catch (error) {
orientation = 1;
}
return orientation;
}
function parseOrientation(orientation) {
var rotate2 = 0;
var scaleX2 = 1;
var scaleY2 = 1;
switch (orientation) {
case 2:
scaleX2 = -1;
break;
case 3:
rotate2 = -180;
break;
case 4:
scaleY2 = -1;
break;
case 5:
rotate2 = 90;
scaleY2 = -1;
break;
case 6:
rotate2 = 90;
break;
case 7:
rotate2 = 90;
scaleX2 = -1;
break;
case 8:
rotate2 = -90;
break;
}
return {
rotate: rotate2,
scaleX: scaleX2,
scaleY: scaleY2
};
}
var render = {
render: function render2() {
this.initContainer();
this.initCanvas();
this.initCropBox();
this.renderCanvas();
if (this.cropped) {
this.renderCropBox();
}
},
initContainer: function initContainer() {
var element = this.element, options = this.options, container = this.container, cropper = this.cropper;
var minWidth = Number(options.minContainerWidth);
var minHeight = Number(options.minContainerHeight);
addClass(cropper, CLASS_HIDDEN);
removeClass(element, CLASS_HIDDEN);
var containerData = {
width: Math.max(container.offsetWidth, minWidth >= 0 ? minWidth : MIN_CONTAINER_WIDTH),
height: Math.max(container.offsetHeight, minHeight >= 0 ? minHeight : MIN_CONTAINER_HEIGHT)
};
this.containerData = containerData;
setStyle(cropper, {
width: containerData.width,
height: containerData.height
});
addClass(element, CLASS_HIDDEN);
removeClass(cropper, CLASS_HIDDEN);
},
initCanvas: function initCanvas() {
var containerData = this.containerData, imageData = this.imageData;
var viewMode = this.options.viewMode;
var rotated = Math.abs(imageData.rotate) % 180 === 90;
var naturalWidth = rotated ? imageData.naturalHeight : imageData.naturalWidth;
var naturalHeight = rotated ? imageData.naturalWidth : imageData.naturalHeight;
var aspectRatio = naturalWidth / naturalHeight;
var canvasWidth = containerData.width;
var canvasHeight = containerData.height;
if (containerData.height * aspectRatio > containerData.width) {
if (viewMode === 3) {
canvasWidth = containerData.height * aspectRatio;
} else {
canvasHeight = containerData.width / aspectRatio;
}
} else if (viewMode === 3) {
canvasHeight = containerData.width / aspectRatio;
} else {
canvasWidth = containerData.height * aspectRatio;
}
var canvasData = {
aspectRatio,
naturalWidth,
naturalHeight,
width: canvasWidth,
height: canvasHeight
};
this.canvasData = canvasData;
this.limited = viewMode === 1 || viewMode === 2;
this.limitCanvas(true, true);
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
canvasData.left = (containerData.width - canvasData.width) / 2;
canvasData.top = (containerData.height - canvasData.height) / 2;
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
this.initialCanvasData = assign({}, canvasData);
},
limitCanvas: function limitCanvas(sizeLimited, positionLimited) {
var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData;
var viewMode = options.viewMode;
var aspectRatio = canvasData.aspectRatio;
var cropped = this.cropped && cropBoxData;
if (sizeLimited) {
var minCanvasWidth = Number(options.minCanvasWidth) || 0;
var minCanvasHeight = Number(options.minCanvasHeight) || 0;
if (viewMode > 1) {
minCanvasWidth = Math.max(minCanvasWidth, containerData.width);
minCanvasHeight = Math.max(minCanvasHeight, containerData.height);
if (viewMode === 3) {
if (minCanvasHeight * aspectRatio > minCanvasWidth) {
minCanvasWidth = minCanvasHeight * aspectRatio;
} else {
minCanvasHeight = minCanvasWidth / aspectRatio;
}
}
} else if (viewMode > 0) {
if (minCanvasWidth) {
minCanvasWidth = Math.max(minCanvasWidth, cropped ? cropBoxData.width : 0);
} else if (minCanvasHeight) {
minCanvasHeight = Math.max(minCanvasHeight, cropped ? cropBoxData.height : 0);
} else if (cropped) {
minCanvasWidth = cropBoxData.width;
minCanvasHeight = cropBoxData.height;
if (minCanvasHeight * aspectRatio > minCanvasWidth) {
minCanvasWidth = minCanvasHeight * aspectRatio;
} else {
minCanvasHeight = minCanvasWidth / aspectRatio;
}
}
}
var _getAdjustedSizes = getAdjustedSizes({
aspectRatio,
width: minCanvasWidth,
height: minCanvasHeight
});
minCanvasWidth = _getAdjustedSizes.width;
minCanvasHeight = _getAdjustedSizes.height;
canvasData.minWidth = minCanvasWidth;
canvasData.minHeight = minCanvasHeight;
canvasData.maxWidth = Infinity;
canvasData.maxHeight = Infinity;
}
if (positionLimited) {
if (viewMode > (cropped ? 0 : 1)) {
var newCanvasLeft = containerData.width - canvasData.width;
var newCanvasTop = containerData.height - canvasData.height;
canvasData.minLeft = Math.min(0, newCanvasLeft);
canvasData.minTop = Math.min(0, newCanvasTop);
canvasData.maxLeft = Math.max(0, newCanvasLeft);
canvasData.maxTop = Math.max(0, newCanvasTop);
if (cropped && this.limited) {
canvasData.minLeft = Math.min(cropBoxData.left, cropBoxData.left + (cropBoxData.width - canvasData.width));
canvasData.minTop = Math.min(cropBoxData.top, cropBoxData.top + (cropBoxData.height - canvasData.height));
canvasData.maxLeft = cropBoxData.left;
canvasData.maxTop = cropBoxData.top;
if (viewMode === 2) {
if (canvasData.width >= containerData.width) {
canvasData.minLeft = Math.min(0, newCanvasLeft);
canvasData.maxLeft = Math.max(0, newCanvasLeft);
}
if (canvasData.height >= containerData.height) {
canvasData.minTop = Math.min(0, newCanvasTop);
canvasData.maxTop = Math.max(0, newCanvasTop);
}
}
}
} else {
canvasData.minLeft = -canvasData.width;
canvasData.minTop = -canvasData.height;
canvasData.maxLeft = containerData.width;
canvasData.maxTop = containerData.height;
}
}
},
renderCanvas: function renderCanvas(changed, transformed) {
var canvasData = this.canvasData, imageData = this.imageData;
if (transformed) {
var _getRotatedSizes = getRotatedSizes({
width: imageData.naturalWidth * Math.abs(imageData.scaleX || 1),
height: imageData.naturalHeight * Math.abs(imageData.scaleY || 1),
degree: imageData.rotate || 0
}), naturalWidth = _getRotatedSizes.width, naturalHeight = _getRotatedSizes.height;
var width = canvasData.width * (naturalWidth / canvasData.naturalWidth);
var height = canvasData.height * (naturalHeight / canvasData.naturalHeight);
canvasData.left -= (width - canvasData.width) / 2;
canvasData.top -= (height - canvasData.height) / 2;
canvasData.width = width;
canvasData.height = height;
canvasData.aspectRatio = naturalWidth / naturalHeight;
canvasData.naturalWidth = naturalWidth;
canvasData.naturalHeight = naturalHeight;
this.limitCanvas(true, false);
}
if (canvasData.width > canvasData.maxWidth || canvasData.width < canvasData.minWidth) {
canvasData.left = canvasData.oldLeft;
}
if (canvasData.height > canvasData.maxHeight || canvasData.height < canvasData.minHeight) {
canvasData.top = canvasData.oldTop;
}
canvasData.width = Math.min(Math.max(canvasData.width, canvasData.minWidth), canvasData.maxWidth);
canvasData.height = Math.min(Math.max(canvasData.height, canvasData.minHeight), canvasData.maxHeight);
this.limitCanvas(false, true);
canvasData.left = Math.min(Math.max(canvasData.left, canvasData.minLeft), canvasData.maxLeft);
canvasData.top = Math.min(Math.max(canvasData.top, canvasData.minTop), canvasData.maxTop);
canvasData.oldLeft = canvasData.left;
canvasData.oldTop = canvasData.top;
setStyle(this.canvas, assign({
width: canvasData.width,
height: canvasData.height
}, getTransforms({
translateX: canvasData.left,
translateY: canvasData.top
})));
this.renderImage(changed);
if (this.cropped && this.limited) {
this.limitCropBox(true, true);
}
},
renderImage: function renderImage(changed) {
var canvasData = this.canvasData, imageData = this.imageData;
var width = imageData.naturalWidth * (canvasData.width / canvasData.naturalWidth);
var height = imageData.naturalHeight * (canvasData.height / canvasData.naturalHeight);
assign(imageData, {
width,
height,
left: (canvasData.width - width) / 2,
top: (canvasData.height - height) / 2
});
setStyle(this.image, assign({
width: imageData.width,
height: imageData.height
}, getTransforms(assign({
translateX: imageData.left,
translateY: imageData.top
}, imageData))));
if (changed) {
this.output();
}
},
initCropBox: function initCropBox() {
var options = this.options, canvasData = this.canvasData;
var aspectRatio = options.aspectRatio || options.initialAspectRatio;
var autoCropArea = Number(options.autoCropArea) || 0.8;
var cropBoxData = {
width: canvasData.width,
height: canvasData.height
};
if (aspectRatio) {
if (canvasData.height * aspectRatio > canvasData.width) {
cropBoxData.height = cropBoxData.width / aspectRatio;
} else {
cropBoxData.width = cropBoxData.height * aspectRatio;
}
}
this.cropBoxData = cropBoxData;
this.limitCropBox(true, true);
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
cropBoxData.width = Math.max(cropBoxData.minWidth, cropBoxData.width * autoCropArea);
cropBoxData.height = Math.max(cropBoxData.minHeight, cropBoxData.height * autoCropArea);
cropBoxData.left = canvasData.left + (canvasData.width - cropBoxData.width) / 2;
cropBoxData.top = canvasData.top + (canvasData.height - cropBoxData.height) / 2;
cropBoxData.oldLeft = cropBoxData.left;
cropBoxData.oldTop = cropBoxData.top;
this.initialCropBoxData = assign({}, cropBoxData);
},
limitCropBox: function limitCropBox(sizeLimited, positionLimited) {
var options = this.options, containerData = this.containerData, canvasData = this.canvasData, cropBoxData = this.cropBoxData, limited = this.limited;
var aspectRatio = options.aspectRatio;
if (sizeLimited) {
var minCropBoxWidth = Number(options.minCropBoxWidth) || 0;
var minCropBoxHeight = Number(options.minCropBoxHeight) || 0;
var maxCropBoxWidth = limited ? Math.min(containerData.width, canvasData.width, canvasData.width + canvasData.left, containerData.width - canvasData.left) : containerData.width;
var maxCropBoxHeight = limited ? Math.min(containerData.height, canvasData.height, canvasData.height + canvasData.top, containerData.height - canvasData.top) : containerData.height;
minCropBoxWidth = Math.min(minCropBoxWidth, containerData.width);
minCropBoxHeight = Math.min(minCropBoxHeight, containerData.height);
if (aspectRatio) {
if (minCropBoxWidth && minCropBoxHeight) {
if (minCropBoxHeight * aspectRatio > minCropBoxWidth) {
minCropBoxHeight = minCropBoxWidth / aspectRatio;
} else {
minCropBoxWidth = minCropBoxHeight * aspectRatio;
}
} else if (minCropBoxWidth) {
minCropBoxHeight = minCropBoxWidth / aspectRatio;
} else if (minCropBoxHeight) {
minCropBoxWidth = minCropBoxHeight * aspectRatio;
}
if (maxCropBoxHeight * aspectRatio > maxCropBoxWidth) {
maxCropBoxHeight = maxCropBoxWidth / aspectRatio;
} else {
maxCropBoxWidth = maxCropBoxHeight * aspectRatio;
}
}
cropBoxData.minWidth = Math.min(minCropBoxWidth, maxCropBoxWidth);
cropBoxData.minHeight = Math.min(minCropBoxHeight, maxCropBoxHeight);
cropBoxData.maxWidth = maxCropBoxWidth;
cropBoxData.maxHeight = maxCropBoxHeight;
}
if (positionLimited) {
if (limited) {
cropBoxData.minLeft = Math.max(0, canvasData.left);
cropBoxData.minTop = Math.max(0, canvasData.top);
cropBoxData.maxLeft = Math.min(containerData.width, canvasData.left + canvasData.width) - cropBoxData.width;
cropBoxData.maxTop = Math.min(containerData.height, canvasData.top + canvasData.height) - cropBoxData.height;
} else {
cropBoxData.minLeft = 0;
cropBoxData.minTop = 0;
cropBoxData.maxLeft = containerData.width - cropBoxData.width;
cropBoxData.maxTop = containerData.height - cropBoxData.height;
}
}
},
renderCropBox: function renderCropBox() {
var options = this.options, containerData = this.containerData, cropBoxData = this.cropBoxData;
if (cropBoxData.width > cropBoxData.maxWidth || cropBoxData.width < cropBoxData.minWidth) {
cropBoxData.left = cropBoxData.oldLeft;
}
if (cropBoxData.height > cropBoxData.maxHeight || cropBoxData.height < cropBoxData.minHeight) {
cropBoxData.top = cropBoxData.oldTop;
}
cropBoxData.width = Math.min(Math.max(cropBoxData.width, cropBoxData.minWidth), cropBoxData.maxWidth);
cropBoxData.height = Math.min(Math.max(cropBoxData.height, cropBoxData.minHeight), cropBoxData.maxHeight);
this.limitCropBox(false, true);
cropBoxData.left = Math.min(Math.max(cropBoxData.left, cropBoxData.minLeft), cropBoxData.maxLeft);
cropBoxData.top = Math.min(Math.max(cropBoxData.top, cropBoxData.minTop), cropBoxData.maxTop);
cropBoxData.oldLeft = cropBoxData.left;
cropBoxData.oldTop = cropBoxData.top;
if (options.movable && options.cropBoxMovable) {
setData(this.face, DATA_ACTION, cropBoxData.width >= containerData.width && cropBoxData.height >= containerData.height ? ACTION_MOVE : ACTION_ALL);
}
setStyle(this.cropBox, assign({
width: cropBoxData.width,
height: cropBoxData.height
}, getTransforms({
translateX: cropBoxData.left,
translateY: cropBoxData.top
})));
if (this.cropped && this.limited) {
this.limitCanvas(true, true);
}
if (!this.disabled) {
this.output();
}
},
output: function output() {
this.preview();
dispatchEvent(this.element, EVENT_CROP, this.getData());
}
};
var preview = {
initPreview: function initPreview() {
var element = this.element, crossOrigin = this.crossOrigin;
var preview3 = this.options.preview;
var url2 = crossOrigin ? this.crossOriginUrl : this.url;
var alt = element.alt || "The image to preview";
var image = document.createElement("img");
if (crossOrigin) {
image.crossOrigin = crossOrigin;
}
image.src = url2;
image.alt = alt;
this.viewBox.appendChild(image);
this.viewBoxImage = image;
if (!preview3) {
return;
}
var previews = preview3;
if (typeof preview3 === "string") {
previews = element.ownerDocument.querySelectorAll(preview3);
} else if (preview3.querySelector) {
previews = [preview3];
}
this.previews = previews;
forEach(previews, function(el) {
var img = document.createElement("img");
setData(el, DATA_PREVIEW, {
width: el.offsetWidth,
height: el.offsetHeight,
html: el.innerHTML
});
if (crossOrigin) {
img.crossOrigin = crossOrigin;
}
img.src = url2;
img.alt = alt;
img.style.cssText = 'display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"';
el.innerHTML = "";
el.appendChild(img);
});
},
resetPreview: function resetPreview() {
forEach(this.previews, function(element) {
var data = getData(element, DATA_PREVIEW);
setStyle(element, {
width: data.width,
height: data.height
});
element.innerHTML = data.html;
removeData(element, DATA_PREVIEW);
});
},
preview: function preview2() {
var imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData;
var cropBoxWidth = cropBoxData.width, cropBoxHeight = cropBoxData.height;
var width = imageData.width, height = imageData.height;
var left = cropBoxData.left - canvasData.left - imageData.left;
var top = cropBoxData.top - canvasData.top - imageData.top;
if (!this.cropped || this.disabled) {
return;
}
setStyle(this.viewBoxImage, assign({
width,
height
}, getTransforms(assign({
translateX: -left,
translateY: -top
}, imageData))));
forEach(this.previews, function(element) {
var data = getData(element, DATA_PREVIEW);
var originalWidth = data.width;
var originalHeight = data.height;
var newWidth = originalWidth;
var newHeight = originalHeight;
var ratio = 1;
if (cropBoxWidth) {
ratio = originalWidth / cropBoxWidth;
newHeight = cropBoxHeight * ratio;
}
if (cropBoxHeight && newHeight > originalHeight) {
ratio = originalHeight / cropBoxHeight;
newWidth = cropBoxWidth * ratio;
newHeight = originalHeight;
}
setStyle(element, {
width: newWidth,
height: newHeight
});
setStyle(element.getElementsByTagName("img")[0], assign({
width: width * ratio,
height: height * ratio
}, getTransforms(assign({
translateX: -left * ratio,
translateY: -top * ratio
}, imageData))));
});
}
};
var events = {
bind: function bind() {
var element = this.element, options = this.options, cropper = this.cropper;
if (isFunction(options.cropstart)) {
addListener(element, EVENT_CROP_START, options.cropstart);
}
if (isFunction(options.cropmove)) {
addListener(element, EVENT_CROP_MOVE, options.cropmove);
}
if (isFunction(options.cropend)) {
addListener(element, EVENT_CROP_END, options.cropend);
}
if (isFunction(options.crop)) {
addListener(element, EVENT_CROP, options.crop);
}
if (isFunction(options.zoom)) {
addListener(element, EVENT_ZOOM, options.zoom);
}
addListener(cropper, EVENT_POINTER_DOWN, this.onCropStart = this.cropStart.bind(this));
if (options.zoomable && options.zoomOnWheel) {
addListener(cropper, EVENT_WHEEL, this.onWheel = this.wheel.bind(this), {
passive: false,
capture: true
});
}
if (options.toggleDragModeOnDblclick) {
addListener(cropper, EVENT_DBLCLICK, this.onDblclick = this.dblclick.bind(this));
}
addListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove = this.cropMove.bind(this));
addListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd = this.cropEnd.bind(this));
if (options.responsive) {
addListener(window, EVENT_RESIZE, this.onResize = this.resize.bind(this));
}
},
unbind: function unbind() {
var element = this.element, options = this.options, cropper = this.cropper;
if (isFunction(options.cropstart)) {
removeListener(element, EVENT_CROP_START, options.cropstart);
}
if (isFunction(options.cropmove)) {
removeListener(element, EVENT_CROP_MOVE, options.cropmove);
}
if (isFunction(options.cropend)) {
removeListener(element, EVENT_CROP_END, options.cropend);
}
if (isFunction(options.crop)) {
removeListener(element, EVENT_CROP, options.crop);
}
if (isFunction(options.zoom)) {
removeListener(element, EVENT_ZOOM, options.zoom);
}
removeListener(cropper, EVENT_POINTER_DOWN, this.onCropStart);
if (options.zoomable && options.zoomOnWheel) {
removeListener(cropper, EVENT_WHEEL, this.onWheel, {
passive: false,
capture: true
});
}
if (options.toggleDragModeOnDblclick) {
removeListener(cropper, EVENT_DBLCLICK, this.onDblclick);
}
removeListener(element.ownerDocument, EVENT_POINTER_MOVE, this.onCropMove);
removeListener(element.ownerDocument, EVENT_POINTER_UP, this.onCropEnd);
if (options.responsive) {
removeListener(window, EVENT_RESIZE, this.onResize);
}
}
};
var handlers = {
resize: function resize() {
if (this.disabled) {
return;
}
var options = this.options, container = this.container, containerData = this.containerData;
var ratioX = container.offsetWidth / containerData.width;
var ratioY = container.offsetHeight / containerData.height;
var ratio = Math.abs(ratioX - 1) > Math.abs(ratioY - 1) ? ratioX : ratioY;
if (ratio !== 1) {
var canvasData;
var cropBoxData;
if (options.restore) {
canvasData = this.getCanvasData();
cropBoxData = this.getCropBoxData();
}
this.render();
if (options.restore) {
this.setCanvasData(forEach(canvasData, function(n, i) {
canvasData[i] = n * ratio;
}));
this.setCropBoxData(forEach(cropBoxData, function(n, i) {
cropBoxData[i] = n * ratio;
}));
}
}
},
dblclick: function dblclick() {
if (this.disabled || this.options.dragMode === DRAG_MODE_NONE) {
return;
}
this.setDragMode(hasClass(this.dragBox, CLASS_CROP) ? DRAG_MODE_MOVE : DRAG_MODE_CROP);
},
wheel: function wheel(event) {
var _this = this;
var ratio = Number(this.options.wheelZoomRatio) || 0.1;
var delta = 1;
if (this.disabled) {
return;
}
event.preventDefault();
if (this.wheeling) {
return;
}
this.wheeling = true;
setTimeout(function() {
_this.wheeling = false;
}, 50);
if (event.deltaY) {
delta = event.deltaY > 0 ? 1 : -1;
} else if (event.wheelDelta) {
delta = -event.wheelDelta / 120;
} else if (event.detail) {
delta = event.detail > 0 ? 1 : -1;
}
this.zoom(-delta * ratio, event);
},
cropStart: function cropStart(event) {
var buttons = event.buttons, button = event.button;
if (this.disabled || (event.type === "mousedown" || event.type === "pointerdown" && event.pointerType === "mouse") && (isNumber(buttons) && buttons !== 1 || isNumber(button) && button !== 0 || event.ctrlKey)) {
return;
}
var options = this.options, pointers = this.pointers;
var action;
if (event.changedTouches) {
forEach(event.changedTouches, function(touch) {
pointers[touch.identifier] = getPointer(touch);
});
} else {
pointers[event.pointerId || 0] = getPointer(event);
}
if (Object.keys(pointers).length > 1 && options.zoomable && options.zoomOnTouch) {
action = ACTION_ZOOM;
} else {
action = getData(event.target, DATA_ACTION);
}
if (!REGEXP_ACTIONS.test(action)) {
return;
}
if (dispatchEvent(this.element, EVENT_CROP_START, {
originalEvent: event,
action
}) === false) {
return;
}
event.preventDefault();
this.action = action;
this.cropping = false;
if (action === ACTION_CROP) {
this.cropping = true;
addClass(this.dragBox, CLASS_MODAL);
}
},
cropMove: function cropMove(event) {
var action = this.action;
if (this.disabled || !action) {
return;
}
var pointers = this.pointers;
event.preventDefault();
if (dispatchEvent(this.element, EVENT_CROP_MOVE, {
originalEvent: event,
action
}) === false) {
return;
}
if (event.changedTouches) {
forEach(event.changedTouches, function(touch) {
assign(pointers[touch.identifier] || {}, getPointer(touch, true));
});
} else {
assign(pointers[event.pointerId || 0] || {}, getPointer(event, true));
}
this.change(event);
},
cropEnd: function cropEnd(event) {
if (this.disabled) {
return;
}
var action = this.action, pointers = this.pointers;
if (event.changedTouches) {
forEach(event.changedTouches, function(touch) {
delete pointers[touch.identifier];
});
} else {
delete pointers[event.pointerId || 0];
}
if (!action) {
return;
}
event.preventDefault();
if (!Object.keys(pointers).length) {
this.action = "";
}
if (this.cropping) {
this.cropping = false;
toggleClass(this.dragBox, CLASS_MODAL, this.cropped && this.options.modal);
}
dispatchEvent(this.element, EVENT_CROP_END, {
originalEvent: event,
action
});
}
};
var change = {
change: function change2(event) {
var options = this.options, canvasData = this.canvasData, containerData = this.containerData, cropBoxData = this.cropBoxData, pointers = this.pointers;
var action = this.action;
var aspectRatio = options.aspectRatio;
var left = cropBoxData.left, top = cropBoxData.top, width = cropBoxData.width, height = cropBoxData.height;
var right = left + width;
var bottom = top + height;
var minLeft = 0;
var minTop = 0;
var maxWidth = containerData.width;
var maxHeight = containerData.height;
var renderable = true;
var offset;
if (!aspectRatio && event.shiftKey) {
aspectRatio = width && height ? width / height : 1;
}
if (this.limited) {
minLeft = cropBoxData.minLeft;
minTop = cropBoxData.minTop;
maxWidth = minLeft + Math.min(containerData.width, canvasData.width, canvasData.left + canvasData.width);
maxHeight = minTop + Math.min(containerData.height, canvasData.height, canvasData.top + canvasData.height);
}
var pointer = pointers[Object.keys(pointers)[0]];
var range3 = {
x: pointer.endX - pointer.startX,
y: pointer.endY - pointer.startY
};
var check = function check2(side) {
switch (side) {
case ACTION_EAST:
if (right + range3.x > maxWidth) {
range3.x = maxWidth - right;
}
break;
case ACTION_WEST:
if (left + range3.x < minLeft) {
range3.x = minLeft - left;
}
break;
case ACTION_NORTH:
if (top + range3.y < minTop) {
range3.y = minTop - top;
}
break;
case ACTION_SOUTH:
if (bottom + range3.y > maxHeight) {
range3.y = maxHeight - bottom;
}
break;
}
};
switch (action) {
case ACTION_ALL:
left += range3.x;
top += range3.y;
break;
case ACTION_EAST:
if (range3.x >= 0 && (right >= maxWidth || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
renderable = false;
break;
}
check(ACTION_EAST);
width += range3.x;
if (width < 0) {
action = ACTION_WEST;
width = -width;
left -= width;
}
if (aspectRatio) {
height = width / aspectRatio;
top += (cropBoxData.height - height) / 2;
}
break;
case ACTION_NORTH:
if (range3.y <= 0 && (top <= minTop || aspectRatio && (left <= minLeft || right >= maxWidth))) {
renderable = false;
break;
}
check(ACTION_NORTH);
height -= range3.y;
top += range3.y;
if (height < 0) {
action = ACTION_SOUTH;
height = -height;
top -= height;
}
if (aspectRatio) {
width = height * aspectRatio;
left += (cropBoxData.width - width) / 2;
}
break;
case ACTION_WEST:
if (range3.x <= 0 && (left <= minLeft || aspectRatio && (top <= minTop || bottom >= maxHeight))) {
renderable = false;
break;
}
check(ACTION_WEST);
width -= range3.x;
left += range3.x;
if (width < 0) {
action = ACTION_EAST;
width = -width;
left -= width;
}
if (aspectRatio) {
height = width / aspectRatio;
top += (cropBoxData.height - height) / 2;
}
break;
case ACTION_SOUTH:
if (range3.y >= 0 && (bottom >= maxHeight || aspectRatio && (left <= minLeft || right >= maxWidth))) {
renderable = false;
break;
}
check(ACTION_SOUTH);
height += range3.y;
if (height < 0) {
action = ACTION_NORTH;
height = -height;
top -= height;
}
if (aspectRatio) {
width = height * aspectRatio;
left += (cropBoxData.width - width) / 2;
}
break;
case ACTION_NORTH_EAST:
if (aspectRatio) {
if (range3.y <= 0 && (top <= minTop || right >= maxWidth)) {
renderable = false;
break;
}
check(ACTION_NORTH);
height -= range3.y;
top += range3.y;
width = height * aspectRatio;
} else {
check(ACTION_NORTH);
check(ACTION_EAST);
if (range3.x >= 0) {
if (right < maxWidth) {
width += range3.x;
} else if (range3.y <= 0 && top <= minTop) {
renderable = false;
}
} else {
width += range3.x;
}
if (range3.y <= 0) {
if (top > minTop) {
height -= range3.y;
top += range3.y;
}
} else {
height -= range3.y;
top += range3.y;
}
}
if (width < 0 && height < 0) {
action = ACTION_SOUTH_WEST;
height = -height;
width = -width;
top -= height;
left -= width;
} else if (width < 0) {
action = ACTION_NORTH_WEST;
width = -width;
left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_EAST;
height = -height;
top -= height;
}
break;
case ACTION_NORTH_WEST:
if (aspectRatio) {
if (range3.y <= 0 && (top <= minTop || left <= minLeft)) {
renderable = false;
break;
}
check(ACTION_NORTH);
height -= range3.y;
top += range3.y;
width = height * aspectRatio;
left += cropBoxData.width - width;
} else {
check(ACTION_NORTH);
check(ACTION_WEST);
if (range3.x <= 0) {
if (left > minLeft) {
width -= range3.x;
left += range3.x;
} else if (range3.y <= 0 && top <= minTop) {
renderable = false;
}
} else {
width -= range3.x;
left += range3.x;
}
if (range3.y <= 0) {
if (top > minTop) {
height -= range3.y;
top += range3.y;
}
} else {
height -= range3.y;
top += range3.y;
}
}
if (width < 0 && height < 0) {
action = ACTION_SOUTH_EAST;
height = -height;
width = -width;
top -= height;
left -= width;
} else if (width < 0) {
action = ACTION_NORTH_EAST;
width = -width;
left -= width;
} else if (height < 0) {
action = ACTION_SOUTH_WEST;
height = -height;
top -= height;
}
break;
case ACTION_SOUTH_WEST:
if (aspectRatio) {
if (range3.x <= 0 && (left <= minLeft || bottom >= maxHeight)) {
renderable = false;
break;
}
check(ACTION_WEST);
width -= range3.x;
left += range3.x;
height = width / aspectRatio;
} else {
check(ACTION_SOUTH);
check(ACTION_WEST);
if (range3.x <= 0) {
if (left > minLeft) {
width -= range3.x;
left += range3.x;
} else if (range3.y >= 0 && bottom >= maxHeight) {
renderable = false;
}
} else {
width -= range3.x;
left += range3.x;
}
if (range3.y >= 0) {
if (bottom < maxHeight) {
height += range3.y;
}
} else {
height += range3.y;
}
}
if (width < 0 && height < 0) {
action = ACTION_NORTH_EAST;
height = -height;
width = -width;
top -= height;
left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_EAST;
width = -width;
left -= width;
} else if (height < 0) {
action = ACTION_NORTH_WEST;
height = -height;
top -= height;
}
break;
case ACTION_SOUTH_EAST:
if (aspectRatio) {
if (range3.x >= 0 && (right >= maxWidth || bottom >= maxHeight)) {
renderable = false;
break;
}
check(ACTION_EAST);
width += range3.x;
height = width / aspectRatio;
} else {
check(ACTION_SOUTH);
check(ACTION_EAST);
if (range3.x >= 0) {
if (right < maxWidth) {
width += range3.x;
} else if (range3.y >= 0 && bottom >= maxHeight) {
renderable = false;
}
} else {
width += range3.x;
}
if (range3.y >= 0) {
if (bottom < maxHeight) {
height += range3.y;
}
} else {
height += range3.y;
}
}
if (width < 0 && height < 0) {
action = ACTION_NORTH_WEST;
height = -height;
width = -width;
top -= height;
left -= width;
} else if (width < 0) {
action = ACTION_SOUTH_WEST;
width = -width;
left -= width;
} else if (height < 0) {
action = ACTION_NORTH_EAST;
height = -height;
top -= height;
}
break;
case ACTION_MOVE:
this.move(range3.x, range3.y);
renderable = false;
break;
case ACTION_ZOOM:
this.zoom(getMaxZoomRatio(pointers), event);
renderable = false;
break;
case ACTION_CROP:
if (!range3.x || !range3.y) {
renderable = false;
break;
}
offset = getOffset(this.cropper);
left = pointer.startX - offset.left;
top = pointer.startY - offset.top;
width = cropBoxData.minWidth;
height = cropBoxData.minHeight;
if (range3.x > 0) {
action = range3.y > 0 ? ACTION_SOUTH_EAST : ACTION_NORTH_EAST;
} else if (range3.x < 0) {
left -= width;
action = range3.y > 0 ? ACTION_SOUTH_WEST : ACTION_NORTH_WEST;
}
if (range3.y < 0) {
top -= height;
}
if (!this.cropped) {
removeClass(this.cropBox, CLASS_HIDDEN);
this.cropped = true;
if (this.limited) {
this.limitCropBox(true, true);
}
}
break;
}
if (renderable) {
cropBoxData.width = width;
cropBoxData.height = height;
cropBoxData.left = left;
cropBoxData.top = top;
this.action = action;
this.renderCropBox();
}
forEach(pointers, function(p) {
p.startX = p.endX;
p.startY = p.endY;
});
}
};
var methods = {
crop: function crop() {
if (this.ready && !this.cropped && !this.disabled) {
this.cropped = true;
this.limitCropBox(true, true);
if (this.options.modal) {
addClass(this.dragBox, CLASS_MODAL);
}
removeClass(this.cropBox, CLASS_HIDDEN);
this.setCropBoxData(this.initialCropBoxData);
}
return this;
},
reset: function reset2() {
if (this.ready && !this.disabled) {
this.imageData = assign({}, this.initialImageData);
this.canvasData = assign({}, this.initialCanvasData);
this.cropBoxData = assign({}, this.initialCropBoxData);
this.renderCanvas();
if (this.cropped) {
this.renderCropBox();
}
}
return this;
},
clear: function clear() {
if (this.cropped && !this.disabled) {
assign(this.cropBoxData, {
left: 0,
top: 0,
width: 0,
height: 0
});
this.cropped = false;
this.renderCropBox();
this.limitCanvas(true, true);
this.renderCanvas();
removeClass(this.dragBox, CLASS_MODAL);
addClass(this.cropBox, CLASS_HIDDEN);
}
return this;
},
replace: function replace(url2) {
var hasSameSize = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
if (!this.disabled && url2) {
if (this.isImg) {
this.element.src = url2;
}
if (hasSameSize) {
this.url = url2;
this.image.src = url2;
if (this.ready) {
this.viewBoxImage.src = url2;
forEach(this.previews, function(element) {
element.getElementsByTagName("img")[0].src = url2;
});
}
} else {
if (this.isImg) {
this.replaced = true;
}
this.options.data = null;
this.uncreate();
this.load(url2);
}
}
return this;
},
enable: function enable() {
if (this.ready && this.disabled) {
this.disabled = false;
removeClass(this.cropper, CLASS_DISABLED);
}
return this;
},
disable: function disable() {
if (this.ready && !this.disabled) {
this.disabled = true;
addClass(this.cropper, CLASS_DISABLED);
}
return this;
},
destroy: function destroy() {
var element = this.element;
if (!element[NAMESPACE]) {
return this;
}
element[NAMESPACE] = void 0;
if (this.isImg && this.replaced) {
element.src = this.originalUrl;
}
this.uncreate();
return this;
},
move: function move(offsetX) {
var offsetY = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : offsetX;
var _this$canvasData = this.canvasData, left = _this$canvasData.left, top = _this$canvasData.top;
return this.moveTo(isUndefined(offsetX) ? offsetX : left + Number(offsetX), isUndefined(offsetY) ? offsetY : top + Number(offsetY));
},
moveTo: function moveTo(x) {
var y = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : x;
var canvasData = this.canvasData;
var changed = false;
x = Number(x);
y = Number(y);
if (this.ready && !this.disabled && this.options.movable) {
if (isNumber(x)) {
canvasData.left = x;
changed = true;
}
if (isNumber(y)) {
canvasData.top = y;
changed = true;
}
if (changed) {
this.renderCanvas(true);
}
}
return this;
},
zoom: function zoom(ratio, _originalEvent) {
var canvasData = this.canvasData;
ratio = Number(ratio);
if (ratio < 0) {
ratio = 1 / (1 - ratio);
} else {
ratio = 1 + ratio;
}
return this.zoomTo(canvasData.width * ratio / canvasData.naturalWidth, null, _originalEvent);
},
zoomTo: function zoomTo(ratio, pivot, _originalEvent) {
var options = this.options, canvasData = this.canvasData;
var width = canvasData.width, height = canvasData.height, naturalWidth = canvasData.naturalWidth, naturalHeight = canvasData.naturalHeight;
ratio = Number(ratio);
if (ratio >= 0 && this.ready && !this.disabled && options.zoomable) {
var newWidth = naturalWidth * ratio;
var newHeight = naturalHeight * ratio;
if (dispatchEvent(this.element, EVENT_ZOOM, {
ratio,
oldRatio: width / naturalWidth,
originalEvent: _originalEvent
}) === false) {
return this;
}
if (_originalEvent) {
var pointers = this.pointers;
var offset = getOffset(this.cropper);
var center = pointers && Object.keys(pointers).length ? getPointersCenter(pointers) : {
pageX: _originalEvent.pageX,
pageY: _originalEvent.pageY
};
canvasData.left -= (newWidth - width) * ((center.pageX - offset.left - canvasData.left) / width);
canvasData.top -= (newHeight - height) * ((center.pageY - offset.top - canvasData.top) / height);
} else if (isPlainObject(pivot) && isNumber(pivot.x) && isNumber(pivot.y)) {
canvasData.left -= (newWidth - width) * ((pivot.x - canvasData.left) / width);
canvasData.top -= (newHeight - height) * ((pivot.y - canvasData.top) / height);
} else {
canvasData.left -= (newWidth - width) / 2;
canvasData.top -= (newHeight - height) / 2;
}
canvasData.width = newWidth;
canvasData.height = newHeight;
this.renderCanvas(true);
}
return this;
},
rotate: function rotate(degree) {
return this.rotateTo((this.imageData.rotate || 0) + Number(degree));
},
rotateTo: function rotateTo(degree) {
degree = Number(degree);
if (isNumber(degree) && this.ready && !this.disabled && this.options.rotatable) {
this.imageData.rotate = degree % 360;
this.renderCanvas(true, true);
}
return this;
},
scaleX: function scaleX(_scaleX) {
var scaleY2 = this.imageData.scaleY;
return this.scale(_scaleX, isNumber(scaleY2) ? scaleY2 : 1);
},
scaleY: function scaleY(_scaleY) {
var scaleX2 = this.imageData.scaleX;
return this.scale(isNumber(scaleX2) ? scaleX2 : 1, _scaleY);
},
scale: function scale(scaleX2) {
var scaleY2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : scaleX2;
var imageData = this.imageData;
var transformed = false;
scaleX2 = Number(scaleX2);
scaleY2 = Number(scaleY2);
if (this.ready && !this.disabled && this.options.scalable) {
if (isNumber(scaleX2)) {
imageData.scaleX = scaleX2;
transformed = true;
}
if (isNumber(scaleY2)) {
imageData.scaleY = scaleY2;
transformed = true;
}
if (transformed) {
this.renderCanvas(true, true);
}
}
return this;
},
getData: function getData2() {
var rounded = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
var options = this.options, imageData = this.imageData, canvasData = this.canvasData, cropBoxData = this.cropBoxData;
var data;
if (this.ready && this.cropped) {
data = {
x: cropBoxData.left - canvasData.left,
y: cropBoxData.top - canvasData.top,
width: cropBoxData.width,
height: cropBoxData.height
};
var ratio = imageData.width / imageData.naturalWidth;
forEach(data, function(n, i) {
data[i] = n / ratio;
});
if (rounded) {
var bottom = Math.round(data.y + data.height);
var right = Math.round(data.x + data.width);
data.x = Math.round(data.x);
data.y = Math.round(data.y);
data.width = right - data.x;
data.height = bottom - data.y;
}
} else {
data = {
x: 0,
y: 0,
width: 0,
height: 0
};
}
if (options.rotatable) {
data.rotate = imageData.rotate || 0;
}
if (options.scalable) {
data.scaleX = imageData.scaleX || 1;
data.scaleY = imageData.scaleY || 1;
}
return data;
},
setData: function setData2(data) {
var options = this.options, imageData = this.imageData, canvasData = this.canvasData;
var cropBoxData = {};
if (this.ready && !this.disabled && isPlainObject(data)) {
var transformed = false;
if (options.rotatable) {
if (isNumber(data.rotate) && data.rotate !== imageData.rotate) {
imageData.rotate = data.rotate;
transformed = true;
}
}
if (options.scalable) {
if (isNumber(data.scaleX) && data.scaleX !== imageData.scaleX) {
imageData.scaleX = data.scaleX;
transformed = true;
}
if (isNumber(data.scaleY) && data.scaleY !== imageData.scaleY) {
imageData.scaleY = data.scaleY;
transformed = true;
}
}
if (transformed) {
this.renderCanvas(true, true);
}
var ratio = imageData.width / imageData.naturalWidth;
if (isNumber(data.x)) {
cropBoxData.left = data.x * ratio + canvasData.left;
}
if (isNumber(data.y)) {
cropBoxData.top = data.y * ratio + canvasData.top;
}
if (isNumber(data.width)) {
cropBoxData.width = data.width * ratio;
}
if (isNumber(data.height)) {
cropBoxData.height = data.height * ratio;
}
this.setCropBoxData(cropBoxData);
}
return this;
},
getContainerData: function getContainerData() {
return this.ready ? assign({}, this.containerData) : {};
},
getImageData: function getImageData() {
return this.sized ? assign({}, this.imageData) : {};
},
getCanvasData: function getCanvasData() {
var canvasData = this.canvasData;
var data = {};
if (this.ready) {
forEach(["left", "top", "width", "height", "naturalWidth", "naturalHeight"], function(n) {
data[n] = canvasData[n];
});
}
return data;
},
setCanvasData: function setCanvasData(data) {
var canvasData = this.canvasData;
var aspectRatio = canvasData.aspectRatio;
if (this.ready && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
canvasData.left = data.left;
}
if (isNumber(data.top)) {
canvasData.top = data.top;
}
if (isNumber(data.width)) {
canvasData.width = data.width;
canvasData.height = data.width / aspectRatio;
} else if (isNumber(data.height)) {
canvasData.height = data.height;
canvasData.width = data.height * aspectRatio;
}
this.renderCanvas(true);
}
return this;
},
getCropBoxData: function getCropBoxData() {
var cropBoxData = this.cropBoxData;
var data;
if (this.ready && this.cropped) {
data = {
left: cropBoxData.left,
top: cropBoxData.top,
width: cropBoxData.width,
height: cropBoxData.height
};
}
return data || {};
},
setCropBoxData: function setCropBoxData(data) {
var cropBoxData = this.cropBoxData;
var aspectRatio = this.options.aspectRatio;
var widthChanged;
var heightChanged;
if (this.ready && this.cropped && !this.disabled && isPlainObject(data)) {
if (isNumber(data.left)) {
cropBoxData.left = data.left;
}
if (isNumber(data.top)) {
cropBoxData.top = data.top;
}
if (isNumber(data.width) && data.width !== cropBoxData.width) {
widthChanged = true;
cropBoxData.width = data.width;
}
if (isNumber(data.height) && data.height !== cropBoxData.height) {
heightChanged = true;
cropBoxData.height = data.height;
}
if (aspectRatio) {
if (widthChanged) {
cropBoxData.height = cropBoxData.width / aspectRatio;
} else if (heightChanged) {
cropBoxData.width = cropBoxData.height * aspectRatio;
}
}
this.renderCropBox();
}
return this;
},
getCroppedCanvas: function getCroppedCanvas() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
if (!this.ready || !window.HTMLCanvasElement) {
return null;
}
var canvasData = this.canvasData;
var source = getSourceCanvas(this.image, this.imageData, canvasData, options);
if (!this.cropped) {
return source;
}
var _this$getData = this.getData(), initialX = _this$getData.x, initialY = _this$getData.y, initialWidth = _this$getData.width, initialHeight = _this$getData.height;
var ratio = source.width / Math.floor(canvasData.naturalWidth);
if (ratio !== 1) {
initialX *= ratio;
initialY *= ratio;
initialWidth *= ratio;
initialHeight *= ratio;
}
var aspectRatio = initialWidth / initialHeight;
var maxSizes = getAdjustedSizes({
aspectRatio,
width: options.maxWidth || Infinity,
height: options.maxHeight || Infinity
});
var minSizes = getAdjustedSizes({
aspectRatio,
width: options.minWidth || 0,
height: options.minHeight || 0
}, "cover");
var _getAdjustedSizes = getAdjustedSizes({
aspectRatio,
width: options.width || (ratio !== 1 ? source.width : initialWidth),
height: options.height || (ratio !== 1 ? source.height : initialHeight)
}), width = _getAdjustedSizes.width, height = _getAdjustedSizes.height;
width = Math.min(maxSizes.width, Math.max(minSizes.width, width));
height = Math.min(maxSizes.height, Math.max(minSizes.height, height));
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
canvas.width = normalizeDecimalNumber(width);
canvas.height = normalizeDecimalNumber(height);
context.fillStyle = options.fillColor || "transparent";
context.fillRect(0, 0, width, height);
var _options$imageSmoothi = options.imageSmoothingEnabled, imageSmoothingEnabled = _options$imageSmoothi === void 0 ? true : _options$imageSmoothi, imageSmoothingQuality = options.imageSmoothingQuality;
context.imageSmoothingEnabled = imageSmoothingEnabled;
if (imageSmoothingQuality) {
context.imageSmoothingQuality = imageSmoothingQuality;
}
var sourceWidth = source.width;
var sourceHeight = source.height;
var srcX = initialX;
var srcY = initialY;
var srcWidth;
var srcHeight;
var dstX;
var dstY;
var dstWidth;
var dstHeight;
if (srcX <= -initialWidth || srcX > sourceWidth) {
srcX = 0;
srcWidth = 0;
dstX = 0;
dstWidth = 0;
} else if (srcX <= 0) {
dstX = -srcX;
srcX = 0;
srcWidth = Math.min(sourceWidth, initialWidth + srcX);
dstWidth = srcWidth;
} else if (srcX <= sourceWidth) {
dstX = 0;
srcWidth = Math.min(initialWidth, sourceWidth - srcX);
dstWidth = srcWidth;
}
if (srcWidth <= 0 || srcY <= -initialHeight || srcY > sourceHeight) {
srcY = 0;
srcHeight = 0;
dstY = 0;
dstHeight = 0;
} else if (srcY <= 0) {
dstY = -srcY;
srcY = 0;
srcHeight = Math.min(sourceHeight, initialHeight + srcY);
dstHeight = srcHeight;
} else if (srcY <= sourceHeight) {
dstY = 0;
srcHeight = Math.min(initialHeight, sourceHeight - srcY);
dstHeight = srcHeight;
}
var params = [srcX, srcY, srcWidth, srcHeight];
if (dstWidth > 0 && dstHeight > 0) {
var scale2 = width / initialWidth;
params.push(dstX * scale2, dstY * scale2, dstWidth * scale2, dstHeight * scale2);
}
context.drawImage.apply(context, [source].concat(_toConsumableArray(params.map(function(param) {
return Math.floor(normalizeDecimalNumber(param));
}))));
return canvas;
},
setAspectRatio: function setAspectRatio(aspectRatio) {
var options = this.options;
if (!this.disabled && !isUndefined(aspectRatio)) {
options.aspectRatio = Math.max(0, aspectRatio) || NaN;
if (this.ready) {
this.initCropBox();
if (this.cropped) {
this.renderCropBox();
}
}
}
return this;
},
setDragMode: function setDragMode(mode) {
var options = this.options, dragBox = this.dragBox, face = this.face;
if (this.ready && !this.disabled) {
var croppable = mode === DRAG_MODE_CROP;
var movable = options.movable && mode === DRAG_MODE_MOVE;
mode = croppable || movable ? mode : DRAG_MODE_NONE;
options.dragMode = mode;
setData(dragBox, DATA_ACTION, mode);
toggleClass(dragBox, CLASS_CROP, croppable);
toggleClass(dragBox, CLASS_MOVE, movable);
if (!options.cropBoxMovable) {
setData(face, DATA_ACTION, mode);
toggleClass(face, CLASS_CROP, croppable);
toggleClass(face, CLASS_MOVE, movable);
}
}
return this;
}
};
var AnotherCropper = WINDOW.Cropper;
var Cropper = /* @__PURE__ */ function() {
function Cropper2(element) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
_classCallCheck(this, Cropper2);
if (!element || !REGEXP_TAG_NAME.test(element.tagName)) {
throw new Error("The first argument is required and must be an <img> or <canvas> element.");
}
this.element = element;
this.options = assign({}, DEFAULTS, isPlainObject(options) && options);
this.cropped = false;
this.disabled = false;
this.pointers = {};
this.ready = false;
this.reloading = false;
this.replaced = false;
this.sized = false;
this.sizing = false;
this.init();
}
_createClass(Cropper2, [{
key: "init",
value: function init() {
var element = this.element;
var tagName = element.tagName.toLowerCase();
var url2;
if (element[NAMESPACE]) {
return;
}
element[NAMESPACE] = this;
if (tagName === "img") {
this.isImg = true;
url2 = element.getAttribute("src") || "";
this.originalUrl = url2;
if (!url2) {
return;
}
url2 = element.src;
} else if (tagName === "canvas" && window.HTMLCanvasElement) {
url2 = element.toDataURL();
}
this.load(url2);
}
}, {
key: "load",
value: function load2(url2) {
var _this = this;
if (!url2) {
return;
}
this.url = url2;
this.imageData = {};
var element = this.element, options = this.options;
if (!options.rotatable && !options.scalable) {
options.checkOrientation = false;
}
if (!options.checkOrientation || !window.ArrayBuffer) {
this.clone();
return;
}
if (REGEXP_DATA_URL.test(url2)) {
if (REGEXP_DATA_URL_JPEG.test(url2)) {
this.read(dataURLToArrayBuffer(url2));
} else {
this.clone();
}
return;
}
var xhr = new XMLHttpRequest();
var clone = this.clone.bind(this);
this.reloading = true;
this.xhr = xhr;
xhr.onabort = clone;
xhr.onerror = clone;
xhr.ontimeout = clone;
xhr.onprogress = function() {
if (xhr.getResponseHeader("content-type") !== MIME_TYPE_JPEG) {
xhr.abort();
}
};
xhr.onload = function() {
_this.read(xhr.response);
};
xhr.onloadend = function() {
_this.reloading = false;
_this.xhr = null;
};
if (options.checkCrossOrigin && isCrossOriginURL(url2) && element.crossOrigin) {
url2 = addTimestamp(url2);
}
xhr.open("GET", url2, true);
xhr.responseType = "arraybuffer";
xhr.withCredentials = element.crossOrigin === "use-credentials";
xhr.send();
}
}, {
key: "read",
value: function read(arrayBuffer) {
var options = this.options, imageData = this.imageData;
var orientation = resetAndGetOrientation(arrayBuffer);
var rotate2 = 0;
var scaleX2 = 1;
var scaleY2 = 1;
if (orientation > 1) {
this.url = arrayBufferToDataURL(arrayBuffer, MIME_TYPE_JPEG);
var _parseOrientation = parseOrientation(orientation);
rotate2 = _parseOrientation.rotate;
scaleX2 = _parseOrientation.scaleX;
scaleY2 = _parseOrientation.scaleY;
}
if (options.rotatable) {
imageData.rotate = rotate2;
}
if (options.scalable) {
imageData.scaleX = scaleX2;
imageData.scaleY = scaleY2;
}
this.clone();
}
}, {
key: "clone",
value: function clone() {
var element = this.element, url2 = this.url;
var crossOrigin = element.crossOrigin;
var crossOriginUrl = url2;
if (this.options.checkCrossOrigin && isCrossOriginURL(url2)) {
if (!crossOrigin) {
crossOrigin = "anonymous";
}
crossOriginUrl = addTimestamp(url2);
}
this.crossOrigin = crossOrigin;
this.crossOriginUrl = crossOriginUrl;
var image = document.createElement("img");
if (crossOrigin) {
image.crossOrigin = crossOrigin;
}
image.src = crossOriginUrl || url2;
image.alt = element.alt || "The image to crop";
this.image = image;
image.onload = this.start.bind(this);
image.onerror = this.stop.bind(this);
addClass(image, CLASS_HIDE);
element.parentNode.insertBefore(image, element.nextSibling);
}
}, {
key: "start",
value: function start() {
var _this2 = this;
var image = this.image;
image.onload = null;
image.onerror = null;
this.sizing = true;
var isIOSWebKit = WINDOW.navigator && /(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(WINDOW.navigator.userAgent);
var done = function done2(naturalWidth, naturalHeight) {
assign(_this2.imageData, {
naturalWidth,
naturalHeight,
aspectRatio: naturalWidth / naturalHeight
});
_this2.initialImageData = assign({}, _this2.imageData);
_this2.sizing = false;
_this2.sized = true;
_this2.build();
};
if (image.naturalWidth && !isIOSWebKit) {
done(image.naturalWidth, image.naturalHeight);
return;
}
var sizingImage = document.createElement("img");
var body = document.body || document.documentElement;
this.sizingImage = sizingImage;
sizingImage.onload = function() {
done(sizingImage.width, sizingImage.height);
if (!isIOSWebKit) {
body.removeChild(sizingImage);
}
};
sizingImage.src = image.src;
if (!isIOSWebKit) {
sizingImage.style.cssText = "left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;";
body.appendChild(sizingImage);
}
}
}, {
key: "stop",
value: function stop() {
var image = this.image;
image.onload = null;
image.onerror = null;
image.parentNode.removeChild(image);
this.image = null;
}
}, {
key: "build",
value: function build() {
if (!this.sized || this.ready) {
return;
}
var element = this.element, options = this.options, image = this.image;
var container = element.parentNode;
var template = document.createElement("div");
template.innerHTML = TEMPLATE;
var cropper = template.querySelector(".".concat(NAMESPACE, "-container"));
var canvas = cropper.querySelector(".".concat(NAMESPACE, "-canvas"));
var dragBox = cropper.querySelector(".".concat(NAMESPACE, "-drag-box"));
var cropBox = cropper.querySelector(".".concat(NAMESPACE, "-crop-box"));
var face = cropBox.querySelector(".".concat(NAMESPACE, "-face"));
this.container = container;
this.cropper = cropper;
this.canvas = canvas;
this.dragBox = dragBox;
this.cropBox = cropBox;
this.viewBox = cropper.querySelector(".".concat(NAMESPACE, "-view-box"));
this.face = face;
canvas.appendChild(image);
addClass(element, CLASS_HIDDEN);
container.insertBefore(cropper, element.nextSibling);
if (!this.isImg) {
removeClass(image, CLASS_HIDE);
}
this.initPreview();
this.bind();
options.initialAspectRatio = Math.max(0, options.initialAspectRatio) || NaN;
options.aspectRatio = Math.max(0, options.aspectRatio) || NaN;
options.viewMode = Math.max(0, Math.min(3, Math.round(options.viewMode))) || 0;
addClass(cropBox, CLASS_HIDDEN);
if (!options.guides) {
addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-dashed")), CLASS_HIDDEN);
}
if (!options.center) {
addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-center")), CLASS_HIDDEN);
}
if (options.background) {
addClass(cropper, "".concat(NAMESPACE, "-bg"));
}
if (!options.highlight) {
addClass(face, CLASS_INVISIBLE);
}
if (options.cropBoxMovable) {
addClass(face, CLASS_MOVE);
setData(face, DATA_ACTION, ACTION_ALL);
}
if (!options.cropBoxResizable) {
addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-line")), CLASS_HIDDEN);
addClass(cropBox.getElementsByClassName("".concat(NAMESPACE, "-point")), CLASS_HIDDEN);
}
this.render();
this.ready = true;
this.setDragMode(options.dragMode);
if (options.autoCrop) {
this.crop();
}
this.setData(options.data);
if (isFunction(options.ready)) {
addListener(element, EVENT_READY, options.ready, {
once: true
});
}
dispatchEvent(element, EVENT_READY);
}
}, {
key: "unbuild",
value: function unbuild() {
if (!this.ready) {
return;
}
this.ready = false;
this.unbind();
this.resetPreview();
this.cropper.parentNode.removeChild(this.cropper);
removeClass(this.element, CLASS_HIDDEN);
}
}, {
key: "uncreate",
value: function uncreate() {
if (this.ready) {
this.unbuild();
this.ready = false;
this.cropped = false;
} else if (this.sizing) {
this.sizingImage.onload = null;
this.sizing = false;
this.sized = false;
} else if (this.reloading) {
this.xhr.onabort = null;
this.xhr.abort();
} else if (this.image) {
this.stop();
}
}
}], [{
key: "noConflict",
value: function noConflict() {
window.Cropper = AnotherCropper;
return Cropper2;
}
}, {
key: "setDefaults",
value: function setDefaults(options) {
assign(DEFAULTS, isPlainObject(options) && options);
}
}]);
return Cropper2;
}();
assign(Cropper.prototype, render, preview, events, handlers, change, methods);
const _hoisted_1$3 = ["name", "field", "multiple", "accept", "disabled"];
const _hoisted_2$2 = { key: 0 };
const _hoisted_3$2 = ["onClick"];
const _hoisted_4$1 = ["onClick"];
2022-12-30 08:13:19 +00:00
const _hoisted_5$1 = /* @__PURE__ */ createElementVNode("i", { class: "layui-icon" }, "\uE67C", -1);
2022-11-15 01:16:55 +00:00
const _hoisted_6 = /* @__PURE__ */ createElementVNode("div", {
class: "layui-hide",
id: "uploadDemoView"
}, [
/* @__PURE__ */ createElementVNode("hr"),
/* @__PURE__ */ createElementVNode("img", {
src: "",
alt: "\u4E0A\u4F20\u6210\u529F\u540E\u6E32\u67D3",
style: { "max-width": "196px" }
})
], -1);
const _hoisted_7 = ["src", "id"];
const __default__$6 = {
name: "LayUpload"
};
const _sfc_main$7 = defineComponent({
...__default__$6,
props: {
url: null,
data: null,
headers: null,
acceptMime: { default: "MIME_type" },
field: { default: "file" },
size: { default: 0 },
multiple: { type: Boolean, default: false },
number: { default: 0 },
drag: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
disabledPreview: { type: Boolean, default: false },
cut: { type: Boolean, default: false },
cutOptions: { default: void 0 },
text: null,
dragText: null,
modelValue: { default: null },
auto: { type: Boolean, default: true }
},
emits: [
"choose",
2022-12-09 08:41:41 +00:00
"chooseAfter",
2022-11-15 01:16:55 +00:00
"before",
"done",
"error",
"cutdone",
"cutcancel",
"update:modelValue"
],
setup(__props, { emit }) {
const props = __props;
const getCutDownResult = () => {
if (_cropper) {
const canvas = _cropper.getCroppedCanvas();
let imgData = canvas.toDataURL('"image/png"');
let currentTimeStamp = new Date().valueOf();
let orgInfo = activeUploadFiles.value[0];
emit("cutdone", Object.assign({ currentTimeStamp, cutResult: imgData, orginal: orgInfo }));
let newFile = dataURLtoFile(imgData);
if (!props.auto) {
emit("update:modelValue", [newFile]);
clearLightCutEffect();
return;
}
commonUploadTransaction([newFile]);
nextTick(() => clearAllCutEffect());
} else {
errorF(cutInitErrorMsg.value);
}
};
const closeCutDownModal = () => {
let currentTimeStamp = new Date().valueOf();
emit("cutcancel", Object.assign({ currentTimeStamp }));
nextTick(() => clearAllCutEffect());
};
const clearAllCutEffect = () => {
activeUploadFiles.value = [];
activeUploadFilesImgs.value = [];
innerCutVisible.value = false;
orgFileInput.value.value = "";
_cropper = null;
};
const clearLightCutEffect = () => {
activeUploadFiles.value = [];
activeUploadFilesImgs.value = [];
innerCutVisible.value = false;
_cropper = null;
};
const { t } = useI18n();
const text = computed$1(() => {
return props.text ? props.text : t("upload.text");
});
const dragText = computed$1(() => {
return props.dragText ? props.dragText : t("upload.dragText");
});
const defaultErrorMsg = computed$1(() => t("upload.defaultErrorMsg"));
const urlErrorMsg = computed$1(() => t("upload.urlErrorMsg"));
const numberErrorMsg = computed$1(() => t("upload.numberErrorMsg"));
const occurFileSizeErrorMsg = computed$1(() => t("upload.occurFileSizeErrorMsg"));
const cutInitErrorMsg = computed$1(() => t("upload.cutInitErrorMsg"));
const uploadSuccess = computed$1(() => t("upload.uploadSuccess"));
const startUploadMsg = computed$1(() => t("upload.startUploadMsg"));
const cannotSupportCutMsg = computed$1(() => t("upload.cannotSupportCutMsg"));
const title = computed$1(() => t("upload.title"));
const confirmBtn = computed$1(() => t("upload.confirmBtn"));
const cancelBtn = computed$1(() => t("upload.cancelBtn"));
let defaultCutLayerOption = computed$1(() => {
return {
type: "component",
title: title.value,
shade: true,
shadeClose: true,
area: ["640px", "640px"],
btn: [
{ text: confirmBtn.value, callback: getCutDownResult },
{ text: cancelBtn.value, callback: closeCutDownModal }
]
};
});
const slot = useSlots();
slot.default && slot.default();
getCurrentInstance();
watch(() => props.modelValue, () => {
if (!props.modelValue) {
clearAllCutEffect();
}
});
const isDragEnter = ref(false);
const activeUploadFiles = ref([]);
const activeUploadFilesImgs = ref([]);
const orgFileInput = templateRef("orgFileInput");
let _cropper = null;
let computedCutLayerOption;
if (props.cutOptions && props.cutOptions.layerOption) {
computedCutLayerOption = computed$1(() => Object.assign(defaultCutLayerOption, props.cutOptions.layerOption));
} else {
computedCutLayerOption = computed$1(() => defaultCutLayerOption.value);
}
const innerCutVisible = ref(false);
const localUploadTransaction = (option) => {
const { url: url2, files } = option;
let formData = new FormData();
if (url2.length <= 5) {
errorF(urlErrorMsg.value);
return;
}
if (Array.isArray(files) && files.length > 0) {
for (let i = 0; i < files.length; i++) {
let _file = files[i];
formData.append(props.field + "[" + i + "]", _file);
}
}
if (props.data && props.data instanceof Object) {
let _requestDate = props.data;
for (const key in _requestDate) {
formData.append(key, _requestDate[key]);
}
}
let utimer = window.setTimeout(() => {
localUpload({ url: url2, formData }, function() {
clearTimeout(utimer);
});
}, 200);
};
const dataURLtoFile = (dataurl) => {
let arr = dataurl.split(",");
let mime = "";
if (arr.length > 0) {
mime = arr[0].match(/:(.*?);/)[1];
}
let bstr = atob(arr[1]);
let n = bstr.length;
let u8arr = new Uint8Array(n);
while (n--) {
u8arr[n] = bstr.charCodeAt(n);
}
return new Blob([u8arr], { type: mime });
};
const errorF = (errorText) => {
let currentTimeStamp = new Date().valueOf();
let errorMsg = errorText ? errorText : defaultErrorMsg;
errorMsg = `layui-vue:${errorMsg}`;
console.warn(errorMsg);
layer.msg(errorMsg, { icon: 2, time: 1e3 }, function(res) {
});
emit("error", Object.assign({ currentTimeStamp, msg: errorMsg }));
};
const localUpload = (option, callback) => {
2022-12-09 08:41:41 +00:00
let xhr = new XMLHttpRequest();
let url2 = option.url;
2022-11-15 01:16:55 +00:00
let formData = option.formData;
const cb = callback;
xhr.onreadystatechange = function() {
let currentTimeStamp2 = new Date().valueOf();
if (xhr.readyState === 1) {
if (xhr.status >= 200 && xhr.status <= 300 || xhr.status === 304 || xhr.status == 0) {
let successText = startUploadMsg.value;
emit("before", Object.assign({ currentTimeStamp: currentTimeStamp2, msg: successText, ...option }));
}
} else if (xhr.readyState === 4) {
let successText = xhr.responseText ? xhr.responseText : uploadSuccess;
if (xhr.status >= 200 && xhr.status <= 300 || xhr.status === 304 || xhr.status == 0) {
let data = xhr.responseText;
emit("done", { currentTimeStamp: currentTimeStamp2, msg: successText, data });
}
}
};
xhr.open("post", url2, true);
if (props.headers) {
for (let key in props.headers) {
xhr.setRequestHeader(key, props.headers[key]);
}
} else {
xhr.setRequestHeader("Accept", "application/json, text/javascript");
}
let currentTimeStamp = new Date().valueOf();
emit("before", Object.assign(option, currentTimeStamp));
xhr.send(formData);
if (cb && typeof cb == "function") {
cb();
}
clearAllCutEffect();
};
const filetoDataURL = (file, fn) => {
const reader = new FileReader();
reader.onloadend = function(e) {
fn(e.target.result);
};
reader.readAsDataURL(file);
};
const uploadChange = (e) => {
e.preventDefault();
const _files = [...e.target.files || e.dataTransfer.files];
if (props.multiple && props.number != 0 && props.number < _files.length) {
errorF(numberErrorMsg.value);
return;
}
if (props.size && props.size != 0) {
for (let i = 0; i < _files.length; i++) {
let _file = _files[i];
let _size = _file.size;
if (_size > props.size * 1024) {
errorF(occurFileSizeErrorMsg.value);
return;
}
}
}
for (let item of _files) {
activeUploadFiles.value.push(item);
filetoDataURL(item, function(res) {
activeUploadFilesImgs.value.push(res);
});
}
let arm1 = props.cut && props.acceptMime.indexOf("image") != -1 && props.multiple == false;
let arm2 = props.cut && props.acceptMime.indexOf("image") != -1 && props.multiple == true;
if (arm1) {
innerCutVisible.value = true;
setTimeout(() => {
let _imgs = document.getElementsByClassName("_lay_upload_img");
if (_imgs && _imgs.length > 0) {
let _img = _imgs[0];
_cropper = new Cropper(_img, {
aspectRatio: 16 / 9
});
} else {
clearAllCutEffect();
}
}, 200);
} else {
if (arm2) {
console.warn(cannotSupportCutMsg.value);
}
if (!props.auto) {
emit("update:modelValue", _files);
return;
}
commonUploadTransaction(_files);
}
};
const commonUploadTransaction = (_files) => {
let currentTimeStamp = new Date().valueOf();
let successText = uploadSuccess;
if (props.url) {
localUploadTransaction({
url: props.url,
files: _files
});
} else {
emit("done", { currentTimeStamp, msg: successText, data: _files });
clearAllCutEffect();
}
};
const chooseFile = () => {
let _target = orgFileInput.value;
if (_target) {
_target.click();
}
};
const clickOrgInput = () => {
let currentTimeStamp = new Date().valueOf();
emit("choose", currentTimeStamp);
};
const dragRef = ref();
function dragEnter(e) {
e.stopPropagation();
e.preventDefault();
}
function dragOver(e) {
e.stopPropagation();
e.preventDefault();
}
onMounted(() => {
nextTick(() => {
if (dragRef.value) {
dragRef.value.addEventListener("dragenter", dragEnter, false);
dragRef.value.addEventListener("dragover", dragOver, false);
dragRef.value.addEventListener("drop", uploadChange, false);
}
});
});
onUnmounted(() => {
if (dragRef.value) {
dragRef.value.removeEventListener("dragenter");
dragRef.value.removeEventListener("dragover");
dragRef.value.removeEventListener("drop");
}
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-upload layui-upload-wrap", __props.disabledPreview ? "layui-upload-file-disabled" : ""])
}, [
createElementVNode("input", {
type: "file",
class: "layui-upload-file",
ref_key: "orgFileInput",
ref: orgFileInput,
name: __props.field,
field: __props.field,
multiple: __props.multiple,
accept: __props.acceptMime,
disabled: __props.disabled,
onClick: clickOrgInput,
onChange: uploadChange
}, null, 40, _hoisted_1$3),
!__props.drag ? (openBlock(), createElementBlock("div", _hoisted_2$2, [
createElementVNode("div", {
class: "layui-upload-btn-box",
onClick: withModifiers(chooseFile, ["stop"])
}, [
unref(slot).default ? renderSlot(_ctx.$slots, "default", {
key: 0,
disabled: __props.disabled
}) : (openBlock(), createBlock(_sfc_main$1C, {
key: 1,
type: "primary",
disabled: __props.disabled
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(unref(text)), 1)
]),
_: 1
}, 8, ["disabled"]))
], 8, _hoisted_3$2)
])) : (openBlock(), createElementBlock("div", {
key: 1,
ref_key: "dragRef",
ref: dragRef,
class: normalizeClass([
"layui-upload-drag",
__props.disabled ? "layui-upload-drag-disable" : isDragEnter.value ? "layui-upload-drag-draging" : ""
]),
onClick: withModifiers(chooseFile, ["stop"])
}, [
2022-12-30 08:13:19 +00:00
_hoisted_5$1,
2022-11-15 01:16:55 +00:00
createElementVNode("p", null, toDisplayString$1(unref(dragText)), 1),
_hoisted_6
], 10, _hoisted_4$1)),
createVNode(unref(_sfc_main$1I), {
modelValue: innerCutVisible.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => innerCutVisible.value = $event),
title: unref(computedCutLayerOption).title,
move: unref(computedCutLayerOption).move,
resize: unref(computedCutLayerOption).resize,
shade: unref(computedCutLayerOption).shade,
shadeClose: unref(computedCutLayerOption).shadeClose,
shadeOpacity: unref(computedCutLayerOption).shadeOpacity,
zIndex: unref(computedCutLayerOption).zIndex,
btnAlign: unref(computedCutLayerOption).btnAlign,
area: unref(computedCutLayerOption).area,
anim: unref(computedCutLayerOption).anim,
isOutAnim: unref(computedCutLayerOption).isOutAnim,
btn: unref(computedCutLayerOption).btn,
onClose: clearAllCutEffect
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(activeUploadFilesImgs.value, (base64str, index2) => {
return openBlock(), createElementBlock("div", {
class: "copper-container",
key: `file${index2}`
}, [
createElementVNode("img", {
src: base64str,
id: `_lay_upload_img${index2}`,
class: "_lay_upload_img"
}, null, 8, _hoisted_7)
]);
}), 128))
]),
_: 1
}, 8, ["modelValue", "title", "move", "resize", "shade", "shadeClose", "shadeOpacity", "zIndex", "btnAlign", "area", "anim", "isOutAnim", "btn"]),
createElementVNode("div", {
class: normalizeClass(["layui-upload-list", __props.disabledPreview ? "layui-upload-list-disabled" : ""])
}, [
renderSlot(_ctx.$slots, "preview")
], 2)
], 2);
};
}
});
const component$9 = withInstall(_sfc_main$7);
var index$5 = /* @__PURE__ */ (() => ".layui-water-ripples-container{position:relative;display:inline-block}.layui-water-ripples-container .layui-slot-container{position:relative;z-index:2}.layui-water-ripples-container .layui-out-ripples{position:absolute;left:0;top:0;height:100%;opacity:1;z-index:1;pointer-events:none}.layui-water-ripples-container .layui-animate-once--out{animation:ripple-effect 1s forwards}.layui-water-ripples-container .layui-animate-always--out{animation:ripple-effect 1s infinite}@keyframes ripple-effect{0%{box-shadow:0 0 0 0 var(--layui-ripple-color);opacity:.4}to{box-shadow:0 0 0 var(--layui-spread-width) var(--layui-ripple-color);opacity:0}}.layui-water-ripples-container .layui-inset-ripples{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);opacity:1;width:0px;height:0px;background:var(--layui-ripple-color);pointer-events:none}@keyframes size-effect{0%{width:0px;height:0px;opacity:.8}to{width:var(--layui-spread-size);height:var(--layui-spread-size);opacity:0}}.layui-water-ripples-container .layui-animate-once--inset{animation:size-effect 1s forwards}.layui-water-ripples-container .layui-animate-always--inset{animation:size-effect 1s infinite}\n")();
const __default__$5 = {
name: "LayRipple"
};
const _sfc_main$6 = defineComponent({
...__default__$5,
props: {
type: { default: "inset" },
color: { default: "currentColor" },
borderRadius: { default: "0" },
spreadWidth: { default: "6px" },
spreadSize: null,
trigger: { default: "click" },
center: { type: Boolean, default: false }
},
setup(__props) {
const props = __props;
const isActiveRef = ref(false);
const spreadSizeRef = ref("0px");
const ripplesRefEl = ref(null);
const waterRipplesContainerRefEl = ref(null);
const isOut = computed$1(() => {
return props.type === "out";
});
const rippleX = ref(void 0);
const rippleY = ref(void 0);
const onActive = function(event) {
isActiveRef.value = true;
if (props.type === "inset" && !props.spreadSize && !props.center) {
const el = event.currentTarget;
const rect = el.getBoundingClientRect();
const rippleOffsetLeft = event.clientX - rect.left;
const rippleOffsetTop = event.clientY - rect.top;
const sizeX = Math.max(rippleOffsetLeft, rect.width - rippleOffsetLeft);
const sizeY = Math.max(rippleOffsetTop, rect.height - rippleOffsetTop);
rippleX.value = rippleOffsetLeft + "px";
rippleY.value = rippleOffsetTop + "px";
spreadSizeRef.value = Math.sqrt(sizeX ** 2 + sizeY ** 2) * 2 + "px";
}
};
const initWidth = function() {
let container = waterRipplesContainerRefEl.value;
let ripples = ripplesRefEl.value;
if (!container || !ripples)
return;
if (props.type == "out") {
ripples.style.width = container.clientWidth + "px";
} else {
container.style.overflow = "hidden";
if (!props.spreadSize || props.center) {
spreadSizeRef.value = container.clientWidth * 1.1 + "px";
} else {
spreadSizeRef.value = props.spreadSize;
}
}
ripples.addEventListener("animationend", () => {
isActiveRef.value = false;
}, false);
};
onMounted(() => {
initWidth();
});
watch(() => props.trigger, (val) => isActiveRef.value = val === "always", { immediate: true });
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", mergeProps({
class: "layui-water-ripples-container",
ref_key: "waterRipplesContainerRefEl",
ref: waterRipplesContainerRefEl
}, { [toHandlerKey(__props.trigger)]: onActive }), [
createElementVNode("div", {
ref_key: "ripplesRefEl",
ref: ripplesRefEl,
class: normalizeClass({
"layui-out-ripples": unref(isOut),
"layui-inset-ripples": __props.type == "inset",
"layui-animate-always--out": isActiveRef.value && __props.trigger == "always" && __props.type == "out",
"layui-animate-once--out": isActiveRef.value && (__props.trigger == "mouseenter" || __props.trigger == "click") && __props.type == "out",
"layui-animate-always--inset": isActiveRef.value && __props.trigger == "always" && __props.type == "inset",
"layui-animate-once--inset": isActiveRef.value && (__props.trigger == "mouseenter" || __props.trigger == "click") && __props.type == "inset"
}),
style: normalizeStyle({
borderRadius: unref(isOut) ? __props.borderRadius : "50%",
left: rippleX.value,
top: rippleY.value,
"--layui-ripple-color": __props.color,
"--layui-spread-width": __props.spreadWidth,
"--layui-spread-size": spreadSizeRef.value
})
}, null, 6),
renderSlot(_ctx.$slots, "default")
], 16);
};
}
});
const component$8 = withInstall(_sfc_main$6);
var index_vue_vue_type_style_index_0_lang = /* @__PURE__ */ (() => '.layui-carousel{position:relative;left:0;top:0;background-color:#f8f8f8}.layui-carousel>[carousel-item]{position:relative;width:100%;height:100%;overflow:hidden}.layui-carousel>[carousel-item]:before{position:absolute;content:"\\e63d";left:50%;top:50%;width:100px;line-height:20px;margin:-10px 0 0 -50px;text-align:center;color:var(--global-neutral-color-8);font-family:layui-icon!important;font-size:30px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.layui-carousel>[carousel-item]>*{position:absolute;left:0;top:0;width:100%;height:100%;background-color:#f8f8f8;transition-duration:.3s;-webkit-transition-duration:.3s;overflow:hidden;visibility:hidden}.layui-carousel-updown>*{-webkit-transition:.3s ease-in-out up;transition:.3s ease-in-out up}.layui-carousel-arrow{display:none\\ ;opacity:0;position:absolute;left:10px;top:50%;margin-top:-18px;width:36px;height:36px;line-height:36px;text-align:center;font-size:20px;border:0;border-radius:50%;background-color:#0003;color:#fff;-webkit-transition-duration:.3s;transition-duration:.3s;cursor:pointer}.layui-carousel-arrow[lay-type=add]{left:auto!important;right:10px}.layui-carousel:hover .layui-carousel-arrow[lay-type=add],.layui-carousel[lay-arrow=always] .layui-carousel-arrow[lay-type=add]{right:20px}.layui-carousel[lay-arrow=always] .layui-carousel-arrow{opacity:1;left:20px}.layui-carousel[lay-arrow=none] .layui-carousel-arrow{display:none}.layui-carousel-arrow:hover,.layui-carousel-ind ul:hover{background-color:#00000059}.layui-carousel:hover .layui-carousel-arrow{display:block\\ ;opacity:1;left:20px}.layui-carousel-ind{position:relative;top:-35px;width:100%;line-height:0!important;text-align:center;font-size:0}.layui-carousel[lay-indicator=outside]{margin-bottom:30px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind{top:10px}.layui-carousel[lay-indicator=outside] .layui-carousel-ind ul{background-color:#00000080}.layui-carousel[lay-indicator=none] .layui-carousel-ind{display:none}.layui-carousel-ind ul{display:inline-block;padding:5px;background-color:#0003;border-radius:10px;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li{display:inline-block;width:10px;height:10px;margin:0 3px;font-size:14px;background-color:var(--global-neutral-color-3);background-color:#ffffff80;border-radius:50%;cursor:pointer;-webkit-transition-duration:.3s;transition-duration:.3s}.layui-carousel-ind li:hover{background-color:#ffffffb3}.layui-carousel-ind li.layui-this{background-color:#fff}.layui-carousel>[carousel-item]>.layui-carousel-next,.layui-carousel>[carousel-item]>.layui-carousel-prev,.layui-carousel>[carousel-item]>.layui-this{display:block}.layui-carousel>[carousel-item]>.layui-this{left:0}.layui-carousel>[carousel-item]>.layui-carousel-prev{left:-100%}.layui-carousel>[carousel-item]>.layui-carousel-next{left:100%}.layui-carousel>[carousel-item]>.layui-carousel-next.layui-carousel-left,.layui-carousel>[carousel-item]>.layui-carousel-prev.layui-carousel-right{left:0}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-left{left:-100%}.layui-carousel>[carousel-item]>.layui-this.layui-carousel-right{left:100%}.layui-carousel[lay-anim=updown] .layui-carousel-arrow{left:50%!important;top:20px;margin:0 0 0 -18px}.layui-carousel[lay-anim=updown]>[carousel-item]>*,.layui-carousel[lay-anim=fade]>[carousel-item]>*{left:0!important}.layui-carousel[lay-anim=updown] .layui-carousel-arrow[lay-type=add]{top:auto!important;bottom:20px}.layui-carousel[lay-anim=updown] .layui-carousel-ind{position:absolute;top:50%;right:20px;width:auto;height:auto;transform:translateY(-50%)}.layui-carousel[lay-anim=updown] .layui-carousel-ind ul{padding:3px 5px}.layui-carousel[lay-anim=updown] .layui-carousel-ind li{display:block;margin:6px 0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-this{top:0}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-prev{top:-100%}.layui-carousel[lay-anim=updown]>[carousel-item]>.layui-carousel-next{top:100%}.layui-caro
const _hoisted_1$2 = {
key: 1,
class: "layui-notice-bar-warp-slot"
};
const __default__$4 = {
name: "LayNoticeBar"
};
const _sfc_main$5 = defineComponent({
...__default__$4,
props: {
mode: null,
text: { default: "" },
textlist: { default: () => [] },
color: { default: () => "var(--color-warning)" },
background: { default: () => "var(--color-warning-light-9)" },
size: { default: 14 },
height: { default: 40 },
delay: { default: 1 },
speed: { default: 100 },
scrollable: { type: Boolean, default: false },
leftIcon: null,
rightIcon: null
},
emits: ["close", "link"],
setup(__props, { emit }) {
var _a2;
const props = __props;
const noticeBarWarpRef = ref();
const noticeBarTextRef = ref();
const active = ref((_a2 = props.textlist[0]) == null ? void 0 : _a2.id);
const state = reactive({
order: 1,
oneTime: 0,
twoTime: 0,
warpOWidth: 0,
textOWidth: 0,
isMode: false,
height: 40
});
var timer;
const initAnimation = () => {
nextTick(() => {
state.warpOWidth = noticeBarWarpRef.value.offsetWidth;
state.textOWidth = noticeBarTextRef.value.offsetWidth;
computeAnimationTime();
timer = setTimeout(() => {
changeAnimation();
}, props.delay * 1e3);
});
};
onUnmounted(() => {
clearInterval(timer);
timer = null;
});
const computeAnimationTime = () => {
state.oneTime = state.textOWidth / props.speed;
state.twoTime = (state.textOWidth + state.warpOWidth) / props.speed;
};
const changeAnimation = () => {
if (state.order === 1) {
noticeBarTextRef.value.style.cssText = `animation: around1 ${state.oneTime}s linear; opactity: 1;`;
state.order = 2;
} else {
noticeBarTextRef.value.style.cssText = `animation: around2 ${state.twoTime}s linear ; opactity: 1;`;
state.order = 1;
}
};
const listenerAnimationend = () => {
noticeBarTextRef.value.addEventListener("animationend", () => {
changeAnimation();
}, false);
};
const onRightIconClick = () => {
if (!props.mode)
return false;
if (props.mode === "closeable") {
state.isMode = true;
emit("close");
} else if (props.mode === "link") {
emit("link");
}
};
onMounted(() => {
if (props.scrollable)
return false;
initAnimation();
listenerAnimationend();
});
return (_ctx, _cache) => {
return withDirectives((openBlock(), createElementBlock("div", {
class: "layui-notice-bar",
style: normalizeStyle({ background: __props.background, height: `${__props.height}px` })
}, [
createElementVNode("div", {
class: "layui-notice-bar-warp",
style: normalizeStyle({ color: __props.color, "font-size": `${__props.size}px` })
}, [
__props.leftIcon ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 0,
class: "layui-notice-bar-warp-left-icon",
type: __props.leftIcon
}, null, 8, ["type"])) : createCommentVNode("", true),
createElementVNode("div", {
class: "layui-notice-bar-warp-text-box",
ref_key: "noticeBarWarpRef",
ref: noticeBarWarpRef,
style: normalizeStyle("--textWidth--:" + __props.text.length + "em")
}, [
!__props.scrollable ? (openBlock(), createElementBlock("div", {
key: 0,
class: "layui-notice-bar-warp-text",
ref_key: "noticeBarTextRef",
ref: noticeBarTextRef
}, toDisplayString$1(__props.text), 513)) : (openBlock(), createElementBlock("div", _hoisted_1$2, [
createVNode(_sfc_main$v, {
modelValue: active.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => active.value = $event),
indicator: "none",
anim: "updown",
arrow: "none",
style: { height: `40px` }
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.textlist, (item) => {
return openBlock(), createBlock(_sfc_main$w, {
key: item.id,
id: item.id,
class: "layui-anim layui-anim-up"
}, {
default: withCtx(() => [
createTextVNode(toDisplayString$1(item.text), 1)
]),
_: 2
}, 1032, ["id"]);
}), 128))
]),
_: 1
}, 8, ["modelValue"])
]))
], 4),
__props.rightIcon ? (openBlock(), createBlock(unref(_sfc_main$2E), {
key: 1,
type: __props.rightIcon,
class: "layui-notice-bar-warp-right-icon",
onClick: onRightIconClick
}, null, 8, ["type"])) : createCommentVNode("", true)
], 4)
], 4)), [
[vShow, !state.isMode]
]);
};
}
});
const component$7 = withInstall(_sfc_main$5);
var index$4 = /* @__PURE__ */ (() => '.lay-page-header{display:flex;line-height:24px}.lay-page-header__left{display:flex;cursor:pointer;margin-right:40px;position:relative;color:var(--global-neutral-color-8)}.lay-page-header__left:after{content:"";position:absolute;width:1px;height:16px;right:-20px;top:50%;transform:translateY(-50%);background-color:var(--global-neutral-color-8)}.lay-page-header__left:hover .layui-icon-return,.lay-page-header__left:hover .lay-page-header__title{color:var(--global-checked-color)!important}.lay-page-header__left .layui-icon-return{font-size:14px;margin-right:6px;align-self:center}.lay-page-header__title{font-size:14px}.lay-page-header__content{font-size:18px;color:#393d49}\n')();
const _hoisted_1$1 = { class: "lay-page-header" };
const _hoisted_2$1 = { class: "lay-page-header__title" };
const _hoisted_3$1 = { class: "lay-page-header__content" };
const __default__$3 = {
name: "LayPageHeader"
};
const _sfc_main$4 = defineComponent({
...__default__$3,
props: {
content: { default: "" },
backText: { default: "\u8FD4\u56DE" },
backIcon: { default: "layui-icon-return" }
},
emits: ["back"],
setup(__props, { emit: emits }) {
const slots = useSlots();
2022-12-30 08:13:19 +00:00
const instance = getCurrentInstance();
const backIconSlotName = convertSlotName(instance, "backIcon");
2022-11-15 01:16:55 +00:00
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", _hoisted_1$1, [
createElementVNode("div", {
class: "lay-page-header__left",
onClick: _cache[0] || (_cache[0] = ($event) => emits("back"))
}, [
2022-12-30 08:13:19 +00:00
renderSlot(_ctx.$slots, unref(backIconSlotName), {}, () => [
2022-11-15 01:16:55 +00:00
createElementVNode("i", {
class: normalizeClass(["layui-icon", [__props.backIcon]])
}, null, 2)
]),
createElementVNode("div", _hoisted_2$1, toDisplayString$1(__props.backText), 1)
]),
createElementVNode("div", _hoisted_3$1, [
unref(slots).default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(__props.content), 1)
], 64))
])
]);
};
}
});
const component$6 = withInstall(_sfc_main$4);
var index$3 = /* @__PURE__ */ (() => ":root{--input-border-radius: var(--global-border-radius);--input-border-color: var(--global-neutral-color-3)}.layui-input{width:100%;height:38px;line-height:38px;border-width:1px;border-style:solid;border-color:var(--input-border-color);border-radius:var(--input-border-radius);display:inline-flex}.layui-input input{height:38px;line-height:38px;background-color:#fff;color:#000000d9;padding-left:10px;display:inline-block;border:none;height:100%;width:100%}.layui-input-append{background-color:#fafafa;border-left:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-prepend{background-color:#fafafa;border-right:1px solid var(--input-border-color);display:flex;padding:0 15px;flex:none;align-items:center}.layui-input-wrapper{width:100%;display:inline-flex;border:none}.layui-input:hover,.layui-input:focus-within{border-color:#d2d2d2}.layui-input-clear,.layui-input-prefix,.layui-input-suffix,.layui-input-password{background-color:#fff}.layui-input-clear,.layui-input-password,.layui-input-prefix,.layui-input-suffix{display:flex;flex:none;align-items:center;padding:0 10px}.layui-input-has-prefix input{padding:0}.layui-input-clear,.layui-input-password{color:#00000073}.layui-input-clear:hover{opacity:.6}.layui-input input::-webkit-input-placeholder{line-height:1.3}.layui-input input::-ms-reveal{display:none}.layui-input-disabled{border-color:var(--input-border-color)!important}.layui-input-disabled{opacity:.6}.layui-input-disabled,.layui-input-disabled *{cursor:not-allowed!important}.layui-input[size=lg]{height:44px}.layui-input[size=lg] .layui-input{height:44px;line-height:44px}.layui-input[size=md]{height:38px}.layui-input[size=md] .layui-input{height:38px;line-height:38px}.layui-input[size=sm]{height:32px}.layui-input[size=sm] .layui-input{height:32px;line-height:32px}.layui-input[size=xs]{height:26px}.layui-input[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader{display:inline-block}.layui-cascader[size=lg]{height:44px;width:260px}.layui-cascader[size=lg] .layui-input{height:44px;line-height:44px}.layui-cascader[size=md]{height:38px;width:220px}.layui-cascader[size=md] .layui-input{height:38px;line-height:38px}.layui-cascader[size=sm]{height:32px;width:180px}.layui-cascader[size=sm] .layui-input{height:32px;line-height:32px}.layui-cascader[size=xs]{height:26px;width:140px}.layui-cascader[size=xs] .layui-input{height:26px;line-height:26px}.layui-cascader .layui-input-suffix{padding-right:10px}.layui-cascader .layui-icon-triangle-d{transition:all .3s ease-in-out;transform:rotate(0);color:var(--global-neutral-color-8)}.layui-cascader-opend .layui-icon-triangle-d{transform:rotate(180deg)}.layui-cascader .layui-cascader-panel{box-sizing:border-box;border-radius:2px;line-height:26px;color:#000c;font-size:14px;white-space:nowrap;display:inline-flex}.layui-cascader-menu{display:inline-block;border-right:1px solid var(--global-neutral-color-3)}.layui-cascader-menu:last-child{border-right:none}.layui-cascader-menu-item{min-width:130px;padding:5px 9px 5px 15px;box-sizing:border-box;transition:all .1s ease-in-out;display:flex;justify-content:space-between;align-items:center;min-height:35px}.layui-cascader-menu-item:hover,.layui-cascader-selected{background-color:var(--global-checked-color);color:#fff}.layui-cascader-menu-item .layui-icon-right{margin-left:10px}.layui-cascader-disabled,.layui-cascader-disabled *{cursor:not-allowed!important}\n")();
const _hoisted_1 = ["size"];
2022-12-30 08:13:19 +00:00
const _hoisted_2 = {
key: 1,
class: "slot-area"
};
const _hoisted_3 = { class: "layui-cascader-panel" };
const _hoisted_4 = ["onClick"];
const _hoisted_5 = {
2022-11-15 01:16:55 +00:00
key: 2,
class: "layui-icon layui-icon-right"
};
const __default__$2 = {
name: "LayCascader"
};
const _sfc_main$3 = defineComponent({
...__default__$2,
props: {
options: { default: null },
modelValue: { default: "" },
decollator: { default: "/" },
placeholder: { default: "" },
onlyLastLevel: { type: Boolean, default: false },
disabled: { type: Boolean, default: false },
replaceFields: { default: () => {
return {
label: "label",
value: "value",
children: "children"
};
} },
allowClear: { type: Boolean, default: false },
size: { default: "md" },
trigger: { default: "click" },
contentClass: null,
contentStyle: null
},
emits: ["update:modelValue", "change", "clear"],
setup(__props, { emit }) {
const props = __props;
onMounted(() => {
initTreeData();
});
watch(() => props.options, () => {
initTreeData();
});
watch(() => props.modelValue, () => {
2022-12-30 08:13:19 +00:00
if (watchModelValue.value) {
if (props.modelValue === null || props.modelValue === "") {
onClear();
} else {
updateDisplayByModelValue();
}
setTimeout(() => {
watchModelValue.value = true;
}, 0);
2022-11-15 01:16:55 +00:00
}
});
2022-12-30 08:13:19 +00:00
const watchModelValue = ref(true);
2022-11-15 01:16:55 +00:00
const treeData = ref([]);
const initTreeData = () => {
let treeLvNum = getMaxFloor(props.options);
for (let index2 = 0; index2 < treeLvNum; index2++) {
if (index2 == 0) {
treeData.value[0] = {
selectIndex: null,
data: findData(props.options, 1)
};
} else {
treeData.value[index2] = {
selectIndex: null,
data: []
};
}
}
2022-12-30 08:13:19 +00:00
updateDisplayByModelValue();
};
function updateDisplayByModelValue() {
2022-11-15 01:16:55 +00:00
if (props.modelValue) {
try {
let valueData = props.modelValue.split(props.decollator);
2022-12-30 08:13:19 +00:00
for (let index2 = 0; index2 < valueData.length; index2++) {
const element = valueData[index2];
let selectIndex = treeData.value[index2].data.findIndex((e) => e.value === element);
if (selectIndex == -1) {
break;
2022-11-15 01:16:55 +00:00
}
2022-12-30 08:13:19 +00:00
selectBar(treeData.value[index2].data[selectIndex], selectIndex, index2);
2022-11-15 01:16:55 +00:00
}
} catch (error) {
console.error(error);
}
}
2022-12-30 08:13:19 +00:00
}
2022-11-15 01:16:55 +00:00
function getMaxFloor(treeData2) {
let max = 0;
function each(data, floor) {
data.forEach((e) => {
if (floor > max) {
max = floor;
}
if (e[props.replaceFields.children] && e[props.replaceFields.children].length > 0) {
each(e[props.replaceFields.children], floor + 1);
}
});
}
each(treeData2, 1);
return max;
}
function findData(orginData, level) {
var _a2;
let data = [];
for (let i = 0; i < orginData.length; i++) {
const element = orginData[i];
if (level === 1) {
data.push({
value: element[props.replaceFields.value],
label: element[props.replaceFields.label],
slot: element.slot || false,
children: (_a2 = element[props.replaceFields.children]) != null ? _a2 : false,
orginData: element
});
}
if (level !== 1 && element[props.replaceFields.children] && element[props.replaceFields.children].length > 0) {
findData(element[props.replaceFields.children], level - 1);
}
}
return data;
}
ref([]);
const selectBar = (item, selectIndex, parentIndex) => {
treeData.value[parentIndex].selectIndex = selectIndex;
if (item.children && item.children.length > 0) {
treeData.value[parentIndex + 1].selectIndex = null;
treeData.value[parentIndex + 1].data = findData(item.children, 1);
}
let nextIndex = parentIndex + 2;
for (let index2 = nextIndex; index2 < treeData.value.length; index2++) {
treeData.value[index2].selectIndex = null;
treeData.value[index2].data = [];
}
if (!item.children || item.children.length === 0) {
let extractData = function(orginData, dataContainer2, index2) {
const element = orginData[index2].data;
const selectIndex2 = orginData[index2].selectIndex;
const selectData = element[selectIndex2];
dataContainer2.push(selectData);
if (selectData.children && selectData.children.length > 0) {
extractData(orginData, dataContainer2, index2 + 1);
}
};
let data = [];
extractData(treeData.value, data, 0);
let fullLable = data.map((e) => {
return e.label;
}).join(` ${props.decollator} `);
if (!props.onlyLastLevel) {
displayValue.value = fullLable;
} else {
let _data = data.map((e) => {
return e.label;
});
displayValue.value = _data[_data.length - 1];
}
let value = data.map((e) => {
return e.value;
}).join(props.decollator);
2022-12-30 08:13:19 +00:00
watchModelValue.value = false;
2022-11-15 01:16:55 +00:00
emit("update:modelValue", value);
let evt = {
display: displayValue.value,
value,
label: fullLable,
currentClick: JSON.parse(JSON.stringify(item.orginData))
};
emit("change", evt);
if (dropdownRef.value)
dropdownRef.value.hide();
}
};
const displayValue = ref("");
const slots = useSlots();
const dropdownRef = ref();
const onClear = () => {
displayValue.value = "";
let arr = JSON.parse(JSON.stringify(treeData.value));
for (let index2 = 0; index2 < arr.length; index2++) {
arr[index2].selectIndex = null;
if (index2 === 0) {
continue;
}
arr[index2].data = [];
}
treeData.value = arr;
emit("update:modelValue", null);
};
const openState = ref(false);
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
size: __props.size,
class: normalizeClass([
"layui-cascader",
{
"layui-cascader-opend": openState.value,
"layui-cascader-disabled": __props.disabled
}
])
}, [
createVNode(_sfc_main$1y, {
ref_key: "dropdownRef",
ref: dropdownRef,
trigger: __props.trigger,
autoFitMinWidth: false,
updateAtScroll: true,
disabled: __props.disabled,
contentClass: __props.contentClass,
contentStyle: __props.contentStyle,
onShow: _cache[1] || (_cache[1] = ($event) => openState.value = true),
onHide: _cache[2] || (_cache[2] = ($event) => openState.value = false)
}, {
content: withCtx(() => [
2022-12-30 08:13:19 +00:00
createElementVNode("div", _hoisted_3, [
2022-11-15 01:16:55 +00:00
(openBlock(true), createElementBlock(Fragment, null, renderList(treeData.value, (itemCol, index2) => {
return openBlock(), createElementBlock(Fragment, null, [
itemCol.data.length ? (openBlock(), createBlock(_sfc_main$1u, {
height: "180px",
class: "layui-cascader-menu",
key: "cascader-menu" + index2
}, {
default: withCtx(() => [
(openBlock(true), createElementBlock(Fragment, null, renderList(itemCol.data, (item, i) => {
return openBlock(), createElementBlock("div", {
class: normalizeClass(["layui-cascader-menu-item", [
{
"layui-cascader-selected": itemCol.selectIndex === i
}
]]),
key: index2 + i,
onClick: ($event) => selectBar(item, i, index2)
}, [
item.slot && unref(slots)[item.slot] ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
createTextVNode(toDisplayString$1(item.label), 1)
], 64)),
2022-12-30 08:13:19 +00:00
item.children && item.children.length ? (openBlock(), createElementBlock("i", _hoisted_5)) : createCommentVNode("", true)
], 10, _hoisted_4);
2022-11-15 01:16:55 +00:00
}), 128))
]),
_: 2
}, 1024)) : createCommentVNode("", true)
], 64);
}), 256))
])
]),
default: withCtx(() => [
!unref(slots).default ? (openBlock(), createBlock(_sfc_main$1v, {
key: 0,
modelValue: displayValue.value,
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => displayValue.value = $event),
"suffix-icon": "layui-icon-triangle-d",
placeholder: __props.placeholder,
"allow-clear": __props.allowClear,
disabled: __props.disabled,
readonly: true,
size: __props.size,
onClear
2022-12-30 08:13:19 +00:00
}, null, 8, ["modelValue", "placeholder", "allow-clear", "disabled", "size"])) : (openBlock(), createElementBlock("div", _hoisted_2, [
renderSlot(_ctx.$slots, "default")
]))
2022-11-15 01:16:55 +00:00
]),
_: 3
}, 8, ["trigger", "disabled", "contentClass", "contentStyle"])
], 10, _hoisted_1);
};
}
});
const component$5 = withInstall(_sfc_main$3);
var index$2 = /* @__PURE__ */ (() => ".layui-affix{display:block;z-index:999;transition:all .3s ease-in-out}\n")();
const __default__$1 = {
name: "LayAffix"
};
const _sfc_main$2 = defineComponent({
...__default__$1,
props: {
offset: { default: 0 },
target: { default: () => {
return document.body;
} },
position: { default: "top" }
},
emits: ["scroll"],
setup(__props, { emit }) {
const props = __props;
const outWindow = ref(false);
const dom = ref();
let changeScrollTop = 0;
let orginOffsetLeft = 0;
let marginLeft = 0;
let marginTop = 0;
let marginBottom = 0;
let fixedOffset = 0;
const getStyle = computed$1(() => {
if (outWindow.value && dom.value) {
let style = {
position: "fixed !important",
top: "unset",
bottom: "unset",
left: orginOffsetLeft - marginLeft + "px"
};
if (props.position === "top") {
style.top = fixedOffset - marginTop + "px";
} else {
style.bottom = fixedOffset - marginBottom + "px";
}
return style;
}
});
const checkInWindow = () => {
var _a2;
if (dom.value) {
let offsetTop = dom.value.offsetTop;
let scrollTop = (_a2 = props.target) == null ? void 0 : _a2.scrollTop;
if (props.position === "top") {
let result = offsetTop - scrollTop + props.target.offsetTop;
if (result < fixedOffset) {
if (outWindow.value) {
if (scrollTop <= changeScrollTop) {
outWindow.value = false;
}
} else {
changeScrollTop = scrollTop;
outWindow.value = true;
}
}
} else {
let viewHeight = props.target.offsetHeight > window.innerHeight ? window.innerHeight : props.target.offsetHeight;
let result = viewHeight + scrollTop - offsetTop - dom.value.offsetHeight;
if (outWindow.value) {
if (scrollTop >= changeScrollTop) {
outWindow.value = false;
}
} else {
if (result < fixedOffset) {
changeScrollTop = scrollTop - result + props.offset;
outWindow.value = true;
}
}
}
emit("scroll", {
targetScroll: scrollTop,
affixed: outWindow.value,
offset: !outWindow.value ? 0 : Math.abs(scrollTop - changeScrollTop)
});
}
};
const getDomStyle = (dom2, attr) => {
if (dom2.currentStyle) {
return dom2.currentStyle[attr];
} else {
return document.defaultView.getComputedStyle(dom2, null)[attr];
}
};
onMounted(() => {
nextTick(() => {
dom.value.offsetTop - props.target.offsetTop;
orginOffsetLeft = dom.value.getBoundingClientRect().left;
marginLeft = parseFloat(getDomStyle(dom.value, "marginLeft"));
marginTop = parseFloat(getDomStyle(dom.value, "marginTop"));
marginBottom = parseFloat(getDomStyle(dom.value, "marginBottom"));
fixedOffset = props.offset + props.target.offsetTop;
if (props.position === "bottom") {
fixedOffset = props.offset;
}
props.target.addEventListener("scroll", checkInWindow, true);
checkInWindow();
});
});
onUnmounted(() => {
props.target.removeEventListener("scroll", checkInWindow);
});
return (_ctx, _cache) => {
return openBlock(), createElementBlock("div", {
class: "layui-affix",
style: normalizeStyle(unref(getStyle)),
ref_key: "dom",
ref: dom
}, [
renderSlot(_ctx.$slots, "default")
], 4);
};
}
});
const component$4 = withInstall(_sfc_main$2);
var index$1 = /* @__PURE__ */ (() => ".layui-space{display:inline-flex}.layui-space-horizontal .layui-space-item{display:flex;align-items:center}.layui-space-vertical{flex-direction:column}.layui-space-wrap{flex-wrap:wrap}.layui-space-fill{display:flex}.layui-space-align-start{align-items:flex-start}.layui-space-align-center{align-items:center}.layui-space-align-end{align-items:flex-end}.layui-space-align-baseline{align-items:baseline}.layui-space-item{width:inherit}\n")();
const _sfc_main$1 = defineComponent({
name: "LaySpace",
props: {
align: {
type: String
},
direction: {
type: String,
default: "horizontal"
},
fill: {
type: Boolean,
default: false
},
size: {
type: [Number, String, Array],
default: "sm"
},
wrap: {
type: Boolean,
default: false
}
},
setup(props, { slots }) {
const computAlign = computed$1(() => {
var _a2;
return (_a2 = props.align) != null ? _a2 : props.direction === "horizontal" ? "center" : "";
});
const spaceClass = computed$1(() => [
"layui-space",
{
[`layui-space-align-${computAlign.value}`]: computAlign.value,
[`layui-space-${props.direction}`]: props.direction,
[`layui-space-wrap`]: props.wrap,
[`layui-space-fill`]: props.fill
}
]);
const spaceStyle = computed$1(() => {
const sizeMap = { xs: "4px", sm: "8px", md: "16px", lg: "24px" };
let gap = "";
if (Array.isArray(props.size)) {
gap = props.size.map((size) => {
if (typeof size === "number") {
return `${size}px`;
}
if (typeof size === "string") {
return sizeMap[size] || size;
}
return size;
}).join(" ");
} else if (typeof props.size === "string") {
gap = sizeMap[props.size] || props.size;
} else if (typeof props.size === "number") {
gap = `${props.size}px`;
}
return {
gap
};
});
const itemStyle = computed$1(() => [
props.fill ? { flexGrow: 1, minWidth: "100%" } : {}
]);
const extractChildren = () => {
const result = [];
const children = renderSlot(slots, "default").children;
const elementData = Array.isArray(children) ? [...children] : [];
while (elementData.length) {
const vnode = elementData.shift();
if (vnode === null)
continue;
if (Array.isArray(vnode)) {
elementData.unshift(...vnode);
}
if (!isVNode(vnode) || vnode.type === Comment)
continue;
if (vnode.type === Fragment && Array.isArray(vnode.children)) {
elementData.unshift(vnode.children);
} else if (typeof vnode === "string" || typeof vnode === "number") {
result.push(createTextVNode(vnode));
} else {
result.push(vnode);
}
}
return result;
};
return () => {
const children = extractChildren();
return h("div", {
class: spaceClass.value,
style: spaceStyle.value
}, children.map((child, index2) => {
var _a2;
return h("div", {
key: (_a2 = child.key) != null ? _a2 : `item-${index2}`,
class: "layui-space-item",
style: itemStyle.value
}, h(child));
}));
};
}
});
const component$3 = withInstall(_sfc_main$1);
const component$2 = withInstall(_sfc_main$V);
const component$1 = withInstall(_sfc_main$U);
var darkreader = { exports: {} };
(function(module, exports) {
(function(global2, factory) {
factory(exports);
})(commonjsGlobal, function(exports2) {
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign2(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) {
return value instanceof P ? value : new P(function(resolve) {
resolve(value);
});
}
return new (P || (P = Promise))(function(resolve, reject) {
function fulfilled(value) {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
}
function rejected(value) {
try {
step(generator["throw"](value));
} catch (e) {
reject(e);
}
}
function step(result) {
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
}
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function() {
if (t[0] & 1)
throw t[1];
return t[1];
}, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
return this;
}), g;
function verb(n) {
return function(v) {
return step([n, v]);
};
}
function step(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (_)
try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
return t;
if (y = 0, t)
op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2])
_.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
} catch (e) {
op = [6, e];
y = 0;
} finally {
f = t = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m)
return m.call(o);
if (o && typeof o.length === "number")
return {
next: function() {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
} catch (error) {
e = { error };
} finally {
try {
if (r && !r.done && (m = i["return"]))
m.call(i);
} finally {
if (e)
throw e.error;
}
}
return ar;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar)
ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
var MessageType = {
UI_GET_DATA: "ui-get-data",
UI_GET_ACTIVE_TAB_INFO: "ui-get-active-tab-info",
UI_SUBSCRIBE_TO_CHANGES: "ui-subscribe-to-changes",
UI_UNSUBSCRIBE_FROM_CHANGES: "ui-unsubscribe-from-changes",
UI_CHANGE_SETTINGS: "ui-change-settings",
UI_SET_THEME: "ui-set-theme",
UI_SET_SHORTCUT: "ui-set-shortcut",
UI_TOGGLE_URL: "ui-toggle-url",
UI_MARK_NEWS_AS_READ: "ui-mark-news-as-read",
UI_LOAD_CONFIG: "ui-load-config",
UI_APPLY_DEV_DYNAMIC_THEME_FIXES: "ui-apply-dev-dynamic-theme-fixes",
UI_RESET_DEV_DYNAMIC_THEME_FIXES: "ui-reset-dev-dynamic-theme-fixes",
UI_APPLY_DEV_INVERSION_FIXES: "ui-apply-dev-inversion-fixes",
UI_RESET_DEV_INVERSION_FIXES: "ui-reset-dev-inversion-fixes",
UI_APPLY_DEV_STATIC_THEMES: "ui-apply-dev-static-themes",
UI_RESET_DEV_STATIC_THEMES: "ui-reset-dev-static-themes",
UI_SAVE_FILE: "ui-save-file",
UI_REQUEST_EXPORT_CSS: "ui-request-export-css",
BG_CHANGES: "bg-changes",
BG_ADD_CSS_FILTER: "bg-add-css-filter",
BG_ADD_STATIC_THEME: "bg-add-static-theme",
BG_ADD_SVG_FILTER: "bg-add-svg-filter",
BG_ADD_DYNAMIC_THEME: "bg-add-dynamic-theme",
BG_EXPORT_CSS: "bg-export-css",
BG_UNSUPPORTED_SENDER: "bg-unsupported-sender",
BG_CLEAN_UP: "bg-clean-up",
BG_RELOAD: "bg-reload",
BG_FETCH_RESPONSE: "bg-fetch-response",
BG_UI_UPDATE: "bg-ui-update",
BG_CSS_UPDATE: "bg-css-update",
CS_COLOR_SCHEME_CHANGE: "cs-color-scheme-change",
CS_FRAME_CONNECT: "cs-frame-connect",
CS_FRAME_FORGET: "cs-frame-forget",
CS_FRAME_FREEZE: "cs-frame-freeze",
CS_FRAME_RESUME: "cs-frame-resume",
CS_EXPORT_CSS_RESPONSE: "cs-export-css-response",
CS_FETCH: "cs-fetch"
};
var userAgent = typeof navigator === "undefined" ? "some useragent" : navigator.userAgent.toLowerCase();
var platform = typeof navigator === "undefined" ? "some platform" : navigator.platform.toLowerCase();
var isChromium = userAgent.includes("chrome") || userAgent.includes("chromium");
var isThunderbird = userAgent.includes("thunderbird");
var isFirefox = userAgent.includes("firefox") || userAgent.includes("librewolf") || isThunderbird;
userAgent.includes("vivaldi");
userAgent.includes("yabrowser");
userAgent.includes("opr") || userAgent.includes("opera");
userAgent.includes("edg");
var isSafari = userAgent.includes("safari") && !isChromium;
var isWindows = platform.startsWith("win");
var isMacOS = platform.startsWith("mac");
userAgent.includes("mobile");
var isShadowDomSupported = typeof ShadowRoot === "function";
var isMatchMediaChangeEventListenerSupported = typeof MediaQueryList === "function" && typeof MediaQueryList.prototype.addEventListener === "function";
(function() {
var m = userAgent.match(/chrom[e|ium]\/([^ ]+)/);
if (m && m[1]) {
return m[1];
}
return "";
})();
var isDefinedSelectorSupported = function() {
try {
document.querySelector(":defined");
return true;
} catch (err) {
return false;
}
}();
typeof globalThis !== "undefined" && globalThis.chrome && globalThis.chrome.runtime && globalThis.chrome.runtime.getManifest && globalThis.chrome.runtime.getManifest().manifest_version === 3;
function getOKResponse(url2, mimeType, origin) {
return __awaiter(this, void 0, void 0, function() {
var response;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, fetch(url2, {
cache: "force-cache",
credentials: "omit",
referrer: origin
})];
case 1:
response = _a2.sent();
if (isFirefox && mimeType === "text/css" && url2.startsWith("moz-extension://") && url2.endsWith(".css")) {
return [2, response];
}
if (mimeType && !response.headers.get("Content-Type").startsWith(mimeType)) {
throw new Error("Mime type mismatch when loading " + url2);
}
if (!response.ok) {
throw new Error("Unable to load " + url2 + " " + response.status + " " + response.statusText);
}
return [2, response];
}
});
});
}
function loadAsDataURL(url2, mimeType) {
return __awaiter(this, void 0, void 0, function() {
var response;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, getOKResponse(url2, mimeType)];
case 1:
response = _a2.sent();
return [4, readResponseAsDataURL(response)];
case 2:
return [2, _a2.sent()];
}
});
});
}
function readResponseAsDataURL(response) {
return __awaiter(this, void 0, void 0, function() {
var blob, dataURL;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, response.blob()];
case 1:
blob = _a2.sent();
return [4, new Promise(function(resolve) {
var reader = new FileReader();
reader.onloadend = function() {
return resolve(reader.result);
};
reader.readAsDataURL(blob);
})];
case 2:
dataURL = _a2.sent();
return [2, dataURL];
}
});
});
}
var throwCORSError = function(url2) {
return __awaiter(void 0, void 0, void 0, function() {
return __generator(this, function(_a2) {
return [2, Promise.reject(new Error([
"Embedded Dark Reader cannot access a cross-origin resource",
url2,
"Overview your URLs and CORS policies or use",
"`DarkReader.setFetchMethod(fetch: (url) => Promise<Response>))`.",
"See if using `DarkReader.setFetchMethod(window.fetch)`",
"before `DarkReader.enable()` works."
].join(" ")))];
});
});
};
var fetcher = throwCORSError;
function setFetchMethod$1(fetch2) {
if (fetch2) {
fetcher = fetch2;
} else {
fetcher = throwCORSError;
}
}
function callFetchMethod(url2) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, fetcher(url2)];
case 1:
return [2, _a2.sent()];
}
});
});
}
function initChrome() {
if (typeof chrome === "undefined")
return;
if (typeof window !== "undefined" && !window.chrome) {
window.chrome = {};
}
if (typeof chrome !== "undefined" && !chrome.runtime) {
chrome.runtime = {};
}
var messageListeners = /* @__PURE__ */ new Set();
function sendMessage() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return __awaiter(this, void 0, void 0, function() {
var id_1, _a2, url2, responseType, response, text_1, error_1;
return __generator(this, function(_b) {
switch (_b.label) {
case 0:
if (!(args[0] && args[0].type === MessageType.CS_FETCH))
return [3, 8];
id_1 = args[0].id;
_b.label = 1;
case 1:
_b.trys.push([1, 7, , 8]);
_a2 = args[0].data, url2 = _a2.url, responseType = _a2.responseType;
return [4, callFetchMethod(url2)];
case 2:
response = _b.sent();
if (!(responseType === "data-url"))
return [3, 4];
return [4, readResponseAsDataURL(response)];
case 3:
text_1 = _b.sent();
return [3, 6];
case 4:
return [4, response.text()];
case 5:
text_1 = _b.sent();
_b.label = 6;
case 6:
messageListeners.forEach(function(cb) {
return cb({ type: MessageType.BG_FETCH_RESPONSE, data: text_1, error: null, id: id_1 });
});
return [3, 8];
case 7:
error_1 = _b.sent();
console.error(error_1);
messageListeners.forEach(function(cb) {
return cb({ type: MessageType.BG_FETCH_RESPONSE, data: null, error: error_1, id: id_1 });
});
return [3, 8];
case 8:
return [2];
}
});
});
}
function addMessageListener(callback) {
messageListeners.add(callback);
}
if (typeof chrome.runtime.sendMessage === "function") {
var nativeSendMessage_1 = chrome.runtime.sendMessage;
chrome.runtime.sendMessage = function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
sendMessage.apply(void 0, __spreadArray([], __read(args), false));
nativeSendMessage_1.apply(chrome.runtime, args);
};
} else {
chrome.runtime.sendMessage = sendMessage;
}
if (!chrome.runtime.onMessage) {
chrome.runtime.onMessage = {};
}
if (typeof chrome.runtime.onMessage.addListener === "function") {
var nativeAddListener_1 = chrome.runtime.onMessage.addListener;
chrome.runtime.onMessage.addListener = function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
addMessageListener(args[0]);
nativeAddListener_1.apply(chrome.runtime.onMessage, args);
};
} else {
chrome.runtime.onMessage.addListener = function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
return addMessageListener(args[0]);
};
}
}
initChrome();
var ThemeEngines = {
cssFilter: "cssFilter",
svgFilter: "svgFilter",
staticTheme: "staticTheme",
dynamicTheme: "dynamicTheme"
};
var DEFAULT_COLORS = {
darkScheme: {
background: "#181a1b",
text: "#e8e6e3"
},
lightScheme: {
background: "#dcdad7",
text: "#181a1b"
}
};
var DEFAULT_THEME = {
mode: 1,
brightness: 100,
contrast: 100,
grayscale: 0,
sepia: 0,
useFont: false,
fontFamily: isMacOS ? "Helvetica Neue" : isWindows ? "Segoe UI" : "Open Sans",
textStroke: 0,
engine: ThemeEngines.dynamicTheme,
stylesheet: "",
darkSchemeBackgroundColor: DEFAULT_COLORS.darkScheme.background,
darkSchemeTextColor: DEFAULT_COLORS.darkScheme.text,
lightSchemeBackgroundColor: DEFAULT_COLORS.lightScheme.background,
lightSchemeTextColor: DEFAULT_COLORS.lightScheme.text,
scrollbarColor: isMacOS ? "" : "auto",
selectionColor: "auto",
styleSystemControls: true,
lightColorScheme: "Default",
darkColorScheme: "Default"
};
function isArrayLike(items) {
return items.length != null;
}
function forEach2(items, iterator) {
var e_1, _a2;
if (isArrayLike(items)) {
for (var i = 0, len = items.length; i < len; i++) {
iterator(items[i]);
}
} else {
try {
for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {
var item = items_1_1.value;
iterator(item);
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (items_1_1 && !items_1_1.done && (_a2 = items_1.return))
_a2.call(items_1);
} finally {
if (e_1)
throw e_1.error;
}
}
}
}
function push(array4, addition) {
forEach2(addition, function(a) {
return array4.push(a);
});
}
function toArray2(items) {
var results = [];
for (var i = 0, len = items.length; i < len; i++) {
results.push(items[i]);
}
return results;
}
function logInfo() {
}
function logWarn() {
}
function throttle2(callback) {
var pending = false;
var frameId = null;
var lastArgs;
var throttled = function() {
var args = [];
for (var _i = 0; _i < arguments.length; _i++) {
args[_i] = arguments[_i];
}
lastArgs = args;
if (frameId) {
pending = true;
} else {
callback.apply(void 0, __spreadArray([], __read(lastArgs), false));
frameId = requestAnimationFrame(function() {
frameId = null;
if (pending) {
callback.apply(void 0, __spreadArray([], __read(lastArgs), false));
pending = false;
}
});
}
};
var cancel = function() {
cancelAnimationFrame(frameId);
pending = false;
frameId = null;
};
return Object.assign(throttled, { cancel });
}
function createAsyncTasksQueue() {
var tasks = [];
var frameId = null;
function runTasks() {
var task;
while (task = tasks.shift()) {
task();
}
frameId = null;
}
function add2(task) {
tasks.push(task);
if (!frameId) {
frameId = requestAnimationFrame(runTasks);
}
}
function cancel() {
tasks.splice(0);
cancelAnimationFrame(frameId);
frameId = null;
}
return { add: add2, cancel };
}
function getDuration(time) {
var duration = 0;
if (time.seconds) {
duration += time.seconds * 1e3;
}
if (time.minutes) {
duration += time.minutes * 60 * 1e3;
}
if (time.hours) {
duration += time.hours * 60 * 60 * 1e3;
}
if (time.days) {
duration += time.days * 24 * 60 * 60 * 1e3;
}
return duration;
}
function removeNode(node) {
node && node.parentNode && node.parentNode.removeChild(node);
}
function watchForNodePosition(node, mode, onRestore) {
if (onRestore === void 0) {
onRestore = Function.prototype;
}
var MAX_ATTEMPTS_COUNT = 10;
var RETRY_TIMEOUT = getDuration({ seconds: 2 });
var ATTEMPTS_INTERVAL = getDuration({ seconds: 10 });
var prevSibling = node.previousSibling;
var parent = node.parentNode;
if (!parent) {
throw new Error("Unable to watch for node position: parent element not found");
}
if (mode === "prev-sibling" && !prevSibling) {
throw new Error("Unable to watch for node position: there is no previous sibling");
}
var attempts = 0;
var start = null;
var timeoutId = null;
var restore = throttle2(function() {
if (timeoutId) {
return;
}
attempts++;
var now = Date.now();
if (start == null) {
start = now;
} else if (attempts >= MAX_ATTEMPTS_COUNT) {
if (now - start < ATTEMPTS_INTERVAL) {
timeoutId = setTimeout(function() {
start = null;
attempts = 0;
timeoutId = null;
restore();
}, RETRY_TIMEOUT);
return;
}
start = now;
attempts = 1;
}
if (mode === "parent") {
if (prevSibling && prevSibling.parentNode !== parent) {
stop();
return;
}
}
if (mode === "prev-sibling") {
if (prevSibling.parentNode == null) {
stop();
return;
}
if (prevSibling.parentNode !== parent) {
updateParent(prevSibling.parentNode);
}
}
parent.insertBefore(node, prevSibling ? prevSibling.nextSibling : parent.firstChild);
observer2.takeRecords();
onRestore && onRestore();
});
var observer2 = new MutationObserver(function() {
if (mode === "parent" && node.parentNode !== parent || mode === "prev-sibling" && node.previousSibling !== prevSibling) {
restore();
}
});
var run = function() {
observer2.observe(parent, { childList: true });
};
var stop = function() {
clearTimeout(timeoutId);
observer2.disconnect();
restore.cancel();
};
var skip = function() {
observer2.takeRecords();
};
var updateParent = function(parentNode) {
parent = parentNode;
stop();
run();
};
run();
return { run, stop, skip };
}
function iterateShadowHosts(root, iterator) {
if (root == null) {
return;
}
var walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, {
acceptNode: function(node2) {
return node2.shadowRoot == null ? NodeFilter.FILTER_SKIP : NodeFilter.FILTER_ACCEPT;
}
});
for (var node = root.shadowRoot ? walker.currentNode : walker.nextNode(); node != null; node = walker.nextNode()) {
iterator(node);
iterateShadowHosts(node.shadowRoot, iterator);
}
}
function isDOMReady() {
if (typeof document === "undefined")
return false;
return document.readyState === "complete" || document.readyState === "interactive";
}
var readyStateListeners = /* @__PURE__ */ new Set();
function addDOMReadyListener(listener) {
readyStateListeners.add(listener);
}
function removeDOMReadyListener(listener) {
readyStateListeners.delete(listener);
}
function isReadyStateComplete() {
return document.readyState === "complete";
}
var readyStateCompleteListeners = /* @__PURE__ */ new Set();
function addReadyStateCompleteListener(listener) {
readyStateCompleteListeners.add(listener);
}
function cleanReadyStateCompleteListeners() {
readyStateCompleteListeners.clear();
}
if (!isDOMReady()) {
var onReadyStateChange_1 = function() {
if (isDOMReady()) {
readyStateListeners.forEach(function(listener) {
return listener();
});
readyStateListeners.clear();
if (isReadyStateComplete()) {
document.removeEventListener("readystatechange", onReadyStateChange_1);
readyStateCompleteListeners.forEach(function(listener) {
return listener();
});
readyStateCompleteListeners.clear();
}
}
};
if (typeof document !== "undefined") {
document.addEventListener("readystatechange", onReadyStateChange_1);
}
}
var HUGE_MUTATIONS_COUNT = 1e3;
function isHugeMutation(mutations) {
if (mutations.length > HUGE_MUTATIONS_COUNT) {
return true;
}
var addedNodesCount = 0;
for (var i = 0; i < mutations.length; i++) {
addedNodesCount += mutations[i].addedNodes.length;
if (addedNodesCount > HUGE_MUTATIONS_COUNT) {
return true;
}
}
return false;
}
function getElementsTreeOperations(mutations) {
var additions = /* @__PURE__ */ new Set();
var deletions = /* @__PURE__ */ new Set();
var moves = /* @__PURE__ */ new Set();
mutations.forEach(function(m) {
forEach2(m.addedNodes, function(n) {
if (n instanceof Element && n.isConnected) {
additions.add(n);
}
});
forEach2(m.removedNodes, function(n) {
if (n instanceof Element) {
if (n.isConnected) {
moves.add(n);
additions.delete(n);
} else {
deletions.add(n);
}
}
});
});
var duplicateAdditions = [];
var duplicateDeletions = [];
additions.forEach(function(node) {
if (additions.has(node.parentElement)) {
duplicateAdditions.push(node);
}
});
deletions.forEach(function(node) {
if (deletions.has(node.parentElement)) {
duplicateDeletions.push(node);
}
});
duplicateAdditions.forEach(function(node) {
return additions.delete(node);
});
duplicateDeletions.forEach(function(node) {
return deletions.delete(node);
});
return { additions, moves, deletions };
}
var optimizedTreeObservers = /* @__PURE__ */ new Map();
var optimizedTreeCallbacks = /* @__PURE__ */ new WeakMap();
function createOptimizedTreeObserver(root, callbacks) {
var observer2;
var observerCallbacks;
var domReadyListener;
if (optimizedTreeObservers.has(root)) {
observer2 = optimizedTreeObservers.get(root);
observerCallbacks = optimizedTreeCallbacks.get(observer2);
} else {
var hadHugeMutationsBefore_1 = false;
var subscribedForReadyState_1 = false;
observer2 = new MutationObserver(function(mutations) {
if (isHugeMutation(mutations)) {
if (!hadHugeMutationsBefore_1 || isDOMReady()) {
observerCallbacks.forEach(function(_a2) {
var onHugeMutations = _a2.onHugeMutations;
return onHugeMutations(root);
});
} else if (!subscribedForReadyState_1) {
domReadyListener = function() {
return observerCallbacks.forEach(function(_a2) {
var onHugeMutations = _a2.onHugeMutations;
return onHugeMutations(root);
});
};
addDOMReadyListener(domReadyListener);
subscribedForReadyState_1 = true;
}
hadHugeMutationsBefore_1 = true;
} else {
var elementsOperations_1 = getElementsTreeOperations(mutations);
observerCallbacks.forEach(function(_a2) {
var onMinorMutations = _a2.onMinorMutations;
return onMinorMutations(elementsOperations_1);
});
}
});
observer2.observe(root, { childList: true, subtree: true });
optimizedTreeObservers.set(root, observer2);
observerCallbacks = /* @__PURE__ */ new Set();
optimizedTreeCallbacks.set(observer2, observerCallbacks);
}
observerCallbacks.add(callbacks);
return {
disconnect: function() {
observerCallbacks.delete(callbacks);
if (domReadyListener) {
removeDOMReadyListener(domReadyListener);
}
if (observerCallbacks.size === 0) {
observer2.disconnect();
optimizedTreeCallbacks.delete(observer2);
optimizedTreeObservers.delete(root);
}
}
};
}
var anchor;
var parsedURLCache = /* @__PURE__ */ new Map();
function fixBaseURL($url) {
if (!anchor) {
anchor = document.createElement("a");
}
anchor.href = $url;
return anchor.href;
}
function parseURL($url, $base) {
if ($base === void 0) {
$base = null;
}
var key = "" + $url + ($base ? ";" + $base : "");
if (parsedURLCache.has(key)) {
return parsedURLCache.get(key);
}
if ($base) {
var parsedURL_1 = new URL($url, fixBaseURL($base));
parsedURLCache.set(key, parsedURL_1);
return parsedURL_1;
}
var parsedURL = new URL(fixBaseURL($url));
parsedURLCache.set($url, parsedURL);
return parsedURL;
}
function getAbsoluteURL($base, $relative) {
if ($relative.match(/^data\\?\:/)) {
return $relative;
}
if (/^\/\//.test($relative)) {
return "" + location.protocol + $relative;
}
var b = parseURL($base);
var a = parseURL($relative, b.href);
return a.href;
}
function isRelativeHrefOnAbsolutePath(href) {
if (href.startsWith("data:")) {
return true;
}
var url2 = parseURL(href);
if (url2.protocol !== location.protocol) {
return false;
}
if (url2.hostname !== location.hostname) {
return false;
}
if (url2.port !== location.port) {
return false;
}
return url2.pathname === location.pathname;
}
function iterateCSSRules(rules2, iterate, onMediaRuleError) {
forEach2(rules2, function(rule) {
if (rule.selectorText) {
iterate(rule);
} else if (rule.href) {
try {
iterateCSSRules(rule.styleSheet.cssRules, iterate, onMediaRuleError);
} catch (err) {
logInfo("Found a non-loaded link.");
onMediaRuleError && onMediaRuleError();
}
} else if (rule.media) {
var media = Array.from(rule.media);
var isScreenOrAllOrQuery = media.some(function(m) {
return m.startsWith("screen") || m.startsWith("all") || m.startsWith("(");
});
var isPrintOrSpeech = media.some(function(m) {
return m.startsWith("print") || m.startsWith("speech");
});
if (isScreenOrAllOrQuery || !isPrintOrSpeech) {
iterateCSSRules(rule.cssRules, iterate, onMediaRuleError);
}
} else if (rule.conditionText) {
if (CSS.supports(rule.conditionText)) {
iterateCSSRules(rule.cssRules, iterate, onMediaRuleError);
}
} else {
logWarn("CSSRule type not supported", rule);
}
});
}
var shorthandVarDependantProperties = [
"background",
"border",
"border-color",
"border-bottom",
"border-left",
"border-right",
"border-top",
"outline",
"outline-color"
];
var shorthandVarDepPropRegexps = isSafari ? shorthandVarDependantProperties.map(function(prop) {
var regexp4 = new RegExp(prop + ":\\s*(.*?)\\s*;");
return [prop, regexp4];
}) : null;
function iterateCSSDeclarations(style, iterate) {
forEach2(style, function(property) {
var value = style.getPropertyValue(property).trim();
if (!value) {
return;
}
iterate(property, value);
});
var cssText = style.cssText;
if (cssText.includes("var(")) {
if (isSafari) {
shorthandVarDepPropRegexps.forEach(function(_a2) {
var _b = __read(_a2, 2), prop = _b[0], regexp4 = _b[1];
var match = cssText.match(regexp4);
if (match && match[1]) {
var val = match[1].trim();
iterate(prop, val);
}
});
} else {
shorthandVarDependantProperties.forEach(function(prop) {
var val = style.getPropertyValue(prop);
if (val && val.includes("var(")) {
iterate(prop, val);
}
});
}
}
}
var cssURLRegex = /url\((('.+?')|(".+?")|([^\)]*?))\)/g;
var cssImportRegex = /@import\s*(url\()?(('.+?')|(".+?")|([^\)]*?))\)? ?(screen)?;?/g;
function getCSSURLValue(cssURL) {
return cssURL.replace(/^url\((.*)\)$/, "$1").trim().replace(/^"(.*)"$/, "$1").replace(/^'(.*)'$/, "$1");
}
function getCSSBaseBath(url2) {
var cssURL = parseURL(url2);
return "" + cssURL.origin + cssURL.pathname.replace(/\?.*$/, "").replace(/(\/)([^\/]+)$/i, "$1");
}
function replaceCSSRelativeURLsWithAbsolute($css, cssBasePath) {
return $css.replace(cssURLRegex, function(match) {
var pathValue = getCSSURLValue(match);
try {
return 'url("' + getAbsoluteURL(cssBasePath, pathValue) + '")';
} catch (err) {
return match;
}
});
}
var cssCommentsRegex = /\/\*[\s\S]*?\*\//g;
function removeCSSComments($css) {
return $css.replace(cssCommentsRegex, "");
}
var fontFaceRegex = /@font-face\s*{[^}]*}/g;
function replaceCSSFontFace($css) {
return $css.replace(fontFaceRegex, "");
}
function hslToRGB(_a2) {
var h2 = _a2.h, s = _a2.s, l = _a2.l, _b = _a2.a, a = _b === void 0 ? 1 : _b;
if (s === 0) {
var _c = __read([l, l, l].map(function(x2) {
return Math.round(x2 * 255);
}), 3), r_1 = _c[0], b_1 = _c[1], g_1 = _c[2];
return { r: r_1, g: g_1, b: b_1, a };
}
var c = (1 - Math.abs(2 * l - 1)) * s;
var x = c * (1 - Math.abs(h2 / 60 % 2 - 1));
var m = l - c / 2;
var _d = __read((h2 < 60 ? [c, x, 0] : h2 < 120 ? [x, c, 0] : h2 < 180 ? [0, c, x] : h2 < 240 ? [0, x, c] : h2 < 300 ? [x, 0, c] : [c, 0, x]).map(function(n) {
return Math.round((n + m) * 255);
}), 3), r = _d[0], g = _d[1], b = _d[2];
return { r, g, b, a };
}
function rgbToHSL(_a2) {
var r255 = _a2.r, g255 = _a2.g, b255 = _a2.b, _b = _a2.a, a = _b === void 0 ? 1 : _b;
var r = r255 / 255;
var g = g255 / 255;
var b = b255 / 255;
var max = Math.max(r, g, b);
var min = Math.min(r, g, b);
var c = max - min;
var l = (max + min) / 2;
if (c === 0) {
return { h: 0, s: 0, l, a };
}
var h2 = (max === r ? (g - b) / c % 6 : max === g ? (b - r) / c + 2 : (r - g) / c + 4) * 60;
if (h2 < 0) {
h2 += 360;
}
var s = c / (1 - Math.abs(2 * l - 1));
return { h: h2, s, l, a };
}
function toFixed(n, digits) {
if (digits === void 0) {
digits = 0;
}
var fixed = n.toFixed(digits);
if (digits === 0) {
return fixed;
}
var dot = fixed.indexOf(".");
if (dot >= 0) {
var zerosMatch = fixed.match(/0+$/);
if (zerosMatch) {
if (zerosMatch.index === dot + 1) {
return fixed.substring(0, dot);
}
return fixed.substring(0, zerosMatch.index);
}
}
return fixed;
}
function rgbToString(rgb) {
var r = rgb.r, g = rgb.g, b = rgb.b, a = rgb.a;
if (a != null && a < 1) {
return "rgba(" + toFixed(r) + ", " + toFixed(g) + ", " + toFixed(b) + ", " + toFixed(a, 2) + ")";
}
return "rgb(" + toFixed(r) + ", " + toFixed(g) + ", " + toFixed(b) + ")";
}
function rgbToHexString(_a2) {
var r = _a2.r, g = _a2.g, b = _a2.b, a = _a2.a;
return "#" + (a != null && a < 1 ? [r, g, b, Math.round(a * 255)] : [r, g, b]).map(function(x) {
return (x < 16 ? "0" : "") + x.toString(16);
}).join("");
}
function hslToString(hsl) {
var h2 = hsl.h, s = hsl.s, l = hsl.l, a = hsl.a;
if (a != null && a < 1) {
return "hsla(" + toFixed(h2) + ", " + toFixed(s * 100) + "%, " + toFixed(l * 100) + "%, " + toFixed(a, 2) + ")";
}
return "hsl(" + toFixed(h2) + ", " + toFixed(s * 100) + "%, " + toFixed(l * 100) + "%)";
}
var rgbMatch = /^rgba?\([^\(\)]+\)$/;
var hslMatch = /^hsla?\([^\(\)]+\)$/;
var hexMatch = /^#[0-9a-f]+$/i;
function parse2($color) {
var c = $color.trim().toLowerCase();
if (c.match(rgbMatch)) {
return parseRGB(c);
}
if (c.match(hslMatch)) {
return parseHSL(c);
}
if (c.match(hexMatch)) {
return parseHex(c);
}
if (knownColors.has(c)) {
return getColorByName(c);
}
if (systemColors.has(c)) {
return getSystemColor(c);
}
if ($color === "transparent") {
return { r: 0, g: 0, b: 0, a: 0 };
}
throw new Error("Unable to parse " + $color);
}
function getNumbers($color) {
var numbers = [];
var prevPos = 0;
var isMining = false;
var startIndex = $color.indexOf("(");
$color = $color.substring(startIndex + 1, $color.length - 1);
for (var i = 0; i < $color.length; i++) {
var c = $color[i];
if (c >= "0" && c <= "9" || c === "." || c === "+" || c === "-") {
isMining = true;
} else if (isMining && (c === " " || c === ",")) {
numbers.push($color.substring(prevPos, i));
isMining = false;
prevPos = i + 1;
} else if (!isMining) {
prevPos = i + 1;
}
}
if (isMining) {
numbers.push($color.substring(prevPos, $color.length));
}
return numbers;
}
function getNumbersFromString(str, range3, units) {
var raw = getNumbers(str);
var unitsList = Object.entries(units);
var numbers = raw.map(function(r) {
return r.trim();
}).map(function(r, i) {
var n;
var unit = unitsList.find(function(_a2) {
var _b = __read(_a2, 1), u = _b[0];
return r.endsWith(u);
});
if (unit) {
n = parseFloat(r.substring(0, r.length - unit[0].length)) / unit[1] * range3[i];
} else {
n = parseFloat(r);
}
if (range3[i] > 1) {
return Math.round(n);
}
return n;
});
return numbers;
}
var rgbRange = [255, 255, 255, 1];
var rgbUnits = { "%": 100 };
function parseRGB($rgb) {
var _a2 = __read(getNumbersFromString($rgb, rgbRange, rgbUnits), 4), r = _a2[0], g = _a2[1], b = _a2[2], _b = _a2[3], a = _b === void 0 ? 1 : _b;
return { r, g, b, a };
}
var hslRange = [360, 1, 1, 1];
var hslUnits = { "%": 100, "deg": 360, "rad": 2 * Math.PI, "turn": 1 };
function parseHSL($hsl) {
var _a2 = __read(getNumbersFromString($hsl, hslRange, hslUnits), 4), h2 = _a2[0], s = _a2[1], l = _a2[2], _b = _a2[3], a = _b === void 0 ? 1 : _b;
return hslToRGB({ h: h2, s, l, a });
}
function parseHex($hex) {
var h2 = $hex.substring(1);
switch (h2.length) {
case 3:
case 4: {
var _a2 = __read([0, 1, 2].map(function(i) {
return parseInt("" + h2[i] + h2[i], 16);
}), 3), r = _a2[0], g = _a2[1], b = _a2[2];
var a = h2.length === 3 ? 1 : parseInt("" + h2[3] + h2[3], 16) / 255;
return { r, g, b, a };
}
case 6:
case 8: {
var _b = __read([0, 2, 4].map(function(i) {
return parseInt(h2.substring(i, i + 2), 16);
}), 3), r = _b[0], g = _b[1], b = _b[2];
var a = h2.length === 6 ? 1 : parseInt(h2.substring(6, 8), 16) / 255;
return { r, g, b, a };
}
}
throw new Error("Unable to parse " + $hex);
}
function getColorByName($color) {
var n = knownColors.get($color);
return {
r: n >> 16 & 255,
g: n >> 8 & 255,
b: n >> 0 & 255,
a: 1
};
}
function getSystemColor($color) {
var n = systemColors.get($color);
return {
r: n >> 16 & 255,
g: n >> 8 & 255,
b: n >> 0 & 255,
a: 1
};
}
var isCharDigit = function(char) {
return char >= "0" && char <= "9";
};
var getAmountOfDigits = function(number4) {
return Math.floor(Math.log10(number4)) + 1;
};
function lowerCalcExpression(color) {
var searchIndex = 0;
var replaceBetweenIndices = function(start, end, replacement2) {
color = color.substring(0, start) + replacement2 + color.substring(end);
};
var getNumber = function() {
var resultNumber = 0;
for (var i = 1; i < 4; i++) {
var char = color[searchIndex + i];
if (char === " ") {
break;
}
if (isCharDigit(char)) {
resultNumber *= 10;
resultNumber += Number(char);
} else {
break;
}
}
var lenDigits = getAmountOfDigits(resultNumber);
searchIndex += lenDigits;
var possibleType = color[searchIndex + 1];
if (possibleType !== "%") {
return;
}
searchIndex++;
return resultNumber;
};
while ((searchIndex = color.indexOf("calc(")) !== 0) {
var startIndex = searchIndex;
searchIndex += 4;
var firstNumber = getNumber();
if (!firstNumber) {
break;
}
if (color[searchIndex + 1] !== " ") {
break;
}
searchIndex++;
var operation = color[searchIndex + 1];
if (operation !== "+" && operation !== "-") {
break;
}
searchIndex++;
if (color[searchIndex + 1] !== " ") {
break;
}
searchIndex++;
var secondNumber = getNumber();
if (!secondNumber) {
break;
}
var replacement = void 0;
if (operation === "+") {
replacement = firstNumber + secondNumber + "%";
} else {
replacement = firstNumber - secondNumber + "%";
}
replaceBetweenIndices(startIndex, searchIndex + 2, replacement);
}
return color;
}
var knownColors = new Map(Object.entries({
aliceblue: 15792383,
antiquewhite: 16444375,
aqua: 65535,
aquamarine: 8388564,
azure: 15794175,
beige: 16119260,
bisque: 16770244,
black: 0,
blanchedalmond: 16772045,
blue: 255,
blueviolet: 9055202,
brown: 10824234,
burlywood: 14596231,
cadetblue: 6266528,
chartreuse: 8388352,
chocolate: 13789470,
coral: 16744272,
cornflowerblue: 6591981,
cornsilk: 16775388,
crimson: 14423100,
cyan: 65535,
darkblue: 139,
darkcyan: 35723,
darkgoldenrod: 12092939,
darkgray: 11119017,
darkgrey: 11119017,
darkgreen: 25600,
darkkhaki: 12433259,
darkmagenta: 9109643,
darkolivegreen: 5597999,
darkorange: 16747520,
darkorchid: 10040012,
darkred: 9109504,
darksalmon: 15308410,
darkseagreen: 9419919,
darkslateblue: 4734347,
darkslategray: 3100495,
darkslategrey: 3100495,
darkturquoise: 52945,
darkviolet: 9699539,
deeppink: 16716947,
deepskyblue: 49151,
dimgray: 6908265,
dimgrey: 6908265,
dodgerblue: 2003199,
firebrick: 11674146,
floralwhite: 16775920,
forestgreen: 2263842,
fuchsia: 16711935,
gainsboro: 14474460,
ghostwhite: 16316671,
gold: 16766720,
goldenrod: 14329120,
gray: 8421504,
grey: 8421504,
green: 32768,
greenyellow: 11403055,
honeydew: 15794160,
hotpink: 16738740,
indianred: 13458524,
indigo: 4915330,
ivory: 16777200,
khaki: 15787660,
lavender: 15132410,
lavenderblush: 16773365,
lawngreen: 8190976,
lemonchiffon: 16775885,
lightblue: 11393254,
lightcoral: 15761536,
lightcyan: 14745599,
lightgoldenrodyellow: 16448210,
lightgray: 13882323,
lightgrey: 13882323,
lightgreen: 9498256,
lightpink: 16758465,
lightsalmon: 16752762,
lightseagreen: 2142890,
lightskyblue: 8900346,
lightslategray: 7833753,
lightslategrey: 7833753,
lightsteelblue: 11584734,
lightyellow: 16777184,
lime: 65280,
limegreen: 3329330,
linen: 16445670,
magenta: 16711935,
maroon: 8388608,
mediumaquamarine: 6737322,
mediumblue: 205,
mediumorchid: 12211667,
mediumpurple: 9662683,
mediumseagreen: 3978097,
mediumslateblue: 8087790,
mediumspringgreen: 64154,
mediumturquoise: 4772300,
mediumvioletred: 13047173,
midnightblue: 1644912,
mintcream: 16121850,
mistyrose: 16770273,
moccasin: 16770229,
navajowhite: 16768685,
navy: 128,
oldlace: 16643558,
olive: 8421376,
olivedrab: 7048739,
orange: 16753920,
orangered: 16729344,
orchid: 14315734,
palegoldenrod: 15657130,
palegreen: 10025880,
paleturquoise: 11529966,
palevioletred: 14381203,
papayawhip: 16773077,
peachpuff: 16767673,
peru: 13468991,
pink: 16761035,
plum: 14524637,
powderblue: 11591910,
purple: 8388736,
rebeccapurple: 6697881,
red: 16711680,
rosybrown: 12357519,
royalblue: 4286945,
saddlebrown: 9127187,
salmon: 16416882,
sandybrown: 16032864,
seagreen: 3050327,
seashell: 16774638,
sienna: 10506797,
silver: 12632256,
skyblue: 8900331,
slateblue: 6970061,
slategray: 7372944,
slategrey: 7372944,
snow: 16775930,
springgreen: 65407,
steelblue: 4620980,
tan: 13808780,
teal: 32896,
thistle: 14204888,
tomato: 16737095,
turquoise: 4251856,
violet: 15631086,
wheat: 16113331,
white: 16777215,
whitesmoke: 16119285,
yellow: 16776960,
yellowgreen: 10145074
}));
var systemColors = new Map(Object.entries({
ActiveBorder: 3906044,
ActiveCaption: 0,
AppWorkspace: 11184810,
Background: 6513614,
ButtonFace: 16777215,
ButtonHighlight: 15329769,
ButtonShadow: 10461343,
ButtonText: 0,
CaptionText: 0,
GrayText: 8355711,
Highlight: 11720703,
HighlightText: 0,
InactiveBorder: 16777215,
InactiveCaption: 16777215,
InactiveCaptionText: 0,
InfoBackground: 16514245,
InfoText: 0,
Menu: 16185078,
MenuText: 16777215,
Scrollbar: 11184810,
ThreeDDarkShadow: 0,
ThreeDFace: 12632256,
ThreeDHighlight: 16777215,
ThreeDLightShadow: 16777215,
ThreeDShadow: 0,
Window: 15527148,
WindowFrame: 11184810,
WindowText: 0,
"-webkit-focus-ring-color": 15046400
}).map(function(_a2) {
var _b = __read(_a2, 2), key = _b[0], value = _b[1];
return [key.toLowerCase(), value];
}));
function scale2(x, inLow, inHigh, outLow, outHigh) {
return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
}
function clamp2(x, min, max) {
return Math.min(max, Math.max(min, x));
}
function multiplyMatrices(m1, m2) {
var result = [];
for (var i = 0, len = m1.length; i < len; i++) {
result[i] = [];
for (var j = 0, len2 = m2[0].length; j < len2; j++) {
var sum = 0;
for (var k = 0, len3 = m1[0].length; k < len3; k++) {
sum += m1[i][k] * m2[k][j];
}
result[i][j] = sum;
}
}
return result;
}
function getMatches(regex, input, group) {
if (group === void 0) {
group = 0;
}
var matches = [];
var m;
while (m = regex.exec(input)) {
matches.push(m[group]);
}
return matches;
}
function formatCSS(text) {
function trimLeft(text2) {
return text2.replace(/^\s+/, "");
}
function getIndent(depth2) {
if (depth2 === 0) {
return "";
}
return " ".repeat(4 * depth2);
}
if (text.length < 5e4) {
var emptyRuleRegexp = /[^{}]+{\s*}/;
while (emptyRuleRegexp.test(text)) {
text = text.replace(emptyRuleRegexp, "");
}
}
var css = text.replace(/\s{2,}/g, " ").replace(/\{/g, "{\n").replace(/\}/g, "\n}\n").replace(/\;(?![^\(|\"]*(\)|\"))/g, ";\n").replace(/\,(?![^\(|\"]*(\)|\"))/g, ",\n").replace(/\n\s*\n/g, "\n").split("\n");
var depth = 0;
var formatted = [];
for (var x = 0, len = css.length; x < len; x++) {
var line = css[x] + "\n";
if (line.includes("{")) {
formatted.push(getIndent(depth++) + trimLeft(line));
} else if (line.includes("}")) {
formatted.push(getIndent(--depth) + trimLeft(line));
} else {
formatted.push(getIndent(depth) + trimLeft(line));
}
}
return formatted.join("").trim();
}
function getParenthesesRange(input, searchStartIndex) {
if (searchStartIndex === void 0) {
searchStartIndex = 0;
}
var length = input.length;
var depth = 0;
var firstOpenIndex = -1;
for (var i = searchStartIndex; i < length; i++) {
if (depth === 0) {
var openIndex = input.indexOf("(", i);
if (openIndex < 0) {
break;
}
firstOpenIndex = openIndex;
depth++;
i = openIndex;
} else {
var closingIndex = input.indexOf(")", i);
if (closingIndex < 0) {
break;
}
var openIndex = input.indexOf("(", i);
if (openIndex < 0 || closingIndex < openIndex) {
depth--;
if (depth === 0) {
return { start: firstOpenIndex, end: closingIndex + 1 };
}
i = closingIndex;
} else {
depth++;
i = openIndex;
}
}
}
return null;
}
function createFilterMatrix(config) {
var m = Matrix.identity();
if (config.sepia !== 0) {
m = multiplyMatrices(m, Matrix.sepia(config.sepia / 100));
}
if (config.grayscale !== 0) {
m = multiplyMatrices(m, Matrix.grayscale(config.grayscale / 100));
}
if (config.contrast !== 100) {
m = multiplyMatrices(m, Matrix.contrast(config.contrast / 100));
}
if (config.brightness !== 100) {
m = multiplyMatrices(m, Matrix.brightness(config.brightness / 100));
}
if (config.mode === 1) {
m = multiplyMatrices(m, Matrix.invertNHue());
}
return m;
}
function applyColorMatrix(_a2, matrix) {
var _b = __read(_a2, 3), r = _b[0], g = _b[1], b = _b[2];
var rgb = [[r / 255], [g / 255], [b / 255], [1], [1]];
var result = multiplyMatrices(matrix, rgb);
return [0, 1, 2].map(function(i) {
return clamp2(Math.round(result[i][0] * 255), 0, 255);
});
}
var Matrix = {
identity: function() {
return [
[1, 0, 0, 0, 0],
[0, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
},
invertNHue: function() {
return [
[0.333, -0.667, -0.667, 0, 1],
[-0.667, 0.333, -0.667, 0, 1],
[-0.667, -0.667, 0.333, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
},
brightness: function(v) {
return [
[v, 0, 0, 0, 0],
[0, v, 0, 0, 0],
[0, 0, v, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
},
contrast: function(v) {
var t = (1 - v) / 2;
return [
[v, 0, 0, 0, t],
[0, v, 0, 0, t],
[0, 0, v, 0, t],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
},
sepia: function(v) {
return [
[0.393 + 0.607 * (1 - v), 0.769 - 0.769 * (1 - v), 0.189 - 0.189 * (1 - v), 0, 0],
[0.349 - 0.349 * (1 - v), 0.686 + 0.314 * (1 - v), 0.168 - 0.168 * (1 - v), 0, 0],
[0.272 - 0.272 * (1 - v), 0.534 - 0.534 * (1 - v), 0.131 + 0.869 * (1 - v), 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
},
grayscale: function(v) {
return [
[0.2126 + 0.7874 * (1 - v), 0.7152 - 0.7152 * (1 - v), 0.0722 - 0.0722 * (1 - v), 0, 0],
[0.2126 - 0.2126 * (1 - v), 0.7152 + 0.2848 * (1 - v), 0.0722 - 0.0722 * (1 - v), 0, 0],
[0.2126 - 0.2126 * (1 - v), 0.7152 - 0.7152 * (1 - v), 0.0722 + 0.9278 * (1 - v), 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1]
];
}
};
function getBgPole(theme) {
var isDarkScheme = theme.mode === 1;
var prop = isDarkScheme ? "darkSchemeBackgroundColor" : "lightSchemeBackgroundColor";
return theme[prop];
}
function getFgPole(theme) {
var isDarkScheme = theme.mode === 1;
var prop = isDarkScheme ? "darkSchemeTextColor" : "lightSchemeTextColor";
return theme[prop];
}
var colorModificationCache = /* @__PURE__ */ new Map();
var colorParseCache$1 = /* @__PURE__ */ new Map();
function parseToHSLWithCache(color) {
if (colorParseCache$1.has(color)) {
return colorParseCache$1.get(color);
}
var rgb = parse2(color);
var hsl = rgbToHSL(rgb);
colorParseCache$1.set(color, hsl);
return hsl;
}
function clearColorModificationCache() {
colorModificationCache.clear();
colorParseCache$1.clear();
}
var rgbCacheKeys = ["r", "g", "b", "a"];
var themeCacheKeys$1 = ["mode", "brightness", "contrast", "grayscale", "sepia", "darkSchemeBackgroundColor", "darkSchemeTextColor", "lightSchemeBackgroundColor", "lightSchemeTextColor"];
function getCacheId(rgb, theme) {
var resultId = "";
rgbCacheKeys.forEach(function(key) {
resultId += rgb[key] + ";";
});
themeCacheKeys$1.forEach(function(key) {
resultId += theme[key] + ";";
});
return resultId;
}
function modifyColorWithCache(rgb, theme, modifyHSL, poleColor, anotherPoleColor) {
var fnCache;
if (colorModificationCache.has(modifyHSL)) {
fnCache = colorModificationCache.get(modifyHSL);
} else {
fnCache = /* @__PURE__ */ new Map();
colorModificationCache.set(modifyHSL, fnCache);
}
var id = getCacheId(rgb, theme);
if (fnCache.has(id)) {
return fnCache.get(id);
}
var hsl = rgbToHSL(rgb);
var pole = poleColor == null ? null : parseToHSLWithCache(poleColor);
var anotherPole = anotherPoleColor == null ? null : parseToHSLWithCache(anotherPoleColor);
var modified = modifyHSL(hsl, pole, anotherPole);
var _a2 = hslToRGB(modified), r = _a2.r, g = _a2.g, b = _a2.b, a = _a2.a;
var matrix = createFilterMatrix(theme);
var _b = __read(applyColorMatrix([r, g, b], matrix), 3), rf = _b[0], gf = _b[1], bf = _b[2];
var color = a === 1 ? rgbToHexString({ r: rf, g: gf, b: bf }) : rgbToString({ r: rf, g: gf, b: bf, a });
fnCache.set(id, color);
return color;
}
function noopHSL(hsl) {
return hsl;
}
function modifyColor(rgb, theme) {
return modifyColorWithCache(rgb, theme, noopHSL);
}
function modifyLightSchemeColor(rgb, theme) {
var poleBg = getBgPole(theme);
var poleFg = getFgPole(theme);
return modifyColorWithCache(rgb, theme, modifyLightModeHSL, poleFg, poleBg);
}
function modifyLightModeHSL(_a2, poleFg, poleBg) {
var h2 = _a2.h, s = _a2.s, l = _a2.l, a = _a2.a;
var isDark = l < 0.5;
var isNeutral;
if (isDark) {
isNeutral = l < 0.2 || s < 0.12;
} else {
var isBlue = h2 > 200 && h2 < 280;
isNeutral = s < 0.24 || l > 0.8 && isBlue;
}
var hx = h2;
var sx = l;
if (isNeutral) {
if (isDark) {
hx = poleFg.h;
sx = poleFg.s;
} else {
hx = poleBg.h;
sx = poleBg.s;
}
}
var lx = scale2(l, 0, 1, poleFg.l, poleBg.l);
return { h: hx, s: sx, l: lx, a };
}
var MAX_BG_LIGHTNESS = 0.4;
function modifyBgHSL(_a2, pole) {
var h2 = _a2.h, s = _a2.s, l = _a2.l, a = _a2.a;
var isDark = l < 0.5;
var isBlue = h2 > 200 && h2 < 280;
var isNeutral = s < 0.12 || l > 0.8 && isBlue;
if (isDark) {
var lx_1 = scale2(l, 0, 0.5, 0, MAX_BG_LIGHTNESS);
if (isNeutral) {
var hx_1 = pole.h;
var sx = pole.s;
return { h: hx_1, s: sx, l: lx_1, a };
}
return { h: h2, s, l: lx_1, a };
}
var lx = scale2(l, 0.5, 1, MAX_BG_LIGHTNESS, pole.l);
if (isNeutral) {
var hx_2 = pole.h;
var sx = pole.s;
return { h: hx_2, s: sx, l: lx, a };
}
var hx = h2;
var isYellow = h2 > 60 && h2 < 180;
if (isYellow) {
var isCloserToGreen = h2 > 120;
if (isCloserToGreen) {
hx = scale2(h2, 120, 180, 135, 180);
} else {
hx = scale2(h2, 60, 120, 60, 105);
}
}
return { h: hx, s, l: lx, a };
}
function modifyBackgroundColor(rgb, theme) {
if (theme.mode === 0) {
return modifyLightSchemeColor(rgb, theme);
}
var pole = getBgPole(theme);
return modifyColorWithCache(rgb, __assign(__assign({}, theme), { mode: 0 }), modifyBgHSL, pole);
}
var MIN_FG_LIGHTNESS = 0.55;
function modifyBlueFgHue(hue) {
return scale2(hue, 205, 245, 205, 220);
}
function modifyFgHSL(_a2, pole) {
var h2 = _a2.h, s = _a2.s, l = _a2.l, a = _a2.a;
var isLight = l > 0.5;
var isNeutral = l < 0.2 || s < 0.24;
var isBlue = !isNeutral && h2 > 205 && h2 < 245;
if (isLight) {
var lx_2 = scale2(l, 0.5, 1, MIN_FG_LIGHTNESS, pole.l);
if (isNeutral) {
var hx_3 = pole.h;
var sx = pole.s;
return { h: hx_3, s: sx, l: lx_2, a };
}
var hx_4 = h2;
if (isBlue) {
hx_4 = modifyBlueFgHue(h2);
}
return { h: hx_4, s, l: lx_2, a };
}
if (isNeutral) {
var hx_5 = pole.h;
var sx = pole.s;
var lx_3 = scale2(l, 0, 0.5, pole.l, MIN_FG_LIGHTNESS);
return { h: hx_5, s: sx, l: lx_3, a };
}
var hx = h2;
var lx;
if (isBlue) {
hx = modifyBlueFgHue(h2);
lx = scale2(l, 0, 0.5, pole.l, Math.min(1, MIN_FG_LIGHTNESS + 0.05));
} else {
lx = scale2(l, 0, 0.5, pole.l, MIN_FG_LIGHTNESS);
}
return { h: hx, s, l: lx, a };
}
function modifyForegroundColor(rgb, theme) {
if (theme.mode === 0) {
return modifyLightSchemeColor(rgb, theme);
}
var pole = getFgPole(theme);
return modifyColorWithCache(rgb, __assign(__assign({}, theme), { mode: 0 }), modifyFgHSL, pole);
}
function modifyBorderHSL(_a2, poleFg, poleBg) {
var h2 = _a2.h, s = _a2.s, l = _a2.l, a = _a2.a;
var isDark = l < 0.5;
var isNeutral = l < 0.2 || s < 0.24;
var hx = h2;
var sx = s;
if (isNeutral) {
if (isDark) {
hx = poleFg.h;
sx = poleFg.s;
} else {
hx = poleBg.h;
sx = poleBg.s;
}
}
var lx = scale2(l, 0, 1, 0.5, 0.2);
return { h: hx, s: sx, l: lx, a };
}
function modifyBorderColor(rgb, theme) {
if (theme.mode === 0) {
return modifyLightSchemeColor(rgb, theme);
}
var poleFg = getFgPole(theme);
var poleBg = getBgPole(theme);
return modifyColorWithCache(rgb, __assign(__assign({}, theme), { mode: 0 }), modifyBorderHSL, poleFg, poleBg);
}
function modifyShadowColor(rgb, filter2) {
return modifyBackgroundColor(rgb, filter2);
}
function modifyGradientColor(rgb, filter2) {
return modifyBackgroundColor(rgb, filter2);
}
function createTextStyle(config) {
var lines = [];
lines.push('*:not(pre, pre *, code, .far, .fa, .glyphicon, [class*="vjs-"], .fab, .fa-github, .fas, .material-icons, .icofont, .typcn, mu, [class*="mu-"], .glyphicon, .icon) {');
if (config.useFont && config.fontFamily) {
lines.push(" font-family: " + config.fontFamily + " !important;");
}
if (config.textStroke > 0) {
lines.push(" -webkit-text-stroke: " + config.textStroke + "px !important;");
lines.push(" text-stroke: " + config.textStroke + "px !important;");
}
lines.push("}");
return lines.join("\n");
}
var FilterMode;
(function(FilterMode2) {
FilterMode2[FilterMode2["light"] = 0] = "light";
FilterMode2[FilterMode2["dark"] = 1] = "dark";
})(FilterMode || (FilterMode = {}));
function getCSSFilterValue(config) {
var filters = [];
if (config.mode === FilterMode.dark) {
filters.push("invert(100%) hue-rotate(180deg)");
}
if (config.brightness !== 100) {
filters.push("brightness(" + config.brightness + "%)");
}
if (config.contrast !== 100) {
filters.push("contrast(" + config.contrast + "%)");
}
if (config.grayscale !== 0) {
filters.push("grayscale(" + config.grayscale + "%)");
}
if (config.sepia !== 0) {
filters.push("sepia(" + config.sepia + "%)");
}
if (filters.length === 0) {
return null;
}
return filters.join(" ");
}
function toSVGMatrix(matrix) {
return matrix.slice(0, 4).map(function(m) {
return m.map(function(m2) {
return m2.toFixed(3);
}).join(" ");
}).join(" ");
}
function getSVGFilterMatrixValue(config) {
return toSVGMatrix(createFilterMatrix(config));
}
var counter = 0;
var resolvers$1 = /* @__PURE__ */ new Map();
var rejectors = /* @__PURE__ */ new Map();
function bgFetch(request) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
return [2, new Promise(function(resolve, reject) {
var id = ++counter;
resolvers$1.set(id, resolve);
rejectors.set(id, reject);
if (typeof chrome !== "undefined") {
chrome.runtime.sendMessage({ type: MessageType.CS_FETCH, data: request, id });
}
})];
});
});
}
if (typeof chrome !== "undefined") {
chrome.runtime.onMessage.addListener(function(_a2) {
var type4 = _a2.type, data = _a2.data, error = _a2.error, id = _a2.id;
if (type4 === MessageType.BG_FETCH_RESPONSE) {
var resolve = resolvers$1.get(id);
var reject = rejectors.get(id);
resolvers$1.delete(id);
rejectors.delete(id);
if (error) {
reject && reject(error);
} else {
resolve && resolve(data);
}
}
});
}
var AsyncQueue = function() {
function AsyncQueue2() {
this.queue = [];
this.timerId = null;
this.frameDuration = 1e3 / 60;
}
AsyncQueue2.prototype.addToQueue = function(entry) {
this.queue.push(entry);
this.startQueue();
};
AsyncQueue2.prototype.stopQueue = function() {
if (this.timerId !== null) {
cancelAnimationFrame(this.timerId);
this.timerId = null;
}
this.queue = [];
};
AsyncQueue2.prototype.startQueue = function() {
var _this = this;
if (this.timerId) {
return;
}
this.timerId = requestAnimationFrame(function() {
_this.timerId = null;
var start = Date.now();
var cb;
while (cb = _this.queue.shift()) {
cb();
if (Date.now() - start >= _this.frameDuration) {
_this.startQueue();
break;
}
}
});
};
return AsyncQueue2;
}();
var imageManager = new AsyncQueue();
function getImageDetails(url2) {
return __awaiter(this, void 0, void 0, function() {
var _this = this;
return __generator(this, function(_a2) {
return [2, new Promise(function(resolve, reject) {
return __awaiter(_this, void 0, void 0, function() {
var dataURL, error_1, image_1, error_2;
return __generator(this, function(_a3) {
switch (_a3.label) {
case 0:
if (!url2.startsWith("data:"))
return [3, 1];
dataURL = url2;
return [3, 4];
case 1:
_a3.trys.push([1, 3, , 4]);
return [4, getImageDataURL(url2)];
case 2:
dataURL = _a3.sent();
return [3, 4];
case 3:
error_1 = _a3.sent();
reject(error_1);
return [2];
case 4:
_a3.trys.push([4, 6, , 7]);
return [4, urlToImage(dataURL)];
case 5:
image_1 = _a3.sent();
imageManager.addToQueue(function() {
resolve(__assign({ src: url2, dataURL, width: image_1.naturalWidth, height: image_1.naturalHeight }, analyzeImage(image_1)));
});
return [3, 7];
case 6:
error_2 = _a3.sent();
reject(error_2);
return [3, 7];
case 7:
return [2];
}
});
});
})];
});
});
}
function getImageDataURL(url2) {
return __awaiter(this, void 0, void 0, function() {
var parsedURL;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
parsedURL = new URL(url2);
if (!(parsedURL.origin === location.origin))
return [3, 2];
return [4, loadAsDataURL(url2)];
case 1:
return [2, _a2.sent()];
case 2:
return [4, bgFetch({ url: url2, responseType: "data-url" })];
case 3:
return [2, _a2.sent()];
}
});
});
}
function urlToImage(url2) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
return [2, new Promise(function(resolve, reject) {
var image = new Image();
image.onload = function() {
return resolve(image);
};
image.onerror = function() {
return reject("Unable to load image " + url2);
};
image.src = url2;
})];
});
});
}
var MAX_ANALIZE_PIXELS_COUNT = 32 * 32;
var canvas;
var context;
function createCanvas() {
var maxWidth = MAX_ANALIZE_PIXELS_COUNT;
var maxHeight = MAX_ANALIZE_PIXELS_COUNT;
canvas = document.createElement("canvas");
canvas.width = maxWidth;
canvas.height = maxHeight;
context = canvas.getContext("2d");
context.imageSmoothingEnabled = false;
}
function removeCanvas() {
canvas = null;
context = null;
}
var MAX_IMAGE_SIZE = 5 * 1024 * 1024;
function analyzeImage(image) {
if (!canvas) {
createCanvas();
}
var naturalWidth = image.naturalWidth, naturalHeight = image.naturalHeight;
if (naturalHeight === 0 || naturalWidth === 0) {
logWarn("logWarn(Image is empty " + image.currentSrc + ")");
return null;
}
var size = naturalWidth * naturalHeight * 4;
if (size > MAX_IMAGE_SIZE) {
return {
isDark: false,
isLight: false,
isTransparent: false,
isLarge: false,
isTooLarge: true
};
}
var naturalPixelsCount = naturalWidth * naturalHeight;
var k = Math.min(1, Math.sqrt(MAX_ANALIZE_PIXELS_COUNT / naturalPixelsCount));
var width = Math.ceil(naturalWidth * k);
var height = Math.ceil(naturalHeight * k);
context.clearRect(0, 0, width, height);
context.drawImage(image, 0, 0, naturalWidth, naturalHeight, 0, 0, width, height);
var imageData = context.getImageData(0, 0, width, height);
var d = imageData.data;
var TRANSPARENT_ALPHA_THRESHOLD = 0.05;
var DARK_LIGHTNESS_THRESHOLD = 0.4;
var LIGHT_LIGHTNESS_THRESHOLD = 0.7;
var transparentPixelsCount = 0;
var darkPixelsCount = 0;
var lightPixelsCount = 0;
var i, x, y;
var r, g, b, a;
var l;
for (y = 0; y < height; y++) {
for (x = 0; x < width; x++) {
i = 4 * (y * width + x);
r = d[i + 0] / 255;
g = d[i + 1] / 255;
b = d[i + 2] / 255;
a = d[i + 3] / 255;
if (a < TRANSPARENT_ALPHA_THRESHOLD) {
transparentPixelsCount++;
} else {
l = 0.2126 * r + 0.7152 * g + 0.0722 * b;
if (l < DARK_LIGHTNESS_THRESHOLD) {
darkPixelsCount++;
}
if (l > LIGHT_LIGHTNESS_THRESHOLD) {
lightPixelsCount++;
}
}
}
}
var totalPixelsCount = width * height;
var opaquePixelsCount = totalPixelsCount - transparentPixelsCount;
var DARK_IMAGE_THRESHOLD = 0.7;
var LIGHT_IMAGE_THRESHOLD = 0.7;
var TRANSPARENT_IMAGE_THRESHOLD = 0.1;
var LARGE_IMAGE_PIXELS_COUNT = 800 * 600;
return {
isDark: darkPixelsCount / opaquePixelsCount >= DARK_IMAGE_THRESHOLD,
isLight: lightPixelsCount / opaquePixelsCount >= LIGHT_IMAGE_THRESHOLD,
isTransparent: transparentPixelsCount / totalPixelsCount >= TRANSPARENT_IMAGE_THRESHOLD,
isLarge: naturalPixelsCount >= LARGE_IMAGE_PIXELS_COUNT,
isTooLarge: false
};
}
function getFilteredImageDataURL(_a2, theme) {
var dataURL = _a2.dataURL, width = _a2.width, height = _a2.height;
var matrix = getSVGFilterMatrixValue(theme);
var svg = [
'<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="' + width + '" height="' + height + '">',
"<defs>",
'<filter id="darkreader-image-filter">',
'<feColorMatrix type="matrix" values="' + matrix + '" />',
"</filter>",
"</defs>",
'<image width="' + width + '" height="' + height + '" filter="url(#darkreader-image-filter)" xlink:href="' + dataURL + '" />',
"</svg>"
].join("");
return "data:image/svg+xml;base64," + btoa(svg);
}
function cleanImageProcessingCache() {
imageManager && imageManager.stopQueue();
removeCanvas();
}
function getPriority(ruleStyle, property) {
return Boolean(ruleStyle && ruleStyle.getPropertyPriority(property));
}
function getModifiableCSSDeclaration(property, value, rule, variablesStore2, ignoreImageSelectors, isCancelled) {
if (property.startsWith("--")) {
var modifier = getVariableModifier(variablesStore2, property, value, rule, ignoreImageSelectors, isCancelled);
if (modifier) {
return { property, value: modifier, important: getPriority(rule.style, property), sourceValue: value };
}
} else if (value.includes("var(")) {
var modifier = getVariableDependantModifier(variablesStore2, property, value);
if (modifier) {
return { property, value: modifier, important: getPriority(rule.style, property), sourceValue: value };
}
} else if (property.includes("color") && property !== "-webkit-print-color-adjust" || property === "fill" || property === "stroke" || property === "stop-color") {
var modifier = getColorModifier(property, value);
if (modifier) {
return { property, value: modifier, important: getPriority(rule.style, property), sourceValue: value };
}
} else if (property === "background-image" || property === "list-style-image") {
var modifier = getBgImageModifier(value, rule, ignoreImageSelectors, isCancelled);
if (modifier) {
return { property, value: modifier, important: getPriority(rule.style, property), sourceValue: value };
}
} else if (property.includes("shadow")) {
var modifier = getShadowModifier(value);
if (modifier) {
return { property, value: modifier, important: getPriority(rule.style, property), sourceValue: value };
}
}
return null;
}
function getModifiedUserAgentStyle(theme, isIFrame2, styleSystemControls) {
var lines = [];
if (!isIFrame2) {
lines.push("html {");
lines.push(" background-color: " + modifyBackgroundColor({ r: 255, g: 255, b: 255 }, theme) + " !important;");
lines.push("}");
}
lines.push((isIFrame2 ? "" : "html, body, ") + (styleSystemControls ? "input, textarea, select, button" : "") + " {");
lines.push(" background-color: " + modifyBackgroundColor({ r: 255, g: 255, b: 255 }, theme) + ";");
lines.push("}");
lines.push("html, body, " + (styleSystemControls ? "input, textarea, select, button" : "") + " {");
lines.push(" border-color: " + modifyBorderColor({ r: 76, g: 76, b: 76 }, theme) + ";");
lines.push(" color: " + modifyForegroundColor({ r: 0, g: 0, b: 0 }, theme) + ";");
lines.push("}");
lines.push("a {");
lines.push(" color: " + modifyForegroundColor({ r: 0, g: 64, b: 255 }, theme) + ";");
lines.push("}");
lines.push("table {");
lines.push(" border-color: " + modifyBorderColor({ r: 128, g: 128, b: 128 }, theme) + ";");
lines.push("}");
lines.push("::placeholder {");
lines.push(" color: " + modifyForegroundColor({ r: 169, g: 169, b: 169 }, theme) + ";");
lines.push("}");
lines.push("input:-webkit-autofill,");
lines.push("textarea:-webkit-autofill,");
lines.push("select:-webkit-autofill {");
lines.push(" background-color: " + modifyBackgroundColor({ r: 250, g: 255, b: 189 }, theme) + " !important;");
lines.push(" color: " + modifyForegroundColor({ r: 0, g: 0, b: 0 }, theme) + " !important;");
lines.push("}");
if (theme.scrollbarColor) {
lines.push(getModifiedScrollbarStyle(theme));
}
if (theme.selectionColor) {
lines.push(getModifiedSelectionStyle(theme));
}
return lines.join("\n");
}
function getSelectionColor(theme) {
var backgroundColorSelection;
var foregroundColorSelection;
if (theme.selectionColor === "auto") {
backgroundColorSelection = modifyBackgroundColor({ r: 0, g: 96, b: 212 }, __assign(__assign({}, theme), { grayscale: 0 }));
foregroundColorSelection = modifyForegroundColor({ r: 255, g: 255, b: 255 }, __assign(__assign({}, theme), { grayscale: 0 }));
} else {
var rgb = parse2(theme.selectionColor);
var hsl = rgbToHSL(rgb);
backgroundColorSelection = theme.selectionColor;
if (hsl.l < 0.5) {
foregroundColorSelection = "#FFF";
} else {
foregroundColorSelection = "#000";
}
}
return { backgroundColorSelection, foregroundColorSelection };
}
function getModifiedSelectionStyle(theme) {
var lines = [];
var modifiedSelectionColor = getSelectionColor(theme);
var backgroundColorSelection = modifiedSelectionColor.backgroundColorSelection;
var foregroundColorSelection = modifiedSelectionColor.foregroundColorSelection;
["::selection", "::-moz-selection"].forEach(function(selection) {
lines.push(selection + " {");
lines.push(" background-color: " + backgroundColorSelection + " !important;");
lines.push(" color: " + foregroundColorSelection + " !important;");
lines.push("}");
});
return lines.join("\n");
}
function getModifiedScrollbarStyle(theme) {
var lines = [];
var colorTrack;
var colorIcons;
var colorThumb;
var colorThumbHover;
var colorThumbActive;
var colorCorner;
if (theme.scrollbarColor === "auto") {
colorTrack = modifyBackgroundColor({ r: 241, g: 241, b: 241 }, theme);
colorIcons = modifyForegroundColor({ r: 96, g: 96, b: 96 }, theme);
colorThumb = modifyBackgroundColor({ r: 176, g: 176, b: 176 }, theme);
colorThumbHover = modifyBackgroundColor({ r: 144, g: 144, b: 144 }, theme);
colorThumbActive = modifyBackgroundColor({ r: 96, g: 96, b: 96 }, theme);
colorCorner = modifyBackgroundColor({ r: 255, g: 255, b: 255 }, theme);
} else {
var rgb = parse2(theme.scrollbarColor);
var hsl_1 = rgbToHSL(rgb);
var isLight = hsl_1.l > 0.5;
var lighten = function(lighter) {
return __assign(__assign({}, hsl_1), { l: clamp2(hsl_1.l + lighter, 0, 1) });
};
var darken = function(darker) {
return __assign(__assign({}, hsl_1), { l: clamp2(hsl_1.l - darker, 0, 1) });
};
colorTrack = hslToString(darken(0.4));
colorIcons = hslToString(isLight ? darken(0.4) : lighten(0.4));
colorThumb = hslToString(hsl_1);
colorThumbHover = hslToString(lighten(0.1));
colorThumbActive = hslToString(lighten(0.2));
}
lines.push("::-webkit-scrollbar {");
lines.push(" background-color: " + colorTrack + ";");
lines.push(" color: " + colorIcons + ";");
lines.push("}");
lines.push("::-webkit-scrollbar-thumb {");
lines.push(" background-color: " + colorThumb + ";");
lines.push("}");
lines.push("::-webkit-scrollbar-thumb:hover {");
lines.push(" background-color: " + colorThumbHover + ";");
lines.push("}");
lines.push("::-webkit-scrollbar-thumb:active {");
lines.push(" background-color: " + colorThumbActive + ";");
lines.push("}");
lines.push("::-webkit-scrollbar-corner {");
lines.push(" background-color: " + colorCorner + ";");
lines.push("}");
if (isFirefox) {
lines.push("* {");
lines.push(" scrollbar-color: " + colorThumb + " " + colorTrack + ";");
lines.push("}");
}
return lines.join("\n");
}
function getModifiedFallbackStyle(filter2, _a2) {
var strict = _a2.strict;
var lines = [];
var isMicrosoft = location.hostname.endsWith("microsoft.com");
lines.push("html, body, " + (strict ? "body :not(iframe)" + (isMicrosoft ? ':not(div[style^="position:absolute;top:0;left:-"]' : "") : "body > :not(iframe)") + " {");
lines.push(" background-color: " + modifyBackgroundColor({ r: 255, g: 255, b: 255 }, filter2) + " !important;");
lines.push(" border-color: " + modifyBorderColor({ r: 64, g: 64, b: 64 }, filter2) + " !important;");
lines.push(" color: " + modifyForegroundColor({ r: 0, g: 0, b: 0 }, filter2) + " !important;");
lines.push("}");
return lines.join("\n");
}
var unparsableColors = /* @__PURE__ */ new Set([
"inherit",
"transparent",
"initial",
"currentcolor",
"none",
"unset"
]);
var colorParseCache = /* @__PURE__ */ new Map();
function parseColorWithCache($color) {
$color = $color.trim();
if (colorParseCache.has($color)) {
return colorParseCache.get($color);
}
if ($color.includes("calc(")) {
$color = lowerCalcExpression($color);
}
var color = parse2($color);
colorParseCache.set($color, color);
return color;
}
function tryParseColor($color) {
try {
return parseColorWithCache($color);
} catch (err) {
return null;
}
}
function getColorModifier(prop, value) {
if (unparsableColors.has(value.toLowerCase())) {
return value;
}
try {
var rgb_1 = parseColorWithCache(value);
if (prop.includes("background")) {
return function(filter2) {
return modifyBackgroundColor(rgb_1, filter2);
};
}
if (prop.includes("border") || prop.includes("outline")) {
return function(filter2) {
return modifyBorderColor(rgb_1, filter2);
};
}
return function(filter2) {
return modifyForegroundColor(rgb_1, filter2);
};
} catch (err) {
return null;
}
}
var gradientRegex = /[\-a-z]+gradient\(([^\(\)]*(\(([^\(\)]*(\(.*?\)))*[^\(\)]*\))){0,15}[^\(\)]*\)/g;
var imageDetailsCache = /* @__PURE__ */ new Map();
var awaitingForImageLoading = /* @__PURE__ */ new Map();
function shouldIgnoreImage(selectorText, selectors) {
if (!selectorText || selectors.length === 0) {
return false;
}
if (selectors.some(function(s) {
return s === "*";
})) {
return true;
}
var ruleSelectors = selectorText.split(/,\s*/g);
var _loop_1 = function(i2) {
var ignoredSelector = selectors[i2];
if (ruleSelectors.some(function(s) {
return s === ignoredSelector;
})) {
return { value: true };
}
};
for (var i = 0; i < selectors.length; i++) {
var state_1 = _loop_1(i);
if (typeof state_1 === "object")
return state_1.value;
}
return false;
}
function getBgImageModifier(value, rule, ignoreImageSelectors, isCancelled) {
var _this = this;
try {
var gradients = getMatches(gradientRegex, value);
var urls = getMatches(cssURLRegex, value);
if (urls.length === 0 && gradients.length === 0) {
return value;
}
var getIndices = function(matches) {
var index2 = 0;
return matches.map(function(match) {
var valueIndex = value.indexOf(match, index2);
index2 = valueIndex + match.length;
return { match, index: valueIndex };
});
};
var matches_1 = getIndices(urls).map(function(i) {
return __assign({ type: "url" }, i);
}).concat(getIndices(gradients).map(function(i) {
return __assign({ type: "gradient" }, i);
})).sort(function(a, b) {
return a.index - b.index;
});
var getGradientModifier_1 = function(gradient) {
var match = gradient.match(/^(.*-gradient)\((.*)\)$/);
var type4 = match[1];
var content = match[2];
var partsRegex = /([^\(\),]+(\([^\(\)]*(\([^\(\)]*\)*[^\(\)]*)?\))?[^\(\),]*),?/g;
var colorStopRegex = /^(from|color-stop|to)\(([^\(\)]*?,\s*)?(.*?)\)$/;
var parts = getMatches(partsRegex, content, 1).map(function(part) {
part = part.trim();
var rgb = tryParseColor(part);
if (rgb) {
return function(filter2) {
return modifyGradientColor(rgb, filter2);
};
}
var space = part.lastIndexOf(" ");
rgb = tryParseColor(part.substring(0, space));
if (rgb) {
return function(filter2) {
return modifyGradientColor(rgb, filter2) + " " + part.substring(space + 1);
};
}
var colorStopMatch = part.match(colorStopRegex);
if (colorStopMatch) {
rgb = tryParseColor(colorStopMatch[3]);
if (rgb) {
return function(filter2) {
return colorStopMatch[1] + "(" + (colorStopMatch[2] ? colorStopMatch[2] + ", " : "") + modifyGradientColor(rgb, filter2) + ")";
};
}
}
return function() {
return part;
};
});
return function(filter2) {
return type4 + "(" + parts.map(function(modify) {
return modify(filter2);
}).join(", ") + ")";
};
};
var getURLModifier_1 = function(urlValue) {
var _a2;
if (shouldIgnoreImage(rule.selectorText, ignoreImageSelectors)) {
return null;
}
var url2 = getCSSURLValue(urlValue);
var parentStyleSheet = rule.parentStyleSheet;
var baseURL = parentStyleSheet && parentStyleSheet.href ? getCSSBaseBath(parentStyleSheet.href) : ((_a2 = parentStyleSheet.ownerNode) === null || _a2 === void 0 ? void 0 : _a2.baseURI) || location.origin;
url2 = getAbsoluteURL(baseURL, url2);
var absoluteValue = 'url("' + url2 + '")';
return function(filter2) {
return __awaiter(_this, void 0, void 0, function() {
var imageDetails, awaiters_1, err_1, bgImageValue;
return __generator(this, function(_a3) {
switch (_a3.label) {
case 0:
if (!imageDetailsCache.has(url2))
return [3, 1];
imageDetails = imageDetailsCache.get(url2);
return [3, 7];
case 1:
_a3.trys.push([1, 6, , 7]);
if (!awaitingForImageLoading.has(url2))
return [3, 3];
awaiters_1 = awaitingForImageLoading.get(url2);
return [4, new Promise(function(resolve) {
return awaiters_1.push(resolve);
})];
case 2:
imageDetails = _a3.sent();
if (!imageDetails) {
return [2, null];
}
return [3, 5];
case 3:
awaitingForImageLoading.set(url2, []);
return [4, getImageDetails(url2)];
case 4:
imageDetails = _a3.sent();
imageDetailsCache.set(url2, imageDetails);
awaitingForImageLoading.get(url2).forEach(function(resolve) {
return resolve(imageDetails);
});
awaitingForImageLoading.delete(url2);
_a3.label = 5;
case 5:
if (isCancelled()) {
return [2, null];
}
return [3, 7];
case 6:
err_1 = _a3.sent();
logWarn(err_1);
if (awaitingForImageLoading.has(url2)) {
awaitingForImageLoading.get(url2).forEach(function(resolve) {
return resolve(null);
});
awaitingForImageLoading.delete(url2);
}
return [2, absoluteValue];
case 7:
bgImageValue = getBgImageValue_1(imageDetails, filter2) || absoluteValue;
return [2, bgImageValue];
}
});
});
};
};
var getBgImageValue_1 = function(imageDetails, filter2) {
var isDark = imageDetails.isDark, isLight = imageDetails.isLight, isTransparent = imageDetails.isTransparent, isLarge = imageDetails.isLarge, isTooLarge = imageDetails.isTooLarge, width = imageDetails.width;
var result;
if (isTooLarge) {
result = 'url("' + imageDetails.src + '")';
} else if (isDark && isTransparent && filter2.mode === 1 && !isLarge && width > 2) {
logInfo("Inverting dark image " + imageDetails.src);
var inverted = getFilteredImageDataURL(imageDetails, __assign(__assign({}, filter2), { sepia: clamp2(filter2.sepia + 10, 0, 100) }));
result = 'url("' + inverted + '")';
} else if (isLight && !isTransparent && filter2.mode === 1) {
if (isLarge) {
result = "none";
} else {
logInfo("Dimming light image " + imageDetails.src);
var dimmed = getFilteredImageDataURL(imageDetails, filter2);
result = 'url("' + dimmed + '")';
}
} else if (filter2.mode === 0 && isLight && !isLarge) {
logInfo("Applying filter to image " + imageDetails.src);
var filtered = getFilteredImageDataURL(imageDetails, __assign(__assign({}, filter2), { brightness: clamp2(filter2.brightness - 10, 5, 200), sepia: clamp2(filter2.sepia + 10, 0, 100) }));
result = 'url("' + filtered + '")';
} else {
result = null;
}
return result;
};
var modifiers_1 = [];
var index_1 = 0;
matches_1.forEach(function(_a2, i) {
var match = _a2.match, type4 = _a2.type, matchStart = _a2.index;
var prefixStart = index_1;
var matchEnd = matchStart + match.length;
index_1 = matchEnd;
modifiers_1.push(function() {
return value.substring(prefixStart, matchStart);
});
modifiers_1.push(type4 === "url" ? getURLModifier_1(match) : getGradientModifier_1(match));
if (i === matches_1.length - 1) {
modifiers_1.push(function() {
return value.substring(matchEnd);
});
}
});
return function(filter2) {
var results = modifiers_1.filter(Boolean).map(function(modify) {
return modify(filter2);
});
if (results.some(function(r) {
return r instanceof Promise;
})) {
return Promise.all(results).then(function(asyncResults) {
return asyncResults.join("");
});
}
return results.join("");
};
} catch (err) {
return null;
}
}
function getShadowModifierWithInfo(value) {
try {
var index_2 = 0;
var colorMatches_1 = getMatches(/(^|\s)(?!calc)([a-z]+\(.+?\)|#[0-9a-f]+|[a-z]+)(.*?(inset|outset)?($|,))/ig, value, 2);
var notParsed_1 = 0;
var modifiers_2 = colorMatches_1.map(function(match, i) {
var prefixIndex = index_2;
var matchIndex = value.indexOf(match, index_2);
var matchEnd = matchIndex + match.length;
index_2 = matchEnd;
var rgb = tryParseColor(match);
if (!rgb) {
notParsed_1++;
return function() {
return value.substring(prefixIndex, matchEnd);
};
}
return function(filter2) {
return "" + value.substring(prefixIndex, matchIndex) + modifyShadowColor(rgb, filter2) + (i === colorMatches_1.length - 1 ? value.substring(matchEnd) : "");
};
});
return function(filter2) {
var modified = modifiers_2.map(function(modify) {
return modify(filter2);
}).join("");
return {
matchesLength: colorMatches_1.length,
unparseableMatchesLength: notParsed_1,
result: modified
};
};
} catch (err) {
return null;
}
}
function getShadowModifier(value) {
var shadowModifier = getShadowModifierWithInfo(value);
if (!shadowModifier) {
return null;
}
return function(theme) {
return shadowModifier(theme).result;
};
}
function getVariableModifier(variablesStore2, prop, value, rule, ignoredImgSelectors, isCancelled) {
return variablesStore2.getModifierForVariable({
varName: prop,
sourceValue: value,
rule,
ignoredImgSelectors,
isCancelled
});
}
function getVariableDependantModifier(variablesStore2, prop, value) {
return variablesStore2.getModifierForVarDependant(prop, value);
}
function cleanModificationCache() {
colorParseCache.clear();
clearColorModificationCache();
imageDetailsCache.clear();
cleanImageProcessingCache();
awaitingForImageLoading.clear();
}
var VAR_TYPE_BGCOLOR = 1 << 0;
var VAR_TYPE_TEXTCOLOR = 1 << 1;
var VAR_TYPE_BORDERCOLOR = 1 << 2;
var VAR_TYPE_BGIMG = 1 << 3;
var VariablesStore = function() {
function VariablesStore2() {
this.varTypes = /* @__PURE__ */ new Map();
this.rulesQueue = [];
this.definedVars = /* @__PURE__ */ new Set();
this.varRefs = /* @__PURE__ */ new Map();
this.unknownColorVars = /* @__PURE__ */ new Set();
this.unknownBgVars = /* @__PURE__ */ new Set();
this.undefinedVars = /* @__PURE__ */ new Set();
this.initialVarTypes = /* @__PURE__ */ new Map();
this.changedTypeVars = /* @__PURE__ */ new Set();
this.typeChangeSubscriptions = /* @__PURE__ */ new Map();
this.unstableVarValues = /* @__PURE__ */ new Map();
}
VariablesStore2.prototype.clear = function() {
this.varTypes.clear();
this.rulesQueue.splice(0);
this.definedVars.clear();
this.varRefs.clear();
this.unknownColorVars.clear();
this.unknownBgVars.clear();
this.undefinedVars.clear();
this.initialVarTypes.clear();
this.changedTypeVars.clear();
this.typeChangeSubscriptions.clear();
this.unstableVarValues.clear();
};
VariablesStore2.prototype.isVarType = function(varName, typeNum) {
return this.varTypes.has(varName) && (this.varTypes.get(varName) & typeNum) > 0;
};
VariablesStore2.prototype.addRulesForMatching = function(rules2) {
this.rulesQueue.push(rules2);
};
VariablesStore2.prototype.matchVariablesAndDependants = function() {
var _this = this;
this.changedTypeVars.clear();
this.initialVarTypes = new Map(this.varTypes);
this.collectRootVariables();
this.collectVariablesAndVarDep(this.rulesQueue);
this.rulesQueue.splice(0);
this.collectRootVarDependants();
this.varRefs.forEach(function(refs, v) {
refs.forEach(function(r) {
if (_this.varTypes.has(v)) {
_this.resolveVariableType(r, _this.varTypes.get(v));
}
});
});
this.unknownColorVars.forEach(function(v) {
if (_this.unknownBgVars.has(v)) {
_this.unknownColorVars.delete(v);
_this.unknownBgVars.delete(v);
_this.resolveVariableType(v, VAR_TYPE_BGCOLOR);
} else if (_this.isVarType(v, VAR_TYPE_BGCOLOR | VAR_TYPE_TEXTCOLOR | VAR_TYPE_BORDERCOLOR)) {
_this.unknownColorVars.delete(v);
} else {
_this.undefinedVars.add(v);
}
});
this.unknownBgVars.forEach(function(v) {
var hasColor = _this.findVarRef(v, function(ref2) {
return _this.unknownColorVars.has(ref2) || _this.isVarType(ref2, VAR_TYPE_TEXTCOLOR | VAR_TYPE_BORDERCOLOR);
}) != null;
if (hasColor) {
_this.itarateVarRefs(v, function(ref2) {
_this.resolveVariableType(ref2, VAR_TYPE_BGCOLOR);
});
} else if (_this.isVarType(v, VAR_TYPE_BGCOLOR | VAR_TYPE_BGIMG)) {
_this.unknownBgVars.delete(v);
} else {
_this.undefinedVars.add(v);
}
});
this.changedTypeVars.forEach(function(varName) {
if (_this.typeChangeSubscriptions.has(varName)) {
_this.typeChangeSubscriptions.get(varName).forEach(function(callback) {
callback();
});
}
});
this.changedTypeVars.clear();
};
VariablesStore2.prototype.getModifierForVariable = function(options) {
var _this = this;
return function(theme) {
var varName = options.varName, sourceValue = options.sourceValue, rule = options.rule, ignoredImgSelectors = options.ignoredImgSelectors, isCancelled = options.isCancelled;
var getDeclarations = function() {
var declarations = [];
var addModifiedValue = function(typeNum, varNameWrapper, colorModifier) {
if (!_this.isVarType(varName, typeNum)) {
return;
}
var property2 = varNameWrapper(varName);
var modifiedValue2;
if (isVarDependant(sourceValue)) {
if (isConstructedColorVar(sourceValue)) {
var value = insertVarValues(sourceValue, _this.unstableVarValues);
if (!value) {
value = typeNum === VAR_TYPE_BGCOLOR ? "#ffffff" : "#000000";
}
modifiedValue2 = colorModifier(value, theme);
} else {
modifiedValue2 = replaceCSSVariablesNames(sourceValue, function(v) {
return varNameWrapper(v);
}, function(fallback) {
return colorModifier(fallback, theme);
});
}
} else {
modifiedValue2 = colorModifier(sourceValue, theme);
}
declarations.push({
property: property2,
value: modifiedValue2
});
};
addModifiedValue(VAR_TYPE_BGCOLOR, wrapBgColorVariableName, tryModifyBgColor);
addModifiedValue(VAR_TYPE_TEXTCOLOR, wrapTextColorVariableName, tryModifyTextColor);
addModifiedValue(VAR_TYPE_BORDERCOLOR, wrapBorderColorVariableName, tryModifyBorderColor);
if (_this.isVarType(varName, VAR_TYPE_BGIMG)) {
var property = wrapBgImgVariableName(varName);
var modifiedValue = sourceValue;
if (isVarDependant(sourceValue)) {
modifiedValue = replaceCSSVariablesNames(sourceValue, function(v) {
return wrapBgColorVariableName(v);
}, function(fallback) {
return tryModifyBgColor(fallback, theme);
});
}
var bgModifier = getBgImageModifier(modifiedValue, rule, ignoredImgSelectors, isCancelled);
modifiedValue = typeof bgModifier === "function" ? bgModifier(theme) : bgModifier;
declarations.push({
property,
value: modifiedValue
});
}
return declarations;
};
var callbacks = /* @__PURE__ */ new Set();
var addListener2 = function(onTypeChange) {
var callback = function() {
var decs = getDeclarations();
onTypeChange(decs);
};
callbacks.add(callback);
_this.subscribeForVarTypeChange(varName, callback);
};
var removeListeners = function() {
callbacks.forEach(function(callback) {
_this.unsubscribeFromVariableTypeChanges(varName, callback);
});
};
return {
declarations: getDeclarations(),
onTypeChange: { addListener: addListener2, removeListeners }
};
};
};
VariablesStore2.prototype.getModifierForVarDependant = function(property, sourceValue) {
var _this = this;
if (sourceValue.match(/^\s*(rgb|hsl)a?\(/)) {
var isBg_1 = property.startsWith("background");
var isText_1 = property === "color" || property === "caret-color";
return function(theme) {
var value = insertVarValues(sourceValue, _this.unstableVarValues);
if (!value) {
value = isBg_1 ? "#ffffff" : "#000000";
}
var modifier = isBg_1 ? tryModifyBgColor : isText_1 ? tryModifyTextColor : tryModifyBorderColor;
return modifier(value, theme);
};
}
if (property === "background-color") {
return function(theme) {
return replaceCSSVariablesNames(sourceValue, function(v) {
return wrapBgColorVariableName(v);
}, function(fallback) {
return tryModifyBgColor(fallback, theme);
});
};
}
if (property === "color" || property === "caret-color") {
return function(theme) {
return replaceCSSVariablesNames(sourceValue, function(v) {
return wrapTextColorVariableName(v);
}, function(fallback) {
return tryModifyTextColor(fallback, theme);
});
};
}
if (property === "background" || property === "background-image" || property === "box-shadow") {
return function(theme) {
var unknownVars = /* @__PURE__ */ new Set();
var modify = function() {
var variableReplaced = replaceCSSVariablesNames(sourceValue, function(v) {
if (_this.isVarType(v, VAR_TYPE_BGCOLOR)) {
return wrapBgColorVariableName(v);
}
if (_this.isVarType(v, VAR_TYPE_BGIMG)) {
return wrapBgImgVariableName(v);
}
unknownVars.add(v);
return v;
}, function(fallback) {
return tryModifyBgColor(fallback, theme);
});
if (property === "box-shadow") {
var shadowModifier = getShadowModifierWithInfo(variableReplaced);
var modifiedShadow = shadowModifier(theme);
if (modifiedShadow.unparseableMatchesLength !== modifiedShadow.matchesLength) {
return modifiedShadow.result;
}
}
return variableReplaced;
};
var modified = modify();
if (unknownVars.size > 0) {
return new Promise(function(resolve) {
var firstUnknownVar = unknownVars.values().next().value;
var callback = function() {
_this.unsubscribeFromVariableTypeChanges(firstUnknownVar, callback);
var newValue = modify();
resolve(newValue);
};
_this.subscribeForVarTypeChange(firstUnknownVar, callback);
});
}
return modified;
};
}
if (property.startsWith("border") || property.startsWith("outline")) {
return function(theme) {
return replaceCSSVariablesNames(sourceValue, function(v) {
return wrapBorderColorVariableName(v);
}, function(fallback) {
return tryModifyBorderColor(fallback, theme);
});
};
}
return null;
};
VariablesStore2.prototype.subscribeForVarTypeChange = function(varName, callback) {
if (!this.typeChangeSubscriptions.has(varName)) {
this.typeChangeSubscriptions.set(varName, /* @__PURE__ */ new Set());
}
var rootStore = this.typeChangeSubscriptions.get(varName);
if (!rootStore.has(callback)) {
rootStore.add(callback);
}
};
VariablesStore2.prototype.unsubscribeFromVariableTypeChanges = function(varName, callback) {
if (this.typeChangeSubscriptions.has(varName)) {
this.typeChangeSubscriptions.get(varName).delete(callback);
}
};
VariablesStore2.prototype.collectVariablesAndVarDep = function(ruleList) {
var _this = this;
ruleList.forEach(function(rules2) {
iterateCSSRules(rules2, function(rule) {
rule.style && iterateCSSDeclarations(rule.style, function(property, value) {
if (isVariable(property)) {
_this.inspectVariable(property, value);
}
if (isVarDependant(value)) {
_this.inspectVarDependant(property, value);
}
});
});
});
};
VariablesStore2.prototype.collectRootVariables = function() {
var _this = this;
iterateCSSDeclarations(document.documentElement.style, function(property, value) {
if (isVariable(property)) {
_this.inspectVariable(property, value);
}
});
};
VariablesStore2.prototype.inspectVariable = function(varName, value) {
this.unstableVarValues.set(varName, value);
if (isVarDependant(value) && isConstructedColorVar(value)) {
this.unknownColorVars.add(varName);
this.definedVars.add(varName);
}
if (this.definedVars.has(varName)) {
return;
}
this.definedVars.add(varName);
var color = tryParseColor(value);
if (color) {
this.unknownColorVars.add(varName);
} else if (value.includes("url(") || value.includes("linear-gradient(") || value.includes("radial-gradient(")) {
this.resolveVariableType(varName, VAR_TYPE_BGIMG);
}
};
VariablesStore2.prototype.resolveVariableType = function(varName, typeNum) {
var initialType = this.initialVarTypes.get(varName) || 0;
var currentType = this.varTypes.get(varName) || 0;
var newType = currentType | typeNum;
this.varTypes.set(varName, newType);
if (newType !== initialType || this.undefinedVars.has(varName)) {
this.changedTypeVars.add(varName);
this.undefinedVars.delete(varName);
}
this.unknownColorVars.delete(varName);
this.unknownBgVars.delete(varName);
};
VariablesStore2.prototype.collectRootVarDependants = function() {
var _this = this;
iterateCSSDeclarations(document.documentElement.style, function(property, value) {
if (isVarDependant(value)) {
_this.inspectVarDependant(property, value);
}
});
};
VariablesStore2.prototype.inspectVarDependant = function(property, value) {
var _this = this;
if (isVariable(property)) {
this.iterateVarDeps(value, function(ref2) {
if (!_this.varRefs.has(property)) {
_this.varRefs.set(property, /* @__PURE__ */ new Set());
}
_this.varRefs.get(property).add(ref2);
});
} else if (property === "background-color" || property === "box-shadow") {
this.iterateVarDeps(value, function(v) {
return _this.resolveVariableType(v, VAR_TYPE_BGCOLOR);
});
} else if (property === "color" || property === "caret-color") {
this.iterateVarDeps(value, function(v) {
return _this.resolveVariableType(v, VAR_TYPE_TEXTCOLOR);
});
} else if (property.startsWith("border") || property.startsWith("outline")) {
this.iterateVarDeps(value, function(v) {
return _this.resolveVariableType(v, VAR_TYPE_BORDERCOLOR);
});
} else if (property === "background" || property === "background-image") {
this.iterateVarDeps(value, function(v) {
if (_this.isVarType(v, VAR_TYPE_BGCOLOR | VAR_TYPE_BGIMG)) {
return;
}
var isBgColor = _this.findVarRef(v, function(ref2) {
return _this.unknownColorVars.has(ref2) || _this.isVarType(ref2, VAR_TYPE_TEXTCOLOR | VAR_TYPE_BORDERCOLOR);
}) != null;
_this.itarateVarRefs(v, function(ref2) {
if (isBgColor) {
_this.resolveVariableType(ref2, VAR_TYPE_BGCOLOR);
} else {
_this.unknownBgVars.add(ref2);
}
});
});
}
};
VariablesStore2.prototype.iterateVarDeps = function(value, iterator) {
var varDeps = /* @__PURE__ */ new Set();
iterateVarDependencies(value, function(v) {
return varDeps.add(v);
});
varDeps.forEach(function(v) {
return iterator(v);
});
};
VariablesStore2.prototype.findVarRef = function(varName, iterator, stack) {
var e_1, _a2;
if (stack === void 0) {
stack = /* @__PURE__ */ new Set();
}
if (stack.has(varName)) {
return null;
}
stack.add(varName);
var result = iterator(varName);
if (result) {
return varName;
}
var refs = this.varRefs.get(varName);
if (!refs || refs.size === 0) {
return null;
}
try {
for (var refs_1 = __values(refs), refs_1_1 = refs_1.next(); !refs_1_1.done; refs_1_1 = refs_1.next()) {
var ref2 = refs_1_1.value;
var found = this.findVarRef(ref2, iterator, stack);
if (found) {
return found;
}
}
} catch (e_1_1) {
e_1 = { error: e_1_1 };
} finally {
try {
if (refs_1_1 && !refs_1_1.done && (_a2 = refs_1.return))
_a2.call(refs_1);
} finally {
if (e_1)
throw e_1.error;
}
}
return null;
};
VariablesStore2.prototype.itarateVarRefs = function(varName, iterator) {
this.findVarRef(varName, function(ref2) {
iterator(ref2);
return false;
});
};
VariablesStore2.prototype.setOnRootVariableChange = function(callback) {
this.onRootVariableDefined = callback;
};
VariablesStore2.prototype.putRootVars = function(styleElement, theme) {
var e_2, _a2;
var _this = this;
var sheet = styleElement.sheet;
if (sheet.cssRules.length > 0) {
sheet.deleteRule(0);
}
var declarations = /* @__PURE__ */ new Map();
iterateCSSDeclarations(document.documentElement.style, function(property2, value2) {
if (isVariable(property2)) {
if (_this.isVarType(property2, VAR_TYPE_BGCOLOR)) {
declarations.set(wrapBgColorVariableName(property2), tryModifyBgColor(value2, theme));
}
if (_this.isVarType(property2, VAR_TYPE_TEXTCOLOR)) {
declarations.set(wrapTextColorVariableName(property2), tryModifyTextColor(value2, theme));
}
if (_this.isVarType(property2, VAR_TYPE_BORDERCOLOR)) {
declarations.set(wrapBorderColorVariableName(property2), tryModifyBorderColor(value2, theme));
}
_this.subscribeForVarTypeChange(property2, _this.onRootVariableDefined);
}
});
var cssLines = [];
cssLines.push(":root {");
try {
for (var declarations_1 = __values(declarations), declarations_1_1 = declarations_1.next(); !declarations_1_1.done; declarations_1_1 = declarations_1.next()) {
var _b = __read(declarations_1_1.value, 2), property = _b[0], value = _b[1];
cssLines.push(" " + property + ": " + value + ";");
}
} catch (e_2_1) {
e_2 = { error: e_2_1 };
} finally {
try {
if (declarations_1_1 && !declarations_1_1.done && (_a2 = declarations_1.return))
_a2.call(declarations_1);
} finally {
if (e_2)
throw e_2.error;
}
}
cssLines.push("}");
var cssText = cssLines.join("\n");
sheet.insertRule(cssText);
};
return VariablesStore2;
}();
var variablesStore = new VariablesStore();
function getVariableRange(input, searchStart) {
if (searchStart === void 0) {
searchStart = 0;
}
var start = input.indexOf("var(", searchStart);
if (start >= 0) {
var range3 = getParenthesesRange(input, start + 3);
if (range3) {
return { start, end: range3.end };
}
return null;
}
}
function getVariablesMatches(input) {
var ranges = [];
var i = 0;
var range3;
while (range3 = getVariableRange(input, i)) {
var start = range3.start, end = range3.end;
ranges.push({ start, end, value: input.substring(start, end) });
i = range3.end + 1;
}
return ranges;
}
function replaceVariablesMatches(input, replacer) {
var matches = getVariablesMatches(input);
var matchesCount = matches.length;
if (matchesCount === 0) {
return input;
}
var inputLength = input.length;
var replacements = matches.map(function(m) {
return replacer(m.value);
});
var parts = [];
parts.push(input.substring(0, matches[0].start));
for (var i = 0; i < matchesCount; i++) {
parts.push(replacements[i]);
var start = matches[i].end;
var end = i < matchesCount - 1 ? matches[i + 1].start : inputLength;
parts.push(input.substring(start, end));
}
return parts.join("");
}
function getVariableNameAndFallback(match) {
var commaIndex = match.indexOf(",");
var name;
var fallback;
if (commaIndex >= 0) {
name = match.substring(4, commaIndex).trim();
fallback = match.substring(commaIndex + 1, match.length - 1).trim();
} else {
name = match.substring(4, match.length - 1).trim();
fallback = "";
}
return { name, fallback };
}
function replaceCSSVariablesNames(value, nameReplacer, fallbackReplacer) {
var matchReplacer = function(match) {
var _a2 = getVariableNameAndFallback(match), name = _a2.name, fallback = _a2.fallback;
var newName = nameReplacer(name);
if (!fallback) {
return "var(" + newName + ")";
}
var newFallback;
if (isVarDependant(fallback)) {
newFallback = replaceCSSVariablesNames(fallback, nameReplacer, fallbackReplacer);
} else if (fallbackReplacer) {
newFallback = fallbackReplacer(fallback);
} else {
newFallback = fallback;
}
return "var(" + newName + ", " + newFallback + ")";
};
return replaceVariablesMatches(value, matchReplacer);
}
function iterateVarDependencies(value, iterator) {
replaceCSSVariablesNames(value, function(varName) {
iterator(varName);
return varName;
});
}
function wrapBgColorVariableName(name) {
return "--darkreader-bg" + name;
}
function wrapTextColorVariableName(name) {
return "--darkreader-text" + name;
}
function wrapBorderColorVariableName(name) {
return "--darkreader-border" + name;
}
function wrapBgImgVariableName(name) {
return "--darkreader-bgimg" + name;
}
function isVariable(property) {
return property.startsWith("--");
}
function isVarDependant(value) {
return value.includes("var(");
}
function isConstructedColorVar(value) {
return value.match(/^\s*(rgb|hsl)a?\(/);
}
var rawValueRegex = /^\d{1,3}, ?\d{1,3}, ?\d{1,3}$/;
function parseRawValue(color) {
if (rawValueRegex.test(color)) {
var splitted = color.split(",");
var resultInRGB_1 = "rgb(";
splitted.forEach(function(number4) {
resultInRGB_1 += number4.trim() + ", ";
});
resultInRGB_1 = resultInRGB_1.substr(0, resultInRGB_1.length - 2);
resultInRGB_1 += ")";
return { isRaw: true, color: resultInRGB_1 };
}
return { isRaw: false, color };
}
function handleRawValue(color, theme, modifyFunction) {
var _a2 = parseRawValue(color), isRaw = _a2.isRaw, newColor = _a2.color;
var rgb = tryParseColor(newColor);
if (rgb) {
var outputColor = modifyFunction(rgb, theme);
if (isRaw) {
var outputInRGB = tryParseColor(outputColor);
return outputInRGB ? outputInRGB.r + ", " + outputInRGB.g + ", " + outputInRGB.b : outputColor;
}
return outputColor;
}
return newColor;
}
function tryModifyBgColor(color, theme) {
return handleRawValue(color, theme, modifyBackgroundColor);
}
function tryModifyTextColor(color, theme) {
return handleRawValue(color, theme, modifyForegroundColor);
}
function tryModifyBorderColor(color, theme) {
return handleRawValue(color, theme, modifyBorderColor);
}
function insertVarValues(source, varValues, stack) {
if (stack === void 0) {
stack = /* @__PURE__ */ new Set();
}
var containsUnresolvedVar = false;
var matchReplacer = function(match) {
var _a2 = getVariableNameAndFallback(match), name = _a2.name, fallback = _a2.fallback;
if (stack.has(name)) {
containsUnresolvedVar = true;
return null;
}
stack.add(name);
var varValue = varValues.get(name) || fallback;
var inserted = null;
if (varValue) {
if (isVarDependant(varValue)) {
inserted = insertVarValues(varValue, varValues, stack);
} else {
inserted = varValue;
}
}
if (!inserted) {
containsUnresolvedVar = true;
return null;
}
return inserted;
};
var replaced = replaceVariablesMatches(source, matchReplacer);
if (containsUnresolvedVar) {
return null;
}
return replaced;
}
var overrides = {
"background-color": {
customProp: "--darkreader-inline-bgcolor",
cssProp: "background-color",
dataAttr: "data-darkreader-inline-bgcolor"
},
"background-image": {
customProp: "--darkreader-inline-bgimage",
cssProp: "background-image",
dataAttr: "data-darkreader-inline-bgimage"
},
"border-color": {
customProp: "--darkreader-inline-border",
cssProp: "border-color",
dataAttr: "data-darkreader-inline-border"
},
"border-bottom-color": {
customProp: "--darkreader-inline-border-bottom",
cssProp: "border-bottom-color",
dataAttr: "data-darkreader-inline-border-bottom"
},
"border-left-color": {
customProp: "--darkreader-inline-border-left",
cssProp: "border-left-color",
dataAttr: "data-darkreader-inline-border-left"
},
"border-right-color": {
customProp: "--darkreader-inline-border-right",
cssProp: "border-right-color",
dataAttr: "data-darkreader-inline-border-right"
},
"border-top-color": {
customProp: "--darkreader-inline-border-top",
cssProp: "border-top-color",
dataAttr: "data-darkreader-inline-border-top"
},
"box-shadow": {
customProp: "--darkreader-inline-boxshadow",
cssProp: "box-shadow",
dataAttr: "data-darkreader-inline-boxshadow"
},
"color": {
customProp: "--darkreader-inline-color",
cssProp: "color",
dataAttr: "data-darkreader-inline-color"
},
"fill": {
customProp: "--darkreader-inline-fill",
cssProp: "fill",
dataAttr: "data-darkreader-inline-fill"
},
"stroke": {
customProp: "--darkreader-inline-stroke",
cssProp: "stroke",
dataAttr: "data-darkreader-inline-stroke"
},
"outline-color": {
customProp: "--darkreader-inline-outline",
cssProp: "outline-color",
dataAttr: "data-darkreader-inline-outline"
},
"stop-color": {
customProp: "--darkreader-inline-stopcolor",
cssProp: "stop-color",
dataAttr: "data-darkreader-inline-stopcolor"
}
};
var overridesList = Object.values(overrides);
var normalizedPropList = {};
overridesList.forEach(function(_a2) {
var cssProp = _a2.cssProp, customProp = _a2.customProp;
return normalizedPropList[customProp] = cssProp;
});
var INLINE_STYLE_ATTRS = ["style", "fill", "stop-color", "stroke", "bgcolor", "color"];
var INLINE_STYLE_SELECTOR = INLINE_STYLE_ATTRS.map(function(attr) {
return "[" + attr + "]";
}).join(", ");
function getInlineOverrideStyle() {
return overridesList.map(function(_a2) {
var dataAttr = _a2.dataAttr, customProp = _a2.customProp, cssProp = _a2.cssProp;
return [
"[" + dataAttr + "] {",
" " + cssProp + ": var(" + customProp + ") !important;",
"}"
].join("\n");
}).join("\n");
}
function getInlineStyleElements(root) {
var results = [];
if (root instanceof Element && root.matches(INLINE_STYLE_SELECTOR)) {
results.push(root);
}
if (root instanceof Element || isShadowDomSupported && root instanceof ShadowRoot || root instanceof Document) {
push(results, root.querySelectorAll(INLINE_STYLE_SELECTOR));
}
return results;
}
var treeObservers = /* @__PURE__ */ new Map();
var attrObservers = /* @__PURE__ */ new Map();
function watchForInlineStyles(elementStyleDidChange, shadowRootDiscovered) {
deepWatchForInlineStyles(document, elementStyleDidChange, shadowRootDiscovered);
iterateShadowHosts(document.documentElement, function(host) {
deepWatchForInlineStyles(host.shadowRoot, elementStyleDidChange, shadowRootDiscovered);
});
}
function deepWatchForInlineStyles(root, elementStyleDidChange, shadowRootDiscovered) {
if (treeObservers.has(root)) {
treeObservers.get(root).disconnect();
attrObservers.get(root).disconnect();
}
var discoveredNodes = /* @__PURE__ */ new WeakSet();
function discoverNodes(node) {
getInlineStyleElements(node).forEach(function(el) {
if (discoveredNodes.has(el)) {
return;
}
discoveredNodes.add(el);
elementStyleDidChange(el);
});
iterateShadowHosts(node, function(n) {
if (discoveredNodes.has(node)) {
return;
}
discoveredNodes.add(node);
shadowRootDiscovered(n.shadowRoot);
deepWatchForInlineStyles(n.shadowRoot, elementStyleDidChange, shadowRootDiscovered);
});
}
var treeObserver = createOptimizedTreeObserver(root, {
onMinorMutations: function(_a2) {
var additions = _a2.additions;
additions.forEach(function(added) {
return discoverNodes(added);
});
},
onHugeMutations: function() {
discoverNodes(root);
}
});
treeObservers.set(root, treeObserver);
var attemptCount = 0;
var start = null;
var ATTEMPTS_INTERVAL = getDuration({ seconds: 10 });
var RETRY_TIMEOUT = getDuration({ seconds: 2 });
var MAX_ATTEMPTS_COUNT = 50;
var cache2 = [];
var timeoutId = null;
var handleAttributeMutations = throttle2(function(mutations) {
mutations.forEach(function(m) {
if (INLINE_STYLE_ATTRS.includes(m.attributeName)) {
elementStyleDidChange(m.target);
}
});
});
var attrObserver = new MutationObserver(function(mutations) {
if (timeoutId) {
cache2.push.apply(cache2, __spreadArray([], __read(mutations), false));
return;
}
attemptCount++;
var now = Date.now();
if (start == null) {
start = now;
} else if (attemptCount >= MAX_ATTEMPTS_COUNT) {
if (now - start < ATTEMPTS_INTERVAL) {
timeoutId = setTimeout(function() {
start = null;
attemptCount = 0;
timeoutId = null;
var attributeCache = cache2;
cache2 = [];
handleAttributeMutations(attributeCache);
}, RETRY_TIMEOUT);
cache2.push.apply(cache2, __spreadArray([], __read(mutations), false));
return;
}
start = now;
attemptCount = 1;
}
handleAttributeMutations(mutations);
});
attrObserver.observe(root, {
attributes: true,
attributeFilter: INLINE_STYLE_ATTRS.concat(overridesList.map(function(_a2) {
var dataAttr = _a2.dataAttr;
return dataAttr;
})),
subtree: true
});
attrObservers.set(root, attrObserver);
}
function stopWatchingForInlineStyles() {
treeObservers.forEach(function(o) {
return o.disconnect();
});
attrObservers.forEach(function(o) {
return o.disconnect();
});
treeObservers.clear();
attrObservers.clear();
}
var inlineStyleCache = /* @__PURE__ */ new WeakMap();
var filterProps = ["brightness", "contrast", "grayscale", "sepia", "mode"];
function getInlineStyleCacheKey(el, theme) {
return INLINE_STYLE_ATTRS.map(function(attr) {
return attr + '="' + el.getAttribute(attr) + '"';
}).concat(filterProps.map(function(prop) {
return prop + '="' + theme[prop] + '"';
})).join(" ");
}
function shouldIgnoreInlineStyle(element, selectors) {
for (var i = 0, len = selectors.length; i < len; i++) {
var ingnoredSelector = selectors[i];
if (element.matches(ingnoredSelector)) {
return true;
}
}
return false;
}
function overrideInlineStyle(element, theme, ignoreInlineSelectors, ignoreImageSelectors) {
var cacheKey = getInlineStyleCacheKey(element, theme);
if (cacheKey === inlineStyleCache.get(element)) {
return;
}
var unsetProps = new Set(Object.keys(overrides));
function setCustomProp(targetCSSProp, modifierCSSProp, cssVal) {
var _a2 = overrides[targetCSSProp], customProp = _a2.customProp, dataAttr = _a2.dataAttr;
var mod = getModifiableCSSDeclaration(modifierCSSProp, cssVal, {}, variablesStore, ignoreImageSelectors, null);
if (!mod) {
return;
}
var value2 = mod.value;
if (typeof value2 === "function") {
value2 = value2(theme);
}
element.style.setProperty(customProp, value2);
if (!element.hasAttribute(dataAttr)) {
element.setAttribute(dataAttr, "");
}
unsetProps.delete(targetCSSProp);
}
if (ignoreInlineSelectors.length > 0) {
if (shouldIgnoreInlineStyle(element, ignoreInlineSelectors)) {
unsetProps.forEach(function(cssProp) {
element.removeAttribute(overrides[cssProp].dataAttr);
});
return;
}
}
if (element.hasAttribute("bgcolor")) {
var value = element.getAttribute("bgcolor");
if (value.match(/^[0-9a-f]{3}$/i) || value.match(/^[0-9a-f]{6}$/i)) {
value = "#" + value;
}
setCustomProp("background-color", "background-color", value);
}
if (element.hasAttribute("color") && element.rel !== "mask-icon") {
var value = element.getAttribute("color");
if (value.match(/^[0-9a-f]{3}$/i) || value.match(/^[0-9a-f]{6}$/i)) {
value = "#" + value;
}
setCustomProp("color", "color", value);
}
if (element instanceof SVGElement) {
if (element.hasAttribute("fill")) {
var SMALL_SVG_LIMIT_1 = 32;
var value_1 = element.getAttribute("fill");
if (value_1 !== "none") {
if (!(element instanceof SVGTextElement)) {
var handleSVGElement = function() {
var _a2 = element.getBoundingClientRect(), width = _a2.width, height = _a2.height;
var isBg = width > SMALL_SVG_LIMIT_1 || height > SMALL_SVG_LIMIT_1;
setCustomProp("fill", isBg ? "background-color" : "color", value_1);
};
if (isReadyStateComplete()) {
handleSVGElement();
} else {
addReadyStateCompleteListener(handleSVGElement);
}
} else {
setCustomProp("fill", "color", value_1);
}
}
}
if (element.hasAttribute("stop-color")) {
setCustomProp("stop-color", "background-color", element.getAttribute("stop-color"));
}
}
if (element.hasAttribute("stroke")) {
var value = element.getAttribute("stroke");
setCustomProp("stroke", element instanceof SVGLineElement || element instanceof SVGTextElement ? "border-color" : "color", value);
}
element.style && iterateCSSDeclarations(element.style, function(property, value2) {
if (property === "background-image" && value2.includes("url")) {
return;
}
if (overrides.hasOwnProperty(property)) {
setCustomProp(property, property, value2);
} else {
var overridenProp = normalizedPropList[property];
if (overridenProp && (!element.style.getPropertyValue(overridenProp) && !element.hasAttribute(overridenProp))) {
if (overridenProp === "background-color" && element.hasAttribute("bgcolor")) {
return;
}
element.style.setProperty(property, "");
}
}
});
if (element.style && element instanceof SVGTextElement && element.style.fill) {
setCustomProp("fill", "color", element.style.getPropertyValue("fill"));
}
forEach2(unsetProps, function(cssProp) {
element.removeAttribute(overrides[cssProp].dataAttr);
});
inlineStyleCache.set(element, getInlineStyleCacheKey(element, theme));
}
var metaThemeColorName = "theme-color";
var metaThemeColorSelector = 'meta[name="' + metaThemeColorName + '"]';
var srcMetaThemeColor = null;
var observer = null;
function changeMetaThemeColor(meta, theme) {
srcMetaThemeColor = srcMetaThemeColor || meta.content;
try {
var color = parse2(srcMetaThemeColor);
meta.content = modifyBackgroundColor(color, theme);
} catch (err) {
}
}
function changeMetaThemeColorWhenAvailable(theme) {
var meta = document.querySelector(metaThemeColorSelector);
if (meta) {
changeMetaThemeColor(meta, theme);
} else {
if (observer) {
observer.disconnect();
}
observer = new MutationObserver(function(mutations) {
loop:
for (var i = 0; i < mutations.length; i++) {
var addedNodes = mutations[i].addedNodes;
for (var j = 0; j < addedNodes.length; j++) {
var node = addedNodes[j];
if (node instanceof HTMLMetaElement && node.name === metaThemeColorName) {
observer.disconnect();
observer = null;
changeMetaThemeColor(node, theme);
break loop;
}
}
}
});
observer.observe(document.head, { childList: true });
}
}
function restoreMetaThemeColor() {
if (observer) {
observer.disconnect();
observer = null;
}
var meta = document.querySelector(metaThemeColorSelector);
if (meta && srcMetaThemeColor) {
meta.content = srcMetaThemeColor;
}
}
var themeCacheKeys = [
"mode",
"brightness",
"contrast",
"grayscale",
"sepia",
"darkSchemeBackgroundColor",
"darkSchemeTextColor",
"lightSchemeBackgroundColor",
"lightSchemeTextColor"
];
function getThemeKey(theme) {
return themeCacheKeys.map(function(p) {
return p + ":" + theme[p];
}).join(";");
}
var asyncQueue = createAsyncTasksQueue();
function createStyleSheetModifier() {
var renderId = 0;
var rulesTextCache = /* @__PURE__ */ new Set();
var rulesModCache = /* @__PURE__ */ new Map();
var varTypeChangeCleaners = /* @__PURE__ */ new Set();
var prevFilterKey = null;
var hasNonLoadedLink = false;
var wasRebuilt = false;
function shouldRebuildStyle() {
return hasNonLoadedLink && !wasRebuilt;
}
function modifySheet(options) {
var rules2 = options.sourceCSSRules;
var theme = options.theme, ignoreImageAnalysis = options.ignoreImageAnalysis, force = options.force, prepareSheet = options.prepareSheet, isAsyncCancelled = options.isAsyncCancelled;
var rulesChanged = rulesModCache.size === 0;
var notFoundCacheKeys = new Set(rulesModCache.keys());
var themeKey = getThemeKey(theme);
var themeChanged = themeKey !== prevFilterKey;
if (hasNonLoadedLink) {
wasRebuilt = true;
}
var modRules = [];
iterateCSSRules(rules2, function(rule) {
var cssText = rule.cssText;
var textDiffersFromPrev = false;
notFoundCacheKeys.delete(cssText);
if (rule.parentRule instanceof CSSMediaRule) {
cssText += ";" + rule.parentRule.media.mediaText;
}
if (!rulesTextCache.has(cssText)) {
rulesTextCache.add(cssText);
textDiffersFromPrev = true;
}
if (textDiffersFromPrev) {
rulesChanged = true;
} else {
modRules.push(rulesModCache.get(cssText));
return;
}
var modDecs = [];
rule.style && iterateCSSDeclarations(rule.style, function(property, value) {
var mod = getModifiableCSSDeclaration(property, value, rule, variablesStore, ignoreImageAnalysis, isAsyncCancelled);
if (mod) {
modDecs.push(mod);
}
});
var modRule = null;
if (modDecs.length > 0) {
var parentRule = rule.parentRule;
modRule = { selector: rule.selectorText, declarations: modDecs, parentRule };
modRules.push(modRule);
}
rulesModCache.set(cssText, modRule);
}, function() {
hasNonLoadedLink = true;
});
notFoundCacheKeys.forEach(function(key) {
rulesTextCache.delete(key);
rulesModCache.delete(key);
});
prevFilterKey = themeKey;
if (!force && !rulesChanged && !themeChanged) {
return;
}
renderId++;
function setRule(target, index2, rule) {
var selector = rule.selector, declarations = rule.declarations;
var getDeclarationText = function(dec) {
var property = dec.property, value = dec.value, important = dec.important, sourceValue = dec.sourceValue;
return property + ": " + (value == null ? sourceValue : value) + (important ? " !important" : "") + ";";
};
var cssRulesText = "";
declarations.forEach(function(declarations2) {
cssRulesText += getDeclarationText(declarations2) + " ";
});
var ruleText = selector + " { " + cssRulesText + " }";
target.insertRule(ruleText, index2);
}
var asyncDeclarations = /* @__PURE__ */ new Map();
var varDeclarations = /* @__PURE__ */ new Map();
var asyncDeclarationCounter = 0;
var varDeclarationCounter = 0;
var rootReadyGroup = { rule: null, rules: [], isGroup: true };
var groupRefs = /* @__PURE__ */ new WeakMap();
function getGroup(rule) {
if (rule == null) {
return rootReadyGroup;
}
if (groupRefs.has(rule)) {
return groupRefs.get(rule);
}
var group = { rule, rules: [], isGroup: true };
groupRefs.set(rule, group);
var parentGroup = getGroup(rule.parentRule);
parentGroup.rules.push(group);
return group;
}
varTypeChangeCleaners.forEach(function(clear2) {
return clear2();
});
varTypeChangeCleaners.clear();
modRules.filter(function(r) {
return r;
}).forEach(function(_a2) {
var selector = _a2.selector, declarations = _a2.declarations, parentRule = _a2.parentRule;
var group = getGroup(parentRule);
var readyStyleRule = { selector, declarations: [], isGroup: false };
var readyDeclarations = readyStyleRule.declarations;
group.rules.push(readyStyleRule);
function handleAsyncDeclaration(property, modified, important, sourceValue) {
var asyncKey = ++asyncDeclarationCounter;
var asyncDeclaration = { property, value: null, important, asyncKey, sourceValue };
readyDeclarations.push(asyncDeclaration);
var currentRenderId = renderId;
modified.then(function(asyncValue) {
if (!asyncValue || isAsyncCancelled() || currentRenderId !== renderId) {
return;
}
asyncDeclaration.value = asyncValue;
asyncQueue.add(function() {
if (isAsyncCancelled() || currentRenderId !== renderId) {
return;
}
rebuildAsyncRule(asyncKey);
});
});
}
function handleVarDeclarations(property, modified, important, sourceValue) {
var _a3 = modified, varDecs = _a3.declarations, onTypeChange = _a3.onTypeChange;
var varKey = ++varDeclarationCounter;
var currentRenderId = renderId;
var initialIndex = readyDeclarations.length;
var oldDecs = [];
if (varDecs.length === 0) {
var tempDec = { property, value: sourceValue, important, sourceValue, varKey };
readyDeclarations.push(tempDec);
oldDecs = [tempDec];
}
varDecs.forEach(function(mod) {
if (mod.value instanceof Promise) {
handleAsyncDeclaration(mod.property, mod.value, important, sourceValue);
} else {
var readyDec = { property: mod.property, value: mod.value, important, sourceValue, varKey };
readyDeclarations.push(readyDec);
oldDecs.push(readyDec);
}
});
onTypeChange.addListener(function(newDecs) {
if (isAsyncCancelled() || currentRenderId !== renderId) {
return;
}
var readyVarDecs = newDecs.map(function(mod) {
return { property: mod.property, value: mod.value, important, sourceValue, varKey };
});
var index2 = readyDeclarations.indexOf(oldDecs[0], initialIndex);
readyDeclarations.splice.apply(readyDeclarations, __spreadArray([index2, oldDecs.length], __read(readyVarDecs), false));
oldDecs = readyVarDecs;
rebuildVarRule(varKey);
});
varTypeChangeCleaners.add(function() {
return onTypeChange.removeListeners();
});
}
declarations.forEach(function(_a3) {
var property = _a3.property, value = _a3.value, important = _a3.important, sourceValue = _a3.sourceValue;
if (typeof value === "function") {
var modified = value(theme);
if (modified instanceof Promise) {
handleAsyncDeclaration(property, modified, important, sourceValue);
} else if (property.startsWith("--")) {
handleVarDeclarations(property, modified, important, sourceValue);
} else {
readyDeclarations.push({ property, value: modified, important, sourceValue });
}
} else {
readyDeclarations.push({ property, value, important, sourceValue });
}
});
});
var sheet = prepareSheet();
function buildStyleSheet() {
function createTarget(group, parent) {
var rule = group.rule;
if (rule instanceof CSSMediaRule) {
var media = rule.media;
var index2 = parent.cssRules.length;
parent.insertRule("@media " + media.mediaText + " {}", index2);
return parent.cssRules[index2];
}
return parent;
}
function iterateReadyRules(group, target, styleIterator) {
group.rules.forEach(function(r) {
if (r.isGroup) {
var t = createTarget(r, target);
iterateReadyRules(r, t, styleIterator);
} else {
styleIterator(r, target);
}
});
}
iterateReadyRules(rootReadyGroup, sheet, function(rule, target) {
var index2 = target.cssRules.length;
rule.declarations.forEach(function(_a2) {
var asyncKey = _a2.asyncKey, varKey = _a2.varKey;
if (asyncKey != null) {
asyncDeclarations.set(asyncKey, { rule, target, index: index2 });
}
if (varKey != null) {
varDeclarations.set(varKey, { rule, target, index: index2 });
}
});
setRule(target, index2, rule);
});
}
function rebuildAsyncRule(key) {
var _a2 = asyncDeclarations.get(key), rule = _a2.rule, target = _a2.target, index2 = _a2.index;
target.deleteRule(index2);
setRule(target, index2, rule);
asyncDeclarations.delete(key);
}
function rebuildVarRule(key) {
var _a2 = varDeclarations.get(key), rule = _a2.rule, target = _a2.target, index2 = _a2.index;
target.deleteRule(index2);
setRule(target, index2, rule);
}
buildStyleSheet();
}
return { modifySheet, shouldRebuildStyle };
}
var STYLE_SELECTOR = 'style, link[rel*="stylesheet" i]:not([disabled])';
function shouldManageStyle(element) {
return (element instanceof HTMLStyleElement || element instanceof SVGStyleElement || element instanceof HTMLLinkElement && element.rel && element.rel.toLowerCase().includes("stylesheet") && !element.disabled && (isFirefox ? !element.href.startsWith("moz-extension://") : true)) && !element.classList.contains("darkreader") && element.media.toLowerCase() !== "print" && !element.classList.contains("stylus");
}
function getManageableStyles(node, results, deep) {
if (results === void 0) {
results = [];
}
if (deep === void 0) {
deep = true;
}
if (shouldManageStyle(node)) {
results.push(node);
} else if (node instanceof Element || isShadowDomSupported && node instanceof ShadowRoot || node === document) {
forEach2(node.querySelectorAll(STYLE_SELECTOR), function(style) {
return getManageableStyles(style, results, false);
});
if (deep) {
iterateShadowHosts(node, function(host) {
return getManageableStyles(host.shadowRoot, results, false);
});
}
}
return results;
}
var syncStyleSet = /* @__PURE__ */ new WeakSet();
var corsStyleSet = /* @__PURE__ */ new WeakSet();
var canOptimizeUsingProxy$1 = false;
if (typeof document !== "undefined") {
document.addEventListener("__darkreader__inlineScriptsAllowed", function() {
canOptimizeUsingProxy$1 = true;
});
}
var loadingLinkCounter = 0;
var rejectorsForLoadingLinks = /* @__PURE__ */ new Map();
function cleanLoadingLinks() {
rejectorsForLoadingLinks.clear();
}
function manageStyle(element, _a2) {
var update = _a2.update, loadingStart = _a2.loadingStart, loadingEnd = _a2.loadingEnd;
var prevStyles = [];
var next = element;
while ((next = next.nextElementSibling) && next.matches(".darkreader")) {
prevStyles.push(next);
}
var corsCopy = prevStyles.find(function(el) {
return el.matches(".darkreader--cors") && !corsStyleSet.has(el);
}) || null;
var syncStyle = prevStyles.find(function(el) {
return el.matches(".darkreader--sync") && !syncStyleSet.has(el);
}) || null;
var corsCopyPositionWatcher = null;
var syncStylePositionWatcher = null;
var cancelAsyncOperations = false;
var isOverrideEmpty = true;
var sheetModifier = createStyleSheetModifier();
var observer2 = new MutationObserver(function() {
update();
});
var observerOptions = { attributes: true, childList: true, subtree: true, characterData: true };
function containsCSSImport() {
return element instanceof HTMLStyleElement && element.textContent.trim().match(cssImportRegex);
}
function hasImports(cssRules, checkCrossOrigin) {
var result = false;
if (cssRules) {
var rule = void 0;
cssRulesLoop:
for (var i = 0, len = cssRules.length; i < len; i++) {
rule = cssRules[i];
if (rule.href) {
if (checkCrossOrigin) {
if (rule.href.startsWith("http") && !rule.href.startsWith(location.origin)) {
result = true;
break cssRulesLoop;
}
} else {
result = true;
break cssRulesLoop;
}
}
}
}
return result;
}
function getRulesSync() {
if (corsCopy) {
return corsCopy.sheet.cssRules;
}
if (containsCSSImport()) {
return null;
}
var cssRules = safeGetSheetRules();
if (element instanceof HTMLLinkElement && !isRelativeHrefOnAbsolutePath(element.href) && hasImports(cssRules, false)) {
return null;
}
if (hasImports(cssRules, true)) {
return null;
}
return cssRules;
}
function insertStyle() {
if (corsCopy) {
if (element.nextSibling !== corsCopy) {
element.parentNode.insertBefore(corsCopy, element.nextSibling);
}
if (corsCopy.nextSibling !== syncStyle) {
element.parentNode.insertBefore(syncStyle, corsCopy.nextSibling);
}
} else if (element.nextSibling !== syncStyle) {
element.parentNode.insertBefore(syncStyle, element.nextSibling);
}
}
function createSyncStyle() {
syncStyle = element instanceof SVGStyleElement ? document.createElementNS("http://www.w3.org/2000/svg", "style") : document.createElement("style");
syncStyle.classList.add("darkreader");
syncStyle.classList.add("darkreader--sync");
syncStyle.media = "screen";
if (!isChromium && element.title) {
syncStyle.title = element.title;
}
syncStyleSet.add(syncStyle);
}
var isLoadingRules = false;
var wasLoadingError = false;
var loadingLinkId = ++loadingLinkCounter;
function getRulesAsync() {
return __awaiter(this, void 0, void 0, function() {
var cssText, cssBasePath, _a3, cssRules, accessError, fullCSSText;
var _b;
return __generator(this, function(_c) {
switch (_c.label) {
case 0:
if (!(element instanceof HTMLLinkElement))
return [3, 7];
_a3 = __read(getRulesOrError(), 2), cssRules = _a3[0], accessError = _a3[1];
if (!(!cssRules && !accessError && !isSafari || isSafari && !element.sheet || isStillLoadingError(accessError)))
return [3, 5];
_c.label = 1;
case 1:
_c.trys.push([1, 3, , 4]);
return [4, linkLoading(element, loadingLinkId)];
case 2:
_c.sent();
return [3, 4];
case 3:
_c.sent();
wasLoadingError = true;
return [3, 4];
case 4:
if (cancelAsyncOperations) {
return [2, null];
}
_b = __read(getRulesOrError(), 2), cssRules = _b[0], accessError = _b[1];
_c.label = 5;
case 5:
if (cssRules) {
if (!hasImports(cssRules, false)) {
return [2, cssRules];
}
}
return [4, loadText(element.href)];
case 6:
cssText = _c.sent();
cssBasePath = getCSSBaseBath(element.href);
if (cancelAsyncOperations) {
return [2, null];
}
return [3, 8];
case 7:
if (containsCSSImport()) {
cssText = element.textContent.trim();
cssBasePath = getCSSBaseBath(location.href);
} else {
return [2, null];
}
_c.label = 8;
case 8:
if (!cssText)
return [3, 13];
_c.label = 9;
case 9:
_c.trys.push([9, 11, , 12]);
return [4, replaceCSSImports(cssText, cssBasePath)];
case 10:
fullCSSText = _c.sent();
corsCopy = createCORSCopy(element, fullCSSText);
return [3, 12];
case 11:
_c.sent();
return [3, 12];
case 12:
if (corsCopy) {
corsCopyPositionWatcher = watchForNodePosition(corsCopy, "prev-sibling");
return [2, corsCopy.sheet.cssRules];
}
_c.label = 13;
case 13:
return [2, null];
}
});
});
}
function details(options) {
var rules2 = getRulesSync();
if (!rules2) {
if (options.secondRound) {
return null;
}
if (isLoadingRules || wasLoadingError) {
return null;
}
isLoadingRules = true;
loadingStart();
getRulesAsync().then(function(results) {
isLoadingRules = false;
loadingEnd();
if (results) {
update();
}
}).catch(function(err) {
isLoadingRules = false;
loadingEnd();
});
return null;
}
return { rules: rules2 };
}
var forceRenderStyle = false;
function render3(theme, ignoreImageAnalysis) {
var rules2 = getRulesSync();
if (!rules2) {
return;
}
cancelAsyncOperations = false;
function removeCSSRulesFromSheet(sheet) {
try {
if (sheet.replaceSync) {
sheet.replaceSync("");
return;
}
} catch (err) {
}
for (var i = sheet.cssRules.length - 1; i >= 0; i--) {
sheet.deleteRule(i);
}
}
function prepareOverridesSheet() {
if (!syncStyle) {
createSyncStyle();
}
syncStylePositionWatcher && syncStylePositionWatcher.stop();
insertStyle();
if (syncStyle.sheet == null) {
syncStyle.textContent = "";
}
var sheet = syncStyle.sheet;
removeCSSRulesFromSheet(sheet);
if (syncStylePositionWatcher) {
syncStylePositionWatcher.run();
} else {
syncStylePositionWatcher = watchForNodePosition(syncStyle, "prev-sibling", function() {
forceRenderStyle = true;
buildOverrides();
});
}
return syncStyle.sheet;
}
function buildOverrides() {
var force = forceRenderStyle;
forceRenderStyle = false;
sheetModifier.modifySheet({
prepareSheet: prepareOverridesSheet,
sourceCSSRules: rules2,
theme,
ignoreImageAnalysis,
force,
isAsyncCancelled: function() {
return cancelAsyncOperations;
}
});
isOverrideEmpty = syncStyle.sheet.cssRules.length === 0;
if (sheetModifier.shouldRebuildStyle()) {
addReadyStateCompleteListener(function() {
return update();
});
}
}
buildOverrides();
}
function getRulesOrError() {
try {
if (element.sheet == null) {
return [null, null];
}
return [element.sheet.cssRules, null];
} catch (err) {
return [null, err];
}
}
function isStillLoadingError(error) {
return error && error.message && error.message.includes("loading");
}
function safeGetSheetRules() {
var _a3 = __read(getRulesOrError(), 2), cssRules = _a3[0], err = _a3[1];
if (err) {
return null;
}
return cssRules;
}
function watchForSheetChanges() {
watchForSheetChangesUsingProxy();
if (!isThunderbird && !(canOptimizeUsingProxy$1 && element.sheet)) {
watchForSheetChangesUsingRAF();
}
}
var rulesChangeKey = null;
var rulesCheckFrameId = null;
function getRulesChangeKey() {
var rules2 = safeGetSheetRules();
return rules2 ? rules2.length : null;
}
function didRulesKeyChange() {
return getRulesChangeKey() !== rulesChangeKey;
}
function watchForSheetChangesUsingRAF() {
rulesChangeKey = getRulesChangeKey();
stopWatchingForSheetChangesUsingRAF();
var checkForUpdate = function() {
if (didRulesKeyChange()) {
rulesChangeKey = getRulesChangeKey();
update();
}
if (canOptimizeUsingProxy$1 && element.sheet) {
stopWatchingForSheetChangesUsingRAF();
return;
}
rulesCheckFrameId = requestAnimationFrame(checkForUpdate);
};
checkForUpdate();
}
function stopWatchingForSheetChangesUsingRAF() {
cancelAnimationFrame(rulesCheckFrameId);
}
var areSheetChangesPending = false;
function onSheetChange() {
canOptimizeUsingProxy$1 = true;
stopWatchingForSheetChangesUsingRAF();
if (areSheetChangesPending) {
return;
}
function handleSheetChanges() {
areSheetChangesPending = false;
if (cancelAsyncOperations) {
return;
}
update();
}
areSheetChangesPending = true;
if (typeof queueMicrotask === "function") {
queueMicrotask(handleSheetChanges);
} else {
requestAnimationFrame(handleSheetChanges);
}
}
function watchForSheetChangesUsingProxy() {
element.addEventListener("__darkreader__updateSheet", onSheetChange);
}
function stopWatchingForSheetChangesUsingProxy() {
element.removeEventListener("__darkreader__updateSheet", onSheetChange);
}
function stopWatchingForSheetChanges() {
stopWatchingForSheetChangesUsingProxy();
stopWatchingForSheetChangesUsingRAF();
}
function pause() {
observer2.disconnect();
cancelAsyncOperations = true;
corsCopyPositionWatcher && corsCopyPositionWatcher.stop();
syncStylePositionWatcher && syncStylePositionWatcher.stop();
stopWatchingForSheetChanges();
}
function destroy2() {
pause();
removeNode(corsCopy);
removeNode(syncStyle);
loadingEnd();
if (rejectorsForLoadingLinks.has(loadingLinkId)) {
var reject = rejectorsForLoadingLinks.get(loadingLinkId);
rejectorsForLoadingLinks.delete(loadingLinkId);
reject && reject();
}
}
function watch2() {
observer2.observe(element, observerOptions);
if (element instanceof HTMLStyleElement) {
watchForSheetChanges();
}
}
var maxMoveCount = 10;
var moveCount = 0;
function restore() {
if (!syncStyle) {
return;
}
moveCount++;
if (moveCount > maxMoveCount) {
return;
}
insertStyle();
corsCopyPositionWatcher && corsCopyPositionWatcher.skip();
syncStylePositionWatcher && syncStylePositionWatcher.skip();
if (!isOverrideEmpty) {
forceRenderStyle = true;
update();
}
}
return {
details,
render: render3,
pause,
destroy: destroy2,
watch: watch2,
restore
};
}
function linkLoading(link, loadingId) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
return [2, new Promise(function(resolve, reject) {
var cleanUp = function() {
link.removeEventListener("load", onLoad);
link.removeEventListener("error", onError);
rejectorsForLoadingLinks.delete(loadingId);
};
var onLoad = function() {
cleanUp();
resolve();
};
var onError = function() {
cleanUp();
reject("Linkelement " + loadingId + " couldn't be loaded. " + link.href);
};
rejectorsForLoadingLinks.set(loadingId, function() {
cleanUp();
reject();
});
link.addEventListener("load", onLoad);
link.addEventListener("error", onError);
if (!link.href) {
onError();
}
})];
});
});
}
function getCSSImportURL(importDeclaration) {
return getCSSURLValue(importDeclaration.substring(7).trim().replace(/;$/, "").replace(/screen$/, ""));
}
function loadText(url2) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
if (!url2.startsWith("data:"))
return [3, 3];
return [4, fetch(url2)];
case 1:
return [4, _a2.sent().text()];
case 2:
return [2, _a2.sent()];
case 3:
return [4, bgFetch({ url: url2, responseType: "text", mimeType: "text/css", origin: window.location.origin })];
case 4:
return [2, _a2.sent()];
}
});
});
}
function replaceCSSImports(cssText, basePath, cache2) {
if (cache2 === void 0) {
cache2 = /* @__PURE__ */ new Map();
}
return __awaiter(this, void 0, void 0, function() {
var importMatches, importMatches_1, importMatches_1_1, match, importURL, absoluteURL, importedCSS, e_1_1;
var e_1, _a2;
return __generator(this, function(_b) {
switch (_b.label) {
case 0:
cssText = removeCSSComments(cssText);
cssText = replaceCSSFontFace(cssText);
cssText = replaceCSSRelativeURLsWithAbsolute(cssText, basePath);
importMatches = getMatches(cssImportRegex, cssText);
_b.label = 1;
case 1:
_b.trys.push([1, 10, 11, 12]);
importMatches_1 = __values(importMatches), importMatches_1_1 = importMatches_1.next();
_b.label = 2;
case 2:
if (!!importMatches_1_1.done)
return [3, 9];
match = importMatches_1_1.value;
importURL = getCSSImportURL(match);
absoluteURL = getAbsoluteURL(basePath, importURL);
importedCSS = void 0;
if (!cache2.has(absoluteURL))
return [3, 3];
importedCSS = cache2.get(absoluteURL);
return [3, 7];
case 3:
_b.trys.push([3, 6, , 7]);
return [4, loadText(absoluteURL)];
case 4:
importedCSS = _b.sent();
cache2.set(absoluteURL, importedCSS);
return [4, replaceCSSImports(importedCSS, getCSSBaseBath(absoluteURL), cache2)];
case 5:
importedCSS = _b.sent();
return [3, 7];
case 6:
_b.sent();
importedCSS = "";
return [3, 7];
case 7:
cssText = cssText.split(match).join(importedCSS);
_b.label = 8;
case 8:
importMatches_1_1 = importMatches_1.next();
return [3, 2];
case 9:
return [3, 12];
case 10:
e_1_1 = _b.sent();
e_1 = { error: e_1_1 };
return [3, 12];
case 11:
try {
if (importMatches_1_1 && !importMatches_1_1.done && (_a2 = importMatches_1.return))
_a2.call(importMatches_1);
} finally {
if (e_1)
throw e_1.error;
}
return [7];
case 12:
cssText = cssText.trim();
return [2, cssText];
}
});
});
}
function createCORSCopy(srcElement, cssText) {
if (!cssText) {
return null;
}
var cors = document.createElement("style");
cors.classList.add("darkreader");
cors.classList.add("darkreader--cors");
cors.media = "screen";
cors.textContent = cssText;
srcElement.parentNode.insertBefore(cors, srcElement.nextSibling);
cors.sheet.disabled = true;
corsStyleSet.add(cors);
return cors;
}
var observers = [];
var observedRoots;
var undefinedGroups = /* @__PURE__ */ new Map();
var elementsDefinitionCallback;
function collectUndefinedElements(root) {
if (!isDefinedSelectorSupported) {
return;
}
forEach2(root.querySelectorAll(":not(:defined)"), function(el) {
var tag = el.tagName.toLowerCase();
if (!tag.includes("-")) {
var extendedTag = el.getAttribute("is");
if (extendedTag) {
tag = extendedTag;
} else {
return;
}
}
if (!undefinedGroups.has(tag)) {
undefinedGroups.set(tag, /* @__PURE__ */ new Set());
customElementsWhenDefined(tag).then(function() {
if (elementsDefinitionCallback) {
var elements = undefinedGroups.get(tag);
undefinedGroups.delete(tag);
elementsDefinitionCallback(Array.from(elements));
}
});
}
undefinedGroups.get(tag).add(el);
});
}
var canOptimizeUsingProxy = false;
if (typeof document !== "undefined") {
document.addEventListener("__darkreader__inlineScriptsAllowed", function() {
canOptimizeUsingProxy = true;
});
}
var resolvers = /* @__PURE__ */ new Map();
function handleIsDefined(e) {
canOptimizeUsingProxy = true;
if (resolvers.has(e.detail.tag)) {
var resolve = resolvers.get(e.detail.tag);
resolve();
}
}
function customElementsWhenDefined(tag) {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
return [2, new Promise(function(resolve) {
if (window.customElements && typeof customElements.whenDefined === "function") {
customElements.whenDefined(tag).then(function() {
return resolve();
});
} else if (canOptimizeUsingProxy) {
resolvers.set(tag, resolve);
document.dispatchEvent(new CustomEvent("__darkreader__addUndefinedResolver", { detail: { tag } }));
} else {
var checkIfDefined_1 = function() {
var elements = undefinedGroups.get(tag);
if (elements && elements.size > 0) {
if (elements.values().next().value.matches(":defined")) {
resolve();
} else {
requestAnimationFrame(checkIfDefined_1);
}
}
};
requestAnimationFrame(checkIfDefined_1);
}
})];
});
});
}
function watchWhenCustomElementsDefined(callback) {
elementsDefinitionCallback = callback;
}
function unsubscribeFromDefineCustomElements() {
elementsDefinitionCallback = null;
undefinedGroups.clear();
document.removeEventListener("__darkreader__isDefined", handleIsDefined);
}
function watchForStyleChanges(currentStyles, update, shadowRootDiscovered) {
stopWatchingForStyleChanges();
var prevStyles = new Set(currentStyles);
var prevStyleSiblings = /* @__PURE__ */ new WeakMap();
var nextStyleSiblings = /* @__PURE__ */ new WeakMap();
function saveStylePosition(style) {
prevStyleSiblings.set(style, style.previousElementSibling);
nextStyleSiblings.set(style, style.nextElementSibling);
}
function forgetStylePosition(style) {
prevStyleSiblings.delete(style);
nextStyleSiblings.delete(style);
}
function didStylePositionChange(style) {
return style.previousElementSibling !== prevStyleSiblings.get(style) || style.nextElementSibling !== nextStyleSiblings.get(style);
}
currentStyles.forEach(saveStylePosition);
function handleStyleOperations(operations) {
var createdStyles = operations.createdStyles, removedStyles = operations.removedStyles, movedStyles = operations.movedStyles;
createdStyles.forEach(function(s) {
return saveStylePosition(s);
});
movedStyles.forEach(function(s) {
return saveStylePosition(s);
});
removedStyles.forEach(function(s) {
return forgetStylePosition(s);
});
createdStyles.forEach(function(s) {
return prevStyles.add(s);
});
removedStyles.forEach(function(s) {
return prevStyles.delete(s);
});
if (createdStyles.size + removedStyles.size + movedStyles.size > 0) {
update({
created: Array.from(createdStyles),
removed: Array.from(removedStyles),
moved: Array.from(movedStyles),
updated: []
});
}
}
function handleMinorTreeMutations(_a2) {
var additions = _a2.additions, moves = _a2.moves, deletions = _a2.deletions;
var createdStyles = /* @__PURE__ */ new Set();
var removedStyles = /* @__PURE__ */ new Set();
var movedStyles = /* @__PURE__ */ new Set();
additions.forEach(function(node) {
return getManageableStyles(node).forEach(function(style) {
return createdStyles.add(style);
});
});
deletions.forEach(function(node) {
return getManageableStyles(node).forEach(function(style) {
return removedStyles.add(style);
});
});
moves.forEach(function(node) {
return getManageableStyles(node).forEach(function(style) {
return movedStyles.add(style);
});
});
handleStyleOperations({ createdStyles, removedStyles, movedStyles });
additions.forEach(function(n) {
iterateShadowHosts(n, subscribeForShadowRootChanges);
collectUndefinedElements(n);
});
}
function handleHugeTreeMutations(root) {
var styles = new Set(getManageableStyles(root));
var createdStyles = /* @__PURE__ */ new Set();
var removedStyles = /* @__PURE__ */ new Set();
var movedStyles = /* @__PURE__ */ new Set();
styles.forEach(function(s) {
if (!prevStyles.has(s)) {
createdStyles.add(s);
}
});
prevStyles.forEach(function(s) {
if (!styles.has(s)) {
removedStyles.add(s);
}
});
styles.forEach(function(s) {
if (!createdStyles.has(s) && !removedStyles.has(s) && didStylePositionChange(s)) {
movedStyles.add(s);
}
});
handleStyleOperations({ createdStyles, removedStyles, movedStyles });
iterateShadowHosts(root, subscribeForShadowRootChanges);
collectUndefinedElements(root);
}
function handleAttributeMutations(mutations) {
var updatedStyles = /* @__PURE__ */ new Set();
var removedStyles = /* @__PURE__ */ new Set();
mutations.forEach(function(m) {
var target = m.target;
if (target.isConnected) {
if (shouldManageStyle(target)) {
updatedStyles.add(target);
} else if (target instanceof HTMLLinkElement && target.disabled) {
removedStyles.add(target);
}
}
});
if (updatedStyles.size + removedStyles.size > 0) {
update({
updated: Array.from(updatedStyles),
created: [],
removed: Array.from(removedStyles),
moved: []
});
}
}
function observe(root) {
var treeObserver = createOptimizedTreeObserver(root, {
onMinorMutations: handleMinorTreeMutations,
onHugeMutations: handleHugeTreeMutations
});
var attrObserver = new MutationObserver(handleAttributeMutations);
attrObserver.observe(root, { attributes: true, attributeFilter: ["rel", "disabled", "media"], subtree: true });
observers.push(treeObserver, attrObserver);
observedRoots.add(root);
}
function subscribeForShadowRootChanges(node) {
var shadowRoot = node.shadowRoot;
if (shadowRoot == null || observedRoots.has(shadowRoot)) {
return;
}
observe(shadowRoot);
shadowRootDiscovered(shadowRoot);
}
observe(document);
iterateShadowHosts(document.documentElement, subscribeForShadowRootChanges);
watchWhenCustomElementsDefined(function(hosts) {
var newStyles = [];
hosts.forEach(function(host) {
return push(newStyles, getManageableStyles(host.shadowRoot));
});
update({ created: newStyles, updated: [], removed: [], moved: [] });
hosts.forEach(function(host) {
var shadowRoot = host.shadowRoot;
if (shadowRoot == null) {
return;
}
subscribeForShadowRootChanges(host);
iterateShadowHosts(shadowRoot, subscribeForShadowRootChanges);
collectUndefinedElements(shadowRoot);
});
});
document.addEventListener("__darkreader__isDefined", handleIsDefined);
collectUndefinedElements(document);
}
function resetObservers() {
observers.forEach(function(o) {
return o.disconnect();
});
observers.splice(0, observers.length);
observedRoots = /* @__PURE__ */ new WeakSet();
}
function stopWatchingForStyleChanges() {
resetObservers();
unsubscribeFromDefineCustomElements();
}
function hexify(number4) {
return (number4 < 16 ? "0" : "") + number4.toString(16);
}
function generateUID() {
if (typeof crypto === "undefined")
return "xxx-xxxx";
if ("randomUUID" in crypto) {
var uuid = crypto.randomUUID();
return uuid.substring(0, 8) + uuid.substring(9, 13) + uuid.substring(14, 18) + uuid.substring(19, 23) + uuid.substring(24);
}
return Array.from(crypto.getRandomValues(new Uint8Array(16))).map(function(x) {
return hexify(x);
}).join("");
}
var adoptedStyleOverrides = /* @__PURE__ */ new WeakMap();
var overrideList = /* @__PURE__ */ new WeakSet();
function createAdoptedStyleSheetOverride(node) {
var cancelAsyncOperations = false;
function injectSheet(sheet, override) {
var newSheets = __spreadArray([], __read(node.adoptedStyleSheets), false);
var sheetIndex = newSheets.indexOf(sheet);
var existingIndex = newSheets.indexOf(override);
if (sheetIndex === existingIndex - 1) {
return;
}
if (existingIndex >= 0) {
newSheets.splice(existingIndex, 1);
}
newSheets.splice(sheetIndex + 1, 0, override);
node.adoptedStyleSheets = newSheets;
}
function destroy2() {
cancelAsyncOperations = true;
var newSheets = __spreadArray([], __read(node.adoptedStyleSheets), false);
node.adoptedStyleSheets.forEach(function(adoptedStyleSheet) {
if (overrideList.has(adoptedStyleSheet)) {
var existingIndex = newSheets.indexOf(adoptedStyleSheet);
if (existingIndex >= 0) {
newSheets.splice(existingIndex, 1);
}
adoptedStyleOverrides.delete(adoptedStyleSheet);
overrideList.delete(adoptedStyleSheet);
}
});
node.adoptedStyleSheets = newSheets;
}
function render3(theme, ignoreImageAnalysis) {
node.adoptedStyleSheets.forEach(function(sheet) {
if (overrideList.has(sheet)) {
return;
}
var rules2 = sheet.rules;
var override = new CSSStyleSheet();
function prepareOverridesSheet() {
for (var i = override.cssRules.length - 1; i >= 0; i--) {
override.deleteRule(i);
}
injectSheet(sheet, override);
adoptedStyleOverrides.set(sheet, override);
overrideList.add(override);
return override;
}
var sheetModifier = createStyleSheetModifier();
sheetModifier.modifySheet({
prepareSheet: prepareOverridesSheet,
sourceCSSRules: rules2,
theme,
ignoreImageAnalysis,
force: false,
isAsyncCancelled: function() {
return cancelAsyncOperations;
}
});
});
}
return {
render: render3,
destroy: destroy2
};
}
function injectProxy(enableStyleSheetsProxy) {
document.dispatchEvent(new CustomEvent("__darkreader__inlineScriptsAllowed"));
var addRuleDescriptor = Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype, "addRule");
var insertRuleDescriptor = Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype, "insertRule");
var deleteRuleDescriptor = Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype, "deleteRule");
var removeRuleDescriptor = Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype, "removeRule");
var documentStyleSheetsDescriptor = enableStyleSheetsProxy ? Object.getOwnPropertyDescriptor(Document.prototype, "styleSheets") : null;
var shouldWrapHTMLElement = location.hostname.endsWith("baidu.com");
var getElementsByTagNameDescriptor = shouldWrapHTMLElement ? Object.getOwnPropertyDescriptor(Element.prototype, "getElementsByTagName") : null;
var cleanUp = function() {
Object.defineProperty(CSSStyleSheet.prototype, "addRule", addRuleDescriptor);
Object.defineProperty(CSSStyleSheet.prototype, "insertRule", insertRuleDescriptor);
Object.defineProperty(CSSStyleSheet.prototype, "deleteRule", deleteRuleDescriptor);
Object.defineProperty(CSSStyleSheet.prototype, "removeRule", removeRuleDescriptor);
document.removeEventListener("__darkreader__cleanUp", cleanUp);
document.removeEventListener("__darkreader__addUndefinedResolver", addUndefinedResolver);
if (enableStyleSheetsProxy) {
Object.defineProperty(Document.prototype, "styleSheets", documentStyleSheetsDescriptor);
}
if (shouldWrapHTMLElement) {
Object.defineProperty(Element.prototype, "getElementsByTagName", getElementsByTagNameDescriptor);
}
};
var addUndefinedResolver = function(e) {
customElements.whenDefined(e.detail.tag).then(function() {
document.dispatchEvent(new CustomEvent("__darkreader__isDefined", { detail: { tag: e.detail.tag } }));
});
};
document.addEventListener("__darkreader__cleanUp", cleanUp);
document.addEventListener("__darkreader__addUndefinedResolver", addUndefinedResolver);
var updateSheetEvent = new Event("__darkreader__updateSheet");
function proxyAddRule(selector, style, index2) {
addRuleDescriptor.value.call(this, selector, style, index2);
if (this.ownerNode && !this.ownerNode.classList.contains("darkreader")) {
this.ownerNode.dispatchEvent(updateSheetEvent);
}
return -1;
}
function proxyInsertRule(rule, index2) {
var returnValue = insertRuleDescriptor.value.call(this, rule, index2);
if (this.ownerNode && !this.ownerNode.classList.contains("darkreader")) {
this.ownerNode.dispatchEvent(updateSheetEvent);
}
return returnValue;
}
function proxyDeleteRule(index2) {
deleteRuleDescriptor.value.call(this, index2);
if (this.ownerNode && !this.ownerNode.classList.contains("darkreader")) {
this.ownerNode.dispatchEvent(updateSheetEvent);
}
}
function proxyRemoveRule(index2) {
removeRuleDescriptor.value.call(this, index2);
if (this.ownerNode && !this.ownerNode.classList.contains("darkreader")) {
this.ownerNode.dispatchEvent(updateSheetEvent);
}
}
function proxyDocumentStyleSheets() {
var docSheets = documentStyleSheetsDescriptor.get.call(this);
var filtered = __spreadArray([], __read(docSheets), false).filter(function(styleSheet) {
return !styleSheet.ownerNode.classList.contains("darkreader");
});
return Object.setPrototypeOf(filtered, StyleSheetList.prototype);
}
function proxyGetElementsByTagName(tagName) {
var _this = this;
if (tagName !== "style") {
return getElementsByTagNameDescriptor.value.call(this, tagName);
}
var getCurrentElementValue = function() {
var elements2 = getElementsByTagNameDescriptor.value.call(_this, tagName);
return Object.setPrototypeOf(__spreadArray([], __read(elements2), false).filter(function(element) {
return !element.classList.contains("darkreader");
}), NodeList.prototype);
};
var elements = getCurrentElementValue();
var NodeListBehavior = {
get: function(_, property) {
return getCurrentElementValue()[Number(property)];
}
};
elements = new Proxy(elements, NodeListBehavior);
return elements;
}
Object.defineProperty(CSSStyleSheet.prototype, "addRule", Object.assign({}, addRuleDescriptor, { value: proxyAddRule }));
Object.defineProperty(CSSStyleSheet.prototype, "insertRule", Object.assign({}, insertRuleDescriptor, { value: proxyInsertRule }));
Object.defineProperty(CSSStyleSheet.prototype, "deleteRule", Object.assign({}, deleteRuleDescriptor, { value: proxyDeleteRule }));
Object.defineProperty(CSSStyleSheet.prototype, "removeRule", Object.assign({}, removeRuleDescriptor, { value: proxyRemoveRule }));
if (enableStyleSheetsProxy) {
Object.defineProperty(Document.prototype, "styleSheets", Object.assign({}, documentStyleSheetsDescriptor, { get: proxyDocumentStyleSheets }));
}
if (shouldWrapHTMLElement) {
Object.defineProperty(Element.prototype, "getElementsByTagName", Object.assign({}, getElementsByTagNameDescriptor, { value: proxyGetElementsByTagName }));
}
}
var INSTANCE_ID = generateUID();
var styleManagers = /* @__PURE__ */ new Map();
var adoptedStyleManagers = [];
var filter = null;
var fixes = null;
var isIFrame$1 = null;
var ignoredImageAnalysisSelectors = null;
var ignoredInlineSelectors = null;
function createOrUpdateStyle(className, root) {
if (root === void 0) {
root = document.head || document;
}
var element = root.querySelector("." + className);
if (!element) {
element = document.createElement("style");
element.classList.add("darkreader");
element.classList.add(className);
element.media = "screen";
element.textContent = "";
}
return element;
}
function createOrUpdateScript(className, root) {
if (root === void 0) {
root = document.head || document;
}
var element = root.querySelector("." + className);
if (!element) {
element = document.createElement("script");
element.classList.add("darkreader");
element.classList.add(className);
}
return element;
}
var nodePositionWatchers = /* @__PURE__ */ new Map();
function setupNodePositionWatcher(node, alias) {
nodePositionWatchers.has(alias) && nodePositionWatchers.get(alias).stop();
nodePositionWatchers.set(alias, watchForNodePosition(node, "parent"));
}
function stopStylePositionWatchers() {
forEach2(nodePositionWatchers.values(), function(watcher) {
return watcher.stop();
});
nodePositionWatchers.clear();
}
function createStaticStyleOverrides() {
var fallbackStyle = createOrUpdateStyle("darkreader--fallback", document);
fallbackStyle.textContent = getModifiedFallbackStyle(filter, { strict: true });
document.head.insertBefore(fallbackStyle, document.head.firstChild);
setupNodePositionWatcher(fallbackStyle, "fallback");
var userAgentStyle = createOrUpdateStyle("darkreader--user-agent");
userAgentStyle.textContent = getModifiedUserAgentStyle(filter, isIFrame$1, filter.styleSystemControls);
document.head.insertBefore(userAgentStyle, fallbackStyle.nextSibling);
setupNodePositionWatcher(userAgentStyle, "user-agent");
var textStyle = createOrUpdateStyle("darkreader--text");
if (filter.useFont || filter.textStroke > 0) {
textStyle.textContent = createTextStyle(filter);
} else {
textStyle.textContent = "";
}
document.head.insertBefore(textStyle, fallbackStyle.nextSibling);
setupNodePositionWatcher(textStyle, "text");
var invertStyle = createOrUpdateStyle("darkreader--invert");
if (fixes && Array.isArray(fixes.invert) && fixes.invert.length > 0) {
invertStyle.textContent = [
fixes.invert.join(", ") + " {",
" filter: " + getCSSFilterValue(__assign(__assign({}, filter), { contrast: filter.mode === 0 ? filter.contrast : clamp2(filter.contrast - 10, 0, 100) })) + " !important;",
"}"
].join("\n");
} else {
invertStyle.textContent = "";
}
document.head.insertBefore(invertStyle, textStyle.nextSibling);
setupNodePositionWatcher(invertStyle, "invert");
var inlineStyle = createOrUpdateStyle("darkreader--inline");
inlineStyle.textContent = getInlineOverrideStyle();
document.head.insertBefore(inlineStyle, invertStyle.nextSibling);
setupNodePositionWatcher(inlineStyle, "inline");
var overrideStyle = createOrUpdateStyle("darkreader--override");
overrideStyle.textContent = fixes && fixes.css ? replaceCSSTemplates(fixes.css) : "";
document.head.appendChild(overrideStyle);
setupNodePositionWatcher(overrideStyle, "override");
var variableStyle = createOrUpdateStyle("darkreader--variables");
var selectionColors = getSelectionColor(filter);
var darkSchemeBackgroundColor = filter.darkSchemeBackgroundColor, darkSchemeTextColor = filter.darkSchemeTextColor, lightSchemeBackgroundColor = filter.lightSchemeBackgroundColor, lightSchemeTextColor = filter.lightSchemeTextColor, mode = filter.mode;
var schemeBackgroundColor = mode === 0 ? lightSchemeBackgroundColor : darkSchemeBackgroundColor;
var schemeTextColor = mode === 0 ? lightSchemeTextColor : darkSchemeTextColor;
schemeBackgroundColor = modifyBackgroundColor(parse2(schemeBackgroundColor), filter);
schemeTextColor = modifyForegroundColor(parse2(schemeTextColor), filter);
variableStyle.textContent = [
":root {",
" --darkreader-neutral-background: " + schemeBackgroundColor + ";",
" --darkreader-neutral-text: " + schemeTextColor + ";",
" --darkreader-selection-background: " + selectionColors.backgroundColorSelection + ";",
" --darkreader-selection-text: " + selectionColors.foregroundColorSelection + ";",
"}"
].join("\n");
document.head.insertBefore(variableStyle, inlineStyle.nextSibling);
setupNodePositionWatcher(variableStyle, "variables");
var rootVarsStyle = createOrUpdateStyle("darkreader--root-vars");
document.head.insertBefore(rootVarsStyle, variableStyle.nextSibling);
var proxyScript = createOrUpdateScript("darkreader--proxy");
proxyScript.append("(" + injectProxy + ")(!" + (fixes && fixes.disableStyleSheetsProxy) + ")");
document.head.insertBefore(proxyScript, rootVarsStyle.nextSibling);
proxyScript.remove();
}
var shadowRootsWithOverrides = /* @__PURE__ */ new Set();
function createShadowStaticStyleOverrides(root) {
var inlineStyle = createOrUpdateStyle("darkreader--inline", root);
inlineStyle.textContent = getInlineOverrideStyle();
root.insertBefore(inlineStyle, root.firstChild);
var overrideStyle = createOrUpdateStyle("darkreader--override", root);
overrideStyle.textContent = fixes && fixes.css ? replaceCSSTemplates(fixes.css) : "";
root.insertBefore(overrideStyle, inlineStyle.nextSibling);
var invertStyle = createOrUpdateStyle("darkreader--invert", root);
if (fixes && Array.isArray(fixes.invert) && fixes.invert.length > 0) {
invertStyle.textContent = [
fixes.invert.join(", ") + " {",
" filter: " + getCSSFilterValue(__assign(__assign({}, filter), { contrast: filter.mode === 0 ? filter.contrast : clamp2(filter.contrast - 10, 0, 100) })) + " !important;",
"}"
].join("\n");
} else {
invertStyle.textContent = "";
}
root.insertBefore(invertStyle, overrideStyle.nextSibling);
shadowRootsWithOverrides.add(root);
}
function replaceCSSTemplates($cssText) {
return $cssText.replace(/\${(.+?)}/g, function(_, $color) {
var color = tryParseColor($color);
if (color) {
return modifyColor(color, filter);
}
return $color;
});
}
function cleanFallbackStyle() {
var fallback = document.querySelector(".darkreader--fallback");
if (fallback) {
fallback.textContent = "";
}
}
function createDynamicStyleOverrides() {
cancelRendering();
var allStyles = getManageableStyles(document);
var newManagers = allStyles.filter(function(style) {
return !styleManagers.has(style);
}).map(function(style) {
return createManager(style);
});
newManagers.map(function(manager) {
return manager.details({ secondRound: false });
}).filter(function(detail) {
return detail && detail.rules.length > 0;
}).forEach(function(detail) {
variablesStore.addRulesForMatching(detail.rules);
});
variablesStore.matchVariablesAndDependants();
variablesStore.setOnRootVariableChange(function() {
variablesStore.putRootVars(document.head.querySelector(".darkreader--root-vars"), filter);
});
variablesStore.putRootVars(document.head.querySelector(".darkreader--root-vars"), filter);
styleManagers.forEach(function(manager) {
return manager.render(filter, ignoredImageAnalysisSelectors);
});
if (loadingStyles.size === 0) {
cleanFallbackStyle();
}
newManagers.forEach(function(manager) {
return manager.watch();
});
var inlineStyleElements = toArray2(document.querySelectorAll(INLINE_STYLE_SELECTOR));
iterateShadowHosts(document.documentElement, function(host) {
createShadowStaticStyleOverrides(host.shadowRoot);
var elements = host.shadowRoot.querySelectorAll(INLINE_STYLE_SELECTOR);
if (elements.length > 0) {
push(inlineStyleElements, elements);
}
});
inlineStyleElements.forEach(function(el) {
return overrideInlineStyle(el, filter, ignoredInlineSelectors, ignoredImageAnalysisSelectors);
});
handleAdoptedStyleSheets(document);
}
var loadingStylesCounter = 0;
var loadingStyles = /* @__PURE__ */ new Set();
function createManager(element) {
var loadingStyleId = ++loadingStylesCounter;
function loadingStart() {
if (!isDOMReady() || !didDocumentShowUp) {
loadingStyles.add(loadingStyleId);
logInfo("Current amount of styles loading: " + loadingStyles.size);
var fallbackStyle = document.querySelector(".darkreader--fallback");
if (!fallbackStyle.textContent) {
fallbackStyle.textContent = getModifiedFallbackStyle(filter, { strict: false });
}
}
}
function loadingEnd() {
loadingStyles.delete(loadingStyleId);
logInfo("Removed loadingStyle " + loadingStyleId + ", now awaiting: " + loadingStyles.size);
if (loadingStyles.size === 0 && isDOMReady()) {
cleanFallbackStyle();
}
}
function update() {
var details = manager.details({ secondRound: true });
if (!details) {
return;
}
variablesStore.addRulesForMatching(details.rules);
variablesStore.matchVariablesAndDependants();
manager.render(filter, ignoredImageAnalysisSelectors);
}
var manager = manageStyle(element, { update, loadingStart, loadingEnd });
styleManagers.set(element, manager);
return manager;
}
function removeManager(element) {
var manager = styleManagers.get(element);
if (manager) {
manager.destroy();
styleManagers.delete(element);
}
}
var throttledRenderAllStyles = throttle2(function(callback) {
styleManagers.forEach(function(manager) {
return manager.render(filter, ignoredImageAnalysisSelectors);
});
adoptedStyleManagers.forEach(function(manager) {
return manager.render(filter, ignoredImageAnalysisSelectors);
});
callback && callback();
});
var cancelRendering = function() {
throttledRenderAllStyles.cancel();
};
function onDOMReady() {
if (loadingStyles.size === 0) {
cleanFallbackStyle();
return;
}
}
var documentVisibilityListener = null;
var didDocumentShowUp = typeof document !== "undefined" && !document.hidden;
function watchForDocumentVisibility(callback) {
var alreadyWatching = Boolean(documentVisibilityListener);
documentVisibilityListener = function() {
if (!document.hidden) {
stopWatchingForDocumentVisibility();
callback();
didDocumentShowUp = true;
}
};
if (!alreadyWatching) {
document.addEventListener("visibilitychange", documentVisibilityListener);
}
}
function stopWatchingForDocumentVisibility() {
document.removeEventListener("visibilitychange", documentVisibilityListener);
documentVisibilityListener = null;
}
function createThemeAndWatchForUpdates() {
createStaticStyleOverrides();
function runDynamicStyle() {
createDynamicStyleOverrides();
watchForUpdates();
}
if (document.hidden) {
watchForDocumentVisibility(runDynamicStyle);
} else {
runDynamicStyle();
}
changeMetaThemeColorWhenAvailable(filter);
}
function handleAdoptedStyleSheets(node) {
if (Array.isArray(node.adoptedStyleSheets)) {
if (node.adoptedStyleSheets.length > 0) {
var newManger = createAdoptedStyleSheetOverride(node);
adoptedStyleManagers.push(newManger);
newManger.render(filter, ignoredImageAnalysisSelectors);
}
}
}
function watchForUpdates() {
var managedStyles = Array.from(styleManagers.keys());
watchForStyleChanges(managedStyles, function(_a2) {
var created = _a2.created, updated = _a2.updated, removed = _a2.removed, moved = _a2.moved;
var stylesToRemove = removed;
var stylesToManage = created.concat(updated).concat(moved).filter(function(style) {
return !styleManagers.has(style);
});
var stylesToRestore = moved.filter(function(style) {
return styleManagers.has(style);
});
stylesToRemove.forEach(function(style) {
return removeManager(style);
});
var newManagers = stylesToManage.map(function(style) {
return createManager(style);
});
newManagers.map(function(manager) {
return manager.details({ secondRound: false });
}).filter(function(detail) {
return detail && detail.rules.length > 0;
}).forEach(function(detail) {
variablesStore.addRulesForMatching(detail.rules);
});
variablesStore.matchVariablesAndDependants();
newManagers.forEach(function(manager) {
return manager.render(filter, ignoredImageAnalysisSelectors);
});
newManagers.forEach(function(manager) {
return manager.watch();
});
stylesToRestore.forEach(function(style) {
return styleManagers.get(style).restore();
});
}, function(shadowRoot) {
createShadowStaticStyleOverrides(shadowRoot);
handleAdoptedStyleSheets(shadowRoot);
});
watchForInlineStyles(function(element) {
overrideInlineStyle(element, filter, ignoredInlineSelectors, ignoredImageAnalysisSelectors);
if (element === document.documentElement) {
var styleAttr = element.getAttribute("style");
if (styleAttr.includes("--")) {
variablesStore.matchVariablesAndDependants();
variablesStore.putRootVars(document.head.querySelector(".darkreader--root-vars"), filter);
}
}
}, function(root) {
createShadowStaticStyleOverrides(root);
var inlineStyleElements = root.querySelectorAll(INLINE_STYLE_SELECTOR);
if (inlineStyleElements.length > 0) {
forEach2(inlineStyleElements, function(el) {
return overrideInlineStyle(el, filter, ignoredInlineSelectors, ignoredImageAnalysisSelectors);
});
}
});
addDOMReadyListener(onDOMReady);
}
function stopWatchingForUpdates() {
styleManagers.forEach(function(manager) {
return manager.pause();
});
stopStylePositionWatchers();
stopWatchingForStyleChanges();
stopWatchingForInlineStyles();
removeDOMReadyListener(onDOMReady);
cleanReadyStateCompleteListeners();
}
function createDarkReaderInstanceMarker() {
var metaElement = document.createElement("meta");
metaElement.name = "darkreader";
metaElement.content = INSTANCE_ID;
document.head.appendChild(metaElement);
}
function isAnotherDarkReaderInstanceActive() {
var meta = document.querySelector('meta[name="darkreader"]');
if (meta) {
if (meta.content !== INSTANCE_ID) {
return true;
}
return false;
}
createDarkReaderInstanceMarker();
return false;
}
function createOrUpdateDynamicTheme(filterConfig, dynamicThemeFixes, iframe) {
filter = filterConfig;
fixes = dynamicThemeFixes;
if (fixes) {
ignoredImageAnalysisSelectors = Array.isArray(fixes.ignoreImageAnalysis) ? fixes.ignoreImageAnalysis : [];
ignoredInlineSelectors = Array.isArray(fixes.ignoreInlineStyle) ? fixes.ignoreInlineStyle : [];
} else {
ignoredImageAnalysisSelectors = [];
ignoredInlineSelectors = [];
}
isIFrame$1 = iframe;
if (document.head) {
if (isAnotherDarkReaderInstanceActive()) {
return;
}
document.documentElement.setAttribute("data-darkreader-mode", "dynamic");
document.documentElement.setAttribute("data-darkreader-scheme", filter.mode ? "dark" : "dimmed");
createThemeAndWatchForUpdates();
} else {
if (!isFirefox) {
var fallbackStyle = createOrUpdateStyle("darkreader--fallback");
document.documentElement.appendChild(fallbackStyle);
fallbackStyle.textContent = getModifiedFallbackStyle(filter, { strict: true });
}
var headObserver_1 = new MutationObserver(function() {
if (document.head) {
headObserver_1.disconnect();
if (isAnotherDarkReaderInstanceActive()) {
removeDynamicTheme();
return;
}
createThemeAndWatchForUpdates();
}
});
headObserver_1.observe(document, { childList: true, subtree: true });
}
}
function removeProxy() {
document.dispatchEvent(new CustomEvent("__darkreader__cleanUp"));
removeNode(document.head.querySelector(".darkreader--proxy"));
}
function removeDynamicTheme() {
document.documentElement.removeAttribute("data-darkreader-mode");
document.documentElement.removeAttribute("data-darkreader-scheme");
cleanDynamicThemeCache();
removeNode(document.querySelector(".darkreader--fallback"));
if (document.head) {
restoreMetaThemeColor();
removeNode(document.head.querySelector(".darkreader--user-agent"));
removeNode(document.head.querySelector(".darkreader--text"));
removeNode(document.head.querySelector(".darkreader--invert"));
removeNode(document.head.querySelector(".darkreader--inline"));
removeNode(document.head.querySelector(".darkreader--override"));
removeNode(document.head.querySelector(".darkreader--variables"));
removeNode(document.head.querySelector(".darkreader--root-vars"));
removeNode(document.head.querySelector('meta[name="darkreader"]'));
removeProxy();
}
shadowRootsWithOverrides.forEach(function(root) {
removeNode(root.querySelector(".darkreader--inline"));
removeNode(root.querySelector(".darkreader--override"));
});
shadowRootsWithOverrides.clear();
forEach2(styleManagers.keys(), function(el) {
return removeManager(el);
});
loadingStyles.clear();
cleanLoadingLinks();
forEach2(document.querySelectorAll(".darkreader"), removeNode);
adoptedStyleManagers.forEach(function(manager) {
manager.destroy();
});
adoptedStyleManagers.splice(0);
}
function cleanDynamicThemeCache() {
variablesStore.clear();
parsedURLCache.clear();
stopWatchingForDocumentVisibility();
cancelRendering();
stopWatchingForUpdates();
cleanModificationCache();
}
var blobRegex = /url\(\"(blob\:.*?)\"\)/g;
function replaceBlobs(text) {
return __awaiter(this, void 0, void 0, function() {
var promises, data;
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
promises = [];
getMatches(blobRegex, text, 1).forEach(function(url2) {
var promise = loadAsDataURL(url2);
promises.push(promise);
});
return [4, Promise.all(promises)];
case 1:
data = _a2.sent();
return [2, text.replace(blobRegex, function() {
return 'url("' + data.shift() + '")';
})];
}
});
});
}
var banner = '/*\n _______\n / \\\n .==. .==.\n (( ))==(( ))\n / "==" "=="\\\n /____|| || ||___\\\n ________ ____ ________ ___ ___\n | ___ \\ / \\ | ___ \\ | | / /\n | | \\ \\ / /\\ \\ | | \\ \\| |_/ /\n | | ) / /__\\ \\ | |__/ /| ___ \\\n | |__/ / ______ \\| ____ \\| | \\ \\\n_______|_______/__/ ____ \\__\\__|___\\__\\__|___\\__\\____\n| ___ \\ | ____/ / \\ | ___ \\ | ____| ___ \\\n| | \\ \\| |___ / /\\ \\ | | \\ \\| |___| | \\ \\\n| |__/ /| ____/ /__\\ \\ | | ) | ____| |__/ /\n| ____ \\| |__/ ______ \\| |__/ /| |___| ____ \\\n|__| \\__\\____/__/ \\__\\_______/ |______|__| \\__\\\n https://darkreader.org\n*/\n\n/*! Dark reader generated CSS | Licensed under MIT https://github.com/darkreader/darkreader/blob/master/LICENSE */\n';
function collectCSS() {
return __awaiter(this, void 0, void 0, function() {
function addStaticCSS(selector, comment) {
var staticStyle = document.querySelector(selector);
if (staticStyle && staticStyle.textContent) {
css.push("/* " + comment + " */");
css.push(staticStyle.textContent);
css.push("");
}
}
var css, modifiedCSS, formattedCSS, _a2, _b;
return __generator(this, function(_c) {
switch (_c.label) {
case 0:
css = [banner];
addStaticCSS(".darkreader--fallback", "Fallback Style");
addStaticCSS(".darkreader--user-agent", "User-Agent Style");
addStaticCSS(".darkreader--text", "Text Style");
addStaticCSS(".darkreader--invert", "Invert Style");
addStaticCSS(".darkreader--variables", "Variables Style");
modifiedCSS = [];
document.querySelectorAll(".darkreader--sync").forEach(function(element) {
forEach2(element.sheet.cssRules, function(rule) {
rule && rule.cssText && modifiedCSS.push(rule.cssText);
});
});
if (!modifiedCSS.length)
return [3, 2];
formattedCSS = formatCSS(modifiedCSS.join("\n"));
css.push("/* Modified CSS */");
_b = (_a2 = css).push;
return [4, replaceBlobs(formattedCSS)];
case 1:
_b.apply(_a2, [_c.sent()]);
css.push("");
_c.label = 2;
case 2:
addStaticCSS(".darkreader--override", "Override Style");
return [2, css.join("\n")];
}
});
});
}
var isDarkReaderEnabled = false;
var isIFrame = function() {
if (typeof window === "undefined")
return false;
try {
return window.self !== window.top;
} catch (err) {
console.warn(err);
return true;
}
}();
function enable2(themeOptions, fixes2) {
if (themeOptions === void 0) {
themeOptions = {};
}
if (fixes2 === void 0) {
fixes2 = null;
}
var theme = __assign(__assign({}, DEFAULT_THEME), themeOptions);
if (theme.engine !== ThemeEngines.dynamicTheme) {
throw new Error("Theme engine is not supported.");
}
createOrUpdateDynamicTheme(theme, fixes2, isIFrame);
isDarkReaderEnabled = true;
}
function isEnabled() {
return isDarkReaderEnabled;
}
function disable2() {
removeDynamicTheme();
isDarkReaderEnabled = false;
}
var store = {
themeOptions: null,
fixes: null
};
function handleColorScheme() {
var darkScheme = matchMedia("(prefers-color-scheme: dark)");
if (darkScheme.matches) {
enable2(store.themeOptions, store.fixes);
} else {
disable2();
}
}
function auto(themeOptions, fixes2) {
if (themeOptions === void 0) {
themeOptions = {};
}
if (fixes2 === void 0) {
fixes2 = null;
}
var darkScheme = matchMedia("(prefers-color-scheme: dark)");
if (themeOptions) {
store = { themeOptions, fixes: fixes2 };
handleColorScheme();
if (isMatchMediaChangeEventListenerSupported) {
darkScheme.addEventListener("change", handleColorScheme);
} else {
darkScheme.addListener(handleColorScheme);
}
} else {
if (isMatchMediaChangeEventListenerSupported) {
darkScheme.removeEventListener("change", handleColorScheme);
} else {
darkScheme.removeListener(handleColorScheme);
}
disable2();
}
}
function exportGeneratedCSS() {
return __awaiter(this, void 0, void 0, function() {
return __generator(this, function(_a2) {
switch (_a2.label) {
case 0:
return [4, collectCSS()];
case 1:
return [2, _a2.sent()];
}
});
});
}
var setFetchMethod = setFetchMethod$1;
exports2.auto = auto;
exports2.disable = disable2;
exports2.enable = enable2;
exports2.exportGeneratedCSS = exportGeneratedCSS;
exports2.isEnabled = isEnabled;
exports2.setFetchMethod = setFetchMethod;
Object.defineProperty(exports2, "__esModule", { value: true });
});
})(darkreader, darkreader.exports);
const __default__ = {
name: "lay-config-provider"
};
const _sfc_main = defineComponent({
...__default__,
props: {
locale: { default: "zh_CN" },
locales: null,
theme: { default: "light" },
themeVariable: null,
darkPartial: null
},
setup(__props) {
const props = __props;
const { locale, setLocaleMessage, mergeLocaleMessage } = useI18n();
const ignoreInlineStyle = [
".layui-colorpicker-trigger-span",
"div.layui-color-picker *"
];
const fixCss = `
.lay-progress-circle svg {
filter: invert(98%) hue-rotate(180deg) contrast(80%) !important;
}
`;
const changeLocale = (lang) => {
locale.value = lang;
};
const changeLocales = (lang, locales, merge) => {
if (merge) {
mergeLocaleMessage(lang, locales);
} else {
setLocaleMessage(lang, locales);
}
};
const changeTheme = (theme) => {
const defaultPartial = {
mode: 1,
brightness: 100,
contrast: 90,
sepia: 0,
grayscale: 0
};
const defaultFixes = {
css: fixCss,
invert: [".lay-progress-circle svg"],
ignoreImageAnalysis: [],
disableStyleSheetsProxy: false,
ignoreInlineStyle
};
Object.assign(defaultPartial, props.darkPartial);
if (theme === "dark") {
if (window) {
darkreader.exports.setFetchMethod(window.fetch);
}
darkreader.exports.enable(defaultPartial, defaultFixes);
} else if (theme === "light") {
darkreader.exports.disable();
} else if (theme === "auto") {
darkreader.exports.auto(defaultPartial, defaultFixes);
}
};
const changeThemeVariable = (vars) => {
if (vars != null) {
const keys = Object.keys(vars);
for (let i = 0; i < keys.length; i++) {
const key = keys[i];
const value = vars[key];
document.documentElement.style.setProperty(key, value);
}
}
};
watch(() => props.locale, (lang) => {
changeLocale(lang);
}, { immediate: true });
watch(() => props.locales, (locals) => {
locals == null ? void 0 : locals.forEach((item) => {
changeLocales(item.name, item.locale, item.merge);
});
}, { immediate: true, deep: true });
watch(() => props.theme, (theme) => {
changeTheme(theme);
}, { immediate: true });
watch(() => props.themeVariable, (vars) => {
changeThemeVariable(vars);
}, { immediate: true, deep: true });
return (_ctx, _cache) => {
return renderSlot(_ctx.$slots, "default");
};
}
});
const component = withInstall(_sfc_main);
const components = {
LaySplitPanel: component$g,
LaySplitPanelItem: component$f,
LayRadio: component$1i,
LayRadioGroup: component$1h,
LayButton: component$1g,
LayIcon: component$1d,
LayBacktop: component$1l,
LayLayout: component$1a,
LaySide: component$19,
LayHeader: component$17,
LayBody: component$18,
LayFooter: component$16,
LayLogo: component$15,
LayPanel: component$14,
LayCard: component$1b,
LayProgress: component$13,
LayButtonGroup: component$1e,
LayButtonContainer: component$1f,
LayRow: component$11,
LayCol: component$12,
LayInput: component$10,
LayBadge: component$$,
LayQuote: component$_,
LayLine: component$Z,
LayTimeline: component$Y,
LayTimelineItem: component$X,
LayTextarea: component$W,
LaySwitch: component$V,
LayCollapse: component$U,
LayCollapseItem: component$T,
LayContainer: component$S,
LayMenu: component$Q,
LayMenuItem: component$P,
LayCheckbox: component$O,
LayForm: component$M,
LayBreadcrumb: component$L,
LayBreadcrumbItem: component$K,
LayAvatar: component$1k,
LayAvatarList: component$1j,
LayField: component$J,
LaySelect: component$I,
LayScroll: component$G,
LaySelectOption: component$H,
LayEmpty: component$F,
LayFormItem: component$E,
LayRate: component$D,
LayDropdown: component$C,
LayDropdownMenu: component$B,
LayDropdownMenuItem: component$A,
LayDropdownSubMenu: component$z,
LayTab: component$y,
LayTabItem: component$x,
LayIconPicker: component$1c,
LayTree: component$w,
LayTable: component$u,
LayPage: component$t,
LayTransfer: component$s,
LayCheckboxGroup: component$N,
LaySlider: component$r,
LayCarousel: component$q,
LayCarouselItem: component$p,
LayColorPicker: component$o,
LayTooltip: component$n,
LayInputNumber: component$m,
LaySkeleton: component$l,
LaySkeletonItem: component$k,
LayCountUp: component$R,
LayStep: component$j,
LayStepItem: component$i,
LaySubMenu: component$h,
LayException: component$e,
LayResult: component$d,
LayFullscreen: component$c,
LayConfigProvider: component,
LayDatePicker: component$b,
LayTransition: component$a,
LayUpload: component$9,
LayRipple: component$8,
LayNoticeBar: component$7,
LayPageHeader: component$6,
LayCascader: component$5,
LayAffix: component$4,
LaySpace: component$3,
LayTag: component$2,
LayTagInput: component$1,
LayTreeSelect: component$v
};
const install = (app, options) => {
for (const key of Object.keys(components)) {
app.use(components[key], options);
}
app.use(i18n);
app.use(index$10);
};
var index = { install };
export { component$4 as LayAffix, component$1k as LayAvatar, component$1j as LayAvatarList, component$1l as LayBacktop, component$$ as LayBadge, component$18 as LayBody, component$L as LayBreadcrumb, component$K as LayBreadcrumbItem, component$1g as LayButton, component$1f as LayButtonContainer, component$1e as LayButtonGroup, component$1b as LayCard, component$q as LayCarousel, component$p as LayCarouselItem, component$5 as LayCascader, component$O as LayCheckbox, component$N as LayCheckboxGroup, component$12 as LayCol, component$U as LayCollapse, component$T as LayCollapseItem, component$o as LayColorPicker, component as LayConfigProvider, component$S as LayContainer, component$R as LayCountUp, component$b as LayDatePicker, component$C as LayDropdown, component$B as LayDropdownMenu, component$A as LayDropdownMenuItem, component$z as LayDropdownSubMenu, component$F as LayEmpty, component$e as LayException, component$J as LayField, component$16 as LayFooter, component$M as LayForm, component$E as LayFormItem, component$c as LayFullscreen, component$17 as LayHeader, component$1d as LayIcon, component$1c as LayIconPicker, component$10 as LayInput, component$m as LayInputNumber, component$1a as LayLayout, component$Z as LayLine, component$15 as LayLogo, component$Q as LayMenu, component$P as LayMenuItem, component$7 as LayNoticeBar, component$t as LayPage, component$6 as LayPageHeader, component$14 as LayPanel, component$13 as LayProgress, component$_ as LayQuote, component$1i as LayRadio, component$1h as LayRadioGroup, component$D as LayRate, component$d as LayResult, component$8 as LayRipple, component$11 as LayRow, component$G as LayScroll, component$I as LaySelect, component$H as LaySelectOption, component$19 as LaySide, component$l as LaySkeleton, component$k as LaySkeletonItem, component$r as LaySlider, component$3 as LaySpace, component$g as LaySplitPanel, component$f as LaySplitPanelItem, component$j as LayStep, component$i as LayStepItem, component$h as LaySubMenu, component$V as LaySwitch, component$y as LayTab, component$x as LayTabItem, component$u as LayTable, component$2 as LayTag, component$1 as LayTagInput, component$W as LayTextarea, component$Y as LayTimeline, component$X as LayTimelineItem, component$n as LayTooltip, component$s as LayTransfer, component$a as LayTransition, component$w as LayTree, component$v as LayTreeSelect, component$9 as LayUpload, index as default, install, layer, useI18n };