twikoo 2.0.16 → 2.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  /*! twikoo:inlined-css */
2
- (function(){if(typeof document==='undefined')return;var s=document.createElement('style');s.setAttribute('data-twikoo','');s.appendChild(document.createTextNode(".twikoo .tk-icon{line-height:1;display:inline-block}.twikoo .tk-icon svg{vertical-align:-.125em;fill:currentColor;height:1em}.twikoo .tk-action{align-items:center;display:flex}.twikoo .tk-action-link{appearance:none;cursor:pointer;color:#409eff;background:0 0;border:none;align-items:center;margin:0 0 0 .5rem;padding:0;text-decoration:none;display:flex}.twikoo .tk-action-link .tk-action-icon-solid,.twikoo .tk-action-link.tk-liked .tk-action-icon,.twikoo .tk-action-link:hover .tk-action-icon{display:none}.twikoo .tk-action-link.tk-liked .tk-action-icon-solid,.twikoo .tk-action-link:hover .tk-action-icon-solid{display:block}.twikoo .tk-action-link.tk-disliked .tk-action-icon,.twikoo .tk-action-link.tk-disliked:hover .tk-action-icon{display:none}.twikoo .tk-action-link.tk-disliked .tk-action-icon-solid,.twikoo .tk-action-link.tk-disliked:hover .tk-action-icon-solid{display:block}.twikoo .tk-action-count{height:1.5rem;margin-left:.25rem;font-size:.75rem;line-height:1.5rem}.twikoo .tk-action-icon{color:#409eff;width:1em;height:1em;line-height:0;display:inline-block}.twikoo .tk-avatar{text-align:center;border-radius:5px;flex-shrink:0;width:2.5rem;height:2.5rem;margin-right:1rem;overflow:hidden}.twikoo .tk-comment .tk-submit .tk-avatar,.twikoo .tk-replies .tk-avatar{width:1.6rem;height:1.6rem}.twikoo .tk-avatar.tk-has-avatar{background-color:#90939921}.twikoo .tk-avatar.tk-clickable{cursor:pointer}.twikoo .tk-avatar .tk-avatar-img{color:#c0c4cc;height:2.5rem;line-height:2.5rem}.twikoo .tk-avatar .tk-avatar-img .tk-icon,.twikoo .tk-avatar .tk-avatar-img .tk-icon svg{width:100%;height:100%;display:block}.twikoo .tk-avatar .tk-avatar-img img,.twikoo .tk-avatar img.tk-avatar-img{object-fit:cover;width:100%;height:100%}.twikoo .tk-comment .tk-submit .tk-avatar .tk-avatar-img,.twikoo .tk-replies .tk-avatar .tk-avatar-img{height:1.6rem;line-height:1.6rem}.twikoo .tk-input{align-items:center;width:100%;font-size:.875rem;display:inline-flex;position:relative}.twikoo .tk-input--group{display:inline-flex}.twikoo .tk-input__inner{color:currentColor;box-sizing:border-box;background-color:#0000;border:1px solid #9093994f;border-radius:4px;outline:none;width:100%;height:32px;padding:0 12px;font-size:.875rem;line-height:32px;transition:border-color .2s;display:inline-block}.twikoo .tk-input__inner:hover{border-color:#90939980}.twikoo .tk-input__inner:focus{border-color:#409eff}.twikoo .tk-input--small .tk-input__inner{height:32px;font-size:.8125rem;line-height:32px}.twikoo .tk-input--mini .tk-input__inner{height:28px;font-size:.75rem;line-height:28px}.twikoo .tk-textarea .tk-input__inner{resize:vertical;height:auto;min-height:66px;padding:6px 12px;line-height:1.5}.twikoo .tk-input.is-disabled .tk-input__inner{cursor:not-allowed;background-color:#9093990f}.twikoo .tk-input__inner[readonly]{cursor:default}.twikoo .tk-input input:invalid{border-color:#f56c6c}.twikoo .tk-input__inner[type=number]{appearance:textfield}.twikoo .tk-input__inner[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}.twikoo .tk-input__inner[type=number]::-webkit-outer-spin-button{appearance:none;margin:0}.twikoo .tk-input__suffix{color:#c0c4cc;align-items:center;gap:4px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.twikoo .tk-input__icon{cursor:pointer;align-items:center;line-height:0;display:inline-flex}.twikoo .tk-input__icon:hover{color:#909399}.twikoo .tk-input__count{color:currentColor;background:0 0;font-size:.75rem;position:absolute;bottom:5px;right:10px}.twikoo .tk-input-group__prepend,.twikoo .tk-input-group__append{box-sizing:border-box;white-space:nowrap;color:currentColor;background-color:#90939921;background-clip:padding-box;border:1px solid #9093994f;border-radius:4px;align-items:center;height:32px;padding:0 1rem;line-height:32px;display:inline-flex}.twikoo .tk-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.twikoo .tk-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.twikoo .tk-input--group .tk-input__inner{border-radius:0}.twikoo .tk-input--small .tk-input-group__prepend,.twikoo .tk-input--small .tk-input-group__append{height:32px;font-size:.8125rem;line-height:32px}.twikoo .tk-input--mini .tk-input-group__prepend,.twikoo .tk-input--mini .tk-input-group__append{height:28px;font-size:.75rem;line-height:28px}.twikoo .tk-meta-input{display:flex}.twikoo .tk-meta-input .tk-input{flex:1;width:calc(33.3333% - .333333rem)}.twikoo .tk-meta-input .tk-input+.tk-input{margin-left:.5rem}.twikoo .tk-meta-input .tk-input-group__prepend{padding:0 1rem}@media screen and (max-width:767px){.twikoo .tk-meta-input{flex-direction:column}.twikoo .tk-meta-input .tk-input{width:auto}.twikoo .tk-meta-input .tk-input+.tk-input{margin-top:.5rem;margin-left:0}}.twikoo .tk-button{color:currentColor;cursor:pointer;white-space:nowrap;background-color:#90939910;border:1px solid #9093994f;border-radius:4px;padding:12px 20px;font-size:.875rem;line-height:1;transition:all .1s;display:inline-block}.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):active,.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):focus,.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):hover{color:#409eff;background-color:#409eff10;border-color:#409eff80}.twikoo .tk-button--primary{color:#fff;background:#409eff;border-color:#409eff}.twikoo .tk-button--primary:not(.is-disabled):focus,.twikoo .tk-button--primary:not(.is-disabled):hover{color:#fff;background:#66b1ff;border-color:#66b1ff}.twikoo .tk-button--primary:not(.is-disabled):active{color:#fff;background:#3a8ee6;border-color:#3a8ee6}.twikoo .tk-button--primary.is-disabled,.twikoo .tk-button--primary.is-disabled:active,.twikoo .tk-button--primary.is-disabled:focus,.twikoo .tk-button--primary.is-disabled:hover{color:#ffffffa1;background-color:#409eff80;border-color:#0000}.twikoo .tk-button--info{color:currentColor;background-color:#90939910;border-color:#9093994f}.twikoo .tk-button--large{padding:13px 20px;font-size:1rem}.twikoo .tk-button--small{border-radius:3px;padding:9px 15px;font-size:.75rem}.twikoo .tk-button--mini{border-radius:3px;padding:7px 15px;font-size:.75rem}.twikoo .tk-button--text{color:#409eff;background:0 0;border-color:#0000;padding-left:0;padding-right:0}.twikoo .tk-button--text:not(.is-disabled):focus,.twikoo .tk-button--text:not(.is-disabled):hover{color:#66b1ff;background:0 0}.twikoo .tk-button--text:not(.is-disabled):active{color:#3a8ee6}.twikoo .tk-button.is-disabled{opacity:.5;cursor:not-allowed}.twikoo .tk-button.is-loading{pointer-events:none;opacity:.7;cursor:wait}.twikoo .tk-button__spinner{margin-right:4px}.twikoo .tk-button__spinner svg{animation:.8s linear infinite tk-spin}.twikoo .tk-button+.tk-button{margin-left:.5rem}.twikoo .tk-input-group__append .tk-button,.twikoo .tk-input-group__prepend .tk-button{font-size:inherit}.twikoo .tk-input-group__append .tk-button{color:currentColor;background:0 0;border:0;border-radius:0 3px 3px 0;height:100%;margin:-1px -1rem;padding:0 15px}.twikoo .tk-input-group__append .tk-button:hover{color:#409eff}@keyframes tk-spin{to{transform:rotate(360deg)}}.twikoo .tk-submit{flex-direction:column;display:flex}.twikoo .tk-col{flex-direction:column;flex:1;display:flex}.twikoo .tk-meta-input{margin-bottom:.5rem}.twikoo .tk-row.actions{justify-content:flex-end;align-items:center;margin-top:1rem;margin-bottom:1rem;margin-left:3.5rem;position:relative}.twikoo .tk-row-actions-start{flex:1;align-items:center;display:flex}.twikoo .tk-submit-action-icon{cursor:pointer;flex-shrink:0;align-self:center;width:1.25em;margin-right:10px;line-height:0;display:inline-block}.twikoo .tk-submit-action-icon svg:hover{opacity:.8}.twikoo .tk-submit-action-icon .tk-icon,.twikoo .tk-submit-action-icon .tk-icon svg{width:100%}.twikoo .tk-submit-action-icon .tk-icon svg{height:auto}.twikoo .tk-submit-action-icon.__markdown{color:#909399}.twikoo .tk-input-image{display:none}.twikoo .tk-input{flex:1}.twikoo .tk-input .tk-textarea__inner{background-position:100% 100%;background-repeat:no-repeat}.twikoo .tk-turnstile-container,.twikoo .tk-geetest-container,.twikoo .tk-cap-container{z-index:1;position:absolute;bottom:-75px;right:0}.twikoo .tk-turnstile{flex-direction:column;display:flex}.twikoo .tk-preview-container{word-break:break-word;border:1px solid #8080804f;border-radius:4px;margin-bottom:1rem;margin-left:3rem;padding:5px 15px}.twikoo .tk-fade-in{animation:.3s tkFadeIn}@keyframes tkFadeIn{0%{opacity:0}to{opacity:1}}.twikoo .tk-main{flex:1;width:0}.twikoo .tk-row{flex-direction:row;flex:1;justify-content:space-between;display:flex}.twikoo .tk-nick-link{color:inherit;text-decoration:none}.twikoo .tk-replies .tk-nick-link{font-size:.9em}.twikoo .tk-nick-link:hover{color:#409eff}.twikoo .tk-actions{margin-left:1em;display:none}.twikoo .tk-actions button{appearance:none;color:#409eff;cursor:pointer;background:0 0;border:none;margin:0;padding:0;text-decoration:none;display:inline}.twikoo .tk-comment:hover .tk-actions{display:inline}.twikoo .tk-meta{flex-wrap:wrap;align-items:baseline;gap:.25em;display:flex}.twikoo .tk-actions button+button{margin-left:.25em}.twikoo .tk-extras{color:#999;flex-wrap:wrap;font-size:.875em;display:flex}.twikoo .tk-extra{align-items:center;margin-top:.5rem;margin-right:.75rem;display:flex}.twikoo .tk-icon.__comment{width:1em;height:1em;line-height:1;display:inline-flex}.twikoo .tk-extra-text{line-height:1}.twikoo .tk-tag{background-color:#f2f6fc;padding:0 .5em;font-size:.75em;display:inline-block}.twikoo .tk-tag-green{color:#67c23a;background-color:#67c23a21;border:1px solid #67c23a80;border-radius:2px}.twikoo .tk-tag-yellow{color:#e6a23c;background-color:#e6a23c21;border:1px solid #e6a23c80;border-radius:2px}.twikoo .tk-tag-blue{color:#409eff;background-color:#409eff21;border:1px solid #409eff80;border-radius:2px}.twikoo .tk-tag-red{color:#f56c6c;background-color:#f56c6c21;border:1px solid #f56c6c80;border-radius:2px}.twikoo .tk-comment{word-break:break-all;flex-direction:row;margin-top:1rem;display:flex}.twikoo .tk-content{max-height:500px;margin-top:.5rem;position:relative;overflow:hidden}.twikoo .tk-content-expand{max-height:none}.twikoo .tk-replies .tk-content{font-size:.9em}.twikoo .tk-comment .vemoji{vertical-align:middle;max-height:2em}.twikoo .tk-replies{max-height:200px;position:relative;overflow:hidden}.twikoo .tk-replies-expand{max-height:none;overflow:unset}.twikoo .tk-submit{margin-top:1rem}.twikoo .tk-expand{font-size:.75em}.twikoo .tk-lightbox{z-index:999;background-color:#0000004d;display:block;position:fixed;inset:0}.twikoo .tk-lightbox-image{background:linear-gradient(90deg,#eee 50%,#e3e3e3 0) 0 0/40px 100%;width:auto;min-width:100px;max-width:95%;height:auto;min-height:30px;max-height:95%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.twikoo .tk-error{color:#f56c6c;background-color:#f56c6c21;border:1px solid #f56c6c80;border-radius:4px;gap:8px;padding:12px;display:flex}.twikoo .tk-error__icon svg{width:20px;height:20px}.twikoo .tk-error__title{font-weight:600}.twikoo .tk-error__toggle{color:currentColor;opacity:.7;cursor:pointer;background:0 0;border:none;margin-top:4px;padding:0;font-size:.75rem}.twikoo .tk-error__detail{color:currentColor;opacity:.7;word-break:break-all;margin-top:6px;font-size:.75rem}.twikoo .tk-error__raw{white-space:pre-wrap;margin:4px 0 0}.twikoo .tk-comments-search{gap:.5rem;margin-bottom:1rem;display:flex}.twikoo .tk-comments-search .tk-input{flex:1}@media (max-width:480px){.twikoo .tk-comments-search{flex-wrap:wrap}.twikoo .tk-comments-search .tk-input{flex-basis:100%}}.twikoo .tk-comments-title{justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:1rem;font-size:1.25rem;font-weight:700;line-height:1;display:flex}.twikoo .tk-comments-count.__hidden{visibility:hidden}.twikoo .tk-comments-count{white-space:nowrap;flex-shrink:0}.twikoo .tk-comments-actions{white-space:nowrap;align-items:center;gap:.5em;display:flex}.twikoo .tk-comments-container{flex-direction:column;min-height:10rem;display:flex}.twikoo .tk-comments-no{text-align:center;flex:1;justify-content:center;align-items:center;display:flex}.twikoo .tk-comments-sort{align-items:center;gap:.75em;margin-right:.5em;line-height:1;display:flex}.twikoo .tk-sort-item{cursor:pointer;color:#409eff99;background:0 0;border:0;align-items:center;padding:0;font-size:.75rem;line-height:1;display:inline-flex}.twikoo .tk-sort-item.__active{color:#409eff}.twikoo .tk-sort-item:focus{color:#409eff;outline:none}.twikoo .tk-icon.__comments{vertical-align:middle;cursor:pointer;color:#409eff;flex-shrink:0;justify-content:center;align-items:center;width:.75rem;height:.75rem;line-height:0;display:inline-flex}.twikoo .tk-icon.__comments.__active{color:#fff;background:#409eff;border-radius:.125rem;box-shadow:0 0 0 .2rem #409eff}.twikoo .tk-icon.__comments svg{width:100%;height:100%;display:block}.twikoo div.code-toolbar{border-radius:.3em;position:relative}.twikoo .tk-content pre,.twikoo .tk-preview-container pre{max-width:100%;overflow-x:auto}.twikoo .tk-content pre code,.twikoo .tk-preview-container pre code{white-space:pre;word-break:normal}.twikoo div.code-toolbar>.toolbar{font-size:.8125rem;font-weight:500;display:flex;position:absolute;top:4px;right:4px}.twikoo div.code-toolbar>.toolbar>.toolbar-item{margin-left:.3em}.twikoo div.code-toolbar>.toolbar>.toolbar-item>a,.twikoo div.code-toolbar>.toolbar>.toolbar-item>button,.twikoo div.code-toolbar>.toolbar>.toolbar-item>span{border-radius:.3em;padding:2px 4px}.twikoo div.code-toolbar>.toolbar>.toolbar-item>button{border:1px solid #8080804f}.twikoo div.code-toolbar>.toolbar>.toolbar-item>button:hover{cursor:pointer}.twikoo .tk-footer{text-align:end;color:#999;width:100%;margin-top:1em;font-size:.75em}.twikoo .tk-pagination,.twikoo .tk-pagination-pagers{display:flex}.twikoo .tk-pagination{flex-wrap:wrap;justify-content:space-between;align-items:center;width:100%}.twikoo .tk-pagination-options{align-items:center;display:flex}.twikoo .tk-pagination-pager{cursor:pointer;justify-content:center;align-items:center;width:2em;height:2em;display:flex}.twikoo .tk-pagination-pager.__current{color:#fff;pointer-events:none;background-color:#409eff}.twikoo .tk-pagination-size,.twikoo .tk-pagination-goto{width:50px;margin:0 .5em}.twikoo .tk-pagination .tk-input__inner{text-align:center;height:28px;padding:0}.twikoo .tk-admin-comment{flex-direction:column;align-items:center;display:flex}.twikoo .tk-admin-comment a{color:currentColor;text-decoration:underline}.twikoo .tk-admin-warn{margin-bottom:1em}.twikoo .tk-admin-security-alert{margin-bottom:0;padding-right:2.5rem;position:relative}.twikoo .tk-admin-security-alert .tk-admin-close{float:none;width:1rem;height:1rem;margin:0;padding:.5rem;line-height:0;position:absolute;top:0;right:0}.twikoo .tk-admin-security-alert-message{margin-bottom:.5em}.twikoo .tk-admin-security-alert-url{word-break:break-all;background:#0003;border-radius:4px;margin-bottom:.5em;padding:.5em}.twikoo .tk-admin-comment-filter{justify-content:center;align-items:center;width:100%;display:flex}.twikoo .tk-admin-comment-filter-keyword{flex:1}.twikoo .tk-admin-comment-filter-type{color:#fff;-webkit-appearance:none;-moz-appearance:none;background-color:#0003;border:1px solid #9093994f;border-radius:4px;height:32px;margin:0 .5em;padding:0 .5em;position:relative}.twikoo .tk-admin-comment-filter-type:focus{border-color:#409eff}.twikoo .tk-admin-comment-filter-type option{color:initial}.twikoo .tk-admin-comment-list{margin-top:1em}.twikoo .tk-admin-comment-list,.twikoo .tk-admin-comment-item{flex-direction:column;justify-content:stretch;width:100%;display:flex}.twikoo .tk-admin-comment-meta{flex-wrap:wrap;align-items:center;margin-bottom:.5em;display:flex}.twikoo .tk-admin-comment .tk-avatar{margin-right:.5em}.twikoo .tk-admin-comment .tk-content{max-height:none}.twikoo .tk-admin-actions{border-bottom:1px solid #ffffff80;margin-bottom:1em;display:flex}.twikoo .tk-admin-config-groups{padding-right:.5em;position:relative;overflow-y:auto}.twikoo .tk-admin-config-groups .tk-admin-config-group,.twikoo .tk-admin-config-groups .tk-admin-config-group-title{background:0 0}.twikoo .tk-admin-config-group-title{margin-top:1em;font-size:1.25rem;font-weight:700}.twikoo .tk-admin-config-item{grid-template-columns:30% 70%;align-items:center;margin-top:1em;display:grid;position:relative}.twikoo .tk-admin-config-title{text-align:right;text-overflow:ellipsis;white-space:nowrap;margin-right:1em;overflow:hidden}.twikoo .tk-admin-config-input{position:relative}.twikoo .tk-admin-config-select{appearance:none;box-sizing:border-box;color:#fff;cursor:pointer;font-size:inherit;background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E\") right 10px center no-repeat;border:1px solid #9093994f;border-radius:4px;outline:none;width:100%;height:32px;padding:0 30px 0 10px;line-height:32px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);display:inline-block}.twikoo .tk-admin-config-select:focus{border-color:#fff9}.twikoo .tk-admin-config-select option{color:#fff;background:#333}.twikoo .tk-admin-config-desc{overflow-wrap:break-word;margin-top:.5em;font-size:.75em}.twikoo .tk-admin-config-actions{justify-content:center;align-items:center;margin-top:1em;display:flex}.twikoo .tk-admin-config-message{text-align:center;margin-top:.5em}.twikoo .tk-admin-config-email-test-desc{margin:1em 0}.twikoo .tk-admin-import{flex-direction:column;display:flex}.twikoo .tk-admin-import-label{margin-top:1em;font-size:1.25rem;font-weight:700}.twikoo .tk-admin-import select,.twikoo .tk-admin-import input,.twikoo .tk-admin-import .tk-button,.twikoo .tk-admin-import .tk-input{margin-top:1em}.twikoo .tk-admin-import-actions{display:flex}.twikoo .tk-admin-import-actions .tk-button{flex:1}.twikoo .tk-admin-import select{color:#fff;background-color:#0003;border:1px solid #9093994f;border-radius:4px;height:32px;padding:0 .5em}.twikoo .tk-admin-import select option{color:initial}.twikoo .tk-admin-container{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden}.twikoo .tk-admin{pointer-events:all;color:#fff;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);visibility:hidden;background-color:#000000d9;width:100%;height:100%;transition:all .5s;position:absolute;top:0;left:100%;overflow-y:auto}.twikoo .tk-admin::-webkit-scrollbar{background-color:#0000;width:5px}.twikoo .tk-admin::-webkit-scrollbar-track{background-color:#0000}.twikoo .tk-admin::-webkit-scrollbar-thumb{background-color:#ffffff4f}.twikoo .tk-admin.__show{visibility:visible;left:0}.twikoo .tk-admin-close{appearance:none;cursor:pointer;box-sizing:content-box;color:#fff;z-index:1;background:0 0;border:none;width:1rem;height:1rem;margin:0;padding:1rem;line-height:0;text-decoration:none;display:block;position:sticky;top:0;left:calc(100% - 3rem)}.twikoo .tk-login,.twikoo .tk-regist{box-sizing:border-box;flex-direction:column;align-items:center;width:100%;padding:0 2rem;display:flex}.twikoo .tk-login-title{color:#fff;text-align:center;margin-top:10rem;font-size:1.25rem}.twikoo .tk-login form,.twikoo .tk-regist form{text-align:center;width:100%}.twikoo .tk-password,.twikoo .tk-login-msg{color:#fff;text-align:center;width:80%;margin-top:1rem}.twikoo .tk-password .tk-input__inner{min-width:100px}.twikoo .tk-password .tk-input-group__prepend{color:#fff}.twikoo .tk-login-msg a{color:#fff;margin-left:1em;text-decoration:underline}.twikoo .tk-regist-button{margin-top:1rem}.twikoo .tk-panel{color:#fff;box-sizing:border-box;width:100%;padding:2rem;position:absolute;top:0}.twikoo .tk-panel-title{justify-content:space-between;align-items:flex-end;font-size:1.5rem;display:flex}.twikoo .tk-panel-logout{color:#fff;font-size:1rem;text-decoration:underline}.twikoo .tk-panel .tk-tabs{border-bottom:2px solid #c0c4cc;margin-bottom:1em;display:flex}.twikoo .tk-panel .tk-tab{color:#c0c4cc;cursor:pointer;margin-bottom:-2px;margin-right:2em;line-height:2em}.twikoo .tk-panel .tk-tab.__active{color:#fff;border-bottom:2px solid #fff}.twikoo{position:relative}.twikoo svg{fill:currentColor;width:100%;height:100%}.twikoo .tk-expand{cursor:pointer;text-align:center;box-sizing:border-box;width:100%;padding:.75em;transition:all .5s}.twikoo .tk-expand:hover{background-color:#00000021}.twikoo .tk-expand:active{background-color:#00000030}.twikoo .tk-content img{vertical-align:middle;max-width:300px;max-height:300px;display:inline-block}.twikoo .tk-owo-emotion,.twikoo .OwO-item img{vertical-align:middle;width:3em;height:auto;display:inline-block}.twikoo .tk-admin-warn{color:#6b5900;box-sizing:border-box;background-color:#fff7d0;border-left:.5rem solid #e7c000;align-self:stretch;padding:1rem 1.5rem}.twikoo .tk-loading-parent--relative{position:relative}.twikoo .tk-loading-mask{z-index:2000;-webkit-backdrop-filter:opacity(20%);backdrop-filter:opacity(20%);background-color:#0000;justify-content:center;align-items:center;margin:0;transition:opacity .3s;display:flex;position:absolute;inset:0}.twikoo .tk-loading-spinner .circular{width:42px;height:42px;animation:2s linear infinite tk-loading-rotate}.twikoo .tk-loading-spinner .path{stroke:#409eff;stroke-width:2px;stroke-linecap:round;animation:1.5s ease-in-out infinite tk-loading-dash}@keyframes tk-loading-rotate{to{transform:rotate(360deg)}}@keyframes tk-loading-dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:90 150;stroke-dashoffset:-40px}to{stroke-dasharray:90 150;stroke-dashoffset:-120px}}.OwO{-webkit-user-select:none;user-select:none}.OwO.OwO-open .OwO-body{display:block}.OwO .OwO-logo{display:flex}.OwO .OwO-body{color:#4a4a4a;z-index:1000;background-color:#fff;border:1px solid #9093994f;border-radius:0 4px 4px;max-width:500px;display:none;position:absolute;top:2em;left:0;right:0}.night .OwO .OwO-body,.darkmode .OwO .OwO-body,.DarkMode .OwO .OwO-body,[data-theme=dark] .OwO .OwO-body,[data-user-color-scheme=dark] .OwO .OwO-body{color:#fff;background-color:#4a4a4a}.OwO .OwO-body .OwO-items{-webkit-user-select:none;user-select:none;margin:0;padding:10px 0 10px 10px;font-size:0;display:none;overflow:auto}.OwO .OwO-body .OwO-items .OwO-item{cursor:pointer;text-align:center;border-radius:5px;padding:5px 10px;font-size:12px;line-height:14px;list-style-type:none;transition:all .3s;display:inline-block}.OwO .OwO-body .OwO-items .OwO-item:hover{background-color:#90939921;box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.OwO .OwO-body .OwO-items-emoji .OwO-item{font-size:20px;line-height:19px}.OwO .OwO-body .OwO-items-image .OwO-item{box-sizing:border-box;width:14%}@media screen and (max-width:600px){#twikoo .OwO-items>.OwO-item{width:16%}}@media screen and (max-width:460px){#twikoo .OwO-items>.OwO-item{width:20%}}@media screen and (max-width:400px){#twikoo .OwO-items>.OwO-item{width:25%}}@media screen and (max-width:330px){#twikoo .OwO-items>.OwO-item{width:33%}}.OwO .OwO-body .OwO-items-image .OwO-item img{max-width:100%}.OwO .OwO-body .OwO-items-show{display:block}.twikoo .OwO .tk-owo-preview-panel{box-sizing:border-box;background-color:inherit;pointer-events:none;border:1px solid #9093994f;border-radius:4px;width:max-content;max-width:100%;height:auto;padding:8px;position:absolute;bottom:100%;right:0}.twikoo .OwO .tk-owo-preview-panel img{object-fit:contain;width:auto;max-width:min(180px,100%);height:auto;max-height:min(180px,40vh - 18px);display:block}.OwO .OwO-body .OwO-bar{border-top:1px solid #9093994f;border-radius:0 0 4px 4px;width:100%}.OwO .OwO-body .OwO-bar .OwO-packages{margin:0;padding:0;font-size:0}.OwO .OwO-body .OwO-bar .OwO-packages li{cursor:pointer;margin-right:3px;padding:0 10px;font-size:14px;line-height:30px;list-style-type:none;display:inline-block}.OwO .OwO-body .OwO-bar .OwO-packages li:first-child{border-radius:0 0 0 3px}.OwO .OwO-body .OwO-bar .OwO-packages li:hover{background-color:#90939921}.OwO .OwO-body .OwO-bar .OwO-packages .OwO-package-active{background-color:#90939921;transition:all .3s}\n/*$vite$:1*/"));document.head.appendChild(s);})();
2
+ (function(){if(typeof document==='undefined')return;var s=document.createElement('style');s.setAttribute('data-twikoo','');s.appendChild(document.createTextNode(".twikoo .tk-icon{line-height:1;display:inline-block}.twikoo .tk-icon svg{vertical-align:-.125em;fill:currentColor;height:1em}.twikoo .tk-action{align-items:center;display:flex}.twikoo .tk-action-link{appearance:none;cursor:pointer;color:#409eff;background:0 0;border:none;align-items:center;margin:0 0 0 .5rem;padding:0;text-decoration:none;display:flex}.twikoo .tk-action-link .tk-action-icon-solid,.twikoo .tk-action-link.tk-liked .tk-action-icon,.twikoo .tk-action-link:hover .tk-action-icon{display:none}.twikoo .tk-action-link.tk-liked .tk-action-icon-solid,.twikoo .tk-action-link:hover .tk-action-icon-solid{display:block}.twikoo .tk-action-link.tk-disliked .tk-action-icon,.twikoo .tk-action-link.tk-disliked:hover .tk-action-icon{display:none}.twikoo .tk-action-link.tk-disliked .tk-action-icon-solid,.twikoo .tk-action-link.tk-disliked:hover .tk-action-icon-solid{display:block}.twikoo .tk-action-count{height:1.5rem;margin-left:.25rem;font-size:.75rem;line-height:1.5rem}.twikoo .tk-action-icon{color:#409eff;width:1em;height:1em;line-height:0;display:inline-block}.twikoo .tk-avatar{text-align:center;border-radius:5px;flex-shrink:0;width:2.5rem;height:2.5rem;margin-right:1rem;overflow:hidden}.twikoo .tk-comment .tk-submit .tk-avatar,.twikoo .tk-replies .tk-avatar{width:1.6rem;height:1.6rem}.twikoo .tk-avatar.tk-has-avatar{background-color:#90939921}.twikoo .tk-avatar.tk-clickable{cursor:pointer}.twikoo .tk-avatar .tk-avatar-img{color:#c0c4cc;height:2.5rem;line-height:2.5rem}.twikoo .tk-avatar .tk-avatar-img .tk-icon,.twikoo .tk-avatar .tk-avatar-img .tk-icon svg{width:100%;height:100%;display:block}.twikoo .tk-avatar .tk-avatar-img img,.twikoo .tk-avatar img.tk-avatar-img{object-fit:cover;width:100%;height:100%}.twikoo .tk-comment .tk-submit .tk-avatar .tk-avatar-img,.twikoo .tk-replies .tk-avatar .tk-avatar-img{height:1.6rem;line-height:1.6rem}.twikoo .tk-input{align-items:center;width:100%;font-size:.875rem;display:inline-flex;position:relative}.twikoo .tk-input--group{display:inline-flex}.twikoo .tk-input__inner{color:currentColor;box-sizing:border-box;background-color:#0000;border:1px solid #9093994f;border-radius:4px;outline:none;width:100%;height:32px;padding:0 12px;font-size:.875rem;line-height:32px;transition:border-color .2s;display:inline-block}.twikoo .tk-input__inner:hover{border-color:#90939980}.twikoo .tk-input__inner:focus{border-color:#409eff}.twikoo .tk-input--small .tk-input__inner{height:32px;font-size:.8125rem;line-height:32px}.twikoo .tk-input--mini .tk-input__inner{height:28px;font-size:.75rem;line-height:28px}.twikoo .tk-textarea .tk-input__inner{resize:vertical;height:auto;min-height:66px;padding:6px 12px;line-height:1.5}.twikoo .tk-input.is-disabled .tk-input__inner{cursor:not-allowed;background-color:#9093990f}.twikoo .tk-input__inner[readonly]{cursor:default}.twikoo .tk-input input:invalid{border-color:#f56c6c}.twikoo .tk-input__inner[type=number]{appearance:textfield}.twikoo .tk-input__inner[type=number]::-webkit-inner-spin-button{appearance:none;margin:0}.twikoo .tk-input__inner[type=number]::-webkit-outer-spin-button{appearance:none;margin:0}.twikoo .tk-input__suffix{color:#c0c4cc;align-items:center;gap:4px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.twikoo .tk-input__icon{cursor:pointer;align-items:center;line-height:0;display:inline-flex}.twikoo .tk-input__icon:hover{color:#909399}.twikoo .tk-input__count{color:currentColor;background:0 0;font-size:.75rem;position:absolute;bottom:5px;right:10px}.twikoo .tk-input-group__prepend,.twikoo .tk-input-group__append{box-sizing:border-box;white-space:nowrap;color:currentColor;background-color:#90939921;background-clip:padding-box;border:1px solid #9093994f;border-radius:4px;align-items:center;height:32px;padding:0 1rem;line-height:32px;display:inline-flex}.twikoo .tk-input-group__prepend{border-right:0;border-top-right-radius:0;border-bottom-right-radius:0}.twikoo .tk-input-group__append{border-left:0;border-top-left-radius:0;border-bottom-left-radius:0}.twikoo .tk-input--group .tk-input__inner{border-radius:0}.twikoo .tk-input--small .tk-input-group__prepend,.twikoo .tk-input--small .tk-input-group__append{height:32px;font-size:.8125rem;line-height:32px}.twikoo .tk-input--mini .tk-input-group__prepend,.twikoo .tk-input--mini .tk-input-group__append{height:28px;font-size:.75rem;line-height:28px}.twikoo .tk-meta-input{display:flex}.twikoo .tk-meta-input .tk-input{flex:1;width:calc(33.3333% - .333333rem)}.twikoo .tk-meta-input .tk-input+.tk-input{margin-left:.5rem}.twikoo .tk-meta-input .tk-input-group__prepend{padding:0 1rem}@media screen and (max-width:767px){.twikoo .tk-meta-input{flex-direction:column}.twikoo .tk-meta-input .tk-input{width:auto}.twikoo .tk-meta-input .tk-input+.tk-input{margin-top:.5rem;margin-left:0}}.twikoo .tk-button{color:currentColor;cursor:pointer;white-space:nowrap;background-color:#90939910;border:1px solid #9093994f;border-radius:4px;padding:12px 20px;font-size:.875rem;line-height:1;transition:all .1s;display:inline-block}.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):active,.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):focus,.twikoo .tk-button:not(.tk-button--primary):not(.tk-button--text):not(.is-disabled):hover{color:#409eff;background-color:#409eff10;border-color:#409eff80}.twikoo .tk-button--primary{color:#fff;background:#409eff;border-color:#409eff}.twikoo .tk-button--primary:not(.is-disabled):focus,.twikoo .tk-button--primary:not(.is-disabled):hover{color:#fff;background:#66b1ff;border-color:#66b1ff}.twikoo .tk-button--primary:not(.is-disabled):active{color:#fff;background:#3a8ee6;border-color:#3a8ee6}.twikoo .tk-button--primary.is-disabled,.twikoo .tk-button--primary.is-disabled:active,.twikoo .tk-button--primary.is-disabled:focus,.twikoo .tk-button--primary.is-disabled:hover{color:#ffffffa1;background-color:#409eff80;border-color:#0000}.twikoo .tk-button--info{color:currentColor;background-color:#90939910;border-color:#9093994f}.twikoo .tk-button--large{padding:13px 20px;font-size:1rem}.twikoo .tk-button--small{border-radius:3px;padding:9px 15px;font-size:.75rem}.twikoo .tk-button--mini{border-radius:3px;padding:7px 15px;font-size:.75rem}.twikoo .tk-button--text{color:#409eff;background:0 0;border-color:#0000;padding-left:0;padding-right:0}.twikoo .tk-button--text:not(.is-disabled):focus,.twikoo .tk-button--text:not(.is-disabled):hover{color:#66b1ff;background:0 0}.twikoo .tk-button--text:not(.is-disabled):active{color:#3a8ee6}.twikoo .tk-button.is-disabled{opacity:.5;cursor:not-allowed}.twikoo .tk-button.is-loading{pointer-events:none;opacity:.7;cursor:wait}.twikoo .tk-button__spinner{margin-right:4px}.twikoo .tk-button__spinner svg{animation:.8s linear infinite tk-spin}.twikoo .tk-button+.tk-button{margin-left:.5rem}.twikoo .tk-input-group__append .tk-button,.twikoo .tk-input-group__prepend .tk-button{font-size:inherit}.twikoo .tk-input-group__append .tk-button{color:currentColor;background:0 0;border:0;border-radius:0 3px 3px 0;height:100%;margin:-1px -1rem;padding:0 15px}.twikoo .tk-input-group__append .tk-button:hover{color:#409eff}@keyframes tk-spin{to{transform:rotate(360deg)}}.twikoo .tk-submit{flex-direction:column;display:flex}.twikoo .tk-col{flex-direction:column;flex:1;display:flex}.twikoo .tk-meta-input{margin-bottom:.5rem}.twikoo .tk-row.actions{justify-content:flex-end;align-items:center;margin-top:1rem;margin-bottom:1rem;margin-left:3.5rem;position:relative}.twikoo .tk-row-actions-start{flex:1;align-items:center;display:flex}.twikoo .tk-submit-action-icon{cursor:pointer;flex-shrink:0;align-self:center;width:1.25em;margin-right:10px;line-height:0;display:inline-block}.twikoo .tk-submit-action-icon svg:hover{opacity:.8}.twikoo .tk-submit-action-icon .tk-icon,.twikoo .tk-submit-action-icon .tk-icon svg{width:100%}.twikoo .tk-submit-action-icon .tk-icon svg{height:auto}.twikoo .tk-submit-action-icon.__markdown{color:#909399}.twikoo .tk-input-image{display:none}.twikoo .tk-input{flex:1}.twikoo .tk-input .tk-textarea__inner{background-position:100% 100%;background-repeat:no-repeat}.twikoo .tk-turnstile-container,.twikoo .tk-geetest-container,.twikoo .tk-cap-container{z-index:1;position:absolute;bottom:-75px;right:0}.twikoo .tk-turnstile{flex-direction:column;display:flex}.twikoo .tk-preview-container{word-break:break-word;border:1px solid #8080804f;border-radius:4px;margin-bottom:1rem;margin-left:3rem;padding:5px 15px}.twikoo .tk-fade-in{animation:.3s tkFadeIn}@keyframes tkFadeIn{0%{opacity:0}to{opacity:1}}.twikoo .tk-main{flex:1;width:0}.twikoo .tk-row{flex-direction:row;flex:1;justify-content:space-between;display:flex}.twikoo .tk-nick-link{color:inherit;text-decoration:none}.twikoo .tk-replies .tk-nick-link{font-size:.9em}.twikoo .tk-nick-link:hover{color:#409eff}.twikoo .tk-actions{margin-left:1em;display:none}.twikoo .tk-actions button{appearance:none;color:#409eff;cursor:pointer;background:0 0;border:none;margin:0;padding:0;text-decoration:none;display:inline}.twikoo .tk-comment:hover .tk-actions{display:inline}.twikoo .tk-meta{flex-wrap:wrap;align-items:baseline;gap:.25em;display:flex}.twikoo .tk-actions button+button{margin-left:.25em}.twikoo .tk-extras{color:#999;flex-wrap:wrap;font-size:.875em;display:flex}.twikoo .tk-extra{align-items:center;margin-top:.5rem;margin-right:.75rem;display:flex}.twikoo .tk-icon.__comment{width:1em;height:1em;line-height:1;display:inline-flex}.twikoo .tk-extra-text{line-height:1}.twikoo .tk-tag{background-color:#f2f6fc;padding:0 .5em;font-size:.75em;display:inline-block}.twikoo .tk-tag-green{color:#67c23a;background-color:#67c23a21;border:1px solid #67c23a80;border-radius:2px}.twikoo .tk-tag-yellow{color:#e6a23c;background-color:#e6a23c21;border:1px solid #e6a23c80;border-radius:2px}.twikoo .tk-tag-blue{color:#409eff;background-color:#409eff21;border:1px solid #409eff80;border-radius:2px}.twikoo .tk-tag-red{color:#f56c6c;background-color:#f56c6c21;border:1px solid #f56c6c80;border-radius:2px}.twikoo .tk-comment{word-break:break-all;flex-direction:row;margin-top:1rem;display:flex}.twikoo .tk-content{max-height:500px;margin-top:.5rem;position:relative;overflow:hidden}.twikoo .tk-content-expand{max-height:none}.twikoo .tk-replies .tk-content{font-size:.9em}.twikoo .tk-comment .vemoji{vertical-align:middle;max-height:2em}.twikoo .tk-replies{max-height:200px;position:relative;overflow:hidden}.twikoo .tk-replies-expand{max-height:none;overflow:unset}.twikoo .tk-submit{margin-top:1rem}.twikoo .tk-expand{font-size:.75em}.twikoo .tk-lightbox{z-index:999;background-color:#0000004d;display:block;position:fixed;inset:0}.twikoo .tk-lightbox-image{background:linear-gradient(90deg,#eee 50%,#e3e3e3 0) 0 0/40px 100%;width:auto;min-width:100px;max-width:95%;height:auto;min-height:30px;max-height:95%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.twikoo .tk-error{color:#f56c6c;background-color:#f56c6c21;border:1px solid #f56c6c80;border-radius:4px;gap:8px;padding:12px;display:flex}.twikoo .tk-error__icon svg{width:20px;height:20px}.twikoo .tk-error__title{font-weight:600}.twikoo .tk-error__toggle{color:currentColor;opacity:.7;cursor:pointer;background:0 0;border:none;margin-top:4px;padding:0;font-size:.75rem}.twikoo .tk-error__detail{color:currentColor;opacity:.7;word-break:break-all;margin-top:6px;font-size:.75rem}.twikoo .tk-error__raw{white-space:pre-wrap;margin:4px 0 0}.twikoo .tk-comments-search{gap:.5rem;margin-bottom:1rem;display:flex}.twikoo .tk-comments-search .tk-input{flex:1}@media (max-width:480px){.twikoo .tk-comments-search{flex-wrap:wrap}.twikoo .tk-comments-search .tk-input{flex-basis:100%}}.twikoo .tk-comments-title{justify-content:space-between;align-items:center;gap:.75rem;margin-bottom:1rem;font-size:1.25rem;font-weight:700;line-height:1;display:flex}.twikoo .tk-comments-count.__hidden{visibility:hidden}.twikoo .tk-comments-count{white-space:nowrap;flex-shrink:0}.twikoo .tk-comments-actions{white-space:nowrap;align-items:center;gap:.5em;display:flex}.twikoo .tk-comments-container{flex-direction:column;min-height:10rem;display:flex}.twikoo .tk-comments-no{text-align:center;flex:1;justify-content:center;align-items:center;display:flex}.twikoo .tk-comments-sort{align-items:center;gap:.75em;margin-right:.5em;line-height:1;display:flex}.twikoo .tk-sort-item{cursor:pointer;color:#409eff99;background:0 0;border:0;align-items:center;padding:0;font-size:.75rem;line-height:1;display:inline-flex}.twikoo .tk-sort-item.__active{color:#409eff}.twikoo .tk-sort-item:focus{color:#409eff;outline:none}.twikoo .tk-icon.__comments{vertical-align:middle;cursor:pointer;color:#409eff;flex-shrink:0;justify-content:center;align-items:center;width:.75rem;height:.75rem;line-height:0;display:inline-flex}.twikoo .tk-icon.__comments.__active{color:#fff;background:#409eff;border-radius:.125rem;box-shadow:0 0 0 .2rem #409eff}.twikoo .tk-icon.__comments svg{width:100%;height:100%;display:block}.twikoo div.code-toolbar{border-radius:.3em;position:relative}.twikoo .tk-content pre,.twikoo .tk-preview-container pre{max-width:100%;overflow-x:auto}.twikoo .tk-content pre code,.twikoo .tk-preview-container pre code{white-space:pre;word-break:normal}.twikoo div.code-toolbar>.toolbar{font-size:.8125rem;font-weight:500;display:flex;position:absolute;top:4px;right:4px}.twikoo div.code-toolbar>.toolbar>.toolbar-item{margin-left:.3em}.twikoo div.code-toolbar>.toolbar>.toolbar-item>a,.twikoo div.code-toolbar>.toolbar>.toolbar-item>button,.twikoo div.code-toolbar>.toolbar>.toolbar-item>span{border-radius:.3em;padding:2px 4px}.twikoo div.code-toolbar>.toolbar>.toolbar-item>button{border:1px solid #8080804f}.twikoo div.code-toolbar>.toolbar>.toolbar-item>button:hover{cursor:pointer}.twikoo .tk-footer{text-align:end;color:#999;width:100%;margin-top:1em;font-size:.75em}.twikoo .tk-pagination,.twikoo .tk-pagination-pagers{display:flex}.twikoo .tk-pagination{flex-wrap:wrap;justify-content:space-between;align-items:center;width:100%}.twikoo .tk-pagination-options{align-items:center;display:flex}.twikoo .tk-pagination-pager{cursor:pointer;justify-content:center;align-items:center;width:2em;height:2em;display:flex}.twikoo .tk-pagination-pager.__current{color:#fff;pointer-events:none;background-color:#409eff}.twikoo .tk-pagination-size,.twikoo .tk-pagination-goto{width:50px;margin:0 .5em}.twikoo .tk-pagination .tk-input__inner{text-align:center;height:28px;padding:0}.twikoo .tk-admin-comment{flex-direction:column;align-items:center;display:flex}.twikoo .tk-admin-comment a{color:currentColor;text-decoration:underline}.twikoo .tk-admin-warn{margin-bottom:1em}.twikoo .tk-admin-security-alert{margin-bottom:0;padding-right:2.5rem;position:relative}.twikoo .tk-admin-security-alert .tk-admin-close{float:none;width:1rem;height:1rem;margin:0;padding:.5rem;line-height:0;position:absolute;top:0;right:0}.twikoo .tk-admin-security-alert-message{margin-bottom:.5em}.twikoo .tk-admin-security-alert-url{word-break:break-all;background:#0003;border-radius:4px;margin-bottom:.5em;padding:.5em}.twikoo .tk-admin-comment-filter{justify-content:center;align-items:center;width:100%;display:flex}.twikoo .tk-admin-comment-filter-keyword{flex:1}.twikoo .tk-admin-comment-filter-type{color:#fff;-webkit-appearance:none;-moz-appearance:none;background-color:#0003;border:1px solid #9093994f;border-radius:4px;height:32px;margin:0 .5em;padding:0 .5em;position:relative}.twikoo .tk-admin-comment-filter-type:focus{border-color:#409eff}.twikoo .tk-admin-comment-filter-type option{color:initial}.twikoo .tk-admin-comment-list{margin-top:1em}.twikoo .tk-admin-comment-list,.twikoo .tk-admin-comment-item{flex-direction:column;justify-content:stretch;width:100%;display:flex}.twikoo .tk-admin-comment-item{border-bottom:1px solid #ffffff80;margin-bottom:.5em;padding-bottom:.5em}.twikoo .tk-admin-comment-meta{flex-wrap:wrap;align-items:center;margin-bottom:.5em;display:flex}.twikoo .tk-admin-comment .tk-avatar{margin-right:.5em}.twikoo .tk-admin-comment .tk-content{max-height:none}.twikoo .tk-admin-actions{display:flex}.twikoo .tk-admin-comment-editor{margin-top:.5em}.twikoo .tk-admin-comment-editor-actions{justify-content:flex-end;gap:.5em;margin-top:.5em;display:flex}.twikoo .tk-admin-config-groups{padding-right:.5em;position:relative;overflow-y:auto}.twikoo .tk-admin-config-groups .tk-admin-config-group,.twikoo .tk-admin-config-groups .tk-admin-config-group-title{background:0 0}.twikoo .tk-admin-config-group-title{margin-top:1em;font-size:1.25rem;font-weight:700}.twikoo .tk-admin-config-item{grid-template-columns:30% 70%;align-items:center;margin-top:1em;display:grid;position:relative}.twikoo .tk-admin-config-title{text-align:right;text-overflow:ellipsis;white-space:nowrap;margin-right:1em;overflow:hidden}.twikoo .tk-admin-config-input{position:relative}.twikoo .tk-admin-config-select{appearance:none;box-sizing:border-box;color:#fff;cursor:pointer;font-size:inherit;background:url(\"data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.763-3.762L10.825 4z'/%3E%3C/svg%3E\") right 10px center no-repeat;border:1px solid #9093994f;border-radius:4px;outline:none;width:100%;height:32px;padding:0 30px 0 10px;line-height:32px;transition:border-color .2s cubic-bezier(.645,.045,.355,1);display:inline-block}.twikoo .tk-admin-config-select:focus{border-color:#fff9}.twikoo .tk-admin-config-select option{color:#fff;background:#333}.twikoo .tk-admin-config-desc{overflow-wrap:break-word;margin-top:.5em;font-size:.75em}.twikoo .tk-admin-config-actions{justify-content:center;align-items:center;margin-top:1em;display:flex}.twikoo .tk-admin-config-message{text-align:center;margin-top:.5em}.twikoo .tk-admin-config-email-test-desc{margin:1em 0}.twikoo .tk-admin-import{flex-direction:column;display:flex}.twikoo .tk-admin-import-label{margin-top:1em;font-size:1.25rem;font-weight:700}.twikoo .tk-admin-import select,.twikoo .tk-admin-import input,.twikoo .tk-admin-import .tk-button,.twikoo .tk-admin-import .tk-input{margin-top:1em}.twikoo .tk-admin-import-actions{display:flex}.twikoo .tk-admin-import-actions .tk-button{flex:1}.twikoo .tk-admin-import select{color:#fff;background-color:#0003;border:1px solid #9093994f;border-radius:4px;height:32px;padding:0 .5em}.twikoo .tk-admin-import select option{color:initial}.twikoo .tk-admin-container{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;overflow:hidden}.twikoo .tk-admin{pointer-events:all;color:#fff;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px);visibility:hidden;background-color:#000000d9;width:100%;height:100%;transition:all .5s;position:absolute;top:0;left:100%;overflow-y:auto}.twikoo .tk-admin::-webkit-scrollbar{background-color:#0000;width:5px}.twikoo .tk-admin::-webkit-scrollbar-track{background-color:#0000}.twikoo .tk-admin::-webkit-scrollbar-thumb{background-color:#ffffff4f}.twikoo .tk-admin.__show{visibility:visible;left:0}.twikoo .tk-admin-close{appearance:none;cursor:pointer;box-sizing:content-box;color:#fff;z-index:1;background:0 0;border:none;width:1rem;height:1rem;margin:0;padding:1rem;line-height:0;text-decoration:none;display:block;position:sticky;top:0;left:calc(100% - 3rem)}.twikoo .tk-login,.twikoo .tk-regist{box-sizing:border-box;flex-direction:column;align-items:center;width:100%;padding:0 2rem;display:flex}.twikoo .tk-login-title{color:#fff;text-align:center;margin-top:10rem;font-size:1.25rem}.twikoo .tk-login form,.twikoo .tk-regist form{text-align:center;width:100%}.twikoo .tk-password,.twikoo .tk-login-msg{color:#fff;text-align:center;width:80%;margin-top:1rem}.twikoo .tk-password .tk-input__inner{min-width:100px}.twikoo .tk-password .tk-input-group__prepend{color:#fff}.twikoo .tk-login-msg a{color:#fff;margin-left:1em;text-decoration:underline}.twikoo .tk-regist-button{margin-top:1rem}.twikoo .tk-panel{color:#fff;box-sizing:border-box;width:100%;padding:2rem;position:absolute;top:0}.twikoo .tk-panel-title{justify-content:space-between;align-items:flex-end;font-size:1.5rem;display:flex}.twikoo .tk-panel-logout{color:#fff;font-size:1rem;text-decoration:underline}.twikoo .tk-panel .tk-tabs{border-bottom:2px solid #c0c4cc;margin-bottom:1em;display:flex}.twikoo .tk-panel .tk-tab{color:#c0c4cc;cursor:pointer;margin-bottom:-2px;margin-right:2em;line-height:2em}.twikoo .tk-panel .tk-tab.__active{color:#fff;border-bottom:2px solid #fff}.twikoo{position:relative}.twikoo svg{fill:currentColor;width:100%;height:100%}.twikoo .tk-expand{cursor:pointer;text-align:center;box-sizing:border-box;width:100%;padding:.75em;transition:all .5s}.twikoo .tk-expand:hover{background-color:#00000021}.twikoo .tk-expand:active{background-color:#00000030}.twikoo .tk-content img{vertical-align:middle;max-width:300px;max-height:300px;display:inline-block}.twikoo .tk-owo-emotion,.twikoo .OwO-item img{vertical-align:middle;width:3em;height:auto;display:inline-block}.twikoo .tk-admin-warn{color:#6b5900;box-sizing:border-box;background-color:#fff7d0;border-left:.5rem solid #e7c000;align-self:stretch;padding:1rem 1.5rem}.twikoo .tk-loading-parent--relative{position:relative}.twikoo .tk-loading-mask{z-index:2000;-webkit-backdrop-filter:opacity(20%);backdrop-filter:opacity(20%);background-color:#0000;justify-content:center;align-items:center;margin:0;transition:opacity .3s;display:flex;position:absolute;inset:0}.twikoo .tk-loading-spinner .circular{width:42px;height:42px;animation:2s linear infinite tk-loading-rotate}.twikoo .tk-loading-spinner .path{stroke:#409eff;stroke-width:2px;stroke-linecap:round;animation:1.5s ease-in-out infinite tk-loading-dash}@keyframes tk-loading-rotate{to{transform:rotate(360deg)}}@keyframes tk-loading-dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:90 150;stroke-dashoffset:-40px}to{stroke-dasharray:90 150;stroke-dashoffset:-120px}}.OwO{-webkit-user-select:none;user-select:none}.OwO.OwO-open .OwO-body{display:block}.OwO .OwO-logo{display:flex}.OwO .OwO-body{color:#4a4a4a;z-index:1000;background-color:#fff;border:1px solid #9093994f;border-radius:0 4px 4px;max-width:500px;display:none;position:absolute;top:2em;left:0;right:0}.night .OwO .OwO-body,.darkmode .OwO .OwO-body,.DarkMode .OwO .OwO-body,[data-theme=dark] .OwO .OwO-body,[data-user-color-scheme=dark] .OwO .OwO-body{color:#fff;background-color:#4a4a4a}.OwO .OwO-body .OwO-items{-webkit-user-select:none;user-select:none;margin:0;padding:10px 0 10px 10px;font-size:0;display:none;overflow:auto}.OwO .OwO-body .OwO-items .OwO-item{cursor:pointer;text-align:center;border-radius:5px;padding:5px 10px;font-size:12px;line-height:14px;list-style-type:none;transition:all .3s;display:inline-block}.OwO .OwO-body .OwO-items .OwO-item:hover{background-color:#90939921;box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.OwO .OwO-body .OwO-items-emoji .OwO-item{font-size:20px;line-height:19px}.OwO .OwO-body .OwO-items-image .OwO-item{box-sizing:border-box;width:14%}@media screen and (max-width:600px){#twikoo .OwO-items>.OwO-item{width:16%}}@media screen and (max-width:460px){#twikoo .OwO-items>.OwO-item{width:20%}}@media screen and (max-width:400px){#twikoo .OwO-items>.OwO-item{width:25%}}@media screen and (max-width:330px){#twikoo .OwO-items>.OwO-item{width:33%}}.OwO .OwO-body .OwO-items-image .OwO-item img{max-width:100%}.OwO .OwO-body .OwO-items-show{display:block}.twikoo .OwO .tk-owo-preview-panel{box-sizing:border-box;background-color:inherit;pointer-events:none;border:1px solid #9093994f;border-radius:4px;width:max-content;max-width:100%;height:auto;padding:8px;position:absolute;bottom:100%;right:0}.twikoo .OwO .tk-owo-preview-panel img{object-fit:contain;width:auto;max-width:min(180px,100%);height:auto;max-height:min(180px,40vh - 18px);display:block}.OwO .OwO-body .OwO-bar{border-top:1px solid #9093994f;border-radius:0 0 4px 4px;width:100%}.OwO .OwO-body .OwO-bar .OwO-packages{margin:0;padding:0;font-size:0}.OwO .OwO-body .OwO-bar .OwO-packages li{cursor:pointer;margin-right:3px;padding:0 10px;font-size:14px;line-height:30px;list-style-type:none;display:inline-block}.OwO .OwO-body .OwO-bar .OwO-packages li:first-child{border-radius:0 0 0 3px}.OwO .OwO-body .OwO-bar .OwO-packages li:hover{background-color:#90939921}.OwO .OwO-body .OwO-bar .OwO-packages .OwO-package-active{background-color:#90939921;transition:all .3s}\n/*$vite$:1*/"));document.head.appendChild(s);})();
3
3
  (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.twikoo={}))})(this,function(e){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t,t.exports),e=null),t.exports),c=(e,t)=>{let r={};for(var i in e)n(r,i,{get:e[i],enumerable:!0});return t||n(r,Symbol.toStringTag,{value:`Module`}),r},l=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},u=(e,r,i)=>(i=e==null?{}:t(a(e)),l(r||!e||!e.__esModule||!o.call(e,`default`)?n(i,`default`,{value:e,enumerable:!0}):i,e)),d;(function(e){e.local=`local`,e.none=`none`,e.session=`session`})(d||={});var f=function(){function e(){}return e}(),p=function(){function e(){}return e}();function m(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;for(var a in n)i===``?!r&&(t+=`?`):i+=`&`,i+=a+`=`+encodeURIComponent(n[a]);return t+=i,/^http(s)?\:\/\//.test(t)?t:``+e+t}var h=c({AbstractSDKRequest:()=>f,AbstractStorage:()=>p,StorageType:()=>d,formatUrl:()=>m});function g(e){this.message=e}g.prototype=Error(),g.prototype.name=`InvalidCharacterError`;var _=typeof window<`u`&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,``);if(t.length%4==1)throw new g(`'atob' failed: The string to be decoded is not correctly encoded.`);for(var n,r,i=0,a=0,o=``;r=t.charAt(a++);~r&&(n=i%4?64*n+r:r,i++%4)&&(o+=String.fromCharCode(255&n>>(-2*i&6))))r=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=`.indexOf(r);return o};function v(e){var t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw`Illegal base64url string!`}try{return function(e){return decodeURIComponent(_(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n=`0`+n),`%`+n})))}(t)}catch{return _(t)}}function y(e){this.message=e}function b(e,t){if(typeof e!=`string`)throw new y(`Invalid token specified`);var n=!0===(t||={}).header?0:1;try{return JSON.parse(v(e.split(`.`)[n]))}catch(e){throw new y(`Invalid token specified: `+e.message)}}y.prototype=Error(),y.prototype.name=`InvalidTokenError`;function x(){}function S(e){return typeof e==`object`&&!!e||typeof e==`function`}var C=x;function w(e,t){try{Object.defineProperty(e,"name",{value:t,configurable:!0})}catch{}}var T=Promise,E=Promise.resolve.bind(T),D=Promise.prototype.then,ee=Promise.reject.bind(T),te=E;function O(e){return new T(e)}function k(e){return O(t=>t(e))}function A(e){return ee(e)}function ne(e,t,n){return D.call(e,t,n)}function re(e,t,n){ne(ne(e,t,n),void 0,C)}function ie(e,t){re(e,t)}function ae(e,t){re(e,void 0,t)}function oe(e,t,n){return ne(e,t,n)}function se(e){ne(e,void 0,C)}var ce=e=>{if(typeof queueMicrotask==`function`)ce=queueMicrotask;else{let e=k(void 0);ce=t=>ne(e,t)}return ce(e)};function le(e,t,n){if(typeof e!=`function`)throw TypeError(`Argument is not a function`);return Function.prototype.apply.call(e,t,n)}function ue(e,t,n){try{return k(le(e,t,n))}catch(e){return A(e)}}var de=class{constructor(){this._cursor=0,this._size=0,this._front={_elements:[],_next:void 0},this._back=this._front,this._cursor=0,this._size=0}get length(){return this._size}push(e){let t=this._back,n=t;t._elements.length===16383&&(n={_elements:[],_next:void 0}),t._elements.push(e),n!==t&&(this._back=n,t._next=n),++this._size}shift(){let e=this._front,t=e,n=this._cursor,r=n+1,i=e._elements,a=i[n];return r===16384&&(t=e._next,r=0),--this._size,this._cursor=r,e!==t&&(this._front=t),i[n]=void 0,a}forEach(e){let t=this._cursor,n=this._front,r=n._elements;for(;!(t===r.length&&n._next===void 0||t===r.length&&(n=n._next,r=n._elements,t=0,r.length===0));)e(r[t]),++t}peek(){let e=this._front,t=this._cursor;return e._elements[t]}},fe=Symbol(`[[AbortSteps]]`),pe=Symbol(`[[ErrorSteps]]`),me=Symbol(`[[CancelSteps]]`),he=Symbol(`[[PullSteps]]`),ge=Symbol(`[[CanPullSyncSteps]]`),_e=Symbol(`[[ReleaseSteps]]`);function ve(e,t){e._ownerReadableStream=t,t._reader=e,t._state===`readable`?xe(e):t._state===`closed`?function(e){xe(e),we(e)}(e):Se(e,t._storedError)}function j(e,t){return Tr(e._ownerReadableStream,t)}function ye(e){let t=e._ownerReadableStream;t._state===`readable`?Ce(e,TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)):function(e,t){Se(e,t)}(e,TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`)),t._readableStreamController[_e](),t._reader=void 0,e._ownerReadableStream=void 0}function be(e){return TypeError(`Cannot `+e+` a stream using a released reader`)}function xe(e){e._closedPromise=O((t,n)=>{e._closedPromise_resolve=t,e._closedPromise_reject=n})}function Se(e,t){xe(e),Ce(e,t)}function Ce(e,t){e._closedPromise_reject!==void 0&&(se(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}function we(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0)}var Te=Number.isFinite||function(e){return typeof e==`number`&&isFinite(e)},M=Math.trunc||function(e){return e<0?Math.ceil(e):Math.floor(e)};function Ee(e,t){if(e!==void 0&&typeof(n=e)!=`object`&&typeof n!=`function`)throw TypeError(`${t} is not an object.`);var n}function N(e,t){if(typeof e!=`function`)throw TypeError(`${t} is not a function.`)}function P(e,t){if(!function(e){return typeof e==`object`&&!!e||typeof e==`function`}(e))throw TypeError(`${t} is not an object.`)}function De(e,t,n){if(e===void 0)throw TypeError(`Parameter ${t} is required in '${n}'.`)}function Oe(e,t,n){if(e===void 0)throw TypeError(`${t} is required in '${n}'.`)}function ke(e){return Number(e)}function Ae(e){return e===0?0:e}function je(e,t){let n=2**53-1,r=Number(e);if(r=Ae(r),!Te(r))throw TypeError(`${t} is not a finite number`);if(r=function(e){return Ae(M(e))}(r),r<0||r>n)throw TypeError(`${t} is outside the accepted range of 0 to ${n}, inclusive`);return Te(r)&&r!==0?r:0}function Me(e,t){if(!Cr(e))throw TypeError(`${t} is not a ReadableStream.`)}function Ne(e){return new Re(e)}function Pe(e,t){e._reader._readRequests.push(t)}function Fe(e,t,n){let r=e._reader._readRequests.shift();n?r._closeSteps():r._chunkSteps(t)}function Ie(e){return e._reader._readRequests.length}function Le(e){let t=e._reader;return t!==void 0&&!!Ve(t)}var Re=class{constructor(e){if(De(e,1,`ReadableStreamDefaultReader`),Me(e,`First parameter`),wr(e))throw TypeError(`This stream has already been locked for exclusive reading by another reader`);ve(this,e),this._readRequests=new de}get closed(){return Ve(this)?this._closedPromise:A(Ge(`closed`))}cancel(e=void 0){return Ve(this)?this._ownerReadableStream===void 0?A(be(`cancel`)):j(this,e):A(Ge(`cancel`))}read(){if(!Ve(this))return A(Ge(`read`));if(this._ownerReadableStream===void 0)return A(be(`read from`));let e=Ue(this)?new Be:new ze;return He(this,e),e._promise}releaseLock(){if(!Ve(this))throw Ge(`releaseLock`);this._ownerReadableStream!==void 0&&function(e){ye(e),We(e,TypeError(`Reader was released`))}(this)}};Object.defineProperties(Re.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),w(Re.prototype.cancel,`cancel`),w(Re.prototype.read,`read`),w(Re.prototype.releaseLock,`releaseLock`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Re.prototype,Symbol.toStringTag,{value:`ReadableStreamDefaultReader`,configurable:!0});var ze=class{constructor(){this._promise=O((e,t)=>{this._resolvePromise=e,this._rejectPromise=t})}_chunkSteps(e){this._resolvePromise({value:e,done:!1})}_closeSteps(){this._resolvePromise({value:void 0,done:!0})}_errorSteps(e){this._rejectPromise(e)}},Be=class{constructor(){this._promise=void 0}_chunkSteps(e){this._promise=te({value:e,done:!1})}_closeSteps(){this._promise=te({value:void 0,done:!0})}_errorSteps(e){this._promise=A(e)}};function Ve(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_readRequests`)&&e instanceof Re}function He(e,t){let n=e._ownerReadableStream;n._disturbed=!0,n._state===`closed`?t._closeSteps():n._state===`errored`?t._errorSteps(n._storedError):n._readableStreamController[he](t)}function Ue(e){let t=e._ownerReadableStream;return t._state===`closed`||t._state===`errored`||t._readableStreamController[ge]()}function We(e,t){let n=e._readRequests;e._readRequests=new de,n.forEach(e=>{e._errorSteps(t)})}function Ge(e){return TypeError(`ReadableStreamDefaultReader.prototype.${e} can only be used on a ReadableStreamDefaultReader`)}function Ke(e){return e.slice()}function qe(e,t,n,r,i){new Uint8Array(e).set(new Uint8Array(n,r,i),t)}var Je=e=>(Je=typeof e.transfer==`function`?e=>e.transfer():typeof structuredClone==`function`?e=>structuredClone(e,{transfer:[e]}):e=>e,Je(e)),Ye=e=>(Ye=typeof e.detached==`boolean`?e=>e.detached:e=>e.byteLength===0,Ye(e));function F(e,t,n){if(e.slice)return e.slice(t,n);let r=n-t,i=new ArrayBuffer(r);return qe(i,0,e,t,r),i}function Xe(e,t){let n=e[t];if(n!=null){if(typeof n!=`function`)throw TypeError(`${String(t)} is not a function`);return n}}function Ze(e){try{let t=e.done,n=e.value;return ne(te(n),e=>({done:t,value:e}))}catch(e){return A(e)}}var Qe=Symbol.asyncIterator??Symbol.for?.call(Symbol,`Symbol.asyncIterator`)??`@@asyncIterator`;function $e(e,t=`sync`,n){if(n===void 0){if(t===`async`){if((n=Xe(e,Qe))===void 0)return function(e){let t={next(){let t;try{t=et(e)}catch(e){return A(e)}return Ze(t)},return(t){let n;try{let r=Xe(e.iterator,`return`);if(r===void 0)return k({done:!0,value:t});n=le(r,e.iterator,[t])}catch(e){return A(e)}return S(n)?Ze(n):A(TypeError(`The iterator.return() method must return an object`))}};return{iterator:t,nextMethod:t.next,done:!1}}($e(e,`sync`,Xe(e,Symbol.iterator)))}else n=Xe(e,Symbol.iterator)}if(n===void 0)throw TypeError(`The object is not iterable`);let r=le(n,e,[]);if(!S(r))throw TypeError(`The iterator method must return an object`);return{iterator:r,nextMethod:r.next,done:!1}}function et(e){let t=le(e.nextMethod,e.iterator,[]);if(!S(t))throw TypeError(`The iterator.next() method must return an object`);return t}var I=class{constructor(e,t){this._ongoingPromise=void 0,this._isFinished=!1,this._reader=e,this._preventCancel=t}next(){let e=()=>this._nextSteps();return this._ongoingPromise=this._ongoingPromise?oe(this._ongoingPromise,e,e):e(),this._ongoingPromise}return(e){let t=()=>this._returnSteps(e);return this._ongoingPromise=this._ongoingPromise?oe(this._ongoingPromise,t,t):t(),this._ongoingPromise}_nextSteps(){if(this._isFinished)return Promise.resolve({value:void 0,done:!0});let e=this._reader,t=new tt(this);return He(e,t),t._promise}_returnSteps(e){if(this._isFinished)return Promise.resolve({value:e,done:!0});this._isFinished=!0;let t=this._reader;if(!this._preventCancel){let n=j(t,e);return ye(t),oe(n,()=>({value:e,done:!0}))}return ye(t),k({value:e,done:!0})}},tt=class{constructor(e){this._iterator=e,this._promise=O((e,t)=>{this._resolvePromise=e,this._rejectPromise=t})}_chunkSteps(e){this._iterator._ongoingPromise=void 0,ce(()=>this._resolvePromise({value:e,done:!1}))}_closeSteps(){let e=this._iterator;e._ongoingPromise=void 0,e._isFinished=!0,ye(e._reader),this._resolvePromise({value:void 0,done:!0})}_errorSteps(e){let t=this._iterator;t._ongoingPromise=void 0,t._isFinished=!0,ye(t._reader),this._rejectPromise(e)}},L={next(){return R(this)?this._asyncIteratorImpl.next():A(nt(`next`))},return(e){return R(this)?this._asyncIteratorImpl.return(e):A(nt(`return`))},[Qe](){return this}};function R(e){if(!S(e)||!Object.prototype.hasOwnProperty.call(e,`_asyncIteratorImpl`))return!1;try{return e._asyncIteratorImpl instanceof I}catch{return!1}}function nt(e){return TypeError(`ReadableStreamAsyncIterator.${e} can only be used on a ReadableSteamAsyncIterator`)}Object.defineProperty(L,Qe,{enumerable:!1});var rt=Number.isNaN||function(e){return e!=e};function it(e){let t=F(e.buffer,e.byteOffset,e.byteOffset+e.byteLength);return new Uint8Array(t)}function at(e){let t=e._queue.shift();return e._queueTotalSize-=t.size,e._queueTotalSize<0&&(e._queueTotalSize=0),t.value}function z(e,t,n){if(typeof(r=n)!=`number`||rt(r)||r<0||n===1/0)throw RangeError(`Size must be a finite, non-NaN, non-negative number.`);var r;e._queue.push({value:t,size:n}),e._queueTotalSize+=n}function ot(e){e._queue=new de,e._queueTotalSize=0}function st(e){return e===DataView}function ct(e){return st(e)?1:e.BYTES_PER_ELEMENT}var lt=class{constructor(){throw TypeError(`Illegal constructor`)}get view(){if(!ft(this))throw Pt(`view`);return this._view}respond(e){if(!ft(this))throw Pt(`respond`);if(De(e,1,`respond`),e=je(e,`First parameter`),this._associatedReadableByteStreamController===void 0)throw TypeError(`This BYOB request has been invalidated`);if(Ye(this._view.buffer))throw TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);jt(this._associatedReadableByteStreamController,e)}respondWithNewView(e){if(!ft(this))throw Pt(`respondWithNewView`);if(De(e,1,`respondWithNewView`),!ArrayBuffer.isView(e))throw TypeError(`You can only respond with array buffer views`);if(this._associatedReadableByteStreamController===void 0)throw TypeError(`This BYOB request has been invalidated`);if(Ye(e.buffer))throw TypeError(`The given view's buffer has been detached and so cannot be used as a response`);Mt(this._associatedReadableByteStreamController,e)}};Object.defineProperties(lt.prototype,{respond:{enumerable:!0},respondWithNewView:{enumerable:!0},view:{enumerable:!0}}),w(lt.prototype.respond,`respond`),w(lt.prototype.respondWithNewView,`respondWithNewView`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(lt.prototype,Symbol.toStringTag,{value:`ReadableStreamBYOBRequest`,configurable:!0});var ut=class{constructor(){throw TypeError(`Illegal constructor`)}get byobRequest(){if(!dt(this))throw Ft(`byobRequest`);return kt(this)}get desiredSize(){if(!dt(this))throw Ft(`desiredSize`);return At(this)}close(){if(!dt(this))throw Ft(`close`);if(this._closeRequested)throw TypeError(`The stream has already been closed; do not close it again!`);let e=this._controlledReadableByteStream._state;if(e!==`readable`)throw TypeError(`The stream (in ${e} state) is not in the readable state and cannot be closed`);U(this)}enqueue(e){if(!dt(this))throw Ft(`enqueue`);if(De(e,1,`enqueue`),!ArrayBuffer.isView(e))throw TypeError(`chunk must be an array buffer view`);if(e.byteLength===0)throw TypeError(`chunk must have non-zero byteLength`);if(e.buffer.byteLength===0)throw TypeError(`chunk's buffer must have non-zero byteLength`);if(this._closeRequested)throw TypeError(`stream is closed or draining`);let t=this._controlledReadableByteStream._state;if(t!==`readable`)throw TypeError(`The stream (in ${t} state) is not in the readable state and cannot be enqueued to`);Et(this,e)}error(e=void 0){if(!dt(this))throw Ft(`error`);Dt(this,e)}[me](e){mt(this),ot(this);let t=this._cancelAlgorithm(e);return H(this),t}[he](e){let t=this._controlledReadableByteStream;if(this._queueTotalSize>0)return void Ot(this,e);let n=this._autoAllocateChunkSize;if(n!==void 0){let t;try{t=new ArrayBuffer(n)}catch(t){e._errorSteps(t);return}let r={buffer:t,bufferByteLength:n,byteOffset:0,byteLength:n,bytesFilled:0,minimumFill:1,elementSize:1,viewConstructor:Uint8Array,readerType:`default`};this._pendingPullIntos.push(r)}Pe(t,e),pt(this)}[ge](){return this._queueTotalSize>0}[_e](){if(this._pendingPullIntos.length>0){let e=this._pendingPullIntos.peek();e.readerType=`none`,this._pendingPullIntos=new de,this._pendingPullIntos.push(e)}}};function dt(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_controlledReadableByteStream`)&&e instanceof ut}function ft(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_associatedReadableByteStreamController`)&&e instanceof lt}function pt(e){if(function(e){let t=e._controlledReadableByteStream;return t._state!==`readable`||e._closeRequested||!e._started?!1:!!(Le(t)&&Ie(t)>0||Bt(t)&&zt(t)>0||At(e)>0)}(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,re(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,pt(e)),null),t=>(Dt(e,t),null))}}function mt(e){wt(e),e._pendingPullIntos=new de}function ht(e,t){let n=!1;e._state===`closed`&&(n=!0);let r=_t(t);t.readerType==="default"?Fe(e,r,n):function(e,t,n){let r=e._reader._readIntoRequests.shift();n?r._closeSteps(t):r._chunkSteps(t)}(e,r,n)}function gt(e,t){for(let n=0;n<t.length;++n)ht(e,t[n])}function _t(e){let t=e.bytesFilled,n=e.elementSize;return new e.viewConstructor(e.buffer,e.byteOffset,t/n)}function vt(e,t,n,r){e._queue.push({buffer:t,byteOffset:n,byteLength:r}),e._queueTotalSize+=r}function yt(e,t,n,r){let i;try{i=F(t,n,n+r)}catch(t){throw Dt(e,t),t}vt(e,i,0,r)}function bt(e,t){t.bytesFilled>0&&yt(e,t.buffer,t.byteOffset,t.bytesFilled),V(e)}function xt(e,t){let n=Math.min(e._queueTotalSize,t.byteLength-t.bytesFilled),r=t.bytesFilled+n,i=n,a=!1,o=r-r%t.elementSize;o>=t.minimumFill&&(i=o-t.bytesFilled,a=!0);let s=e._queue;for(;i>0;){let n=s.peek(),r=Math.min(i,n.byteLength),a=t.byteOffset+t.bytesFilled;qe(t.buffer,a,n.buffer,n.byteOffset,r),n.byteLength===r?s.shift():(n.byteOffset+=r,n.byteLength-=r),e._queueTotalSize-=r,St(e,r,t),i-=r}return a}function St(e,t,n){n.bytesFilled+=t}function Ct(e){e._queueTotalSize===0&&e._closeRequested?(H(e),Er(e._controlledReadableByteStream)):pt(e)}function wt(e){e._byobRequest!==null&&(e._byobRequest._associatedReadableByteStreamController=void 0,e._byobRequest._view=null,e._byobRequest=null)}function B(e){let t=[];for(;e._pendingPullIntos.length>0&&e._queueTotalSize!==0;){let n=e._pendingPullIntos.peek();xt(e,n)&&(V(e),t.push(n))}return t}function Tt(e,t){let n=e._pendingPullIntos.peek();wt(e),e._controlledReadableByteStream._state===`closed`?function(e,t){t.readerType===`none`&&V(e);let n=e._controlledReadableByteStream;if(Bt(n)){let t=[];for(;t.length<zt(n);)t.push(V(e));gt(n,t)}}(e,n):function(e,t,n){if(St(0,t,n),n.readerType===`none`){bt(e,n);let t=B(e);gt(e._controlledReadableByteStream,t);return}if(n.bytesFilled<n.minimumFill)return;V(e);let r=n.bytesFilled%n.elementSize;if(r>0){let t=n.byteOffset+n.bytesFilled;yt(e,n.buffer,t-r,r)}n.bytesFilled-=r;let i=B(e);ht(e._controlledReadableByteStream,n),gt(e._controlledReadableByteStream,i)}(e,t,n),pt(e)}function V(e){return e._pendingPullIntos.shift()}function H(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0}function U(e){let t=e._controlledReadableByteStream;if(!e._closeRequested&&t._state===`readable`){if(e._queueTotalSize>0)e._closeRequested=!0;else{if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(t.bytesFilled%t.elementSize!==0){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);throw Dt(e,t),t}}H(e),Er(t)}}}function Et(e,t){let n=e._controlledReadableByteStream;if(e._closeRequested||n._state!==`readable`)return;let{buffer:r,byteOffset:i,byteLength:a}=t;if(Ye(r))throw TypeError(`chunk's buffer is detached and so cannot be enqueued`);let o=Je(r);if(e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek();if(Ye(t.buffer))throw TypeError(`The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk`);wt(e),t.buffer=Je(t.buffer),t.readerType===`none`&&bt(e,t)}Le(n)?(function(e){let t=e._controlledReadableByteStream._reader;for(;t._readRequests.length>0;){if(e._queueTotalSize===0)return;Ot(e,t._readRequests.shift())}}(e),Ie(n)===0?vt(e,o,i,a):(e._pendingPullIntos.length>0&&V(e),Fe(n,new Uint8Array(o,i,a),!1))):Bt(n)?(vt(e,o,i,a),gt(n,B(e))):vt(e,o,i,a),pt(e)}function Dt(e,t){let n=e._controlledReadableByteStream;n._state===`readable`&&(mt(e),ot(e),H(e),Dr(n,t))}function Ot(e,t){let n=e._queue.shift();e._queueTotalSize-=n.byteLength,Ct(e);let r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);t._chunkSteps(r)}function kt(e){if(e._byobRequest===null&&e._pendingPullIntos.length>0){let t=e._pendingPullIntos.peek(),n=new Uint8Array(t.buffer,t.byteOffset+t.bytesFilled,t.byteLength-t.bytesFilled),r=Object.create(lt.prototype);(function(e,t,n){e._associatedReadableByteStreamController=t,e._view=n})(r,e,n),e._byobRequest=r}return e._byobRequest}function At(e){let t=e._controlledReadableByteStream._state;return t===`errored`?null:t===`closed`?0:e._strategyHWM-e._queueTotalSize}function jt(e,t){let n=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state===`closed`){if(t!==0)throw TypeError(`bytesWritten must be 0 when calling respond() on a closed stream`)}else{if(t===0)throw TypeError(`bytesWritten must be greater than 0 when calling respond() on a readable stream`);if(n.bytesFilled+t>n.byteLength)throw RangeError(`bytesWritten out of range`)}n.buffer=Je(n.buffer),Tt(e,t)}function Mt(e,t){let n=e._pendingPullIntos.peek();if(e._controlledReadableByteStream._state===`closed`){if(t.byteLength!==0)throw TypeError(`The view's length must be 0 when calling respondWithNewView() on a closed stream`)}else if(t.byteLength===0)throw TypeError(`The view's length must be greater than 0 when calling respondWithNewView() on a readable stream`);if(n.byteOffset+n.bytesFilled!==t.byteOffset)throw RangeError(`The region specified by view does not match byobRequest`);if(n.bufferByteLength!==t.buffer.byteLength)throw RangeError(`The buffer of view has different capacity than byobRequest`);if(n.bytesFilled+t.byteLength>n.byteLength)throw RangeError(`The region specified by view is larger than byobRequest`);let r=t.byteLength;n.buffer=Je(t.buffer),Tt(e,r)}function Nt(e,t,n,r,i,a,o){t._controlledReadableByteStream=e,t._pullAgain=!1,t._pulling=!1,t._byobRequest=null,t._queue=t._queueTotalSize=void 0,ot(t),t._closeRequested=!1,t._started=!1,t._strategyHWM=a,t._pullAlgorithm=r,t._cancelAlgorithm=i,t._autoAllocateChunkSize=o,t._pendingPullIntos=new de,e._readableStreamController=t,re(k(n()),()=>(t._started=!0,pt(t),null),e=>(Dt(t,e),null))}function Pt(e){return TypeError(`ReadableStreamBYOBRequest.prototype.${e} can only be used on a ReadableStreamBYOBRequest`)}function Ft(e){return TypeError(`ReadableByteStreamController.prototype.${e} can only be used on a ReadableByteStreamController`)}function It(e,t){if((e=`${e}`)!=`byob`)throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamReaderMode`);return e}function Lt(e){return new Vt(e)}function Rt(e,t){e._reader._readIntoRequests.push(t)}function zt(e){return e._reader._readIntoRequests.length}function Bt(e){let t=e._reader;return t!==void 0&&!!Wt(t)}Object.defineProperties(ut.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},byobRequest:{enumerable:!0},desiredSize:{enumerable:!0}}),w(ut.prototype.close,`close`),w(ut.prototype.enqueue,`enqueue`),w(ut.prototype.error,`error`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(ut.prototype,Symbol.toStringTag,{value:`ReadableByteStreamController`,configurable:!0});var Vt=class{constructor(e){if(De(e,1,`ReadableStreamBYOBReader`),Me(e,`First parameter`),wr(e))throw TypeError(`This stream has already been locked for exclusive reading by another reader`);if(!dt(e._readableStreamController))throw TypeError(`Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte source`);ve(this,e),this._readIntoRequests=new de}get closed(){return Wt(this)?this._closedPromise:A(qt(`closed`))}cancel(e=void 0){return Wt(this)?this._ownerReadableStream===void 0?A(be(`cancel`)):j(this,e):A(qt(`cancel`))}read(e,t={}){if(!Wt(this))return A(qt(`read`));if(!ArrayBuffer.isView(e))return A(TypeError(`view must be an array buffer view`));if(e.byteLength===0)return A(TypeError(`view must have non-zero byteLength`));if(e.buffer.byteLength===0)return A(TypeError(`view's buffer must have non-zero byteLength`));if(Ye(e.buffer))return A(TypeError(`view's buffer has been detached`));let n;try{n=function(e,t){return Ee(e,t),{min:je(e?.min??1,`${t} has member 'min' that`)}}(t,`options`)}catch(e){return A(e)}let r=n.min;if(r===0)return A(TypeError(`options.min must be greater than 0`));if(function(e){return st(e.constructor)}(e)){if(r>e.byteLength)return A(RangeError(`options.min must be less than or equal to view's byteLength`))}else if(r>e.length)return A(RangeError(`options.min must be less than or equal to view's length`));if(this._ownerReadableStream===void 0)return A(be(`read from`));let i=function(e,t,n){let r=e._ownerReadableStream;return r._state===`errored`||function(e,t,n){let r=e._controlledReadableByteStream,i=ct(t.constructor),{byteLength:a}=t,o=n*i;return!(e._pendingPullIntos.length>0)&&(r._state===`closed`||e._queueTotalSize>=o)}(r._readableStreamController,t,n)}(this,e,r)?new Ut:new Ht;return Gt(this,e,r,i),i._promise}releaseLock(){if(!Wt(this))throw qt(`releaseLock`);this._ownerReadableStream!==void 0&&function(e){ye(e),Kt(e,TypeError(`Reader was released`))}(this)}};Object.defineProperties(Vt.prototype,{cancel:{enumerable:!0},read:{enumerable:!0},releaseLock:{enumerable:!0},closed:{enumerable:!0}}),w(Vt.prototype.cancel,`cancel`),w(Vt.prototype.read,`read`),w(Vt.prototype.releaseLock,`releaseLock`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Vt.prototype,Symbol.toStringTag,{value:`ReadableStreamBYOBReader`,configurable:!0});var Ht=class{constructor(){this._promise=O((e,t)=>{this._resolvePromise=e,this._rejectPromise=t})}_chunkSteps(e){this._resolvePromise({value:e,done:!1})}_closeSteps(e){this._resolvePromise({value:e,done:!0})}_errorSteps(e){this._rejectPromise(e)}},Ut=class{constructor(){this._promise=void 0}_chunkSteps(e){this._promise=te({value:e,done:!1})}_closeSteps(e){this._promise=te({value:e,done:!0})}_errorSteps(e){this._promise=A(e)}};function Wt(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_readIntoRequests`)&&e instanceof Vt}function Gt(e,t,n,r){let i=e._ownerReadableStream;i._disturbed=!0,i._state===`errored`?r._errorSteps(i._storedError):function(e,t,n,r){let i=e._controlledReadableByteStream,a=t.constructor,o=ct(a),{byteOffset:s,byteLength:c}=t,l=n*o,u;try{u=Je(t.buffer)}catch(e){r._errorSteps(e);return}let d={buffer:u,bufferByteLength:u.byteLength,byteOffset:s,byteLength:c,bytesFilled:0,minimumFill:l,elementSize:o,viewConstructor:a,readerType:`byob`};if(e._pendingPullIntos.length>0)return e._pendingPullIntos.push(d),void Rt(i,r);if(i._state===`closed`){let e=new a(d.buffer,d.byteOffset,0);r._closeSteps(e)}else{if(e._queueTotalSize>0){if(xt(e,d)){let t=_t(d);Ct(e),r._chunkSteps(t);return}if(e._closeRequested){let t=TypeError(`Insufficient bytes to fill elements in the given buffer`);Dt(e,t),r._errorSteps(t);return}}e._pendingPullIntos.push(d),Rt(i,r),pt(e)}}(i._readableStreamController,t,n,r)}function Kt(e,t){let n=e._readIntoRequests;e._readIntoRequests=new de,n.forEach(e=>{e._errorSteps(t)})}function qt(e){return TypeError(`ReadableStreamBYOBReader.prototype.${e} can only be used on a ReadableStreamBYOBReader`)}function Jt(e,t){let{highWaterMark:n}=e;if(n===void 0)return t;if(rt(n)||n<0)throw RangeError(`Invalid highWaterMark`);return n}function Yt(e){let{size:t}=e;return t||(()=>1)}function Xt(e,t){Ee(e,t);let n=e?.highWaterMark,r=e?.size;return{highWaterMark:n===void 0?void 0:ke(n),size:r===void 0?void 0:Zt(r,`${t} has member 'size' that`)}}function Zt(e,t){return N(e,t),t=>ke(e(t))}function Qt(e,t,n){return N(e,n),n=>ue(e,t,[n])}function $t(e,t,n){return N(e,n),()=>ue(e,t,[])}function en(e,t,n){return N(e,n),n=>le(e,t,[n])}function tn(e,t,n){return N(e,n),(n,r)=>ue(e,t,[n,r])}function nn(e,t){if(!sn(e))throw TypeError(`${t} is not a WritableStream.`)}var rn=class{constructor(e={},t={}){e===void 0?e=null:P(e,`First parameter`);let n=Xt(t,`Second parameter`),r=function(e,t){Ee(e,t);let n=e?.abort,r=e?.close,i=e?.start,a=e?.type,o=e?.write;return{abort:n===void 0?void 0:Qt(n,e,`${t} has member 'abort' that`),close:r===void 0?void 0:$t(r,e,`${t} has member 'close' that`),start:i===void 0?void 0:en(i,e,`${t} has member 'start' that`),write:o===void 0?void 0:tn(o,e,`${t} has member 'write' that`),type:a}}(e,`First parameter`);if(on(this),r.type!==void 0)throw RangeError(`Invalid type is specified`);let i=Yt(n);(function(e,t,n,r){let i=Object.create(Tn.prototype),a,o,s,c;a=t.start===void 0?()=>{}:()=>t.start(i),o=t.write===void 0?()=>k(void 0):e=>t.write(e,i),s=t.close===void 0?()=>k(void 0):()=>t.close(),c=t.abort===void 0?()=>k(void 0):e=>t.abort(e),Dn(e,i,a,o,s,c,n,r)})(this,r,Jt(n,1),i)}get locked(){if(!sn(this))throw Pn(`locked`);return cn(this)}abort(e=void 0){return sn(this)?cn(this)?A(TypeError(`Cannot abort a stream that already has a writer`)):ln(this,e):A(Pn(`abort`))}close(){return sn(this)?cn(this)?A(TypeError(`Cannot close a stream that already has a writer`)):mn(this)?A(TypeError(`Cannot close an already-closing stream`)):un(this):A(Pn(`close`))}getWriter(){if(!sn(this))throw Pn(`getWriter`);return an(this)}};function an(e){return new _n(e)}function on(e){e._state=`writable`,e._storedError=void 0,e._writer=void 0,e._writableStreamController=void 0,e._writeRequests=new de,e._inFlightWriteRequest=void 0,e._closeRequest=void 0,e._inFlightCloseRequest=void 0,e._pendingAbortRequest=void 0,e._backpressure=!1}function sn(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_writableStreamController`)&&e instanceof rn}function cn(e){return e._writer!==void 0}function ln(e,t){var n;if(e._state===`closed`||e._state===`errored`)return k(void 0);e._writableStreamController._abortReason=t,(n=e._writableStreamController._abortController)==null||n.abort(t);let r=e._state;if(r===`closed`||r===`errored`)return k(void 0);if(e._pendingAbortRequest!==void 0)return e._pendingAbortRequest._promise;let i=!1;r===`erroring`&&(i=!0,t=void 0);let a=O((n,r)=>{e._pendingAbortRequest={_promise:void 0,_resolve:n,_reject:r,_reason:t,_wasAlreadyErroring:i}});return e._pendingAbortRequest._promise=a,i||fn(e,t),a}function un(e){let t=e._state;if(t===`closed`||t===`errored`)return A(TypeError(`The stream (in ${t} state) is not in the writable state and cannot be closed`));let n=O((t,n)=>{e._closeRequest={_resolve:t,_reject:n}}),r=e._writer;var i;return r!==void 0&&e._backpressure&&t===`writable`&&Kn(r),z(i=e._writableStreamController,wn,0),An(i),n}function dn(e,t){e._state===`writable`?fn(e,t):pn(e)}function fn(e,t){let n=e._writableStreamController;e._state=`erroring`,e._storedError=t;let r=e._writer;r!==void 0&&xn(r,t),!function(e){return e._inFlightWriteRequest!==void 0||e._inFlightCloseRequest!==void 0}(e)&&n._started&&pn(e)}function pn(e){e._state=`errored`,e._writableStreamController[pe]();let t=e._storedError;if(e._writeRequests.forEach(e=>{e._reject(t)}),e._writeRequests=new de,e._pendingAbortRequest===void 0)return void hn(e);let n=e._pendingAbortRequest;if(e._pendingAbortRequest=void 0,n._wasAlreadyErroring)return n._reject(t),void hn(e);re(e._writableStreamController[fe](n._reason),()=>(n._resolve(),hn(e),null),t=>(n._reject(t),hn(e),null))}function mn(e){return e._closeRequest!==void 0||e._inFlightCloseRequest!==void 0}function hn(e){e._closeRequest!==void 0&&(e._closeRequest._reject(e._storedError),e._closeRequest=void 0);let t=e._writer;t!==void 0&&Bn(t,e._storedError)}function gn(e,t){let n=e._writer;n!==void 0&&t!==e._backpressure&&(t?function(e){Hn(e)}(n):Kn(n)),e._backpressure=t}Object.defineProperties(rn.prototype,{abort:{enumerable:!0},close:{enumerable:!0},getWriter:{enumerable:!0},locked:{enumerable:!0}}),w(rn.prototype.abort,`abort`),w(rn.prototype.close,`close`),w(rn.prototype.getWriter,`getWriter`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(rn.prototype,Symbol.toStringTag,{value:`WritableStream`,configurable:!0});var _n=class{constructor(e){if(De(e,1,`WritableStreamDefaultWriter`),nn(e,`First parameter`),cn(e))throw TypeError(`This stream has already been locked for exclusive writing by another writer`);this._ownerWritableStream=e,e._writer=this;let t=e._state;if(t===`writable`)!mn(e)&&e._backpressure?Hn(this):Wn(this),Rn(this);else if(t===`erroring`)Un(this,e._storedError),Rn(this);else if(t===`closed`)Wn(this),Rn(n=this),Vn(n);else{let t=e._storedError;Un(this,t),zn(this,t)}var n}get closed(){return vn(this)?this._closedPromise:A(In(`closed`))}get desiredSize(){if(!vn(this))throw In(`desiredSize`);if(this._ownerWritableStream===void 0)throw Ln(`desiredSize`);return function(e){let t=e._ownerWritableStream,n=t._state;return n===`errored`||n===`erroring`?null:n===`closed`?0:kn(t._writableStreamController)}(this)}get ready(){return vn(this)?this._readyPromise:A(In(`ready`))}abort(e=void 0){return vn(this)?this._ownerWritableStream===void 0?A(Ln(`abort`)):function(e,t){return ln(e._ownerWritableStream,t)}(this,e):A(In(`abort`))}close(){if(!vn(this))return A(In(`close`));let e=this._ownerWritableStream;return e===void 0?A(Ln(`close`)):mn(e)?A(TypeError(`Cannot close an already-closing stream`)):yn(this)}releaseLock(){if(!vn(this))throw In(`releaseLock`);this._ownerWritableStream!==void 0&&Sn(this)}write(e=void 0){return vn(this)?this._ownerWritableStream===void 0?A(Ln(`write to`)):Cn(this,e):A(In(`write`))}};function vn(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_ownerWritableStream`)&&e instanceof _n}function yn(e){return un(e._ownerWritableStream)}function bn(e,t){e._closedPromiseState===`pending`?Bn(e,t):function(e,t){zn(e,t)}(e,t)}function xn(e,t){e._readyPromiseState===`pending`?Gn(e,t):function(e,t){Un(e,t)}(e,t)}function Sn(e){let t=e._ownerWritableStream,n=TypeError(`Writer was released and can no longer be used to monitor the stream's closedness`);xn(e,n),bn(e,n),t._writer=void 0,e._ownerWritableStream=void 0}function Cn(e,t){let n=e._ownerWritableStream,r=n._writableStreamController,i=function(e,t){if(e._strategySizeAlgorithm===void 0)return 1;try{return e._strategySizeAlgorithm(t)}catch(t){return jn(e,t),1}}(r,t);if(n!==e._ownerWritableStream)return A(Ln(`write to`));let a=n._state;if(a===`errored`)return A(n._storedError);if(mn(n)||a===`closed`)return A(TypeError(`The stream is closing or closed and cannot be written to`));if(a===`erroring`)return A(n._storedError);let o=function(e){return O((t,n)=>{let r={_resolve:t,_reject:n};e._writeRequests.push(r)})}(n);return function(e,t,n){try{z(e,t,n)}catch(t){jn(e,t);return}let r=e._controlledWritableStream;!mn(r)&&r._state===`writable`&&gn(r,Mn(e)),An(e)}(r,t,i),o}Object.defineProperties(_n.prototype,{abort:{enumerable:!0},close:{enumerable:!0},releaseLock:{enumerable:!0},write:{enumerable:!0},closed:{enumerable:!0},desiredSize:{enumerable:!0},ready:{enumerable:!0}}),w(_n.prototype.abort,`abort`),w(_n.prototype.close,`close`),w(_n.prototype.releaseLock,`releaseLock`),w(_n.prototype.write,`write`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(_n.prototype,Symbol.toStringTag,{value:`WritableStreamDefaultWriter`,configurable:!0});var wn={},Tn=class{constructor(){throw TypeError(`Illegal constructor`)}get abortReason(){if(!En(this))throw Fn(`abortReason`);return this._abortReason}get signal(){if(!En(this))throw Fn(`signal`);if(this._abortController===void 0)throw TypeError(`WritableStreamDefaultController.prototype.signal is not supported`);return this._abortController.signal}error(e=void 0){if(!En(this))throw Fn(`error`);this._controlledWritableStream._state===`writable`&&Nn(this,e)}[fe](e){let t=this._abortAlgorithm(e);return On(this),t}[pe](){ot(this)}};function En(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_controlledWritableStream`)&&e instanceof Tn}function Dn(e,t,n,r,i,a,o,s){t._controlledWritableStream=e,e._writableStreamController=t,t._queue=void 0,t._queueTotalSize=void 0,ot(t),t._abortReason=void 0,t._abortController=function(){if(typeof AbortController==`function`)return new AbortController}(),t._started=!1,t._strategySizeAlgorithm=s,t._strategyHWM=o,t._writeAlgorithm=r,t._closeAlgorithm=i,t._abortAlgorithm=a,gn(e,Mn(t)),re(k(n()),()=>(t._started=!0,An(t),null),n=>(t._started=!0,dn(e,n),null))}function On(e){e._writeAlgorithm=void 0,e._closeAlgorithm=void 0,e._abortAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function kn(e){return e._strategyHWM-e._queueTotalSize}function An(e){let t=e._controlledWritableStream;if(!e._started||t._inFlightWriteRequest!==void 0)return;if(t._state===`erroring`)return void pn(t);if(e._queue.length===0)return;let n=e._queue.peek().value;n===wn?function(e){let t=e._controlledWritableStream;(function(e){e._inFlightCloseRequest=e._closeRequest,e._closeRequest=void 0})(t),at(e);let n=e._closeAlgorithm();On(e),re(n,()=>(function(e){e._inFlightCloseRequest._resolve(void 0),e._inFlightCloseRequest=void 0,e._state===`erroring`&&(e._storedError=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._resolve(),e._pendingAbortRequest=void 0)),e._state=`closed`;let t=e._writer;t!==void 0&&Vn(t)}(t),null),e=>(function(e,t){e._inFlightCloseRequest._reject(t),e._inFlightCloseRequest=void 0,e._pendingAbortRequest!==void 0&&(e._pendingAbortRequest._reject(t),e._pendingAbortRequest=void 0),dn(e,t)}(t,e),null))}(e):function(e,t){let n=e._controlledWritableStream;(function(e){e._inFlightWriteRequest=e._writeRequests.shift()})(n),re(e._writeAlgorithm(t),()=>{(function(e){e._inFlightWriteRequest._resolve(void 0),e._inFlightWriteRequest=void 0})(n);let t=n._state;if(at(e),!mn(n)&&t===`writable`){let t=Mn(e);gn(n,t)}return An(e),null},t=>(n._state===`writable`&&On(e),function(e,t){e._inFlightWriteRequest._reject(t),e._inFlightWriteRequest=void 0,dn(e,t)}(n,t),null))}(e,n)}function jn(e,t){e._controlledWritableStream._state===`writable`&&Nn(e,t)}function Mn(e){return kn(e)<=0}function Nn(e,t){let n=e._controlledWritableStream;On(e),fn(n,t)}function Pn(e){return TypeError(`WritableStream.prototype.${e} can only be used on a WritableStream`)}function Fn(e){return TypeError(`WritableStreamDefaultController.prototype.${e} can only be used on a WritableStreamDefaultController`)}function In(e){return TypeError(`WritableStreamDefaultWriter.prototype.${e} can only be used on a WritableStreamDefaultWriter`)}function Ln(e){return TypeError(`Cannot `+e+` a stream using a released writer`)}function Rn(e){e._closedPromise=O((t,n)=>{e._closedPromise_resolve=t,e._closedPromise_reject=n,e._closedPromiseState=`pending`})}function zn(e,t){Rn(e),Bn(e,t)}function Bn(e,t){e._closedPromise_reject!==void 0&&(se(e._closedPromise),e._closedPromise_reject(t),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState=`rejected`)}function Vn(e){e._closedPromise_resolve!==void 0&&(e._closedPromise_resolve(void 0),e._closedPromise_resolve=void 0,e._closedPromise_reject=void 0,e._closedPromiseState=`resolved`)}function Hn(e){e._readyPromise=O((t,n)=>{e._readyPromise_resolve=t,e._readyPromise_reject=n}),e._readyPromiseState=`pending`}function Un(e,t){Hn(e),Gn(e,t)}function Wn(e){Hn(e),Kn(e)}function Gn(e,t){e._readyPromise_reject!==void 0&&(se(e._readyPromise),e._readyPromise_reject(t),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState=`rejected`)}function Kn(e){e._readyPromise_resolve!==void 0&&(e._readyPromise_resolve(void 0),e._readyPromise_resolve=void 0,e._readyPromise_reject=void 0,e._readyPromiseState=`fulfilled`)}Object.defineProperties(Tn.prototype,{abortReason:{enumerable:!0},signal:{enumerable:!0},error:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Tn.prototype,Symbol.toStringTag,{value:`WritableStreamDefaultController`,configurable:!0});var qn=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof global<`u`?global:void 0,Jn=function(){let e=qn?.DOMException;return function(e){if(typeof e!=`function`&&typeof e!=`object`||e.name!==`DOMException`)return!1;try{return new e,!0}catch{return!1}}(e)?e:void 0}()||function(){let e=function(e,t){this.message=e||``,this.name=t||`Error`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)};return w(e,`DOMException`),e.prototype=Object.create(Error.prototype),Object.defineProperty(e.prototype,"constructor",{value:e,writable:!0,configurable:!0}),e}();function Yn(e,t,n,r,i,a){let o=Ne(e),s=an(t);e._disturbed=!0;let c=new Xn(s),l=new Qn(c);return O((u,d)=>{let f;if(a!==void 0){if(f=()=>{let n=a.reason===void 0?new Jn(`Aborted`,`AbortError`):a.reason,o=[];r||o.push(()=>t._state===`writable`?ln(t,n):k(void 0)),i||o.push(()=>e._state===`readable`?Tr(e,n):k(void 0)),_(()=>Promise.all(o.map(e=>e())),!0,n)},a.aborted)return void f();a.addEventListener(`abort`,f)}function p(){for(;!c._shuttingDown&&!t._backpressure&&t._state===`writable`&&!mn(t)&&e._state===`readable`&&Ue(o);)He(o,l);if(c._shuttingDown)return k(!0);if(t._backpressure)return ne(s._readyPromise,p);let n=new Zn(c);return He(o,n),n._promise}var m,h,g;if($n(e,o._closedPromise,e=>(r?v(!0,e):_(()=>ln(t,e),!0,e),null)),$n(t,s._closedPromise,t=>(i?v(!0,t):_(()=>Tr(e,t),!0,t),null)),m=e,h=o._closedPromise,g=()=>(n?v():_(()=>function(e){let t=e._ownerWritableStream,n=t._state;return mn(t)||n===`closed`?k(void 0):n===`errored`?A(t._storedError):yn(e)}(s)),null),m._state===`closed`?g():ie(h,g),mn(t)||t._state===`closed`){let t=TypeError(`the destination writable stream closed before all data could be piped to it`);i?v(!0,t):_(()=>Tr(e,t),!0,t)}function _(e,n,r){function i(){return re(e(),()=>y(n,r),e=>y(!0,e)),null}c._shuttingDown||(c._shuttingDown=!0,t._state!==`writable`||mn(t)?i():ie(c._waitForWritesToFinish(),i))}function v(e,n){c._shuttingDown||(c._shuttingDown=!0,t._state!==`writable`||mn(t)?y(e,n):ie(c._waitForWritesToFinish(),()=>y(e,n)))}function y(e,t){return Sn(s),ye(o),a!==void 0&&a.removeEventListener(`abort`,f),e?d(t):u(void 0),null}se(O((e,t)=>{(function n(r){r?e():ne(p(),n,t)})(!1)}))})}var Xn=class{constructor(e){this._writer=e,this._shuttingDown=!1,this._currentWrite=k(void 0)}_waitForWritesToFinish(){let e=this._currentWrite;return ne(this._currentWrite,()=>e===this._currentWrite?void 0:this._waitForWritesToFinish())}},Zn=class{constructor(e){this._state=e,this._promise=O((e,t)=>{this._resolvePromise=e,this._rejectPromise=t})}_chunkSteps(e){this._state._currentWrite=ne(Cn(this._state._writer,e),void 0,x),this._resolvePromise(!1)}_closeSteps(){this._resolvePromise(!0)}_errorSteps(e){this._rejectPromise(e)}},Qn=class{constructor(e){this._state=e}_chunkSteps(e){this._state._currentWrite=ne(Cn(this._state._writer,e),void 0,x)}_closeSteps(){}_errorSteps(e){}};function $n(e,t,n){e._state===`errored`?n(e._storedError):ae(t,n)}var er=class{constructor(){throw TypeError(`Illegal constructor`)}get desiredSize(){if(!tr(this))throw dr(`desiredSize`);return cr(this)}close(){if(!tr(this))throw dr(`close`);if(!lr(this))throw TypeError(`The stream is not in a state that permits close`);ar(this)}enqueue(e=void 0){if(!tr(this))throw dr(`enqueue`);if(!lr(this))throw TypeError(`The stream is not in a state that permits enqueue`);return or(this,e)}error(e=void 0){if(!tr(this))throw dr(`error`);sr(this,e)}[me](e){ot(this);let t=this._cancelAlgorithm(e);return ir(this),t}[he](e){let t=this._controlledReadableStream;if(this._queue.length>0){let n=at(this);this._closeRequested&&this._queue.length===0?(ir(this),Er(t)):nr(this),e._chunkSteps(n)}else Pe(t,e),nr(this)}[ge](){return this._queue.length>0}[_e](){}};function tr(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_controlledReadableStream`)&&e instanceof er}function nr(e){if(rr(e)){if(e._pulling)return void(e._pullAgain=!0);e._pulling=!0,re(e._pullAlgorithm(),()=>(e._pulling=!1,e._pullAgain&&(e._pullAgain=!1,nr(e)),null),t=>(sr(e,t),null))}}function rr(e){let t=e._controlledReadableStream;return!lr(e)||!e._started?!1:wr(t)&&Ie(t)>0?!0:cr(e)>0}function ir(e){e._pullAlgorithm=void 0,e._cancelAlgorithm=void 0,e._strategySizeAlgorithm=void 0}function ar(e){if(!lr(e))return;let t=e._controlledReadableStream;e._closeRequested=!0,e._queue.length===0&&(ir(e),Er(t))}function or(e,t){if(!lr(e))return;let n=e._controlledReadableStream;if(wr(n)&&Ie(n)>0)Fe(n,t,!1);else{let n;try{n=e._strategySizeAlgorithm(t)}catch(t){throw sr(e,t),t}try{z(e,t,n)}catch(t){throw sr(e,t),t}}nr(e)}function sr(e,t){let n=e._controlledReadableStream;n._state===`readable`&&(ot(e),ir(e),Dr(n,t))}function cr(e){let t=e._controlledReadableStream._state;return t===`errored`?null:t===`closed`?0:e._strategyHWM-e._queueTotalSize}function lr(e){let t=e._controlledReadableStream._state;return!e._closeRequested&&t===`readable`}function ur(e,t,n,r,i,a,o){t._controlledReadableStream=e,t._queue=void 0,t._queueTotalSize=void 0,ot(t),t._started=!1,t._closeRequested=!1,t._pullAgain=!1,t._pulling=!1,t._strategySizeAlgorithm=o,t._strategyHWM=a,t._pullAlgorithm=r,t._cancelAlgorithm=i,e._readableStreamController=t,re(k(n()),()=>(t._started=!0,nr(t),null),e=>(sr(t,e),null))}function dr(e){return TypeError(`ReadableStreamDefaultController.prototype.${e} can only be used on a ReadableStreamDefaultController`)}function fr(e,t){return dt(e._readableStreamController)?function(e){let t,n,r,i,a,o=Ne(e),s=!1,c=!1,l=!1,u=!1,d=!1,f=O(e=>{a=e});function p(e){ae(e._closedPromise,t=>(e!==o||(Dt(r._readableStreamController,t),Dt(i._readableStreamController,t),u&&d||a(void 0)),null))}function m(){Wt(o)&&(ye(o),o=Ne(e),p(o)),He(o,{_chunkSteps:t=>{ce(()=>{c=!1,l=!1;let n=t,o=t;if(!u&&!d)try{o=it(t)}catch(t){Dt(r._readableStreamController,t),Dt(i._readableStreamController,t),a(Tr(e,t));return}u||Et(r._readableStreamController,n),d||Et(i._readableStreamController,o),s=!1,c?g():l&&_()})},_closeSteps:()=>{s=!1,u||U(r._readableStreamController),d||U(i._readableStreamController),r._readableStreamController._pendingPullIntos.length>0&&jt(r._readableStreamController,0),i._readableStreamController._pendingPullIntos.length>0&&jt(i._readableStreamController,0),u&&d||a(void 0)},_errorSteps:()=>{s=!1}})}function h(t,n){Ve(o)&&(ye(o),o=Lt(e),p(o));let f=n?i:r,m=n?r:i;Gt(o,t,1,{_chunkSteps:t=>{ce(()=>{c=!1,l=!1;let r=n?d:u;if(n?u:d)r||Mt(f._readableStreamController,t);else{let n;try{n=it(t)}catch(t){Dt(f._readableStreamController,t),Dt(m._readableStreamController,t),a(Tr(e,t));return}r||Mt(f._readableStreamController,t),Et(m._readableStreamController,n)}s=!1,c?g():l&&_()})},_closeSteps:e=>{s=!1;let t=n?d:u,r=n?u:d;t||U(f._readableStreamController),r||U(m._readableStreamController),e!==void 0&&(t||Mt(f._readableStreamController,e),!r&&m._readableStreamController._pendingPullIntos.length>0&&jt(m._readableStreamController,0)),t&&r||a(void 0)},_errorSteps:()=>{s=!1}})}function g(){if(s)return c=!0,k(void 0);s=!0;let e=kt(r._readableStreamController);return e===null?m():h(e._view,!1),k(void 0)}function _(){if(s)return l=!0,k(void 0);s=!0;let e=kt(i._readableStreamController);return e===null?m():h(e._view,!0),k(void 0)}function v(r){if(u=!0,t=r,d){let r=Tr(e,Ke([t,n]));a(r)}return f}function y(r){if(d=!0,n=r,u){let r=Tr(e,Ke([t,n]));a(r)}return f}function b(){}return r=xr(b,g,v),i=xr(b,_,y),p(o),[r,i]}(e):function(e){let t=Ne(e),n,r,i,a,o,s=!1,c=!1,l=!1,u=!1,d=O(e=>{o=e});function f(){return s?(c=!0,k(void 0)):(s=!0,He(t,{_chunkSteps:e=>{ce(()=>{c=!1;let t=e,n=e;l||or(i._readableStreamController,t),u||or(a._readableStreamController,n),s=!1,c&&f()})},_closeSteps:()=>{s=!1,l||ar(i._readableStreamController),u||ar(a._readableStreamController),l&&u||o(void 0)},_errorSteps:()=>{s=!1}}),k(void 0))}function p(t){if(l=!0,n=t,u){let t=Tr(e,Ke([n,r]));o(t)}return d}function m(t){if(u=!0,r=t,l){let t=Tr(e,Ke([n,r]));o(t)}return d}function h(){}return i=br(h,f,p),a=br(h,f,m),ae(t._closedPromise,e=>(sr(i._readableStreamController,e),sr(a._readableStreamController,e),l&&u||o(void 0),null)),[i,a]}(e)}function pr(e){return S(t=e)&&t.getReader!==void 0?function(e){let t;function n(){let n;try{n=e.read()}catch(e){return A(e)}return oe(n,e=>{if(!S(e))throw TypeError(`The promise returned by the reader.read() method must fulfill with an object`);if(e.done)ar(t._readableStreamController);else{let n=e.value;or(t._readableStreamController,n)}})}function r(t){try{return k(e.cancel(t))}catch(e){return A(e)}}return t=br(x,n,r,0),t}(e.getReader()):function(e){let t,n=$e(e,`async`);function r(){let e;try{e=et(n)}catch(e){return A(e)}return oe(k(e),e=>{if(!S(e))throw TypeError(`The promise returned by the iterator.next() method must fulfill with an object`);if(e.done)ar(t._readableStreamController);else{let n=e.value;or(t._readableStreamController,n)}})}function i(e){let t=n.iterator,r;try{r=Xe(t,`return`)}catch(e){return A(e)}return r===void 0?k(void 0):oe(ue(r,t,[e]),e=>{if(!S(e))throw TypeError(`The promise returned by the iterator.return() method must fulfill with an object`)})}return t=br(x,r,i,0),t}(e);var t}function mr(e,t,n){return N(e,n),n=>ue(e,t,[n])}function hr(e,t,n){return N(e,n),n=>ue(e,t,[n])}function gr(e,t,n){return N(e,n),n=>le(e,t,[n])}function _r(e,t){if((e=`${e}`)!=`bytes`)throw TypeError(`${t} '${e}' is not a valid enumeration value for ReadableStreamType`);return e}function vr(e,t){Ee(e,t);let n=e?.preventAbort,r=e?.preventCancel,i=e?.preventClose,a=e?.signal;return a!==void 0&&function(e,t){if(!function(e){if(typeof e!=`object`||!e)return!1;try{return typeof e.aborted==`boolean`}catch{return!1}}(e))throw TypeError(`${t} is not an AbortSignal.`)}(a,`${t} has member 'signal' that`),{preventAbort:!!n,preventCancel:!!r,preventClose:!!i,signal:a}}Object.defineProperties(er.prototype,{close:{enumerable:!0},enqueue:{enumerable:!0},error:{enumerable:!0},desiredSize:{enumerable:!0}}),w(er.prototype.close,`close`),w(er.prototype.enqueue,`enqueue`),w(er.prototype.error,`error`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(er.prototype,Symbol.toStringTag,{value:`ReadableStreamDefaultController`,configurable:!0});var yr=class{constructor(e={},t={}){e===void 0?e=null:P(e,`First parameter`);let n=Xt(t,`Second parameter`),r=function(e,t){Ee(e,t);let n=e,r=n?.autoAllocateChunkSize,i=n?.cancel,a=n?.pull,o=n?.start,s=n?.type;return{autoAllocateChunkSize:r===void 0?void 0:je(r,`${t} has member 'autoAllocateChunkSize' that`),cancel:i===void 0?void 0:mr(i,n,`${t} has member 'cancel' that`),pull:a===void 0?void 0:hr(a,n,`${t} has member 'pull' that`),start:o===void 0?void 0:gr(o,n,`${t} has member 'start' that`),type:s===void 0?void 0:_r(s,`${t} has member 'type' that`)}}(e,`First parameter`);if(Sr(this),r.type===`bytes`){if(n.size!==void 0)throw RangeError(`The strategy for a byte stream cannot have a size function`);(function(e,t,n){let r=Object.create(ut.prototype),i,a,o;i=t.start===void 0?()=>{}:()=>t.start(r),a=t.pull===void 0?()=>k(void 0):()=>t.pull(r),o=t.cancel===void 0?()=>k(void 0):e=>t.cancel(e);let s=t.autoAllocateChunkSize;if(s===0)throw TypeError(`autoAllocateChunkSize must be greater than 0`);Nt(e,r,i,a,o,n,s)})(this,r,Jt(n,0))}else{let e=Yt(n);(function(e,t,n,r){let i=Object.create(er.prototype),a,o,s;a=t.start===void 0?()=>{}:()=>t.start(i),o=t.pull===void 0?()=>k(void 0):()=>t.pull(i),s=t.cancel===void 0?()=>k(void 0):e=>t.cancel(e),ur(e,i,a,o,s,n,r)})(this,r,Jt(n,1),e)}}get locked(){if(!Cr(this))throw Or(`locked`);return wr(this)}cancel(e=void 0){return Cr(this)?wr(this)?A(TypeError(`Cannot cancel a stream that already has a reader`)):Tr(this,e):A(Or(`cancel`))}getReader(e=void 0){if(!Cr(this))throw Or(`getReader`);return function(e,t){Ee(e,t);let n=e?.mode;return{mode:n===void 0?void 0:It(n,`${t} has member 'mode' that`)}}(e,`First parameter`).mode===void 0?Ne(this):Lt(this)}pipeThrough(e,t={}){if(!Cr(this))throw Or(`pipeThrough`);De(e,1,`pipeThrough`);let n=function(e,t){Ee(e,t);let n=e?.readable;Oe(n,`readable`,`ReadableWritablePair`),Me(n,`${t} has member 'readable' that`);let r=e?.writable;return Oe(r,`writable`,`ReadableWritablePair`),nn(r,`${t} has member 'writable' that`),{readable:n,writable:r}}(e,`First parameter`),r=vr(t,`Second parameter`);if(wr(this))throw TypeError(`ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream`);if(cn(n.writable))throw TypeError(`ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream`);return se(Yn(this,n.writable,r.preventClose,r.preventAbort,r.preventCancel,r.signal)),n.readable}pipeTo(e,t={}){if(!Cr(this))return A(Or(`pipeTo`));if(e===void 0)return A(`Parameter 1 is required in 'pipeTo'.`);if(!sn(e))return A(TypeError(`ReadableStream.prototype.pipeTo's first argument must be a WritableStream`));let n;try{n=vr(t,`Second parameter`)}catch(e){return A(e)}return wr(this)?A(TypeError(`ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream`)):cn(e)?A(TypeError(`ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream`)):Yn(this,e,n.preventClose,n.preventAbort,n.preventCancel,n.signal)}tee(){if(!Cr(this))throw Or(`tee`);return Ke(fr(this))}values(e=void 0){if(!Cr(this))throw Or(`values`);return function(e,t){let n=new I(Ne(e),t),r=Object.create(L);return r._asyncIteratorImpl=n,r}(this,function(e,t){return Ee(e,t),{preventCancel:!!e?.preventCancel}}(e,`First parameter`).preventCancel)}[Qe](e){return this.values(e)}static from(e){return pr(e)}};function br(e,t,n,r=1,i=()=>1){let a=Object.create(yr.prototype);return Sr(a),ur(a,Object.create(er.prototype),e,t,n,r,i),a}function xr(e,t,n){let r=Object.create(yr.prototype);return Sr(r),Nt(r,Object.create(ut.prototype),e,t,n,0,void 0),r}function Sr(e){e._state=`readable`,e._reader=void 0,e._storedError=void 0,e._disturbed=!1}function Cr(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_readableStreamController`)&&e instanceof yr}function wr(e){return e._reader!==void 0}function Tr(e,t){if(e._disturbed=!0,e._state===`closed`)return k(void 0);if(e._state===`errored`)return A(e._storedError);Er(e);let n=e._reader;if(n!==void 0&&Wt(n)){let e=n._readIntoRequests;n._readIntoRequests=new de,e.forEach(e=>{e._closeSteps(void 0)})}return oe(e._readableStreamController[me](t),x)}function Er(e){e._state=`closed`;let t=e._reader;if(t!==void 0&&(we(t),Ve(t))){let e=t._readRequests;t._readRequests=new de,e.forEach(e=>{e._closeSteps()})}}function Dr(e,t){e._state=`errored`,e._storedError=t;let n=e._reader;n!==void 0&&(Ce(n,t),Ve(n)?We(n,t):Kt(n,t))}function Or(e){return TypeError(`ReadableStream.prototype.${e} can only be used on a ReadableStream`)}function kr(e,t){Ee(e,t);let n=e?.highWaterMark;return Oe(n,`highWaterMark`,`QueuingStrategyInit`),{highWaterMark:ke(n)}}Object.defineProperties(yr,{from:{enumerable:!0}}),Object.defineProperties(yr.prototype,{cancel:{enumerable:!0},getReader:{enumerable:!0},pipeThrough:{enumerable:!0},pipeTo:{enumerable:!0},tee:{enumerable:!0},values:{enumerable:!0},locked:{enumerable:!0}}),w(yr.from,`from`),w(yr.prototype.cancel,`cancel`),w(yr.prototype.getReader,`getReader`),w(yr.prototype.pipeThrough,`pipeThrough`),w(yr.prototype.pipeTo,`pipeTo`),w(yr.prototype.tee,`tee`),w(yr.prototype.values,`values`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(yr.prototype,Symbol.toStringTag,{value:`ReadableStream`,configurable:!0}),Object.defineProperty(yr.prototype,Qe,{value:yr.prototype.values,writable:!0,configurable:!0});var Ar=e=>e.byteLength;w(Ar,`size`);var jr=class{constructor(e){De(e,1,`ByteLengthQueuingStrategy`),e=kr(e,`First parameter`),this._byteLengthQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Nr(this))throw Mr(`highWaterMark`);return this._byteLengthQueuingStrategyHighWaterMark}get size(){if(!Nr(this))throw Mr(`size`);return Ar}};function Mr(e){return TypeError(`ByteLengthQueuingStrategy.prototype.${e} can only be used on a ByteLengthQueuingStrategy`)}function Nr(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_byteLengthQueuingStrategyHighWaterMark`)&&e instanceof jr}Object.defineProperties(jr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(jr.prototype,Symbol.toStringTag,{value:`ByteLengthQueuingStrategy`,configurable:!0});var Pr=()=>1;w(Pr,`size`);var Fr=class{constructor(e){De(e,1,`CountQueuingStrategy`),e=kr(e,`First parameter`),this._countQueuingStrategyHighWaterMark=e.highWaterMark}get highWaterMark(){if(!Lr(this))throw Ir(`highWaterMark`);return this._countQueuingStrategyHighWaterMark}get size(){if(!Lr(this))throw Ir(`size`);return Pr}};function Ir(e){return TypeError(`CountQueuingStrategy.prototype.${e} can only be used on a CountQueuingStrategy`)}function Lr(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_countQueuingStrategyHighWaterMark`)&&e instanceof Fr}function Rr(e,t,n){return N(e,n),n=>ue(e,t,[n])}function zr(e,t,n){return N(e,n),n=>le(e,t,[n])}function Br(e,t,n){return N(e,n),(n,r)=>ue(e,t,[n,r])}function Vr(e,t,n){return N(e,n),n=>ue(e,t,[n])}Object.defineProperties(Fr.prototype,{highWaterMark:{enumerable:!0},size:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Fr.prototype,Symbol.toStringTag,{value:`CountQueuingStrategy`,configurable:!0});var Hr=class{constructor(e={},t={},n={}){e===void 0&&(e=null);let r=Xt(t,`Second parameter`),i=Xt(n,`Third parameter`),a=function(e,t){Ee(e,t);let n=e?.cancel,r=e?.flush,i=e?.readableType,a=e?.start,o=e?.transform,s=e?.writableType;return{cancel:n===void 0?void 0:Vr(n,e,`${t} has member 'cancel' that`),flush:r===void 0?void 0:Rr(r,e,`${t} has member 'flush' that`),readableType:i,start:a===void 0?void 0:zr(a,e,`${t} has member 'start' that`),transform:o===void 0?void 0:Br(o,e,`${t} has member 'transform' that`),writableType:s}}(e,`First parameter`);if(a.readableType!==void 0)throw RangeError(`Invalid readableType specified`);if(a.writableType!==void 0)throw RangeError(`Invalid writableType specified`);let o=Jt(i,0),s=Yt(i),c=Jt(r,1),l=Yt(r),u;(function(e,t,n,r,i,a){function o(){return t}function s(t){return function(e,t){let n=e._transformStreamController;return e._backpressure?oe(e._backpressureChangePromise,()=>{let r=e._writable;if(r._state===`erroring`)throw r._storedError;return Qr(n,t)}):Qr(n,t)}(e,t)}function c(t){return function(e,t){let n=e._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let r=e._readable;n._finishPromise=O((e,t)=>{n._finishPromise_resolve=e,n._finishPromise_reject=t});let i=n._cancelAlgorithm(t);return Xr(n),re(i,()=>(r._state===`errored`?ti(n,r._storedError):(sr(r._readableStreamController,t),ei(n)),null),e=>(sr(r._readableStreamController,e),ti(n,e),null)),n._finishPromise}(e,t)}function l(){return function(e){let t=e._transformStreamController;if(t._finishPromise!==void 0)return t._finishPromise;let n=e._readable;t._finishPromise=O((e,n)=>{t._finishPromise_resolve=e,t._finishPromise_reject=n});let r=t._flushAlgorithm();return Xr(t),re(r,()=>(n._state===`errored`?ti(t,n._storedError):(ar(n._readableStreamController),ei(t)),null),e=>(sr(n._readableStreamController,e),ti(t,e),null)),t._finishPromise}(e)}function u(){return function(e){return qr(e,!1),e._backpressureChangePromise}(e)}function d(t){return function(e,t){let n=e._transformStreamController;if(n._finishPromise!==void 0)return n._finishPromise;let r=e._writable;n._finishPromise=O((e,t)=>{n._finishPromise_resolve=e,n._finishPromise_reject=t});let i=n._cancelAlgorithm(t);return Xr(n),re(i,()=>(r._state===`errored`?ti(n,r._storedError):(jn(r._writableStreamController,t),Kr(e),ei(n)),null),t=>(jn(r._writableStreamController,t),Kr(e),ti(n,t),null)),n._finishPromise}(e,t)}e._writable=function(e,t,n,r,i=1,a=()=>1){let o=Object.create(rn.prototype);return on(o),Dn(o,Object.create(Tn.prototype),e,t,n,r,i,a),o}(o,s,l,c,n,r),e._readable=br(o,u,d,i,a),e._backpressure=void 0,e._backpressureChangePromise=void 0,e._backpressureChangePromise_resolve=void 0,qr(e,!0),e._transformStreamController=void 0})(this,O(e=>{u=e}),c,l,o,s),function(e,t){let n=Object.create(Jr.prototype),r,i,a;r=t.transform===void 0?e=>{try{return Zr(n,e),k(void 0)}catch(e){return A(e)}}:e=>t.transform(e,n),i=t.flush===void 0?()=>k(void 0):()=>t.flush(n),a=t.cancel===void 0?()=>k(void 0):e=>t.cancel(e),(function(e,t,n,r,i){t._controlledTransformStream=e,e._transformStreamController=t,t._transformAlgorithm=n,t._flushAlgorithm=r,t._cancelAlgorithm=i,t._finishPromise=void 0,t._finishPromise_resolve=void 0,t._finishPromise_reject=void 0})(e,n,r,i,a)}(this,a),a.start===void 0?u(void 0):u(a.start(this._transformStreamController))}get readable(){if(!Ur(this))throw ni(`readable`);return this._readable}get writable(){if(!Ur(this))throw ni(`writable`);return this._writable}};function Ur(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_transformStreamController`)&&e instanceof Hr}function Wr(e,t){sr(e._readable._readableStreamController,t),Gr(e,t)}function Gr(e,t){Xr(e._transformStreamController),jn(e._writable._writableStreamController,t),Kr(e)}function Kr(e){e._backpressure&&qr(e,!1)}function qr(e,t){e._backpressureChangePromise!==void 0&&e._backpressureChangePromise_resolve(),e._backpressureChangePromise=O(t=>{e._backpressureChangePromise_resolve=t}),e._backpressure=t}Object.defineProperties(Hr.prototype,{readable:{enumerable:!0},writable:{enumerable:!0}}),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Hr.prototype,Symbol.toStringTag,{value:`TransformStream`,configurable:!0});var Jr=class{constructor(){throw TypeError(`Illegal constructor`)}get desiredSize(){if(!Yr(this))throw $r(`desiredSize`);return cr(this._controlledTransformStream._readable._readableStreamController)}enqueue(e=void 0){if(!Yr(this))throw $r(`enqueue`);Zr(this,e)}error(e=void 0){if(!Yr(this))throw $r(`error`);var t=e;Wr(this._controlledTransformStream,t)}terminate(){if(!Yr(this))throw $r(`terminate`);(function(e){let t=e._controlledTransformStream;ar(t._readable._readableStreamController),Gr(t,TypeError(`TransformStream terminated`))})(this)}};function Yr(e){return!!S(e)&&!!Object.prototype.hasOwnProperty.call(e,`_controlledTransformStream`)&&e instanceof Jr}function Xr(e){e._transformAlgorithm=void 0,e._flushAlgorithm=void 0,e._cancelAlgorithm=void 0}function Zr(e,t){let n=e._controlledTransformStream,r=n._readable._readableStreamController;if(!lr(r))throw TypeError(`Readable side is not in a state that permits enqueue`);try{or(r,t)}catch(e){throw Gr(n,e),n._readable._storedError}(function(e){return!rr(e)})(r)!==n._backpressure&&qr(n,!0)}function Qr(e,t){return oe(e._transformAlgorithm(t),void 0,t=>{throw Wr(e._controlledTransformStream,t),t})}function $r(e){return TypeError(`TransformStreamDefaultController.prototype.${e} can only be used on a TransformStreamDefaultController`)}function ei(e){e._finishPromise_resolve!==void 0&&(e._finishPromise_resolve(),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function ti(e,t){e._finishPromise_reject!==void 0&&(se(e._finishPromise),e._finishPromise_reject(t),e._finishPromise_resolve=void 0,e._finishPromise_reject=void 0)}function ni(e){return TypeError(`TransformStream.prototype.${e} can only be used on a TransformStream`)}Object.defineProperties(Jr.prototype,{enqueue:{enumerable:!0},error:{enumerable:!0},terminate:{enumerable:!0},desiredSize:{enumerable:!0}}),w(Jr.prototype.enqueue,`enqueue`),w(Jr.prototype.error,`error`),w(Jr.prototype.terminate,`terminate`),typeof Symbol.toStringTag==`symbol`&&Object.defineProperty(Jr.prototype,Symbol.toStringTag,{value:`TransformStreamDefaultController`,configurable:!0});var ri=` `;function ii(e){e===void 0&&(e={});var t={},n;return Object.keys(e).forEach(function(r){r.toLowerCase()===`content-type`?n=e[r]:t[r]=e[r]}),t[`content-type`]=(typeof n==`string`?n.trim():n)||ri,t}function ai(e){return typeof Blob<`u`&&e instanceof Blob}function oi(e){return typeof File<`u`&&e instanceof File?e:typeof File<`u`?new File([e],`file`,{type:e.type||``}):e}function si(e){if(typeof e==`string`&&e)return{filePath:e};if(ai(e)){var t=oi(e);return{file:t,files:[{name:`file`,file:t}]}}throw Error(`upload file path or File is required`)}function ci(e){return e!=null&&!!(ai(e)||typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||typeof ArrayBuffer.isView==`function`&&ArrayBuffer.isView(e)))}function li(e){return ai(e)?typeof e.arrayBuffer==`function`?e.arrayBuffer():new Promise(function(t,n){var r=new FileReader;r.onload=function(){return t(r.result)},r.onerror=function(){return n(r.error||Error(`read blob failed`))},r.readAsArrayBuffer(e)}):Promise.resolve(e)}function ui(e){if(ci(e))return li(e);if(typeof e!=`string`||!e)return Promise.reject(Error(`upload file path or file content is required`));if(typeof wx.getFileSystemManager!=`function`)return Promise.reject(Error(`getFileSystemManager is not supported; cannot PUT a local file path`));var t=wx.getFileSystemManager();return typeof t.readFile==`function`?new Promise(function(n,r){t.readFile({filePath:e,success:function(e){return n(e.data)},fail:r})}):typeof t.readFileSync==`function`?Promise.resolve(t.readFileSync(e)):Promise.reject(Error(`readFile is not supported in this environment`))}var di=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),fi=function(){return fi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fi.apply(this,arguments)},pi=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},mi=function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o={next:s(0),throw:s(1),return:s(2)};return typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(o){if(r)throw TypeError(`Generator is already executing.`);for(;n;)try{if(r=1,i&&(a=o[0]&2?i.return:o[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,o[1])).done)return a;switch(i=0,a&&(o=[o[0]&2,a.value]),o[0]){case 0:case 1:a=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,i=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1],a=o;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(o);break}a[2]&&n.ops.pop(),n.trys.pop();continue}o=t.call(e,n)}catch(e){o=[6,e],i=0}finally{r=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}},hi=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n};function gi(){if(typeof wx>`u`||typeof Page>`u`||!wx.getSystemInfoSync||!wx.getStorageSync||!wx.setStorageSync||!wx.connectSocket||!wx.request)return!1;try{if(!wx.getSystemInfoSync()||wx.getSystemInfoSync().AppPlatform===`qq`)return!1}catch{return!1}return!0}function _i(){return typeof App>`u`&&typeof getApp>`u`&&!wx.onAppHide&&!wx.offAppHide&&!wx.onAppShow&&!wx.offAppShow}var vi=`Error when aborting requestTask`;function yi(e){if(e!=null){if(typeof e==`object`){if(typeof e.size==`number`)return e.size;if(typeof e.byteLength==`number`)return e.byteLength}if(typeof e==`string`)try{var t=wx.getFileSystemManager();if(typeof t.statSync==`function`)try{var n=t.statSync(e);if(n&&typeof n.size==`number`)return n.size}catch{}if(typeof t.readFileSync==`function`){var r=t.readFileSync(e);if(r&&typeof r.byteLength==`number`)return r.byteLength}}catch{}}}var bi=function(e){di(t,e);function t(t){t===void 0&&(t={});var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n._timeout=r||0,n._timeoutMsg=i||`请求超时`,n._restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}return t.prototype.getUploadByteLength=function(e){return yi(e)},t.prototype.post=function(e){var t=this;return new Promise(function(n,r){var i=e.url,a=e.data,o=e.headers,s=wx.request({url:m(`https:`,i),data:a,timeout:t._timeout,method:`POST`,header:o,success:function(e){e.statusCode>=200&&e.statusCode<300?n({statusCode:e.statusCode,status:e.statusCode,data:e.data}):r(e)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&t._restrictedMethods.indexOf(`post`)!==-1&&e.errMsg===`request:fail timeout`){console.warn(t._timeoutMsg);try{s.abort()}catch{}}}})})},t.prototype.get=function(e){var t=this;return new Promise(function(n,r){var i=e.url,a=e.body,o=e.headers,s=m(`https:`,i),c=wx.request({url:s,data:a,timeout:t._timeout,method:`GET`,header:o,success:function(e){e.statusCode>=200&&e.statusCode<300?n({statusCode:e.statusCode,status:e.statusCode,data:e.data}):r(e)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&t._timeout&&t._restrictedMethods.indexOf(`get`)!==-1&&e.errMsg.includes(`timeout`)){console.warn(t._timeoutMsg);try{c.abort()}catch(e){console.warn(vi,e)}}}})})},t.prototype.upload=function(e){return(String(e.method||`put`).toLowerCase()===`post`?`post`:`put`)==`post`?this.uploadByForm(e):this.uploadByPut(e)},t.prototype.download=function(e){var t=this,n=this;return new Promise(function(r,i){var a=e.url,o=e.headers,s=wx.downloadFile({url:m(`https:`,a),header:o,timeout:t._timeout,success:function(e){e.statusCode===200&&e.tempFilePath?r({statusCode:200,tempFilePath:e.tempFilePath}):r(e)},fail:function(e){i(e)},complete:function(e){if(e&&e.errMsg&&n._timeout&&n._restrictedMethods.indexOf(`download`)!==-1&&e.errMsg===`request:fail timeout`){console.warn(n._timeoutMsg);try{s.abort()}catch{}}}})})},t.prototype.fetch=function(e){var t=e.url,n=e.body,r=e.enableAbort,i=e.headers,a=e.method,o=e.stream,s=o!==void 0&&o,c=e.signal,l=e.timeout,u=this,d=l??this._timeout,f=null,p=new yr({start:function(e){f=e},cancel:function(){f=null}});return new Promise(function(e,o){s&&e({data:p});var l=wx.request({url:m(`https:`,t),data:n,timeout:d,method:a.toUpperCase(),header:i,success:function(t){f?.close(),!s&&e(t)},fail:function(e){if(f?.close(),o(e),s)throw e},complete:function(e){if(e&&e.errMsg&&d&&u._restrictedMethods.indexOf(`post`)!==-1&&r&&e.errMsg===`request:fail timeout`){console.warn(u._timeoutMsg);try{l.abort()}catch(e){console.warn(vi,e)}}},enableChunked:s});if(l.onChunkReceived(function(e){f?.enqueue(new Uint8Array(e.data))}),c){var h=function(){try{l.abort()}catch(e){console.warn(vi,e)}};c.aborted?h():c.addEventListener(`abort`,function(){return h()})}})},t.prototype.patch=function(e){var t=e.method,n=e.headers,r=JSON.parse(JSON.stringify(n||{}));return t.toUpperCase()===`PATCH`&&(r[`X-HTTP-Method-Override`]=`PATCH`,t=`POST`),this.post(fi(fi({},e),{method:t,headers:r}))},t.prototype.uploadByForm=function(e){var t=this,n=this;return new Promise(function(r){var i=e.url,a=e.file,o=e.data,s=e.headers,c=e.onUploadProgress,l;try{l=si(a)}catch(e){r(e);return}var u=wx.uploadFile(fi(fi({url:i},l),{name:`file`,formData:o||{},header:s,timeout:t._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};e.statusCode===200&&o?.success_action_status&&(t.statusCode=parseInt(o.success_action_status,10)),r(t)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&n._timeout&&n._restrictedMethods.indexOf(`upload`)!==-1&&e.errMsg===`request:fail timeout`){console.warn(n._timeoutMsg);try{u.abort()}catch{}}}}));c&&u.onProgressUpdate(function(e){c(e)})})},t.prototype.uploadByPut=function(e){var t=this,n=this;return new Promise(function(r){return pi(t,void 0,void 0,function(){var t,i,a,o,s,c,l,u,d;return mi(this,function(f){switch(f.label){case 0:t=e.url,i=e.file,a=e.data,o=e.headers,s=o===void 0?{}:o,c=e.onUploadProgress,f.label=1;case 1:return f.trys.push([1,3,,4]),[4,ui(i)];case 2:return l=f.sent(),[3,4];case 3:return u=f.sent(),r(u),[2];case 4:return d=wx.request({url:t,method:`PUT`,header:ii(s),data:l,timeout:this._timeout,success:function(e){var t={statusCode:e.statusCode,data:e.data||{}};e.statusCode===200&&a?.success_action_status&&(t.statusCode=parseInt(a.success_action_status,10)),r(t)},fail:function(e){r(e)},complete:function(e){if(e&&e.errMsg&&n._timeout&&n._restrictedMethods.indexOf(`upload`)!==-1&&e.errMsg.includes(`timeout`)){console.warn(n._timeoutMsg);try{d.abort()}catch{}}}}),c&&typeof d.onProgressUpdate==`function`&&d.onProgressUpdate(function(e){c(e)}),[2]}})})})},t}(f),xi={setItem:function(e,t){wx.setStorageSync(e,t)},getItem:function(e){return wx.getStorageSync(e)},removeItem:function(e){wx.removeStorageSync(e)},clear:function(){wx.clearStorageSync()}},Si=function(){function e(e,t){t===void 0&&(t={});var n=wx.connectSocket(fi({url:e},t));return{set onopen(e){n.onOpen(e)},set onmessage(e){n.onMessage(e)},set onclose(e){n.onClose(e)},set onerror(e){n.onError(e)},send:function(e){return n.send({data:e})},close:function(e,t){return n.close({code:e,reason:t})},get readyState(){return n.readyState},CONNECTING:0,OPEN:1,CLOSING:2,CLOSED:3}}return e}();function Ci(e){var t={},n=e.replace(/^[?#]/,``);return n&&n.split(`&`).forEach(function(e){var n=e.split(`=`),r=n[0],i=n[1];r=decodeURIComponent(r),i=decodeURIComponent(i),r&&(t[r]?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i)}),t}function wi(e){return{root:{globalThis:{}},reqClass:bi,wsClass:Si,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},i=t;console.log(`openURIWithCallback`,t);var a=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(a){i=a[1],console.log(`openURIWithCallback url`,i);var o=a[2];o&&(r=Ci(o))}console.log(`openURIWithCallback queryObj`,r);var s=r.token,c=hi(r,[`token`]);return/^data:/.test(i)&&!s?Promise.reject({error:`invalid_argument`,error_description:`invalie captcha data: `+t}):s?new Promise(function(e){console.log(`wait for captcha...`),n.$emit(`CAPTCHA_DATA_CHANGE`,fi(fi({},c),{token:s,url:i})),n.$once(`RESOLVE_CAPTCHA_DATA`,function(t){e(t)})}):Promise.reject({error:`unimplemented`,error_description:`need to impl captcha data`})}},localStorage:xi,primaryStorage:d.local,getAppSign:function(){var e=wx.getAccountInfoSync();return _i()?e&&e.plugin?e.plugin.appId:``:e&&e.miniProgram?e.miniProgram.appId:``}}}var Ti={genAdapter:wi,isMatch:gi,runtime:`wx_mp`},Ei={d:(e,t)=>{for(var n in t)Ei.o(t,n)&&!Ei.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},Di={};Ei.d(Di,{Z:()=>lo});var Oi=`@cloudbase/js-sdk`;function ki(){return Oi}var Ai=`https:`,ji={INVALID_PARAMS:`INVALID_PARAMS`,INVALID_SYNTAX:`INVALID_SYNTAX`,INVALID_OPERATION:`INVALID_OPERATION`,OPERATION_FAIL:`OPERATION_FAIL`,NETWORK_ERROR:`NETWORK_ERROR`,UNKOWN_ERROR:`UNKOWN_ERROR`},Mi=(Ni={AbstractSDKRequest:()=>f,AbstractStorage:()=>p,StorageType:()=>d},Pi={},Ei.d(Pi,Ni),Pi),Ni,Pi,Fi=function(e,t){return Fi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Fi(e,t)},Ii,Li=function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);function n(){this.constructor=e}Fi(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)};function Ri(e){return Object.prototype.toString.call(e)===`[object FormData]`}function zi(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;return Object.keys(n).forEach(function(e){i===``?!r&&(t+=`?`):i+=`&`,i+=`${e}=${encodeURIComponent(n[e])}`}),/^http(s)?:\/\//.test(t+=i)?t:`${e}${t}`}function Bi(e,t){console.warn(`[${ki()}][${e}]:${t}`)}function Vi(e){var t={},n=e.match(/^(data:.*?)(\?[^#\s]*)?$/);if(n){e=n[1];var r=n[2];r&&(t=function(e){e=e.replace(/^\?/,``);var t={};return e.split(`&`).forEach(function(e){var n=e.split(`=`),r=n[0],i=n[1];r=decodeURIComponent(r),i=decodeURIComponent(i),r&&(t[r]?Array.isArray(t[r])?t[r].push(i):t[r]=[t[r],i]:t[r]=i)}),t}(r))}var i=t.token,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,[`token`]);return/^data:/.test(e)&&!i?{error:`invalid_argument`,error_description:`invalid captcha data: ${e}`}:i?{state:a.state,token:i,captchaData:e}:{error:`unimplemented`,error_description:`need to impl captcha data`}}Ii=Error,Li(function(e){var t=Ii.call(this,e.msg||e.message||``)||this;return t.code=e.code||``,t.requestId=e.requestId||``,Object.defineProperty(t,"message",{value:e.msg||e.message||``,enumerable:!0,writable:!0,configurable:!0}),t},Ii);var Hi,Ui=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Wi=function(){return Wi=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Wi.apply(this,arguments)},Gi=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ki=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},qi=function(e){function t(t){var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=i||`请求超时`,n.restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}return Ui(t,e),t.prototype.get=function(e){return this.request(Wi(Wi({},e),{method:`get`}),this.restrictedMethods.includes(`get`))},t.prototype.post=function(e){return this.request(Wi(Wi({},e),{method:`post`}),this.restrictedMethods.includes(`post`))},t.prototype.put=function(e){return this.request(Wi(Wi({},e),{method:`put`}))},t.prototype.upload=function(e){var t=e,n=t.data,r=t.file,i=t.fileContent,a=t.name,o=t.method,s=t.headers,c=s===void 0?{}:s,l=r??i,u={post:`post`,put:`put`}[o?.toLowerCase()]||`put`,d=new FormData;return u===`post`?(Object.keys(n).forEach(function(e){d.append(e,n[e])}),d.append(`key`,a),d.append(`file`,l instanceof Blob?l:new Blob([l])),this.request(Wi(Wi({},e),{data:d,method:u}),this.restrictedMethods.includes(`upload`))):this.request(Wi(Wi({},e),{method:`put`,headers:c,body:l}),this.restrictedMethods.includes(`upload`))},t.prototype.download=function(e){return Gi(this,void 0,Promise,function(){var t,n,r,i;return Ki(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(Wi(Wi({},e),{headers:{},responseType:`blob`}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split(`/`).pop()||``),(i=document.createElement(`a`)).href=n,i.setAttribute(`download`,r),i.style.display=`none`,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){return Gi(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=this;return Ki(this,function(h){switch(h.label){case 0:return t=new AbortController,n=e.url,r=e.enableAbort,i=r!==void 0&&r,a=e.stream,o=a!==void 0&&a,s=e.signal,c=e.timeout,l=e.shouldThrowOnError,u=l===void 0||l,d=c??this.timeout,s&&(s.aborted&&t.abort(),s.addEventListener(`abort`,function(){return t.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),t.abort(Error(m.timeoutMsg))},d)),[4,fetch(n,Wi(Wi({},e),{signal:t.signal})).then(function(e){return Gi(m,void 0,void 0,function(){var t,n,r;return Ki(this,function(i){switch(i.label){case 0:return clearTimeout(f),u?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[i.sent()]),i.label=3;case 3:return[2,t];case 4:return[2,e]}})})}).catch(function(e){return clearTimeout(f),Promise.reject(e)})];case 1:return p=h.sent(),[2,{data:o?p.body:p.headers.get(`content-type`)?.includes(`application/json`)?p.json():p.text(),statusCode:p.status,header:p.headers,response:p}]}})})},t.prototype.request=function(e,t){var n=this;t===void 0&&(t=!1);var r=String(e.method).toLowerCase()||`get`;return new Promise(function(i){var a=e.url,o=e.headers,s=o===void 0?{}:o,c=e.data,l=e.responseType,u=e.withCredentials,d=e.body,f=e.onUploadProgress,p=zi(Ai,a,r===`get`?c:{}),m=new XMLHttpRequest;m.open(r,p),l&&(m.responseType=l);var h,g,_=e.signal;_&&(_.aborted?m.abort():_.addEventListener(`abort`,function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),f&&m.upload.addEventListener(`progress`,f),m.onreadystatechange=function(){var e={};if(m.readyState===4){var t=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(`: `),r=t.shift().toLowerCase();n[r]=t.join(`: `)}),e.header=n,e.statusCode=m.status;try{e.data=l===`blob`?m.response:JSON.parse(m.responseText)}catch{e.data=l===`blob`?m.response:m.responseText}clearTimeout(h),i(e)}},t&&n.timeout&&(h=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),g=Ri(c)?c:s[`content-type`]===`application/x-www-form-urlencoded`?function(e){e===void 0&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)}(c):d||(c?JSON.stringify(c):void 0),u&&(m.withCredentials=!0),m.send(g)})},t}(Mi.AbstractSDKRequest),Ji=function(){return Ji=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ji.apply(this,arguments)};(function(e){e.WEB=`web`,e.WX_MP=`wx_mp`})(Hi||={});var Yi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Xi=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Zi=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Qi=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||={},n}return Yi(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(Mi.AbstractStorage),$i=function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=n===void 0?{}:n,i=e.keys,a=i===void 0?{}:i;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case`local`:default:return t.localStorage?t.localStorage:(Bi(ji.INVALID_PARAMS,`localStorage is not supported on current platform`),new Qi(t.root));case`none`:return new Qi(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=a)}return Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||`sync`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if(this.mode!==`async`){if(this.storage)try{var r={version:n||`localCachev1`,content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw Error(JSON.stringify({code:ji.OPERATION_FAIL,msg:`[${ki()}][${ji.OPERATION_FAIL}]setStore failed`,info:e}))}}else Bi(ji.INVALID_OPERATION,`current platform's storage is asynchronous, please use setStoreAsync insteed`)},e.prototype.setStoreAsync=function(e,t,n){return Xi(this,void 0,void 0,function(){var r;return Zi(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),r={version:n||`localCachev1`,content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){if(this.mode!==`async`){try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return``}catch{return``}t||=`localCachev1`;var n=this.storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:``}Bi(ji.INVALID_OPERATION,`current platform's storage is asynchronous, please use getStoreAsync insteed`)},e.prototype.getStoreAsync=function(e,t){return Xi(this,void 0,void 0,function(){var n;return Zi(this,function(r){switch(r.label){case 0:try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,``]}catch{return[2,``]}return t||=`localCachev1`,[4,this.storage.getItem(e)];case 1:return(n=r.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,``]}})})},e.prototype.removeStore=function(e){this.mode===`async`?Bi(ji.INVALID_OPERATION,`current platform's storage is asynchronous, please use removeStoreAsync insteed`):this.storage.removeItem(e)},e.prototype.removeStoreAsync=function(e){return Xi(this,void 0,void 0,function(){return Zi(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})},e}(),ea=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ta=function(e,t){this.data=t||null,this.name=e},na=function(e){function t(t,n){var r=e.call(this,`error`,{error:t,data:n})||this;return r.error=t,r}return ea(t,e),t}(ta),ra=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(n?.[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof na)return console.error(e.error),this;var n=typeof e==`string`?new ta(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var i=0,a=this.listeners[r]?function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],this.listeners[r],!0):[];i<a.length;i++)a[i].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new ra;var ia=new ra,aa=`lang_change`;typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.indexOf(`Firefox`),(e=>{var t={};return Ei.d(t,e),t})({default:()=>b}).default;var oa=function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},sa=ji,ca={};function la(e,t){var n=t.name,r=t.namespace,i=t.entity,a=t.injectEvents,o=t.IIFE,s=o!==void 0&&o;if(ca[n]||r&&e[r])throw Error(JSON.stringify({code:sa.INVALID_OPERATION,msg:`Duplicate component ${n}`}));if(s){if(!i||typeof i!=`function`)throw Error(JSON.stringify({code:sa.INVALID_PARAMS,msg:`IIFE component's entity must be a function`}));i.call(e)}if(ca[n]=t,r?e.prototype[r]=i:ua(e.prototype,i),a){var c=a.bus,l=a.events;if(!c||!l||l.length===0)return;var u=e.prototype.fire||function(){};e.prototype.events||(e.prototype.events={}),(e.prototype.events||{})[n]?e.prototype.events[n].events=oa(oa([],e.prototype.events[n].events,!0),l,!0):e.prototype.events[n]={bus:c,events:l},e.prototype.fire=function(e,t){u(e,t);for(var n=0,r=Object.keys(this.events);n<r.length;n++){var i=r[n],a=this.events[i],o=a.bus;if(a.events.includes(e)){o.fire(e,t);break}}}}}function ua(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:return new Date(t.getTime());case Object:e===void 0&&(e={});break;case Array:e=[];break;default:return t}for(var n=0,r=Object.keys(t);n<r.length;n++){var i=r[n];Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=ua(e[i],t[i]))}return e}var da=(e=>{var t={};return Ei.d(t,e),t})({WxMpWebSocket:()=>Si,WxRequest:()=>bi,default:()=>Ti,parseQueryString:()=>Ci,wxMpStorage:()=>xi}),fa=function(){return fa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},fa.apply(this,arguments)},pa={},ma=function(){return ma=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ma.apply(this,arguments)},ha=$i,ga={},_a={};function va(e){var t=e.env,n=e.platformInfo,r={userInfoKey:`user_info_${t}`};ga[t]=ga[t]||new ha(ma(ma({},e),{keys:r,platformInfo:n})),_a[t]=_a[t]||new ha(ma(ma({},e),{keys:r,platformInfo:n,persistence:`local`}))}function ya(e){return _a[e]}var ba=function(){return ba=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ba.apply(this,arguments)},xa=``,Sa=`@cloudbase/js-sdk`;function Ca(){return xa}var wa,Ta=[],Ea=[`env`,`endPointKey`,`region`],Da=`https:`;function Oa(e){return Ta.find(function(t){return Ea.filter(function(t){return e[t]!=null}).every(function(n){return t[n]===e[n]})})}function ka(e){e.protocol&&!/:$/.test(e.protocol)&&(e.protocol=`${e.protocol}:`);var t,n=Oa(e);n?(e.baseUrl!=null&&(n.baseUrl=e.baseUrl),e.protocol!=null&&(n.protocol=e.protocol)):Ta.push(ba(ba({},e),{protocol:e.protocol??Da})),e.endPointKey===`CLOUD_API`&&(t=e.protocol??Da,Ai=t)}function Aa(e,t,n){return Oa({env:e,endPointKey:t,region:n})}function ja(e,t){t===void 0&&(t=`CLOUD_API`);var n=Aa(e,t||`CLOUD_API`);return`${n.protocol}${n.baseUrl}`.match(/(http(s)?:)?\/\/([^/?#]*)/)[0]}(function(e){e.NULL=`NULL`,e.ANONYMOUS=`ANONYMOUS`,e.WECHAT=`WECHAT`,e.WECHAT_PUBLIC=`WECHAT-PUBLIC`,e.WECHAT_OPEN=`WECHAT-OPEN`,e.CUSTOM=`CUSTOM`,e.EMAIL=`EMAIL`,e.USERNAME=`USERNAME`,e.PHONE=`PHONE`})(wa||={});var Ma=function(){return Ma=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ma.apply(this,arguments)},Na=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Pa=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Fa=ji,Ia=Ri,La=zi,Ra=[`auth.getJwt`,`auth.logout`,`auth.signInWithTicket`,`auth.signInAnonymously`,`auth.signIn`,`auth.fetchAccessTokenWithRefreshToken`,`auth.signUpWithEmailAndPassword`,`auth.activateEndUserMail`,`auth.sendPasswordResetEmail`,`auth.resetPasswordWithToken`,`auth.isUsernameRegistered`];function za(e,t,n){var r=e[t];e[t]=function(t){var i={},a={};n.forEach(function(n){var r=n.call(e,t),o=r.data,s=r.headers;Object.assign(i,o),Object.assign(a,s)});var o=t.data;return o&&(Ia(o)?Object.keys(i).forEach(function(e){o.append(e,i[e])}):t.data=Ma(Ma({},o),i)),t.headers=Ma(Ma({},t.headers||{}),a),r.call(e,t)}}function Ba(){var e=Math.random().toString(16).slice(2);return{data:{seqId:e},headers:{"X-SDK-Version":`@cloudbase/js-sdk/${Ca()}`,"x-seqid":e}}}var Va,Ha,Ua=function(){function e(e){var t=this;this.config=e;var n={env:this.config.env,region:this.config.region,accessKey:this.config.accessKey,context:this.config.context,auth:this.config.auth,timeout:this.config.timeout,timeoutMsg:`[@cloudbase/js-sdk] 请求在${this.config.timeout/1e3}s内未完成,已中断`,restrictedMethods:[`post`,`put`]};this.reqClass=new pa.adapter.reqClass(n),this.localCache=ya(this.config.env),this.config.endPointMode!==`GATEWAY`&&(za(this.reqClass,`post`,[Ba]),za(this.reqClass,`upload`,[Ba]),za(this.reqClass,`download`,[Ba])),ia.on(aa,function(e){t.config.i18n=e.data?.i18n||t.config.i18n})}return Object.defineProperty(e.prototype,"throwWhenRequestFail",{get:function(){var e=this.config?._fromApp?.config?.throw;return typeof e==`boolean`?e:!1!==this.config?.throw},enumerable:!1,configurable:!0}),e.prototype.getAccessToken=function(e){return e===void 0&&(e=null),Na(this,void 0,void 0,function(){var t,n,r;return Pa(this,function(i){switch(i.label){case 0:if(e!=null)return[2,e];if(!(t=this.config._fromApp).oauthInstance)throw Error(`you can't request without auth`);return n=t.oauthInstance,r=n.oauth2client,[4,this.getOauthAccessTokenV2(r)];case 1:return[2,i.sent().accessToken]}})})},e.prototype.getDefaultHeaders=function(){var e;return(e={})[this.config.i18n?.LANG_HEADER_KEY]=this.config.i18n?.lang,e[`X-SDK-Version`]=`@cloudbase/js-sdk/${Ca()}`,e},e.prototype.post=function(e,t){return Na(this,void 0,Promise,function(){return Pa(this,function(n){switch(n.label){case 0:return[4,this.reqClass.post(Ma(Ma({},e),{headers:Ma(Ma({},e.headers),this.getDefaultHeaders()),customReqOpts:t}))];case 1:return[2,n.sent()]}})})},e.prototype.upload=function(e){return Na(this,void 0,Promise,function(){var t,n,r;return Pa(this,function(i){switch(i.label){case 0:return n=(t=e).file??t.fileContent,delete(r=Ma(Ma({},t),{file:n,headers:Ma(Ma({},t.headers),this.getDefaultHeaders())})).fileContent,[4,this.reqClass.upload(r)];case 1:return[2,i.sent()]}})})},e.prototype.download=function(e){return Na(this,void 0,Promise,function(){return Pa(this,function(t){switch(t.label){case 0:return[4,this.reqClass.download(Ma(Ma({},e),{headers:Ma(Ma({},e.headers),this.getDefaultHeaders())}))];case 1:return[2,t.sent()]}})})},e.prototype.getUploadByteLength=function(e){var t;return(t=this.reqClass).getUploadByteLength?.call(t,e)},e.prototype.getBaseEndPoint=function(e){return e===void 0&&(e=`CLOUD_API`),ja(this.config.env,e)},e.prototype.getOauthAccessTokenV2=function(e){return Na(this,void 0,Promise,function(){var t,n;return Pa(this,function(r){switch(r.label){case 0:return[4,e.getAccessToken()];case 1:return t=r.sent(),[4,e.getCredentials()];case 2:return n=r.sent(),[2,{accessToken:t,accessTokenExpire:new Date(n.expires_at).getTime()}]}})})},e.prototype.request=function(e,t,n,r){return Na(this,void 0,Promise,function(){var i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E;return Pa(this,function(D){switch(D.label){case 0:if(D.trys.push([0,4,,5]),i=`x-tcb-trace_${this.config.env}`,a=`application/x-www-form-urlencoded`,o=Ma({action:e,dataVersion:`2020-01-10`,env:this.config.env},t),Ra.indexOf(e)!==-1)return[3,2];if(!(s=this.config._fromApp).oauthInstance)throw Error(`you can't request without auth`);return c=s.oauthInstance,l=c.oauth2client,u=o,[4,this.getOauthAccessTokenV2(l)];case 1:u.access_token=D.sent().accessToken,D.label=2;case 2:return e===`storage.uploadFile`?(d=new FormData,Object.keys(d).forEach(function(e){Object.prototype.hasOwnProperty.call(d,e)&&d[e]!==void 0&&d.append(e,o[e])}),a=`multipart/form-data`):(a=`application/json;charset=UTF-8`,d={},Object.keys(o).forEach(function(e){o[e]!==void 0&&(d[e]=o[e])})),f={headers:Ma(Ma({"content-type":a},this.getDefaultHeaders()),n?.headers)},n!=null&&n.onUploadProgress&&(f.onUploadProgress=n.onUploadProgress),this.config.region&&(f.headers[`X-TCB-Region`]=this.config.region),(p=this.localCache.getStore(i))&&(f.headers[`X-TCB-Trace`]=p),m=n?.parse===void 0?t.parse:n.parse,h=n?.inQuery===void 0?t.inQuery:n.inQuery,g=n?.search===void 0?t.search:n.search,_=Ma(Ma({},n?.defaultQuery||{}),{env:this.config.env}),m&&(_.parse=!0),h&&(_=Ma(Ma({},h),_)),v=n?.endPointMode||this.config.endPointMode||`CLOUD_API`,y=Aa(this.config.env,v),b=y.baseUrl,x=y.protocol,v===`GATEWAY`&&/^((database)\.)|(auth\.wsWebSign)/.test(e)&&(S=Aa(this.config.env,`CLOUD_API`),b=`${S.baseUrl.match(/\/\/([^/?#]*)/)[0]}/web`),C=void 0,C=n.pathname?La(x,`${ja(this.config.env,v)?.replace(/^https?:/,``)}/${n.pathname}`,_):La(x,b,_),g&&(C+=g),[4,this.post(Ma({url:C,data:d},f),r)];case 3:if(w=D.sent(),(T=w.header?.[`x-tcb-trace`])&&this.localCache.setStore(i,T),Number(w.status)!==200&&Number(w.statusCode)!==200||!w.data)throw Error(`network request error`);return[2,w];case 4:E=D.sent();try{E.requestId=E.requestId||n?.headers[`x-request-id`]||n?.headers[`X-Request-Id`]||``}catch{}throw E;case 5:return[2]}})})},e.prototype.fetch=function(e){return Na(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l=this;return Pa(this,function(u){switch(u.label){case 0:t=e.token,n=e.headers,r=n===void 0?{}:n,i=e.withCredentials,a=i===void 0||i,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,[`token`,`headers`,`withCredentials`]),s=function(){return Na(l,void 0,void 0,function(){var e,n,i,s;return Pa(this,function(c){switch(c.label){case 0:if(e={},!a)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.getAccessToken(t)];case 2:return(n=c.sent())&&(e.Authorization=`Bearer ${n}`),[3,4];case 3:if(i=c.sent(),typeof process>`u`||process.versions==null||process.versions.node==null)throw i;return[3,4];case 4:return s=Ma({headers:Ma(Ma(Ma({"X-SDK-Version":`@cloudbase/js-sdk/${Ca()}`},e),this.getDefaultHeaders()),r),withCredentials:a},o),[2,this.reqClass.fetch(s)]}})})},u.label=1;case 1:return u.trys.push([1,3,,6]),[4,s()];case 2:return[2,u.sent()];case 3:c=u.sent();try{c.requestId=c.requestId||r[`x-request-id`]||r[`X-Request-Id`]||``}catch{}if(c?.code!==`ACCESS_TOKEN_EXPIRED`)return[3,5];if(typeof this.config?._fromApp?.oauthInstance?.authApi?.refreshTokenForce!=`function`)throw c;return[4,(this.config?._fromApp?.oauthInstance?.authApi)?.refreshTokenForce()];case 4:return u.sent(),[2,s()];case 5:throw c;case 6:return[2]}})})},e.prototype.send=function(e,t,n,r){return t===void 0&&(t={}),n===void 0&&(n={}),Na(this,void 0,Promise,function(){var i;return Pa(this,function(a){switch(a.label){case 0:return[4,this.request(e,t,Ma(Ma({},n),{onUploadProgress:t.onUploadProgress}),r)];case 1:if((i=a.sent()).data.code&&this.throwWhenRequestFail)throw Error(JSON.stringify({code:Fa.OPERATION_FAIL,msg:`[${i.data.code}] ${i.data.message}`}));return[2,i.data]}})})},e.prototype.gateWay=function(e,t){return Na(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b;return Pa(this,function(x){switch(x.label){case 0:if(n=e.url,r=e.name,i=e.data,a=e.path,o=a===void 0?``:a,s=e.method,c=e.header,l=c===void 0?{}:c,!(r&&o||n))throw Error(JSON.stringify({code:Fa.INVALID_PARAMS,msg:`[gateWay] invalid function name or path or url`}));try{u=i?JSON.stringify(i):``}catch{throw Error(JSON.stringify({code:Fa.INVALID_PARAMS,msg:`[gateWay] invalid data`}))}if(S=new Date().getTime(),C=(Date==null?void 0:Date.now)&&1e3*Date.now()||0,d=`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=16*Math.random();return S>0?(t=(S+t)%16|0,S=Math.floor(S/16)):(t=(C+t)%16|0,C=Math.floor(C/16)),(e===`x`?t:7&t|8).toString(16)}),f=Aa(this.config.env,`GATEWAY`),p=f.baseUrl,m=f.protocol,h=`${m}${p}${n||`/${o}/${r}`}`,g=[`GET`,`HEAD`].includes((s?.toUpperCase)?.call(s)))try{_={};try{_=JSON.parse(i)}catch{_=i||{}}h=`${h}${h.includes(`?`)?`&`:`?`}${Object.keys(_).map(function(e){return`${e}=${_[e]}`}).join(`&`)}`}catch{}return[4,this.fetch(Ma(Ma({method:s||`POST`,headers:Ma({"Content-Type":`application/json; charset=utf-8`,"X-Request-Id":d},l)},g?{}:{body:u}),{url:h,customReqOpts:t,shouldThrowOnError:e.shouldThrowOnError??this.throwWhenRequestFail}))];case 1:return v=x.sent(),y=[Ma({requestId:d},v)],b={},[4,v.data];case 2:return[2,Ma.apply(void 0,y.concat([(b.data=x.sent(),b)]))]}var S,C})})},e}(),Wa={};(function(e){e.ZH=`zh-CN`,e.EN=`en-US`})(Ha||={});var Ga=((Va={})[Ha.EN]={"请检查调用方式,或前往云开发 AI+ 首页查看文档":`Please check the calling method or visit the AI+ homepage to view the documentation`,"AI+ 请求出错,错误码":`AI+ request error, error code`,错误信息:`error message`,未实现:`not implemented`,"小程序不支持 wasm 加载":`wasm loading is not supported in mini programs`,"小程序不支持动态 js 加载":`dynamic js loading is not supported in mini programs`,请求超时:`request timeout`,"缺少 privatelink sdk 地址":`missing privatelink sdk address`},Va),Ka=function(e,t){return Ga[t]?.[e]||e},qa=function(e,t){var n,r=function(e){return`lang_${e.clientId||e.env}`}(t),i=(e.adapter||{}).localStorage,a=t.lang||(i?.getItem)?.call(i,r)||Ha.ZH;return(n=i?.setItem)==null||n.call(i,r,a),new Proxy({t:function(e){return Ka(e,a)},LANG_HEADER_KEY:`Accept-Language`,lang:a},{get:function(e,t){return t===`lang`&&(i?.getItem)?.call(i,r)||e[t]},set:function(e,t,n){var a;return t===`lang`&&n!==e[t]&&(e[t]=n,e.t=function(e){return Ka(e,n)},(a=i?.setItem)==null||a.call(i,r,n),ia.fire(aa,{i18n:e})),e[t]=n,!0}})},Ja=new Set,Ya=function(){return Ya=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Ya.apply(this,arguments)},Xa=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Za=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},Qa=function(){return{adapter:Ji({},{type:`default`,root:window,reqClass:qi,wsClass:WebSocket,localStorage}),runtime:Hi.WEB}},$a=ji,eo=`https://support.qq.com/products/148793`,to=Bi,no=function(e){return e.mode,e.customInfo,e.title,e.messages,function(e,t,n){}},ro={persistence:`local`},io=6e5,ao={},oo=new(function(){function e(e){this.cloudbaseConfig=e||this.cloudbaseConfig,this.authInstance=null,this.oauthInstance=null,this.requestInstance=null,this.version=Ca()}return Object.defineProperty(e.prototype,"config",{get:function(){return this.cloudbaseConfig},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"platform",{get:function(){return pa},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cache",{get:function(){return e=this.cloudbaseConfig.env,ga[e];var e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"localCache",{get:function(){return ya(this.cloudbaseConfig.env)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.requestInstance||(e=this.cloudbaseConfig.env,Wa[e]);var e},enumerable:!1,configurable:!0}),e.prototype.init=function(t){var n,r,i,a;if(t===void 0&&(t={env:``}),t.endPointMode=t.endPointMode||`GATEWAY`,pa.adapter||this.useDefaultAdapter(),(t=this.dealNodeAdapterConfig(t)).throw=(n=t.throw??t.throwOnCode)==null||n,delete t.throwOnCode,!t.env)throw Error(JSON.stringify({code:$a.INVALID_PARAMS,msg:`env must not be specified`}));this.isInitialized(t);var o=this.isNodeEnv()?void 0:15e3,s=t.timeout||o,c={env:t.env,region:t.region,accessKey:t.accessKey,context:t.context,auth:t.auth,timeout:s,timeoutMsg:s?`[${Sa}][REQUEST TIMEOUT] request had been abort since didn't finished within${s/1e3}s`:void 0};this.requestClient=new pa.adapter.reqClass(c),this.cloudbaseConfig=Ya(Ya(Ya({},ro),t),{timeout:s,i18n:qa(pa,t)}),function(e){e&&typeof e==`object`&&Ja.add(e)}(this.cloudbaseConfig),delete this.cloudbaseConfig.lang,this.cloudbaseConfig.timeout=this.formatTimeout(this.cloudbaseConfig.timeout);var l=this.cloudbaseConfig,u=l.env,d=l.persistence,f=l.debug,p=l.timeout,m=l.oauthClient,h=l.i18n;va({env:u,persistence:d,debug:f,platformInfo:this.platform}),function(e,t){ka({env:e,region:t,baseUrl:`//${e}.${t||`ap-shanghai`}.tcb-api.tencentcloudapi.com/web`,protocol:void 0,endPointKey:`CLOUD_API`})}(u,t.region||``),function(e,t,n){var r=`//${e}.api.tcloudbasegateway.com/v1`;n&&(r=`//${e}.api.intl.tcloudbasegateway.com/v1`),ka({endPointKey:`GATEWAY`,env:e,baseUrl:r,protocol:t})}(u,Da,t.intl);var g=new e(this.cloudbaseConfig);return g.requestInstance=function(e){var t=new Ua(Ma(Ma({},e),{throw:e.throw}));return Wa[e.env]=t,t}({env:u,region:t.region||``,timeout:p,oauthClient:m,_fromApp:g,i18n:h,endPointMode:t.endPointMode,auth:t.auth,context:t.context,accessKey:t.accessKey,throw:t.throw}),g.requestClient=this.requestClient,(r=this==null?void 0:this.fire)==null||r.call(this,`cloudbase_init`,g),this.try2InitAuth(g),(i=pa.adapter)!=null&&i.nodeTool&&((a=pa.adapter)==null||a.nodeTool(g,this.cloudbaseConfig)),g},e.prototype.updateConfig=function(e){var t=e.persistence,n=e.debug;this.cloudbaseConfig.persistence=t,this.cloudbaseConfig.debug=n,va({env:this.cloudbaseConfig.env,persistence:t,debug:n,platformInfo:this.platform})},e.prototype.setThrowOnCode=function(e){this.cloudbaseConfig.throw=e},e.prototype.updateLang=function(e){e&&e!==this.cloudbaseConfig.i18n?.lang&&(this.cloudbaseConfig.i18n.lang=e)},e.prototype.registerExtension=function(e){ao[e.name]=e},e.prototype.invokeExtension=function(e,t){return n=this,r=void 0,a=function(){var n;return function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}(this,function(r){switch(r.label){case 0:if(!(n=ao[e]))throw Error(JSON.stringify({code:$a.INVALID_PARAMS,msg:`extension:${e} must be registered before invoke`}));return[4,n.invoke(t,this)];case 1:return[2,r.sent()]}})},new((i=void 0)||(i=Promise))(function(e,t){function o(e){try{c(a.next(e))}catch(e){t(e)}}function s(e){try{c(a.throw(e))}catch(e){t(e)}}function c(t){var n;t.done?e(t.value):(n=t.value,n instanceof i?n:new i(function(e){e(n)})).then(o,s)}c((a=a.apply(n,r||[])).next())});var n,r,i,a},e.prototype.useAdapters=function(e,t){var n=function(e,t){for(var n,r=0,i=(n=e,Object.prototype.toString.call(n)===`[object Array]`?e:[e]);r<i.length;r++){var a=i[r],o=a.isMatch,s=a.genAdapter,c=a.runtime;if(o())return{adapter:Ji({isMatch:o},s(t)),runtime:c}}}(e,t)||{},r=n.adapter,i=n.runtime;r&&(pa.adapter=r),i&&(pa.runtime=i)},e.prototype.registerHook=function(t){(function(e,t){var n=t.entity,r=t.target;if(Object.prototype.hasOwnProperty.call(e,r))throw Error(JSON.stringify({code:sa.INVALID_OPERATION,msg:`target:${r} is not exist`}));var i=e.prototype[r];if(typeof i!=`function`)throw Error(JSON.stringify({code:sa.INVALID_OPERATION,msg:`target:${r} is not a function which is the only type supports hook`}));e.prototype[r]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.call.apply(n,oa([this],e,!1)),i.call.apply(i,oa([this],e,!1))}})(e,t)},e.prototype.registerComponent=function(t){la(e,t)},e.prototype.registerVersion=function(e){(function(e){xa=e})(e),this.version=e},e.prototype.registerSdkName=function(e){(function(e){Sa=e,function(e){Oi=e}(e)})(e)},e.prototype.isInitialized=function(e){return e===void 0&&(e=this.cloudbaseConfig),typeof e.env==`string`&&[`your-env-id`,`your-envid`,`your_env_id`,`xxx-yyy`,`xxxx-yyy`,`envId`,`env-id`,`your-environment-id`,`REPLACE_ME`].some(function(t){return e.env.toLowerCase()===t.toLowerCase()})&&to($a.INVALID_PARAMS,`[CloudBase] 检测到环境 ID "${e.env}" 可能是占位符,请替换为真实的环境 ID。
4
4
  获取方式:登录腾讯云开发平台 → 环境管理 → 环境设置 → 环境 ID
5
5
  建议通过环境变量配置:process.env.CLOUDBASE_ENV 或 import.meta.env.VITE_CLOUDBASE_ENV`),!!e?.env},e.prototype.registerEndPoint=function(e,t){ka({baseUrl:e,protocol:t,env:this.config.env,endPointKey:`CLOUD_API`})},e.prototype.registerEndPointWithKey=function(e){ka({env:this.config.env,endPointKey:e.key,baseUrl:e.url,protocol:e.protocol})},e.prototype.registerHost=function(e,t){t===void 0&&(t=`http`);var n=`//${e.replace(/^(https?:)?\/\//,``)}`;ka({baseUrl:`${n}/web`,protocol:t,env:this.config.env,endPointKey:`CLOUD_API`}),ka({baseUrl:`${n}/v1`,protocol:t,env:this.config.env,endPointKey:`GATEWAY`})},e.prototype.getEndPointWithKey=function(e){var t=Aa(this.config.env,e);return{BASE_URL:t.baseUrl,PROTOCOL:t.protocol}},e.prototype.parseCaptcha=function(e){return Vi(e)},e.prototype.useDefaultAdapter=function(){var e=Qa.bind(this)(),t=e.adapter,n=e.runtime;pa.adapter=t,pa.runtime=n},e.prototype.isNodeEnv=function(){return typeof process<`u`&&!!pa.adapter?.getSecretInfo},e.prototype.formatTimeout=function(e){if(e==null)return e;switch(!0){case e>io:return to($a.INVALID_PARAMS,`timeout is greater than maximum value[10min]`),io;case e<100:return to($a.INVALID_PARAMS,`timeout is less than maximum value[100ms]`),100;default:return e}},e.prototype.try2InitAuth=function(e){try{e.auth()}catch(e){console.log(`try2InitAuth error:`,e)}},e.prototype.dealNodeAdapterConfig=function(e){if(this.isNodeEnv()){var t=pa.adapter?.getSecretInfo(e);e.env&&typeof e.env!=`symbol`||(e.env=t.env),t.credentials&&(e.auth=Ya(Ya({},e.auth),{credentials:t.credentials}));var n=e,r=n.secretId||e.auth?.secretId,i=n.secretKey||e.auth?.secretKey;if(r&&i){var a=n.sessionToken||e.auth?.sessionToken||``;e.auth=Ya(Ya({},e.auth),{secretId:r,secretKey:i,sessionToken:a,secretType:e.auth?.secretType||(a?`SESSION_SECRET`:`SECRET`)})}}return e},Xa([no({mode:`sync`,title:`Cloudbase 初始化失败`,messages:[`请确认以下各项:`,` 1 - 调用 cloudbase.init() 的语法或参数是否正确`,` 2 - 如果是非浏览器环境,是否配置了安全应用来源(https://docs.cloudbase.net/api-reference/webv3/adapter#%E7%AC%AC-2-%E6%AD%A5%E9%85%8D%E7%BD%AE%E5%AE%89%E5%85%A8%E5%BA%94%E7%94%A8%E6%9D%A5%E6%BA%90)`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${eo}`]}),Za(`design:type`,Function),Za(`design:paramtypes`,[Object]),Za(`design:returntype`,e)],e.prototype,`init`,null),Xa([no({title:`调用扩展能力失败`,messages:[`请确认以下各项:`,` 1 - 调用 invokeExtension() 的语法或参数是否正确`,` 2 - 被调用的扩展能力是否已经安装并通过 registerExtension() 注册`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${eo}`]}),Za(`design:type`,Function),Za(`design:paramtypes`,[String,Object]),Za(`design:returntype`,Promise)],e.prototype,`invokeExtension`,null),e}()),so=da.WxRequest===void 0?null:(da.default.genAdapter=function(e){return{root:{globalThis:{}},reqClass:da.WxRequest,wsClass:da.WxMpWebSocket,captchaOptions:{openURIWithCallback:function(t){var n=e.EventBus,r={},i=t;console.log(`openURIWithCallback`,t);var a=t.match(/^(data:.*?)(\?[^#\s]*)?$/);if(a){i=a[1],console.log(`openURIWithCallback url`,i);var o=a[2];o&&(r=(0,da.parseQueryString)(o))}console.log(`openURIWithCallback queryObj`,r);var s=r.token,c=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(r,[`token`]);return/^data:/.test(i)&&!s?Promise.reject({error:`invalid_argument`,error_description:`invalie captcha data: ${t}`}):s?new Promise(function(e){console.log(`wait for captcha...`),n.$emit(`CAPTCHA_DATA_CHANGE`,fa(fa({},c),{token:s,url:i})),n.$once(`RESOLVE_CAPTCHA_DATA`,function(t){e(t)})}):Promise.reject({error:`unimplemented`,error_description:`need to impl captcha data`})}},localStorage:da.wxMpStorage,primaryStorage:Mi.StorageType.local,getAppSign:function(){var e=wx.getAccountInfoSync();return typeof App<`u`||typeof getApp<`u`||wx.onAppHide||wx.offAppHide||wx.onAppShow||wx.offAppShow?e&&e.miniProgram?e.miniProgram.appId:``:e&&e.plugin?e.plugin.appId:``}}},da.default);so&&oo.useAdapters(so);var co=oo;co.registerVersion(`3.10.1`);try{window.cloudbase=co}catch{}var lo=co,uo=Di.Z,fo={171:(e,t,n)=>{var r;if(n.r(t),n.d(t,{getEncryptInfo:()=>Ee}),!globalThis.IS_MP_BUILD){var i=typeof globalThis<`u`?globalThis.navigator:window.globalThis;function a(e){return`0123456789abcdefghijklmnopqrstuvwxyz`.charAt(e)}function o(e,t){return e&t}function s(e,t){return e|t}function c(e,t){return e^t}function l(e,t){return e&~t}function u(e){if(e==0)return-1;var t=0;return 65535&e||(e>>=16,t+=16),255&e||(e>>=8,t+=8),15&e||(e>>=4,t+=4),3&e||(e>>=2,t+=2),1&e||++t,t}function d(e){for(var t=0;e!=0;)e&=e-1,++t;return t}var f=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;function p(e){var t,n,r=``;for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=f.charAt(n>>6)+f.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=f.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=f.charAt(n>>2)+f.charAt((3&n)<<4));(3&r.length)>0;)r+=`=`;return r}function m(e){var t,n=``,r=0,i=0;for(t=0;t<e.length&&e.charAt(t)!=`=`;++t){var o=f.indexOf(e.charAt(t));o<0||(r==0?(n+=a(o>>2),i=3&o,r=1):r==1?(n+=a(i<<2|o>>4),i=15&o,r=2):r==2?(n+=a(i),n+=a(o>>2),i=3&o,r=3):(n+=a(i<<2|o>>4),n+=a(15&o),r=0))}return r==1&&(n+=a(i<<2)),n}var h,g,_={decode:function(e){var t;if(h===void 0){var n=`0123456789ABCDEF`;for(h={},t=0;t<16;++t)h[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)h[n.charAt(t)]=t;for(t=0;t<8;++t)h[` \f
@@ -168,9 +168,9 @@ ${[`verifyOtp`,`signInWithOtp`,`signUp`].includes(n)?`
168
168
  ✓ 控制台已开启「短信验证码登录」或「邮箱验证码登录」`,signInWithOAuth:`当前使用「第三方 OAuth 登录」,需确保:
169
169
  ✓ 控制台已配置并开启对应的第三方身份源`}[e]||``}var I=function(e){function t(t,n){var r=this,o=function(e){return typeof e==`object`&&!!e&&`__isAuthError`in e}(t);return(r=e.call(this,o?t.message:t.error_description||t.message)||this).__isAuthError=!0,r.name=`AuthError`,o?(r.status=t.status,r.code=t.code,r.errorCode=t.errorCode,r.requestId=t.requestId,r.category=t.category,r.retryAfter=t.retryAfter,r.helpMessage=$e(r.category,{method:n?.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=et(n?.method),r):(r.status=t.error,r.code=String(t.error||t.error_code||`unknown`).toLowerCase(),r.errorCode=typeof t.error_code==`number`?t.error_code:typeof t.error_code==`string`&&parseInt(t.error_code,10)||void 0,r.requestId=t.requestId,r.category=function(e,t,n){if(!e&&!t&&!n)return F.UNKNOWN;try{var r=(e||``).toLowerCase(),o=typeof n==`string`?parseInt(n,10):n;return o===a.MISSING_REQUIRED_PARAM||t===i.MISSING_REQUIRED_PARAM?F.INVALID_PARAMS:o===a.CAPTCHA_REQUIRED||t===i.CAPTCHA_REQUIRED?F.CAPTCHA_REQUIRED:o===a.CAPTCHA_INVALID||t===i.CAPTCHA_INVALID?F.CAPTCHA_INVALID:o===a.MFA_PHONE_REQUIRED||t===i.MFA_PHONE_REQUIRED?F.MFA_REQUIRED:o===a.LOGIN_TYPE_DISABLED||t===i.LOGIN_TYPE_DISABLED?F.PROVIDER_NOT_ENABLED:o===a.RESOURCE_EXHAUSTED||t===i.RESOURCE_EXHAUSTED?F.RATE_LIMITED:o===a.INTERNAL||o===a.UNAVAILABLE||o===a.UNIMPLEMENTED||o===a.ABORTED?F.SERVICE_ERROR:o===a.NOT_FOUND?F.USER_NOT_FOUND:o===a.UNAUTHENTICATED?F.INVALID_CREDENTIALS:o===a.INVALID_ARGUMENT&&(r.includes(`验证码`)||r.includes(`verification`)||r.includes(`verification_code`)||r.includes(`verification_id`)||r.includes(`does not match`)||r.includes(`token expired`)||r.includes(`token error`)||r.includes(`过期`))?F.VERIFICATION_FAILED:t===i.PROVIDER_NOT_ENABLED||t===i.LOGIN_METHOD_DISABLED||r.includes(`身份源`)||r.includes(`开启`)||r.includes(`identity provider`)||r.includes(`provider not enabled`)||r.includes(`login method`)||r.includes(`登录方式`)||r.includes(`not enabled`)||r.includes(`未开启`)||r.includes(`未启用`)||r.includes(`请联系开发者`)||r.includes(`anonymous login is not enabled`)||r.includes(`匿名登录未开启`)?F.PROVIDER_NOT_ENABLED:t===i.FAILED_PRECONDITION||o===a.FAILED_PRECONDITION&&!r.includes(`请联系开发者`)?r.includes(`不存在`)||r.includes(`not found`)||r.includes(`未注册`)?F.USER_NOT_FOUND:F.PRECONDITION_FAILED:t===i.INVALID_PASSWORD||t===i.INVALID_GRANT||t===i.INVALID_VERIFICATION_CODE||t===i.INVALID_USERNAME_OR_PASSWORD||t===i.INVALID_CREDENTIALS||t===i.WRONG_PASSWORD||t===i.UNAUTHENTICATED||t===i.INVALID_TWO_FACTOR||t===i.INVALID_TWO_FACTOR_RECOVERY||t===i.PASSWORD_NOT_SET||r.includes(`密码不正确`)||r.includes(`password`)||r.includes(`invalid_password`)||r.includes(`凭据`)||r.includes(`credentials`)||r.includes(`验证码`)||r.includes(`verification`)||r.includes(`invalid_verification_code`)||r.includes(`invalid_username_or_password`)||r.includes(`username or password`)||r.includes(`用户名或密码`)||r.includes(`wrong password`)||r.includes(`incorrect password`)?F.INVALID_CREDENTIALS:t===i.NOT_FOUND||t===i.USER_NOT_FOUND||r.includes(`用户不存在`)||r.includes(`not found`)||r.includes(`user not found`)||r.includes(`no such user`)||r.includes(`user does not exist`)?F.USER_NOT_FOUND:t===i.USER_BLOCKED||t===i.USER_PENDING||t===i.UNDER_REVIEW||t===i.INVALID_STATUS||r.includes(`被封禁`)||r.includes(`blocked`)||r.includes(`pending`)||r.includes(`审核`)||r.includes(`review`)||r.includes(`locked`)||r.includes(`已锁定`)?F.USER_STATUS_ABNORMAL:t===i.SERVER_ERROR||t===i.UNAVAILABLE||t===i.TEMPORARILY_UNAVAILABLE||t===i.INTERNAL||t===i.UNREACHABLE||t===i.DEADLINE_EXCEEDED||t===i.DATA_LOSS||t===i.ABORTED||r.includes(`network`)||r.includes(`timeout`)||r.includes(`timed out`)||r.includes(`超时`)||r.includes(`smtp is not set`)||r.includes(`sms sender does not config`)?F.SERVICE_ERROR:t===i.INVALID_ARGUMENT||t===i.INVALID_REQUEST||t===i.INVALID_SCOPE||t===i.INVALID_REQUEST_URI||t===i.INVALID_REQUEST_OBJECT||o===a.INVALID_ARGUMENT?F.INVALID_PARAMS:t===i.PERMISSION_DENIED||t===i.ACCESS_DENIED||t===i.UNAUTHORIZED_CLIENT?F.PROVIDER_NOT_ENABLED:F.UNKNOWN}catch{return t}}(r.message,r.status,r.errorCode),r.helpMessage=$e(r.category,{method:n?.method,errorCode:r.errorCode,code:r.code}),r.loginMethodHint=et(n?.method),r.category===F.RATE_LIMITED&&(r.retryAfter=t.retry_after||t.retryAfter||void 0),r)}return Xe(t,e),t.prototype.toJSON=function(){return{name:this.name,message:this.message,code:this.code,errorCode:this.errorCode,status:this.status,requestId:this.requestId,category:this.category,retryAfter:this.retryAfter}},t}(Error),tt=function(){return tt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},tt.apply(this,arguments)},L=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},R=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function nt(e,t){return L(this,void 0,void 0,function(){var n,r=this;return R(this,function(i){n=function(){return L(r,void 0,void 0,function(){return R(this,function(e){switch(e.label){case 0:return e.trys.push([0,1,,6]),[2,mo(171)];case 1:e.sent(),e.label=2;case 2:return e.trys.push([2,4,,5]),[4,Promise.resolve().then(mo.bind(mo,171))];case 3:return[2,e.sent()];case 4:return e.sent(),[2];case 5:return[3,6];case 6:return[2]}})})};try{if((t?.root?.globalThis||globalThis).IS_MP_BUILD)return[2];if(e)return[2,n()]}catch{if(e)return[2,n()]}return[2]})})}var rt=function(){function e(e){var t=e.request,n=e.credentialsClient;if(n||=new Pe({apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,storage:e.storage,env:e.env,baseRequest:e.baseRequest,anonymousSignInFunc:e.anonymousSignInFunc,wxCloud:e.wxCloud,onCredentialsError:e.onCredentialsError,headers:e.headers||{},i18n:e.i18n,debug:e.debug}),!t){var r=n.request.bind(n),i=new Je(tt({env:e.env,clientId:e.clientId,request:r,storage:e.storage,adapter:e.adapter,oauthInstance:this},e.captchaOptions));t=i.request.bind(i)}this.config={env:e.env,apiOrigin:e.apiOrigin,apiPath:e.apiPath,clientId:e.clientId,request:t,credentialsClient:n,storage:e.storage||Me,adapter:e.adapter}}return e.parseParamsToSearch=function(e){return Object.keys(e).forEach(function(t){e[t]||delete e[t]}),new Ye(e).toString()},e.prototype.getParamsByVersion=function(e,r){var i=(0,w.I)(e),a={v2:n}[i?.version]?.[r]||t[r];return i&&delete i.version,{params:i,url:a}},e.prototype.signIn=function(e){return L(this,void 0,Promise,function(){var t,n,r,i;return R(this,function(a){switch(a.label){case 0:return t=e.version||`v1`,(n=this.getParamsByVersion(e,`AUTH_SIGN_IN_URL`)).params.query&&delete n.params.query,[4,this.getEncryptParams(n.params)];case 1:return r=a.sent(),[4,this.config.request(n.url,{method:`POST`,body:r})];case 2:return i=a.sent(),[4,this.config.credentialsClient.setCredentials(tt(tt({},i),{version:t}))];case 3:return a.sent(),[2,Promise.resolve(i)]}})})},e.prototype.signInAnonymously=function(e,n){return e===void 0&&(e={}),n===void 0&&(n=!1),L(this,void 0,Promise,function(){var r;return R(this,function(i){switch(i.label){case 0:return[4,this.config.request(t.AUTH_SIGN_IN_ANONYMOUSLY_URL,{method:`POST`,body:e,useWxCloud:n})];case 1:return r=i.sent(),[4,this.config.credentialsClient.setCredentials(r)];case 2:return i.sent(),[2,Promise.resolve(r)]}})})},e.prototype.signUp=function(e){return L(this,void 0,Promise,function(){var n;return R(this,function(r){switch(r.label){case 0:return[4,this.config.request(t.AUTH_SIGN_UP_URL,{method:`POST`,body:e})];case 1:return n=r.sent(),[4,this.config.credentialsClient.setCredentials(n)];case 2:return r.sent(),[2,Promise.resolve(n)]}})})},e.prototype.signOut=function(e){return L(this,void 0,Promise,function(){var n,r,a,o;return R(this,function(s){switch(s.label){case 0:if(n={},!e)return[3,6];s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.config.request(t.AUTH_SIGNOUT_URL,{method:`POST`,withCredentials:!0,body:e})];case 2:return n=s.sent(),[3,4];case 3:return(r=s.sent()).error!==i.UNAUTHENTICATED&&console.log(`sign_out_error`,r),[3,4];case 4:return[4,this.config.credentialsClient.setCredentials()];case 5:return s.sent(),[2,n];case 6:return[4,this.config.credentialsClient.getAccessToken()];case 7:return a=s.sent(),[4,this.config.request(t.AUTH_REVOKE_URL,{method:`POST`,body:{token:a}})];case 8:return o=s.sent(),[4,this.config.credentialsClient.setCredentials()];case 9:return s.sent(),[2,Promise.resolve(o)]}})})},e.prototype.revokeAllDevices=function(){return L(this,void 0,Promise,function(){return R(this,function(e){switch(e.label){case 0:return[4,this.config.request(t.AUTH_REVOKE_ALL_URL,{method:`DELETE`,withCredentials:!0})];case 1:return e.sent(),[2]}})})},e.prototype.revokeDevice=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){switch(n.label){case 0:return[4,this.config.request(t.AUTHORIZED_DEVICES_DELETE_URL+e.device_id,{method:`DELETE`,withCredentials:!0})];case 1:return n.sent(),[2]}})})},e.prototype.getVerification=function(e,n){return L(this,void 0,Promise,function(){var r,i;return R(this,function(a){switch(a.label){case 0:return r=!1,e.target===`CUR_USER`?(r=!0,[3,3]):[3,1];case 1:return[4,this.hasLoginState()];case 2:a.sent()&&(r=!0),a.label=3;case 3:return(i=(0,w.I)(e)).phone_number&&!/^\+\d{1,3}\s+\d+/.test(i.phone_number)&&(i.phone_number=`+86 ${i.phone_number}`),[2,this.config.request(t.VERIFICATION_URL,{method:`POST`,body:i,withCaptcha:n?.withCaptcha||!1,withCredentials:r})]}})})},e.prototype.verify=function(e){return L(this,void 0,Promise,function(){var t,n;return R(this,function(r){switch(r.label){case 0:return t=this.getParamsByVersion(e,`VERIFY_URL`),[4,this.config.request(t.url,{method:`POST`,body:t.params})];case 1:return n=r.sent(),e?.version===`v2`?[4,this.config.credentialsClient.setCredentials(tt(tt({},n),{version:`v2`}))]:[3,3];case 2:r.sent(),r.label=3;case 3:return[2,n]}})})},e.prototype.genProviderRedirectUri=function(n){return L(this,void 0,Promise,function(){var r,i,a,o,s;return R(this,function(c){return r=n.provider_redirect_uri,i=n.other_params,a=i===void 0?{}:i,o=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,[`provider_redirect_uri`,`other_params`]),r&&!o.redirect_uri&&(o.redirect_uri=r),s=`${t.PROVIDER_URI_URL}?${e.parseParamsToSearch(o)}`,Object.keys(a).forEach(function(e){var t=a[e];(e!==`sign_out_uri`||t?.length>0)&&(s+=`&other_params[${e}]=${encodeURIComponent(t)}`)}),[2,this.config.request(s,{method:`GET`})]})})},e.prototype.grantProviderToken=function(e,n){return n===void 0&&(n=!1),L(this,void 0,Promise,function(){return R(this,function(r){return[2,this.config.request(t.PROVIDER_TOKEN_URL,{method:`POST`,body:e,useWxCloud:n})]})})},e.prototype.patchProviderToken=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.PROVIDER_TOKEN_URL,{method:`PATCH`,body:e})]})})},e.prototype.signInWithProvider=function(e,t){return t===void 0&&(t=!1),L(this,void 0,Promise,function(){var n,r;return R(this,function(i){switch(i.label){case 0:return n=this.getParamsByVersion(e,`AUTH_SIGN_IN_WITH_PROVIDER_URL`),[4,this.config.request(n.url,{method:`POST`,body:n.params,useWxCloud:t})];case 1:return r=i.sent(),[4,this.config.credentialsClient.setCredentials(tt(tt({},r),{version:e?.version||`v1`}))];case 2:return i.sent(),[2,Promise.resolve(r)]}})})},e.prototype.toBindIdentity=function(e){var t,n;return L(this,void 0,void 0,function(){var r,i,a,o;return R(this,function(s){switch(s.label){case 0:return(i=e.credentials)?[3,2]:[4,this.config.credentialsClient.localCredentials.getCredentials()];case 1:i=s.sent(),s.label=2;case 2:r=i,s.label=3;case 3:return s.trys.push([3,5,,6]),[4,this.bindWithProvider({provider_token:e.provider_token},r)];case 4:return s.sent(),a={data:{type:x,provider:e.provider},error:null},[3,6];case 5:return o=s.sent(),a={data:{type:x},error:new I(o)},[3,6];case 6:return e.fireEvent&&((n=(t=this.config.eventBus)?.fire)==null||n.call(t,v,{event:g,info:a})),[2,a]}})})},e.prototype.getInitialSession=function(){return L(this,void 0,Promise,function(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m;return R(this,function(h){switch(h.label){case 0:e={},h.label=1;case 1:if(h.trys.push([1,12,,13]),typeof window>`u`||typeof document>`u`||(t=new URLSearchParams(location==null?void 0:location.search),n=t.get(`code`),r=t.get(`state`),!n||!r))return[2,{data:null,error:null}];i=null;try{i=JSON.parse(sessionStorage.getItem(r)||`null`)}catch{}return e={type:i?.type},a=t.get(`error`),o=t.get(`error_description`),a||o?[2,{data:e,error:new I({message:o||a||`Unknown error from OAuth provider`})}]:(s=i?.provider||t.get(`provider`))?(c=location.origin+location.pathname,[4,this.grantProviderToken({provider_id:s,provider_redirect_uri:c,provider_code:n})]):[2,{data:e,error:new I({message:`Provider is required for OAuth verification`})}];case 2:return l=h.sent().provider_token,u=void 0,d=null,f=void 0,i.type===x?[4,this.config.credentialsClient.localCredentials.getCredentials()]:[3,5];case 3:return u=h.sent(),[4,this.toBindIdentity({provider:s,provider_token:l,credentials:u})];case 4:return f=h.sent(),[3,11];case 5:return i.type===y?(f=this.getParamsByVersion({provider:s},`AUTH_SIGN_IN_WITH_PROVIDER_URL`),[4,this.config.request(f.url,{method:`POST`,body:{provider_token:l}})]):[3,11];case 6:u=h.sent(),h.label=7;case 7:return h.trys.push([7,9,,10]),[4,this.getUserInfo({credentials:u})];case 8:return d=h.sent(),[3,10];case 9:return p=h.sent(),console.error(`get user info error`,p),[3,10];case 10:f={data:tt(tt({},e),{session:u,user:d}),error:null},h.label=11;case 11:t.delete(`code`),t.delete(`state`),t.delete(`provider`),this.restoreUrlState(i?.search===void 0?`?${t.toString()}`:i.search,i?.hash||location.hash);try{sessionStorage.removeItem(r)}catch{}return[2,f];case 12:return m=h.sent(),[2,{data:e,error:new I(m)}];case 13:return[2]}})})},e.prototype.signInCustom=function(e){return L(this,void 0,Promise,function(){var n;return R(this,function(r){switch(r.label){case 0:return[4,this.config.request(t.AUTH_SIGN_IN_CUSTOM,{method:`POST`,body:e})];case 1:return n=r.sent(),[4,this.config.credentialsClient.setCredentials(n)];case 2:return r.sent(),[2,Promise.resolve(n)]}})})},e.prototype.signInWithWechat=function(e){return e===void 0&&(e={}),L(this,void 0,Promise,function(){var n;return R(this,function(r){switch(r.label){case 0:return[4,this.config.request(t.AUTH_SIGN_IN_WITH_WECHAT_URL,{method:`POST`,body:e})];case 1:return n=r.sent(),[4,this.config.credentialsClient.setCredentials(n)];case 2:return r.sent(),[2,Promise.resolve(n)]}})})},e.prototype.bindWithProvider=function(e,n){return L(this,void 0,Promise,function(){return R(this,function(r){return[2,this.config.request(t.PROVIDER_BIND_URL,{method:`POST`,body:e,withCredentials:!0,getCredentials:n?function(){return n}:void 0})]})})},e.prototype.getUserProfile=function(e){return L(this,void 0,Promise,function(){return R(this,function(t){return[2,this.getUserInfo(e)]})})},e.prototype.getUserInfo=function(e){var t;return e===void 0&&(e={}),L(this,void 0,Promise,function(){var n,r,i,a,o;return R(this,function(s){switch(s.label){case 0:return n=this.getParamsByVersion(e,`USER_ME_URL`),(t=n.params)!=null&&t.query&&(r=new Ye(n.params.query),n.url+=`?${r.toString()}`),[4,this.config.request(n.url,{method:`GET`,withCredentials:!0,getCredentials:e.credentials?function(){return e.credentials}:void 0})];case 1:if((i=s.sent()).sub&&(i.uid=i.sub),i.providers?.length)try{typeof wx<`u`&&wx.getAccountInfoSync&&(a=wx.getAccountInfoSync().miniProgram?.appId,(o=i.providers.find(function(e){return e.id===a}))!=null&&o.provider_user_id&&(i.open_id=o.provider_user_id))}catch{}return[2,i]}})})},e.prototype.getWedaUserInfo=function(){return L(this,void 0,Promise,function(){return R(this,function(e){switch(e.label){case 0:return[4,this.config.request(t.WEDA_USER_URL,{method:`GET`,withCredentials:!0})];case 1:return[2,e.sent()]}})})},e.prototype.deleteMe=function(t){return L(this,void 0,Promise,function(){var n,r;return R(this,function(i){return n=this.getParamsByVersion(t,`USER_ME_URL`),r=`${n.url}?${e.parseParamsToSearch(n.params)}`,[2,this.config.request(r,{method:`DELETE`,withCredentials:!0})]})})},e.prototype.hasLoginState=function(){return L(this,void 0,Promise,function(){return R(this,function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.config.credentialsClient.getAccessToken()];case 1:return e.sent(),[2,!0];case 2:return e.sent(),[2,!1];case 3:return[2]}})})},e.prototype.hasLoginStateSync=function(){return this.config.credentialsClient.getCredentialsSync()},e.prototype.getLoginState=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.credentialsClient.getCredentialsAsync()]})})},e.prototype.transByProvider=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.USER_TRANS_BY_PROVIDER_URL,{method:`PATCH`,body:e,withCredentials:!0})]})})},e.prototype.grantToken=function(e){return L(this,void 0,Promise,function(){var t;return R(this,function(n){return t=this.getParamsByVersion(e,`AUTH_TOKEN_URL`),[2,this.config.request(t.url,{method:`POST`,body:t.params})]})})},e.prototype.getProviders=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.request(t.PROVIDER_LIST,{method:`GET`,withCredentials:!0})]})})},e.prototype.unbindProvider=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.PROVIDER_UNBIND_URL}/${e.provider_id}`,{method:`DELETE`,withCredentials:!0})]})})},e.prototype.checkPassword=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.CHECK_PWD_URL}`,{method:`POST`,withCredentials:!0,body:e})]})})},e.prototype.editContact=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.BIND_CONTACT_URL}`,{method:`PATCH`,withCredentials:!0,body:e})]})})},e.prototype.setPassword=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.AUTH_SET_PASSWORD}`,{method:`PATCH`,withCredentials:!0,body:e})]})})},e.prototype.updatePasswordByOld=function(e){return L(this,void 0,Promise,function(){var t;return R(this,function(n){switch(n.label){case 0:return[4,this.sudo({password:e.old_password})];case 1:return t=n.sent(),[2,this.setPassword({sudo_token:t.sudo_token,new_password:e.new_password})]}})})},e.prototype.sudo=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.SUDO_URL}`,{method:`POST`,withCredentials:!0,body:e})]})})},e.prototype.sendVerificationCodeToCurrentUser=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return e.target=`CUR_USER`,[2,this.config.request(t.VERIFICATION_URL,{method:`POST`,body:e,withCredentials:!0,withCaptcha:!0})]})})},e.prototype.changeBoundProvider=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(`${t.PROVIDER_LIST}/${e.provider_id}/trans`,{method:`POST`,body:{provider_trans_token:e.trans_token},withCredentials:!0})]})})},e.prototype.setUserProfile=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.USER_PRIFILE_URL,{method:`PATCH`,body:e,withCredentials:!0})]})})},e.prototype.updateUserBasicInfo=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.USER_BASIC_EDIT_URL,{method:`POST`,withCredentials:!0,body:e})]})})},e.prototype.queryUserProfile=function(e){return L(this,void 0,Promise,function(){var n;return R(this,function(r){return n=new Ye(e),[2,this.config.request(`${t.USER_QUERY_URL}?${n.toString()}`,{method:`GET`,withCredentials:!0})]})})},e.prototype.setCustomSignFunc=function(e){this.getCustomSignTicketFn=e},e.prototype.signInWithCustomTicket=function(){return L(this,void 0,Promise,function(){var e,t;return R(this,function(n){switch(n.label){case 0:return(e=this.getCustomSignTicketFn)?[4,e()]:[2,Promise.reject({error:`failed_precondition`,error_description:`please use setCustomSignFunc to set custom sign function`})];case 1:return t=n.sent(),[2,this.signInCustom({provider_id:`custom`,ticket:t})]}})})},e.prototype.resetPassword=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.AUTH_RESET_PASSWORD,{method:`POST`,body:e})]})})},e.prototype.authorize=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.AUTHORIZE_URL,{method:`POST`,withCredentials:!0,body:e})]})})},e.prototype.authorizeDevice=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.AUTHORIZE_DEVICE_URL,{method:`POST`,withCredentials:!0,body:e})]})})},e.prototype.deviceAuthorize=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.AUTH_GET_DEVICE_CODE,{method:`POST`,body:e})]})})},e.prototype.authorizeInfo=function(n){return L(this,void 0,Promise,function(){var r,i,a;return R(this,function(o){switch(o.label){case 0:return r=`${t.AUTHORIZE_INFO_URL}?${e.parseParamsToSearch(n)}`,i=!0,a=!1,[4,this.hasLoginState()];case 1:return o.sent()&&(a=!0,i=!1),[2,this.config.request(r,{method:`GET`,withBasicAuth:i,withCredentials:a})]}})})},e.prototype.checkUsername=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.CHECK_USERNAME,{method:`GET`,body:e,withCredentials:!0})]})})},e.prototype.checkIfUserExist=function(e){return L(this,void 0,Promise,function(){var n;return R(this,function(r){return n=new Ye(e),[2,this.config.request(`${t.CHECK_IF_USER_EXIST}?${n.toString()}`,{method:`GET`})]})})},e.prototype.loginScope=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.credentialsClient.getScope()]})})},e.prototype.loginGroups=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.credentialsClient.getGroups()]})})},e.prototype.refreshTokenForce=function(e){return L(this,void 0,void 0,function(){var t;return R(this,function(n){switch(n.label){case 0:return[4,this.config.credentialsClient.getCredentials()];case 1:return t=n.sent(),[4,this.config.credentialsClient.refreshToken(tt(tt({},t),{version:e?.version||`v1`}))];case 2:return[2,n.sent()]}})})},e.prototype.getCredentials=function(){return L(this,void 0,void 0,function(){return R(this,function(e){return[2,this.config.credentialsClient.getCredentials()]})})},e.prototype.getPublicKey=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.request(n.AUTH_PUBLIC_KEY,{method:`POST`,body:{}})]})})},e.prototype.getEncryptParams=function(e){return L(this,void 0,Promise,function(){var t,n,r,i,a,o;return R(this,function(s){switch(s.label){case 0:return t=e.isEncrypt,delete e.isEncrypt,n=(0,w.I)(e),[4,nt(t,this.config.adapter)];case 1:if(!(r=s.sent()))return[2,e];i=``,a=``,s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(o=s.sent(),i=o.public_key,a=o.public_key_thumbprint,!i||!a)throw o;return[3,5];case 4:throw s.sent();case 5:return[2,{params:r.getEncryptInfo({publicKey:i,payload:n}),public_key_thumbprint:a}]}})})},e.prototype.getProviderSubType=function(){return L(this,void 0,Promise,function(){return R(this,function(e){return[2,this.config.request(t.GET_PROVIDER_TYPE,{method:`POST`,body:{provider_id:`weda`}})]})})},e.prototype.verifyCaptchaData=function(e){var n=e.token,r=e.key;return L(this,void 0,void 0,function(){return R(this,function(e){return[2,this.config.request(t.VERIFY_CAPTCHA_DATA_URL,{method:`POST`,body:{token:n,key:r},withCredentials:!1})]})})},e.prototype.createCaptchaData=function(e){var n=e.state,r=e.redirect_uri,i=r===void 0?void 0:r;return L(this,void 0,void 0,function(){return R(this,function(e){return[2,this.config.request(t.CAPTCHA_DATA_URL,{method:`POST`,body:{state:n,redirect_uri:i},withCredentials:!1})]})})},e.prototype.getMiniProgramCode=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.GET_MINIPROGRAM_QRCODE,{method:`POST`,body:e})]})})},e.prototype.getMiniProgramQrCodeStatus=function(e){return L(this,void 0,Promise,function(){return R(this,function(n){return[2,this.config.request(t.GET_MINIPROGRAM_QRCODE_STATUS,{method:`POST`,body:e})]})})},e.prototype.getUserBehaviorLog=function(e){return L(this,void 0,Promise,function(){var n,r;return R(this,function(i){return n={LOGIN:`query[action]=USER_LOGIN`,MODIFY:`ne_query[action]=USER_LOGIN`},r=`${t.GET_USER_BEHAVIOR_LOG}?${n[e.type]}&limit=${e.limit}${e.page_token?`&page_token=${e.page_token}`:``}`,[2,this.config.request(r,{method:`GET`,withCredentials:!0})]})})},e.prototype.modifyPassword=function(e){return L(this,void 0,Promise,function(){var n,r,i,a,o,s;return R(this,function(c){switch(c.label){case 0:return n=``,r=``,[4,nt(!0,this.config.adapter)];case 1:if(!(i=c.sent()))throw Error(`do not support encrypt, a encrypt util required.`);c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(a=c.sent(),n=a.public_key,r=a.public_key_thumbprint,!n||!r)throw a;return[3,5];case 4:throw c.sent();case 5:return o=e.password?i.getEncryptInfo({publicKey:n,payload:e.password}):``,s=i.getEncryptInfo({publicKey:n,payload:e.new_password}),[2,this.config.request(t.USER_BASIC_EDIT_URL,{method:`POST`,withCredentials:!0,body:{user_id:e.user_id,encrypt_password:o,encrypt_new_password:s,public_key_thumbprint:r}})]}})})},e.prototype.modifyPasswordWithoutLogin=function(e){return L(this,void 0,Promise,function(){var t,r,i,a,o,s;return R(this,function(c){switch(c.label){case 0:return t=``,r=``,[4,nt(!0,this.config.adapter)];case 1:if(!(i=c.sent()))throw Error(`do not support encrypt, a encrypt util required.`);c.label=2;case 2:return c.trys.push([2,4,,5]),[4,this.getPublicKey()];case 3:if(a=c.sent(),t=a.public_key,r=a.public_key_thumbprint,!t||!r)throw a;return[3,5];case 4:throw c.sent();case 5:return o=e.password?i.getEncryptInfo({publicKey:t,payload:e.password}):``,s=i.getEncryptInfo({publicKey:t,payload:e.new_password}),[2,this.config.request(n.AUTH_RESET_PASSWORD,{method:`POST`,body:{username:e.username,password:o,new_password:s,public_key_thumbprint:r}})]}})})},e.prototype.restoreUrlState=function(e,t){if(e!==void 0)try{var n=new URL(window.location.href);n.search=e,n.hash=t||``,window.history.replaceState(null,``,n.toString()),window.location.replace(n.toString())}catch{}},e}(),it=function(){return it=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},it.apply(this,arguments)},at=function(){function e(e){var t=e.apiOrigin,n=e.getApiOrigin,r=e.apiPath,i=r===void 0?s:r,a=e.clientId,o=e.env,c=e.storage,l=e.request,u=e.baseRequest,d=e.anonymousSignInFunc,f=e.wxCloud,p=e.adapter,m=e.onCredentialsError,h=e.headers,g=e.i18n,_=e.useWxCloud,v=e.eventBus,y=e.detectSessionInUrl,b=e.debug;if(this.detectSessionInUrl=y!=null&&y,this.oauth2client=new Pe({apiOrigin:t,getApiOrigin:n,apiPath:i,clientId:a,env:o,storage:c,baseRequest:u||l,anonymousSignInFunc:d,wxCloud:f,onCredentialsError:m,headers:h||{},i18n:g,useWxCloud:_,eventBus:v,debug:b}),this.authApi=new rt(it(it({credentialsClient:this.oauth2client},e),{request:l?this.oauth2client.request.bind(this.oauth2client):void 0,adapter:p})),y)this.oauth2client.setGetInitialSession(this.authApi.getInitialSession.bind(this.authApi));else try{var x=new URL(window.location.href),S=x.searchParams.get(`code`),C=x.searchParams.get(`state`),w=JSON.parse(sessionStorage.getItem(C)||`null`);S&&C&&w!=null&&w.hash&&(x.hash=w.hash,window.history.replaceState(null,``,x.toString()),window.location.replace(x.toString()))}catch{}}return e.prototype.initializeSession=function(e){this.detectSessionInUrl?(this.oauth2client.setOnInitialSessionObtained(e),this.oauth2client.initialize()):this.oauth2client.initialize(Promise.resolve({error:null}))},e}(),z=mo(794),ot=mo(141),st=mo(197);let ct=(e=>{var t={};return mo.d(t,e),t})({default:()=>Ti});var lt=mo(182),ut=function(){return ut=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ut.apply(this,arguments)},dt=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},ft=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},pt=function(){function e(e){try{this.localStorage=e?.localStorage||(e?.adapter?.root?.globalThis||globalThis).localStorage}catch{this.localStorage=e?.localStorage||{}}}return e.prototype.getItem=function(e){return dt(this,void 0,Promise,function(){return ft(this,function(t){return[2,this.localStorage.getItem(e)]})})},e.prototype.removeItem=function(e){return dt(this,void 0,void 0,function(){return ft(this,function(t){return this.localStorage.removeItem(e),[2]})})},e.prototype.setItem=function(e,t){return dt(this,void 0,Promise,function(){return ft(this,function(n){return this.localStorage.setItem(e,t),[2]})})},e.prototype.getItemSync=function(e){return this.localStorage.getItem(e)},e.prototype.setItemSync=function(e,t){this.localStorage.setItem(e,t)},e.prototype.removeItemSync=function(e){this.localStorage.removeItem(e)},e}(),mt=/^[^:]+:\/\/[^/]+(\/[^?#]+)/,ht=function(e,t){var n,r,i=t?.headers?.[`x-request-id`];return e||={},(e!=null&&e.code||(n=e?.data)!=null&&n.error_code)&&(e={error:e.code||e.data.error,error_description:e.data.error_description||e.message||e.code||e.data.error_code,request_id:e.requestId,error_code:e.data?.error_code}),e!=null&&e.request_id||(e.request_id=e.request_id||i),e?.error?(e.error_uri=(r=t?.url,mt.test(r)?RegExp.$1:r),e):e?.data||{}},gt=function(e){return e.adapter&&e.adapter.type!=="default"?function(e,t){var n=ut({},e);try{if(!(e!=null&&e.storage)&&t!=null&&t.localStorage&&(n.storage=new pt({localStorage:t.localStorage,adapter:t})),!e.captchaOptions&&t!=null&&t.captchaOptions&&(n.captchaOptions=t.captchaOptions),!e.baseRequest&&!e.request&&t?.reqClass){var r={timeout:1e4,restrictedMethods:[`get`,`post`,`upload`,`download`,`request`],auth:e.auth},i=new t.reqClass(r);n.baseRequest=function(e,t){var n,r,a;return dt(this,void 0,void 0,function(){var o,s,c,l;return ft(this,function(u){switch(u.label){case 0:if(o={},s=t.method?.toLocaleLowerCase()||`post`,typeof(c=((n=i?.[s])?.bind)?.call(n,i))!=`function`)throw Error(`invalid 【${s}】 request method`);u.label=1;case 1:return u.trys.push([1,3,,4]),(r=t.headers)!=null&&r[`content-type`]&&!((a=t.headers)!=null&&a[`content-type`].includes(`application/json`))||[`string`,`undefined`].includes(typeof t.body)||(t.data=t.data||t.body,t.body=JSON.stringify(t.body)),[4,c(ut({url:e},t))];case 2:return o=u.sent(),o=ht(o,ut(ut({},t),{url:e})),[3,4];case 3:throw l=u.sent(),o=ut(ut({},l?.data),l);case 4:if(o?.error)throw o;return[2,o]}})})}}}catch(e){console.error(`user adapter generate fail:`,e)}return n}(e,e.adapter):function(e,t){var n=ut({},e),r={};if(t!=null&&t.captchaOptions&&(n.captchaOptions=t.captchaOptions),!ct.default.isMatch()||e.storage&&e.baseRequest)return n;try{var i=ct.default.genAdapter({}),a=i.localStorage,o=i.reqClass;return a&&(r.storage=new pt({localStorage:a,adapter:t})),o&&(r.request=function(e){return function(t,n){return dt(this,void 0,void 0,function(){return ft(this,function(r){return[2,new Promise(function(r,i){var a=Object.assign({},n);a.body&&typeof a.body!=`string`&&(a.body=JSON.stringify(a.body));var o=wx.request({url:t,data:a.body,timeout:e._timeout,method:a.method||`GET`,header:a.headers,success:function(e){(e=ht(e,ut(ut({},n),{url:t}))).error&&i(e),r(e)},fail:function(e){i({error:`unreachable`,error_description:e.message})},complete:function(t){if(t&&t.errMsg&&e._timeout&&e._restrictedMethods.indexOf(`request`)!==-1&&t.errMsg===`request:fail timeout`){console.warn(e._timeoutMsg);try{o.abort()}catch{}}}})})]})})}}(new o({timeout:1e4,restrictedMethods:[`get`,`post`,`upload`,`download`,`request`]}))),n.captchaOptions&&(r.baseRequest=r.request,r.request=void 0),ut(ut({},n),r)}catch(e){console.error(`adapter generate fail:`,e)}return n}(e,e.adapter)},_t=function(){return _t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_t.apply(this,arguments)},vt=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},yt=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},bt=function(){function e(e){}return e.prototype.signInWithRedirect=function(){throw Error(`[v1 兼容] WeixinAuthProvider.signInWithRedirect() 在当前版本中无法实现。 建议使用 auth.signInWithOAuth({ provider: 'providerId' }) 替代。`)},e.prototype.getRedirectResult=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] WeixinAuthProvider.getRedirectResult() 在当前版本中无法实现。 建议使用 auth.verifyOAuth({ code, state, provider }) 替代。`)})})},e.prototype.getLinkRedirectResult=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] WeixinAuthProvider.getLinkRedirectResult() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。`)})})},e}(),xt=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(t){switch(t.label){case 0:return[4,this.authInstance.signInWithCustomTicket(function(){return Promise.resolve(e)})];case 1:return t.sent(),[2]}})})},e}(),St=function(){function e(e){this.authInstance=e.authInstance}return e.prototype.signIn=function(){return vt(this,void 0,Promise,function(){return yt(this,function(e){switch(e.label){case 0:return[4,this.authInstance.signInAnonymously({})];case 1:return e.sent(),[2]}})})},e}(),Ct=function(){function e(){}return e.prototype.weixinAuthProvider=function(e){return new bt({authInstance:this,appid:e.appid,scope:e.scope})},e.prototype.customAuthProvider=function(){return new xt({authInstance:this})},e.prototype.anonymousAuthProvider=function(){return new St({authInstance:this})},e.prototype.signUpWithEmailAndPassword=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(n){switch(n.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`email must be a string`),typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`password must be a string`),[4,this.signUp({email:e,password:t})];case 1:return[2,n.sent()]}})})},e.prototype.signInWithEmailAndPassword=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(n){switch(n.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`email must be a string`),typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`password must be a string`),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}})})},e.prototype.sendPasswordResetEmail=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(t){switch(t.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`email must be a string`),[4,this.getVerification({email:e})];case 1:return t.sent(),[2]}})})},e.prototype.signInWithUsernameAndPassword=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(n){switch(n.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`username must be a string`),typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`password must be a string`),[4,this.signIn({username:e,password:t})];case 1:return n.sent(),[2,this.createLoginState()]}})})},e.prototype.sendPhoneCode=function(e){return vt(this,void 0,Promise,function(){var t;return yt(this,function(n){switch(n.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneNumber must be a string`),t=this.formatPhone(e),[4,this.getVerification({phone_number:t})];case 1:return n.sent(),[2,!0]}})})},e.prototype.signUpWithPhoneCode=function(e,t,n){return vt(this,void 0,Promise,function(){var r;return yt(this,function(i){switch(i.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneNumber must be a string`),typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneCode must be a string`),r=this.formatPhone(e),[4,this.signUp(_t({phone_number:r,verification_code:t},n?{password:n}:{}))];case 1:return i.sent(),[2,this.createLoginState()]}})})},e.prototype.signInWithPhoneCodeOrPassword=function(e){return vt(this,void 0,Promise,function(){var t,n,r,i;return yt(this,function(a){switch(a.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneNumber must be a string`),i=this.formatPhone(t),r?[4,this.signIn({username:i,password:r})]:[3,2];case 1:return a.sent(),[3,5];case 2:return n?[4,this.signIn({username:i,verification_token:n})]:[3,4];case 3:return a.sent(),[3,5];case 4:(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneCode or password must be provided`),a.label=5;case 5:return[2,this.createLoginState()]}})})},e.prototype.forceResetPwdByPhoneCode=function(e){return vt(this,void 0,Promise,function(){var t,n,r,i;return yt(this,function(a){switch(a.label){case 0:return t=e.phoneNumber,n=e.phoneCode,r=e.password,typeof t!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneNumber must be a string`),typeof n!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`phoneCode must be a string`),typeof r!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`password must be a string`),i=this.formatPhone(t),[4,this.resetPassword({phone_number:i,new_password:r,verification_token:n})];case 1:return a.sent(),[4,this.signIn({username:i,password:r})];case 2:return a.sent(),[2,this.createLoginState()]}})})},e.prototype.shouldRefreshAccessToken=function(e){throw Error(`[v1 兼容] shouldRefreshAccessToken() 在当前版本中无法实现。 建议使用 auth.onAuthStateChange(callback) 来监听 TOKEN_REFRESHED 事件替代。`)},e.prototype.onLoginStateExpired=function(e){var t=this;this.onLoginStateChanged(function(n){n?.eventType===u&&e.call(t)})},e.prototype.onAccessTokenRefreshed=function(e){var t=this;this.onAuthStateChange(function(n){n===m&&e.call(t)})},e.prototype.onAnonymousConverted=function(e){var t=this;this.onAuthStateChange(function(n){n===f&&e.call(t)})},e.prototype.onLoginTypeChanged=function(e){var t=this;this.onAuthStateChange(function(n){n!==f&&n!==d||e.call(t)})},e}(),wt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),B=function(){return B=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},B.apply(this,arguments)},Tt=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},V=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},H=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},U=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Et=function(){return typeof window<`u`&&typeof document<`u`},Dt=function(e){return function(t){e.fire(_,B(B({},t),{eventType:u}))}},Ot=[`avatar_url`,`avatarUrl`];function kt(e){return typeof TextEncoder<`u`?new TextEncoder().encode(e).length:e.length}function At(e,t){if(e)for(var n=0,r=Ot;n<r.length;n++){var i=r[n],o=e[i];if(o!=null&&o!==``){var s=kt(String(o));if(s>204800)throw new I({error:`invalid_argument`,error_code:a.INVALID_ARGUMENT,error_description:`auth.${t}(params): "${i}" 超过 200KB 限制(当前 ${s} 字节),请传入图片 URL 而非文件内容`},{method:t})}}}var jt,Mt=function(){function t(e){var t=e.cache,n=e.oauthInstance;this.cache=t,this.oauthInstance=n,this.setUserInfo()}var n,r,i;return t.prototype.checkLocalInfo=function(){return H(this,void 0,void 0,function(){return U(this,function(e){return this.uid=this.getLocalUserInfo(`uid`),this.gender=this.getLocalUserInfo(`gender`),this.picture=this.getLocalUserInfo(`picture`),this.email=this.getLocalUserInfo(`email`),this.emailVerified=this.getLocalUserInfo(`email_verified`),this.phoneNumber=this.getLocalUserInfo(`phone_number`),this.username=this.getLocalUserInfo(`username`),this.name=this.getLocalUserInfo(`name`),this.birthdate=this.getLocalUserInfo(`birthdate`),this.zoneinfo=this.getLocalUserInfo(`zoneinfo`),this.locale=this.getLocalUserInfo(`locale`),this.sub=this.getLocalUserInfo(`sub`),this.createdFrom=this.getLocalUserInfo(`created_from`),this.providers=this.getLocalUserInfo(`providers`),[2]})})},t.prototype.checkLocalInfoAsync=function(){return H(this,void 0,void 0,function(){var e,t,n,r;return U(this,function(i){switch(i.label){case 0:return e=this,[4,this.getLocalUserInfoAsync(`uid`)];case 1:return e.uid=i.sent(),t=this,[4,this.getLocalUserInfoAsync(`gender`)];case 2:return t.gender=i.sent(),this.picture=this.getLocalUserInfo(`picture`),n=this,[4,this.getLocalUserInfoAsync(`email`)];case 3:return n.email=i.sent(),this.emailVerified=this.getLocalUserInfo(`email_verified`),this.phoneNumber=this.getLocalUserInfo(`phone_number`),r=this,[4,this.getLocalUserInfoAsync(`username`)];case 4:return r.username=i.sent(),this.name=this.getLocalUserInfo(`name`),this.birthdate=this.getLocalUserInfo(`birthdate`),this.zoneinfo=this.getLocalUserInfo(`zoneinfo`),this.locale=this.getLocalUserInfo(`locale`),this.sub=this.getLocalUserInfo(`sub`),this.createdFrom=this.getLocalUserInfo(`created_from`),this.providers=this.getLocalUserInfo(`providers`),[2]}})})},t.prototype.update=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return At(e,`update`),[4,this.oauthInstance.authApi.setUserProfile(B({},e))];case 1:return t=n.sent(),this.setLocalUserInfo(t),[2]}})})},t.prototype.updateUserBasicInfo=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return At(e,`updateUserBasicInfo`),[4,this.oauthInstance.authApi.updateUserBasicInfo(B({},e))];case 1:return t.sent(),[4,this.refresh()];case 2:return t.sent(),[2]}})})},t.prototype.updatePassword=function(e,t){return this.oauthInstance.authApi.updatePasswordByOld({old_password:t,new_password:e})},t.prototype.updateUsername=function(e){return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`username must be a string`),this.update({username:e})},t.prototype.refresh=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return[4,this.oauthInstance.authApi.getUserInfo(e)];case 1:if((t=n.sent()).code===`INVALID_ACCESS_TOKEN`)throw this.setLocalUserInfo({}),t;return this.setLocalUserInfo(t),[2,t]}})})},t.prototype.getLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);return e?n[e]:n||{}},t.prototype.setLocalUserInfo=function(e){var t=this.cache.keys.userInfoKey;this.cache.setStore(t,e),this.setUserInfo()},t.prototype.getLocalUserInfoAsync=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return t=this.cache.keys.userInfoKey,[4,this.cache.getStoreAsync(t)];case 1:return[2,n.sent()[e]]}})})},t.prototype.setUserInfo=function(){var e=this,t=this.cache.keys.userInfoKey,n=this.cache.getStore(t);[`uid`,`email`,`name`,`gender`,`picture`,`email_verified`,`phone_number`,`birthdate`,`zoneinfo`,`locale`,`sub`,`created_from`,`providers`,`username`,`created_at`,`open_id`].forEach(function(t){e[t]=n[t]})},Tt([(0,ot.catchErrorsDecorator)({title:`更新用户信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 User.update() 的语法或参数是否正确`,` 2 - 用户信息中是否包含非法值`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(n=e.UserProfile)==`function`?n:Object]),V(`design:returntype`,typeof(r=typeof Promise<`u`&&Promise)==`function`?r:Object)],t.prototype,`update`,null),Tt([(0,ot.catchErrorsDecorator)({title:`更新密码失败`,messages:[`请确认以下各项:`,` 1 - 调用 User.updatePassword() 的语法或参数是否正确`,` 3 - 新密码中是否包含非法字符`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[String,String]),V(`design:returntype`,void 0)],t.prototype,`updatePassword`,null),Tt([(0,ot.catchErrorsDecorator)({title:`更新用户名失败`,messages:[`请确认以下各项:`,` 1 - 调用 User.updateUsername() 的语法或参数是否正确`,` 2 - 当前环境是否开通了用户名密码登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[String]),V(`design:returntype`,void 0)],t.prototype,`updateUsername`,null),Tt([(0,ot.catchErrorsDecorator)({title:`刷新本地用户信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 User.refresh() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(i=typeof Promise<`u`&&Promise)==`function`?i:Object)],t.prototype,`refresh`,null),t}();(jt=Mt).prototype.linkWithTicket=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] User.linkWithTicket() 在当前版本中无法实现。 建议使用 auth.signInWithCustomTicket(() => Promise.resolve(ticket)) 替代。`)})})},jt.prototype.linkWithRedirect=function(e){throw Error(`[v1 兼容] User.linkWithRedirect() 在当前版本中无法实现。 建议使用 auth.linkIdentity({ provider: 'providerId' }) 替代。`)},jt.prototype.updateEmail=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(t){switch(t.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`newEmail must be a string`),[4,this.updateUserBasicInfo({email:e})];case 1:return t.sent(),[2]}})})},jt.prototype.linkWithPhoneNumber=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] User.linkWithPhoneNumber() 在当前版本中无法实现。 建议使用 auth.bindPhoneNumber({ phone_number, verification_token, sudo_token }) 替代。`)})})},jt.prototype.updatePhoneNumber=function(e,t){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] User.updatePhoneNumber() 在当前版本中无法实现。 建议使用 auth.updateUser({ phone: newPhoneNumber }) 替代。`)})})},jt.prototype.unlink=function(e){return vt(this,void 0,Promise,function(){return yt(this,function(e){throw Error(`[v1 兼容] User.unlink() 在当前版本中无法实现。 建议使用 auth.unlinkIdentity({ provider: loginType }) 替代。`)})})};var Nt=function(){function e(e){var t=e.envId,n=e.cache,r=e.oauthInstance;t||(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`envId is not defined`),this.cache=n,this.oauthInstance=r,this.user=new Mt({cache:this.cache,oauthInstance:r})}return e.prototype.checkLocalState=function(){this.oauthLoginState=this.oauthInstance?.authApi.hasLoginStateSync(),this.user.checkLocalInfo()},e.prototype.checkLocalStateAsync=function(){return H(this,void 0,void 0,function(){return U(this,function(e){switch(e.label){case 0:return[4,this.oauthInstance?.authApi.getLoginState()];case 1:return e.sent(),[4,this.user.checkLocalInfoAsync()];case 2:return e.sent(),[2]}})})},e}(),Pt=function(t){function n(e){var n=t.call(this)||this;return n.listeners=new Map,n.hasListenerSetUp=!1,n.config=e,n.oauthInstance=e.oauthInstance,n.cache=e.cache,n.init(),n.setAccessKey(),n}var r,i,a,o,s,l,d,m,g,b,C,w,T,E,D,ee,te,O,A,ne,re;return wt(n,t),n.prototype.signInAnonymously=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a;return U(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,this.oauthInstance.authApi.signInAnonymously(e)];case 1:return o.sent(),[4,this.createLoginState()];case 2:return t=o.sent(),[4,this.getSession()];case 3:return n=o.sent().data,r=(n===void 0?{}:n).session,[2,B(B({},t),{data:{user:r.user,session:r},error:null})];case 4:return i=o.sent(),(a=new I(i,{method:`signInAnonymously`})).category===F.PROVIDER_NOT_ENABLED?(console.error(a.helpMessage),console.error(`[CloudBase Auth] 提示:匿名登录需要在控制台开启「匿名登录」。
170
170
  如果您需要使用用户名密码登录,请改用 auth.signInWithPassword({ username, password })。
171
- 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。`)):(console.warn(`[CloudBase Auth] signInAnonymously 失败 [${a.category}]: ${a.message}`),a.loginMethodHint&&console.warn(a.loginMethodHint)),[2,{data:{user:null,session:null},error:a}];case 5:return[2]}})})},n.prototype.signUp=function(e){return H(this,void 0,Promise,function(){var t,n,r=this;return U(this,function(i){switch(i.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&=this.formatPhone(e.phone_number),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return i.sent(),[2,this.createLoginState()];case 2:return i.trys.push([2,4,,5]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`signUp`),[4,this.getVerification(e.email?{email:e.email,usage:c.EMAIL}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=i.sent(),[2,{data:{verifyOtp:function(n){var i=n.token,a=n.messageId,o=a===void 0?t.verification_id:a;return H(r,void 0,Promise,function(){var n,r,a,s,c;return U(this,function(l){switch(l.label){case 0:return l.trys.push([0,8,,9]),[4,this.verify({verification_id:o||t.verification_id,verification_code:String(i)})];case 1:return n=l.sent(),t.is_user?[4,this.signIn({username:e.email||this.formatPhone(e.phone),verification_token:n.verification_token})]:[3,3];case 2:return l.sent(),[3,6];case 3:return delete(r=JSON.parse(JSON.stringify(e))).email,delete r.phone,[4,this.oauthInstance.authApi.signUp(B(B(B({},r),e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{verification_token:n.verification_token,verification_code:i}))];case 4:return l.sent(),[4,this.createLoginState()];case 5:l.sent(),l.label=6;case 6:return[4,this.getSession()];case 7:return a=l.sent().data,[2,{data:{user:(s=(a===void 0?{}:a).session).user,session:s},error:null}];case 8:return c=l.sent(),[2,{data:{user:null,session:null},error:new I(c,{method:`signUp`})}];case 9:return[2]}})})}},error:null}];case 4:return n=i.sent(),[2,{data:{user:null,session:null},error:new I(n,{method:`signUp`})}];case 5:return[2]}})})},n.prototype.signOut=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return n=i.sent(),[4,this.cache.removeStoreAsync(t)];case 2:return i.sent(),this.setAccessKey(),[2,B(B({},n),{data:{},error:null})];case 3:return r=i.sent(),[2,{data:{},error:new I(r,{method:`signOut`})}];case 4:return[2]}})})},n.prototype.onAuthStateChange=function(e){var t=this;this.hasListenerSetUp||=(this.setupListeners(),!0);var n=Math.random().toString(36);return this.listeners.has(n)||this.listeners.set(n,new Set),this.listeners.get(n).add(e),{data:{subscription:{id:n,callback:e,unsubscribe:function(){var r=t.listeners.get(n);r&&(r.delete(e),r.size===0&&t.listeners.delete(n))}}}}},n.prototype.signInWithPassword=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c;return U(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),this.validateAtLeastOne(e,[[`username`],[`email`],[`phone`]],`signInWithPassword`),this.validateParams(e,{password:{required:!0,message:`Password is required`}},`signInWithPassword`),t=`username`in e?e.username:void 0,n=`email`in e?e.email:void 0,r=`phone`in e?e.phone:void 0,i=e.options?.is_encrypt??e.is_encrypt,[4,this.signIn(B({username:t||n||this.formatPhone(r),password:e.password},i?{isEncrypt:!0,version:`v2`}:{}))];case 1:return l.sent(),[4,this.getSession()];case 2:return a=l.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 3:return s=l.sent(),(c=new I(s,{method:`signInWithPassword`})).category===F.PROVIDER_NOT_ENABLED?console.error(c.helpMessage):c.category===F.INVALID_CREDENTIALS||c.category===F.USER_NOT_FOUND?console.warn(c.helpMessage):console.warn(`[CloudBase Auth] signInWithPassword 失败 [${c.category}]: ${c.message}`),c.loginMethodHint&&console.info(c.loginMethodHint),[2,{data:{user:null,session:null},error:c}];case 4:return[2]}})})},n.prototype.signInWithIdToken=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:`Token is required`}},`signInWithIdToken`),[4,this.signInWithProvider({provider_id:e.provider,provider_id_token:e.token})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`signInWithIdToken`})}];case 4:return[2]}})})},n.prototype.signInWithOtp=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o=this;return U(this,function(s){switch(s.label){case 0:if(t=e.options,n=`email`in e?e.email:void 0,r=`phone`in e?e.phone:void 0,!t?.emailRedirectTo&&(t?.shouldCreateUser===void 0||t?.shouldCreateUser))return[2,this.signUp(n?{email:n}:{phone:r})];s.label=1;case 1:return s.trys.push([1,3,,4]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`signInWithOtp`),[4,this.getVerification(B(B({email_redirect_to:t?.emailRedirectTo},n?{email:n,usage:c.EMAIL}:{phone_number:this.formatPhone(r)}),{target:t?.emailRedirectTo&&t?.shouldCreateUser?`ANY`:`USER`}))];case 2:return i=s.sent(),[2,{data:{user:null,session:null,verifyOtp:function(e){var t=e.token,a=e.messageId,s=a===void 0?i.verification_id:a;return H(o,void 0,Promise,function(){return U(this,function(e){return[2,this.verifyOtp(n?{email:n,token:String(t),messageId:s||``}:{phone:r,token:String(t),messageId:s||``})]})})}},error:null}];case 3:return a=s.sent(),[2,{data:{user:null,session:null},error:new I(a,{method:`signInWithOtp`})}];case 4:return[2]}})})},n.prototype.verifyOAuth=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l;return U(this,function(u){switch(u.label){case 0:t={},u.label=1;case 1:return u.trys.push([1,7,,8]),n=e?.code||ue(`code`),r=e?.state||ue(`state`),n?r?(i=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error(`Failed to get browser session:`,e),null}}(r),t.type=i?.type,(a=e?.provider||i?.provider||ue(`provider`))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:B(B({},t),{user:null,session:null,redirectUrl:null}),error:this.missingRequiredParam(`verifyOAuth`,`provider`)}]):[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam(`verifyOAuth`,`state`)}]:[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam(`verifyOAuth`,`code`)}];case 2:return o=u.sent().provider_token,s=void 0,i.type===x?[4,this.oauthInstance.authApi.toBindIdentity({provider_token:o,provider:a,fireEvent:!0})]:[3,4];case 3:return s=u.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:o})];case 5:(s=u.sent()).data=B(B({},t),s.data),u.label=6;case 6:return(c=new URLSearchParams(location==null?void 0:location.search)).delete(`code`),c.delete(`state`),s.data.redirectUrl=function(e,t){if(e!==void 0){var n=new URL(window.location.href);return n.search=e,n.hash=t||n.hash,window.history.replaceState({},``,n.href),n.href}}(i?.search===void 0?`?${c.toString()}`:i?.search,i?.hash||location.hash),function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error(`Failed to remove browser session:`,e),null}}(r),[2,s];case 7:return l=u.sent(),[2,{data:B(B({},t),{user:null,session:null,redirectUrl:null}),error:new I(l,{method:`verifyOAuth`})}];case 8:return[2]}})})},n.prototype.signInWithOAuth=function(e){var t,n;return H(this,void 0,Promise,function(){var r,i,a,o,s,c,l,u,d;return U(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`signInWithOAuth`),r=e.options?.redirectTo||location.href,i=new URL(r),a=i.origin+i.pathname,o=e.options?.state||`prd-${e.provider}-${Math.random().toString(36).slice(2)}`,[4,this.genProviderRedirectUri({provider_id:e.provider,provider_redirect_uri:a,state:o})];case 1:return s=f.sent().uri,c=decodeURIComponent(s),l=c,(t=e.options)!=null&&t.queryParams&&(u=new URL(c),Object.entries(e.options.queryParams).forEach(function(e){var t=e[0],n=e[1];u.searchParams.set(t,n)}),l=u.toString()),function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(`Failed to save to browser session:`,e)}}(o,{provider:e.provider,search:i.search,hash:i.hash,type:e.options?.type||y}),Et()&&!((n=e.options)!=null&&n.skipBrowserRedirect)&&window.location.assign(l),[2,{data:{url:l,provider:e.provider},error:null}];case 2:return d=f.sent(),[2,{data:{url:null,provider:null},error:new I(d,{method:`signInWithOAuth`})}];case 3:return[2]}})})},n.prototype.getClaims=function(){return H(this,void 0,Promise,function(){var e;return U(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return[2,{data:function(e){if(typeof e!=`string`)throw Error(`Invalid token specified`);try{var t=e.split(`.`).map(function(e,t){return t===2?e:JSON.parse(function(e){var t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`Illegal base64url string!`)}try{return function(e){return decodeURIComponent(k(e).replace(/(.)/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t=`0${t}`),`%${t}`}))}(t)}catch{return k(t)}}(e))});return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw Error(`Invalid token specified: ${e}`?e.message:0)}}(t.sent().accessToken),error:null}];case 2:return e=t.sent(),[2,{data:{claims:null,header:null,signature:null},error:new I(e,{method:`getClaims`})}];case 3:return[2]}})})},n.prototype.resetPasswordForEmail=function(e,t){return H(this,void 0,Promise,function(){var n,r,i,a,o,s,l=this;return U(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:`Email or phone is required`}},`resetPasswordForEmail`),n=(t||{}).redirectTo,r=e.includes(`@`),i=void 0,r?i={email:e,usage:c.RECOVERY}:(a=this.formatPhone(e),i={phone_number:a}),[4,this.getVerification(B(B({},i),{target:`USER`}))];case 1:return o=u.sent(),[2,{data:{updateUser:function(t){return H(l,void 0,Promise,function(){var i,a,s,c;return U(this,function(l){switch(l.label){case 0:this.validateParams(t,{nonce:{required:!0,message:`Nonce is required`},password:{required:!0,message:`Password is required`}},`resetPasswordForEmail`),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,this.verify({verification_id:o.verification_id,verification_code:t.nonce})];case 2:return i=l.sent(),[4,this.oauthInstance.authApi.resetPassword({email:r?e:void 0,phone_number:r?void 0:e,new_password:t.password,verification_token:i.verification_token})];case 3:return l.sent(),(c=this.config.eventBus)==null||c.fire(v,{event:`PASSWORD_RECOVERY`}),[4,this.signInWithPassword({email:r?e:void 0,phone:r?void 0:e,password:t.password})];case 4:return a=l.sent(),n&&Et()&&window.location.assign(n),[2,a];case 5:return s=l.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`resetPasswordForEmail`})}];case 6:return[2]}})})}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new I(s,{method:`resetPasswordForEmail`})}];case 3:return[2]}})})},n.prototype.resetPasswordForOld=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.authApi.updatePasswordByOld({old_password:e.old_password,new_password:e.new_password})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`resetPasswordForOld`})}];case 4:return[2]}})})},n.prototype.verifyOtp=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s;return U(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),t=e.type,n=String(e.token),r=`email`in e?e.email:void 0,i=`phone`in e?e.phone:void 0,this.validateParams(e,{token:{required:!0,message:`Token is required`},messageId:{required:!0,message:`messageId is required`}},`verifyOtp`),[`phone_change`,`email_change`].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return c.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:r||this.formatPhone(i)||``,loginType:r?`email`:`phone`})];case 3:c.sent(),c.label=4;case 4:return[4,this.getSession()];case 5:return a=c.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 6:return s=c.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`verifyOtp`})}];case 7:return[2]}})})},n.prototype.getSession=function(){return H(this,void 0,Promise,function(){var e,t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(e=i.sent())&&e.scope!==`accessKey`?[4,this.getUser(!1)]:[2,{data:{session:null,user:null},error:null}];case 2:return t=i.sent().data,n=(t===void 0?{}:t).user,[2,{data:{session:B(B({},e),{user:n}),user:n},error:null}];case 3:return r=i.sent(),[2,{data:{session:null,user:null},error:new I(r,{method:`getSession`})}];case 4:return[2]}})})},n.prototype.refreshSession=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a;return U(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=o.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=o.sent(),[4,this.getUser(!1)];case 3:return r=o.sent().data,[2,{data:{user:i=(r===void 0?{}:r).user,session:B(B({},n),{user:i})},error:null}];case 4:return a=o.sent(),[2,{data:{user:null,session:null},error:new I(a,{method:`refreshSession`})}];case 5:return[2]}})})},n.prototype.getUser=function(e){return e===void 0&&(e=!0),H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(t=i.sent())&&t.scope!==`accessKey`?(n=this.convertToUser,[4,this.getCurrentUser(e)]):[2,{data:{user:null},error:null}];case 2:return[2,{data:{user:n.apply(this,[i.sent()])},error:null}];case 3:return r=i.sent(),[2,{data:{user:null},error:new I(r,{method:`getUser`})}];case 4:return[2]}})})},n.prototype.refreshUser=function(){return H(this,void 0,Promise,function(){var e,t,n;return U(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.currentUser.refresh()];case 1:return r.sent(),[4,this.getSession()];case 2:return e=r.sent().data,[2,{data:{user:(t=(e===void 0?{}:e).session).user,session:t},error:null}];case 3:return n=r.sent(),[2,{data:{user:null,session:null},error:new I(n,{method:`refreshUser`})}];case 4:return[2]}})})},n.prototype.updateUser=function(e){var t;return H(this,void 0,Promise,function(){var n,r,i,a,o,s,l,u,d,f,p,m,g,_=this;return U(this,function(y){switch(y.label){case 0:if(y.trys.push([0,8,,9]),At(e,`updateUser`),n=[`password`,`new_password`].find(function(t){var n=e[t];return n!=null&&n!==``}))throw new I({message:`updateUser 不支持更新密码,检测到传入了 "${n}" 参数。如需修改密码请使用 resetPasswordForOld(旧密码修改)、resetPasswordForEmail(验证码重置)或 reauthenticate(重新认证后改密)`});if(!Object.keys(e).some(function(t){return e[t]!==void 0&&e[t]!==null&&e[t]!==``}))throw this.missingRequiredParam(`updateUser`,`(at least one field)`);return r=e.email,i=e.phone,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,[`email`,`phone`]),s=i!==void 0,l={},(o=r!==void 0)||s?(u=void 0,o?(u={email:e.email,usage:c.REAUTHENTICATION},d=`email_change`):(f=this.formatPhone(e.phone),u={phone_number:f},d=`phone_change`),[4,this.getVerification(B({},u))]):[3,4];case 1:return p=y.sent(),Object.keys(a).length>0?[4,this.updateUserBasicInfo(a)]:[3,3];case 2:y.sent(),y.label=3;case 3:return l={messageId:p.verification_id,verifyOtp:function(t){return H(_,void 0,Promise,function(){var n,r,i,a;return U(this,function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:`email_change`,email:e.email,token:t.token,messageId:p.verification_id||``})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:`phone_change`,phone:e.phone,token:t.token,messageId:p.verification_id||``})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp(o?{type:d,email:e.email,token:t.token,messageId:p.verification_id||``}:{type:d,phone:e.phone,token:t.token,messageId:p.verification_id||``})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,(a=this.config.eventBus)==null||a.fire(v,{event:h}),[2,{data:{user:r},error:null}];case 11:return i=s.sent(),[2,{data:{user:null},error:new I(i,{method:`updateUser`})}];case 12:return[2]}})})}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:y.sent(),y.label=6;case 6:return[4,this.getUser(!1)];case 7:return m=y.sent().data.user,Object.keys(a).length>0&&((t=this.config.eventBus)==null||t.fire(v,{event:h})),[2,{data:B({user:m},l),error:null}];case 8:return g=y.sent(),[2,{data:{user:null},error:new I(g,{method:`updateUser`})}];case 9:return[2]}})})},n.prototype.getUserIdentities=function(){return H(this,void 0,Promise,function(){var e,t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.oauthInstance.authApi.getProviders()];case 1:return e=n.sent(),[2,{data:{identities:(e?.data)?.filter(function(e){return!!e.bind})},error:null}];case 2:return t=n.sent(),[2,{data:{identities:null},error:new I(t,{method:`getUserIdentities`})}];case 3:return[2]}})})},n.prototype.linkIdentity=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`linkIdentity`),[4,this.signInWithOAuth({provider:e.provider,options:{type:x}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new I(t,{method:`linkIdentity`})}];case 3:return[2]}})})},n.prototype.unlinkIdentity=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`unlinkIdentity`),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new I(t,{method:`unlinkIdentity`})}];case 3:return[2]}})})},n.prototype.reauthenticate=function(){return H(this,void 0,Promise,function(){var e,t,n,r,i=this;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=a.sent().data.user,this.validateAtLeastOne(e,[[`email`,`phone`]],`reauthenticate`),t=e.email?{email:e.email,usage:c.REAUTHENTICATION}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=a.sent(),[2,{data:{updateUser:function(e){return H(i,void 0,Promise,function(){var r,i,a,o,s;return U(this,function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:`Nonce is required`}},`reauthenticate`),c.label=1;case 1:return c.trys.push([1,9,,10]),e.password?[4,this.verify({verification_id:n.verification_id,verification_code:e.nonce})]:[3,5];case 2:return r=c.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return i=c.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:i.sudo_token})];case 4:return c.sent(),[3,7];case 5:return[4,this.signInWithUsername(B(B({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?`email`:`phone`}))];case 6:c.sent(),c.label=7;case 7:return[4,this.getSession()];case 8:return a=c.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 9:return s=c.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`reauthenticate`})}];case 10:return[2]}})})}},error:null}];case 3:return r=a.sent(),[2,{data:{updateUser:null},error:new I(r,{method:`reauthenticate`})}];case 4:return[2]}})})},n.prototype.resend=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`resend`),t=e.type===`signup`?`ANY`:`USER`,n={target:t},`email`in e&&(n.email=e.email,n.usage=c.EMAIL),`phone`in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:i.sent().verification_id},error:null}];case 2:return r=i.sent(),[2,{data:{messageId:null},error:new I(r,{method:`resend`})}];case 3:return[2]}})})},n.prototype.setSession=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:`Access token is required`},refresh_token:{required:!0,message:`Refresh token is required`}},`setSession`),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`setSession`})}];case 4:return[2]}})})},n.prototype.exchangeCodeForSession=function(){return H(this,void 0,void 0,function(){return U(this,function(e){return[2]})})},n.prototype.deleteUser=function(e){return H(this,void 0,Promise,function(){var t,n;return U(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:`Password is required`}},`deleteUser`),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new I(n,{method:`deleteUser`})}];case 4:return[2]}})})},n.prototype.toDefaultLoginPage=function(e){return e===void 0&&(e={}),H(this,void 0,Promise,function(){var t,n,r,i,a;return U(this,function(o){try{return t=e.config_version||`env`,n=Object.keys(e.query||{}).map(function(t){return`${t}=${e.query[t]}`}).join(`&`),ct.default.isMatch()?wx.navigateTo({url:`/packages/$wd_system/pages/login/index${n?`?${n}`:``}`}):(r=e.redirect_uri||window.location.href,i=new URL(r),a=`${i.origin}/__auth/?app_id=${e.app_id||``}&env_id=${this.config.env}&client_id=${this.config.clientId||this.config.env}&config_version=${t}&redirect_uri=${encodeURIComponent(r)}${n?`&${n}`:``}`,window.location.href=a),[2,{data:{},error:null}]}catch(e){return[2,{data:{},error:new I(e,{method:`toDefaultLoginPage`})}]}})})},n.prototype.signInWithCustomTicket=function(e){return H(this,void 0,Promise,function(){var t,n,r,i;return U(this,function(a){switch(a.label){case 0:e&&this.setCustomSignFunc(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return a.sent(),[4,this.createLoginState()];case 3:return t=a.sent(),[4,this.getSession()];case 4:return n=a.sent().data,r=(n===void 0?{}:n).session,[2,B(B({},t),{data:{user:r.user,session:r},error:null})];case 5:return i=a.sent(),[2,{data:{user:null,session:null},error:new I(i,{method:`signInWithCustomTicket`})}];case 6:return[2]}})})},n.prototype.signInWithOpenId=function(e){var t=(e===void 0?{}:e).useWxCloud,n=t===void 0||t;return H(this,void 0,Promise,function(){var e,t,r,i,a,o,s=this;return U(this,function(c){switch(c.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);e=wx.getAccountInfoSync().miniProgram,t=function(t){return H(s,void 0,void 0,function(){var r,i;return U(this,function(a){switch(a.label){case 0:r=void 0,i=void 0,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:t,provider_params:{provider_code_type:`open_id`,appid:e?.appId}},n)];case 2:if((r=a.sent())?.error_code||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:r.provider_token},n)];case 3:if((i=a.sent())?.error_code)throw i;return[3,5];case 4:throw a.sent();case 5:return[4,this.oauthInstance.oauth2client.setCredentials(i)];case 6:return a.sent(),[2]}})})},c.label=1;case 1:return c.trys.push([1,5,,6]),[4,new Promise(function(e,n){wx.login({success:function(r){return H(s,void 0,void 0,function(){var i;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t(r.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return i=a.sent(),n(i),[3,3];case 3:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,n(t)}})})];case 2:return c.sent(),[4,this.createLoginState()];case 3:return r=c.sent(),[4,this.getSession()];case 4:return i=c.sent().data,a=(i===void 0?{}:i).session,[2,B(B({},r),{data:{user:a.user,session:a},error:null})];case 5:return o=c.sent(),[2,{data:{user:null,session:null},error:new I(o,{method:`signInWithOpenId`})}];case 6:return[2]}})})},n.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=t===void 0?``:t,r=e.useWxCloud,i=r!==void 0&&r;return H(this,void 0,Promise,function(){var e,t,r,a,o,s,c,l,u;return U(this,function(d){switch(d.label){case 0:return ct.default.isMatch()?(e=wx.getAccountInfoSync().miniProgram,t={provider_params:{provider_code_type:`phone`,code:n,appid:e.appId},provider_id:e.appId},[4,wx.login()]):[2,{data:{user:null,session:null},error:new I({message:`wx api undefined`})}];case 1:r=d.sent().code,t.provider_code=r,d.label=2;case 2:return d.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,i)];case 3:if((a=d.sent()).error_code)throw a;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:a.provider_token},i)];case 4:if((o=d.sent())?.error_code)throw o;return[3,6];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`signInWithPhoneAuth`})}];case 6:return[4,this.createLoginState()];case 7:return c=d.sent(),[4,this.getSession()];case 8:return l=d.sent().data,u=(l===void 0?{}:l).session,[2,B(B({},c),{data:{user:u.user,session:u},error:null})]}})})},n.prototype.bindPhoneNumber=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.editContact(e)]})})},n.prototype.unbindProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]})})},n.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},n.prototype.verify=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.verify(e)]})})},n.prototype.getVerification=function(e,t){return H(this,void 0,Promise,function(){return U(this,function(n){return e.phone_number&&=this.formatPhone(e.phone_number),[2,this.oauthInstance.authApi.getVerification(e,t)]})})},Object.defineProperty(n.prototype,"currentUser",{get:function(){if(this.cache.mode!==`async`){var e=this.hasLoginState();return e&&e.user||null}(0,Ie.printWarn)(z.ERRORS.INVALID_OPERATION,`current platform's storage is asynchronous, please use getCurrentUser instead`)},enumerable:!1,configurable:!0}),n.prototype.getCurrentUser=function(e){return e===void 0&&(e=!0),H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e?[4,this.getLoginState()]:[3,3];case 1:return(t=i.sent())?[4,t.user.refresh()]:[3,3];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:return i.sent(),[3,5];case 5:return[4,this.getLoginState()];case 6:return(n=i.sent())?(r=n.user.getLocalUserInfo(),[4,n.user.checkLocalInfoAsync()]):[3,8];case 7:return i.sent(),[2,B(B({},n.user),r)];case 8:return[2,null]}})})},n.prototype.signInAnonymouslyInWx=function(e){var t=(e===void 0?{}:e).useWxCloud;return H(this,void 0,Promise,function(){var e,n,r=this;return U(this,function(i){switch(i.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);return e=wx.getAccountInfoSync().miniProgram,n=function(n){return H(r,void 0,void 0,function(){var r,i;return U(this,function(a){switch(a.label){case 0:r=void 0,i=void 0,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:n,provider_params:{provider_code_type:`open_id`,appid:e?.appId}},t)];case 2:if((r=a.sent())?.error_code||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInAnonymously({provider_token:r.provider_token},t)];case 3:if((i=a.sent())?.error_code)throw i;return[3,5];case 4:throw a.sent();case 5:return[2]}})})},[4,new Promise(function(e,t){wx.login({success:function(i){return H(r,void 0,void 0,function(){var r;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,n(i.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return r=a.sent(),t(r),[3,3];case 3:return[2]}})})},fail:function(e){var n=Error(e?.errMsg);n.code=e?.errno,t(n)}})})];case 1:return i.sent(),[2,this.createLoginState(void 0,{asyncRefreshUser:!0})]}})})},n.prototype.bindOpenId=function(){return H(this,void 0,Promise,function(){var e,t,n=this;return U(this,function(r){switch(r.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);return e=wx.getAccountInfoSync().miniProgram,t=function(t){return H(n,void 0,void 0,function(){var n;return U(this,function(r){switch(r.label){case 0:n=void 0,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:t,provider_params:{provider_code_type:`open_id`,appid:e?.appId}})];case 2:if((n=r.sent())?.error_code||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.bindWithProvider({provider_token:n.provider_token})];case 3:return r.sent(),[3,5];case 4:throw r.sent();case 5:return[2]}})})},[4,new Promise(function(e,r){wx.login({success:function(i){return H(n,void 0,void 0,function(){var n;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t(i.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return n=a.sent(),r(n),[3,3];case 3:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,r(t)}})})];case 1:return r.sent(),[2]}})})},n.prototype.signInWithUnionId=function(){return H(this,void 0,Promise,function(){var e=this;return U(this,function(t){switch(t.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);t.label=1;case 1:return t.trys.push([1,3,,4]),[4,new Promise(function(t,n){var r=wx.getAccountInfoSync().miniProgram;wx.login({success:function(i){return H(e,void 0,void 0,function(){var e,a,o,s,c;return U(this,function(l){switch(l.label){case 0:e=r?.appId,l.label=1;case 1:return l.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_code:i.code,provider_id:e,provider_params:{provider_code_type:`union_id`,appid:r?.appId}})];case 2:return a=l.sent(),(o=a.provider_token)?[4,this.oauthInstance.authApi.signInWithProvider({provider_id:e,provider_token:o})]:(n(a),[2]);case 3:return(s=l.sent())?.error_code?(n(s),[2]):(t(!0),[3,5]);case 4:return c=l.sent(),n(c),[3,5];case 5:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,n(t)}})})];case 2:return t.sent(),[3,4];case 3:throw t.sent();case 4:return[2,this.createLoginState()]}})})},n.prototype.signInWithSms=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.phoneNum,o=a===void 0?``:a,s=e.bindInfo,c=s===void 0?void 0:s;return H(this,void 0,Promise,function(){return U(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:i,bindInfo:c,username:o,loginType:`sms`})]}catch(e){throw e}})})},n.prototype.signInWithEmail=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.bindInfo,o=a===void 0?void 0:a,s=e.email,c=s===void 0?``:s;return H(this,void 0,Promise,function(){return U(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:i,bindInfo:o,username:c,loginType:`email`})]}catch(e){throw e}})})},n.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},n.prototype.signIn=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.setPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.setPassword(e)]})})},n.prototype.isUsernameRegistered=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`username must be a string`),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}})})},n.prototype.hasLoginState=function(){if(this.cache.mode!==`async`)return this.oauthInstance?.authApi.hasLoginStateSync()?new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,Ie.printWarn)(z.ERRORS.INVALID_OPERATION,`current platform's storage is asynchronous, please use getLoginState instead`)},n.prototype.getLoginState=function(){return H(this,void 0,Promise,function(){var e;return U(this,function(t){switch(t.label){case 0:e=null,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.oauthInstance.authApi.getLoginState()];case 2:return e=t.sent(),[3,4];case 3:return t.sent(),[2,null];case 4:return e?[2,new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}})})},n.prototype.getUserInfo=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.getCurrentUser()]})})},n.prototype.getWedaUserInfo=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]})})},n.prototype.updateUserBasicInfo=function(e){return H(this,void 0,void 0,function(){var t;return U(this,function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return(t=n.sent())?[4,t.user.updateUserBasicInfo(e)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},n.prototype.getAuthHeader=function(){return console.error(`Auth.getAuthHeader API 已废弃`),{}},n.prototype.bindWithProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]})})},n.prototype.queryUser=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]})})},n.prototype.getAccessToken=function(){return H(this,void 0,Promise,function(){return U(this,function(e){switch(e.label){case 0:return[4,this.oauthInstance.oauth2client.getAccessToken()];case 1:return[2,{accessToken:e.sent(),env:this.config.env}]}})})},n.prototype.grantProviderToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]})})},n.prototype.patchProviderToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]})})},n.prototype.signInWithProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.signInWithWechat=function(e){return e===void 0&&(e={}),H(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.grantToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}})})},n.prototype.genProviderRedirectUri=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]})})},n.prototype.resetPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]})})},n.prototype.deviceAuthorize=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]})})},n.prototype.sudo=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.sudo(e)]})})},n.prototype.deleteMe=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]})})},n.prototype.getProviders=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getProviders()]})})},n.prototype.loginScope=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.loginScope()]})})},n.prototype.loginGroups=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.loginGroups()]})})},n.prototype.onLoginStateChanged=function(e){var t;return H(this,void 0,void 0,function(){var n,r=this;return U(this,function(i){switch(i.label){case 0:return(t=this.config.eventBus)==null||t.on(_,function(t){return H(r,void 0,void 0,function(){var n,r;return U(this,function(i){switch(i.label){case 0:return t?.data?.eventType===u?[3,2]:[4,this.getLoginState()];case 1:return r=i.sent(),[3,3];case 2:r={},i.label=3;case 3:return n=r,e.call(this,B(B({},t),n)),[2]}})})}),[4,this.getLoginState()];case 1:return n=i.sent(),e.call(this,n),[2]}})})},n.prototype.refreshTokenForce=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]})})},n.prototype.getCredentials=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getCredentials()]})})},n.prototype.setCredentials=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}})})},n.prototype.getProviderSubType=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]})})},n.prototype.createCaptchaData=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]})})},n.prototype.verifyCaptchaData=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]})})},n.prototype.getMiniProgramQrCode=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]})})},n.prototype.getMiniProgramQrCodeStatus=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]})})},n.prototype.modifyPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]})})},n.prototype.modifyPasswordWithoutLogin=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]})})},n.prototype.getUserBehaviorLog=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]})})},n.prototype.signInWithUsername=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.username,o=a===void 0?``:a,s=e.bindInfo,c=s===void 0?void 0:s,l=e.loginType,u=l===void 0?``:l;return H(this,void 0,Promise,function(){var e,t,r,a,s,l,d;return U(this,function(f){switch(f.label){case 0:return f.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:i})];case 1:if((e=f.sent())?.error_code)throw e;return t=e.verification_token,r=this.formatPhone(o),a={phone_number:r},u===`email`&&(a={email:r=o}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if((s=f.sent())?.error_code)throw s;return c?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:c?.providerToken})]:[3,4];case 3:if((l=f.sent())?.error_code)throw l;f.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(B(B({},a),{verification_token:t,provider_token:c?.providerId}))];case 6:if((d=f.sent())?.error_code)throw d;f.label=7;case 7:return[2,this.createLoginState()];case 8:throw f.sent();case 9:return[2]}})})},n.prototype.createLoginState=function(e,t){return H(this,void 0,Promise,function(){var n;return U(this,function(r){switch(r.label){case 0:return[4,(n=new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return r.sent(),t?.userInfo?(n.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return t?.asyncRefreshUser?(n.user.refresh(e),[3,5]):[3,3];case 3:return[4,n.user.refresh(e)];case 4:r.sent(),r.label=5;case 5:return[2,n]}})})},n.prototype.setAccessKey=function(){var e,t;return H(this,void 0,void 0,function(){var n,r;return U(this,function(i){if(n=``,r=``,this.config.accessKey?(n=this.config.accessKey,r=`accessKey`):(e=this.config.auth)!=null&&e.secretId&&(t=this.config.auth)!=null&&t.secretKey&&(n=``,r=S),!r)return[2];try{this.oauthInstance.oauth2client.setAccessKeyCredentials({access_token:n,token_type:`Bearer`,scope:r,expires_at:new Date(+new Date+ +new Date),expires_in:+new Date+ +new Date})}catch(e){console.warn(`accessKey error: `,e)}return[2]})})},n.prototype.formatPhone=function(e){return!/\s+/.test(e)&&/^\+\d{1,3}\d+/.test(e)?e.replace(/^(\+\d{1,2})(\d+)$/,`$1 $2`):/^\+\d{1,3}\s+/.test(e)?e:`+86 ${e}`},n.prototype.notifyListeners=function(e,t,n){this.listeners.forEach(function(r){r.forEach(function(r){try{r(e,t,n)}catch(e){console.error(`Error in auth state change callback:`,e)}})})},n.prototype.setupListeners=function(){var e,t=this;(e=this.config.eventBus)==null||e.on(v,function(e){return H(t,void 0,void 0,function(){var t,n,r,i,a;return U(this,function(o){switch(o.label){case 0:return t=e?.data?.event,n=e?.data?.info,t!==f||n?[3,2]:[4,this.getUser(!0)];case 1:r=o.sent().data,(i=(r===void 0?{}:r).user)&&(n={user:i}),o.label=2;case 2:return[4,this.getSession()];case 3:return a=o.sent().data.session,this.notifyListeners(t,a,n),[2]}})})})},n.prototype.convertToUser=function(e){var t;if(!e)return null;var n=e?.email||``,r=e?.phone_number||``,i=e?.sub||e?.uid||``;return{id:i,aud:`authenticated`,role:((t=e.groups)?.map)?.call(t,function(e){return typeof e==`string`?e:e.id}),email:n||``,email_confirmed_at:(e?.email_verified,e.created_at),phone:r,phone_confirmed_at:r?e.created_at:void 0,confirmed_at:e.created_at,last_sign_in_at:e.last_sign_in_at,app_metadata:{provider:e.loginType?.toLowerCase()||`cloudbase`,providers:[e.loginType?.toLowerCase()||`cloudbase`]},user_metadata:{name:e?.name,picture:e?.picture,username:e?.username,gender:e?.gender,locale:e?.locale,uid:e.uid,nickName:e.nickName||e?.name,avatarUrl:e.avatarUrl||e.picture,location:e.location,hasPassword:e.hasPassword??e.password===`SET`,open_id:e?.open_id},identities:(e?.providers)?.map(function(t){return{id:t.id||``,identity_id:t.id||``,user_id:i,identity_data:{provider_id:t.id,provider_user_id:t.provider_user_id,name:t.name},provider:t.id||`cloudbase`,created_at:e.created_at,updated_at:e.updated_at,last_sign_in_at:e.last_sign_in_at}})||[],created_at:e.created_at,updated_at:e.updated_at,is_anonymous:e.name===`anonymous`}},n.prototype.missingRequiredParam=function(e,t){return new I({error:`missing_required_param`,error_code:4e3,error_description:`auth.${e}(params): missing required param '${t}'`},{method:e})},n.prototype.validateParams=function(e,t,n){for(var r=0,i=Object.entries(t);r<i.length;r++){var a=i[r],o=a[0];if(a[1].required&&(e?.[o]===void 0||e?.[o]===null||e?.[o]===``))throw this.missingRequiredParam(n,o)}},n.prototype.validateAtLeastOne=function(e,t,n){if(!t.some(function(t){return t.some(function(t){return e?.[t]!==void 0&&e?.[t]!==null&&e?.[t]!==``})}))throw this.missingRequiredParam(n,t.map(function(e){return e.join(`|`)}).join(`|`))},n.prototype.init=function(){var e;return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&!this.oauthInstance.oauth2client.initSessionEmitted&&((e=this.config.eventBus)==null||e.fire(v,{event:p})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}})})},Tt([(0,ot.catchErrorsDecorator)({title:`绑定手机号失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确`,` 2 - 当前环境是否开通了短信验证码登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(r=e.BindPhoneRequest)==`function`?r:Object]),V(`design:returntype`,Promise)],n.prototype,`bindPhoneNumber`,null),Tt([(0,ot.catchErrorsDecorator)({title:`解除三方绑定失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().unbindProvider() 的语法或参数是否正确`,` 2 - 当前账户是否已经与此登录方式解绑`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(i=e.UnbindProviderRequest)==`function`?i:Object]),V(`design:returntype`,typeof(a=typeof Promise<`u`&&Promise)==`function`?a:Object)],n.prototype,`unbindProvider`,null),Tt([(0,ot.catchErrorsDecorator)({title:`绑定邮箱地址失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindEmail() 的语法或参数是否正确`,` 2 - 当前环境是否开通了邮箱密码登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(o=e.BindEmailRequest)==`function`?o:Object]),V(`design:returntype`,void 0)],n.prototype,`bindEmail`,null),Tt([(0,ot.catchErrorsDecorator)({title:`验证码验证失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().verify() 的语法或参数是否正确`,` 2 - 当前环境是否开通了手机验证码/邮箱登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(s=e.VerifyRequest)==`function`?s:Object]),V(`design:returntype`,typeof(l=typeof Promise<`u`&&Promise)==`function`?l:Object)],n.prototype,`verify`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取验证码失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getVerification() 的语法或参数是否正确`,` 2 - 当前环境是否开通了手机验证码/邮箱登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(d=e.GetVerificationRequest)==`function`?d:Object,Object]),V(`design:returntype`,typeof(m=typeof Promise<`u`&&Promise)==`function`?m:Object)],n.prototype,`getVerification`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(g=typeof Promise<`u`&&Promise)==`function`?g:Object)],n.prototype,`getCurrentUser`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序匿名登录失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了匿名登录`,` 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(b=typeof Promise<`u`&&Promise)==`function`?b:Object)],n.prototype,`signInAnonymouslyInWx`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序绑定OpenID失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序openId静默登录`,` 2 - 调用 auth().bindOpenId() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(C=typeof Promise<`u`&&Promise)==`function`?C:Object)],n.prototype,`bindOpenId`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序unionId静默登录失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序unionId静默登录`,` 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(w=typeof Promise<`u`&&Promise)==`function`?w:Object)],n.prototype,`signInWithUnionId`,null),Tt([(0,ot.catchErrorsDecorator)({title:`短信验证码登陆`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序短信验证码登陆`,` 2 - 调用 auth().signInWithSms() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(T=typeof Promise<`u`&&Promise)==`function`?T:Object)],n.prototype,`signInWithSms`,null),Tt([(0,ot.catchErrorsDecorator)({title:`邮箱验证码登陆`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了邮箱登陆`,` 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(E=typeof Promise<`u`&&Promise)==`function`?E:Object)],n.prototype,`signInWithEmail`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户是否被占用失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[String]),V(`design:returntype`,typeof(D=typeof Promise<`u`&&Promise)==`function`?D:Object)],n.prototype,`isUsernameRegistered`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取本地登录态失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getLoginState() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(ee=typeof Promise<`u`&&Promise)==`function`?ee:Object)],n.prototype,`getLoginState`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户信息失败`,messages:[`请确认以下各项:`,` 1 - 是否已登录`,` 2 - 调用 auth().getUserInfo() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(te=typeof Promise<`u`&&Promise)==`function`?te:Object)],n.prototype,`getUserInfo`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取微搭插件用户信息失败`,messages:[`请确认以下各项:`,` 1 - 是否已登录`,` 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(O=typeof Promise<`u`&&Promise)==`function`?O:Object)],n.prototype,`getWedaUserInfo`,null),Tt([(0,ot.catchErrorsDecorator)({title:`绑定第三方登录方式失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确`,` 2 - 此账户是否已经绑定此第三方`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(A=e.BindWithProviderRequest)==`function`?A:Object]),V(`design:returntype`,typeof(ne=typeof Promise<`u`&&Promise)==`function`?ne:Object)],n.prototype,`bindWithProvider`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取身份源类型`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(re=typeof Promise<`u`&&Promise)==`function`?re:Object)],n.prototype,`getProviderSubType`,null),n}(Ct),Ft=`auth`;function It(e,t){for(var n=[],r=0;r<=e.length;r++)n[r]=[r];for(var i=0;i<=t.length;i++)n[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=t.length;i++){var a=e[r-1].toLowerCase()===t[i-1].toLowerCase()?0:1;n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+a)}return n[e.length][t.length]}var Lt={name:`auth`,namespace:Ft,entity:function(e){var t=function(e){var t=this;if(this.authInstance&&!e)return this.authInstance;e||={region:``,persistence:`local`,apiPath:s};var n=this.platform.adapter,r=e.persistence||n.primaryStorage;r&&r!==this.config.persistence&&this.updateConfig({persistence:r});var i=function(e,t){var n=this,r=e.region,i=r===void 0?`ap-shanghai`:r,a=e.i18n,o=e.accessKey,c=e.useWxCloud,l=t?.platform||lt.useDefaultAdapter.bind(t)(),u=l.runtime,d=l.adapter,p=t||{},m=p.env,h=p.clientId,_=p.debug,b=p.cache,S=p.app,C=p.getApiOrigin,w=(t||{}).apiOrigin;w||=`https://${m}.${i}.tcb-api.tencentcloudapi.com`;var T={env:m,clientId:h,i18n:a,accessKey:o,useWxCloud:c,eventBus:new Fe.CloudbaseEventEmitter},E=new at(gt(B(B({},T),{apiOrigin:w,getApiOrigin:C,apiPath:e?.apiPath||s,storage:e?.storage,baseRequest:e?.baseRequest,request:e?.request,anonymousSignInFunc:e?.anonymousSignInFunc,captchaOptions:e?.captchaOptions,wxCloud:e?.wxCloud,adapter:d,onCredentialsError:Dt(T.eventBus),headers:B({"X-SDK-Version":`@cloudbase/js-sdk/${e.sdkVersion}`},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:_,auth:t.app?.config?.auth}))),D=new Pt(B(B({},T),{region:i,persistence:e.persistence,debug:_,cache:b||new st.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:`user_info_${m}`},platformInfo:l}),runtime:u||`web`,_fromApp:S,oauthInstance:E,auth:t.app?.config?.auth}));return E.initializeSession(function(e,t){return H(n,void 0,void 0,function(){return U(this,function(n){return e&&(e.type===y?t?T.eventBus.fire(v,{event:f,info:B(B({},e),{error:t})}):e.user&&D.createLoginState({},{userInfo:e.user}):e.type===x&&T.eventBus.fire(v,{event:g,info:B(B({},e),{error:t})})),[2]})})}),{authInstance:D,oauthInstance:E}}(B(B({wxCloud:this.config.wxCloud,storage:this.config.storage},e),{persistence:this.config.persistence,i18n:this.config.i18n,accessKey:this.config.accessKey,useWxCloud:this.config.useWxCloud,sdkVersion:this.version,detectSessionInUrl:this.config.auth?.detectSessionInUrl}),{env:this.config.env,clientId:this.config.clientId,getApiOrigin:function(){return t.request.getBaseEndPoint(t.config.endPointMode||`CLOUD_API`)},platform:this.platform,cache:this.cache,app:this,debug:this.config.debug}),a=i.authInstance,o=i.oauthInstance;return this.oauthInstance=o,this.authInstance=a,this.authInstance},n=t.call(this,e);Object.assign(t,n),Object.setPrototypeOf(t,Object.getPrototypeOf(n));var r=typeof Proxy<`u`?new Proxy(t,{get:function(e,t,n){var r=Reflect.get(e,t,n);if(r!==void 0||typeof t!=`string`)return r;var i=function(e,t){for(var n=null,r=1/0,i=0,a=t;i<a.length;i++){var o=a[i];if(!o.startsWith(`_`)&&o!==`constructor`){var s=It(e,o);s<r&&(r=s,n=o)}}return n}(t,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.keys(e)).filter(function(t){return typeof e[t]==`function`}));return i&&console.warn(`[CloudBase Auth] auth.${t} is not a function. Did you mean: auth.${i}() ?`),r}}):t;return this[Ft]=r,r}};try{cloudbase.registerComponent(Lt)}catch{}var Rt=function(e){try{e.registerComponent(Lt)}catch(e){console.warn(e)}};try{window.registerAuth=Rt}catch{}})(),ho.W;var go={388:e=>{e.exports={}}},_o={};function vo(e){var t=_o[e];if(t!==void 0)return t.exports;var n=_o[e]={exports:{}};return go[e](n,n.exports,vo),n.exports}vo.d=(e,t)=>{for(var n in t)vo.o(t,n)&&!vo.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},vo.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var yo={};(()=>{vo.d(yo,{r:()=>ve});var e=vo(388);function t(){return`@cloudbase/js-sdk`}var n={INVALID_PARAMS:`INVALID_PARAMS`,INVALID_SYNTAX:`INVALID_SYNTAX`,INVALID_OPERATION:`INVALID_OPERATION`,OPERATION_FAIL:`OPERATION_FAIL`,NETWORK_ERROR:`NETWORK_ERROR`,UNKOWN_ERROR:`UNKOWN_ERROR`};let r=(i={AbstractSDKRequest:()=>f,AbstractStorage:()=>p},a={},vo.d(a,i),a);var i,a,o,s=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);function n(){this.constructor=e}o(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function l(e,t){console.warn(`[@cloudbase/js-sdk][${e}]:${t}`)}var u=function(e){function t(t){var n=e.call(this,t.msg||t.message||``)||this;return n.code=t.code||``,n.requestId=t.requestId||``,Object.defineProperty(n,"message",{value:t.msg||t.message||``,enumerable:!0,writable:!0,configurable:!0}),n}return s(t,e),t}(Error),d=function(e){return new u(e)};function m(e,t){return(t||d)(e)}var h,g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_.apply(this,arguments)},v=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},y=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){function t(t){var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=i||`请求超时`,n.restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}g(t,e),t.prototype.get=function(e){return this.request(_(_({},e),{method:`get`}),this.restrictedMethods.includes(`get`))},t.prototype.post=function(e){return this.request(_(_({},e),{method:`post`}),this.restrictedMethods.includes(`post`))},t.prototype.put=function(e){return this.request(_(_({},e),{method:`put`}))},t.prototype.upload=function(e){var t=e,n=t.data,r=t.file,i=t.fileContent,a=t.name,o=t.method,s=t.headers,c=s===void 0?{}:s,l=r??i,u={post:`post`,put:`put`}[o?.toLowerCase()]||`put`,d=new FormData;return u===`post`?(Object.keys(n).forEach(function(e){d.append(e,n[e])}),d.append(`key`,a),d.append(`file`,l instanceof Blob?l:new Blob([l])),this.request(_(_({},e),{data:d,method:u}),this.restrictedMethods.includes(`upload`))):this.request(_(_({},e),{method:`put`,headers:c,body:l}),this.restrictedMethods.includes(`upload`))},t.prototype.download=function(e){return v(this,void 0,Promise,function(){var t,n,r,i;return y(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(_(_({},e),{headers:{},responseType:`blob`}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split(`/`).pop()||``),(i=document.createElement(`a`)).href=n,i.setAttribute(`download`,r),i.style.display=`none`,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){return v(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=this;return y(this,function(h){switch(h.label){case 0:return t=new AbortController,n=e.url,r=e.enableAbort,i=r!==void 0&&r,a=e.stream,o=a!==void 0&&a,s=e.signal,c=e.timeout,l=e.shouldThrowOnError,u=l===void 0||l,d=c??this.timeout,s&&(s.aborted&&t.abort(),s.addEventListener(`abort`,function(){return t.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),t.abort(Error(m.timeoutMsg))},d)),[4,fetch(n,_(_({},e),{signal:t.signal})).then(function(e){return v(m,void 0,void 0,function(){var t,n,r;return y(this,function(i){switch(i.label){case 0:return clearTimeout(f),u?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[i.sent()]),i.label=3;case 3:return[2,t];case 4:return[2,e]}})})}).catch(function(e){return clearTimeout(f),Promise.reject(e)})];case 1:return p=h.sent(),[2,{data:o?p.body:p.headers.get(`content-type`)?.includes(`application/json`)?p.json():p.text(),statusCode:p.status,header:p.headers,response:p}]}})})},t.prototype.request=function(e,t){var n=this;t===void 0&&(t=!1);var r=String(e.method).toLowerCase()||`get`;return new Promise(function(i){var a=e.url,o=e.headers,s=o===void 0?{}:o,c=e.data,l=e.responseType,u=e.withCredentials,d=e.body,f=e.onUploadProgress,p=function(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;return Object.keys(n).forEach(function(e){i===``?!r&&(t+=`?`):i+=`&`,i+=`${e}=${encodeURIComponent(n[e])}`}),/^http(s)?:\/\//.test(t+=i)?t:`${e}${t}`}(`https:`,a,r===`get`?c:{}),m=new XMLHttpRequest;m.open(r,p),l&&(m.responseType=l);var h,g,_,v=e.signal;v&&(v.aborted?m.abort():v.addEventListener(`abort`,function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),f&&m.upload.addEventListener(`progress`,f),m.onreadystatechange=function(){var e={};if(m.readyState===4){var t=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(`: `),r=t.shift().toLowerCase();n[r]=t.join(`: `)}),e.header=n,e.statusCode=m.status;try{e.data=l===`blob`?m.response:JSON.parse(m.responseText)}catch{e.data=l===`blob`?m.response:m.responseText}clearTimeout(h),i(e)}},t&&n.timeout&&(h=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),_=c,g=Object.prototype.toString.call(_)===`[object FormData]`?c:s[`content-type`]===`application/x-www-form-urlencoded`?function(e){e===void 0&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)}(c):d||(c?JSON.stringify(c):void 0),u&&(m.withCredentials=!0),m.send(g)})}})(r.AbstractSDKRequest),function(e){e.WEB=`web`,e.WX_MP=`wx_mp`}(h||={});var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},C=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},w=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||={},n}return x(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(r.AbstractStorage);(function(){function e(e){this.keys={};var t=e.persistence,r=e.platformInfo,i=r===void 0?{}:r,a=e.keys,o=a===void 0?{}:a;this.platformInfo=i,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case`local`:default:return t.localStorage?t.localStorage:(l(n.INVALID_PARAMS,`localStorage is not supported on current platform`),new w(t.root));case`none`:return new w(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=o)}Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||`sync`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,r){if(this.mode!==`async`){if(this.storage)try{var i={version:r||`localCachev1`,content:t};this.storage.setItem(e,JSON.stringify(i))}catch(e){throw Error(JSON.stringify({code:n.OPERATION_FAIL,msg:`[@cloudbase/js-sdk][${n.OPERATION_FAIL}]setStore failed`,info:e}))}}else l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use setStoreAsync insteed`)},e.prototype.setStoreAsync=function(e,t,n){return S(this,void 0,void 0,function(){var r;return C(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),r={version:n||`localCachev1`,content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){if(this.mode!==`async`){try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return``}catch{return``}t||=`localCachev1`;var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:``}l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use getStoreAsync insteed`)},e.prototype.getStoreAsync=function(e,t){return S(this,void 0,void 0,function(){var n;return C(this,function(r){switch(r.label){case 0:try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,``]}catch{return[2,``]}return t||=`localCachev1`,[4,this.storage.getItem(e)];case 1:return(n=r.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,``]}})})},e.prototype.removeStore=function(e){this.mode===`async`?l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use removeStoreAsync insteed`):this.storage.removeItem(e)},e.prototype.removeStoreAsync=function(e){return S(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})}})();var T=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(e,t){this.data=t||null,this.name=e},D=function(e){function t(t,n){var r=e.call(this,`error`,{error:t,data:n})||this;return r.error=t,r}return T(t,e),t}(E),ee=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(n?.[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof D)return console.error(e.error),this;var n=typeof e==`string`?new E(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var i=0,a=this.listeners[r]?function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],this.listeners[r],!0):[];i<a.length;i++)a[i].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new ee,new ee,typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.indexOf(`Firefox`),(e=>{var t={};return vo.d(t,e),t})({default:()=>b}).default;var te=function(){return te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},te.apply(this,arguments)},O=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},k=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},A=n,ne=`cloudrun`;function re(e,t){return O(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return k(this,function(_){switch(_.label){case 0:if(n=e.name,r=e.data,i=e.path,a=i===void 0?``:i,o=e.method,s=e.header,c=s===void 0?{}:s,l=this.getEndPointWithKey(`GATEWAY`),u=l.BASE_URL,d=l.PROTOCOL,f=`${d}${u}/cloudrun/${n}`,p=a.startsWith(`/`)?a:`/${a}`,m=[`GET`,`HEAD`].includes((o?.toUpperCase)?.call(o)))try{h={};try{h=JSON.parse(r)}catch{h=r||{}}p=`${p}${p.includes(`?`)?`&`:`?`}${Object.keys(h).map(function(e){return`${e}=${h[e]}`}).join(`&`)}`}catch{}return[4,this.request.fetch(te(te({method:o||`POST`,headers:Object.assign({},{"Content-Type":`application/json; charset=utf-8`},c)},m?{}:{body:r}),{url:`${f}${p}`,customReqOpts:t}))];case 1:return g=_.sent(),t?.from===`node-sdk`?[2,g]:[4,g.data];case 2:return[2,_.sent()]}})})}var ie={name:ne,entity:{callContainer:new(function(){function e(){}return e.prototype.callContainer=function(e,t){return O(this,void 0,void 0,function(){var n,r,i;return k(this,function(a){switch(a.label){case 0:if(n=e.name,r=e.data,!n)throw Error(JSON.stringify({code:A.INVALID_PARAMS,msg:`[${ne}.callContainer] invalid name`}));try{i=r?JSON.stringify(r):``}catch{throw Error(JSON.stringify({code:A.INVALID_PARAMS,msg:`[${ne}.callContainer] invalid data`}))}return[4,re.call(this,te(te({},e),{data:i}),t)];case 1:return[2,a.sent()]}})})},e}())().callContainer}};try{cloudbase.registerComponent(ie)}catch{}try{window.registerCloudrun=function(e){try{e.registerComponent(ie)}catch(e){console.warn(e)}}}catch{}var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ae.apply(this,arguments)},oe=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},se=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},ce=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},le=t,ue=n,de=function(e,t,n){if(n===void 0&&(n=null),e&&typeof e==`function`)return e(t,n);if(t)throw t;return n},fe=function(e,t){if(function(e){return!e||typeof e.throw!=`boolean`||e.throw}(e))throw m(c(c({},t),{msg:t.message}),e?.errorFactory);return c({code:t.code,message:t.message},t.requestId?{requestId:t.requestId}:{})},pe=`functions`;function me(e){return e.length<=1024?e:`${e.slice(0,1024)}…`}function he(e,t){return{code:e?.code||ue.NETWORK_ERROR,message:e?.message||e?.msg||``,requestId:t}}function ge(e,t){if(e&&typeof e==`object`&&!Array.isArray(e))return he(e,t);if(typeof e==`string`){try{var n=JSON.parse(e);if(n&&typeof n==`object`&&!Array.isArray(n))return he(n,t)}catch{}return{code:ue.NETWORK_ERROR,message:me(e),requestId:t}}return{code:ue.NETWORK_ERROR,message:me(e==null?``:String(e)),requestId:t}}var _e={name:pe,entity:{callFunction:new(function(){function t(){}var n,r,i,a;return t.invokeCloudrun=function(e,t,n){return se(this,void 0,void 0,function(){var r,i,a,o,s,c,l;return ce(this,function(u){switch(u.label){case 0:return r=t.name,i=t.path,a=i===void 0?``:i,o=t.method,s=t.header,c=s===void 0?{}:s,d=new Date().getTime(),f=(Date==null?void 0:Date.now)&&1e3*Date.now()||0,l=`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=16*Math.random();return d>0?(t=(d+t)%16|0,d=Math.floor(d/16)):(t=(f+t)%16|0,f=Math.floor(f/16)),(e===`x`?t:7&t|8).toString(16)}),[4,re.call(e,{name:r,data:n,path:a,method:o,header:ae(ae({},c),{"X-Request-Id":l})})];case 1:return[2,{result:u.sent(),requestId:l}]}var d,f})})},t.invokeGateway=function(e,t,n,r){return se(this,void 0,void 0,function(){var i,a,o,s,c;return ce(this,function(l){switch(l.label){case 0:i=e.request,a=e.config,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,i.gateWay(ae(ae({},t),{path:`functions`,shouldThrowOnError:!1}),r)];case 2:return o=l.sent(),[3,4];case 3:return s=l.sent(),function(e){if(!e)return!1;if(e instanceof SyntaxError||e.name===`SyntaxError`)return!0;var t=String(e.message||``);return/not valid JSON|Unexpected token|JSON\.parse|Failed to execute 'json'/i.test(t)}(c=s)?[2,fe(a,ge(c.message,c.requestId))]:[2,de(n,c)];case 4:return Number(o?.statusCode)>=400?[2,fe(a,ge(o?.data,o?.requestId))]:[2,de(n,null,{requestId:o?.requestId,result:o?.data})]}})})},t.invokeCloudApi=function(e,t,n,r,i){return se(this,void 0,void 0,function(){var a,o,s,c,l,u,d;return ce(this,function(f){switch(f.label){case 0:return a=t.name,o=t.data,s=t.query,c=t.parse,l=t.search,[4,e.request.send(`functions.invokeFunction`,{inQuery:s,parse:c,search:l,function_name:a,request_data:n},{endPointMode:`CLOUD_API`,defaultQuery:o?.params?.action?{action:o?.params?.action}:{}},i)];case 1:if(u=f.sent(),(d=u.data?.response_data)===void 0)return[2,de(r,null,u)];if(c)return[2,de(r,null,{result:d,requestId:u.requestId})];try{return d=JSON.parse(d),[2,de(r,null,{result:d,requestId:u.requestId})]}catch{return[2,de(r,Error(`[${le()}][${ue.INVALID_PARAMS}][${pe}.callFunction] response data must be json`))]}}})})},t.prototype.callFunction=function(e,n,r){return se(this,void 0,void 0,function(){var i,a,o,s,c,l;return ce(this,function(u){switch(u.label){case 0:if(i=e.name,a=e.data,o=e.type,s=this.config,!i)return[2,fe(s,{code:ue.INVALID_PARAMS,message:`[${pe}.callFunction] invalid function name`})];try{c=a?JSON.stringify(a):``}catch{return[2,fe(s,{code:ue.INVALID_PARAMS,message:`[${pe}.callFunction] invalid data`})]}if(o===`cloudrun`)return[2,t.invokeCloudrun(this,e,c)];u.label=1;case 1:return u.trys.push([1,5,,6]),function(e,t){return e.endPointMode===`GATEWAY`&&!function(e){return e===`lcap-common-service`||e===`lcap-datasource-test`||e.startsWith(`lcap-data`)||e.startsWith(`lowcode-datasource`)||e===`cloudbase_module`}(t)&&!function(e){return e===`lowcode-wx-datasource`}(t)}(s,i)?[4,t.invokeGateway(this,e,n,r)]:[3,3];case 2:return[2,u.sent()];case 3:return[4,t.invokeCloudApi(this,e,c,n,r)];case 4:return[2,u.sent()];case 5:return l=u.sent(),de(n,l),[3,6];case 6:return[2]}})})},function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([(a={customInfo:{className:`Cloudbase`,methodName:`callFunction`},title:`函数调用失败`,messages:[`请确认以下各项:`,` 1 - 调用 callFunction() 的语法或参数是否正确`,` 2 - 当前环境下是否存在此函数`,` 3 - 函数安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:https://support.qq.com/products/148793`]},a.mode,a.customInfo,a.title,a.messages,function(e,t,n){}),oe(`design:type`,Function),oe(`design:paramtypes`,[typeof(n=e.ICallFunctionOptions!==void 0&&e.ICallFunctionOptions)==`function`?n:Object,typeof(r=typeof Function<`u`&&Function)==`function`?r:Object,typeof(i=e.ICustomReqOpts!==void 0&&e.ICustomReqOpts)==`function`?i:Object]),oe(`design:returntype`,Promise)],t.prototype,`callFunction`,null),t}())().callFunction}};try{cloudbase.registerComponent(_e)}catch{}var ve=function(e){try{e.registerComponent(_e)}catch(e){console.warn(e)}};try{window.registerFunctions=ve}catch{}})(),yo.r;var bo={388:e=>{e.exports={}}},xo={};function So(e){var t=xo[e];if(t!==void 0)return t.exports;var n=xo[e]={exports:{}};return bo[e](n,n.exports,So),n.exports}So.d=(e,t)=>{for(var n in t)So.o(t,n)&&!So.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},So.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Co={};(()=>{So.d(Co,{v:()=>ct});var e,t=(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)},function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}),n=function(e){function n(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name=`StorageError`,n}return t(n,e),n}(Error);function r(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var i,a=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.name=`StorageApiError`,i.status=n,i.statusCode=r,i}return t(n,e),n.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},n}(n);function o(){return globalThis.Buffer}function s(e){var t=o();return t?t.from(e).toString(`base64`):btoa(e)}function c(e){return e.split(`/`).map(function(e){return encodeURIComponent(e)}).join(`/`)}t(function(e,t){var n=i.call(this,e)||this;return n.name=`StorageUnknownError`,n.originalError=t,n},i=n);var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)},u=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},d=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},m=`/v1/storages`;function h(e,t){return u(this,void 0,Promise,function(){var i;return d(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e()];case 1:return[2,{data:a.sent(),error:null}];case 2:if(i=a.sent(),t)throw i;return r(i)?[2,{data:null,error:i}]:[2,{data:null,error:new n(i?.message||String(i))}];case 3:return[2]}})})}var g=function(){function e(e){this.ctx=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),e.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint(`GATEWAY`)},e.prototype.buildUrl=function(e,t){var n=`${this.gatewayOrigin()}${m}${e}`,r=function(e){if(!e)return``;var t=[];return Object.keys(e).forEach(function(n){var r=e[n];r!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}),t.join(`&`)}(t);return r&&(n+=(n.includes(`?`)?`&`:`?`)+r),n},e.prototype.toFullUrl=function(e){return e&&(/^https?:\/\//.test(e)||e.startsWith(`//`)?e:`${this.gatewayOrigin()}${m}${e.startsWith(`/`)?``:`/`}${e}`)},e.prototype.send=function(e){return u(this,void 0,Promise,function(){var t,n,r,i,a,o;return d(this,function(s){switch(s.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),r=[`GET`,`HEAD`].includes(n),i=l({},e.headers||{}),r||(e.rawBody===void 0?e.json!==void 0&&(i[`Content-Type`]=i[`Content-Type`]||`application/json`,a=JSON.stringify(e.json)):a=e.rawBody),[4,this.request.fetch(l(l(l(l({url:t,method:n,headers:i},a===void 0?{}:{body:a}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return o=s.sent(),[2,this.unwrap(o,t)]}})})},e.prototype.download=function(e){return u(this,void 0,Promise,function(){var t,n,r,i;return d(this,function(o){switch(o.label){case 0:return t=this.buildUrl(e.path,e.query),[4,this.request.fetch(l(l({url:t,method:`GET`,headers:l({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(n=o.sent(),e.signal?.aborted)throw new a(`The download was aborted`,0,`STORAGE_PG_ABORTED`);if((r=Number(n?.statusCode??200))===304)throw new a(`Not Modified`,r,`STORAGE_PG_NOT_MODIFIED`);if(r>=400)throw new a(`Download failed with status ${r}`,r,`STORAGE_PG_REQUEST_FAIL`);if(!(i=n?.response))throw new a(`Underlying adapter did not expose the raw Response`,r,`STORAGE_PG_NO_RESPONSE`);return[2,{response:i,status:r,header:n?.header}]}})})},e.prototype.unwrap=function(e,t){return u(this,void 0,Promise,function(){var n,r,i,o;return d(this,function(s){switch(s.label){case 0:n=Number(e?.statusCode??e?.status??200),r=e?.data,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return r=s.sent(),[3,4];case 3:return s.sent(),r=void 0,[3,4];case 4:if(n>=200&&n<300)return[2,r];throw i=r?.code||r?.error||`STORAGE_PG_REQUEST_FAIL`,o=r?.message||`Storage request failed with status ${n}: ${t}`,new a(o,n,i)}})})},e}(),_=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_.apply(this,arguments)},v=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},y=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function x(e){return r(e)?e:new n(e?.message||String(e))}function S(e){var t={};return e?.download!==void 0&&(t.download=!0===e.download?``:e.download),e?.cacheNonce!==void 0&&(t.cacheNonce=String(e.cacheNonce)),{headers:{},query:t}}var C=function(){function e(e){this.ctx=e}return e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){return v(this,void 0,Promise,function(){var e,t,n,r,i;return y(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=S(this.ctx.options),t=e.headers,n=e.query,[4,this.ctx.http.download({path:`/object/${this.ctx.bucketId}/${c(this.ctx.cleanName)}`,headers:_(_({},this.ctx.headers),t),query:n,signal:this.ctx.parameters?.signal,cache:this.ctx.parameters?.cache})];case 1:if(!(r=o.sent().response).body)throw new a(`Response body is empty`,r.status,`STORAGE_PG_EMPTY_BODY`);return[2,{data:r.body,error:null}];case 2:if(i=o.sent(),this.ctx.shouldThrowOnError)throw i;return[2,{data:null,error:x(i)}];case 3:return[2]}})})},e}(),w=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new C(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){return v(this,void 0,Promise,function(){var e,t,n,r,i,a;return y(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),e=S(this.ctx.options),t=e.headers,n=e.query,[4,this.ctx.http.download({path:`/object/${this.ctx.bucketId}/${c(this.ctx.cleanName)}`,headers:_(_({},this.ctx.headers),t),query:n,signal:this.ctx.parameters?.signal,cache:this.ctx.parameters?.cache})];case 1:return r=o.sent().response,a={},[4,r.blob()];case 2:return[2,(a.data=o.sent(),a.error=null,a)];case 3:if(i=o.sent(),this.ctx.shouldThrowOnError)throw i;return[2,{data:null,error:x(i)}];case 4:return[2]}})})},e}(),T=function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T.apply(this,arguments)},E=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},D=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ee=`3600`,te=function(){function e(e,t,n){n===void 0&&(n=!1),this.headers={},this.http=e,this.bucketId=t,this.shouldThrowOnError=n}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.setHeader=function(e,t){var r;if(typeof e!=`string`||e.trim()===``)throw new n(`setHeader requires a non-empty header name`);if(/[\r\n]/.test(e)||typeof t==`string`&&/[\r\n]/.test(t))throw new n(`setHeader does not allow CR/LF characters in header name or value`);return this.headers=T(T({},this.headers),((r={})[e]=String(t),r)),this},e.prototype.upload=function(e,t,n){return E(this,void 0,Promise,function(){return D(this,function(r){return[2,this.uploadOrUpdate(`POST`,e,t,n)]})})},e.prototype.update=function(e,t,n){return E(this,void 0,Promise,function(){return D(this,function(r){return[2,this.uploadOrUpdate(`PUT`,e,t,n)]})})},e.prototype.download=function(e,t,n){return new w({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(e),options:t,parameters:n,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},e.prototype.list=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r;return D(this,function(i){return r={prefix:e||``},t?.limit!==void 0&&(r.limit=t.limit),t?.cursor!==void 0&&(r.cursor=t.cursor),t?.withDelimiter!==void 0&&(r.with_delimiter=t.withDelimiter),t?.sortBy!==void 0&&(r.sortBy=t.sortBy),[2,this.send({method:`POST`,path:`/object/list/${this.bucketId}`,json:r,signal:n?.signal,cache:n?.cache})]})})},this.shouldThrowOnError)]})})},e.prototype.remove=function(e){return E(this,void 0,Promise,function(){var t=this;return D(this,function(n){return[2,h(function(){return E(t,void 0,void 0,function(){var t,n,r,i,a,o=this;return D(this,function(s){switch(s.label){case 0:t=e.map(function(e){return o.cleanPath(e)}),n=[],r=0,s.label=1;case 1:return r<t.length?(i=t.slice(r,r+100),[4,this.send({method:`DELETE`,path:`/object/${this.bucketId}`,json:{prefixes:i}})]):[3,4];case 2:a=s.sent(),Array.isArray(a)&&n.push.apply(n,a),s.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}})})},this.shouldThrowOnError)]})})},e.prototype.copy=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r;return D(this,function(i){switch(i.label){case 0:return r=this.buildCopyMoveHeaders(n),[4,this.send({method:`POST`,path:`/object/copy`,json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:n?.destinationBucket,copyMetadata:n?.copyMetadata,metadata:n?.metadata},headers:r})];case 1:return[2,{path:i.sent().Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.move=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){return D(this,function(r){switch(r.label){case 0:return[4,this.send({method:`POST`,path:`/object/move`,json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:n?.destinationBucket}})];case 1:return[2,{message:r.sent().message||`Successfully moved`}]}})})},this.shouldThrowOnError)]})})},e.prototype.info=function(e){return E(this,void 0,Promise,function(){var t=this;return D(this,function(n){return[2,h(function(){return E(t,void 0,void 0,function(){var t,n;return D(this,function(r){switch(r.label){case 0:return t=this.cleanPath(e),[4,this.send({method:`GET`,path:`/object/info/${this.bucketId}/${this.encodePath(t)}`})];case 1:return[2,{id:(n=r.sent()).id,name:n.name,version:n.version,bucketId:n.bucket_id,size:n.size,contentType:n.content_type,cacheControl:n.cache_control,etag:n.etag,metadata:n.metadata,lastModified:n.last_modified,createdAt:n.created_at}]}})})},this.shouldThrowOnError)]})})},e.prototype.exists=function(e){return E(this,void 0,Promise,function(){var t,r,i;return D(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=this.cleanPath(e),[4,this.send({method:`GET`,path:`/object/info/${this.bucketId}/${this.encodePath(t)}`})];case 1:return a.sent(),[2,{data:!0,error:null}];case 2:if(r=a.sent(),(i=r?.status)!==void 0&&[400,404].includes(Number(i)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof n?r:new n(r?.message||String(r))}];case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r,i,a;return D(this,function(o){switch(o.label){case 0:return r=this.cleanPath(e),[4,this.send({method:`POST`,path:`/object/sign/${this.bucketId}/${this.encodePath(r)}`,json:{expiresIn:t}})];case 1:return i=o.sent(),a=i.fullSignedURL||this.http.toFullUrl(i.signedURL||``),[2,{fullSignedURL:this.appendUrlOptions(a,n)}]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUrls=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r,i,a,o,s=this;return D(this,function(c){switch(c.label){case 0:r=e.map(function(e){return s.cleanPath(e)}),i=[],a=0,c.label=1;case 1:return a<r.length?(o=r.slice(a,a+500),[4,this.send({method:`POST`,path:`/object/sign/${this.bucketId}`,json:{expiresIn:t,paths:o}})]):[3,4];case 2:c.sent().forEach(function(e){var t=e.fullSignedURL||(e.signedURL?s.http.toFullUrl(e.signedURL):null);i.push({path:e.path,fullSignedURL:t?s.appendUrlOptions(t,n):null,error:e.error??null})}),c.label=3;case 3:return a+=500,[3,1];case 4:return[2,i]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUploadUrl=function(e,t){return E(this,void 0,Promise,function(){var n=this;return D(this,function(r){return[2,h(function(){return E(n,void 0,void 0,function(){var n,r,i;return D(this,function(a){switch(a.label){case 0:return n=this.cleanPath(e),r={},t!=null&&t.upsert&&(r[`x-upsert`]=`true`),[4,this.send({method:`POST`,path:`/object/upload/sign/${this.bucketId}/${this.encodePath(n)}`,headers:r})];case 1:return[2,{fullSignedURL:(i=a.sent()).fullURL||this.http.toFullUrl(i.url||``),path:n,token:i.token}]}})})},this.shouldThrowOnError)]})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return E(this,void 0,Promise,function(){var i=this;return D(this,function(a){return[2,h(function(){return E(i,void 0,void 0,function(){var i,a,o,s,c;return D(this,function(l){switch(l.label){case 0:return i=this.cleanPath(e),a=this.buildUploadBody(n,r),o=a.body,s=a.headers,[4,this.send({method:`PUT`,path:`/object/upload/sign/${this.bucketId}/${this.encodePath(i)}`,query:{token:t},rawBody:o,headers:s,withCredentials:!1})];case 1:return c=l.sent(),[2,{path:i,fullPath:c.Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.getPublicUrl=function(e,t){var n=this.cleanPath(e),r=this.http.buildUrl(`/object/public/${this.bucketId}/${this.encodePath(n)}`);return{data:{publicUrl:this.appendUrlOptions(r,t)}}},e.prototype.send=function(e){return this.http.send(T(T({},e),{headers:T(T({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return E(this,void 0,Promise,function(){var i=this;return D(this,function(a){return[2,h(function(){return E(i,void 0,void 0,function(){var i,a,o,s,c;return D(this,function(l){switch(l.label){case 0:return i=this.cleanPath(t),a=this.buildUploadBody(n,r),o=a.body,s=a.headers,e===`POST`&&(s[`x-upsert`]=String(!!r?.upsert)),[4,this.send({method:e,path:`/object/${this.bucketId}/${this.encodePath(i)}`,rawBody:o,headers:s})];case 1:return[2,{id:(c=l.sent()).Id,path:i,fullPath:c.Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.cleanPath=function(e){var t=e.replace(/^\/+|\/+$/g,``).replace(/\/+/g,`/`);if(t.split(`/`).some(function(e){return e===`..`}))throw new n(`invalid path: ".." segment is not allowed`);return t},e.prototype.encodePath=function(e){return c(e)},e.prototype.buildUploadBody=function(e,t){var n=T({},t?.headers||{}),r=e,i=typeof FormData<`u`&&e instanceof FormData;if(typeof Blob<`u`&&e instanceof Blob||i){var a=void 0,o={};if(i){var s=this.extractFromFormData(e);a=s.file,o=s.fields}else a=e;var c=t?.cacheControl??o.cacheControl??ee,l=t?.contentType??o.contentType,u=t?.metadata===void 0?o.metadata:JSON.stringify(t.metadata),d=new FormData;c!==void 0&&d.append(`cacheControl`,String(c)),l!==void 0&&d.append(`contentType`,l),u!==void 0&&d.append(`metadata`,u),d.append(``,a),r=d}else r=e,c=t?.cacheControl??ee,l=t?.contentType??`text/plain;charset=UTF-8`,n[`cache-control`]=`max-age=${c}`,l&&(n[`content-type`]=l),t!=null&&t.metadata&&(n[`x-metadata`]=this.toBase64(JSON.stringify(t.metadata)));return{body:r,headers:n}},e.prototype.extractFromFormData=function(e){var t,r={},i=0,a=[];if(e.forEach(function(e,n){if(typeof Blob<`u`&&e instanceof Blob)return t=e,void(i+=1);n!==`cacheControl`&&n!==`contentType`&&n!==`metadata`?a.push(n):r[n]=String(e)}),a.length>0&&console.warn(`Ignored unsupported FormData field(s): [${a.join(`, `)}]. Only file, cacheControl, contentType and metadata are supported`),i===0||!t)throw new n(`FormData must contain a file`);if(i>1)throw new n(`FormData must contain exactly one file`);return{file:t,fields:r}},e.prototype.buildCopyMoveHeaders=function(e){var t={};return e!=null&&e.upsert&&(t[`x-upsert`]=`true`),!1===e?.copyMetadata&&e!=null&&e.metadata&&(t[`x-metadata`]=this.toBase64(JSON.stringify(e.metadata))),t},e.prototype.appendUrlOptions=function(e,t){var n=[];if(t?.download!==void 0){var r=!0===t.download?``:String(t.download);n.push(`download=${encodeURIComponent(r)}`)}return t?.cacheNonce!==void 0&&n.push(`cacheNonce=${encodeURIComponent(String(t.cacheNonce))}`),n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${n.join(`&`)}`},e.prototype.toBase64=function(e){return s(e)},e}(),O=/[\x00-\x20\x7f/\\?#%]/;function k(e,t){if(typeof e!=`string`||e.length===0)throw new n(`[storage.${t}] bucketId is required`);if(e.length>256)throw new n(`[storage.${t}] invalid bucketId: length must be 1-256`);var r=O.exec(e);if(r)throw new n(`[storage.${t}] invalid bucketId "${e}": contains forbidden character ${JSON.stringify(r[0])}; must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"`)}var A=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},ne=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},re=function(){function e(e,t){t===void 0&&(t=!1),this.http=new g(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){var n={};return e?.limit!==void 0&&(n.limit=e.limit),e?.offset!==void 0&&(n.offset=e.offset),e!=null&&e.sortColumn&&(n.sortColumn=e.sortColumn),e!=null&&e.sortOrder&&(n.sortOrder=e.sortOrder),e!=null&&e.search&&(n.search=e.search),t.http.send({method:`GET`,path:`/bucket/`,query:n})},this.shouldThrowOnError)]})})},e.prototype.getBucket=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){return k(e,`getBucket`),t.http.send({method:`GET`,path:`/bucket/${e}`})},this.shouldThrowOnError)]})})},e.prototype.createBucket=function(e,t){return A(this,void 0,Promise,function(){var n=this;return ne(this,function(r){return[2,h(function(){var r;return k(e,`createBucket`),n.http.send({method:`POST`,path:`/bucket/`,json:{id:e,name:e,public:(r=t?.public)!=null&&r,type:t?.type,file_size_limit:t?.fileSizeLimit,allowed_mime_types:t?.allowedMimeTypes}})},this.shouldThrowOnError)]})})},e.prototype.updateBucket=function(e,t){return A(this,void 0,Promise,function(){var n=this;return ne(this,function(r){return[2,h(function(){return k(e,`updateBucket`),n.http.send({method:`PUT`,path:`/bucket/${e}`,json:{public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes}})},this.shouldThrowOnError)]})})},e.prototype.deleteBucket=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){return k(e,`deleteBucket`),t.http.send({method:`DELETE`,path:`/bucket/${e}`})},this.shouldThrowOnError)]})})},e}();function ie(){return`@cloudbase/js-sdk`}var ae={INVALID_PARAMS:`INVALID_PARAMS`,INVALID_SYNTAX:`INVALID_SYNTAX`,INVALID_OPERATION:`INVALID_OPERATION`,OPERATION_FAIL:`OPERATION_FAIL`,NETWORK_ERROR:`NETWORK_ERROR`,UNKOWN_ERROR:`UNKOWN_ERROR`};let oe=(se={AbstractSDKRequest:()=>f,AbstractStorage:()=>p},ce={},So.d(ce,se),ce);var se,ce,le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=function(){return ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ue.apply(this,arguments)};function de(e){return typeof e==`string`}function fe(e,t){console.warn(`[@cloudbase/js-sdk][${e}]:${t}`)}var pe=function(e){function t(t){var n=e.call(this,t.msg||t.message||``)||this;return n.code=t.code||``,n.requestId=t.requestId||``,Object.defineProperty(n,"message",{value:t.msg||t.message||``,enumerable:!0,writable:!0,configurable:!0}),n}return le(t,e),t}(Error),me=function(e){return new pe(e)};function he(e,t){return(t||me)(e)}function ge(e){if(e&&typeof e==`object`&&e.data&&typeof e.data==`object`){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return ue(ue(ue({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e}var _e,ve=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)},ye=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},be=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){function t(t){var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=i||`请求超时`,n.restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}ve(t,e),t.prototype.get=function(e){return this.request(j(j({},e),{method:`get`}),this.restrictedMethods.includes(`get`))},t.prototype.post=function(e){return this.request(j(j({},e),{method:`post`}),this.restrictedMethods.includes(`post`))},t.prototype.put=function(e){return this.request(j(j({},e),{method:`put`}))},t.prototype.upload=function(e){var t=e,n=t.data,r=t.file,i=t.fileContent,a=t.name,o=t.method,s=t.headers,c=s===void 0?{}:s,l=r??i,u={post:`post`,put:`put`}[o?.toLowerCase()]||`put`,d=new FormData;return u===`post`?(Object.keys(n).forEach(function(e){d.append(e,n[e])}),d.append(`key`,a),d.append(`file`,l instanceof Blob?l:new Blob([l])),this.request(j(j({},e),{data:d,method:u}),this.restrictedMethods.includes(`upload`))):this.request(j(j({},e),{method:`put`,headers:c,body:l}),this.restrictedMethods.includes(`upload`))},t.prototype.download=function(e){return ye(this,void 0,Promise,function(){var t,n,r,i;return be(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(j(j({},e),{headers:{},responseType:`blob`}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split(`/`).pop()||``),(i=document.createElement(`a`)).href=n,i.setAttribute(`download`,r),i.style.display=`none`,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){return ye(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=this;return be(this,function(h){switch(h.label){case 0:return t=new AbortController,n=e.url,r=e.enableAbort,i=r!==void 0&&r,a=e.stream,o=a!==void 0&&a,s=e.signal,c=e.timeout,l=e.shouldThrowOnError,u=l===void 0||l,d=c??this.timeout,s&&(s.aborted&&t.abort(),s.addEventListener(`abort`,function(){return t.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),t.abort(Error(m.timeoutMsg))},d)),[4,fetch(n,j(j({},e),{signal:t.signal})).then(function(e){return ye(m,void 0,void 0,function(){var t,n,r;return be(this,function(i){switch(i.label){case 0:return clearTimeout(f),u?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[i.sent()]),i.label=3;case 3:return[2,t];case 4:return[2,e]}})})}).catch(function(e){return clearTimeout(f),Promise.reject(e)})];case 1:return p=h.sent(),[2,{data:o?p.body:p.headers.get(`content-type`)?.includes(`application/json`)?p.json():p.text(),statusCode:p.status,header:p.headers,response:p}]}})})},t.prototype.request=function(e,t){var n=this;t===void 0&&(t=!1);var r=String(e.method).toLowerCase()||`get`;return new Promise(function(i){var a=e.url,o=e.headers,s=o===void 0?{}:o,c=e.data,l=e.responseType,u=e.withCredentials,d=e.body,f=e.onUploadProgress,p=function(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;return Object.keys(n).forEach(function(e){i===``?!r&&(t+=`?`):i+=`&`,i+=`${e}=${encodeURIComponent(n[e])}`}),/^http(s)?:\/\//.test(t+=i)?t:`${e}${t}`}(`https:`,a,r===`get`?c:{}),m=new XMLHttpRequest;m.open(r,p),l&&(m.responseType=l);var h,g,_,v=e.signal;v&&(v.aborted?m.abort():v.addEventListener(`abort`,function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),f&&m.upload.addEventListener(`progress`,f),m.onreadystatechange=function(){var e={};if(m.readyState===4){var t=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(`: `),r=t.shift().toLowerCase();n[r]=t.join(`: `)}),e.header=n,e.statusCode=m.status;try{e.data=l===`blob`?m.response:JSON.parse(m.responseText)}catch{e.data=l===`blob`?m.response:m.responseText}clearTimeout(h),i(e)}},t&&n.timeout&&(h=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),_=c,g=Object.prototype.toString.call(_)===`[object FormData]`?c:s[`content-type`]===`application/x-www-form-urlencoded`?function(e){e===void 0&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)}(c):d||(c?JSON.stringify(c):void 0),u&&(m.withCredentials=!0),m.send(g)})}})(oe.AbstractSDKRequest),function(e){e.WEB=`web`,e.WX_MP=`wx_mp`}(_e||={});var xe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ce=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},we=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||={},n}return xe(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(oe.AbstractStorage);(function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=n===void 0?{}:n,i=e.keys,a=i===void 0?{}:i;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case`local`:default:return t.localStorage?t.localStorage:(fe(ae.INVALID_PARAMS,`localStorage is not supported on current platform`),new we(t.root));case`none`:return new we(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=a)}Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||`sync`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if(this.mode!==`async`){if(this.storage)try{var r={version:n||`localCachev1`,content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw Error(JSON.stringify({code:ae.OPERATION_FAIL,msg:`[@cloudbase/js-sdk][${ae.OPERATION_FAIL}]setStore failed`,info:e}))}}else fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use setStoreAsync insteed`)},e.prototype.setStoreAsync=function(e,t,n){return Se(this,void 0,void 0,function(){var r;return Ce(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),r={version:n||`localCachev1`,content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){if(this.mode!==`async`){try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return``}catch{return``}t||=`localCachev1`;var n=this.storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:``}fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use getStoreAsync insteed`)},e.prototype.getStoreAsync=function(e,t){return Se(this,void 0,void 0,function(){var n;return Ce(this,function(r){switch(r.label){case 0:try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,``]}catch{return[2,``]}return t||=`localCachev1`,[4,this.storage.getItem(e)];case 1:return(n=r.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,``]}})})},e.prototype.removeStore=function(e){this.mode===`async`?fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use removeStoreAsync insteed`):this.storage.removeItem(e)},e.prototype.removeStoreAsync=function(e){return Se(this,void 0,void 0,function(){return Ce(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})}})();var Te=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(e,t){this.data=t||null,this.name=e},Ee=function(e){function t(t,n){var r=e.call(this,`error`,{error:t,data:n})||this;return r.error=t,r}return Te(t,e),t}(M),N=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(n?.[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof Ee)return console.error(e.error),this;var n=de(e)?new M(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var i=0,a=this.listeners[r]?function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],this.listeners[r],!0):[];i<a.length;i++)a[i].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new N,new N,typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.indexOf(`Firefox`),(e=>{var t={};return So.d(t,e),t})({default:()=>b}).default;var P,De=So(388),Oe=function(){return Oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oe.apply(this,arguments)},ke=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Ae=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},je=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Me=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){e.put=`put`,e.post=`post`})(P||={});var Ne=ie,Pe=ae,Fe=`https://support.qq.com/products/148793`,Ie=function(e){return Object.prototype.toString.call(e)===`[object Array]`},Le=de,Re=function(e){return Object.prototype.toString.call(e)===`[object Object]`},ze=function(e,t,n){if(n===void 0&&(n=null),e&&typeof e==`function`)return e(t,n);if(t)throw t;return n},Be=function(e,t){if(function(e){return!e||typeof e.throw!=`boolean`||e.throw}(e))throw he(ue(ue({},t),{msg:t.message}),e?.errorFactory);return ue({code:t.code,message:t.message},t.requestId?{requestId:t.requestId}:{})},Ve=fe,He=function(e){return e.mode,e.customInfo,e.title,e.messages,function(e,t,n){}},Ue=`storage`;function We(e,t){return t&&typeof t!=`function`?[Oe(Oe({},e),{customReqOpts:t}),void 0]:[e,t]}var Ge=function(e,t,n){return je(void 0,void 0,void 0,function(){var r,i;return Me(this,function(a){switch(a.label){case 0:return[4,e.gateWay({path:`storages`,name:`get-objects-upload-info`,data:[Oe({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return r=ge(r=a.sent()),i=r.data?.[0]||{},[2,Oe(Oe({},r),{data:Oe(Oe({},i.code?Oe({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},Ke=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`get-objects-download-info`,data:t.convertedFileList.map(function(e){return Oe({cloudObjectId:e.fileid},e.max_age==null?{}:{maxAge:e.max_age})})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{download_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl,mime_type:e.contentType||F(null,e.cloudObjectId||``)}}):[]}})]}})})},qe=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`delete-objects`,data:t.fileList.map(function(e){return{cloudObjectId:e}})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{delete_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,fileID:e.cloudObjectId,message:e.message}}):[]}})]}})})},Je=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`copy-objects`,data:t.convertedFileList.map(function(e){return{srcPath:e.src_path,dstPath:e.dst_path,overwrite:e.overwrite,removeOriginal:e.remove_original}})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{copy_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,fileID:e.cloudObjectId,fileId:e.cloudObjectId,message:e.message}}):[]}})]}})})},Ye={txt:`text/plain`,json:`application/json`,html:`text/html`,htm:`text/html`,css:`text/css`,js:`application/javascript`,csv:`text/csv`,xml:`application/xml`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,ico:`image/x-icon`,pdf:`application/pdf`,zip:`application/zip`,gz:`application/gzip`,mp4:`video/mp4`,webm:`video/webm`,mp3:`audio/mpeg`,wav:`audio/wav`};function F(e,t){if(typeof Blob<`u`&&e instanceof Blob&&e.type)return e.type;var n=/\.([a-zA-Z0-9]+)$/.exec(t||``);return Ye[n?n[1].toLowerCase():``]||`application/octet-stream`}function Xe(){return typeof globalThis.wx?.getFileSystemManager==`function`}function Ze(e,t){var n=t.toLowerCase();return Object.keys(e).some(function(e){return e.toLowerCase()===n})}function Qe(e){return Object.keys(e).reduce(function(t,n){var r;return Oe(Oe({},t),((r={})[n]=[e[n]],r))},{})}function $e(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1}var et=function(){function e(e){this.context=e}var t,n,r,i,a,s,c,l,u,d,f,p,m,h,g,_,v;return Object.defineProperty(e.prototype,"config",{get:function(){return this.context?.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.context?.request},enumerable:!1,configurable:!0}),e.prototype.isGateWay=function(){return(this.config.endPointMode||`CLOUD_API`)===`GATEWAY`},e.prototype.uploadFile=function(e,t){var n;return je(this,void 0,Promise,function(){var r,i,a,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,te,O,k,A,ne,re,ie,ae,oe;return Me(this,function(se){switch(se.label){case 0:if(re=We(e,t),e=re[0],t=re[1],r=e.cloudPath,i=e.filePath,a=e.onUploadProgress,ie=e.method,s=ie===void 0?`put`:ie,ae=e.headers,c=ae===void 0?{}:ae,l=e.fileContent,!Le(r)||!i&&!l)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.uploadFile] invalid params`})];if(i&&l&&console.warn(`[${Ne()}][${Ue}.uploadFile] fileContent 是兼容字段,与 filePath 同时传入时忽略,实际使用 filePath`),u=i??l,(d={put:P.put,post:P.post}[s.toLocaleLowerCase()]||P.put)===P.post&&console.warn(`[${Ne()}][${Ue}.uploadFile] method: 'post' 已废弃,请改用 'put'`),f=this.isGateWay(),p=Oe({},c),m=Object.keys(c).reduce(function(e,t){return t.toLowerCase()!==`content-length`&&(e[t]=c[t]),e},{}),d===P.put&&f){if(!Ze(p,`content-length`)){if(h=((n=this.request)?.getUploadByteLength)?.call(n,u),typeof(g=typeof h==`number`?h:function(e){if((!Xe()||typeof e!=`string`)&&e!==null){if(typeof Blob<`u`&&e instanceof Blob)return e.size;if(typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||typeof ArrayBuffer.isView==`function`&&ArrayBuffer.isView(e)))return e.byteLength;if(typeof e==`string`){if(typeof Blob<`u`)return new Blob([e]).size;var t=(n=e,(r=o())?.byteLength(n));return typeof t==`number`?t:e.length}var n,r;return typeof e==`object`&&typeof e.size==`number`?e.size:void 0}}(u))!=`number`)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:Xe()?`[${Ue}.uploadFile] 无法计算 content-length,请确认上传内容为有效的本地临时路径,或传入 ArrayBuffer`:`[${Ue}.uploadFile] 无法计算 content-length,请传入 File/Blob/Buffer/ArrayBuffer,或在 headers 中提供 content-length`})];p[`content-length`]=String(g)}Ze(p,`content-type`)||(p[`content-type`]=F(u,r)),Ze(m,`content-type`)||(m[`content-type`]=F(u,r))}return[4,this.getUploadMetadata({cloudPath:r,method:d,headers:d!==P.put||f?void 0:m,signedHeader:d===P.put&&f?Qe(p):void 0,customReqOpts:e.customReqOpts})];case 1:return _=se.sent(),v=_.data,y=_.requestId,(b=v)?.code||!b?.url?(x=b?.code||Pe.OPERATION_FAIL,S=b?.message||`get upload info failed`,[2,ze(t,Error(`[${Ne()}][${x}][${Ue}]:${S}`))]):(C=v.url,w=v.authorization,T=v.token,E=v.fileId,D=v.cosFileId,ee=v.download_url,O=Oe(Oe({},te={url:C,file:u,name:r,onUploadProgress:a,fileId:E,requestId:y}),{method:P.put,headers:Oe(Oe({},m),{authorization:w,"x-cos-meta-fileid":D,"x-cos-security-token":T})}),k=Oe(Oe({},te),{method:P.post,data:{key:r,signature:w,"x-cos-meta-fileid":D,success_action_status:`201`,"x-cos-security-token":T}}),(oe={})[P.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},oe[P.post]={params:k,isSuccess:function(e){return e===201}},A=oe,[4,this.request.upload(A[d].params)]);case 2:return ne=se.sent(),A[d].isSuccess(ne.statusCode)?[2,ze(t,null,{fileID:E,download_url:ee,requestId:y})]:[2,ze(t,Error(`[${Ne()}][${Pe.OPERATION_FAIL}][${Ue}]:${ne.data}`))]}})})},e.prototype.getUploadMetadata=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d;return Me(this,function(f){switch(f.label){case 0:if(n=e.cloudPath,r=e.method,i=e.headers,a=e.signedHeader,!Le(n))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getUploadMetadata] invalid cloudPath`})];o=this.request,s=`storage.getUploadMetadata`,f.label=1;case 1:return f.trys.push([1,6,,7]),c=void 0,l={path:n},u=this.isGateWay(),r&&(l.method=r),r===P.put&&(u&&a?l.signedHeader=a:!u&&i&&(l.headers=i)),r!==P.post&&u?[3,3]:[4,o.send(s,l,{endPointMode:`CLOUD_API`},e.customReqOpts)];case 2:return c=f.sent(),[3,5];case 3:return[4,Ge(o,l,e.customReqOpts)];case 4:c=f.sent(),f.label=5;case 5:return[2,ze(t,null,c)];case 6:return d=f.sent(),[2,ze(t,d)];case 7:return[2]}})})},e.prototype.deleteFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u;return Me(this,function(d){switch(d.label){case 0:if(u=We(e,t),e=u[0],t=u[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.deleteFile] fileList must not be empty`})];for(r=0,i=n;r<i.length;r++)if(!(a=i[r])||!Le(a))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.deleteFile] fileID must be string`})];return o=`storage.batchDeleteFile`,s=this.request,c={},this.isGateWay()?[4,qe(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=d.sent(),[3,4];case 2:return[4,s.send(o,{fileid_list:n},e.customReqOpts)];case 3:c=d.sent(),d.label=4;case 4:return c.code?[2,ze(t,null,c)]:(l={fileList:c.data.delete_list,requestId:c.requestId},[2,ze(t,null,l)])}})})},e.prototype.getTempFileURL=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d,f,p;return Me(this,function(m){switch(m.label){case 0:if(p=We(e,t),e=p[0],t=p[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] fileList must not be empty`})];for(r=[],i=!1,a=0,o=n;a<o.length;a++)if(s=o[a],Re(s)){if(!Object.prototype.hasOwnProperty.call(s,`fileID`))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] file info must include fileID`})];if(c={fileid:s.fileID},Object.prototype.hasOwnProperty.call(s,`maxAge`)){if(!$e(l=s.maxAge))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] maxAge must be an integer greater than or equal to 1`})];l>3600&&!i&&(Ve(Pe.INVALID_PARAMS,`[${Ue}.getTempFileURL] maxAge ${l} 大于 3600,仍按原值下发`),i=!0),c.max_age=l}r.push(c)}else{if(!Le(s))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] invalid fileList`})];r.push({fileid:s})}return u=`storage.batchGetDownloadUrl`,d=this.request,f={},this.isGateWay()?[4,Ke(d,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return[4,d.send(u,{file_list:r},e.customReqOpts)];case 3:f=m.sent(),m.label=4;case 4:return f.code?[2,ze(t,null,f)]:[2,ze(t,null,{fileList:Array.isArray(f.data?.download_list)?f.data.download_list:[],requestId:f.requestId})]}})})},e.prototype.downloadFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c;return Me(this,function(l){switch(l.label){case 0:return c=We(e,t),e=c[0],t=c[1],n=e.fileID,Le(n)?[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:e.customReqOpts})]:[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] fileID must be string`})];case 1:return r=l.sent(),(i=r.fileList[0]).code===`SUCCESS`?(a=this.request,o=encodeURI(i.download_url),[4,a.download({url:o,tempFilePath:e.tempFilePath})]):[2,ze(t,i)];case 2:return s=l.sent(),[2,ze(t,null,s)]}})})},e.prototype.copyFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d;return Me(this,function(f){switch(f.label){case 0:if(d=We(e,t),e=d[0],t=d[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] fileList must not be empty`})];for(r=[],i=0,a=n;i<a.length;i++){if(o=a[i],s=o.srcPath,c=o.dstPath,!s||!c||typeof s!=`string`||typeof c!=`string`)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] srcPath and dstPath may not be empty`})];if(s===c)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] srcPath and dstPath can not be the same`})];r.push({src_path:s,dst_path:c,overwrite:o.overwrite,remove_original:o.removeOriginal})}return l=this.request,u={},this.isGateWay()?[4,Je(l,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return u=f.sent(),[3,4];case 2:return[4,l.send(`storage.batchCopyFile`,{file_list:r},e.customReqOpts)];case 3:u=f.sent(),f.label=4;case 4:return u.code?[2,ze(t,null,u)]:[2,ze(t,null,{fileList:u.data.copy_list,requestId:u.requestId})]}})})},e.prototype.getFileInfo=function(e){return je(this,void 0,Promise,function(){var t,n=this;return Me(this,function(r){switch(r.label){case 0:return[4,this.getTempFileURL(e)];case 1:return(t=r.sent())?.fileList&&t?.fileList?.length>0?[4,Promise.all(t.fileList.map(function(e){return je(n,void 0,void 0,function(){var t,n,r,i,a,o,s;return Me(this,function(c){switch(c.label){case 0:if(e.code!==`SUCCESS`)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:`HEAD`})];case 2:return t=c.sent(),n=t.header,typeof Headers<`u`&&n instanceof Headers&&(r={},n.forEach(function(e,t){r[t]=e}),n=r),i=parseInt(n[`content-length`])||0,a=n[`content-type`]||``,[400,404].includes(Number(t.statusCode))?[2,{code:`FILE_NOT_FOUND`,fileID:e.fileID,tempFileURL:e.tempFileURL,message:`file not found`}]:[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,cloudId:e.fileID,fileName:e.fileID.split(`/`).pop(),contentType:a,mime:a.split(`;`)[0].trim(),size:i,etag:n.etag||``,lastModified:n[`last-modified`]||``,cacheControl:n[`cache-control`]||``}];case 3:return o=c.sent(),s=typeof o==`object`&&o&&`message`in o?String(o.message):void 0,[2,{code:`FETCH_FILE_INFO_ERROR`,fileID:e.fileID,tempFileURL:e.tempFileURL,message:s}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:r.sent(),requestId:t.requestId}];case 3:return[2,{fileList:[],requestId:t.requestId}]}})})},ke([He({customInfo:{className:`Cloudbase`,methodName:`uploadFile`},title:`上传文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 uploadFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(t=De.ICloudbaseUploadFileParams!==void 0&&De.ICloudbaseUploadFileParams)==`function`?t:Object,typeof(n=typeof Function<`u`&&Function)==`function`?n:Object]),Ae(`design:returntype`,typeof(r=typeof Promise<`u`&&Promise)==`function`?r:Object)],e.prototype,`uploadFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`getUploadMetadata`},title:`获取上传元信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 getUploadMetadata() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[Object,typeof(i=typeof Function<`u`&&Function)==`function`?i:Object]),Ae(`design:returntype`,typeof(a=typeof Promise<`u`&&Promise)==`function`?a:Object)],e.prototype,`getUploadMetadata`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`deleteFile`},title:`删除文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 deleteFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(s=De.ICloudbaseDeleteFileParams!==void 0&&De.ICloudbaseDeleteFileParams)==`function`?s:Object,typeof(c=typeof Function<`u`&&Function)==`function`?c:Object]),Ae(`design:returntype`,typeof(l=typeof Promise<`u`&&Promise)==`function`?l:Object)],e.prototype,`deleteFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`getTempFileURL`},title:`获取文件下载链接`,messages:[`请确认以下各项:`,` 1 - 调用 getTempFileURL() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(u=De.ICloudbaseGetTempFileURLParams!==void 0&&De.ICloudbaseGetTempFileURLParams)==`function`?u:Object,typeof(d=typeof Function<`u`&&Function)==`function`?d:Object]),Ae(`design:returntype`,typeof(f=typeof Promise<`u`&&Promise)==`function`?f:Object)],e.prototype,`getTempFileURL`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`downloadFile`},title:`下载文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 downloadFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(p=De.ICloudbaseDownloadFileParams!==void 0&&De.ICloudbaseDownloadFileParams)==`function`?p:Object,typeof(m=typeof Function<`u`&&Function)==`function`?m:Object]),Ae(`design:returntype`,typeof(h=typeof Promise<`u`&&Promise)==`function`?h:Object)],e.prototype,`downloadFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`copyFile`},title:`批量复制文件`,messages:[`请确认以下各项:`,` 1 - 调用 copyFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(g=De.ICloudbaseCopyFileParams!==void 0&&De.ICloudbaseCopyFileParams)==`function`?g:Object,typeof(_=typeof Function<`u`&&Function)==`function`?_:Object]),Ae(`design:returntype`,typeof(v=typeof Promise<`u`&&Promise)==`function`?v:Object)],e.prototype,`copyFile`,null),e}(),I=function(){return I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},I.apply(this,arguments)},tt=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},L=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},R=ae,nt=function(){function e(e,t){t===void 0&&(t=!1),this.shouldThrowOnError=!1,this.bucketId=``,this.context=e,this.shouldThrowOnError=t,this.storage=new et(e)}return Object.defineProperty(e.prototype,"config",{get:function(){return this.context?.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.context?.request},enumerable:!1,configurable:!0}),e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.upload=function(e,t,n){return tt(this,void 0,Promise,function(){var i,a,o,s,c,l,u,d,f;return L(this,function(p){switch(p.label){case 0:i=I({upsert:!0},n),a=i.cacheControl,o=i.contentType,s=i.metadata,p.label=1;case 1:return p.trys.push([1,3,,4]),c=this.getCloudPath(e),l={cloudPath:c,filePath:t},(a||o||s)&&(u={},a&&(u[`cache-control`]=a),o&&(u[`content-type`]=o),s&&(u[`x-cos-metadata-metadata`]=this.toBase64(JSON.stringify(s))),l.headers=u),[4,this.storage.uploadFile(l)];case 2:if(!(d=p.sent()).fileID)throw Error(JSON.stringify({code:R.OPERATION_FAIL,msg:`[${Ue}.update] no fileID returned`}));return[2,{data:{id:d.fileID,path:e,fullPath:e},error:null}];case 3:if(f=p.sent(),this.shouldThrowOnError)throw f;if(r(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return tt(this,void 0,Promise,function(){return L(this,function(t){return[2,this.upload(e,n,r)]})})},e.prototype.createSignedUploadUrl=function(e){return tt(this,void 0,Promise,function(){var t,r,i;return L(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=this.getCloudPath(e),[4,this.storage.getUploadMetadata({cloudPath:t})];case 1:return[2,{data:{signedUrl:(r=a.sent().data).url,token:r.token,path:e,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(i=a.sent(),this.shouldThrowOnError)throw i;return[2,{data:null,error:i instanceof n?i:new n(i.message)}];case 3:return[2]}})})},e.prototype.update=function(e,t,n){return tt(this,void 0,Promise,function(){return L(this,function(r){return[2,this.upload(e,t,I(I({},n),{upsert:!0}))]})})},e.prototype.move=function(e,t){return tt(this,void 0,Promise,function(){var i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!0}]})];case 1:if((i=o.sent()).fileList[0].code&&i.fileList[0].code!==`SUCCESS`)throw new n(i.fileList[0].message||`Move failed`);return[2,{data:{message:`File moved from ${e} to ${t}`},error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.copy=function(e,t){return tt(this,void 0,Promise,function(){var i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!1}]})];case 1:if((i=o.sent()).fileList[0].code&&i.fileList[0].code!==`SUCCESS`)throw new n(i.fileList[0].message||`Copy failed`);return[2,{data:{path:this.getCloudPath(t)},error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,i){return tt(this,void 0,Promise,function(){var a,o,s,c,l,u,d;return L(this,function(f){switch(f.label){case 0:if(f.trys.push([0,2,,3]),!$e(t))throw new n(`[${Ue}.createSignedUrl] expiresIn must be an integer greater than or equal to 1`);return a=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[{fileID:a,maxAge:t}]})];case 1:if((o=f.sent()).fileList[0].code!==`SUCCESS`)throw new n(`Failed to create signed URL: [${o.fileList[0].code}] ${o.fileList[0].fileID}`);return s=o.fileList[0].download_url,c=[],i?.download!==void 0&&(typeof i.download==`string`?c.push(`download=${encodeURIComponent(i.download)}`):!0===i.download&&c.push(`download=true`)),i!=null&&i.transform&&(l=this.transformOptsToQueryString(i.transform))&&c.push(l),c.length>0&&(u=s.includes(`?`)?`&`:`?`,s=`${s}${u}${c.join(`&`)}`),[2,{data:{signedUrl:s},error:null}];case 2:if(d=f.sent(),this.shouldThrowOnError)throw d;if(r(d))return[2,{data:null,error:d}];throw d;case 3:return[2]}})})},e.prototype.createSignedUrls=function(e,t){return tt(this,void 0,Promise,function(){var i,a,o=this;return L(this,function(s){switch(s.label){case 0:if(s.trys.push([0,2,,3]),!$e(t))throw new n(`[${Ue}.createSignedUrls] expiresIn must be an integer greater than or equal to 1`);return i=e.map(function(e){return{fileID:o.normalizeCloudId(e),maxAge:t}}),[4,this.storage.getTempFileURL({fileList:i})];case 1:return[2,{data:s.sent().fileList.map(function(t,n){return{path:e[n],signedUrl:t.tempFileURL||``,error:t.code===`SUCCESS`?null:t.message}}),error:null}];case 2:if(a=s.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.download=function(e,t){return tt(this,void 0,Promise,function(){var i,a,o=this;return L(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),a={},[4,tt(o,void 0,void 0,function(){var r,i,a;return L(this,function(o){switch(o.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((r=o.sent()).error)throw r.error;return i=encodeURI(r.data?.signedUrl),[4,this.request.reqClass.get({url:i,headers:{},responseType:`blob`})];case 2:if(!(a=o.sent().data))throw new n(`Download failed: no file content`);return[2,new Blob([a])]}})})];case 1:return[2,(a.data=s.sent(),a.error=null,a)];case 2:if(i=s.sent(),this.shouldThrowOnError)throw i;if(r(i))return[2,{data:null,error:i}];throw i;case 3:return[2]}})})},e.prototype.info=function(e){return tt(this,void 0,Promise,function(){var t,r,i,a,o,s,c,l;return L(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=e.startsWith(`cloud://`),r=t?this.extractPathFromFileId(e):e,i=t?this.extractBucketFromFileId(e):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(a=u.sent(),(o=a.fileList[0]).code!==`SUCCESS`)throw new n(o.message);return s=new Date().toISOString(),c=(o.lastModified?new Date(o.lastModified):new Date).toISOString(),[2,{data:{id:o.fileID,version:`1`,name:r,bucketId:i,updatedAt:c,createdAt:c,lastAccessedAt:s,size:o.size,cacheControl:o.cacheControl,contentType:o.contentType,etag:o.etag,lastModified:c,metadata:{}},error:null}];case 2:if(l=u.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof n?l:new n(l.message)}];case 3:return[2]}})})},e.prototype.exists=function(e){return tt(this,void 0,Promise,function(){var t,i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(t=o.sent(),(i=t.fileList[0]).code===`FILE_NOT_FOUND`)return[2,{data:!1,error:null}];if(i.code!==`SUCCESS`)throw new n(i.message);return[2,{data:!0,error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.getPublicUrl=function(e,t){return tt(this,void 0,Promise,function(){var n;return L(this,function(r){switch(r.label){case 0:return[4,this.createSignedUrl(e,600,t)];case 1:return(n=r.sent()).data?[2,{data:{publicUrl:n.data.signedUrl}}]:[2,{data:null,error:n.error}]}})})},e.prototype.remove=function(e){return tt(this,void 0,Promise,function(){var t,i,a,o,s,c,l,u,d,f,p=this;return L(this,function(m){switch(m.label){case 0:for(m.trys.push([0,3,,4]),t=10,i=[],a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return[4,Promise.all(i.map(function(e){return Promise.all(e.map(function(e){return p.info(e)}))}))];case 1:return o=m.sent(),s=new Map,o.forEach(function(n,r){n.forEach(function(n,i){n.data&&s.set(e[r*t+i],n.data)})}),c=e.map(function(e){return p.normalizeCloudId(e)}),[4,this.storage.deleteFile({fileList:c})];case 2:if(l=m.sent(),(u=l.fileList.filter(function(e){return e.code!==`SUCCESS`})).length>0)throw new n(`Delete failed for ${u.length} file(s)`);return d=new Date().toISOString(),[2,{data:e.map(function(e){var t=s.get(e);return{name:t?.name,id:t?.id,bucket_id:t?.bucketId,owner:void 0,updated_at:t?.updatedAt||d,created_at:t?.createdAt,last_accessed_at:t?.lastAccessedAt||d,metadata:t?.metadata||{},buckets:{id:t?.bucketId,name:t?.bucketId,owner:void 0,public:!1,created_at:``,updated_at:d}}}),error:null}];case 3:if(f=m.sent(),this.shouldThrowOnError)throw f;if(r(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},e.prototype.list=function(){return tt(this,void 0,void 0,function(){return L(this,function(e){throw new n(`Not implemented`)})})},e.prototype.getCloudPath=function(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)},e.prototype.normalizeCloudId=function(e){if(/^cloud:\/\//.test(e))return e;var t=this.getCloudPath(e);if(!this.bucketId)throw new n(`bucketId is not set`);var r=this.config?.env||``;return r?`cloud://${r}.${this.bucketId}/${t}`:void 0},e.prototype.toBase64=function(e){return s(e)},e.prototype.transformOptsToQueryString=function(e){var t=[`imageMogr2`];if(e.width||e.height){var n=e.width||``,r=e.height||``;e.resize===`fill`?t.push(`thumbnail/${n}x${r}!`):e.resize===`contain`?t.push(`thumbnail/${n}x${r}`):t.push(`thumbnail/${n}x${r}^`)}if(e.format&&e.format!==`origin`&&t.push(`format/${e.format}`),e.quality!==void 0){var i=Math.max(1,Math.min(100,e.quality));t.push(`quality/${i}`)}return t.join(`/`)},e.prototype.extractPathFromFileId=function(e){var t=e.replace(/^cloud:\/\//,``).split(`/`);return t.length<2?e:t.slice(1).join(`/`)},e.prototype.extractBucketFromFileId=function(e){var t=e.replace(/^cloud:\/\//,``).split(`/`);if(t.length<1)return``;var n=t[0],r=n.indexOf(`.`);return r===-1?n:n.substring(r+1)},e}(),rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=new et,at={name:Ue,entity:{uploadFile:it.uploadFile,deleteFile:it.deleteFile,getTempFileURL:it.getTempFileURL,downloadFile:it.downloadFile,getUploadMetadata:it.getUploadMetadata,copyFile:it.copyFile,getFileInfo:it.getFileInfo,isGateWay:it.isGateWay}},z=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return rt(t,e),t.prototype.from=function(e){return e?(k(e,`from`),new te(this.http,e,this.shouldThrowOnError)):new nt(this.http.ctx,this.shouldThrowOnError)},t}(re),ot={name:`${Ue}/supabase`,IIFE:!0,entity:function(){var e=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(e.has(this))return e.get(this);var t=this,n=new z(new Proxy({},{get:function(e,n){return n===`config`?t.config:n===`request`?t.request:void 0}}));return e.set(this,n),n},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(at),cloudbase.registerComponent(ot)}catch{}function st(e){try{e.registerComponent(at),e.registerComponent(ot)}catch(e){console.warn(e)}}try{window.registerStorage=st}catch{}var ct=st})(),Co.v;var wo=`2.0.16`,To=[`webhook`,`qmsg`,`serverchan`,`pushplus`,`dingtalk`,`wecom`,`bark`,`gocqhttp`,`onebot`,`atri`,`pushdeer`,`igot`,`telegram`,`feishu`,`lark`,`ifttt`,`wecombot`,`discord`,`wxpusher`,`ntfy`,`join`],Eo=class extends Error{};async function Do(e,t={}){let n=new AbortController,r=setTimeout(()=>n.abort(),3e4);try{let r=await fetch(e,{...t,signal:n.signal});return{response:r,text:await r.text()}}catch(e){throw n.signal.aborted?new Eo(`请求超时`):e}finally{clearTimeout(r)}}var Oo=class extends Error{kind;httpStatus;rawMessage;requestId;constructor(e,t,n={}){super(t),this.name=`TwikooError`,this.kind=e,this.httpStatus=n.httpStatus,this.rawMessage=n.rawMessage??t,this.requestId=n.requestId}},ko=class extends Oo{constructor(e){super(`CLIENT_ERROR`,e),this.name=`TwikooResponseError`}};function Ao(e){let t=e.result??e;if(t.code!==void 0&&t.code!==0)throw new ko(typeof t.message==`string`&&t.message?t.message:JSON.stringify(t.code)??``);return t}function jo(e){return e&&typeof e==`object`&&`message`in e?String(e.message):String(e)}var Mo={tcb:null,options:{}};function No(e,t){Mo.tcb=e,Mo.options=t}function Po(){return Mo}function Fo(e){return typeof e==`string`&&/^http(s)?:\/\//.test(e)}async function Io(e,t){let n;try{let r=localStorage.getItem(`twikoo-access-token`);n=JSON.stringify({accessToken:r,...t,envId:e})}catch(e){throw new Oo(`NETWORK`,`无法连接到后端`,{rawMessage:jo(e)})}try{let{response:t,text:r}=await Do(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:n}),{status:i}=t;if(i===200)try{let e=JSON.parse(r);return e.accessToken&&localStorage.setItem(`twikoo-access-token`,typeof e.accessToken==`string`?e.accessToken:``),e}catch{throw new Oo(`UNKNOWN`,`后端返回格式异常`,{rawMessage:r.slice(0,200)})}let a={httpStatus:i,rawMessage:r.slice(0,200)};throw i===404?new Oo(`NOT_FOUND`,`接口地址不存在`,a):i===401||i===403?new Oo(`CLIENT_ERROR`,`认证失败,请重新登录`,a):i===429?new Oo(`REJECTED`,`请求过于频繁`,a):i>=500?new Oo(`SERVER_ERROR`,`后端异常`,a):new Oo(`CLIENT_ERROR`,`请求失败(${i})`,a)}catch(e){throw e instanceof Oo?e:e instanceof Eo?new Oo(`TIMEOUT`,`请求超时`,{rawMessage:e.message}):new Oo(`CORS`,`请求被跨域策略拦截或网络不可达`,{rawMessage:jo(e)})}}async function Lo(e,t,n={}){let r=e??Mo.tcb,i=typeof n.envId==`string`?n.envId:typeof Mo.options.envId==`string`?Mo.options.envId:void 0,a=typeof n.funcName==`string`?n.funcName:typeof Mo.options.funcName==`string`?Mo.options.funcName:`twikoo`;if(r)return await r.app.callFunction({name:a,data:{event:t,...n}});if(typeof i==`string`&&Fo(i))return await Io(i,{event:t,...n});throw Error(`缺少 envId 配置 - https://twikoo.js.org`)}var Ro={verbose:1,info:2,warn:3,error:4}[(typeof process<`u`&&process.env,`info`).toLowerCase()]||2,zo={verbose:(...e)=>{Ro<=1&&console.log(...e)},info:(...e)=>{Ro<=2&&console.info(...e)},warn:(...e)=>{Ro<=3&&console.warn(...e)},error:(...e)=>{Ro<=4&&console.error(...e)}},Bo={ADMIN_CLIENT_VERSION:`前端版本:`,ADMIN_SERVER_VERSION:`云函数版本:`,ADMIN_COMMENT:`评论管理`,ADMIN_COMMENT_DELETE:`删除`,ADMIN_COMMENT_DELETE_CONFIRM:`确认删除?`,ADMIN_COMMENT_FILTER_ALL:`全部`,ADMIN_COMMENT_FILTER_VISIBLE:`只看可见`,ADMIN_COMMENT_FILTER_HIDDEN:`只看隐藏`,ADMIN_COMMENT_HIDE:`隐藏`,ADMIN_COMMENT_IS_SPAM_SUFFIX:` (已隐藏)`,ADMIN_COMMENT_SEARCH:`搜索`,ADMIN_COMMENT_SEARCH_PLACEHOLDER:`搜索昵称、邮箱、网址、IP、评论正文、文章地址`,ADMIN_COMMENT_SHOW:`显示`,ADMIN_COMMENT_TOP:`置顶`,ADMIN_COMMENT_UNTOP:`取消置顶`,ADMIN_COMMENT_VIEW:`查看`,ADMIN_COMMENT_SECURITY_ALERT:`评论链接与本站不同!出于安全考虑,请手动复制以下网址访问:`,ADMIN_COMMENT_PARSE_ERROR:`无法解析评论链接,请仔细检查链接后手动复制以下网址访问:`,ADMIN_CONFIG:`配置管理`,ADMIN_CONFIG_CATEGORY_COMMON:`通用`,ADMIN_CONFIG_CATEGORY_IM:`即时通知`,ADMIN_CONFIG_CATEGORY_MAIL:`邮件通知`,ADMIN_CONFIG_CATEGORY_PLUGIN:`插件`,ADMIN_CONFIG_CATEGORY_PRIVACY:`隐私`,ADMIN_CONFIG_CATEGORY_SPAM:`反垃圾`,ADMIN_CONFIG_CATEGORY_CAPTCHA:`人机验证`,ADMIN_CONFIG_IMAGE_CDN_NONE:`无(不启用图片上传)`,ADMIN_CONFIG_CAPTCHA_NONE:`无`,ADMIN_CONFIG_CAPTCHA_TURNSTILE:`Cloudflare Turnstile`,ADMIN_CONFIG_CAPTCHA_GEETEST:`极验 Geetest`,ADMIN_CONFIG_CAPTCHA_CAP:`Cap`,ADMIN_CONFIG_EMAIL_TEST:`邮件通知测试`,ADMIN_CONFIG_EMAIL_TEST_BTN:`发送测试邮件`,ADMIN_CONFIG_EMAIL_TEST_HELP:`输入一个邮箱地址,发送测试邮件`,ADMIN_CONFIG_EMAIL_TEST_RESULT:`测试结果:`,ADMIN_CONFIG_EXAMPLE:`示例:`,ADMIN_CONFIG_ITEM_AKISMET_KEY:`Akismet 反垃圾评论,用于垃圾评论检测,设为 "MANUAL_REVIEW" 开启人工审核,留空不使用反垃圾。注册:https://akismet.com`,ADMIN_CONFIG_ITEM_BLOGGER_NICK:`博主的昵称。`,ADMIN_CONFIG_ITEM_BLOGGER_EMAIL:`博主的邮箱地址,用于邮件通知、博主标识。`,ADMIN_CONFIG_ITEM_COMMENT_BG_IMG:`评论框自定义背景图片 URL 地址。`,ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE:`评论列表分页大小,默认为 8。`,ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER:`评论框提示信息,可用<br>换行,默认为空`,ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN:`CORS 安全域名,注意:如果您不了解什么是 CORS,此项请留空,错误设置会导致无法加载,默认为空,格式为 https://blog.example.com;如需添加多域名请使用,分隔`,ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR:`默认的头像显示。默认值(留空)为 "initials",可选:"404"、"mp"、"identicon"、"monsterid"、"wavatar"、"retro"、"robohash"、"blank"`,ADMIN_CONFIG_ITEM_EMOTION_CDN:`表情 CDN,英文逗号分隔。默认为:https://owo.imaegoo.com/owo.json`,ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS:`违禁词配置,包含违禁词的内容会直接标记为垃圾评论。英文逗号分隔。`,ADMIN_CONFIG_ITEM_BLOCKED_WORDS:`屏蔽词配置,包含屏蔽词的内容会直接评论失败。英文逗号分隔。`,ADMIN_CONFIG_ITEM_GRAVATAR_CDN:`自定义头像 CDN 地址。如:cn.gravatar.com, weavatar.com, cravatar.cn, sdn.geekzu.org, gravatar.loli.net,默认:weavatar.com`,ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT:`隐藏管理面板入口。可设置一个“暗号”,只有在“昵称”一栏输入相同的“暗号”时,管理面板入口才会显示,留空则不隐藏管理入口`,ADMIN_CONFIG_ITEM_QQ_API_KEY:`QQ昵称API密钥,用于获取QQ昵称。前往 https://api.tqq.me/dashboard/api-keys 获取`,ADMIN_CONFIG_ITEM_HIGHLIGHT:`启用代码高亮功能。如果您的主题和代码高亮有冲突,请设为 false。默认:true`,ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME:`代码高亮主题,可选:"default"、"coy"、"dark"、"funky"、"okaidia"、"solarizedlight"、"tomorrow"、"twilight",访问 https://prismjs.com 可预览主题效果。如果您的主题和代码高亮有冲突,请设为 none。默认:none`,ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN:`代码高亮插件,可选:"showLanguage"、"copyButton",分别表示:展示代码语言、展示代码拷贝按钮。可以同时设置多个选项,如果想要不添加任何代码高亮插件,请设为 none。默认:none。`,ADMIN_CONFIG_ITEM_IMAGE_CDN:`插入图片所使用的图床,目前支持:"qcloud"、"7bu (https://7bu.top)"、"see (https://s.ee)"、"lskypro"、"piclist"、"easyimage"、"chevereto"、"S3 / R2 / MinIO"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_URL:`图床的 URL,仅当 IMAGE_CDN 为 "lskypro" / "piclist" / "easyimage" / "chevereto" 时需要填写`,ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN:`图床 token。qcloud 图床无需设置`,ADMIN_CONFIG_ITEM_NSFW_API_URL:`NSFW 图片检测 API 地址。免费服务:nsfw.qixz.cn,项目:github.com/HG-ha/nsfwpy`,ADMIN_CONFIG_ITEM_NSFW_THRESHOLD:`NSFW 检测阈值(0-1),当检测分数高于此值时拒绝上传。默认:0.5`,ADMIN_CONFIG_ITEM_S3_REGION:`S3 存储区域,例如 us-east-1。使用兼容 S3 的服务(如 Cloudflare R2、MinIO)时可填任意值`,ADMIN_CONFIG_ITEM_S3_BUCKET:`S3 存储桶名称`,ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID:`S3 Access Key ID`,ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY:`S3 Secret Access Key`,ADMIN_CONFIG_ITEM_S3_ENDPOINT:`S3 自定义 Endpoint,使用 Cloudflare R2、MinIO 等兼容 S3 的服务时填写`,ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE:`设置 S3_ENDPOINT 时,是否将 S3_BUCKET 拼入上传地址路径。默认为 true,适用于 Cloudflare R2、MinIO 等 path-style S3 兼容端点;使用已绑定存储桶的自定义域名时设为 false,例如腾讯云 COS 自定义域名`,ADMIN_CONFIG_ITEM_S3_CDN_URL:`S3 图片访问域名(CDN 域名),留空则使用默认 S3/Endpoint URL`,ADMIN_CONFIG_ITEM_S3_PATH_PREFIX:`S3 图片存储路径前缀,例如 images/twikoo,留空则存储在根目录`,ADMIN_CONFIG_ITEM_LIGHTBOX:`使用简易图片点击放大效果。默认:false`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE:`单个 IP 发言频率限制(条/10分钟),0 为无限制,默认:10`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL:`全站发言频率限制(条/10分钟),0 为无限制,默认:10`,ADMIN_CONFIG_ITEM_LIMIT_LENGTH:`评论长度限制,0 为无限制,默认:500`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT:`自定义通知邮件主题,留空则使用默认主题。`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN:`自定义博主通知邮件主题,留空则使用默认主题。`,ADMIN_CONFIG_ITEM_MAIL_TEMPLATE:"自定义通知邮件模板,留空则使用默认模板。可包含的字段:${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${PARENT_NICK}, ${PARENT_COMMENT}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${REPLY_TIME}, ${POST_URL}, ${IMG}, ${PARENT_IMG}",ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN:"自定义博主通知邮件模板,留空则使用默认模板。可包含的字段:${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${POST_URL}, ${IP}, ${MAIL}, ${IMG}",ADMIN_CONFIG_ITEM_MASTER_TAG:`博主标识自定义文字,默认为 “博主”。`,ADMIN_CONFIG_ITEM_NOTIFY_SPAM:`垃圾评论是否发送通知,默认:true`,ADMIN_CONFIG_ITEM_HIDE_SPAM:`前台评论区对所有人隐藏垃圾评论,包括管理员和评论作者。评论管理后台仍可审核和恢复。设为 true 开启,默认:false。`,ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER:`人机验证码提供商`,ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY:`Turnstile 验证码的站点密钥。申请地址: https://dash.cloudflare.com/?to=/:account/turnstile`,ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY:`Turnstile 验证码的密钥`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID:`极验验证码的 Captcha ID。申请地址: https://console.geetest.com/sensbot/management`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY:`极验验证码的 Captcha Key`,ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT:`Cap 验证码 API 端点。留空则使用内嵌 Cap(无需额外部署);外部 Standalone 格式:https://<实例地址>/<site_key>/`,ADMIN_CONFIG_ITEM_CAP_SECRET_KEY:`Cap Secret Key(仅外部 Standalone 需要;内嵌模式可留空)`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID:`腾讯云 secret id,用于垃圾评论检测。同时设置腾讯云和 Akismet 时,只有腾讯云会生效。注册:https://twikoo.js.org/cms.html`,ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE:`腾讯云内容安全 Biztype 名称,用于垃圾评论策略。可以自定义垃圾拦截规则`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY:`腾讯云 secret key`,ADMIN_CONFIG_ITEM_JEV_API_KEY:`Jev API Key,用于 AI 垃圾评论检测。仅在未配置腾讯云和 Akismet 时生效,优先于 LLM。`,ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT:`Jev API 接口地址,默认:https://api.typesafe.ai/v1/systemone`,ADMIN_CONFIG_ITEM_JEV_MODEL:`Jev 模型名称,默认:jev-latest`,ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD:`Jev 垃圾评论概率阈值,范围 0 到 1,默认:0.85`,ADMIN_CONFIG_ITEM_LLM_API_KEY:`LLM API Key,用于 AI 垃圾评论检测。仅在未配置腾讯云、Akismet 和 Jev 时生效。`,ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT:`LLM API 接口地址,默认:https://api.deepseek.com/v1`,ADMIN_CONFIG_ITEM_LLM_MODEL:`LLM 模型名称,默认:deepseek-v4-pro`,ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON:`自定义请求体 JSON(可选),合并进 chat/completions 请求体,如 {"reasoning_effort":"none","temperature":0}。优先级高于内置参数。若 JSON 语法错误,将忽略此配置。仅覆盖请求体字段;端点、API Key、请求头和超时等传输字段将被忽略`,ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT:`LLM 垃圾检测提示词(可选,留空则使用默认提示词)`,ADMIN_CONFIG_ITEM_LLM_TIMEOUT:`LLM 单次请求超时(毫秒),默认 30000。超时会中止请求并按 LLM_MAX_RETRIES 重试;留空或无效值使用默认值`,ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES:`LLM 检测最大重试次数(默认 3 次)`,ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL:`即时消息推送平台名称,支持:"qmsg"、"serverchan"、"pushplus"、"dingtalk"、"wecom"、"bark"、"gocqhttp"、"atri"、"pushdeer"、"igot"、"telegram"、"feishu" 等`,ADMIN_CONFIG_ITEM_PUSHOO_TOKEN:`即时消息推送 token。请参考 https://pushoo.js.org 里的详细说明配置`,ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS:`界面上展示的输入框,默认:nick,mail,link`,ADMIN_CONFIG_ITEM_REQUIRED_FIELDS:`评论必填信息,设为 nick,mail,link 代表全必填,设为 none 代表全选填,默认:nick,mail`,ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY:`是否同时通过 IM 和邮件 2 种方式通知博主,默认只通过 IM 通知博主,默认:false`,ADMIN_CONFIG_ITEM_SENDER_EMAIL:`邮件通知邮箱地址。对于大多数邮箱服务商,SENDER_EMAIL 必须和 SMTP_USER 保持一致,否则无法发送邮件。`,ADMIN_CONFIG_ITEM_SENDER_NAME:`邮件通知标题。`,ADMIN_CONFIG_ITEM_SHOW_EMOTION:`启用插入表情功能,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_IMAGE:`启用插入图片功能,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_ORDER:`评论排序下拉框,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_DISLIKE:`评论点踩按钮,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_UA:`是否显示用户系统和浏览器,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_REGION:`是否显示用户 IP 属地到省,可能不准确,不支持 IPv6,默认为:false`,ADMIN_CONFIG_ITEM_SITE_NAME:`网站名称`,ADMIN_CONFIG_ITEM_SITE_URL:`网站地址`,ADMIN_CONFIG_ITEM_SMTP_HOST:`自定义 SMTP 服务器地址。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_PASS:`邮件通知邮箱密码,QQ、163邮箱请填写授权码。`,ADMIN_CONFIG_ITEM_SMTP_PORT:`自定义 SMTP 端口。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_SECURE:`自定义 SMTP 是否使用TLS,请填写 true 或 false。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_SERVICE:`邮件通知邮箱服务商。支持:"126"、"163"、"1und1"、"AOL"、"DebugMail"、"DynectEmail"、"FastMail"、"GandiMail"、"Gmail"、"Godaddy"、"GodaddyAsia"、"GodaddyEurope"、"Hotmail"、"Mail.ru"、"Maildev"、"Mailgun"、"Mailjet"、"Mailosaur"、"Mandrill"、"Naver"、"OpenMailBox"、"Outlook365"、"Postmark"、"QQ"、"QQex"、"SES"、"SES-EU-WEST-1"、"SES-US-EAST-1"、"SES-US-WEST-2"、"SendCloud"、"SendGrid"、"SendPulse"、"SendinBlue"、"Sparkpost"、"Yahoo"、"Yandex"、"Zoho"、"hot.ee"、"iCloud"、"mail.ee"、"qiye.aliyun"`,ADMIN_CONFIG_ITEM_SMTP_USER:`邮件通知邮箱用户名。`,ADMIN_CONFIG_RESET:`重置`,ADMIN_CONFIG_SAVE:`保存`,ADMIN_CONFIG_EXPORT:`导出配置`,ADMIN_CONFIG_IMPORT:`导入配置`,ADMIN_CONFIG_IMPORT_FAILED:`配置导入失败:`,ADMIN_CONFIG_IMPORT_INVALID:`配置文件格式不合法`,ADMIN_CONFIG_IMPORT_SOURCE_INVALID:`配置导入仅支持 Twikoo 导出的配置文件,请将「源系统」选择为 Twikoo`,ADMIN_CONFIG_IMPORTED:`配置导入成功`,ADMIN_CONFIG_IMPORTING:`正在导入配置`,ADMIN_CREDENTIALS:`私钥文件`,ADMIN_CREDENTIALS_FAQ:`如何获得私钥`,ADMIN_CREDENTIALS_PLACEHOLDER:`请粘贴私钥文件内容`,ADMIN_FORGOT:`忘记密码`,ADMIN_EXPORT:`导出`,ADMIN_EXPORT_WARN:`将全部数据导出为 JSON 文件。如果遇到评论较多、导出失败或缺失数据,请连接数据库手动导出`,ADMIN_EXPORT_COMMENT:`导出评论`,ADMIN_EXPORT_COUNTER:`导出访问量`,ADMIN_IMPORT:`导入`,ADMIN_IMPORT_FILE_REQUIRED:`未选择文件`,ADMIN_IMPORT_IMPORTED:`完成导入 `,ADMIN_IMPORT_IMPORTING:`开始导入 `,ADMIN_IMPORT_LOG:`日志`,ADMIN_IMPORT_SELECT:`请选择`,ADMIN_IMPORT_SELECT_FILE:`选择文件`,ADMIN_IMPORT_SELECT_SOURCE:`选择源系统`,ADMIN_IMPORT_SOURCE_REQUIRED:`未选择源系统`,ADMIN_IMPORT_START:`开始导入`,ADMIN_IMPORT_COMMENT:`导入评论`,ADMIN_IMPORT_STARTING:`开始导入`,ADMIN_IMPORT_TIP_ARTALK:`请上传 JSON 格式的 Artalk 导出文件,文件名通常为 comments.data.json`,ADMIN_IMPORT_TIP_DISQUS:`请上传 XML 格式的 Disqus 导出文件,文件名通常为 [网站名称]-[导出时间]-all.xml`,ADMIN_IMPORT_TIP_VALINE:`请上传 JSON 格式的 Valine 导出文件,文件名通常为 Comment.json`,ADMIN_IMPORT_UPLOADED:`上传完成 `,ADMIN_IMPORT_UPLOADING:`已上传 `,ADMIN_IMPORT_WARN:`支持从其他评论系统的备份文件导入评论。
171
+ 不要在匿名登录失败后自动回退到密码登录,这两种方式的使用场景不同。`)):(console.warn(`[CloudBase Auth] signInAnonymously 失败 [${a.category}]: ${a.message}`),a.loginMethodHint&&console.warn(a.loginMethodHint)),[2,{data:{user:null,session:null},error:a}];case 5:return[2]}})})},n.prototype.signUp=function(e){return H(this,void 0,Promise,function(){var t,n,r=this;return U(this,function(i){switch(i.label){case 0:return e.phone_number||e.verification_code||e.verification_token||e.provider_token?(e.phone_number&&=this.formatPhone(e.phone_number),[4,this.oauthInstance.authApi.signUp(e)]):[3,2];case 1:return i.sent(),[2,this.createLoginState()];case 2:return i.trys.push([2,4,,5]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`signUp`),[4,this.getVerification(e.email?{email:e.email,usage:c.EMAIL}:{phone_number:this.formatPhone(e.phone)})];case 3:return t=i.sent(),[2,{data:{verifyOtp:function(n){var i=n.token,a=n.messageId,o=a===void 0?t.verification_id:a;return H(r,void 0,Promise,function(){var n,r,a,s,c;return U(this,function(l){switch(l.label){case 0:return l.trys.push([0,8,,9]),[4,this.verify({verification_id:o||t.verification_id,verification_code:String(i)})];case 1:return n=l.sent(),t.is_user?[4,this.signIn({username:e.email||this.formatPhone(e.phone),verification_token:n.verification_token})]:[3,3];case 2:return l.sent(),[3,6];case 3:return delete(r=JSON.parse(JSON.stringify(e))).email,delete r.phone,[4,this.oauthInstance.authApi.signUp(B(B(B({},r),e.email?{email:e.email}:{phone_number:this.formatPhone(e.phone)}),{verification_token:n.verification_token,verification_code:i}))];case 4:return l.sent(),[4,this.createLoginState()];case 5:l.sent(),l.label=6;case 6:return[4,this.getSession()];case 7:return a=l.sent().data,[2,{data:{user:(s=(a===void 0?{}:a).session).user,session:s},error:null}];case 8:return c=l.sent(),[2,{data:{user:null,session:null},error:new I(c,{method:`signUp`})}];case 9:return[2]}})})}},error:null}];case 4:return n=i.sent(),[2,{data:{user:null,session:null},error:new I(n,{method:`signUp`})}];case 5:return[2]}})})},n.prototype.signOut=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),t=this.cache.keys.userInfoKey,[4,this.oauthInstance.authApi.signOut(e)];case 1:return n=i.sent(),[4,this.cache.removeStoreAsync(t)];case 2:return i.sent(),this.setAccessKey(),[2,B(B({},n),{data:{},error:null})];case 3:return r=i.sent(),[2,{data:{},error:new I(r,{method:`signOut`})}];case 4:return[2]}})})},n.prototype.onAuthStateChange=function(e){var t=this;this.hasListenerSetUp||=(this.setupListeners(),!0);var n=Math.random().toString(36);return this.listeners.has(n)||this.listeners.set(n,new Set),this.listeners.get(n).add(e),{data:{subscription:{id:n,callback:e,unsubscribe:function(){var r=t.listeners.get(n);r&&(r.delete(e),r.size===0&&t.listeners.delete(n))}}}}},n.prototype.signInWithPassword=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c;return U(this,function(l){switch(l.label){case 0:return l.trys.push([0,3,,4]),this.validateAtLeastOne(e,[[`username`],[`email`],[`phone`]],`signInWithPassword`),this.validateParams(e,{password:{required:!0,message:`Password is required`}},`signInWithPassword`),t=`username`in e?e.username:void 0,n=`email`in e?e.email:void 0,r=`phone`in e?e.phone:void 0,i=e.options?.is_encrypt??e.is_encrypt,[4,this.signIn(B({username:t||n||this.formatPhone(r),password:e.password},i?{isEncrypt:!0,version:`v2`}:{}))];case 1:return l.sent(),[4,this.getSession()];case 2:return a=l.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 3:return s=l.sent(),(c=new I(s,{method:`signInWithPassword`})).category===F.PROVIDER_NOT_ENABLED?console.error(c.helpMessage):c.category===F.INVALID_CREDENTIALS||c.category===F.USER_NOT_FOUND?console.warn(c.helpMessage):console.warn(`[CloudBase Auth] signInWithPassword 失败 [${c.category}]: ${c.message}`),c.loginMethodHint&&console.info(c.loginMethodHint),[2,{data:{user:null,session:null},error:c}];case 4:return[2]}})})},n.prototype.signInWithIdToken=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{token:{required:!0,message:`Token is required`}},`signInWithIdToken`),[4,this.signInWithProvider({provider_id:e.provider,provider_id_token:e.token})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`signInWithIdToken`})}];case 4:return[2]}})})},n.prototype.signInWithOtp=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o=this;return U(this,function(s){switch(s.label){case 0:if(t=e.options,n=`email`in e?e.email:void 0,r=`phone`in e?e.phone:void 0,!t?.emailRedirectTo&&(t?.shouldCreateUser===void 0||t?.shouldCreateUser))return[2,this.signUp(n?{email:n}:{phone:r})];s.label=1;case 1:return s.trys.push([1,3,,4]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`signInWithOtp`),[4,this.getVerification(B(B({email_redirect_to:t?.emailRedirectTo},n?{email:n,usage:c.EMAIL}:{phone_number:this.formatPhone(r)}),{target:t?.emailRedirectTo&&t?.shouldCreateUser?`ANY`:`USER`}))];case 2:return i=s.sent(),[2,{data:{user:null,session:null,verifyOtp:function(e){var t=e.token,a=e.messageId,s=a===void 0?i.verification_id:a;return H(o,void 0,Promise,function(){return U(this,function(e){return[2,this.verifyOtp(n?{email:n,token:String(t),messageId:s||``}:{phone:r,token:String(t),messageId:s||``})]})})}},error:null}];case 3:return a=s.sent(),[2,{data:{user:null,session:null},error:new I(a,{method:`signInWithOtp`})}];case 4:return[2]}})})},n.prototype.verifyOAuth=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l;return U(this,function(u){switch(u.label){case 0:t={},u.label=1;case 1:return u.trys.push([1,7,,8]),n=e?.code||ue(`code`),r=e?.state||ue(`state`),n?r?(i=function(e){try{return JSON.parse(sessionStorage.getItem(e))}catch(e){return console.error(`Failed to get browser session:`,e),null}}(r),t.type=i?.type,(a=e?.provider||i?.provider||ue(`provider`))?[4,this.grantProviderToken({provider_id:a,provider_redirect_uri:location.origin+location.pathname,provider_code:n})]:[2,{data:B(B({},t),{user:null,session:null,redirectUrl:null}),error:this.missingRequiredParam(`verifyOAuth`,`provider`)}]):[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam(`verifyOAuth`,`state`)}]:[2,{data:{user:null,session:null,redirectUrl:null},error:this.missingRequiredParam(`verifyOAuth`,`code`)}];case 2:return o=u.sent().provider_token,s=void 0,i.type===x?[4,this.oauthInstance.authApi.toBindIdentity({provider_token:o,provider:a,fireEvent:!0})]:[3,4];case 3:return s=u.sent(),[3,6];case 4:return[4,this.signInWithIdToken({token:o})];case 5:(s=u.sent()).data=B(B({},t),s.data),u.label=6;case 6:return(c=new URLSearchParams(location==null?void 0:location.search)).delete(`code`),c.delete(`state`),s.data.redirectUrl=function(e,t){if(e!==void 0){var n=new URL(window.location.href);return n.search=e,n.hash=t||n.hash,window.history.replaceState({},``,n.href),n.href}}(i?.search===void 0?`?${c.toString()}`:i?.search,i?.hash||location.hash),function(e){try{return sessionStorage.removeItem(e),!0}catch(e){return console.error(`Failed to remove browser session:`,e),null}}(r),[2,s];case 7:return l=u.sent(),[2,{data:B(B({},t),{user:null,session:null,redirectUrl:null}),error:new I(l,{method:`verifyOAuth`})}];case 8:return[2]}})})},n.prototype.signInWithOAuth=function(e){var t,n;return H(this,void 0,Promise,function(){var r,i,a,o,s,c,l,u,d;return U(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`signInWithOAuth`),r=e.options?.redirectTo||location.href,i=new URL(r),a=i.origin+i.pathname,o=e.options?.state||`prd-${e.provider}-${Math.random().toString(36).slice(2)}`,[4,this.genProviderRedirectUri({provider_id:e.provider,provider_redirect_uri:a,state:o})];case 1:return s=f.sent().uri,c=decodeURIComponent(s),l=c,(t=e.options)!=null&&t.queryParams&&(u=new URL(c),Object.entries(e.options.queryParams).forEach(function(e){var t=e[0],n=e[1];u.searchParams.set(t,n)}),l=u.toString()),function(e,t){try{sessionStorage.setItem(e,JSON.stringify(t))}catch(e){console.error(`Failed to save to browser session:`,e)}}(o,{provider:e.provider,search:i.search,hash:i.hash,type:e.options?.type||y}),Et()&&!((n=e.options)!=null&&n.skipBrowserRedirect)&&window.location.assign(l),[2,{data:{url:l,provider:e.provider},error:null}];case 2:return d=f.sent(),[2,{data:{url:null,provider:null},error:new I(d,{method:`signInWithOAuth`})}];case 3:return[2]}})})},n.prototype.getClaims=function(){return H(this,void 0,Promise,function(){var e;return U(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.getAccessToken()];case 1:return[2,{data:function(e){if(typeof e!=`string`)throw Error(`Invalid token specified`);try{var t=e.split(`.`).map(function(e,t){return t===2?e:JSON.parse(function(e){var t=e.replace(/-/g,`+`).replace(/_/g,`/`);switch(t.length%4){case 0:break;case 2:t+=`==`;break;case 3:t+=`=`;break;default:throw Error(`Illegal base64url string!`)}try{return function(e){return decodeURIComponent(k(e).replace(/(.)/g,function(e){var t=e.charCodeAt(0).toString(16).toUpperCase();return t.length<2&&(t=`0${t}`),`%${t}`}))}(t)}catch{return k(t)}}(e))});return{claims:t[1],header:t[0],signature:t[2]}}catch(e){throw Error(`Invalid token specified: ${e}`?e.message:0)}}(t.sent().accessToken),error:null}];case 2:return e=t.sent(),[2,{data:{claims:null,header:null,signature:null},error:new I(e,{method:`getClaims`})}];case 3:return[2]}})})},n.prototype.resetPasswordForEmail=function(e,t){return H(this,void 0,Promise,function(){var n,r,i,a,o,s,l=this;return U(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),this.validateParams({emailOrPhone:e},{emailOrPhone:{required:!0,message:`Email or phone is required`}},`resetPasswordForEmail`),n=(t||{}).redirectTo,r=e.includes(`@`),i=void 0,r?i={email:e,usage:c.RECOVERY}:(a=this.formatPhone(e),i={phone_number:a}),[4,this.getVerification(B(B({},i),{target:`USER`}))];case 1:return o=u.sent(),[2,{data:{updateUser:function(t){return H(l,void 0,Promise,function(){var i,a,s,c;return U(this,function(l){switch(l.label){case 0:this.validateParams(t,{nonce:{required:!0,message:`Nonce is required`},password:{required:!0,message:`Password is required`}},`resetPasswordForEmail`),l.label=1;case 1:return l.trys.push([1,5,,6]),[4,this.verify({verification_id:o.verification_id,verification_code:t.nonce})];case 2:return i=l.sent(),[4,this.oauthInstance.authApi.resetPassword({email:r?e:void 0,phone_number:r?void 0:e,new_password:t.password,verification_token:i.verification_token})];case 3:return l.sent(),(c=this.config.eventBus)==null||c.fire(v,{event:`PASSWORD_RECOVERY`}),[4,this.signInWithPassword({email:r?e:void 0,phone:r?void 0:e,password:t.password})];case 4:return a=l.sent(),n&&Et()&&window.location.assign(n),[2,a];case 5:return s=l.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`resetPasswordForEmail`})}];case 6:return[2]}})})}},error:null}];case 2:return s=u.sent(),[2,{data:{updateUser:null},error:new I(s,{method:`resetPasswordForEmail`})}];case 3:return[2]}})})},n.prototype.resetPasswordForOld=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.authApi.updatePasswordByOld({old_password:e.old_password,new_password:e.new_password})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`resetPasswordForOld`})}];case 4:return[2]}})})},n.prototype.verifyOtp=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a,o,s;return U(this,function(c){switch(c.label){case 0:return c.trys.push([0,6,,7]),t=e.type,n=String(e.token),r=`email`in e?e.email:void 0,i=`phone`in e?e.phone:void 0,this.validateParams(e,{token:{required:!0,message:`Token is required`},messageId:{required:!0,message:`messageId is required`}},`verifyOtp`),[`phone_change`,`email_change`].includes(t)?[4,this.verify({verification_id:e.messageId,verification_code:n})]:[3,2];case 1:return c.sent(),[3,4];case 2:return[4,this.signInWithUsername({verificationInfo:{verification_id:e.messageId,is_user:!0},verificationCode:n,username:r||this.formatPhone(i)||``,loginType:r?`email`:`phone`})];case 3:c.sent(),c.label=4;case 4:return[4,this.getSession()];case 5:return a=c.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 6:return s=c.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`verifyOtp`})}];case 7:return[2]}})})},n.prototype.getSession=function(){return H(this,void 0,Promise,function(){var e,t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(e=i.sent())&&e.scope!==`accessKey`?[4,this.getUser(!1)]:[2,{data:{session:null,user:null},error:null}];case 2:return t=i.sent().data,n=(t===void 0?{}:t).user,[2,{data:{session:B(B({},e),{user:n}),user:n},error:null}];case 3:return r=i.sent(),[2,{data:{session:null,user:null},error:new I(r,{method:`getSession`})}];case 4:return[2]}})})},n.prototype.refreshSession=function(e){return H(this,void 0,Promise,function(){var t,n,r,i,a;return U(this,function(o){switch(o.label){case 0:return o.trys.push([0,4,,5]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return(t=o.sent()).refresh_token=e||t.refresh_token,[4,this.oauthInstance.oauth2client.refreshToken(t)];case 2:return n=o.sent(),[4,this.getUser(!1)];case 3:return r=o.sent().data,[2,{data:{user:i=(r===void 0?{}:r).user,session:B(B({},n),{user:i})},error:null}];case 4:return a=o.sent(),[2,{data:{user:null,session:null},error:new I(a,{method:`refreshSession`})}];case 5:return[2]}})})},n.prototype.getUser=function(e){return e===void 0&&(e=!0),H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,this.oauthInstance.oauth2client.getCredentials()];case 1:return(t=i.sent())&&t.scope!==`accessKey`?(n=this.convertToUser,[4,this.getCurrentUser(e)]):[2,{data:{user:null},error:null}];case 2:return[2,{data:{user:n.apply(this,[i.sent()])},error:null}];case 3:return r=i.sent(),[2,{data:{user:null},error:new I(r,{method:`getUser`})}];case 4:return[2]}})})},n.prototype.refreshUser=function(){return H(this,void 0,Promise,function(){var e,t,n;return U(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),[4,this.currentUser.refresh()];case 1:return r.sent(),[4,this.getSession()];case 2:return e=r.sent().data,[2,{data:{user:(t=(e===void 0?{}:e).session).user,session:t},error:null}];case 3:return n=r.sent(),[2,{data:{user:null,session:null},error:new I(n,{method:`refreshUser`})}];case 4:return[2]}})})},n.prototype.updateUser=function(e){var t;return H(this,void 0,Promise,function(){var n,r,i,a,o,s,l,u,d,f,p,m,g,_=this;return U(this,function(y){switch(y.label){case 0:if(y.trys.push([0,8,,9]),At(e,`updateUser`),n=[`password`,`new_password`].find(function(t){var n=e[t];return n!=null&&n!==``}))throw new I({message:`updateUser 不支持更新密码,检测到传入了 "${n}" 参数。如需修改密码请使用 resetPasswordForOld(旧密码修改)、resetPasswordForEmail(验证码重置)或 reauthenticate(重新认证后改密)`});if(!Object.keys(e).some(function(t){return e[t]!==void 0&&e[t]!==null&&e[t]!==``}))throw this.missingRequiredParam(`updateUser`,`(at least one field)`);return r=e.email,i=e.phone,a=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(e,[`email`,`phone`]),s=i!==void 0,l={},(o=r!==void 0)||s?(u=void 0,o?(u={email:e.email,usage:c.REAUTHENTICATION},d=`email_change`):(f=this.formatPhone(e.phone),u={phone_number:f},d=`phone_change`),[4,this.getVerification(B({},u))]):[3,4];case 1:return p=y.sent(),Object.keys(a).length>0?[4,this.updateUserBasicInfo(a)]:[3,3];case 2:y.sent(),y.label=3;case 3:return l={messageId:p.verification_id,verifyOtp:function(t){return H(_,void 0,Promise,function(){var n,r,i,a;return U(this,function(s){switch(s.label){case 0:return s.trys.push([0,11,,12]),t.email&&e.email===t.email?[4,this.verifyOtp({type:`email_change`,email:e.email,token:t.token,messageId:p.verification_id||``})]:[3,3];case 1:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({email:e.email})];case 2:return s.sent(),[3,9];case 3:return t.phone&&e.phone===t.phone?[4,this.verifyOtp({type:`phone_change`,phone:e.phone,token:t.token,messageId:p.verification_id||``})]:[3,6];case 4:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo({phone:this.formatPhone(e.phone)})];case 5:return s.sent(),[3,9];case 6:return[4,this.verifyOtp(o?{type:d,email:e.email,token:t.token,messageId:p.verification_id||``}:{type:d,phone:e.phone,token:t.token,messageId:p.verification_id||``})];case 7:return(n=s.sent()).error?[2,n]:[4,this.updateUserBasicInfo(e)];case 8:s.sent(),s.label=9;case 9:return[4,this.getUser(!1)];case 10:return r=s.sent().data.user,(a=this.config.eventBus)==null||a.fire(v,{event:h}),[2,{data:{user:r},error:null}];case 11:return i=s.sent(),[2,{data:{user:null},error:new I(i,{method:`updateUser`})}];case 12:return[2]}})})}},[3,6];case 4:return[4,this.updateUserBasicInfo(e)];case 5:y.sent(),y.label=6;case 6:return[4,this.getUser(!1)];case 7:return m=y.sent().data.user,Object.keys(a).length>0&&((t=this.config.eventBus)==null||t.fire(v,{event:h})),[2,{data:B({user:m},l),error:null}];case 8:return g=y.sent(),[2,{data:{user:null},error:new I(g,{method:`updateUser`})}];case 9:return[2]}})})},n.prototype.getUserIdentities=function(){return H(this,void 0,Promise,function(){var e,t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.oauthInstance.authApi.getProviders()];case 1:return e=n.sent(),[2,{data:{identities:(e?.data)?.filter(function(e){return!!e.bind})},error:null}];case 2:return t=n.sent(),[2,{data:{identities:null},error:new I(t,{method:`getUserIdentities`})}];case 3:return[2]}})})},n.prototype.linkIdentity=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`linkIdentity`),[4,this.signInWithOAuth({provider:e.provider,options:{type:x}})];case 1:return n.sent(),[2,{data:{provider:e.provider},error:null}];case 2:return t=n.sent(),[2,{data:{provider:null},error:new I(t,{method:`linkIdentity`})}];case 3:return[2]}})})},n.prototype.unlinkIdentity=function(e){return H(this,void 0,Promise,function(){var t;return U(this,function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),this.validateParams(e,{provider:{required:!0,message:`Provider is required`}},`unlinkIdentity`),[4,this.oauthInstance.authApi.unbindProvider({provider_id:e.provider})];case 1:return n.sent(),[2,{data:{},error:null}];case 2:return t=n.sent(),[2,{data:{},error:new I(t,{method:`unlinkIdentity`})}];case 3:return[2]}})})},n.prototype.reauthenticate=function(){return H(this,void 0,Promise,function(){var e,t,n,r,i=this;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),[4,this.getUser(!1)];case 1:return e=a.sent().data.user,this.validateAtLeastOne(e,[[`email`,`phone`]],`reauthenticate`),t=e.email?{email:e.email,usage:c.REAUTHENTICATION}:{phone_number:this.formatPhone(e.phone)},[4,this.getVerification(t)];case 2:return n=a.sent(),[2,{data:{updateUser:function(e){return H(i,void 0,Promise,function(){var r,i,a,o,s;return U(this,function(c){switch(c.label){case 0:this.validateParams(e,{nonce:{required:!0,message:`Nonce is required`}},`reauthenticate`),c.label=1;case 1:return c.trys.push([1,9,,10]),e.password?[4,this.verify({verification_id:n.verification_id,verification_code:e.nonce})]:[3,5];case 2:return r=c.sent(),[4,this.oauthInstance.authApi.sudo({verification_token:r.verification_token})];case 3:return i=c.sent(),[4,this.oauthInstance.authApi.setPassword({new_password:e.password,sudo_token:i.sudo_token})];case 4:return c.sent(),[3,7];case 5:return[4,this.signInWithUsername(B(B({verificationInfo:n,verificationCode:e.nonce},t),{loginType:t.email?`email`:`phone`}))];case 6:c.sent(),c.label=7;case 7:return[4,this.getSession()];case 8:return a=c.sent().data,[2,{data:{user:(o=(a===void 0?{}:a).session).user,session:o},error:null}];case 9:return s=c.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`reauthenticate`})}];case 10:return[2]}})})}},error:null}];case 3:return r=a.sent(),[2,{data:{updateUser:null},error:new I(r,{method:`reauthenticate`})}];case 4:return[2]}})})},n.prototype.resend=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.validateAtLeastOne(e,[[`email`],[`phone`]],`resend`),t=e.type===`signup`?`ANY`:`USER`,n={target:t},`email`in e&&(n.email=e.email,n.usage=c.EMAIL),`phone`in e&&(n.phone_number=this.formatPhone(e.phone)),[4,this.oauthInstance.authApi.getVerification(n)];case 1:return[2,{data:{messageId:i.sent().verification_id},error:null}];case 2:return r=i.sent(),[2,{data:{messageId:null},error:new I(r,{method:`resend`})}];case 3:return[2]}})})},n.prototype.setSession=function(e){return H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),this.validateParams(e,{access_token:{required:!0,message:`Access token is required`},refresh_token:{required:!0,message:`Refresh token is required`}},`setSession`),[4,this.oauthInstance.oauth2client.refreshToken(e,{throwError:!0})];case 1:return i.sent(),[4,this.getSession()];case 2:return t=i.sent().data,[2,{data:{user:(n=(t===void 0?{}:t).session).user,session:n},error:null}];case 3:return r=i.sent(),[2,{data:{user:null,session:null},error:new I(r,{method:`setSession`})}];case 4:return[2]}})})},n.prototype.exchangeCodeForSession=function(){return H(this,void 0,void 0,function(){return U(this,function(e){return[2]})})},n.prototype.deleteUser=function(e){return H(this,void 0,Promise,function(){var t,n;return U(this,function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),this.validateParams(e,{password:{required:!0,message:`Password is required`}},`deleteUser`),[4,this.oauthInstance.authApi.sudo(e)];case 1:return t=r.sent().sudo_token,[4,this.oauthInstance.authApi.deleteMe({sudo_token:t})];case 2:return r.sent(),[2,{data:{},error:null}];case 3:return n=r.sent(),[2,{data:{},error:new I(n,{method:`deleteUser`})}];case 4:return[2]}})})},n.prototype.toDefaultLoginPage=function(e){return e===void 0&&(e={}),H(this,void 0,Promise,function(){var t,n,r,i,a;return U(this,function(o){try{return t=e.config_version||`env`,n=Object.keys(e.query||{}).map(function(t){return`${t}=${e.query[t]}`}).join(`&`),ct.default.isMatch()?wx.navigateTo({url:`/packages/$wd_system/pages/login/index${n?`?${n}`:``}`}):(r=e.redirect_uri||window.location.href,i=new URL(r),a=`${i.origin}/__auth/?app_id=${e.app_id||``}&env_id=${this.config.env}&client_id=${this.config.clientId||this.config.env}&config_version=${t}&redirect_uri=${encodeURIComponent(r)}${n?`&${n}`:``}`,window.location.href=a),[2,{data:{},error:null}]}catch(e){return[2,{data:{},error:new I(e,{method:`toDefaultLoginPage`})}]}})})},n.prototype.signInWithCustomTicket=function(e){return H(this,void 0,Promise,function(){var t,n,r,i;return U(this,function(a){switch(a.label){case 0:e&&this.setCustomSignFunc(e),a.label=1;case 1:return a.trys.push([1,5,,6]),[4,this.oauthInstance.authApi.signInWithCustomTicket()];case 2:return a.sent(),[4,this.createLoginState()];case 3:return t=a.sent(),[4,this.getSession()];case 4:return n=a.sent().data,r=(n===void 0?{}:n).session,[2,B(B({},t),{data:{user:r.user,session:r},error:null})];case 5:return i=a.sent(),[2,{data:{user:null,session:null},error:new I(i,{method:`signInWithCustomTicket`})}];case 6:return[2]}})})},n.prototype.signInWithOpenId=function(e){var t=(e===void 0?{}:e).useWxCloud,n=t===void 0||t;return H(this,void 0,Promise,function(){var e,t,r,i,a,o,s=this;return U(this,function(c){switch(c.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);e=wx.getAccountInfoSync().miniProgram,t=function(t){return H(s,void 0,void 0,function(){var r,i;return U(this,function(a){switch(a.label){case 0:r=void 0,i=void 0,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:t,provider_params:{provider_code_type:`open_id`,appid:e?.appId}},n)];case 2:if((r=a.sent())?.error_code||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:r.provider_token},n)];case 3:if((i=a.sent())?.error_code)throw i;return[3,5];case 4:throw a.sent();case 5:return[4,this.oauthInstance.oauth2client.setCredentials(i)];case 6:return a.sent(),[2]}})})},c.label=1;case 1:return c.trys.push([1,5,,6]),[4,new Promise(function(e,n){wx.login({success:function(r){return H(s,void 0,void 0,function(){var i;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t(r.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return i=a.sent(),n(i),[3,3];case 3:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,n(t)}})})];case 2:return c.sent(),[4,this.createLoginState()];case 3:return r=c.sent(),[4,this.getSession()];case 4:return i=c.sent().data,a=(i===void 0?{}:i).session,[2,B(B({},r),{data:{user:a.user,session:a},error:null})];case 5:return o=c.sent(),[2,{data:{user:null,session:null},error:new I(o,{method:`signInWithOpenId`})}];case 6:return[2]}})})},n.prototype.signInWithPhoneAuth=function(e){var t=e.phoneCode,n=t===void 0?``:t,r=e.useWxCloud,i=r!==void 0&&r;return H(this,void 0,Promise,function(){var e,t,r,a,o,s,c,l,u;return U(this,function(d){switch(d.label){case 0:return ct.default.isMatch()?(e=wx.getAccountInfoSync().miniProgram,t={provider_params:{provider_code_type:`phone`,code:n,appid:e.appId},provider_id:e.appId},[4,wx.login()]):[2,{data:{user:null,session:null},error:new I({message:`wx api undefined`})}];case 1:r=d.sent().code,t.provider_code=r,d.label=2;case 2:return d.trys.push([2,5,,6]),[4,this.oauthInstance.authApi.grantProviderToken(t,i)];case 3:if((a=d.sent()).error_code)throw a;return[4,this.oauthInstance.authApi.signInWithProvider({provider_token:a.provider_token},i)];case 4:if((o=d.sent())?.error_code)throw o;return[3,6];case 5:return s=d.sent(),[2,{data:{user:null,session:null},error:new I(s,{method:`signInWithPhoneAuth`})}];case 6:return[4,this.createLoginState()];case 7:return c=d.sent(),[4,this.getSession()];case 8:return l=d.sent().data,u=(l===void 0?{}:l).session,[2,B(B({},c),{data:{user:u.user,session:u},error:null})]}})})},n.prototype.bindPhoneNumber=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.editContact(e)]})})},n.prototype.unbindProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.unbindProvider(e)]})})},n.prototype.bindEmail=function(e){return this.oauthInstance.authApi.editContact(e)},n.prototype.verify=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.verify(e)]})})},n.prototype.getVerification=function(e,t){return H(this,void 0,Promise,function(){return U(this,function(n){return e.phone_number&&=this.formatPhone(e.phone_number),[2,this.oauthInstance.authApi.getVerification(e,t)]})})},Object.defineProperty(n.prototype,"currentUser",{get:function(){if(this.cache.mode!==`async`){var e=this.hasLoginState();return e&&e.user||null}(0,Ie.printWarn)(z.ERRORS.INVALID_OPERATION,`current platform's storage is asynchronous, please use getCurrentUser instead`)},enumerable:!1,configurable:!0}),n.prototype.getCurrentUser=function(e){return e===void 0&&(e=!0),H(this,void 0,Promise,function(){var t,n,r;return U(this,function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e?[4,this.getLoginState()]:[3,3];case 1:return(t=i.sent())?[4,t.user.refresh()]:[3,3];case 2:i.sent(),i.label=3;case 3:return[3,5];case 4:return i.sent(),[3,5];case 5:return[4,this.getLoginState()];case 6:return(n=i.sent())?(r=n.user.getLocalUserInfo(),[4,n.user.checkLocalInfoAsync()]):[3,8];case 7:return i.sent(),[2,B(B({},n.user),r)];case 8:return[2,null]}})})},n.prototype.signInAnonymouslyInWx=function(e){var t=(e===void 0?{}:e).useWxCloud;return H(this,void 0,Promise,function(){var e,n,r=this;return U(this,function(i){switch(i.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);return e=wx.getAccountInfoSync().miniProgram,n=function(n){return H(r,void 0,void 0,function(){var r,i;return U(this,function(a){switch(a.label){case 0:r=void 0,i=void 0,a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:n,provider_params:{provider_code_type:`open_id`,appid:e?.appId}},t)];case 2:if((r=a.sent())?.error_code||!r.provider_token)throw r;return[4,this.oauthInstance.authApi.signInAnonymously({provider_token:r.provider_token},t)];case 3:if((i=a.sent())?.error_code)throw i;return[3,5];case 4:throw a.sent();case 5:return[2]}})})},[4,new Promise(function(e,t){wx.login({success:function(i){return H(r,void 0,void 0,function(){var r;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,n(i.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return r=a.sent(),t(r),[3,3];case 3:return[2]}})})},fail:function(e){var n=Error(e?.errMsg);n.code=e?.errno,t(n)}})})];case 1:return i.sent(),[2,this.createLoginState(void 0,{asyncRefreshUser:!0})]}})})},n.prototype.bindOpenId=function(){return H(this,void 0,Promise,function(){var e,t,n=this;return U(this,function(r){switch(r.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);return e=wx.getAccountInfoSync().miniProgram,t=function(t){return H(n,void 0,void 0,function(){var n;return U(this,function(r){switch(r.label){case 0:n=void 0,r.label=1;case 1:return r.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_id:e?.appId,provider_code:t,provider_params:{provider_code_type:`open_id`,appid:e?.appId}})];case 2:if((n=r.sent())?.error_code||!n.provider_token)throw n;return[4,this.oauthInstance.authApi.bindWithProvider({provider_token:n.provider_token})];case 3:return r.sent(),[3,5];case 4:throw r.sent();case 5:return[2]}})})},[4,new Promise(function(e,r){wx.login({success:function(i){return H(n,void 0,void 0,function(){var n;return U(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t(i.code)];case 1:return a.sent(),e(!0),[3,3];case 2:return n=a.sent(),r(n),[3,3];case 3:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,r(t)}})})];case 1:return r.sent(),[2]}})})},n.prototype.signInWithUnionId=function(){return H(this,void 0,Promise,function(){var e=this;return U(this,function(t){switch(t.label){case 0:if(!ct.default.isMatch())throw Error(`wx api undefined`);t.label=1;case 1:return t.trys.push([1,3,,4]),[4,new Promise(function(t,n){var r=wx.getAccountInfoSync().miniProgram;wx.login({success:function(i){return H(e,void 0,void 0,function(){var e,a,o,s,c;return U(this,function(l){switch(l.label){case 0:e=r?.appId,l.label=1;case 1:return l.trys.push([1,4,,5]),[4,this.oauthInstance.authApi.grantProviderToken({provider_code:i.code,provider_id:e,provider_params:{provider_code_type:`union_id`,appid:r?.appId}})];case 2:return a=l.sent(),(o=a.provider_token)?[4,this.oauthInstance.authApi.signInWithProvider({provider_id:e,provider_token:o})]:(n(a),[2]);case 3:return(s=l.sent())?.error_code?(n(s),[2]):(t(!0),[3,5]);case 4:return c=l.sent(),n(c),[3,5];case 5:return[2]}})})},fail:function(e){var t=Error(e?.errMsg);t.code=e?.errno,n(t)}})})];case 2:return t.sent(),[3,4];case 3:throw t.sent();case 4:return[2,this.createLoginState()]}})})},n.prototype.signInWithSms=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.phoneNum,o=a===void 0?``:a,s=e.bindInfo,c=s===void 0?void 0:s;return H(this,void 0,Promise,function(){return U(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:i,bindInfo:c,username:o,loginType:`sms`})]}catch(e){throw e}})})},n.prototype.signInWithEmail=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.bindInfo,o=a===void 0?void 0:a,s=e.email,c=s===void 0?``:s;return H(this,void 0,Promise,function(){return U(this,function(e){try{return[2,this.signInWithUsername({verificationInfo:n,verificationCode:i,bindInfo:o,username:c,loginType:`email`})]}catch(e){throw e}})})},n.prototype.setCustomSignFunc=function(e){this.oauthInstance.authApi.setCustomSignFunc(e)},n.prototype.signIn=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signIn(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.setPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.setPassword(e)]})})},n.prototype.isUsernameRegistered=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return typeof e!=`string`&&(0,Ie.throwError)(z.ERRORS.INVALID_PARAMS,`username must be a string`),[4,this.oauthInstance.authApi.checkIfUserExist({username:e})];case 1:return[2,t.sent().exist]}})})},n.prototype.hasLoginState=function(){if(this.cache.mode!==`async`)return this.oauthInstance?.authApi.hasLoginStateSync()?new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance}):null;(0,Ie.printWarn)(z.ERRORS.INVALID_OPERATION,`current platform's storage is asynchronous, please use getLoginState instead`)},n.prototype.getLoginState=function(){return H(this,void 0,Promise,function(){var e;return U(this,function(t){switch(t.label){case 0:e=null,t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.oauthInstance.authApi.getLoginState()];case 2:return e=t.sent(),[3,4];case 3:return t.sent(),[2,null];case 4:return e?[2,new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})]:[2,null]}})})},n.prototype.getUserInfo=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.getCurrentUser()]})})},n.prototype.getWedaUserInfo=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getWedaUserInfo()]})})},n.prototype.updateUserBasicInfo=function(e){return H(this,void 0,void 0,function(){var t;return U(this,function(n){switch(n.label){case 0:return[4,this.getLoginState()];case 1:return(t=n.sent())?[4,t.user.updateUserBasicInfo(e)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},n.prototype.getAuthHeader=function(){return console.error(`Auth.getAuthHeader API 已废弃`),{}},n.prototype.bindWithProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.bindWithProvider(e)]})})},n.prototype.queryUser=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.queryUserProfile(e)]})})},n.prototype.getAccessToken=function(){return H(this,void 0,Promise,function(){return U(this,function(e){switch(e.label){case 0:return[4,this.oauthInstance.oauth2client.getAccessToken()];case 1:return[2,{accessToken:e.sent(),env:this.config.env}]}})})},n.prototype.grantProviderToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.grantProviderToken(e)]})})},n.prototype.patchProviderToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.patchProviderToken(e)]})})},n.prototype.signInWithProvider=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithProvider(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.signInWithWechat=function(e){return e===void 0&&(e={}),H(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.signInWithWechat(e)];case 1:return t.sent(),[2,this.createLoginState(e)]}})})},n.prototype.grantToken=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.authApi.grantToken(e)];case 1:return t.sent(),[2,this.createLoginState()]}})})},n.prototype.genProviderRedirectUri=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.genProviderRedirectUri(e)]})})},n.prototype.resetPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.resetPassword(e)]})})},n.prototype.deviceAuthorize=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.deviceAuthorize(e)]})})},n.prototype.sudo=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.sudo(e)]})})},n.prototype.deleteMe=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.deleteMe(e)]})})},n.prototype.getProviders=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getProviders()]})})},n.prototype.loginScope=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.loginScope()]})})},n.prototype.loginGroups=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.loginGroups()]})})},n.prototype.onLoginStateChanged=function(e){var t;return H(this,void 0,void 0,function(){var n,r=this;return U(this,function(i){switch(i.label){case 0:return(t=this.config.eventBus)==null||t.on(_,function(t){return H(r,void 0,void 0,function(){var n,r;return U(this,function(i){switch(i.label){case 0:return t?.data?.eventType===u?[3,2]:[4,this.getLoginState()];case 1:return r=i.sent(),[3,3];case 2:r={},i.label=3;case 3:return n=r,e.call(this,B(B({},t),n)),[2]}})})}),[4,this.getLoginState()];case 1:return n=i.sent(),e.call(this,n),[2]}})})},n.prototype.refreshTokenForce=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.refreshTokenForce(e)]})})},n.prototype.getCredentials=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getCredentials()]})})},n.prototype.setCredentials=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){switch(t.label){case 0:return[4,this.oauthInstance.oauth2client.setCredentials(e)];case 1:return t.sent(),[2]}})})},n.prototype.getProviderSubType=function(){return H(this,void 0,Promise,function(){return U(this,function(e){return[2,this.oauthInstance.authApi.getProviderSubType()]})})},n.prototype.createCaptchaData=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.createCaptchaData(e)]})})},n.prototype.verifyCaptchaData=function(e){return H(this,void 0,void 0,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.verifyCaptchaData(e)]})})},n.prototype.getMiniProgramQrCode=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramCode(e)]})})},n.prototype.getMiniProgramQrCodeStatus=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getMiniProgramQrCodeStatus(e)]})})},n.prototype.modifyPassword=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.modifyPassword(e)]})})},n.prototype.modifyPasswordWithoutLogin=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.modifyPasswordWithoutLogin(e)]})})},n.prototype.getUserBehaviorLog=function(e){return H(this,void 0,Promise,function(){return U(this,function(t){return[2,this.oauthInstance.authApi.getUserBehaviorLog(e)]})})},n.prototype.signInWithUsername=function(e){var t=e.verificationInfo,n=t===void 0?{verification_id:``,is_user:!1}:t,r=e.verificationCode,i=r===void 0?``:r,a=e.username,o=a===void 0?``:a,s=e.bindInfo,c=s===void 0?void 0:s,l=e.loginType,u=l===void 0?``:l;return H(this,void 0,Promise,function(){var e,t,r,a,s,l,d;return U(this,function(f){switch(f.label){case 0:return f.trys.push([0,8,,9]),[4,this.oauthInstance.authApi.verify({verification_id:n.verification_id,verification_code:i})];case 1:if((e=f.sent())?.error_code)throw e;return t=e.verification_token,r=this.formatPhone(o),a={phone_number:r},u===`email`&&(a={email:r=o}),n.is_user?[4,this.oauthInstance.authApi.signIn({username:r,verification_token:t})]:[3,5];case 2:if((s=f.sent())?.error_code)throw s;return c?[4,this.oauthInstance.authApi.bindWithProvider({provider_token:c?.providerToken})]:[3,4];case 3:if((l=f.sent())?.error_code)throw l;f.label=4;case 4:return[3,7];case 5:return[4,this.oauthInstance.authApi.signUp(B(B({},a),{verification_token:t,provider_token:c?.providerId}))];case 6:if((d=f.sent())?.error_code)throw d;f.label=7;case 7:return[2,this.createLoginState()];case 8:throw f.sent();case 9:return[2]}})})},n.prototype.createLoginState=function(e,t){return H(this,void 0,Promise,function(){var n;return U(this,function(r){switch(r.label){case 0:return[4,(n=new Nt({envId:this.config.env,cache:this.cache,oauthInstance:this.oauthInstance})).checkLocalStateAsync()];case 1:return r.sent(),t?.userInfo?(n.user.setLocalUserInfo(t.userInfo),[3,5]):[3,2];case 2:return t?.asyncRefreshUser?(n.user.refresh(e),[3,5]):[3,3];case 3:return[4,n.user.refresh(e)];case 4:r.sent(),r.label=5;case 5:return[2,n]}})})},n.prototype.setAccessKey=function(){var e,t;return H(this,void 0,void 0,function(){var n,r;return U(this,function(i){if(n=``,r=``,this.config.accessKey?(n=this.config.accessKey,r=`accessKey`):(e=this.config.auth)!=null&&e.secretId&&(t=this.config.auth)!=null&&t.secretKey&&(n=``,r=S),!r)return[2];try{this.oauthInstance.oauth2client.setAccessKeyCredentials({access_token:n,token_type:`Bearer`,scope:r,expires_at:new Date(+new Date+ +new Date),expires_in:+new Date+ +new Date})}catch(e){console.warn(`accessKey error: `,e)}return[2]})})},n.prototype.formatPhone=function(e){return!/\s+/.test(e)&&/^\+\d{1,3}\d+/.test(e)?e.replace(/^(\+\d{1,2})(\d+)$/,`$1 $2`):/^\+\d{1,3}\s+/.test(e)?e:`+86 ${e}`},n.prototype.notifyListeners=function(e,t,n){this.listeners.forEach(function(r){r.forEach(function(r){try{r(e,t,n)}catch(e){console.error(`Error in auth state change callback:`,e)}})})},n.prototype.setupListeners=function(){var e,t=this;(e=this.config.eventBus)==null||e.on(v,function(e){return H(t,void 0,void 0,function(){var t,n,r,i,a;return U(this,function(o){switch(o.label){case 0:return t=e?.data?.event,n=e?.data?.info,t!==f||n?[3,2]:[4,this.getUser(!0)];case 1:r=o.sent().data,(i=(r===void 0?{}:r).user)&&(n={user:i}),o.label=2;case 2:return[4,this.getSession()];case 3:return a=o.sent().data.session,this.notifyListeners(t,a,n),[2]}})})})},n.prototype.convertToUser=function(e){var t;if(!e)return null;var n=e?.email||``,r=e?.phone_number||``,i=e?.sub||e?.uid||``;return{id:i,aud:`authenticated`,role:((t=e.groups)?.map)?.call(t,function(e){return typeof e==`string`?e:e.id}),email:n||``,email_confirmed_at:(e?.email_verified,e.created_at),phone:r,phone_confirmed_at:r?e.created_at:void 0,confirmed_at:e.created_at,last_sign_in_at:e.last_sign_in_at,app_metadata:{provider:e.loginType?.toLowerCase()||`cloudbase`,providers:[e.loginType?.toLowerCase()||`cloudbase`]},user_metadata:{name:e?.name,picture:e?.picture,username:e?.username,gender:e?.gender,locale:e?.locale,uid:e.uid,nickName:e.nickName||e?.name,avatarUrl:e.avatarUrl||e.picture,location:e.location,hasPassword:e.hasPassword??e.password===`SET`,open_id:e?.open_id},identities:(e?.providers)?.map(function(t){return{id:t.id||``,identity_id:t.id||``,user_id:i,identity_data:{provider_id:t.id,provider_user_id:t.provider_user_id,name:t.name},provider:t.id||`cloudbase`,created_at:e.created_at,updated_at:e.updated_at,last_sign_in_at:e.last_sign_in_at}})||[],created_at:e.created_at,updated_at:e.updated_at,is_anonymous:e.name===`anonymous`}},n.prototype.missingRequiredParam=function(e,t){return new I({error:`missing_required_param`,error_code:4e3,error_description:`auth.${e}(params): missing required param '${t}'`},{method:e})},n.prototype.validateParams=function(e,t,n){for(var r=0,i=Object.entries(t);r<i.length;r++){var a=i[r],o=a[0];if(a[1].required&&(e?.[o]===void 0||e?.[o]===null||e?.[o]===``))throw this.missingRequiredParam(n,o)}},n.prototype.validateAtLeastOne=function(e,t,n){if(!t.some(function(t){return t.some(function(t){return e?.[t]!==void 0&&e?.[t]!==null&&e?.[t]!==``})}))throw this.missingRequiredParam(n,t.map(function(e){return e.join(`|`)}).join(`|`))},n.prototype.init=function(){var e;return H(this,void 0,Promise,function(){return U(this,function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,this.oauthInstance.oauth2client.localCredentials.getCredentials()];case 1:return t.sent()&&!this.oauthInstance.oauth2client.initSessionEmitted&&((e=this.config.eventBus)==null||e.fire(v,{event:p})),[3,3];case 2:return t.sent(),[3,3];case 3:return[2,{error:null}]}})})},Tt([(0,ot.catchErrorsDecorator)({title:`绑定手机号失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindPhoneNumber() 的语法或参数是否正确`,` 2 - 当前环境是否开通了短信验证码登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(r=e.BindPhoneRequest)==`function`?r:Object]),V(`design:returntype`,Promise)],n.prototype,`bindPhoneNumber`,null),Tt([(0,ot.catchErrorsDecorator)({title:`解除三方绑定失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().unbindProvider() 的语法或参数是否正确`,` 2 - 当前账户是否已经与此登录方式解绑`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(i=e.UnbindProviderRequest)==`function`?i:Object]),V(`design:returntype`,typeof(a=typeof Promise<`u`&&Promise)==`function`?a:Object)],n.prototype,`unbindProvider`,null),Tt([(0,ot.catchErrorsDecorator)({title:`绑定邮箱地址失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindEmail() 的语法或参数是否正确`,` 2 - 当前环境是否开通了邮箱密码登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(o=e.BindEmailRequest)==`function`?o:Object]),V(`design:returntype`,void 0)],n.prototype,`bindEmail`,null),Tt([(0,ot.catchErrorsDecorator)({title:`验证码验证失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().verify() 的语法或参数是否正确`,` 2 - 当前环境是否开通了手机验证码/邮箱登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(s=e.VerifyRequest)==`function`?s:Object]),V(`design:returntype`,typeof(l=typeof Promise<`u`&&Promise)==`function`?l:Object)],n.prototype,`verify`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取验证码失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getVerification() 的语法或参数是否正确`,` 2 - 当前环境是否开通了手机验证码/邮箱登录`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(d=e.GetVerificationRequest)==`function`?d:Object,Object]),V(`design:returntype`,typeof(m=typeof Promise<`u`&&Promise)==`function`?m:Object)],n.prototype,`getVerification`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getCurrentUser() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(g=typeof Promise<`u`&&Promise)==`function`?g:Object)],n.prototype,`getCurrentUser`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序匿名登录失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了匿名登录`,` 2 - 调用 auth().signInAnonymouslyInWx() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(b=typeof Promise<`u`&&Promise)==`function`?b:Object)],n.prototype,`signInAnonymouslyInWx`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序绑定OpenID失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序openId静默登录`,` 2 - 调用 auth().bindOpenId() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(C=typeof Promise<`u`&&Promise)==`function`?C:Object)],n.prototype,`bindOpenId`,null),Tt([(0,ot.catchErrorsDecorator)({title:`小程序unionId静默登录失败`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序unionId静默登录`,` 2 - 调用 auth().signInWithUnionId() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(w=typeof Promise<`u`&&Promise)==`function`?w:Object)],n.prototype,`signInWithUnionId`,null),Tt([(0,ot.catchErrorsDecorator)({title:`短信验证码登陆`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了小程序短信验证码登陆`,` 2 - 调用 auth().signInWithSms() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(T=typeof Promise<`u`&&Promise)==`function`?T:Object)],n.prototype,`signInWithSms`,null),Tt([(0,ot.catchErrorsDecorator)({title:`邮箱验证码登陆`,messages:[`请确认以下各项:`,` 1 - 当前环境是否开启了邮箱登陆`,` 2 - 调用 auth().signInWithEmail() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[Object]),V(`design:returntype`,typeof(E=typeof Promise<`u`&&Promise)==`function`?E:Object)],n.prototype,`signInWithEmail`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户是否被占用失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().isUsernameRegistered() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[String]),V(`design:returntype`,typeof(D=typeof Promise<`u`&&Promise)==`function`?D:Object)],n.prototype,`isUsernameRegistered`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取本地登录态失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getLoginState() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(ee=typeof Promise<`u`&&Promise)==`function`?ee:Object)],n.prototype,`getLoginState`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取用户信息失败`,messages:[`请确认以下各项:`,` 1 - 是否已登录`,` 2 - 调用 auth().getUserInfo() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(te=typeof Promise<`u`&&Promise)==`function`?te:Object)],n.prototype,`getUserInfo`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取微搭插件用户信息失败`,messages:[`请确认以下各项:`,` 1 - 是否已登录`,` 2 - 调用 auth().getWedaUserInfo() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(O=typeof Promise<`u`&&Promise)==`function`?O:Object)],n.prototype,`getWedaUserInfo`,null),Tt([(0,ot.catchErrorsDecorator)({title:`绑定第三方登录方式失败`,messages:[`请确认以下各项:`,` 1 - 调用 auth().bindWithProvider() 的语法或参数是否正确`,` 2 - 此账户是否已经绑定此第三方`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[typeof(A=e.BindWithProviderRequest)==`function`?A:Object]),V(`design:returntype`,typeof(ne=typeof Promise<`u`&&Promise)==`function`?ne:Object)],n.prototype,`bindWithProvider`,null),Tt([(0,ot.catchErrorsDecorator)({title:`获取身份源类型`,messages:[`请确认以下各项:`,` 1 - 调用 auth().getProviderSubType() 的语法或参数是否正确`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${z.COMMUNITY_SITE_URL}`]}),V(`design:type`,Function),V(`design:paramtypes`,[]),V(`design:returntype`,typeof(re=typeof Promise<`u`&&Promise)==`function`?re:Object)],n.prototype,`getProviderSubType`,null),n}(Ct),Ft=`auth`;function It(e,t){for(var n=[],r=0;r<=e.length;r++)n[r]=[r];for(var i=0;i<=t.length;i++)n[0][i]=i;for(r=1;r<=e.length;r++)for(i=1;i<=t.length;i++){var a=e[r-1].toLowerCase()===t[i-1].toLowerCase()?0:1;n[r][i]=Math.min(n[r-1][i]+1,n[r][i-1]+1,n[r-1][i-1]+a)}return n[e.length][t.length]}var Lt={name:`auth`,namespace:Ft,entity:function(e){var t=function(e){var t=this;if(this.authInstance&&!e)return this.authInstance;e||={region:``,persistence:`local`,apiPath:s};var n=this.platform.adapter,r=e.persistence||n.primaryStorage;r&&r!==this.config.persistence&&this.updateConfig({persistence:r});var i=function(e,t){var n=this,r=e.region,i=r===void 0?`ap-shanghai`:r,a=e.i18n,o=e.accessKey,c=e.useWxCloud,l=t?.platform||lt.useDefaultAdapter.bind(t)(),u=l.runtime,d=l.adapter,p=t||{},m=p.env,h=p.clientId,_=p.debug,b=p.cache,S=p.app,C=p.getApiOrigin,w=(t||{}).apiOrigin;w||=`https://${m}.${i}.tcb-api.tencentcloudapi.com`;var T={env:m,clientId:h,i18n:a,accessKey:o,useWxCloud:c,eventBus:new Fe.CloudbaseEventEmitter},E=new at(gt(B(B({},T),{apiOrigin:w,getApiOrigin:C,apiPath:e?.apiPath||s,storage:e?.storage,baseRequest:e?.baseRequest,request:e?.request,anonymousSignInFunc:e?.anonymousSignInFunc,captchaOptions:e?.captchaOptions,wxCloud:e?.wxCloud,adapter:d,onCredentialsError:Dt(T.eventBus),headers:B({"X-SDK-Version":`@cloudbase/js-sdk/${e.sdkVersion}`},e.headers||{}),detectSessionInUrl:e.detectSessionInUrl,debug:_,auth:t.app?.config?.auth}))),D=new Pt(B(B({},T),{region:i,persistence:e.persistence,debug:_,cache:b||new st.CloudbaseCache({persistence:e.persistence,keys:{userInfoKey:`user_info_${m}`},platformInfo:l}),runtime:u||`web`,_fromApp:S,oauthInstance:E,auth:t.app?.config?.auth}));return E.initializeSession(function(e,t){return H(n,void 0,void 0,function(){return U(this,function(n){return e&&(e.type===y?t?T.eventBus.fire(v,{event:f,info:B(B({},e),{error:t})}):e.user&&D.createLoginState({},{userInfo:e.user}):e.type===x&&T.eventBus.fire(v,{event:g,info:B(B({},e),{error:t})})),[2]})})}),{authInstance:D,oauthInstance:E}}(B(B({wxCloud:this.config.wxCloud,storage:this.config.storage},e),{persistence:this.config.persistence,i18n:this.config.i18n,accessKey:this.config.accessKey,useWxCloud:this.config.useWxCloud,sdkVersion:this.version,detectSessionInUrl:this.config.auth?.detectSessionInUrl}),{env:this.config.env,clientId:this.config.clientId,getApiOrigin:function(){return t.request.getBaseEndPoint(t.config.endPointMode||`CLOUD_API`)},platform:this.platform,cache:this.cache,app:this,debug:this.config.debug}),a=i.authInstance,o=i.oauthInstance;return this.oauthInstance=o,this.authInstance=a,this.authInstance},n=t.call(this,e);Object.assign(t,n),Object.setPrototypeOf(t,Object.getPrototypeOf(n));var r=typeof Proxy<`u`?new Proxy(t,{get:function(e,t,n){var r=Reflect.get(e,t,n);if(r!==void 0||typeof t!=`string`)return r;var i=function(e,t){for(var n=null,r=1/0,i=0,a=t;i<a.length;i++){var o=a[i];if(!o.startsWith(`_`)&&o!==`constructor`){var s=It(e,o);s<r&&(r=s,n=o)}}return n}(t,Object.getOwnPropertyNames(Object.getPrototypeOf(e)).concat(Object.keys(e)).filter(function(t){return typeof e[t]==`function`}));return i&&console.warn(`[CloudBase Auth] auth.${t} is not a function. Did you mean: auth.${i}() ?`),r}}):t;return this[Ft]=r,r}};try{cloudbase.registerComponent(Lt)}catch{}var Rt=function(e){try{e.registerComponent(Lt)}catch(e){console.warn(e)}};try{window.registerAuth=Rt}catch{}})(),ho.W;var go={388:e=>{e.exports={}}},_o={};function vo(e){var t=_o[e];if(t!==void 0)return t.exports;var n=_o[e]={exports:{}};return go[e](n,n.exports,vo),n.exports}vo.d=(e,t)=>{for(var n in t)vo.o(t,n)&&!vo.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},vo.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var yo={};(()=>{vo.d(yo,{r:()=>ve});var e=vo(388);function t(){return`@cloudbase/js-sdk`}var n={INVALID_PARAMS:`INVALID_PARAMS`,INVALID_SYNTAX:`INVALID_SYNTAX`,INVALID_OPERATION:`INVALID_OPERATION`,OPERATION_FAIL:`OPERATION_FAIL`,NETWORK_ERROR:`NETWORK_ERROR`,UNKOWN_ERROR:`UNKOWN_ERROR`};let r=(i={AbstractSDKRequest:()=>f,AbstractStorage:()=>p},a={},vo.d(a,i),a);var i,a,o,s=(o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},o(e,t)},function(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);function n(){this.constructor=e}o(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),c=function(){return c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},c.apply(this,arguments)};function l(e,t){console.warn(`[@cloudbase/js-sdk][${e}]:${t}`)}var u=function(e){function t(t){var n=e.call(this,t.msg||t.message||``)||this;return n.code=t.code||``,n.requestId=t.requestId||``,Object.defineProperty(n,"message",{value:t.msg||t.message||``,enumerable:!0,writable:!0,configurable:!0}),n}return s(t,e),t}(Error),d=function(e){return new u(e)};function m(e,t){return(t||d)(e)}var h,g=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_.apply(this,arguments)},v=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},y=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){function t(t){var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=i||`请求超时`,n.restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}g(t,e),t.prototype.get=function(e){return this.request(_(_({},e),{method:`get`}),this.restrictedMethods.includes(`get`))},t.prototype.post=function(e){return this.request(_(_({},e),{method:`post`}),this.restrictedMethods.includes(`post`))},t.prototype.put=function(e){return this.request(_(_({},e),{method:`put`}))},t.prototype.upload=function(e){var t=e,n=t.data,r=t.file,i=t.fileContent,a=t.name,o=t.method,s=t.headers,c=s===void 0?{}:s,l=r??i,u={post:`post`,put:`put`}[o?.toLowerCase()]||`put`,d=new FormData;return u===`post`?(Object.keys(n).forEach(function(e){d.append(e,n[e])}),d.append(`key`,a),d.append(`file`,l instanceof Blob?l:new Blob([l])),this.request(_(_({},e),{data:d,method:u}),this.restrictedMethods.includes(`upload`))):this.request(_(_({},e),{method:`put`,headers:c,body:l}),this.restrictedMethods.includes(`upload`))},t.prototype.download=function(e){return v(this,void 0,Promise,function(){var t,n,r,i;return y(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(_(_({},e),{headers:{},responseType:`blob`}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split(`/`).pop()||``),(i=document.createElement(`a`)).href=n,i.setAttribute(`download`,r),i.style.display=`none`,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){return v(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=this;return y(this,function(h){switch(h.label){case 0:return t=new AbortController,n=e.url,r=e.enableAbort,i=r!==void 0&&r,a=e.stream,o=a!==void 0&&a,s=e.signal,c=e.timeout,l=e.shouldThrowOnError,u=l===void 0||l,d=c??this.timeout,s&&(s.aborted&&t.abort(),s.addEventListener(`abort`,function(){return t.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),t.abort(Error(m.timeoutMsg))},d)),[4,fetch(n,_(_({},e),{signal:t.signal})).then(function(e){return v(m,void 0,void 0,function(){var t,n,r;return y(this,function(i){switch(i.label){case 0:return clearTimeout(f),u?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[i.sent()]),i.label=3;case 3:return[2,t];case 4:return[2,e]}})})}).catch(function(e){return clearTimeout(f),Promise.reject(e)})];case 1:return p=h.sent(),[2,{data:o?p.body:p.headers.get(`content-type`)?.includes(`application/json`)?p.json():p.text(),statusCode:p.status,header:p.headers,response:p}]}})})},t.prototype.request=function(e,t){var n=this;t===void 0&&(t=!1);var r=String(e.method).toLowerCase()||`get`;return new Promise(function(i){var a=e.url,o=e.headers,s=o===void 0?{}:o,c=e.data,l=e.responseType,u=e.withCredentials,d=e.body,f=e.onUploadProgress,p=function(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;return Object.keys(n).forEach(function(e){i===``?!r&&(t+=`?`):i+=`&`,i+=`${e}=${encodeURIComponent(n[e])}`}),/^http(s)?:\/\//.test(t+=i)?t:`${e}${t}`}(`https:`,a,r===`get`?c:{}),m=new XMLHttpRequest;m.open(r,p),l&&(m.responseType=l);var h,g,_,v=e.signal;v&&(v.aborted?m.abort():v.addEventListener(`abort`,function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),f&&m.upload.addEventListener(`progress`,f),m.onreadystatechange=function(){var e={};if(m.readyState===4){var t=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(`: `),r=t.shift().toLowerCase();n[r]=t.join(`: `)}),e.header=n,e.statusCode=m.status;try{e.data=l===`blob`?m.response:JSON.parse(m.responseText)}catch{e.data=l===`blob`?m.response:m.responseText}clearTimeout(h),i(e)}},t&&n.timeout&&(h=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),_=c,g=Object.prototype.toString.call(_)===`[object FormData]`?c:s[`content-type`]===`application/x-www-form-urlencoded`?function(e){e===void 0&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)}(c):d||(c?JSON.stringify(c):void 0),u&&(m.withCredentials=!0),m.send(g)})}})(r.AbstractSDKRequest),function(e){e.WEB=`web`,e.WX_MP=`wx_mp`}(h||={});var x=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),S=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},C=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},w=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||={},n}return x(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(r.AbstractStorage);(function(){function e(e){this.keys={};var t=e.persistence,r=e.platformInfo,i=r===void 0?{}:r,a=e.keys,o=a===void 0?{}:a;this.platformInfo=i,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case`local`:default:return t.localStorage?t.localStorage:(l(n.INVALID_PARAMS,`localStorage is not supported on current platform`),new w(t.root));case`none`:return new w(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=o)}Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||`sync`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,r){if(this.mode!==`async`){if(this.storage)try{var i={version:r||`localCachev1`,content:t};this.storage.setItem(e,JSON.stringify(i))}catch(e){throw Error(JSON.stringify({code:n.OPERATION_FAIL,msg:`[@cloudbase/js-sdk][${n.OPERATION_FAIL}]setStore failed`,info:e}))}}else l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use setStoreAsync insteed`)},e.prototype.setStoreAsync=function(e,t,n){return S(this,void 0,void 0,function(){var r;return C(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),r={version:n||`localCachev1`,content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){if(this.mode!==`async`){try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return``}catch{return``}t||=`localCachev1`;var r=this.storage.getItem(e);return r&&r.indexOf(t)>=0?JSON.parse(r).content:``}l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use getStoreAsync insteed`)},e.prototype.getStoreAsync=function(e,t){return S(this,void 0,void 0,function(){var n;return C(this,function(r){switch(r.label){case 0:try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,``]}catch{return[2,``]}return t||=`localCachev1`,[4,this.storage.getItem(e)];case 1:return(n=r.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,``]}})})},e.prototype.removeStore=function(e){this.mode===`async`?l(n.INVALID_OPERATION,`current platform's storage is asynchronous, please use removeStoreAsync insteed`):this.storage.removeItem(e)},e.prototype.removeStoreAsync=function(e){return S(this,void 0,void 0,function(){return C(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})}})();var T=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),E=function(e,t){this.data=t||null,this.name=e},D=function(e){function t(t,n){var r=e.call(this,`error`,{error:t,data:n})||this;return r.error=t,r}return T(t,e),t}(E),ee=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(n?.[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof D)return console.error(e.error),this;var n=typeof e==`string`?new E(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var i=0,a=this.listeners[r]?function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],this.listeners[r],!0):[];i<a.length;i++)a[i].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new ee,new ee,typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.indexOf(`Firefox`),(e=>{var t={};return vo.d(t,e),t})({default:()=>b}).default;var te=function(){return te=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},te.apply(this,arguments)},O=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},k=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},A=n,ne=`cloudrun`;function re(e,t){return O(this,void 0,void 0,function(){var n,r,i,a,o,s,c,l,u,d,f,p,m,h,g;return k(this,function(_){switch(_.label){case 0:if(n=e.name,r=e.data,i=e.path,a=i===void 0?``:i,o=e.method,s=e.header,c=s===void 0?{}:s,l=this.getEndPointWithKey(`GATEWAY`),u=l.BASE_URL,d=l.PROTOCOL,f=`${d}${u}/cloudrun/${n}`,p=a.startsWith(`/`)?a:`/${a}`,m=[`GET`,`HEAD`].includes((o?.toUpperCase)?.call(o)))try{h={};try{h=JSON.parse(r)}catch{h=r||{}}p=`${p}${p.includes(`?`)?`&`:`?`}${Object.keys(h).map(function(e){return`${e}=${h[e]}`}).join(`&`)}`}catch{}return[4,this.request.fetch(te(te({method:o||`POST`,headers:Object.assign({},{"Content-Type":`application/json; charset=utf-8`},c)},m?{}:{body:r}),{url:`${f}${p}`,customReqOpts:t}))];case 1:return g=_.sent(),t?.from===`node-sdk`?[2,g]:[4,g.data];case 2:return[2,_.sent()]}})})}var ie={name:ne,entity:{callContainer:new(function(){function e(){}return e.prototype.callContainer=function(e,t){return O(this,void 0,void 0,function(){var n,r,i;return k(this,function(a){switch(a.label){case 0:if(n=e.name,r=e.data,!n)throw Error(JSON.stringify({code:A.INVALID_PARAMS,msg:`[${ne}.callContainer] invalid name`}));try{i=r?JSON.stringify(r):``}catch{throw Error(JSON.stringify({code:A.INVALID_PARAMS,msg:`[${ne}.callContainer] invalid data`}))}return[4,re.call(this,te(te({},e),{data:i}),t)];case 1:return[2,a.sent()]}})})},e}())().callContainer}};try{cloudbase.registerComponent(ie)}catch{}try{window.registerCloudrun=function(e){try{e.registerComponent(ie)}catch(e){console.warn(e)}}}catch{}var ae=function(){return ae=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ae.apply(this,arguments)},oe=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},se=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},ce=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},le=t,ue=n,de=function(e,t,n){if(n===void 0&&(n=null),e&&typeof e==`function`)return e(t,n);if(t)throw t;return n},fe=function(e,t){if(function(e){return!e||typeof e.throw!=`boolean`||e.throw}(e))throw m(c(c({},t),{msg:t.message}),e?.errorFactory);return c({code:t.code,message:t.message},t.requestId?{requestId:t.requestId}:{})},pe=`functions`;function me(e){return e.length<=1024?e:`${e.slice(0,1024)}…`}function he(e,t){return{code:e?.code||ue.NETWORK_ERROR,message:e?.message||e?.msg||``,requestId:t}}function ge(e,t){if(e&&typeof e==`object`&&!Array.isArray(e))return he(e,t);if(typeof e==`string`){try{var n=JSON.parse(e);if(n&&typeof n==`object`&&!Array.isArray(n))return he(n,t)}catch{}return{code:ue.NETWORK_ERROR,message:me(e),requestId:t}}return{code:ue.NETWORK_ERROR,message:me(e==null?``:String(e)),requestId:t}}var _e={name:pe,entity:{callFunction:new(function(){function t(){}var n,r,i,a;return t.invokeCloudrun=function(e,t,n){return se(this,void 0,void 0,function(){var r,i,a,o,s,c,l;return ce(this,function(u){switch(u.label){case 0:return r=t.name,i=t.path,a=i===void 0?``:i,o=t.method,s=t.header,c=s===void 0?{}:s,d=new Date().getTime(),f=(Date==null?void 0:Date.now)&&1e3*Date.now()||0,l=`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,function(e){var t=16*Math.random();return d>0?(t=(d+t)%16|0,d=Math.floor(d/16)):(t=(f+t)%16|0,f=Math.floor(f/16)),(e===`x`?t:7&t|8).toString(16)}),[4,re.call(e,{name:r,data:n,path:a,method:o,header:ae(ae({},c),{"X-Request-Id":l})})];case 1:return[2,{result:u.sent(),requestId:l}]}var d,f})})},t.invokeGateway=function(e,t,n,r){return se(this,void 0,void 0,function(){var i,a,o,s,c;return ce(this,function(l){switch(l.label){case 0:i=e.request,a=e.config,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,i.gateWay(ae(ae({},t),{path:`functions`,shouldThrowOnError:!1}),r)];case 2:return o=l.sent(),[3,4];case 3:return s=l.sent(),function(e){if(!e)return!1;if(e instanceof SyntaxError||e.name===`SyntaxError`)return!0;var t=String(e.message||``);return/not valid JSON|Unexpected token|JSON\.parse|Failed to execute 'json'/i.test(t)}(c=s)?[2,fe(a,ge(c.message,c.requestId))]:[2,de(n,c)];case 4:return Number(o?.statusCode)>=400?[2,fe(a,ge(o?.data,o?.requestId))]:[2,de(n,null,{requestId:o?.requestId,result:o?.data})]}})})},t.invokeCloudApi=function(e,t,n,r,i){return se(this,void 0,void 0,function(){var a,o,s,c,l,u,d;return ce(this,function(f){switch(f.label){case 0:return a=t.name,o=t.data,s=t.query,c=t.parse,l=t.search,[4,e.request.send(`functions.invokeFunction`,{inQuery:s,parse:c,search:l,function_name:a,request_data:n},{endPointMode:`CLOUD_API`,defaultQuery:o?.params?.action?{action:o?.params?.action}:{}},i)];case 1:if(u=f.sent(),(d=u.data?.response_data)===void 0)return[2,de(r,null,u)];if(c)return[2,de(r,null,{result:d,requestId:u.requestId})];try{return d=JSON.parse(d),[2,de(r,null,{result:d,requestId:u.requestId})]}catch{return[2,de(r,Error(`[${le()}][${ue.INVALID_PARAMS}][${pe}.callFunction] response data must be json`))]}}})})},t.prototype.callFunction=function(e,n,r){return se(this,void 0,void 0,function(){var i,a,o,s,c,l;return ce(this,function(u){switch(u.label){case 0:if(i=e.name,a=e.data,o=e.type,s=this.config,!i)return[2,fe(s,{code:ue.INVALID_PARAMS,message:`[${pe}.callFunction] invalid function name`})];try{c=a?JSON.stringify(a):``}catch{return[2,fe(s,{code:ue.INVALID_PARAMS,message:`[${pe}.callFunction] invalid data`})]}if(o===`cloudrun`)return[2,t.invokeCloudrun(this,e,c)];u.label=1;case 1:return u.trys.push([1,5,,6]),function(e,t){return e.endPointMode===`GATEWAY`&&!function(e){return e===`lcap-common-service`||e===`lcap-datasource-test`||e.startsWith(`lcap-data`)||e.startsWith(`lowcode-datasource`)||e===`cloudbase_module`}(t)&&!function(e){return e===`lowcode-wx-datasource`}(t)}(s,i)?[4,t.invokeGateway(this,e,n,r)]:[3,3];case 2:return[2,u.sent()];case 3:return[4,t.invokeCloudApi(this,e,c,n,r)];case 4:return[2,u.sent()];case 5:return l=u.sent(),de(n,l),[3,6];case 6:return[2]}})})},function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);a>3&&o&&Object.defineProperty(t,n,o)}([(a={customInfo:{className:`Cloudbase`,methodName:`callFunction`},title:`函数调用失败`,messages:[`请确认以下各项:`,` 1 - 调用 callFunction() 的语法或参数是否正确`,` 2 - 当前环境下是否存在此函数`,` 3 - 函数安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:https://support.qq.com/products/148793`]},a.mode,a.customInfo,a.title,a.messages,function(e,t,n){}),oe(`design:type`,Function),oe(`design:paramtypes`,[typeof(n=e.ICallFunctionOptions!==void 0&&e.ICallFunctionOptions)==`function`?n:Object,typeof(r=typeof Function<`u`&&Function)==`function`?r:Object,typeof(i=e.ICustomReqOpts!==void 0&&e.ICustomReqOpts)==`function`?i:Object]),oe(`design:returntype`,Promise)],t.prototype,`callFunction`,null),t}())().callFunction}};try{cloudbase.registerComponent(_e)}catch{}var ve=function(e){try{e.registerComponent(_e)}catch(e){console.warn(e)}};try{window.registerFunctions=ve}catch{}})(),yo.r;var bo={388:e=>{e.exports={}}},xo={};function So(e){var t=xo[e];if(t!==void 0)return t.exports;var n=xo[e]={exports:{}};return bo[e](n,n.exports,So),n.exports}So.d=(e,t)=>{for(var n in t)So.o(t,n)&&!So.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},So.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Co={};(()=>{So.d(Co,{v:()=>ct});var e,t=(e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)},function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}),n=function(e){function n(t){var n=e.call(this,t)||this;return n.__isStorageError=!0,n.name=`StorageError`,n}return t(n,e),n}(Error);function r(e){return typeof e==`object`&&!!e&&`__isStorageError`in e}var i,a=function(e){function n(t,n,r){var i=e.call(this,t)||this;return i.name=`StorageApiError`,i.status=n,i.statusCode=r,i}return t(n,e),n.prototype.toJSON=function(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}},n}(n);function o(){return globalThis.Buffer}function s(e){var t=o();return t?t.from(e).toString(`base64`):btoa(e)}function c(e){return e.split(`/`).map(function(e){return encodeURIComponent(e)}).join(`/`)}t(function(e,t){var n=i.call(this,e)||this;return n.name=`StorageUnknownError`,n.originalError=t,n},i=n);var l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)},u=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},d=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},m=`/v1/storages`;function h(e,t){return u(this,void 0,Promise,function(){var i;return d(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,e()];case 1:return[2,{data:a.sent(),error:null}];case 2:if(i=a.sent(),t)throw i;return r(i)?[2,{data:null,error:i}]:[2,{data:null,error:new n(i?.message||String(i))}];case 3:return[2]}})})}var g=function(){function e(e){this.ctx=e}return Object.defineProperty(e.prototype,"request",{get:function(){return this.ctx.request},enumerable:!1,configurable:!0}),e.prototype.gatewayOrigin=function(){return this.request.getBaseEndPoint(`GATEWAY`)},e.prototype.buildUrl=function(e,t){var n=`${this.gatewayOrigin()}${m}${e}`,r=function(e){if(!e)return``;var t=[];return Object.keys(e).forEach(function(n){var r=e[n];r!=null&&t.push(`${encodeURIComponent(n)}=${encodeURIComponent(String(r))}`)}),t.join(`&`)}(t);return r&&(n+=(n.includes(`?`)?`&`:`?`)+r),n},e.prototype.toFullUrl=function(e){return e&&(/^https?:\/\//.test(e)||e.startsWith(`//`)?e:`${this.gatewayOrigin()}${m}${e.startsWith(`/`)?``:`/`}${e}`)},e.prototype.send=function(e){return u(this,void 0,Promise,function(){var t,n,r,i,a,o;return d(this,function(s){switch(s.label){case 0:return t=this.buildUrl(e.path,e.query),n=e.method.toUpperCase(),r=[`GET`,`HEAD`].includes(n),i=l({},e.headers||{}),r||(e.rawBody===void 0?e.json!==void 0&&(i[`Content-Type`]=i[`Content-Type`]||`application/json`,a=JSON.stringify(e.json)):a=e.rawBody),[4,this.request.fetch(l(l(l(l({url:t,method:n,headers:i},a===void 0?{}:{body:a}),{withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1}),e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:return o=s.sent(),[2,this.unwrap(o,t)]}})})},e.prototype.download=function(e){return u(this,void 0,Promise,function(){var t,n,r,i;return d(this,function(o){switch(o.label){case 0:return t=this.buildUrl(e.path,e.query),[4,this.request.fetch(l(l({url:t,method:`GET`,headers:l({},e.headers||{}),stream:!0,withCredentials:!1!==e.withCredentials,shouldThrowOnError:!1},e.signal?{signal:e.signal}:{}),e.cache?{cache:e.cache}:{}))];case 1:if(n=o.sent(),e.signal?.aborted)throw new a(`The download was aborted`,0,`STORAGE_PG_ABORTED`);if((r=Number(n?.statusCode??200))===304)throw new a(`Not Modified`,r,`STORAGE_PG_NOT_MODIFIED`);if(r>=400)throw new a(`Download failed with status ${r}`,r,`STORAGE_PG_REQUEST_FAIL`);if(!(i=n?.response))throw new a(`Underlying adapter did not expose the raw Response`,r,`STORAGE_PG_NO_RESPONSE`);return[2,{response:i,status:r,header:n?.header}]}})})},e.prototype.unwrap=function(e,t){return u(this,void 0,Promise,function(){var n,r,i,o;return d(this,function(s){switch(s.label){case 0:n=Number(e?.statusCode??e?.status??200),r=e?.data,s.label=1;case 1:return s.trys.push([1,3,,4]),[4,r];case 2:return r=s.sent(),[3,4];case 3:return s.sent(),r=void 0,[3,4];case 4:if(n>=200&&n<300)return[2,r];throw i=r?.code||r?.error||`STORAGE_PG_REQUEST_FAIL`,o=r?.message||`Storage request failed with status ${n}: ${t}`,new a(o,n,i)}})})},e}(),_=function(){return _=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},_.apply(this,arguments)},v=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},y=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};function x(e){return r(e)?e:new n(e?.message||String(e))}function S(e){var t={};return e?.download!==void 0&&(t.download=!0===e.download?``:e.download),e?.cacheNonce!==void 0&&(t.cacheNonce=String(e.cacheNonce)),{headers:{},query:t}}var C=function(){function e(e){this.ctx=e}return e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){return v(this,void 0,Promise,function(){var e,t,n,r,i;return y(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),e=S(this.ctx.options),t=e.headers,n=e.query,[4,this.ctx.http.download({path:`/object/${this.ctx.bucketId}/${c(this.ctx.cleanName)}`,headers:_(_({},this.ctx.headers),t),query:n,signal:this.ctx.parameters?.signal,cache:this.ctx.parameters?.cache})];case 1:if(!(r=o.sent().response).body)throw new a(`Response body is empty`,r.status,`STORAGE_PG_EMPTY_BODY`);return[2,{data:r.body,error:null}];case 2:if(i=o.sent(),this.ctx.shouldThrowOnError)throw i;return[2,{data:null,error:x(i)}];case 3:return[2]}})})},e}(),w=function(){function e(e){this.ctx=e}return e.prototype.asStream=function(){return new C(this.ctx)},e.prototype.then=function(e,t){return this.execute().then(e,t)},e.prototype.execute=function(){return v(this,void 0,Promise,function(){var e,t,n,r,i,a;return y(this,function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),e=S(this.ctx.options),t=e.headers,n=e.query,[4,this.ctx.http.download({path:`/object/${this.ctx.bucketId}/${c(this.ctx.cleanName)}`,headers:_(_({},this.ctx.headers),t),query:n,signal:this.ctx.parameters?.signal,cache:this.ctx.parameters?.cache})];case 1:return r=o.sent().response,a={},[4,r.blob()];case 2:return[2,(a.data=o.sent(),a.error=null,a)];case 3:if(i=o.sent(),this.ctx.shouldThrowOnError)throw i;return[2,{data:null,error:x(i)}];case 4:return[2]}})})},e}(),T=function(){return T=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},T.apply(this,arguments)},E=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},D=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ee=`3600`,te=function(){function e(e,t,n){n===void 0&&(n=!1),this.headers={},this.http=e,this.bucketId=t,this.shouldThrowOnError=n}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.setHeader=function(e,t){var r;if(typeof e!=`string`||e.trim()===``)throw new n(`setHeader requires a non-empty header name`);if(/[\r\n]/.test(e)||typeof t==`string`&&/[\r\n]/.test(t))throw new n(`setHeader does not allow CR/LF characters in header name or value`);return this.headers=T(T({},this.headers),((r={})[e]=String(t),r)),this},e.prototype.upload=function(e,t,n){return E(this,void 0,Promise,function(){return D(this,function(r){return[2,this.uploadOrUpdate(`POST`,e,t,n)]})})},e.prototype.update=function(e,t,n){return E(this,void 0,Promise,function(){return D(this,function(r){return[2,this.uploadOrUpdate(`PUT`,e,t,n)]})})},e.prototype.download=function(e,t,n){return new w({http:this.http,bucketId:this.bucketId,cleanName:this.cleanPath(e),options:t,parameters:n,headers:this.headers,shouldThrowOnError:this.shouldThrowOnError})},e.prototype.list=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r;return D(this,function(i){return r={prefix:e||``},t?.limit!==void 0&&(r.limit=t.limit),t?.cursor!==void 0&&(r.cursor=t.cursor),t?.withDelimiter!==void 0&&(r.with_delimiter=t.withDelimiter),t?.sortBy!==void 0&&(r.sortBy=t.sortBy),[2,this.send({method:`POST`,path:`/object/list/${this.bucketId}`,json:r,signal:n?.signal,cache:n?.cache})]})})},this.shouldThrowOnError)]})})},e.prototype.remove=function(e){return E(this,void 0,Promise,function(){var t=this;return D(this,function(n){return[2,h(function(){return E(t,void 0,void 0,function(){var t,n,r,i,a,o=this;return D(this,function(s){switch(s.label){case 0:t=e.map(function(e){return o.cleanPath(e)}),n=[],r=0,s.label=1;case 1:return r<t.length?(i=t.slice(r,r+100),[4,this.send({method:`DELETE`,path:`/object/${this.bucketId}`,json:{prefixes:i}})]):[3,4];case 2:a=s.sent(),Array.isArray(a)&&n.push.apply(n,a),s.label=3;case 3:return r+=100,[3,1];case 4:return[2,n]}})})},this.shouldThrowOnError)]})})},e.prototype.copy=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r;return D(this,function(i){switch(i.label){case 0:return r=this.buildCopyMoveHeaders(n),[4,this.send({method:`POST`,path:`/object/copy`,json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:n?.destinationBucket,copyMetadata:n?.copyMetadata,metadata:n?.metadata},headers:r})];case 1:return[2,{path:i.sent().Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.move=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){return D(this,function(r){switch(r.label){case 0:return[4,this.send({method:`POST`,path:`/object/move`,json:{bucketId:this.bucketId,sourceKey:this.cleanPath(e),destinationKey:this.cleanPath(t),destinationBucket:n?.destinationBucket}})];case 1:return[2,{message:r.sent().message||`Successfully moved`}]}})})},this.shouldThrowOnError)]})})},e.prototype.info=function(e){return E(this,void 0,Promise,function(){var t=this;return D(this,function(n){return[2,h(function(){return E(t,void 0,void 0,function(){var t,n;return D(this,function(r){switch(r.label){case 0:return t=this.cleanPath(e),[4,this.send({method:`GET`,path:`/object/info/${this.bucketId}/${this.encodePath(t)}`})];case 1:return[2,{id:(n=r.sent()).id,name:n.name,version:n.version,bucketId:n.bucket_id,size:n.size,contentType:n.content_type,cacheControl:n.cache_control,etag:n.etag,metadata:n.metadata,lastModified:n.last_modified,createdAt:n.created_at}]}})})},this.shouldThrowOnError)]})})},e.prototype.exists=function(e){return E(this,void 0,Promise,function(){var t,r,i;return D(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=this.cleanPath(e),[4,this.send({method:`GET`,path:`/object/info/${this.bucketId}/${this.encodePath(t)}`})];case 1:return a.sent(),[2,{data:!0,error:null}];case 2:if(r=a.sent(),(i=r?.status)!==void 0&&[400,404].includes(Number(i)))return[2,{data:!1,error:null}];if(this.shouldThrowOnError)throw r;return[2,{data:null,error:r instanceof n?r:new n(r?.message||String(r))}];case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r,i,a;return D(this,function(o){switch(o.label){case 0:return r=this.cleanPath(e),[4,this.send({method:`POST`,path:`/object/sign/${this.bucketId}/${this.encodePath(r)}`,json:{expiresIn:t}})];case 1:return i=o.sent(),a=i.fullSignedURL||this.http.toFullUrl(i.signedURL||``),[2,{fullSignedURL:this.appendUrlOptions(a,n)}]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUrls=function(e,t,n){return E(this,void 0,Promise,function(){var r=this;return D(this,function(i){return[2,h(function(){return E(r,void 0,void 0,function(){var r,i,a,o,s=this;return D(this,function(c){switch(c.label){case 0:r=e.map(function(e){return s.cleanPath(e)}),i=[],a=0,c.label=1;case 1:return a<r.length?(o=r.slice(a,a+500),[4,this.send({method:`POST`,path:`/object/sign/${this.bucketId}`,json:{expiresIn:t,paths:o}})]):[3,4];case 2:c.sent().forEach(function(e){var t=e.fullSignedURL||(e.signedURL?s.http.toFullUrl(e.signedURL):null);i.push({path:e.path,fullSignedURL:t?s.appendUrlOptions(t,n):null,error:e.error??null})}),c.label=3;case 3:return a+=500,[3,1];case 4:return[2,i]}})})},this.shouldThrowOnError)]})})},e.prototype.createSignedUploadUrl=function(e,t){return E(this,void 0,Promise,function(){var n=this;return D(this,function(r){return[2,h(function(){return E(n,void 0,void 0,function(){var n,r,i;return D(this,function(a){switch(a.label){case 0:return n=this.cleanPath(e),r={},t!=null&&t.upsert&&(r[`x-upsert`]=`true`),[4,this.send({method:`POST`,path:`/object/upload/sign/${this.bucketId}/${this.encodePath(n)}`,headers:r})];case 1:return[2,{fullSignedURL:(i=a.sent()).fullURL||this.http.toFullUrl(i.url||``),path:n,token:i.token}]}})})},this.shouldThrowOnError)]})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return E(this,void 0,Promise,function(){var i=this;return D(this,function(a){return[2,h(function(){return E(i,void 0,void 0,function(){var i,a,o,s,c;return D(this,function(l){switch(l.label){case 0:return i=this.cleanPath(e),a=this.buildUploadBody(n,r),o=a.body,s=a.headers,[4,this.send({method:`PUT`,path:`/object/upload/sign/${this.bucketId}/${this.encodePath(i)}`,query:{token:t},rawBody:o,headers:s,withCredentials:!1})];case 1:return c=l.sent(),[2,{path:i,fullPath:c.Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.getPublicUrl=function(e,t){var n=this.cleanPath(e),r=this.http.buildUrl(`/object/public/${this.bucketId}/${this.encodePath(n)}`);return{data:{publicUrl:this.appendUrlOptions(r,t)}}},e.prototype.send=function(e){return this.http.send(T(T({},e),{headers:T(T({},this.headers),e.headers||{})}))},e.prototype.uploadOrUpdate=function(e,t,n,r){return E(this,void 0,Promise,function(){var i=this;return D(this,function(a){return[2,h(function(){return E(i,void 0,void 0,function(){var i,a,o,s,c;return D(this,function(l){switch(l.label){case 0:return i=this.cleanPath(t),a=this.buildUploadBody(n,r),o=a.body,s=a.headers,e===`POST`&&(s[`x-upsert`]=String(!!r?.upsert)),[4,this.send({method:e,path:`/object/${this.bucketId}/${this.encodePath(i)}`,rawBody:o,headers:s})];case 1:return[2,{id:(c=l.sent()).Id,path:i,fullPath:c.Key}]}})})},this.shouldThrowOnError)]})})},e.prototype.cleanPath=function(e){var t=e.replace(/^\/+|\/+$/g,``).replace(/\/+/g,`/`);if(t.split(`/`).some(function(e){return e===`..`}))throw new n(`invalid path: ".." segment is not allowed`);return t},e.prototype.encodePath=function(e){return c(e)},e.prototype.buildUploadBody=function(e,t){var n=T({},t?.headers||{}),r=e,i=typeof FormData<`u`&&e instanceof FormData;if(typeof Blob<`u`&&e instanceof Blob||i){var a=void 0,o={};if(i){var s=this.extractFromFormData(e);a=s.file,o=s.fields}else a=e;var c=t?.cacheControl??o.cacheControl??ee,l=t?.contentType??o.contentType,u=t?.metadata===void 0?o.metadata:JSON.stringify(t.metadata),d=new FormData;c!==void 0&&d.append(`cacheControl`,String(c)),l!==void 0&&d.append(`contentType`,l),u!==void 0&&d.append(`metadata`,u),d.append(``,a),r=d}else r=e,c=t?.cacheControl??ee,l=t?.contentType??`text/plain;charset=UTF-8`,n[`cache-control`]=`max-age=${c}`,l&&(n[`content-type`]=l),t!=null&&t.metadata&&(n[`x-metadata`]=this.toBase64(JSON.stringify(t.metadata)));return{body:r,headers:n}},e.prototype.extractFromFormData=function(e){var t,r={},i=0,a=[];if(e.forEach(function(e,n){if(typeof Blob<`u`&&e instanceof Blob)return t=e,void(i+=1);n!==`cacheControl`&&n!==`contentType`&&n!==`metadata`?a.push(n):r[n]=String(e)}),a.length>0&&console.warn(`Ignored unsupported FormData field(s): [${a.join(`, `)}]. Only file, cacheControl, contentType and metadata are supported`),i===0||!t)throw new n(`FormData must contain a file`);if(i>1)throw new n(`FormData must contain exactly one file`);return{file:t,fields:r}},e.prototype.buildCopyMoveHeaders=function(e){var t={};return e!=null&&e.upsert&&(t[`x-upsert`]=`true`),!1===e?.copyMetadata&&e!=null&&e.metadata&&(t[`x-metadata`]=this.toBase64(JSON.stringify(e.metadata))),t},e.prototype.appendUrlOptions=function(e,t){var n=[];if(t?.download!==void 0){var r=!0===t.download?``:String(t.download);n.push(`download=${encodeURIComponent(r)}`)}return t?.cacheNonce!==void 0&&n.push(`cacheNonce=${encodeURIComponent(String(t.cacheNonce))}`),n.length===0?e:`${e}${e.includes(`?`)?`&`:`?`}${n.join(`&`)}`},e.prototype.toBase64=function(e){return s(e)},e}(),O=/[\x00-\x20\x7f/\\?#%]/;function k(e,t){if(typeof e!=`string`||e.length===0)throw new n(`[storage.${t}] bucketId is required`);if(e.length>256)throw new n(`[storage.${t}] invalid bucketId: length must be 1-256`);var r=O.exec(e);if(r)throw new n(`[storage.${t}] invalid bucketId "${e}": contains forbidden character ${JSON.stringify(r[0])}; must not contain whitespace, control chars, "/", "\\", "?", "#" or "%"`)}var A=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},ne=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},re=function(){function e(e,t){t===void 0&&(t=!1),this.http=new g(e),this.shouldThrowOnError=t}return e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.listBuckets=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){var n={};return e?.limit!==void 0&&(n.limit=e.limit),e?.offset!==void 0&&(n.offset=e.offset),e!=null&&e.sortColumn&&(n.sortColumn=e.sortColumn),e!=null&&e.sortOrder&&(n.sortOrder=e.sortOrder),e!=null&&e.search&&(n.search=e.search),t.http.send({method:`GET`,path:`/bucket/`,query:n})},this.shouldThrowOnError)]})})},e.prototype.getBucket=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){return k(e,`getBucket`),t.http.send({method:`GET`,path:`/bucket/${e}`})},this.shouldThrowOnError)]})})},e.prototype.createBucket=function(e,t){return A(this,void 0,Promise,function(){var n=this;return ne(this,function(r){return[2,h(function(){var r;return k(e,`createBucket`),n.http.send({method:`POST`,path:`/bucket/`,json:{id:e,name:e,public:(r=t?.public)!=null&&r,type:t?.type,file_size_limit:t?.fileSizeLimit,allowed_mime_types:t?.allowedMimeTypes}})},this.shouldThrowOnError)]})})},e.prototype.updateBucket=function(e,t){return A(this,void 0,Promise,function(){var n=this;return ne(this,function(r){return[2,h(function(){return k(e,`updateBucket`),n.http.send({method:`PUT`,path:`/bucket/${e}`,json:{public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes}})},this.shouldThrowOnError)]})})},e.prototype.deleteBucket=function(e){return A(this,void 0,Promise,function(){var t=this;return ne(this,function(n){return[2,h(function(){return k(e,`deleteBucket`),t.http.send({method:`DELETE`,path:`/bucket/${e}`})},this.shouldThrowOnError)]})})},e}();function ie(){return`@cloudbase/js-sdk`}var ae={INVALID_PARAMS:`INVALID_PARAMS`,INVALID_SYNTAX:`INVALID_SYNTAX`,INVALID_OPERATION:`INVALID_OPERATION`,OPERATION_FAIL:`OPERATION_FAIL`,NETWORK_ERROR:`NETWORK_ERROR`,UNKOWN_ERROR:`UNKOWN_ERROR`};let oe=(se={AbstractSDKRequest:()=>f,AbstractStorage:()=>p},ce={},So.d(ce,se),ce);var se,ce,le=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ue=function(){return ue=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},ue.apply(this,arguments)};function de(e){return typeof e==`string`}function fe(e,t){console.warn(`[@cloudbase/js-sdk][${e}]:${t}`)}var pe=function(e){function t(t){var n=e.call(this,t.msg||t.message||``)||this;return n.code=t.code||``,n.requestId=t.requestId||``,Object.defineProperty(n,"message",{value:t.msg||t.message||``,enumerable:!0,writable:!0,configurable:!0}),n}return le(t,e),t}(Error),me=function(e){return new pe(e)};function he(e,t){return(t||me)(e)}function ge(e){if(e&&typeof e==`object`&&e.data&&typeof e.data==`object`){var t=e.data,n=t.code,r=t.message;if(!e.code&&n||!e.message&&r)return ue(ue(ue({},e),!e.code&&n?{code:n}:{}),!e.message&&r?{message:r}:{})}return e}var _e,ve=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),j=function(){return j=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},j.apply(this,arguments)},ye=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},be=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){function t(t){var n=e.call(this)||this,r=t.timeout,i=t.timeoutMsg,a=t.restrictedMethods;return n.timeout=r||0,n.timeoutMsg=i||`请求超时`,n.restrictedMethods=a||[`get`,`post`,`upload`,`download`],n}ve(t,e),t.prototype.get=function(e){return this.request(j(j({},e),{method:`get`}),this.restrictedMethods.includes(`get`))},t.prototype.post=function(e){return this.request(j(j({},e),{method:`post`}),this.restrictedMethods.includes(`post`))},t.prototype.put=function(e){return this.request(j(j({},e),{method:`put`}))},t.prototype.upload=function(e){var t=e,n=t.data,r=t.file,i=t.fileContent,a=t.name,o=t.method,s=t.headers,c=s===void 0?{}:s,l=r??i,u={post:`post`,put:`put`}[o?.toLowerCase()]||`put`,d=new FormData;return u===`post`?(Object.keys(n).forEach(function(e){d.append(e,n[e])}),d.append(`key`,a),d.append(`file`,l instanceof Blob?l:new Blob([l])),this.request(j(j({},e),{data:d,method:u}),this.restrictedMethods.includes(`upload`))):this.request(j(j({},e),{method:`put`,headers:c,body:l}),this.restrictedMethods.includes(`upload`))},t.prototype.download=function(e){return ye(this,void 0,Promise,function(){var t,n,r,i;return be(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.get(j(j({},e),{headers:{},responseType:`blob`}))];case 1:return t=a.sent().data,n=window.URL.createObjectURL(new Blob([t])),r=decodeURIComponent(new URL(e.url).pathname.split(`/`).pop()||``),(i=document.createElement(`a`)).href=n,i.setAttribute(`download`,r),i.style.display=`none`,document.body.appendChild(i),i.click(),window.URL.revokeObjectURL(n),document.body.removeChild(i),[3,3];case 2:return a.sent(),[3,3];case 3:return[2,new Promise(function(t){t({statusCode:200,tempFilePath:e.url})})]}})})},t.prototype.fetch=function(e){return ye(this,void 0,Promise,function(){var t,n,r,i,a,o,s,c,l,u,d,f,p,m=this;return be(this,function(h){switch(h.label){case 0:return t=new AbortController,n=e.url,r=e.enableAbort,i=r!==void 0&&r,a=e.stream,o=a!==void 0&&a,s=e.signal,c=e.timeout,l=e.shouldThrowOnError,u=l===void 0||l,d=c??this.timeout,s&&(s.aborted&&t.abort(),s.addEventListener(`abort`,function(){return t.abort()})),f=null,i&&d&&(f=setTimeout(function(){console.warn(m.timeoutMsg),t.abort(Error(m.timeoutMsg))},d)),[4,fetch(n,j(j({},e),{signal:t.signal})).then(function(e){return ye(m,void 0,void 0,function(){var t,n,r;return be(this,function(i){switch(i.label){case 0:return clearTimeout(f),u?e.ok?(t=e,[3,3]):[3,1]:[3,4];case 1:return r=(n=Promise).reject,[4,e.json()];case 2:t=r.apply(n,[i.sent()]),i.label=3;case 3:return[2,t];case 4:return[2,e]}})})}).catch(function(e){return clearTimeout(f),Promise.reject(e)})];case 1:return p=h.sent(),[2,{data:o?p.body:p.headers.get(`content-type`)?.includes(`application/json`)?p.json():p.text(),statusCode:p.status,header:p.headers,response:p}]}})})},t.prototype.request=function(e,t){var n=this;t===void 0&&(t=!1);var r=String(e.method).toLowerCase()||`get`;return new Promise(function(i){var a=e.url,o=e.headers,s=o===void 0?{}:o,c=e.data,l=e.responseType,u=e.withCredentials,d=e.body,f=e.onUploadProgress,p=function(e,t,n){n===void 0&&(n={});var r=/\?/.test(t),i=``;return Object.keys(n).forEach(function(e){i===``?!r&&(t+=`?`):i+=`&`,i+=`${e}=${encodeURIComponent(n[e])}`}),/^http(s)?:\/\//.test(t+=i)?t:`${e}${t}`}(`https:`,a,r===`get`?c:{}),m=new XMLHttpRequest;m.open(r,p),l&&(m.responseType=l);var h,g,_,v=e.signal;v&&(v.aborted?m.abort():v.addEventListener(`abort`,function(){return m.abort()},{once:!0})),Object.keys(s).forEach(function(e){m.setRequestHeader(e,s[e])}),f&&m.upload.addEventListener(`progress`,f),m.onreadystatechange=function(){var e={};if(m.readyState===4){var t=m.getAllResponseHeaders().trim().split(/[\r\n]+/),n={};t.forEach(function(e){var t=e.split(`: `),r=t.shift().toLowerCase();n[r]=t.join(`: `)}),e.header=n,e.statusCode=m.status;try{e.data=l===`blob`?m.response:JSON.parse(m.responseText)}catch{e.data=l===`blob`?m.response:m.responseText}clearTimeout(h),i(e)}},t&&n.timeout&&(h=setTimeout(function(){console.warn(n.timeoutMsg),m.abort()},n.timeout)),_=c,g=Object.prototype.toString.call(_)===`[object FormData]`?c:s[`content-type`]===`application/x-www-form-urlencoded`?function(e){e===void 0&&(e={});var t=[];return Object.keys(e).forEach(function(n){t.push(`${n}=${encodeURIComponent(e[n])}`)}),t.join(`&`)}(c):d||(c?JSON.stringify(c):void 0),u&&(m.withCredentials=!0),m.send(g)})}})(oe.AbstractSDKRequest),function(e){e.WEB=`web`,e.WX_MP=`wx_mp`}(_e||={});var xe=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Ce=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},we=function(e){function t(t){var n=e.call(this)||this;return n.root=t,t.tcbCacheObject||={},n}return xe(t,e),t.prototype.setItem=function(e,t){this.root.tcbCacheObject[e]=t},t.prototype.getItem=function(e){return this.root.tcbCacheObject[e]},t.prototype.removeItem=function(e){delete this.root.tcbCacheObject[e]},t.prototype.clear=function(){delete this.root.tcbCacheObject},t}(oe.AbstractStorage);(function(){function e(e){this.keys={};var t=e.persistence,n=e.platformInfo,r=n===void 0?{}:n,i=e.keys,a=i===void 0?{}:i;this.platformInfo=r,this.storage||(this.persistenceTag=this.platformInfo.adapter.primaryStorage||t,this.storage=function(e,t){switch(e){case`local`:default:return t.localStorage?t.localStorage:(fe(ae.INVALID_PARAMS,`localStorage is not supported on current platform`),new we(t.root));case`none`:return new we(t.root)}}(this.persistenceTag,this.platformInfo.adapter),this.keys=a)}Object.defineProperty(e.prototype,"mode",{get:function(){return this.storage.mode||`sync`},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"persistence",{get:function(){return this.persistenceTag},enumerable:!1,configurable:!0}),e.prototype.setStore=function(e,t,n){if(this.mode!==`async`){if(this.storage)try{var r={version:n||`localCachev1`,content:t};this.storage.setItem(e,JSON.stringify(r))}catch(e){throw Error(JSON.stringify({code:ae.OPERATION_FAIL,msg:`[@cloudbase/js-sdk][${ae.OPERATION_FAIL}]setStore failed`,info:e}))}}else fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use setStoreAsync insteed`)},e.prototype.setStoreAsync=function(e,t,n){return Se(this,void 0,void 0,function(){var r;return Ce(this,function(i){switch(i.label){case 0:if(!this.storage)return[2];i.label=1;case 1:return i.trys.push([1,3,,4]),r={version:n||`localCachev1`,content:t},[4,this.storage.setItem(e,JSON.stringify(r))];case 2:return i.sent(),[3,4];case 3:return i.sent(),[2];case 4:return[2]}})})},e.prototype.getStore=function(e,t){if(this.mode!==`async`){try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token;if(!this.storage)return``}catch{return``}t||=`localCachev1`;var n=this.storage.getItem(e);return n&&n.indexOf(t)>=0?JSON.parse(n).content:``}fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use getStoreAsync insteed`)},e.prototype.getStoreAsync=function(e,t){return Se(this,void 0,void 0,function(){var n;return Ce(this,function(r){switch(r.label){case 0:try{if(typeof process<`u`&&{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token)return[2,{IS_MP_BUILD:!1,IS_BROWSER_BUILD:!0}.tcb_token];if(!this.storage)return[2,``]}catch{return[2,``]}return t||=`localCachev1`,[4,this.storage.getItem(e)];case 1:return(n=r.sent())&&n.indexOf(t)>=0?[2,JSON.parse(n).content]:[2,``]}})})},e.prototype.removeStore=function(e){this.mode===`async`?fe(ae.INVALID_OPERATION,`current platform's storage is asynchronous, please use removeStoreAsync insteed`):this.storage.removeItem(e)},e.prototype.removeStoreAsync=function(e){return Se(this,void 0,void 0,function(){return Ce(this,function(t){switch(t.label){case 0:return[4,this.storage.removeItem(e)];case 1:return t.sent(),[2]}})})}})();var Te=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),M=function(e,t){this.data=t||null,this.name=e},Ee=function(e){function t(t,n){var r=e.call(this,`error`,{error:t,data:n})||this;return r.error=t,r}return Te(t,e),t}(M),N=function(){function e(){this.listeners={}}return e.prototype.on=function(e,t){return function(e,t,n){n[e]=n[e]||[],n[e].push(t)}(e,t,this.listeners),this},e.prototype.off=function(e,t){return function(e,t,n){if(n?.[e]){var r=n[e].indexOf(t);r!==-1&&n[e].splice(r,1)}}(e,t,this.listeners),this},e.prototype.fire=function(e,t){if(e instanceof Ee)return console.error(e.error),this;var n=de(e)?new M(e,t||{}):e,r=n.name;if(this.listens(r)){n.target=this;for(var i=0,a=this.listeners[r]?function(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||(r||=Array.prototype.slice.call(t,0,i),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}([],this.listeners[r],!0):[];i<a.length;i++)a[i].call(this,n)}return this},e.prototype.listens=function(e){return this.listeners[e]&&this.listeners[e].length>0},e}();new N,new N,typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.indexOf(`Firefox`),(e=>{var t={};return So.d(t,e),t})({default:()=>b}).default;var P,De=So(388),Oe=function(){return Oe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Oe.apply(this,arguments)},ke=function(e,t,n,r){var i,a=arguments.length,o=a<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,n,o):i(t,n))||o);return a>3&&o&&Object.defineProperty(t,n,o),o},Ae=function(e,t){if(typeof Reflect==`object`&&typeof Reflect.metadata==`function`)return Reflect.metadata(e,t)},je=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},Me=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}};(function(e){e.put=`put`,e.post=`post`})(P||={});var Ne=ie,Pe=ae,Fe=`https://support.qq.com/products/148793`,Ie=function(e){return Object.prototype.toString.call(e)===`[object Array]`},Le=de,Re=function(e){return Object.prototype.toString.call(e)===`[object Object]`},ze=function(e,t,n){if(n===void 0&&(n=null),e&&typeof e==`function`)return e(t,n);if(t)throw t;return n},Be=function(e,t){if(function(e){return!e||typeof e.throw!=`boolean`||e.throw}(e))throw he(ue(ue({},t),{msg:t.message}),e?.errorFactory);return ue({code:t.code,message:t.message},t.requestId?{requestId:t.requestId}:{})},Ve=fe,He=function(e){return e.mode,e.customInfo,e.title,e.messages,function(e,t,n){}},Ue=`storage`;function We(e,t){return t&&typeof t!=`function`?[Oe(Oe({},e),{customReqOpts:t}),void 0]:[e,t]}var Ge=function(e,t,n){return je(void 0,void 0,void 0,function(){var r,i;return Me(this,function(a){switch(a.label){case 0:return[4,e.gateWay({path:`storages`,name:`get-objects-upload-info`,data:[Oe({objectId:t.path},t.signedHeader?{signedHeader:t.signedHeader}:{})]},n)];case 1:return r=ge(r=a.sent()),i=r.data?.[0]||{},[2,Oe(Oe({},r),{data:Oe(Oe({},i.code?Oe({},i):{}),{authorization:i.authorization,token:i.token,url:i.uploadUrl,fileId:i.cloudObjectId,cosFileId:i.cloudObjectMeta,download_url:i.downloadUrl})})]}})})},Ke=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`get-objects-download-info`,data:t.convertedFileList.map(function(e){return Oe({cloudObjectId:e.fileid},e.max_age==null?{}:{maxAge:e.max_age})})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{download_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,message:e.message,fileid:e.cloudObjectId,download_url:e.downloadUrl,fileID:e.cloudObjectId,tempFileURL:e.downloadUrl,mime_type:e.contentType||F(null,e.cloudObjectId||``)}}):[]}})]}})})},qe=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`delete-objects`,data:t.fileList.map(function(e){return{cloudObjectId:e}})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{delete_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,fileID:e.cloudObjectId,message:e.message}}):[]}})]}})})},Je=function(e,t,n){return je(void 0,void 0,void 0,function(){var r;return Me(this,function(i){switch(i.label){case 0:return[4,e.gateWay({path:`storages`,name:`copy-objects`,data:t.convertedFileList.map(function(e){return{srcPath:e.src_path,dstPath:e.dst_path,overwrite:e.overwrite,removeOriginal:e.remove_original}})},n)];case 1:return r=ge(r=i.sent()),[2,Oe(Oe({},r),{data:{copy_list:Array.isArray(r.data)?r.data.map(function(e){return{code:e.code||`SUCCESS`,fileID:e.cloudObjectId,fileId:e.cloudObjectId,message:e.message}}):[]}})]}})})},Ye={txt:`text/plain`,json:`application/json`,html:`text/html`,htm:`text/html`,css:`text/css`,js:`application/javascript`,csv:`text/csv`,xml:`application/xml`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,svg:`image/svg+xml`,ico:`image/x-icon`,pdf:`application/pdf`,zip:`application/zip`,gz:`application/gzip`,mp4:`video/mp4`,webm:`video/webm`,mp3:`audio/mpeg`,wav:`audio/wav`};function F(e,t){if(typeof Blob<`u`&&e instanceof Blob&&e.type)return e.type;var n=/\.([a-zA-Z0-9]+)$/.exec(t||``);return Ye[n?n[1].toLowerCase():``]||`application/octet-stream`}function Xe(){return typeof globalThis.wx?.getFileSystemManager==`function`}function Ze(e,t){var n=t.toLowerCase();return Object.keys(e).some(function(e){return e.toLowerCase()===n})}function Qe(e){return Object.keys(e).reduce(function(t,n){var r;return Oe(Oe({},t),((r={})[n]=[e[n]],r))},{})}function $e(e){return typeof e==`number`&&Number.isInteger(e)&&e>=1}var et=function(){function e(e){this.context=e}var t,n,r,i,a,s,c,l,u,d,f,p,m,h,g,_,v;return Object.defineProperty(e.prototype,"config",{get:function(){return this.context?.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.context?.request},enumerable:!1,configurable:!0}),e.prototype.isGateWay=function(){return(this.config.endPointMode||`CLOUD_API`)===`GATEWAY`},e.prototype.uploadFile=function(e,t){var n;return je(this,void 0,Promise,function(){var r,i,a,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,ee,te,O,k,A,ne,re,ie,ae,oe;return Me(this,function(se){switch(se.label){case 0:if(re=We(e,t),e=re[0],t=re[1],r=e.cloudPath,i=e.filePath,a=e.onUploadProgress,ie=e.method,s=ie===void 0?`put`:ie,ae=e.headers,c=ae===void 0?{}:ae,l=e.fileContent,!Le(r)||!i&&!l)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.uploadFile] invalid params`})];if(i&&l&&console.warn(`[${Ne()}][${Ue}.uploadFile] fileContent 是兼容字段,与 filePath 同时传入时忽略,实际使用 filePath`),u=i??l,(d={put:P.put,post:P.post}[s.toLocaleLowerCase()]||P.put)===P.post&&console.warn(`[${Ne()}][${Ue}.uploadFile] method: 'post' 已废弃,请改用 'put'`),f=this.isGateWay(),p=Oe({},c),m=Object.keys(c).reduce(function(e,t){return t.toLowerCase()!==`content-length`&&(e[t]=c[t]),e},{}),d===P.put&&f){if(!Ze(p,`content-length`)){if(h=((n=this.request)?.getUploadByteLength)?.call(n,u),typeof(g=typeof h==`number`?h:function(e){if((!Xe()||typeof e!=`string`)&&e!==null){if(typeof Blob<`u`&&e instanceof Blob)return e.size;if(typeof ArrayBuffer<`u`&&(e instanceof ArrayBuffer||typeof ArrayBuffer.isView==`function`&&ArrayBuffer.isView(e)))return e.byteLength;if(typeof e==`string`){if(typeof Blob<`u`)return new Blob([e]).size;var t=(n=e,(r=o())?.byteLength(n));return typeof t==`number`?t:e.length}var n,r;return typeof e==`object`&&typeof e.size==`number`?e.size:void 0}}(u))!=`number`)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:Xe()?`[${Ue}.uploadFile] 无法计算 content-length,请确认上传内容为有效的本地临时路径,或传入 ArrayBuffer`:`[${Ue}.uploadFile] 无法计算 content-length,请传入 File/Blob/Buffer/ArrayBuffer,或在 headers 中提供 content-length`})];p[`content-length`]=String(g)}Ze(p,`content-type`)||(p[`content-type`]=F(u,r)),Ze(m,`content-type`)||(m[`content-type`]=F(u,r))}return[4,this.getUploadMetadata({cloudPath:r,method:d,headers:d!==P.put||f?void 0:m,signedHeader:d===P.put&&f?Qe(p):void 0,customReqOpts:e.customReqOpts})];case 1:return _=se.sent(),v=_.data,y=_.requestId,(b=v)?.code||!b?.url?(x=b?.code||Pe.OPERATION_FAIL,S=b?.message||`get upload info failed`,[2,ze(t,Error(`[${Ne()}][${x}][${Ue}]:${S}`))]):(C=v.url,w=v.authorization,T=v.token,E=v.fileId,D=v.cosFileId,ee=v.download_url,O=Oe(Oe({},te={url:C,file:u,name:r,onUploadProgress:a,fileId:E,requestId:y}),{method:P.put,headers:Oe(Oe({},m),{authorization:w,"x-cos-meta-fileid":D,"x-cos-security-token":T})}),k=Oe(Oe({},te),{method:P.post,data:{key:r,signature:w,"x-cos-meta-fileid":D,success_action_status:`201`,"x-cos-security-token":T}}),(oe={})[P.put]={params:O,isSuccess:function(e){return e>=200&&e<300}},oe[P.post]={params:k,isSuccess:function(e){return e===201}},A=oe,[4,this.request.upload(A[d].params)]);case 2:return ne=se.sent(),A[d].isSuccess(ne.statusCode)?[2,ze(t,null,{fileID:E,download_url:ee,requestId:y})]:[2,ze(t,Error(`[${Ne()}][${Pe.OPERATION_FAIL}][${Ue}]:${ne.data}`))]}})})},e.prototype.getUploadMetadata=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d;return Me(this,function(f){switch(f.label){case 0:if(n=e.cloudPath,r=e.method,i=e.headers,a=e.signedHeader,!Le(n))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getUploadMetadata] invalid cloudPath`})];o=this.request,s=`storage.getUploadMetadata`,f.label=1;case 1:return f.trys.push([1,6,,7]),c=void 0,l={path:n},u=this.isGateWay(),r&&(l.method=r),r===P.put&&(u&&a?l.signedHeader=a:!u&&i&&(l.headers=i)),r!==P.post&&u?[3,3]:[4,o.send(s,l,{endPointMode:`CLOUD_API`},e.customReqOpts)];case 2:return c=f.sent(),[3,5];case 3:return[4,Ge(o,l,e.customReqOpts)];case 4:c=f.sent(),f.label=5;case 5:return[2,ze(t,null,c)];case 6:return d=f.sent(),[2,ze(t,d)];case 7:return[2]}})})},e.prototype.deleteFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u;return Me(this,function(d){switch(d.label){case 0:if(u=We(e,t),e=u[0],t=u[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.deleteFile] fileList must not be empty`})];for(r=0,i=n;r<i.length;r++)if(!(a=i[r])||!Le(a))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.deleteFile] fileID must be string`})];return o=`storage.batchDeleteFile`,s=this.request,c={},this.isGateWay()?[4,qe(s,{fileList:n},e.customReqOpts)]:[3,2];case 1:return c=d.sent(),[3,4];case 2:return[4,s.send(o,{fileid_list:n},e.customReqOpts)];case 3:c=d.sent(),d.label=4;case 4:return c.code?[2,ze(t,null,c)]:(l={fileList:c.data.delete_list,requestId:c.requestId},[2,ze(t,null,l)])}})})},e.prototype.getTempFileURL=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d,f,p;return Me(this,function(m){switch(m.label){case 0:if(p=We(e,t),e=p[0],t=p[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] fileList must not be empty`})];for(r=[],i=!1,a=0,o=n;a<o.length;a++)if(s=o[a],Re(s)){if(!Object.prototype.hasOwnProperty.call(s,`fileID`))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] file info must include fileID`})];if(c={fileid:s.fileID},Object.prototype.hasOwnProperty.call(s,`maxAge`)){if(!$e(l=s.maxAge))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] maxAge must be an integer greater than or equal to 1`})];l>3600&&!i&&(Ve(Pe.INVALID_PARAMS,`[${Ue}.getTempFileURL] maxAge ${l} 大于 3600,仍按原值下发`),i=!0),c.max_age=l}r.push(c)}else{if(!Le(s))return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] invalid fileList`})];r.push({fileid:s})}return u=`storage.batchGetDownloadUrl`,d=this.request,f={},this.isGateWay()?[4,Ke(d,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return f=m.sent(),[3,4];case 2:return[4,d.send(u,{file_list:r},e.customReqOpts)];case 3:f=m.sent(),m.label=4;case 4:return f.code?[2,ze(t,null,f)]:[2,ze(t,null,{fileList:Array.isArray(f.data?.download_list)?f.data.download_list:[],requestId:f.requestId})]}})})},e.prototype.downloadFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c;return Me(this,function(l){switch(l.label){case 0:return c=We(e,t),e=c[0],t=c[1],n=e.fileID,Le(n)?[4,this.getTempFileURL.call(this,{fileList:[{fileID:n,maxAge:600}],customReqOpts:e.customReqOpts})]:[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.getTempFileURL] fileID must be string`})];case 1:return r=l.sent(),(i=r.fileList[0]).code===`SUCCESS`?(a=this.request,o=encodeURI(i.download_url),[4,a.download({url:o,tempFilePath:e.tempFilePath})]):[2,ze(t,i)];case 2:return s=l.sent(),[2,ze(t,null,s)]}})})},e.prototype.copyFile=function(e,t){return je(this,void 0,Promise,function(){var n,r,i,a,o,s,c,l,u,d;return Me(this,function(f){switch(f.label){case 0:if(d=We(e,t),e=d[0],t=d[1],!(n=e.fileList)||!Ie(n)||n.length===0)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] fileList must not be empty`})];for(r=[],i=0,a=n;i<a.length;i++){if(o=a[i],s=o.srcPath,c=o.dstPath,!s||!c||typeof s!=`string`||typeof c!=`string`)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] srcPath and dstPath may not be empty`})];if(s===c)return[2,Be(this.config,{code:Pe.INVALID_PARAMS,message:`[${Ue}.copyFile] srcPath and dstPath can not be the same`})];r.push({src_path:s,dst_path:c,overwrite:o.overwrite,remove_original:o.removeOriginal})}return l=this.request,u={},this.isGateWay()?[4,Je(l,{convertedFileList:r},e.customReqOpts)]:[3,2];case 1:return u=f.sent(),[3,4];case 2:return[4,l.send(`storage.batchCopyFile`,{file_list:r},e.customReqOpts)];case 3:u=f.sent(),f.label=4;case 4:return u.code?[2,ze(t,null,u)]:[2,ze(t,null,{fileList:u.data.copy_list,requestId:u.requestId})]}})})},e.prototype.getFileInfo=function(e){return je(this,void 0,Promise,function(){var t,n=this;return Me(this,function(r){switch(r.label){case 0:return[4,this.getTempFileURL(e)];case 1:return(t=r.sent())?.fileList&&t?.fileList?.length>0?[4,Promise.all(t.fileList.map(function(e){return je(n,void 0,void 0,function(){var t,n,r,i,a,o,s;return Me(this,function(c){switch(c.label){case 0:if(e.code!==`SUCCESS`)return[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,message:e.message}];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.request.fetch({url:e.tempFileURL,method:`HEAD`})];case 2:return t=c.sent(),n=t.header,typeof Headers<`u`&&n instanceof Headers&&(r={},n.forEach(function(e,t){r[t]=e}),n=r),i=parseInt(n[`content-length`])||0,a=n[`content-type`]||``,[400,404].includes(Number(t.statusCode))?[2,{code:`FILE_NOT_FOUND`,fileID:e.fileID,tempFileURL:e.tempFileURL,message:`file not found`}]:[2,{code:e.code,fileID:e.fileID,tempFileURL:e.tempFileURL,cloudId:e.fileID,fileName:e.fileID.split(`/`).pop(),contentType:a,mime:a.split(`;`)[0].trim(),size:i,etag:n.etag||``,lastModified:n[`last-modified`]||``,cacheControl:n[`cache-control`]||``}];case 3:return o=c.sent(),s=typeof o==`object`&&o&&`message`in o?String(o.message):void 0,[2,{code:`FETCH_FILE_INFO_ERROR`,fileID:e.fileID,tempFileURL:e.tempFileURL,message:s}];case 4:return[2]}})})}))]:[3,3];case 2:return[2,{fileList:r.sent(),requestId:t.requestId}];case 3:return[2,{fileList:[],requestId:t.requestId}]}})})},ke([He({customInfo:{className:`Cloudbase`,methodName:`uploadFile`},title:`上传文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 uploadFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(t=De.ICloudbaseUploadFileParams!==void 0&&De.ICloudbaseUploadFileParams)==`function`?t:Object,typeof(n=typeof Function<`u`&&Function)==`function`?n:Object]),Ae(`design:returntype`,typeof(r=typeof Promise<`u`&&Promise)==`function`?r:Object)],e.prototype,`uploadFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`getUploadMetadata`},title:`获取上传元信息失败`,messages:[`请确认以下各项:`,` 1 - 调用 getUploadMetadata() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[Object,typeof(i=typeof Function<`u`&&Function)==`function`?i:Object]),Ae(`design:returntype`,typeof(a=typeof Promise<`u`&&Promise)==`function`?a:Object)],e.prototype,`getUploadMetadata`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`deleteFile`},title:`删除文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 deleteFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(s=De.ICloudbaseDeleteFileParams!==void 0&&De.ICloudbaseDeleteFileParams)==`function`?s:Object,typeof(c=typeof Function<`u`&&Function)==`function`?c:Object]),Ae(`design:returntype`,typeof(l=typeof Promise<`u`&&Promise)==`function`?l:Object)],e.prototype,`deleteFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`getTempFileURL`},title:`获取文件下载链接`,messages:[`请确认以下各项:`,` 1 - 调用 getTempFileURL() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(u=De.ICloudbaseGetTempFileURLParams!==void 0&&De.ICloudbaseGetTempFileURLParams)==`function`?u:Object,typeof(d=typeof Function<`u`&&Function)==`function`?d:Object]),Ae(`design:returntype`,typeof(f=typeof Promise<`u`&&Promise)==`function`?f:Object)],e.prototype,`getTempFileURL`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`downloadFile`},title:`下载文件失败`,messages:[`请确认以下各项:`,` 1 - 调用 downloadFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(p=De.ICloudbaseDownloadFileParams!==void 0&&De.ICloudbaseDownloadFileParams)==`function`?p:Object,typeof(m=typeof Function<`u`&&Function)==`function`?m:Object]),Ae(`design:returntype`,typeof(h=typeof Promise<`u`&&Promise)==`function`?h:Object)],e.prototype,`downloadFile`,null),ke([He({customInfo:{className:`Cloudbase`,methodName:`copyFile`},title:`批量复制文件`,messages:[`请确认以下各项:`,` 1 - 调用 copyFile() 的语法或参数是否正确`,` 2 - 当前域名是否在安全域名列表中:https://console.cloud.tencent.com/tcb/env/safety`,` 3 - 云存储安全规则是否限制了当前登录状态访问`,`如果问题依然存在,建议到官方问答社区提问或寻找帮助:${Fe}`]}),Ae(`design:type`,Function),Ae(`design:paramtypes`,[typeof(g=De.ICloudbaseCopyFileParams!==void 0&&De.ICloudbaseCopyFileParams)==`function`?g:Object,typeof(_=typeof Function<`u`&&Function)==`function`?_:Object]),Ae(`design:returntype`,typeof(v=typeof Promise<`u`&&Promise)==`function`?v:Object)],e.prototype,`copyFile`,null),e}(),I=function(){return I=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},I.apply(this,arguments)},tt=function(e,t,n,r){return new(n||=Promise)(function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((r=r.apply(e,t||[])).next())})},L=function(e,t){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==`function`&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw TypeError(`Generator is already executing.`);for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||s[0]!==6&&s[0]!==2)){o=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(s[0]===6&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},R=ae,nt=function(){function e(e,t){t===void 0&&(t=!1),this.shouldThrowOnError=!1,this.bucketId=``,this.context=e,this.shouldThrowOnError=t,this.storage=new et(e)}return Object.defineProperty(e.prototype,"config",{get:function(){return this.context?.config},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"request",{get:function(){return this.context?.request},enumerable:!1,configurable:!0}),e.prototype.throwOnError=function(){return this.shouldThrowOnError=!0,this},e.prototype.upload=function(e,t,n){return tt(this,void 0,Promise,function(){var i,a,o,s,c,l,u,d,f;return L(this,function(p){switch(p.label){case 0:i=I({upsert:!0},n),a=i.cacheControl,o=i.contentType,s=i.metadata,p.label=1;case 1:return p.trys.push([1,3,,4]),c=this.getCloudPath(e),l={cloudPath:c,filePath:t},(a||o||s)&&(u={},a&&(u[`cache-control`]=a),o&&(u[`content-type`]=o),s&&(u[`x-cos-metadata-metadata`]=this.toBase64(JSON.stringify(s))),l.headers=u),[4,this.storage.uploadFile(l)];case 2:if(!(d=p.sent()).fileID)throw Error(JSON.stringify({code:R.OPERATION_FAIL,msg:`[${Ue}.update] no fileID returned`}));return[2,{data:{id:d.fileID,path:e,fullPath:e},error:null}];case 3:if(f=p.sent(),this.shouldThrowOnError)throw f;if(r(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},e.prototype.uploadToSignedUrl=function(e,t,n,r){return tt(this,void 0,Promise,function(){return L(this,function(t){return[2,this.upload(e,n,r)]})})},e.prototype.createSignedUploadUrl=function(e){return tt(this,void 0,Promise,function(){var t,r,i;return L(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),t=this.getCloudPath(e),[4,this.storage.getUploadMetadata({cloudPath:t})];case 1:return[2,{data:{signedUrl:(r=a.sent().data).url,token:r.token,path:e,authorization:r.authorization,id:r.fileId,cosFileId:r.cosFileId,downloadUrl:r.download_url},error:null}];case 2:if(i=a.sent(),this.shouldThrowOnError)throw i;return[2,{data:null,error:i instanceof n?i:new n(i.message)}];case 3:return[2]}})})},e.prototype.update=function(e,t,n){return tt(this,void 0,Promise,function(){return L(this,function(r){return[2,this.upload(e,t,I(I({},n),{upsert:!0}))]})})},e.prototype.move=function(e,t){return tt(this,void 0,Promise,function(){var i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!0}]})];case 1:if((i=o.sent()).fileList[0].code&&i.fileList[0].code!==`SUCCESS`)throw new n(i.fileList[0].message||`Move failed`);return[2,{data:{message:`File moved from ${e} to ${t}`},error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.copy=function(e,t){return tt(this,void 0,Promise,function(){var i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.copyFile({fileList:[{srcPath:this.getCloudPath(e),dstPath:this.getCloudPath(t),overwrite:!0,removeOriginal:!1}]})];case 1:if((i=o.sent()).fileList[0].code&&i.fileList[0].code!==`SUCCESS`)throw new n(i.fileList[0].message||`Copy failed`);return[2,{data:{path:this.getCloudPath(t)},error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.createSignedUrl=function(e,t,i){return tt(this,void 0,Promise,function(){var a,o,s,c,l,u,d;return L(this,function(f){switch(f.label){case 0:if(f.trys.push([0,2,,3]),!$e(t))throw new n(`[${Ue}.createSignedUrl] expiresIn must be an integer greater than or equal to 1`);return a=this.normalizeCloudId(e),[4,this.storage.getTempFileURL({fileList:[{fileID:a,maxAge:t}]})];case 1:if((o=f.sent()).fileList[0].code!==`SUCCESS`)throw new n(`Failed to create signed URL: [${o.fileList[0].code}] ${o.fileList[0].fileID}`);return s=o.fileList[0].download_url,c=[],i?.download!==void 0&&(typeof i.download==`string`?c.push(`download=${encodeURIComponent(i.download)}`):!0===i.download&&c.push(`download=true`)),i!=null&&i.transform&&(l=this.transformOptsToQueryString(i.transform))&&c.push(l),c.length>0&&(u=s.includes(`?`)?`&`:`?`,s=`${s}${u}${c.join(`&`)}`),[2,{data:{signedUrl:s},error:null}];case 2:if(d=f.sent(),this.shouldThrowOnError)throw d;if(r(d))return[2,{data:null,error:d}];throw d;case 3:return[2]}})})},e.prototype.createSignedUrls=function(e,t){return tt(this,void 0,Promise,function(){var i,a,o=this;return L(this,function(s){switch(s.label){case 0:if(s.trys.push([0,2,,3]),!$e(t))throw new n(`[${Ue}.createSignedUrls] expiresIn must be an integer greater than or equal to 1`);return i=e.map(function(e){return{fileID:o.normalizeCloudId(e),maxAge:t}}),[4,this.storage.getTempFileURL({fileList:i})];case 1:return[2,{data:s.sent().fileList.map(function(t,n){return{path:e[n],signedUrl:t.tempFileURL||``,error:t.code===`SUCCESS`?null:t.message}}),error:null}];case 2:if(a=s.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.download=function(e,t){return tt(this,void 0,Promise,function(){var i,a,o=this;return L(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),a={},[4,tt(o,void 0,void 0,function(){var r,i,a;return L(this,function(o){switch(o.label){case 0:return[4,this.createSignedUrl(e,600,{transform:t})];case 1:if((r=o.sent()).error)throw r.error;return i=encodeURI(r.data?.signedUrl),[4,this.request.reqClass.get({url:i,headers:{},responseType:`blob`})];case 2:if(!(a=o.sent().data))throw new n(`Download failed: no file content`);return[2,new Blob([a])]}})})];case 1:return[2,(a.data=s.sent(),a.error=null,a)];case 2:if(i=s.sent(),this.shouldThrowOnError)throw i;if(r(i))return[2,{data:null,error:i}];throw i;case 3:return[2]}})})},e.prototype.info=function(e){return tt(this,void 0,Promise,function(){var t,r,i,a,o,s,c,l;return L(this,function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=e.startsWith(`cloud://`),r=t?this.extractPathFromFileId(e):e,i=t?this.extractBucketFromFileId(e):this.bucketId,[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(a=u.sent(),(o=a.fileList[0]).code!==`SUCCESS`)throw new n(o.message);return s=new Date().toISOString(),c=(o.lastModified?new Date(o.lastModified):new Date).toISOString(),[2,{data:{id:o.fileID,version:`1`,name:r,bucketId:i,updatedAt:c,createdAt:c,lastAccessedAt:s,size:o.size,cacheControl:o.cacheControl,contentType:o.contentType,etag:o.etag,lastModified:c,metadata:{}},error:null}];case 2:if(l=u.sent(),this.shouldThrowOnError)throw l;return[2,{data:null,error:l instanceof n?l:new n(l.message)}];case 3:return[2]}})})},e.prototype.exists=function(e){return tt(this,void 0,Promise,function(){var t,i,a;return L(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.storage.getFileInfo({fileList:[this.normalizeCloudId(e)]})];case 1:if(t=o.sent(),(i=t.fileList[0]).code===`FILE_NOT_FOUND`)return[2,{data:!1,error:null}];if(i.code!==`SUCCESS`)throw new n(i.message);return[2,{data:!0,error:null}];case 2:if(a=o.sent(),this.shouldThrowOnError)throw a;if(r(a))return[2,{data:null,error:a}];throw a;case 3:return[2]}})})},e.prototype.getPublicUrl=function(e,t){return tt(this,void 0,Promise,function(){var n;return L(this,function(r){switch(r.label){case 0:return[4,this.createSignedUrl(e,600,t)];case 1:return(n=r.sent()).data?[2,{data:{publicUrl:n.data.signedUrl}}]:[2,{data:null,error:n.error}]}})})},e.prototype.remove=function(e){return tt(this,void 0,Promise,function(){var t,i,a,o,s,c,l,u,d,f,p=this;return L(this,function(m){switch(m.label){case 0:for(m.trys.push([0,3,,4]),t=10,i=[],a=0;a<e.length;a+=t)i.push(e.slice(a,a+t));return[4,Promise.all(i.map(function(e){return Promise.all(e.map(function(e){return p.info(e)}))}))];case 1:return o=m.sent(),s=new Map,o.forEach(function(n,r){n.forEach(function(n,i){n.data&&s.set(e[r*t+i],n.data)})}),c=e.map(function(e){return p.normalizeCloudId(e)}),[4,this.storage.deleteFile({fileList:c})];case 2:if(l=m.sent(),(u=l.fileList.filter(function(e){return e.code!==`SUCCESS`})).length>0)throw new n(`Delete failed for ${u.length} file(s)`);return d=new Date().toISOString(),[2,{data:e.map(function(e){var t=s.get(e);return{name:t?.name,id:t?.id,bucket_id:t?.bucketId,owner:void 0,updated_at:t?.updatedAt||d,created_at:t?.createdAt,last_accessed_at:t?.lastAccessedAt||d,metadata:t?.metadata||{},buckets:{id:t?.bucketId,name:t?.bucketId,owner:void 0,public:!1,created_at:``,updated_at:d}}}),error:null}];case 3:if(f=m.sent(),this.shouldThrowOnError)throw f;if(r(f))return[2,{data:null,error:f}];throw f;case 4:return[2]}})})},e.prototype.list=function(){return tt(this,void 0,void 0,function(){return L(this,function(e){throw new n(`Not implemented`)})})},e.prototype.getCloudPath=function(e){return e.replace(/^\/|\/$/g,``).replace(/\/+/g,`/`)},e.prototype.normalizeCloudId=function(e){if(/^cloud:\/\//.test(e))return e;var t=this.getCloudPath(e);if(!this.bucketId)throw new n(`bucketId is not set`);var r=this.config?.env||``;return r?`cloud://${r}.${this.bucketId}/${t}`:void 0},e.prototype.toBase64=function(e){return s(e)},e.prototype.transformOptsToQueryString=function(e){var t=[`imageMogr2`];if(e.width||e.height){var n=e.width||``,r=e.height||``;e.resize===`fill`?t.push(`thumbnail/${n}x${r}!`):e.resize===`contain`?t.push(`thumbnail/${n}x${r}`):t.push(`thumbnail/${n}x${r}^`)}if(e.format&&e.format!==`origin`&&t.push(`format/${e.format}`),e.quality!==void 0){var i=Math.max(1,Math.min(100,e.quality));t.push(`quality/${i}`)}return t.join(`/`)},e.prototype.extractPathFromFileId=function(e){var t=e.replace(/^cloud:\/\//,``).split(`/`);return t.length<2?e:t.slice(1).join(`/`)},e.prototype.extractBucketFromFileId=function(e){var t=e.replace(/^cloud:\/\//,``).split(`/`);if(t.length<1)return``;var n=t[0],r=n.indexOf(`.`);return r===-1?n:n.substring(r+1)},e}(),rt=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},e(t,n)};return function(t,n){if(typeof n!=`function`&&n!==null)throw TypeError(`Class extends value `+String(n)+` is not a constructor or null`);function r(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),it=new et,at={name:Ue,entity:{uploadFile:it.uploadFile,deleteFile:it.deleteFile,getTempFileURL:it.getTempFileURL,downloadFile:it.downloadFile,getUploadMetadata:it.getUploadMetadata,copyFile:it.copyFile,getFileInfo:it.getFileInfo,isGateWay:it.isGateWay}},z=function(e){function t(){return e!==null&&e.apply(this,arguments)||this}return rt(t,e),t.prototype.from=function(e){return e?(k(e,`from`),new te(this.http,e,this.shouldThrowOnError)):new nt(this.http.ctx,this.shouldThrowOnError)},t}(re),ot={name:`${Ue}/supabase`,IIFE:!0,entity:function(){var e=new WeakMap;Object.defineProperty(this.prototype,"storage",{get:function(){if(e.has(this))return e.get(this);var t=this,n=new z(new Proxy({},{get:function(e,n){return n===`config`?t.config:n===`request`?t.request:void 0}}));return e.set(this,n),n},configurable:!0,enumerable:!0})}};try{cloudbase.registerComponent(at),cloudbase.registerComponent(ot)}catch{}function st(e){try{e.registerComponent(at),e.registerComponent(ot)}catch(e){console.warn(e)}}try{window.registerStorage=st}catch{}var ct=st})(),Co.v;var wo=`2.0.17`,To=[`webhook`,`qmsg`,`serverchan`,`pushplus`,`dingtalk`,`wecom`,`bark`,`gocqhttp`,`onebot`,`atri`,`pushdeer`,`igot`,`telegram`,`feishu`,`lark`,`ifttt`,`wecombot`,`discord`,`wxpusher`,`ntfy`,`join`],Eo=class extends Error{};async function Do(e,t={}){let n=new AbortController,r=setTimeout(()=>n.abort(),3e4);try{let r=await fetch(e,{...t,signal:n.signal});return{response:r,text:await r.text()}}catch(e){throw n.signal.aborted?new Eo(`请求超时`):e}finally{clearTimeout(r)}}var Oo=class extends Error{kind;httpStatus;rawMessage;requestId;constructor(e,t,n={}){super(t),this.name=`TwikooError`,this.kind=e,this.httpStatus=n.httpStatus,this.rawMessage=n.rawMessage??t,this.requestId=n.requestId}},ko=class extends Oo{constructor(e){super(`CLIENT_ERROR`,e),this.name=`TwikooResponseError`}};function Ao(e){let t=e.result??e;if(t.code!==void 0&&t.code!==0)throw new ko(typeof t.message==`string`&&t.message?t.message:JSON.stringify(t.code)??``);return t}function jo(e){return e&&typeof e==`object`&&`message`in e?String(e.message):String(e)}var Mo={tcb:null,options:{}};function No(e,t){Mo.tcb=e,Mo.options=t}function Po(){return Mo}function Fo(e){return typeof e==`string`&&/^http(s)?:\/\//.test(e)}async function Io(e,t){let n;try{let r=localStorage.getItem(`twikoo-access-token`);n=JSON.stringify({accessToken:r,...t,envId:e})}catch(e){throw new Oo(`NETWORK`,`无法连接到后端`,{rawMessage:jo(e)})}try{let{response:t,text:r}=await Do(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:n}),{status:i}=t;if(i===200)try{let e=JSON.parse(r);return e.accessToken&&localStorage.setItem(`twikoo-access-token`,typeof e.accessToken==`string`?e.accessToken:``),e}catch{throw new Oo(`UNKNOWN`,`后端返回格式异常`,{rawMessage:r.slice(0,200)})}let a={httpStatus:i,rawMessage:r.slice(0,200)};throw i===404?new Oo(`NOT_FOUND`,`接口地址不存在`,a):i===401||i===403?new Oo(`CLIENT_ERROR`,`认证失败,请重新登录`,a):i===429?new Oo(`REJECTED`,`请求过于频繁`,a):i>=500?new Oo(`SERVER_ERROR`,`后端异常`,a):new Oo(`CLIENT_ERROR`,`请求失败(${i})`,a)}catch(e){throw e instanceof Oo?e:e instanceof Eo?new Oo(`TIMEOUT`,`请求超时`,{rawMessage:e.message}):new Oo(`CORS`,`请求被跨域策略拦截或网络不可达`,{rawMessage:jo(e)})}}async function Lo(e,t,n={}){let r=e??Mo.tcb,i=typeof n.envId==`string`?n.envId:typeof Mo.options.envId==`string`?Mo.options.envId:void 0,a=typeof n.funcName==`string`?n.funcName:typeof Mo.options.funcName==`string`?Mo.options.funcName:`twikoo`;if(r)return await r.app.callFunction({name:a,data:{event:t,...n}});if(typeof i==`string`&&Fo(i))return await Io(i,{event:t,...n});throw Error(`缺少 envId 配置 - https://twikoo.js.org`)}var Ro={verbose:1,info:2,warn:3,error:4}[(typeof process<`u`&&process.env,`info`).toLowerCase()]||2,zo={verbose:(...e)=>{Ro<=1&&console.log(...e)},info:(...e)=>{Ro<=2&&console.info(...e)},warn:(...e)=>{Ro<=3&&console.warn(...e)},error:(...e)=>{Ro<=4&&console.error(...e)}},Bo={ADMIN_CLIENT_VERSION:`前端版本:`,ADMIN_SERVER_VERSION:`云函数版本:`,ADMIN_COMMENT:`评论管理`,ADMIN_COMMENT_DELETE:`删除`,ADMIN_COMMENT_DELETE_CONFIRM:`确认删除?`,ADMIN_COMMENT_EDIT:`编辑`,ADMIN_COMMENT_EDIT_CANCEL:`取消`,ADMIN_COMMENT_EDIT_SAVE:`保存`,ADMIN_COMMENT_EDIT_DISCARD_CONFIRM:`确认不保存吗?`,ADMIN_COMMENT_FILTER_ALL:`全部`,ADMIN_COMMENT_FILTER_VISIBLE:`只看可见`,ADMIN_COMMENT_FILTER_HIDDEN:`只看隐藏`,ADMIN_COMMENT_HIDE:`隐藏`,ADMIN_COMMENT_IS_SPAM_SUFFIX:` (已隐藏)`,ADMIN_COMMENT_SEARCH:`搜索`,ADMIN_COMMENT_SEARCH_PLACEHOLDER:`搜索昵称、邮箱、网址、IP、评论正文、文章地址`,ADMIN_COMMENT_SHOW:`显示`,ADMIN_COMMENT_TOP:`置顶`,ADMIN_COMMENT_UNTOP:`取消置顶`,ADMIN_COMMENT_VIEW:`查看`,ADMIN_COMMENT_SECURITY_ALERT:`评论链接与本站不同!出于安全考虑,请手动复制以下网址访问:`,ADMIN_COMMENT_PARSE_ERROR:`无法解析评论链接,请仔细检查链接后手动复制以下网址访问:`,ADMIN_CONFIG:`配置管理`,ADMIN_CONFIG_CATEGORY_COMMON:`通用`,ADMIN_CONFIG_CATEGORY_IM:`即时通知`,ADMIN_CONFIG_CATEGORY_MAIL:`邮件通知`,ADMIN_CONFIG_CATEGORY_PLUGIN:`插件`,ADMIN_CONFIG_CATEGORY_PRIVACY:`隐私`,ADMIN_CONFIG_CATEGORY_SPAM:`反垃圾`,ADMIN_CONFIG_CATEGORY_CAPTCHA:`人机验证`,ADMIN_CONFIG_IMAGE_CDN_NONE:`无(不启用图片上传)`,ADMIN_CONFIG_CAPTCHA_NONE:`无`,ADMIN_CONFIG_CAPTCHA_TURNSTILE:`Cloudflare Turnstile`,ADMIN_CONFIG_CAPTCHA_GEETEST:`极验 Geetest`,ADMIN_CONFIG_CAPTCHA_CAP:`Cap`,ADMIN_CONFIG_EMAIL_TEST:`邮件通知测试`,ADMIN_CONFIG_EMAIL_TEST_BTN:`发送测试邮件`,ADMIN_CONFIG_EMAIL_TEST_HELP:`输入一个邮箱地址,发送测试邮件`,ADMIN_CONFIG_EMAIL_TEST_RESULT:`测试结果:`,ADMIN_CONFIG_EXAMPLE:`示例:`,ADMIN_CONFIG_ITEM_AKISMET_KEY:`Akismet 反垃圾评论,用于垃圾评论检测,设为 "MANUAL_REVIEW" 开启人工审核,留空不使用反垃圾。注册:https://akismet.com`,ADMIN_CONFIG_ITEM_BLOGGER_NICK:`博主的昵称。`,ADMIN_CONFIG_ITEM_BLOGGER_EMAIL:`博主的邮箱地址,用于邮件通知、博主标识。`,ADMIN_CONFIG_ITEM_COMMENT_BG_IMG:`评论框自定义背景图片 URL 地址。`,ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE:`评论列表分页大小,默认为 8。`,ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER:`评论框提示信息,可用<br>换行,默认为空`,ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN:`CORS 安全域名,注意:如果您不了解什么是 CORS,此项请留空,错误设置会导致无法加载,默认为空,格式为 https://blog.example.com;如需添加多域名请使用,分隔`,ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR:`默认的头像显示。默认值(留空)为 "initials",可选:"404"、"mp"、"identicon"、"monsterid"、"wavatar"、"retro"、"robohash"、"blank"`,ADMIN_CONFIG_ITEM_EMOTION_CDN:`表情 CDN,英文逗号分隔。默认为:https://owo.imaegoo.com/owo.json`,ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS:`违禁词配置,包含违禁词的内容会直接标记为垃圾评论。英文逗号分隔。`,ADMIN_CONFIG_ITEM_BLOCKED_WORDS:`屏蔽词配置,包含屏蔽词的内容会直接评论失败。英文逗号分隔。`,ADMIN_CONFIG_ITEM_GRAVATAR_CDN:`自定义头像 CDN 地址。如:cn.gravatar.com, weavatar.com, cravatar.cn, sdn.geekzu.org, gravatar.loli.net,默认:weavatar.com`,ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT:`隐藏管理面板入口。可设置一个“暗号”,只有在“昵称”一栏输入相同的“暗号”时,管理面板入口才会显示,留空则不隐藏管理入口`,ADMIN_CONFIG_ITEM_QQ_API_KEY:`QQ昵称API密钥,用于获取QQ昵称。前往 https://api.tqq.me/dashboard/api-keys 获取`,ADMIN_CONFIG_ITEM_HIGHLIGHT:`启用代码高亮功能。如果您的主题和代码高亮有冲突,请设为 false。默认:true`,ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME:`代码高亮主题,可选:"default"、"coy"、"dark"、"funky"、"okaidia"、"solarizedlight"、"tomorrow"、"twilight",访问 https://prismjs.com 可预览主题效果。如果您的主题和代码高亮有冲突,请设为 none。默认:none`,ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN:`代码高亮插件,可选:"showLanguage"、"copyButton",分别表示:展示代码语言、展示代码拷贝按钮。可以同时设置多个选项,如果想要不添加任何代码高亮插件,请设为 none。默认:none。`,ADMIN_CONFIG_ITEM_IMAGE_CDN:`插入图片所使用的图床,目前支持:"qcloud"、"7bu (https://7bu.top)"、"see (https://s.ee)"、"lskypro"、"piclist"、"easyimage"、"chevereto"、"S3 / R2 / MinIO"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_URL:`图床的 URL,仅当 IMAGE_CDN 为 "lskypro" / "piclist" / "easyimage" / "chevereto" 时需要填写`,ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN:`图床 token。qcloud 图床无需设置`,ADMIN_CONFIG_ITEM_NSFW_API_URL:`NSFW 图片检测 API 地址。免费服务:nsfw.qixz.cn,项目:github.com/HG-ha/nsfwpy`,ADMIN_CONFIG_ITEM_NSFW_THRESHOLD:`NSFW 检测阈值(0-1),当检测分数高于此值时拒绝上传。默认:0.5`,ADMIN_CONFIG_ITEM_S3_REGION:`S3 存储区域,例如 us-east-1。使用兼容 S3 的服务(如 Cloudflare R2、MinIO)时可填任意值`,ADMIN_CONFIG_ITEM_S3_BUCKET:`S3 存储桶名称`,ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID:`S3 Access Key ID`,ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY:`S3 Secret Access Key`,ADMIN_CONFIG_ITEM_S3_ENDPOINT:`S3 自定义 Endpoint,使用 Cloudflare R2、MinIO 等兼容 S3 的服务时填写`,ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE:`设置 S3_ENDPOINT 时,是否将 S3_BUCKET 拼入上传地址路径。默认为 true,适用于 Cloudflare R2、MinIO 等 path-style S3 兼容端点;使用已绑定存储桶的自定义域名时设为 false,例如腾讯云 COS 自定义域名`,ADMIN_CONFIG_ITEM_S3_CDN_URL:`S3 图片访问域名(CDN 域名),留空则使用默认 S3/Endpoint URL`,ADMIN_CONFIG_ITEM_S3_PATH_PREFIX:`S3 图片存储路径前缀,例如 images/twikoo,留空则存储在根目录`,ADMIN_CONFIG_ITEM_LIGHTBOX:`使用简易图片点击放大效果。默认:false`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE:`单个 IP 发言频率限制(条/10分钟),0 为无限制,默认:10`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL:`全站发言频率限制(条/10分钟),0 为无限制,默认:10`,ADMIN_CONFIG_ITEM_LIMIT_LENGTH:`评论长度限制,0 为无限制,默认:500`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT:`自定义通知邮件主题,留空则使用默认主题。`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN:`自定义博主通知邮件主题,留空则使用默认主题。`,ADMIN_CONFIG_ITEM_MAIL_TEMPLATE:"自定义通知邮件模板,留空则使用默认模板。可包含的字段:${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${PARENT_NICK}, ${PARENT_COMMENT}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${REPLY_TIME}, ${POST_URL}, ${IMG}, ${PARENT_IMG}",ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN:"自定义博主通知邮件模板,留空则使用默认模板。可包含的字段:${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${POST_URL}, ${IP}, ${MAIL}, ${IMG}",ADMIN_CONFIG_ITEM_MASTER_TAG:`博主标识自定义文字,默认为 “博主”。`,ADMIN_CONFIG_ITEM_NOTIFY_SPAM:`垃圾评论是否发送通知,默认:true`,ADMIN_CONFIG_ITEM_HIDE_SPAM:`前台评论区对所有人隐藏垃圾评论,包括管理员和评论作者。评论管理后台仍可审核和恢复。设为 true 开启,默认:false。`,ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER:`人机验证码提供商`,ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY:`Turnstile 验证码的站点密钥。申请地址: https://dash.cloudflare.com/?to=/:account/turnstile`,ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY:`Turnstile 验证码的密钥`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID:`极验验证码的 Captcha ID。申请地址: https://console.geetest.com/sensbot/management`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY:`极验验证码的 Captcha Key`,ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT:`Cap 验证码 API 端点。留空则使用内嵌 Cap(无需额外部署);外部 Standalone 格式:https://<实例地址>/<site_key>/`,ADMIN_CONFIG_ITEM_CAP_SECRET_KEY:`Cap Secret Key(仅外部 Standalone 需要;内嵌模式可留空)`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID:`腾讯云 secret id,用于垃圾评论检测。同时设置腾讯云和 Akismet 时,只有腾讯云会生效。注册:https://twikoo.js.org/cms.html`,ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE:`腾讯云内容安全 Biztype 名称,用于垃圾评论策略。可以自定义垃圾拦截规则`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY:`腾讯云 secret key`,ADMIN_CONFIG_ITEM_JEV_API_KEY:`Jev API Key,用于 AI 垃圾评论检测。仅在未配置腾讯云和 Akismet 时生效,优先于 LLM。`,ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT:`Jev API 接口地址,默认:https://api.typesafe.ai/v1/systemone`,ADMIN_CONFIG_ITEM_JEV_MODEL:`Jev 模型名称,默认:jev-latest`,ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD:`Jev 垃圾评论概率阈值,范围 0 到 1,默认:0.85`,ADMIN_CONFIG_ITEM_LLM_API_KEY:`LLM API Key,用于 AI 垃圾评论检测。仅在未配置腾讯云、Akismet 和 Jev 时生效。`,ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT:`LLM API 接口地址,默认:https://api.deepseek.com/v1`,ADMIN_CONFIG_ITEM_LLM_MODEL:`LLM 模型名称,默认:deepseek-v4-pro`,ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON:`自定义请求体 JSON(可选),合并进 chat/completions 请求体,如 {"reasoning_effort":"none","temperature":0}。优先级高于内置参数。若 JSON 语法错误,将忽略此配置。仅覆盖请求体字段;端点、API Key、请求头和超时等传输字段将被忽略`,ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT:`LLM 垃圾检测提示词(可选,留空则使用默认提示词)`,ADMIN_CONFIG_ITEM_LLM_TIMEOUT:`LLM 单次请求超时(毫秒),默认 30000。超时会中止请求并按 LLM_MAX_RETRIES 重试;留空或无效值使用默认值`,ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES:`LLM 检测最大重试次数(默认 3 次)`,ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL:`即时消息推送平台名称,支持:"qmsg"、"serverchan"、"pushplus"、"dingtalk"、"wecom"、"bark"、"gocqhttp"、"atri"、"pushdeer"、"igot"、"telegram"、"feishu" 等`,ADMIN_CONFIG_ITEM_PUSHOO_TOKEN:`即时消息推送 token。请参考 https://pushoo.js.org 里的详细说明配置`,ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS:`界面上展示的输入框,默认:nick,mail,link`,ADMIN_CONFIG_ITEM_REQUIRED_FIELDS:`评论必填信息,设为 nick,mail,link 代表全必填,设为 none 代表全选填,默认:nick,mail`,ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY:`是否同时通过 IM 和邮件 2 种方式通知博主,默认只通过 IM 通知博主,默认:false`,ADMIN_CONFIG_ITEM_SENDER_EMAIL:`邮件通知邮箱地址。对于大多数邮箱服务商,SENDER_EMAIL 必须和 SMTP_USER 保持一致,否则无法发送邮件。`,ADMIN_CONFIG_ITEM_SENDER_NAME:`邮件通知标题。`,ADMIN_CONFIG_ITEM_SHOW_EMOTION:`启用插入表情功能,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_IMAGE:`启用插入图片功能,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_ORDER:`评论排序下拉框,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_DISLIKE:`评论点踩按钮,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_UA:`是否显示用户系统和浏览器,默认为:true`,ADMIN_CONFIG_ITEM_SHOW_REGION:`是否显示用户 IP 属地到省,可能不准确,不支持 IPv6,默认为:false`,ADMIN_CONFIG_ITEM_SITE_NAME:`网站名称`,ADMIN_CONFIG_ITEM_SITE_URL:`网站地址`,ADMIN_CONFIG_ITEM_SMTP_HOST:`自定义 SMTP 服务器地址。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_PASS:`邮件通知邮箱密码,QQ、163邮箱请填写授权码。`,ADMIN_CONFIG_ITEM_SMTP_PORT:`自定义 SMTP 端口。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_SECURE:`自定义 SMTP 是否使用TLS,请填写 true 或 false。如您已配置 SMTP_SERVICE,此项请留空。`,ADMIN_CONFIG_ITEM_SMTP_SERVICE:`邮件通知邮箱服务商。支持:"126"、"163"、"1und1"、"AOL"、"DebugMail"、"DynectEmail"、"FastMail"、"GandiMail"、"Gmail"、"Godaddy"、"GodaddyAsia"、"GodaddyEurope"、"Hotmail"、"Mail.ru"、"Maildev"、"Mailgun"、"Mailjet"、"Mailosaur"、"Mandrill"、"Naver"、"OpenMailBox"、"Outlook365"、"Postmark"、"QQ"、"QQex"、"SES"、"SES-EU-WEST-1"、"SES-US-EAST-1"、"SES-US-WEST-2"、"SendCloud"、"SendGrid"、"SendPulse"、"SendinBlue"、"Sparkpost"、"Yahoo"、"Yandex"、"Zoho"、"hot.ee"、"iCloud"、"mail.ee"、"qiye.aliyun"`,ADMIN_CONFIG_ITEM_SMTP_USER:`邮件通知邮箱用户名。`,ADMIN_CONFIG_RESET:`重置`,ADMIN_CONFIG_SAVE:`保存`,ADMIN_CONFIG_EXPORT:`导出配置`,ADMIN_CONFIG_IMPORT:`导入配置`,ADMIN_CONFIG_IMPORT_FAILED:`配置导入失败:`,ADMIN_CONFIG_IMPORT_INVALID:`配置文件格式不合法`,ADMIN_CONFIG_IMPORT_SOURCE_INVALID:`配置导入仅支持 Twikoo 导出的配置文件,请将「源系统」选择为 Twikoo`,ADMIN_CONFIG_IMPORTED:`配置导入成功`,ADMIN_CONFIG_IMPORTING:`正在导入配置`,ADMIN_CREDENTIALS:`私钥文件`,ADMIN_CREDENTIALS_FAQ:`如何获得私钥`,ADMIN_CREDENTIALS_PLACEHOLDER:`请粘贴私钥文件内容`,ADMIN_FORGOT:`忘记密码`,ADMIN_EXPORT:`导出`,ADMIN_EXPORT_WARN:`将全部数据导出为 JSON 文件。如果遇到评论较多、导出失败或缺失数据,请连接数据库手动导出`,ADMIN_EXPORT_COMMENT:`导出评论`,ADMIN_EXPORT_COUNTER:`导出访问量`,ADMIN_IMPORT:`导入`,ADMIN_IMPORT_FILE_REQUIRED:`未选择文件`,ADMIN_IMPORT_IMPORTED:`完成导入 `,ADMIN_IMPORT_IMPORTING:`开始导入 `,ADMIN_IMPORT_LOG:`日志`,ADMIN_IMPORT_SELECT:`请选择`,ADMIN_IMPORT_SELECT_FILE:`选择文件`,ADMIN_IMPORT_SELECT_SOURCE:`选择源系统`,ADMIN_IMPORT_SOURCE_REQUIRED:`未选择源系统`,ADMIN_IMPORT_START:`开始导入`,ADMIN_IMPORT_COMMENT:`导入评论`,ADMIN_IMPORT_STARTING:`开始导入`,ADMIN_IMPORT_TIP_ARTALK:`请上传 JSON 格式的 Artalk 导出文件,文件名通常为 comments.data.json`,ADMIN_IMPORT_TIP_DISQUS:`请上传 XML 格式的 Disqus 导出文件,文件名通常为 [网站名称]-[导出时间]-all.xml`,ADMIN_IMPORT_TIP_VALINE:`请上传 JSON 格式的 Valine 导出文件,文件名通常为 Comment.json`,ADMIN_IMPORT_UPLOADED:`上传完成 `,ADMIN_IMPORT_UPLOADING:`已上传 `,ADMIN_IMPORT_WARN:`支持从其他评论系统的备份文件导入评论。
172
172
  数据是安全的,导入功能完全在您的云环境进行。
173
- 建议在导入前备份 comment 数据库。`,ADMIN_LOGIN:`登录`,ADMIN_LOGIN_TITLE:`Twikoo 评论管理`,ADMIN_LOGOUT:`退出登录`,ADMIN_NEED_UPDATE:`若要使用评论管理,请更新 Twikoo 云函数`,ADMIN_PASSWORD:`密码`,ADMIN_PASSWORD_PLACEHOLDER:`请输入`,ADMIN_PASSWORD_REQUIRED:`请输入密码`,ADMIN_REGIST:`注册`,ADMIN_REGIST_FAILED:`注册失败`,ADMIN_SET_PASSWORD:`设置密码`,ADMIN_SET_PASSWORD_CONFIRM:`确认密码`,ADMIN_SET_PASSWORD_CONFIRM_PLACEHOLDER:`确认密码`,ADMIN_SET_PASSWORD_PLACEHOLDER:`密码`,ADMIN_TITLE:`Twikoo 管理面板`,COMMENTS_SEARCH:`搜索`,COMMENTS_SEARCH_PLACEHOLDER:`搜索评论`,COMMENTS_SEARCH_NO_RESULT:`没有找到评论`,COMMENTS_SEARCH_COUNT_PREFIX:`找到 `,COMMENTS_COUNT_SUFFIX:` 条评论`,COMMENTS_SORT_NEWEST:`最新`,COMMENTS_SORT_OLDEST:`最早`,COMMENTS_SORT_POPULAR:`热门`,COMMENTS_EXPAND:`查看更多`,COMMENTS_NO_COMMENTS:`没有评论`,COMMENT_EXPAND:`展开`,COMMENT_COLLAPSE:`收起`,COMMENT_MASTER_TAG:`博主`,COMMENT_REPLIED:`回复`,COMMENT_DELETE_CONFIRM:`确认删除你的评论?`,COMMENT_REVIEWING_TAG:`审核中`,COMMENT_TOP_TAG:`置顶`,COMMENT_FAILED:`评论失败`,META_INPUT_LINK:`网址`,META_INPUT_MAIL:`邮箱`,META_INPUT_NICK:`昵称`,META_INPUT_NOT_REQUIRED:`选填`,META_INPUT_REQUIRED:`必填`,PAGINATION_COUNT_PREFIX:`共 `,PAGINATION_COUNT_SUFFIX:` 条`,PAGINATION_GOTO_PREFIX:`前往`,PAGINATION_GOTO_SUFFIX:`页`,PAGINATION_PAGESIZE:`条/页`,SUBMIT_CANCEL:`取消`,SUBMIT_PREVIEW:`预览`,SUBMIT_SEND:`发送`,IMAGE_UPLOAD_PLACEHOLDER:`图片上传中`,IMAGE_UPLOAD_FAILED:`图片上传失败`,IMAGE_UPLOAD_NSFW:`图片包含不当内容,禁止上传`,IMAGE_UPLOAD_FAILED_NO_CONF:`博主未配置图床服务`,IMAGE_UPLOAD_PLEASE_WAIT:`图片上传中,请稍候再发送`,SUBMIT_SENDING:`发送中`,TIMEAGO_DAYS:`天前`,TIMEAGO_HOURS:`小时前`,TIMEAGO_MINUTES:`分钟前`,TIMEAGO_NOW:`刚刚`,TIMEAGO_SECONDS:`秒前`},Vo={ADMIN_CLIENT_VERSION:`Client version: `,ADMIN_SERVER_VERSION:`Server version: `,ADMIN_COMMENT:`Comment`,ADMIN_COMMENT_DELETE:`Delete`,ADMIN_COMMENT_DELETE_CONFIRM:`Confirm deletion?`,ADMIN_COMMENT_FILTER_ALL:`All`,ADMIN_COMMENT_FILTER_VISIBLE:`Visible`,ADMIN_COMMENT_FILTER_HIDDEN:`Hidden`,ADMIN_COMMENT_HIDE:`Hide`,ADMIN_COMMENT_IS_SPAM_SUFFIX:` (Hidden)`,ADMIN_COMMENT_SEARCH:`Search`,ADMIN_COMMENT_SEARCH_PLACEHOLDER:`Search by nick, mail, website, IP, comment, or article path`,ADMIN_COMMENT_SHOW:`Show`,ADMIN_COMMENT_TOP:`Pin`,ADMIN_COMMENT_UNTOP:`Unpin`,ADMIN_COMMENT_VIEW:`View`,ADMIN_COMMENT_SECURITY_ALERT:`The comment link is different from this site! For security reasons, please manually copy the following URL to visit:`,ADMIN_COMMENT_PARSE_ERROR:`Unable to parse comment link. Please check and manually copy the following URL:`,ADMIN_CONFIG:`Configuration`,ADMIN_CONFIG_CATEGORY_COMMON:`General`,ADMIN_CONFIG_CATEGORY_IM:`Instant notification`,ADMIN_CONFIG_CATEGORY_MAIL:`Email notification`,ADMIN_CONFIG_CATEGORY_PLUGIN:`Plugin`,ADMIN_CONFIG_CATEGORY_PRIVACY:`Privacy`,ADMIN_CONFIG_CATEGORY_SPAM:`Spam`,ADMIN_CONFIG_CATEGORY_CAPTCHA:`CAPTCHA`,ADMIN_CONFIG_IMAGE_CDN_NONE:`None (disable image upload)`,ADMIN_CONFIG_CAPTCHA_NONE:`None`,ADMIN_CONFIG_CAPTCHA_TURNSTILE:`Cloudflare Turnstile`,ADMIN_CONFIG_CAPTCHA_GEETEST:`GeeTest`,ADMIN_CONFIG_CAPTCHA_CAP:`Cap`,ADMIN_CONFIG_EMAIL_TEST:`Email notification test`,ADMIN_CONFIG_EMAIL_TEST_BTN:`Send test mail`,ADMIN_CONFIG_EMAIL_TEST_HELP:`Input an email address & send test mail`,ADMIN_CONFIG_EMAIL_TEST_RESULT:`Test result: `,ADMIN_CONFIG_EXAMPLE:`Example: `,ADMIN_CONFIG_ITEM_AKISMET_KEY:`Akismet spam protection. Set to "MANUAL_REVIEW" to enable manual review. Leave it blank to not use anti-spam. Register Akismet: https://akismet.com`,ADMIN_CONFIG_ITEM_BLOGGER_NICK:`Admin nick name.`,ADMIN_CONFIG_ITEM_BLOGGER_EMAIL:`Admin Email address. Used for Email notification and admin identification.`,ADMIN_CONFIG_ITEM_COMMENT_BG_IMG:`URL for custom background image.`,ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE:`Comment page size. Default: 8.`,ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER:`Comment placeholder. Use <br> to start a newline. Default: empty.`,ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN:`CORS allow origin, note: incorrect settings can cause loading failure. Default: blank, format: https://blog.example.com; If you need to add multiple domain names, please use, separate`,ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR:`Avatar placeholder. Default (when empty): "initials". Choose from: "404", "mp", "identicon", "monsterid", "wavatar", "retro", "robohash", "blank"`,ADMIN_CONFIG_ITEM_EMOTION_CDN:`Emoji CDN. Separate by comma. Default: https://owo.imaegoo.com/owo.json`,ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS:`Configure prohibited words. Comments containing prohibited words will be auto spammed. Separate by comma.`,ADMIN_CONFIG_ITEM_BLOCKED_WORDS:`Configure blocked words. Comments containing blocked words will fail to send. Separate by comma.`,ADMIN_CONFIG_ITEM_GRAVATAR_CDN:`Custom avator CDN. (Examples: gravatar.com) Default: weavatar.com.`,ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT:`Set a cipher to hide the management panel entrance, only when the same cipher is entered in the nickname field the management panel entry will be displayed. Leave it blank to not hide the management entrance.`,ADMIN_CONFIG_ITEM_QQ_API_KEY:`QQ nickname API key for fetching QQ nickname. Get it from https://api.nsuuu.com/admin/key`,ADMIN_CONFIG_ITEM_HIGHLIGHT:`Enable code highlighting. If your theme conflicts with code highlighting, please set it to false. Default: true.`,ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME:`Code highlighting theme. Select from: "default", "coy", "dark", "funky", "okaidia", "solarizedlight", "tomorrow", "twilight". Visit https://prismjs.com for preview. If your theme conflicts with code highlighting, please set it to none. Default: none.`,ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN:`Code highlight plug-in, optional: "showLanguage", "copyButton", respectively: show code language, show code copy button. Multiple options can be set at the same time, if you want to add no code highlighting plug-ins, please set it to none. Default: none. `,ADMIN_CONFIG_ITEM_IMAGE_CDN:`The image bed for image uploading. Select from: "qcloud", "7bu (https://7bu.top)", "see (https://s.ee)", "lskypro", "piclist", "easyimage", "chevereto", "S3 / R2 / MinIO"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_URL:`The URL for the image bed. Required if your IMAGE_CDN is one of these: "lskypro", "piclist", "easyimage", "chevereto"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN:`The image bed token. Unnessessary for qcloud`,ADMIN_CONFIG_ITEM_NSFW_API_URL:`NSFW image detection API URL. Free services: nsfw.qixz.cn, project: github.com/HG-ha/nsfwpy`,ADMIN_CONFIG_ITEM_NSFW_THRESHOLD:`NSFW detection threshold (0-1). Upload will be rejected if score exceeds this value. Default: 0.5`,ADMIN_CONFIG_ITEM_S3_REGION:`S3 region, e.g. us-east-1. Can be any value when using S3-compatible services (e.g. Cloudflare R2, MinIO)`,ADMIN_CONFIG_ITEM_S3_BUCKET:`S3 bucket name`,ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID:`S3 Access Key ID`,ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY:`S3 Secret Access Key`,ADMIN_CONFIG_ITEM_S3_ENDPOINT:`S3 custom endpoint. Required when using S3-compatible services like Cloudflare R2 or MinIO`,ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE:`When S3_ENDPOINT is set, whether to append S3_BUCKET to the upload URL path. Default: true. Use true for Cloudflare R2, MinIO, and other path-style S3-compatible endpoints; set false for bucket-bound custom domains, such as Tencent Cloud COS custom domains.`,ADMIN_CONFIG_ITEM_S3_CDN_URL:`S3 image access domain (CDN domain). Leave empty to use default S3/Endpoint URL`,ADMIN_CONFIG_ITEM_S3_PATH_PREFIX:`S3 image storage path prefix, e.g. images/twikoo. Leave empty to store in root`,ADMIN_CONFIG_ITEM_LIGHTBOX:`Use simple Lightbox effect. Default: false`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE:`How many comments can be posted by each IP every 10 minutes, 0 is unlimited, default: 10.`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL:`How many comments can be posted by all IPs every 10 minutes, 0 is unlimited, default: 10.`,ADMIN_CONFIG_ITEM_LIMIT_LENGTH:`Comment length limitation, 0 is unlimited, default: 500.`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT:`Custom Email notification subject. Leave it blank to use the default subject.`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN:`Custom admin Email notification subject. Leave it blank to use the default subject.`,ADMIN_CONFIG_ITEM_MAIL_TEMPLATE:"Custom Email notification template. Leave it blank to use the default template. Fields that can be included: ${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${PARENT_NICK}, ${PARENT_COMMENT}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${REPLY_TIME}, ${POST_URL}, ${IMG}, ${PARENT_IMG}",ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN:"Custom admin Email notification template. Leave it blank to use the default template. Fields that can be included: ${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${POST_URL}, ${IP}, ${MAIL}, ${IMG}",ADMIN_CONFIG_ITEM_MASTER_TAG:`Custom admin identifier.`,ADMIN_CONFIG_ITEM_NOTIFY_SPAM:`Notifications for spam comments. Default: true.`,ADMIN_CONFIG_ITEM_HIDE_SPAM:`Hide spam comments from everyone in the public comment section, including admins and comment authors. Comments can still be reviewed and restored in the admin panel. Set to true to enable. Default: false.`,ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER:`CAPTCHA Provider`,ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY:`Turnstile CAPTCHA Site Key. Get from: https://dash.cloudflare.com/?to=/:account/turnstile`,ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY:`Turnstile CAPTCHA Secret Key`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID:`GeeTest CAPTCHA ID. Get from: https://console.geetest.com/sensbot/management`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY:`GeeTest CAPTCHA Key`,ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT:`Cap CAPTCHA API endpoint. Leave empty for built-in Cap (no extra server). External Standalone format: https://<instance_url>/<site_key>/`,ADMIN_CONFIG_ITEM_CAP_SECRET_KEY:`Cap Secret Key (external Standalone only; leave empty for built-in)`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID:`Tencent Cloud secret id for spam detection. When Tencent Cloud and Akismet are set at the same time, only Tencent Cloud will take effect. Register: https://twikoo.js.org/cms.html`,ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE:`Tencent Cloud Content Security Biztype name for spam comment policy. Spam blocking rules can be customized`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY:`Tencent Cloud secret key.`,ADMIN_CONFIG_ITEM_JEV_API_KEY:`Jev API Key for AI spam detection. Used only when Tencent Cloud and Akismet are not configured, and takes precedence over LLM.`,ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT:`Jev API endpoint URL, default: https://api.typesafe.ai/v1/systemone`,ADMIN_CONFIG_ITEM_JEV_MODEL:`Jev model name, default: jev-latest`,ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD:`Jev spam probability threshold from 0 to 1, default: 0.85`,ADMIN_CONFIG_ITEM_LLM_API_KEY:`LLM API Key for AI spam detection. Used only when Tencent Cloud, Akismet, and Jev are not configured.`,ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT:`LLM API endpoint URL, defaults to https://api.deepseek.com/v1`,ADMIN_CONFIG_ITEM_LLM_MODEL:`LLM model name, default: deepseek-v4-pro`,ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON:`Extra request body JSON (optional), merged into the chat/completions body, e.g. {"reasoning_effort":"none","temperature":0}. Takes precedence over built-in fields. Invalid JSON syntax causes this configuration to be ignored. Overrides body fields only; transport fields such as endpoint, API key, headers and timeout are ignored`,ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT:`LLM spam detection prompt (optional, uses default if left empty)`,ADMIN_CONFIG_ITEM_LLM_TIMEOUT:`LLM timeout per request in milliseconds, default 30000. Timed-out requests are aborted and retried according to LLM_MAX_RETRIES; empty or invalid values use the default`,ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES:`LLM detection maximum retries (default 3)`,ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL:`IM notification push channel. Support: "qmsg", "serverchan", "pushplus", "dingtalk", "wecom", "bark", "gocqhttp", "atri", "pushdeer", "igot", "telegram", "feishu"`,ADMIN_CONFIG_ITEM_PUSHOO_TOKEN:`IM notification push token. See https://pushoo.js.org for details`,ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS:`Input boxes displayed on the interface. Default: nick,mail,link`,ADMIN_CONFIG_ITEM_REQUIRED_FIELDS:`Required fields for comments. Set to "nick,mail,link" means all fields are required. Set to "none" means all fields are optional. Default: nick,mail.`,ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY:`Whether to notify admin via IM and email at the same time, the default is to notify admin only via IM. Default: false.`,ADMIN_CONFIG_ITEM_SENDER_EMAIL:`Email address for Email notification. For most email service providers, SENDER_EMAIL must be consistent with SMTP_USER, otherwise emails cannot be sent.`,ADMIN_CONFIG_ITEM_SENDER_NAME:`The title for Email notification.`,ADMIN_CONFIG_ITEM_SHOW_EMOTION:`Enable emojis. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_IMAGE:`Enable picture uploading. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_ORDER:`Show sort dropdown. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_DISLIKE:`Show dislike button. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_UA:`Show users' OS and browser. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_REGION:`Show users' IP region (province). Default: false.`,ADMIN_CONFIG_ITEM_SITE_NAME:`Website name.`,ADMIN_CONFIG_ITEM_SITE_URL:`Website URL.`,ADMIN_CONFIG_ITEM_SMTP_HOST:`Custom SMTP server address. If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_PASS:`Email notification mailbox password. Enter authorization code for QQ/163 mail.`,ADMIN_CONFIG_ITEM_SMTP_PORT:`Custom SMTP port. If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_SECURE:`Custom TLS for SMTP. Enter "true" or "false". If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_SERVICE:`Email service provider for Email notification. Support: "126", "163", "1und1", "AOL", "DebugMail", "DynectEmail", "FastMail", "GandiMail", "Gmail", "Godaddy", "GodaddyAsia", "GodaddyEurope", "Hotmail", "Mail.ru", "Maildev", "Mailgun", "Mailjet", "Mailosaur", "Mandrill", "Naver", "OpenMailBox", "Outlook365", "Postmark", "QQ", "QQex", "SES", "SES-EU-WEST-1", "SES-US-EAST-1", "SES-US-WEST-2", "SendCloud", "SendGrid", "SendPulse", "SendinBlue", "Sparkpost", "Yahoo", "Yandex", "Zoho", "hot.ee", "iCloud", "mail.ee", "qiye.aliyun"`,ADMIN_CONFIG_ITEM_SMTP_USER:`Email notification mailbox username.`,ADMIN_CONFIG_RESET:`Reset`,ADMIN_CONFIG_SAVE:`Save`,ADMIN_CONFIG_EXPORT:`Export Config`,ADMIN_CONFIG_IMPORT:`Import Config`,ADMIN_CONFIG_IMPORT_FAILED:`Config import failed: `,ADMIN_CONFIG_IMPORT_INVALID:`Invalid config file format`,ADMIN_CONFIG_IMPORT_SOURCE_INVALID:`Config import only supports files exported by Twikoo. Please select Twikoo as the source system.`,ADMIN_CONFIG_IMPORTED:`Config imported`,ADMIN_CONFIG_IMPORTING:`Importing config`,ADMIN_CREDENTIALS:`Private key file`,ADMIN_CREDENTIALS_FAQ:`How to get the private key`,ADMIN_CREDENTIALS_PLACEHOLDER:`Please paste the contents of the private key file`,ADMIN_FORGOT:`Forget your password`,ADMIN_EXPORT:`Export`,ADMIN_EXPORT_WARN:`Export all data as a JSON file. If you encounter export failures or missing data, connect to the database to export manually`,ADMIN_EXPORT_COMMENT:`Export comment`,ADMIN_EXPORT_COUNTER:`Export counter`,ADMIN_IMPORT:`Import`,ADMIN_IMPORT_FILE_REQUIRED:`No file selected`,ADMIN_IMPORT_IMPORTED:`Imported `,ADMIN_IMPORT_IMPORTING:`Importing `,ADMIN_IMPORT_LOG:`Log`,ADMIN_IMPORT_SELECT:`Select`,ADMIN_IMPORT_SELECT_FILE:`Select file`,ADMIN_IMPORT_SELECT_SOURCE:`Select source`,ADMIN_IMPORT_SOURCE_REQUIRED:`No source selected.`,ADMIN_IMPORT_START:`Start import`,ADMIN_IMPORT_COMMENT:`Import comments`,ADMIN_IMPORT_STARTING:`Importing`,ADMIN_IMPORT_TIP_ARTALK:`Please upload the Artalk export file in JSON format.The file name is usually comments.data.json`,ADMIN_IMPORT_TIP_DISQUS:`Please upload the Disqus export file in XML format. The file name is usually [website name]-[export time]-all.xml`,ADMIN_IMPORT_TIP_VALINE:`Please upload the Valine export file in JSON format. The file name is usually Comment.json`,ADMIN_IMPORT_UPLOADED:`Uploaded `,ADMIN_IMPORT_UPLOADING:`Uploading `,ADMIN_IMPORT_WARN:`Import comments from other comment systems.
173
+ 建议在导入前备份 comment 数据库。`,ADMIN_LOGIN:`登录`,ADMIN_LOGIN_TITLE:`Twikoo 评论管理`,ADMIN_LOGOUT:`退出登录`,ADMIN_NEED_UPDATE:`若要使用评论管理,请更新 Twikoo 云函数`,ADMIN_PASSWORD:`密码`,ADMIN_PASSWORD_PLACEHOLDER:`请输入`,ADMIN_PASSWORD_REQUIRED:`请输入密码`,ADMIN_REGIST:`注册`,ADMIN_REGIST_FAILED:`注册失败`,ADMIN_SET_PASSWORD:`设置密码`,ADMIN_SET_PASSWORD_CONFIRM:`确认密码`,ADMIN_SET_PASSWORD_CONFIRM_PLACEHOLDER:`确认密码`,ADMIN_SET_PASSWORD_PLACEHOLDER:`密码`,ADMIN_TITLE:`Twikoo 管理面板`,COMMENTS_SEARCH:`搜索`,COMMENTS_SEARCH_PLACEHOLDER:`搜索评论`,COMMENTS_SEARCH_NO_RESULT:`没有找到评论`,COMMENTS_SEARCH_COUNT_PREFIX:`找到 `,COMMENTS_COUNT_SUFFIX:` 条评论`,COMMENTS_SORT_NEWEST:`最新`,COMMENTS_SORT_OLDEST:`最早`,COMMENTS_SORT_POPULAR:`热门`,COMMENTS_EXPAND:`查看更多`,COMMENTS_NO_COMMENTS:`没有评论`,COMMENT_EXPAND:`展开`,COMMENT_COLLAPSE:`收起`,COMMENT_MASTER_TAG:`博主`,COMMENT_REPLIED:`回复`,COMMENT_DELETE_CONFIRM:`确认删除你的评论?`,COMMENT_REVIEWING_TAG:`审核中`,COMMENT_TOP_TAG:`置顶`,COMMENT_FAILED:`评论失败`,META_INPUT_LINK:`网址`,META_INPUT_MAIL:`邮箱`,META_INPUT_NICK:`昵称`,META_INPUT_NOT_REQUIRED:`选填`,META_INPUT_REQUIRED:`必填`,PAGINATION_COUNT_PREFIX:`共 `,PAGINATION_COUNT_SUFFIX:` 条`,PAGINATION_GOTO_PREFIX:`前往`,PAGINATION_GOTO_SUFFIX:`页`,PAGINATION_PAGESIZE:`条/页`,SUBMIT_CANCEL:`取消`,SUBMIT_PREVIEW:`预览`,SUBMIT_SEND:`发送`,IMAGE_UPLOAD_PLACEHOLDER:`图片上传中`,IMAGE_UPLOAD_FAILED:`图片上传失败`,IMAGE_UPLOAD_NSFW:`图片包含不当内容,禁止上传`,IMAGE_UPLOAD_FAILED_NO_CONF:`博主未配置图床服务`,IMAGE_UPLOAD_PLEASE_WAIT:`图片上传中,请稍候再发送`,SUBMIT_SENDING:`发送中`,TIMEAGO_DAYS:`天前`,TIMEAGO_HOURS:`小时前`,TIMEAGO_MINUTES:`分钟前`,TIMEAGO_NOW:`刚刚`,TIMEAGO_SECONDS:`秒前`},Vo={ADMIN_CLIENT_VERSION:`Client version: `,ADMIN_SERVER_VERSION:`Server version: `,ADMIN_COMMENT:`Comment`,ADMIN_COMMENT_DELETE:`Delete`,ADMIN_COMMENT_DELETE_CONFIRM:`Confirm deletion?`,ADMIN_COMMENT_EDIT:`Edit`,ADMIN_COMMENT_EDIT_CANCEL:`Cancel`,ADMIN_COMMENT_EDIT_SAVE:`Save`,ADMIN_COMMENT_EDIT_DISCARD_CONFIRM:`Discard unsaved changes?`,ADMIN_COMMENT_FILTER_ALL:`All`,ADMIN_COMMENT_FILTER_VISIBLE:`Visible`,ADMIN_COMMENT_FILTER_HIDDEN:`Hidden`,ADMIN_COMMENT_HIDE:`Hide`,ADMIN_COMMENT_IS_SPAM_SUFFIX:` (Hidden)`,ADMIN_COMMENT_SEARCH:`Search`,ADMIN_COMMENT_SEARCH_PLACEHOLDER:`Search by nick, mail, website, IP, comment, or article path`,ADMIN_COMMENT_SHOW:`Show`,ADMIN_COMMENT_TOP:`Pin`,ADMIN_COMMENT_UNTOP:`Unpin`,ADMIN_COMMENT_VIEW:`View`,ADMIN_COMMENT_SECURITY_ALERT:`The comment link is different from this site! For security reasons, please manually copy the following URL to visit:`,ADMIN_COMMENT_PARSE_ERROR:`Unable to parse comment link. Please check and manually copy the following URL:`,ADMIN_CONFIG:`Configuration`,ADMIN_CONFIG_CATEGORY_COMMON:`General`,ADMIN_CONFIG_CATEGORY_IM:`Instant notification`,ADMIN_CONFIG_CATEGORY_MAIL:`Email notification`,ADMIN_CONFIG_CATEGORY_PLUGIN:`Plugin`,ADMIN_CONFIG_CATEGORY_PRIVACY:`Privacy`,ADMIN_CONFIG_CATEGORY_SPAM:`Spam`,ADMIN_CONFIG_CATEGORY_CAPTCHA:`CAPTCHA`,ADMIN_CONFIG_IMAGE_CDN_NONE:`None (disable image upload)`,ADMIN_CONFIG_CAPTCHA_NONE:`None`,ADMIN_CONFIG_CAPTCHA_TURNSTILE:`Cloudflare Turnstile`,ADMIN_CONFIG_CAPTCHA_GEETEST:`GeeTest`,ADMIN_CONFIG_CAPTCHA_CAP:`Cap`,ADMIN_CONFIG_EMAIL_TEST:`Email notification test`,ADMIN_CONFIG_EMAIL_TEST_BTN:`Send test mail`,ADMIN_CONFIG_EMAIL_TEST_HELP:`Input an email address & send test mail`,ADMIN_CONFIG_EMAIL_TEST_RESULT:`Test result: `,ADMIN_CONFIG_EXAMPLE:`Example: `,ADMIN_CONFIG_ITEM_AKISMET_KEY:`Akismet spam protection. Set to "MANUAL_REVIEW" to enable manual review. Leave it blank to not use anti-spam. Register Akismet: https://akismet.com`,ADMIN_CONFIG_ITEM_BLOGGER_NICK:`Admin nick name.`,ADMIN_CONFIG_ITEM_BLOGGER_EMAIL:`Admin Email address. Used for Email notification and admin identification.`,ADMIN_CONFIG_ITEM_COMMENT_BG_IMG:`URL for custom background image.`,ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE:`Comment page size. Default: 8.`,ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER:`Comment placeholder. Use <br> to start a newline. Default: empty.`,ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN:`CORS allow origin, note: incorrect settings can cause loading failure. Default: blank, format: https://blog.example.com; If you need to add multiple domain names, please use, separate`,ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR:`Avatar placeholder. Default (when empty): "initials". Choose from: "404", "mp", "identicon", "monsterid", "wavatar", "retro", "robohash", "blank"`,ADMIN_CONFIG_ITEM_EMOTION_CDN:`Emoji CDN. Separate by comma. Default: https://owo.imaegoo.com/owo.json`,ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS:`Configure prohibited words. Comments containing prohibited words will be auto spammed. Separate by comma.`,ADMIN_CONFIG_ITEM_BLOCKED_WORDS:`Configure blocked words. Comments containing blocked words will fail to send. Separate by comma.`,ADMIN_CONFIG_ITEM_GRAVATAR_CDN:`Custom avator CDN. (Examples: gravatar.com) Default: weavatar.com.`,ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT:`Set a cipher to hide the management panel entrance, only when the same cipher is entered in the nickname field the management panel entry will be displayed. Leave it blank to not hide the management entrance.`,ADMIN_CONFIG_ITEM_QQ_API_KEY:`QQ nickname API key for fetching QQ nickname. Get it from https://api.nsuuu.com/admin/key`,ADMIN_CONFIG_ITEM_HIGHLIGHT:`Enable code highlighting. If your theme conflicts with code highlighting, please set it to false. Default: true.`,ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME:`Code highlighting theme. Select from: "default", "coy", "dark", "funky", "okaidia", "solarizedlight", "tomorrow", "twilight". Visit https://prismjs.com for preview. If your theme conflicts with code highlighting, please set it to none. Default: none.`,ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN:`Code highlight plug-in, optional: "showLanguage", "copyButton", respectively: show code language, show code copy button. Multiple options can be set at the same time, if you want to add no code highlighting plug-ins, please set it to none. Default: none. `,ADMIN_CONFIG_ITEM_IMAGE_CDN:`The image bed for image uploading. Select from: "qcloud", "7bu (https://7bu.top)", "see (https://s.ee)", "lskypro", "piclist", "easyimage", "chevereto", "S3 / R2 / MinIO"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_URL:`The URL for the image bed. Required if your IMAGE_CDN is one of these: "lskypro", "piclist", "easyimage", "chevereto"`,ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN:`The image bed token. Unnessessary for qcloud`,ADMIN_CONFIG_ITEM_NSFW_API_URL:`NSFW image detection API URL. Free services: nsfw.qixz.cn, project: github.com/HG-ha/nsfwpy`,ADMIN_CONFIG_ITEM_NSFW_THRESHOLD:`NSFW detection threshold (0-1). Upload will be rejected if score exceeds this value. Default: 0.5`,ADMIN_CONFIG_ITEM_S3_REGION:`S3 region, e.g. us-east-1. Can be any value when using S3-compatible services (e.g. Cloudflare R2, MinIO)`,ADMIN_CONFIG_ITEM_S3_BUCKET:`S3 bucket name`,ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID:`S3 Access Key ID`,ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY:`S3 Secret Access Key`,ADMIN_CONFIG_ITEM_S3_ENDPOINT:`S3 custom endpoint. Required when using S3-compatible services like Cloudflare R2 or MinIO`,ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE:`When S3_ENDPOINT is set, whether to append S3_BUCKET to the upload URL path. Default: true. Use true for Cloudflare R2, MinIO, and other path-style S3-compatible endpoints; set false for bucket-bound custom domains, such as Tencent Cloud COS custom domains.`,ADMIN_CONFIG_ITEM_S3_CDN_URL:`S3 image access domain (CDN domain). Leave empty to use default S3/Endpoint URL`,ADMIN_CONFIG_ITEM_S3_PATH_PREFIX:`S3 image storage path prefix, e.g. images/twikoo. Leave empty to store in root`,ADMIN_CONFIG_ITEM_LIGHTBOX:`Use simple Lightbox effect. Default: false`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE:`How many comments can be posted by each IP every 10 minutes, 0 is unlimited, default: 10.`,ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL:`How many comments can be posted by all IPs every 10 minutes, 0 is unlimited, default: 10.`,ADMIN_CONFIG_ITEM_LIMIT_LENGTH:`Comment length limitation, 0 is unlimited, default: 500.`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT:`Custom Email notification subject. Leave it blank to use the default subject.`,ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN:`Custom admin Email notification subject. Leave it blank to use the default subject.`,ADMIN_CONFIG_ITEM_MAIL_TEMPLATE:"Custom Email notification template. Leave it blank to use the default template. Fields that can be included: ${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${PARENT_NICK}, ${PARENT_COMMENT}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${REPLY_TIME}, ${POST_URL}, ${IMG}, ${PARENT_IMG}",ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN:"Custom admin Email notification template. Leave it blank to use the default template. Fields that can be included: ${SITE_URL}, ${SITE_NAME}, ${POST_TITLE}, ${NICK}, ${COMMENT}, ${COMMENT_TIME}, ${POST_URL}, ${IP}, ${MAIL}, ${IMG}",ADMIN_CONFIG_ITEM_MASTER_TAG:`Custom admin identifier.`,ADMIN_CONFIG_ITEM_NOTIFY_SPAM:`Notifications for spam comments. Default: true.`,ADMIN_CONFIG_ITEM_HIDE_SPAM:`Hide spam comments from everyone in the public comment section, including admins and comment authors. Comments can still be reviewed and restored in the admin panel. Set to true to enable. Default: false.`,ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER:`CAPTCHA Provider`,ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY:`Turnstile CAPTCHA Site Key. Get from: https://dash.cloudflare.com/?to=/:account/turnstile`,ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY:`Turnstile CAPTCHA Secret Key`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID:`GeeTest CAPTCHA ID. Get from: https://console.geetest.com/sensbot/management`,ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY:`GeeTest CAPTCHA Key`,ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT:`Cap CAPTCHA API endpoint. Leave empty for built-in Cap (no extra server). External Standalone format: https://<instance_url>/<site_key>/`,ADMIN_CONFIG_ITEM_CAP_SECRET_KEY:`Cap Secret Key (external Standalone only; leave empty for built-in)`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID:`Tencent Cloud secret id for spam detection. When Tencent Cloud and Akismet are set at the same time, only Tencent Cloud will take effect. Register: https://twikoo.js.org/cms.html`,ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE:`Tencent Cloud Content Security Biztype name for spam comment policy. Spam blocking rules can be customized`,ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY:`Tencent Cloud secret key.`,ADMIN_CONFIG_ITEM_JEV_API_KEY:`Jev API Key for AI spam detection. Used only when Tencent Cloud and Akismet are not configured, and takes precedence over LLM.`,ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT:`Jev API endpoint URL, default: https://api.typesafe.ai/v1/systemone`,ADMIN_CONFIG_ITEM_JEV_MODEL:`Jev model name, default: jev-latest`,ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD:`Jev spam probability threshold from 0 to 1, default: 0.85`,ADMIN_CONFIG_ITEM_LLM_API_KEY:`LLM API Key for AI spam detection. Used only when Tencent Cloud, Akismet, and Jev are not configured.`,ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT:`LLM API endpoint URL, defaults to https://api.deepseek.com/v1`,ADMIN_CONFIG_ITEM_LLM_MODEL:`LLM model name, default: deepseek-v4-pro`,ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON:`Extra request body JSON (optional), merged into the chat/completions body, e.g. {"reasoning_effort":"none","temperature":0}. Takes precedence over built-in fields. Invalid JSON syntax causes this configuration to be ignored. Overrides body fields only; transport fields such as endpoint, API key, headers and timeout are ignored`,ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT:`LLM spam detection prompt (optional, uses default if left empty)`,ADMIN_CONFIG_ITEM_LLM_TIMEOUT:`LLM timeout per request in milliseconds, default 30000. Timed-out requests are aborted and retried according to LLM_MAX_RETRIES; empty or invalid values use the default`,ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES:`LLM detection maximum retries (default 3)`,ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL:`IM notification push channel. Support: "qmsg", "serverchan", "pushplus", "dingtalk", "wecom", "bark", "gocqhttp", "atri", "pushdeer", "igot", "telegram", "feishu"`,ADMIN_CONFIG_ITEM_PUSHOO_TOKEN:`IM notification push token. See https://pushoo.js.org for details`,ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS:`Input boxes displayed on the interface. Default: nick,mail,link`,ADMIN_CONFIG_ITEM_REQUIRED_FIELDS:`Required fields for comments. Set to "nick,mail,link" means all fields are required. Set to "none" means all fields are optional. Default: nick,mail.`,ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY:`Whether to notify admin via IM and email at the same time, the default is to notify admin only via IM. Default: false.`,ADMIN_CONFIG_ITEM_SENDER_EMAIL:`Email address for Email notification. For most email service providers, SENDER_EMAIL must be consistent with SMTP_USER, otherwise emails cannot be sent.`,ADMIN_CONFIG_ITEM_SENDER_NAME:`The title for Email notification.`,ADMIN_CONFIG_ITEM_SHOW_EMOTION:`Enable emojis. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_IMAGE:`Enable picture uploading. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_ORDER:`Show sort dropdown. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_DISLIKE:`Show dislike button. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_UA:`Show users' OS and browser. Default: true.`,ADMIN_CONFIG_ITEM_SHOW_REGION:`Show users' IP region (province). Default: false.`,ADMIN_CONFIG_ITEM_SITE_NAME:`Website name.`,ADMIN_CONFIG_ITEM_SITE_URL:`Website URL.`,ADMIN_CONFIG_ITEM_SMTP_HOST:`Custom SMTP server address. If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_PASS:`Email notification mailbox password. Enter authorization code for QQ/163 mail.`,ADMIN_CONFIG_ITEM_SMTP_PORT:`Custom SMTP port. If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_SECURE:`Custom TLS for SMTP. Enter "true" or "false". If you have configured SMTP_SERVICE, please leave it empty.`,ADMIN_CONFIG_ITEM_SMTP_SERVICE:`Email service provider for Email notification. Support: "126", "163", "1und1", "AOL", "DebugMail", "DynectEmail", "FastMail", "GandiMail", "Gmail", "Godaddy", "GodaddyAsia", "GodaddyEurope", "Hotmail", "Mail.ru", "Maildev", "Mailgun", "Mailjet", "Mailosaur", "Mandrill", "Naver", "OpenMailBox", "Outlook365", "Postmark", "QQ", "QQex", "SES", "SES-EU-WEST-1", "SES-US-EAST-1", "SES-US-WEST-2", "SendCloud", "SendGrid", "SendPulse", "SendinBlue", "Sparkpost", "Yahoo", "Yandex", "Zoho", "hot.ee", "iCloud", "mail.ee", "qiye.aliyun"`,ADMIN_CONFIG_ITEM_SMTP_USER:`Email notification mailbox username.`,ADMIN_CONFIG_RESET:`Reset`,ADMIN_CONFIG_SAVE:`Save`,ADMIN_CONFIG_EXPORT:`Export Config`,ADMIN_CONFIG_IMPORT:`Import Config`,ADMIN_CONFIG_IMPORT_FAILED:`Config import failed: `,ADMIN_CONFIG_IMPORT_INVALID:`Invalid config file format`,ADMIN_CONFIG_IMPORT_SOURCE_INVALID:`Config import only supports files exported by Twikoo. Please select Twikoo as the source system.`,ADMIN_CONFIG_IMPORTED:`Config imported`,ADMIN_CONFIG_IMPORTING:`Importing config`,ADMIN_CREDENTIALS:`Private key file`,ADMIN_CREDENTIALS_FAQ:`How to get the private key`,ADMIN_CREDENTIALS_PLACEHOLDER:`Please paste the contents of the private key file`,ADMIN_FORGOT:`Forget your password`,ADMIN_EXPORT:`Export`,ADMIN_EXPORT_WARN:`Export all data as a JSON file. If you encounter export failures or missing data, connect to the database to export manually`,ADMIN_EXPORT_COMMENT:`Export comment`,ADMIN_EXPORT_COUNTER:`Export counter`,ADMIN_IMPORT:`Import`,ADMIN_IMPORT_FILE_REQUIRED:`No file selected`,ADMIN_IMPORT_IMPORTED:`Imported `,ADMIN_IMPORT_IMPORTING:`Importing `,ADMIN_IMPORT_LOG:`Log`,ADMIN_IMPORT_SELECT:`Select`,ADMIN_IMPORT_SELECT_FILE:`Select file`,ADMIN_IMPORT_SELECT_SOURCE:`Select source`,ADMIN_IMPORT_SOURCE_REQUIRED:`No source selected.`,ADMIN_IMPORT_START:`Start import`,ADMIN_IMPORT_COMMENT:`Import comments`,ADMIN_IMPORT_STARTING:`Importing`,ADMIN_IMPORT_TIP_ARTALK:`Please upload the Artalk export file in JSON format.The file name is usually comments.data.json`,ADMIN_IMPORT_TIP_DISQUS:`Please upload the Disqus export file in XML format. The file name is usually [website name]-[export time]-all.xml`,ADMIN_IMPORT_TIP_VALINE:`Please upload the Valine export file in JSON format. The file name is usually Comment.json`,ADMIN_IMPORT_UPLOADED:`Uploaded `,ADMIN_IMPORT_UPLOADING:`Uploading `,ADMIN_IMPORT_WARN:`Import comments from other comment systems.
174
174
  The data is safe, and the import function is performed entirely in your cloud environment.
175
175
  Please backup your comment database before importing.`,ADMIN_LOGIN:`Sign in`,ADMIN_LOGIN_TITLE:`Twikoo Management Panel`,ADMIN_LOGOUT:`Sign out`,ADMIN_NEED_UPDATE:`A new version of Twikoo is required for comment management.`,ADMIN_PASSWORD:`Password`,ADMIN_PASSWORD_PLACEHOLDER:`Enter your password...`,ADMIN_PASSWORD_REQUIRED:`Please enter your password`,ADMIN_REGIST:`Register`,ADMIN_REGIST_FAILED:`Register failed`,ADMIN_SET_PASSWORD:`Set password`,ADMIN_SET_PASSWORD_CONFIRM:`Confirm password`,ADMIN_SET_PASSWORD_CONFIRM_PLACEHOLDER:`Confirm password...`,ADMIN_SET_PASSWORD_PLACEHOLDER:`Password`,ADMIN_TITLE:`Twikoo Management Panel`,COMMENTS_SEARCH:`Search`,COMMENTS_SEARCH_PLACEHOLDER:`Search comments`,COMMENTS_SEARCH_NO_RESULT:`No comments found`,COMMENTS_SEARCH_COUNT_PREFIX:`Found `,COMMENTS_COUNT_SUFFIX:` comments`,COMMENTS_SORT_NEWEST:`Newest`,COMMENTS_SORT_OLDEST:`Oldest`,COMMENTS_SORT_POPULAR:`Popular`,COMMENTS_EXPAND:`Load more`,COMMENTS_NO_COMMENTS:`No comment`,COMMENT_EXPAND:`Read more`,COMMENT_COLLAPSE:`Collapse`,COMMENT_MASTER_TAG:`Admin`,COMMENT_REPLIED:`Reply`,COMMENT_DELETE_CONFIRM:`Delete your comment?`,COMMENT_REVIEWING_TAG:`Pending`,COMMENT_TOP_TAG:`Pinned`,COMMENT_FAILED:`Comment failed`,META_INPUT_LINK:`Website`,META_INPUT_MAIL:`Email`,META_INPUT_NICK:`Nickname`,META_INPUT_NOT_REQUIRED:`Optional`,META_INPUT_REQUIRED:`Required`,PAGINATION_COUNT_PREFIX:``,PAGINATION_COUNT_SUFFIX:` entries`,PAGINATION_GOTO_PREFIX:`Goto page`,PAGINATION_GOTO_SUFFIX:``,PAGINATION_PAGESIZE:`entries/page`,SUBMIT_CANCEL:`Cancel`,SUBMIT_PREVIEW:`Preview`,SUBMIT_SEND:`Send`,IMAGE_UPLOAD_PLACEHOLDER:`Uploading image`,IMAGE_UPLOAD_FAILED:`IMAGE UPLOAD FAILED`,IMAGE_UPLOAD_NSFW:`Image contains inappropriate content, upload rejected`,IMAGE_UPLOAD_FAILED_NO_CONF:`The blogger didn't configured any image bed service`,IMAGE_UPLOAD_PLEASE_WAIT:`Uploading image, please try again later`,SUBMIT_SENDING:`Sending`,TIMEAGO_DAYS:`days ago`,TIMEAGO_HOURS:`hours ago`,TIMEAGO_MINUTES:`minutes ago`,TIMEAGO_NOW:`Just now`,TIMEAGO_SECONDS:`seconds ago`},Ho=`en`,Uo={"zh-CN":Bo,en:Vo},Wo={},Go={zh:`zh-CN`,"zh-cn":`zh-CN`,"zh-hk":`zh-HK`,"zh-tw":`zh-TW`,en:`en`,"en-us":`en`,"en-gb":`en`,uz:`uz-UZ`,"uz-uz":`uz-UZ`,ja:`ja-JP`,"ja-jp":`ja-JP`,ko:`ko-KR`,"ko-kr":`ko-KR`,vi:`vi-VN`,"vi-vn":`vi-VN`,id:`id-ID`,"id-id":`id-ID`},Ko=Ho,qo=``;function Jo(){if(typeof document>`u`)return``;let e=document.currentScript?.src??``;if(!e){let t=document.querySelectorAll(`script[src]`);for(let n=t.length-1;n>=0;--n){let r=t[n].src;if(/twikoo/i.test(r)){e=r;break}}}return e?e.slice(0,e.lastIndexOf(`/`)):``}function Yo(e={}){let t=e.lang?.toLowerCase(),n=typeof navigator>`u`?void 0:navigator.language?.toLowerCase();return t&&Go[t]||n&&Go[n]||Ho}async function Xo(e={}){let t=Yo(e);if(Ko=t,Uo[t]||Wo[t])return;let n=(e.localeBaseUrl||qo||Jo()).replace(/\/+$/,``);if(!n){console.warn(`[twikoo] 无法推导语言分片基址,${t} 回退英文`);return}let r=`${n}/locales/${t}.js`;try{let e=await import(r),n=e.default??e;n&&typeof n==`object`?Wo[t]=n:console.warn(`[twikoo] 语言分片 ${t} 形态异常,回退英文`)}catch(e){console.warn(`[twikoo] 语言分片 ${r} 加载失败,回退英文:`,e instanceof Error?e.message:String(e))}}function W(e,t){let n=t&&Go[t.toLowerCase()]||Ko;return(Wo[n]??Uo[n])?.[e]??Uo[Ho]?.[e]??``}function Zo(e,t){this.v=e,this.k=t}function Qo(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function $o(e){if(Array.isArray(e))return e}function es(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ts(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
176
176
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ns(e,t){return $o(e)||es(e,t)||rs(e,t)||ts()}function rs(e,t){if(e){if(typeof e==`string`)return Qo(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Qo(e,t):void 0}}function is(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof Zo;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}is.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},is.prototype.next=function(e){return this._invoke(`next`,e)},is.prototype.throw=function(e){return this._invoke(`throw`,e)},is.prototype.return=function(e){return this._invoke(`return`,e)};var as=Object.entries,os=Object.setPrototypeOf,ss=Object.isFrozen,cs=Object.getPrototypeOf,ls=Object.getOwnPropertyDescriptor,us=Object.freeze,ds=Object.seal,fs=Object.create,ps=typeof Reflect<`u`&&Reflect,ms=ps.apply,hs=ps.construct;us||=function(e){return e},ds||=function(e){return e},ms||=function(e,t){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return e.apply(t,r)},hs||=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return new e(...n)};var gs=Is(Array.prototype.forEach);Array.prototype.indexOf;var _s=Is(Array.prototype.lastIndexOf),vs=Is(Array.prototype.pop),ys=Is(Array.prototype.push);Array.prototype.slice;var bs=Is(Array.prototype.splice),xs=Array.isArray,Ss=Is(String.prototype.toLowerCase),Cs=Is(String.prototype.toString),ws=Is(String.prototype.match),Ts=Is(String.prototype.replace),Es=Is(String.prototype.indexOf),Ds=Is(String.prototype.trim),Os=Is(Number.prototype.toString),ks=Is(Boolean.prototype.toString),As=typeof BigInt>`u`?null:Is(BigInt.prototype.toString),js=typeof Symbol>`u`?null:Is(Symbol.prototype.toString),Ms=Is(Object.prototype.hasOwnProperty),Ns=Is(Object.prototype.toString),Ps=Is(RegExp.prototype.test),Fs=Ls(TypeError);function Is(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return ms(e,t,r)}}function Ls(e){return function(){for(var t=arguments.length,n=Array(t),r=0;r<t;r++)n[r]=arguments[r];return hs(e,n)}}function Rs(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ss;if(os&&os(e,null),!xs(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(ss(t)||(t[r]=e),i=e)}e[i]=!0}return e}function zs(e){for(let t=0;t<e.length;t++)Ms(e,t)||(e[t]=null);return e}function Bs(e){let t=fs(null);for(let r of as(e)){var n=ns(r,2);let i=n[0],a=n[1];Ms(e,i)&&(t[i]=xs(a)?zs(a):a&&typeof a==`object`&&a.constructor===Object?Bs(a):a)}return t}function Vs(e){switch(typeof e){case`string`:return e;case`number`:return Os(e);case`boolean`:return ks(e);case`bigint`:return As?As(e):`0`;case`symbol`:return js?js(e):`Symbol()`;case`undefined`:return Ns(e);case`function`:case`object`:{if(e===null)return Ns(e);let t=e,n=Hs(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Ns(e)}return Ns(e)}default:return Ns(e)}}function Hs(e,t){for(;e!==null;){let n=ls(e,t);if(n){if(n.get)return Is(n.get);if(typeof n.value==`function`)return Is(n.value)}e=cs(e)}function n(){return null}return n}function Us(e){try{return Ps(e,``),!0}catch{return!1}}var Ws=us(`a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr`.split(`.`)),Gs=us(`svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern`.split(`.`)),Ks=us([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),qs=us([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),Js=us(`math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts`.split(`.`)),Ys=us([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Xs=us([`#text`]),Zs=us(`accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns`.split(`.`)),Qs=us(`accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan`.split(`.`)),$s=us(`accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns`.split(`.`)),ec=us([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),tc=ds(/{{[\w\W]*|^[\w\W]*}}/g),nc=ds(/<%[\w\W]*|^[\w\W]*%>/g),rc=ds(/\${[\w\W]*/g),ic=ds(/^data-[\-\w.\u00B7-\uFFFF]+$/),ac=ds(/^aria-[\-\w]+$/),oc=ds(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),sc=ds(/^(?:\w+script|data):/i),cc=ds(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lc=ds(/^html$/i),uc=ds(/^[a-z][.\w]*(-[.\w]+)+$/i),dc=ds(/<[/\w!]/g),fc=ds(/<[/\w]/g),pc=ds(/<\/no(script|embed|frames)/i),mc=ds(/\/>/i),hc={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},gc=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],_c=us(Rs({},gc)),vc=function(){let e={};return gs(gc,t=>{e[t]=ds(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),us(e)}(),yc=function(){return typeof window>`u`?null:window},bc=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},xc=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Sc=function(e,t,n,r){return Ms(e,t)&&xs(e[t])?Rs(r.base?Bs(r.base):{},e[t],r.transform):n},Cc=function(e,t,n){let r=Ms(e,t)?e[t]:void 0;return r&&typeof r==`object`?Bs(r):n()};function wc(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yc(),t=e=>wc(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==hc.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Hs(d,`cloneNode`),p=Hs(d,`remove`),m=Hs(d,`removeAttributeNode`),h=Hs(d,`nextSibling`),g=Hs(d,`childNodes`),_=Hs(d,`parentNode`),v=Hs(d,`shadowRoot`),y=Hs(d,`attributes`),b=o&&o.prototype?Hs(o.prototype,`nodeType`):null,x=o&&o.prototype?Hs(o.prototype,`nodeName`):null,S=o&&o.prototype?Hs(o.prototype,`ownerDocument`):null,C=function(e){return b?b(e):e.nodeType},w=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let T,E=``,D,ee=!1,te=0,O=function(){if(te>0)throw Fs(`A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.`)},k=function(e){O(),te++;try{return T.createHTML(e)}finally{te--}},A=function(e){O(),te++;try{return T.createScriptURL(e)}finally{te--}},ne=function(){return ee||=(D=bc(u,i),!0),D},re=n,ie=re.implementation,ae=re.createNodeIterator,oe=re.createDocumentFragment,se=re.getElementsByTagName,ce=r.importNode,le=xc();t.isSupported=typeof as==`function`&&typeof _==`function`&&ie&&ie.createHTMLDocument!==void 0;let ue=tc,de=nc,fe=rc,pe=ic,me=ac,he=sc,ge=cc,_e=uc,ve=oc,j=null,ye=Rs({},[...Ws,...Gs,...Ks,...Js,...Xs]),be=null,xe=Rs({},[...Zs,...Qs,...$s,...ec]),Se=Object.seal(fs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ce=null,we=null,Te=Object.seal(fs(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),M=!0,Ee=!0,N=!1,P=!0,De=!1,Oe=!0,ke=!1,Ae=!1,je=null,Me=null,Ne=!1,Pe=!1,Fe=!1,Ie=!1,Le=!0,Re=!1,ze=`user-content-`,Be=!0,Ve=!1,He={},Ue=null,We=Rs({},`annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),Ge=null,Ke=Rs({},[`audio`,`video`,`img`,`source`,`image`,`track`]),qe=null,Je=Rs({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ye=`http://www.w3.org/1998/Math/MathML`,F=`http://www.w3.org/2000/svg`,Xe=`http://www.w3.org/1999/xhtml`,Ze=Xe,Qe=!1,$e=null,et=Rs({},[Ye,F,Xe],Cs),I=us([`mi`,`mo`,`mn`,`ms`,`mtext`]),tt=Rs({},I),L=us([`annotation-xml`]),R=Rs({},L),nt=Rs({},[`title`,`style`,`font`,`a`,`script`]),rt=null,it=[`application/xhtml+xml`,`text/html`],at=null,z=null,ot=n.createElement(`form`),st=function(e){return e instanceof RegExp||e instanceof Function},ct=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(z&&z===e)return;(!e||typeof e!=`object`)&&(e={}),e=Bs(e),rt=it.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,at=rt===`application/xhtml+xml`?Cs:Ss,j=Sc(e,`ALLOWED_TAGS`,ye,{transform:at}),be=Sc(e,`ALLOWED_ATTR`,xe,{transform:at}),$e=Sc(e,`ALLOWED_NAMESPACES`,et,{transform:Cs}),qe=Sc(e,`ADD_URI_SAFE_ATTR`,Je,{transform:at,base:Je}),Ge=Sc(e,`ADD_DATA_URI_TAGS`,Ke,{transform:at,base:Ke}),Ue=Sc(e,`FORBID_CONTENTS`,We,{transform:at}),Ce=Sc(e,`FORBID_TAGS`,Bs({}),{transform:at}),we=Sc(e,`FORBID_ATTR`,Bs({}),{transform:at}),He=Ms(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Bs(e.USE_PROFILES):e.USE_PROFILES:!1,M=e.ALLOW_ARIA_ATTR!==!1,Ee=e.ALLOW_DATA_ATTR!==!1,N=e.ALLOW_UNKNOWN_PROTOCOLS||!1,P=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,De=e.SAFE_FOR_TEMPLATES||!1,Oe=e.SAFE_FOR_XML!==!1,ke=e.WHOLE_DOCUMENT||!1,Pe=e.RETURN_DOM||!1,Fe=e.RETURN_DOM_FRAGMENT||!1,Ie=e.RETURN_TRUSTED_TYPE||!1,Ne=e.FORCE_BODY||!1,Le=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,Be=e.KEEP_CONTENT!==!1,Ve=e.IN_PLACE||!1,ve=Us(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:oc,Ze=typeof e.NAMESPACE==`string`?e.NAMESPACE:Xe,tt=Cc(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>Rs({},I)),R=Cc(e,`HTML_INTEGRATION_POINTS`,()=>Rs({},L));let t=Cc(e,`CUSTOM_ELEMENT_HANDLING`,()=>fs(null));if(Se=fs(null),Ms(t,`tagNameCheck`)&&st(t.tagNameCheck)&&(Se.tagNameCheck=t.tagNameCheck),Ms(t,`attributeNameCheck`)&&st(t.attributeNameCheck)&&(Se.attributeNameCheck=t.attributeNameCheck),Ms(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Se.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),ds(Se),De&&(Ee=!1),Fe&&(Pe=!0),He&&(j=Rs({},Xs),be=fs(null),He.html===!0&&(Rs(j,Ws),Rs(be,Zs)),He.svg===!0&&(Rs(j,Gs),Rs(be,Qs),Rs(be,ec)),He.svgFilters===!0&&(Rs(j,Ks),Rs(be,Qs),Rs(be,ec)),He.mathMl===!0&&(Rs(j,Js),Rs(be,$s),Rs(be,ec))),Te.tagCheck=null,Te.attributeCheck=null,Ms(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?Te.tagCheck=e.ADD_TAGS:xs(e.ADD_TAGS)&&(j===ye&&(j=Bs(j)),Rs(j,e.ADD_TAGS,at))),Ms(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?Te.attributeCheck=e.ADD_ATTR:xs(e.ADD_ATTR)&&(be===xe&&(be=Bs(be)),Rs(be,e.ADD_ATTR,at))),Ms(e,`ADD_FORBID_CONTENTS`)&&xs(e.ADD_FORBID_CONTENTS)&&(Ue===We&&(Ue=Bs(Ue)),Rs(Ue,e.ADD_FORBID_CONTENTS,at)),Be&&(j[`#text`]=!0),ke&&Rs(j,[`html`,`head`,`body`]),j.table&&(Rs(j,[`tbody`]),delete Ce.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw Fs(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw Fs(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=T;T=e.TRUSTED_TYPES_POLICY;try{E=k(``)}catch(e){throw T=t,e}}else e.TRUSTED_TYPES_POLICY===null?(T=void 0,E=``):(T===void 0&&(T=ne()),T&&typeof E==`string`&&(E=k(``)));us&&us(e),z=e},lt=Rs({},[...Gs,...Ks,...qs]),ut=Rs({},[...Js,...Ys]),dt=function(e,t,n){return t.namespaceURI===Xe?e===`svg`:t.namespaceURI===Ye?e===`svg`&&(n===`annotation-xml`||tt[n]):!!lt[e]},ft=function(e,t,n){return t.namespaceURI===Xe?e===`math`:t.namespaceURI===F?e===`math`&&R[n]:!!ut[e]},pt=function(e,t,n){return t.namespaceURI===F&&!R[n]||t.namespaceURI===Ye&&!tt[n]?!1:!ut[e]&&(nt[e]||!lt[e])},mt=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:Ze,tagName:`template`});let n=Ss(e.tagName),r=Ss(t.tagName);return $e[e.namespaceURI]?e.namespaceURI===F?dt(n,t,r):e.namespaceURI===Ye?ft(n,t,r):e.namespaceURI===Xe?pt(n,t,r):!!(rt===`application/xhtml+xml`&&$e[e.namespaceURI]):!1},ht=function(e){ys(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw Fs(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},gt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},_t=function(e){bt(e);let t=g(e);if(t){let e=[];gs(t,t=>{ys(e,t)}),gs(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&gt(e,r,i)}},vt=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}ys(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Pe||Fe)try{ht(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},yt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||be[at(i)]||gt(e,r,i)}},bt=function(e){let t=[e];for(;t.length>0;){let e=t.pop();C(e)===hc.element&&yt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},xt=function(e,t){return Oe?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},St=function(e){if(!Oe)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=C(e);if(n===hc.processingInstruction||n===hc.comment&&Ps(fc,e.data)){try{p(e)}catch{}continue}if(n===hc.element){let t=e,n=at(w(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&xt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},Ct=function(e){let t=null,r=null;if(Ne)e=`<remove></remove>`+e;else{let t=ws(e,/^[\r\n\t ]+/);r=t&&t[0]}rt===`application/xhtml+xml`&&Ze===Xe&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=T?k(e):e;if(Ze===Xe)try{t=new l().parseFromString(i,rt)}catch{}if(!t||!t.documentElement){t=ie.createDocument(Ze,`template`,null);try{t.documentElement.innerHTML=Qe?E:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),Ze===Xe?se.call(t,ke?`html`:`body`)[0]:ke?t.documentElement:a},wt=function(e){let t=S?S(e):e.ownerDocument;return ae.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},B=function(e){return e=Ts(e,ue,` `),e=Ts(e,de,` `),e=Ts(e,fe,` `),e},Tt=function(e){e.normalize();let t=S?S(e):e.ownerDocument,n=ae.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=B(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&gs(i,e=>{H(e.content)&&Tt(e.content)})},V=function(e){let t=x?x(e):null;return typeof t!=`string`||at(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},H=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===hc.documentFragment}catch{return!1}},U=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Et(e,n,r){e.length!==0&&gs(e,e=>{e.call(t,n,r,z)})}let Dt=function(e,t){return!!(Oe&&e.hasChildNodes()&&!U(e.firstElementChild)&&Ps(dc,e.textContent)&&Ps(dc,e.innerHTML)||Oe&&e.namespaceURI===Xe&&_c[t]&&(U(e.firstElementChild)||typeof e.textContent==`string`&&Ps(vc[t],e.textContent))||e.nodeType===hc.processingInstruction||Oe&&e.nodeType===hc.comment&&Ps(fc,e.data))},Ot=function(e,t){if(e instanceof RegExp)return Ps(e,t);if(e instanceof Function){for(var n=arguments.length,r=Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];return!!e(t,...r)}return!1},kt=function(e,t,n){if(!Ce[t]&&Ft(t)&&Ot(Se.tagNameCheck,t))return!1;if(Be&&!Ue[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return ht(e),!0},At=function(e,t,n,r){return e.length===0?t:t===n||t===r?Bs(t):t},jt=function(e,t){return e===t||_(e)!==null?!1:(Ve&&bt(e),!0)},Mt=function(e,n){if(Et(le.beforeSanitizeElements,e,null),jt(e,n))return!0;if(V(e))return ht(e),!0;let r=at(w(e));if(j=At(le.uponSanitizeElement,j,ye,je),Et(le.uponSanitizeElement,e,{tagName:r,allowedTags:j}),jt(e,n))return!0;if(Dt(e,r))return ht(e),!0;if(Ce[r]||!(Te.tagCheck instanceof Function&&Te.tagCheck(r))&&!j[r]){let t=kt(e,r,n);return t===!1&&(Et(le.afterSanitizeElements,e,null),jt(e,n))?!0:t}if(C(e)===hc.element&&!mt(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Ps(pc,e.innerHTML))return ht(e),!0;if(De&&e.nodeType===hc.text){let n=B(e.textContent);e.textContent!==n&&(ys(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Et(le.afterSanitizeElements,e,null),jt(e,n)},Nt=function(e,t,r){if(we[t]||xt(t,e)||Le&&(t===`id`||t===`name`)&&(r in n||r in ot))return!1;let i=be[t]||Te.attributeCheck instanceof Function&&Te.attributeCheck(t,e);return Ee&&Ps(pe,t)||M&&Ps(me,t)?!0:i?qe[t]||Ps(ve,Ts(r,ge,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Es(r,`data:`)===0&&Ge[e]||N&&!Ps(he,Ts(r,ge,``))?!0:!r:Ft(e)&&Ot(Se.tagNameCheck,e)&&Ot(Se.attributeNameCheck,t,e)||t===`is`&&Se.allowCustomizedBuiltInElements&&Ot(Se.tagNameCheck,r)},Pt=Rs({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),Ft=function(e){return!Pt[Ss(e)]&&Ps(_e,e)},It=function(e,t,n,r){if(T&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return k(r);case`TrustedScriptURL`:return A(r)}return r},Lt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!V(e)||(ht(e),!1)}catch{return vt(t,e),!1}},Rt=function(e,n){if(Et(le.beforeSanitizeAttributes,e,null),jt(e,n))return;let r=e.attributes;if(!r||V(e))return;be=At(le.uponSanitizeAttribute,be,xe,Me);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:be,forceKeepAttr:void 0},a=r.length,o=at(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=at(s),d=l,f=s===`value`?d:Ds(d),p=!1;i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Et(le.uponSanitizeAttribute,e,i),f=i.attrValue,Re&&(u===`id`||u===`name`)&&Es(f,ze)!==0&&(vt(s,e,n),f=ze+f,p=!0),Oe&&Ps(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)||u===`attributename`&&ws(f,`href`)?vt(s,e,n):i.forceKeepAttr||(i.keepAttr?!P&&Ps(mc,f)?vt(s,e,n):(De&&(f=B(f)),Nt(o,u,f)?(f=It(o,u,c,f),f!==d&&Lt(e,s,c,f)&&p&&vs(t.removed)):vt(s,e,n)):vt(s,e,n))}Et(le.afterSanitizeAttributes,e,null),jt(e,n)},zt=function(e){let t=null,n=wt(e);for(Et(le.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Et(le.uponSanitizeShadowNode,t,null),Mt(t,e),Rt(t,e),H(t.content)&&zt(t.content),C(t)===hc.element){let e=v(t);H(e)&&(Bt(e),zt(e))}Et(le.afterSanitizeShadowDOM,e,null)},Bt=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){zt(e.shadow);continue}let n=e.node,r=C(n)===hc.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&at(e)===`template`){let e=n.content;H(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);H(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Qe=!e,Qe&&(e=`<!-->`),typeof e!=`string`&&!U(e)&&(e=Vs(e),typeof e!=`string`))throw Fs(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ae?(j=je,be=Me):ct(n),(le.uponSanitizeElement.length>0||le.uponSanitizeAttribute.length>0)&&(j=Bs(j)),le.uponSanitizeAttribute.length>0&&(be=Bs(be)),t.removed=[];let c=Ve&&typeof e!=`string`&&U(e);if(c){St(e);let t=w(e);if(typeof t==`string`){let n=at(t);if(!j[n]||Ce[n])throw _t(e),Fs(`root node is forbidden and cannot be sanitized in-place`)}if(V(e))throw _t(e),Fs(`root node is clobbered and cannot be sanitized in-place`);try{Bt(e)}catch(t){throw _t(e),t}}else if(U(e))i=Ct(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===hc.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Bt(i);else{if(!Pe&&!De&&!ke&&e.indexOf(`<`)===-1)return T&&Ie?k(e):e;if(i=Ct(e),!i)return Pe?null:Ie?E:``}i&&Ne&&ht(i.firstChild);let l=c?e:i;try{let e=wt(l);for(;o=e.nextNode();)Mt(o,l),Rt(o,l),H(o.content)&&zt(o.content)}catch(n){throw c&&(_t(e),gs(t.removed,e=>{e.element&&bt(e.element)})),n}if(c){let n=!1;if(gs(t.removed,t=>{t.element&&(t.element===e&&(n=!0),bt(t.element))}),n)throw Fs(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return De&&Tt(e),e}if(Pe){if(De&&Tt(i),Fe)for(s=oe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(be.shadowroot||be.shadowrootmode)&&(s=ce.call(r,s,!0)),s}let u=ke?i.outerHTML:i.innerHTML;return ke&&j[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Ps(lc,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
@@ -240,13 +240,13 @@ ${e}</tr>
240
240
  `}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
241
241
  `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Nu(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,text:n,tokens:r,autolink:i}){let a=i?Nu(n,!0):this.parser.parseInline(r),o=Pu(e);if(o===null)return a;e=Nu(o,i);let s=`<a href="`+e+`"`;return t&&(s+=` title="`+Nu(t)+`"`),s+=`>`+a+`</a>`,s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Pu(e);if(i===null)return Nu(n);e=i;let a=`<img src="${Nu(e)}" alt="${Nu(n)}"`;return t&&(a+=` title="${Nu(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Nu(e.text)}},qu=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Ju=class e{options;renderer;textRenderer;constructor(e){this.options=e||ul,this.options.renderer=this.options.renderer||new Ku,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new qu}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`checkbox`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`checkbox`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Yu=class{options;block;constructor(e){this.options=e||ul}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Gu.lex:Gu.lexInline}provideParser(e=this.block){return e?Ju.parse:Ju.parseInline}},Xu=class{defaults=ll();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ju;Renderer=Ku;TextRenderer=qu;Lexer=Gu;Tokenizer=Wu;Hooks=Yu;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ku(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Wu(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Yu;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Yu.passThroughHooks.has(n)?e=>{if(this.defaults.async&&Yu.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Gu.lex(e,t??this.defaults)}parser(e,t){return Ju.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(Error(`marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.`));if(typeof t>`u`||t===null)return a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Gu.lex:Gu.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Ju.parse:Ju.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Gu.lex:Gu.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Ju.parse:Ju.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
242
242
  Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Nu(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}},Zu=new Xu;function Qu(e,t){return Zu.parse(e,t)}Qu.options=Qu.setOptions=function(e){return Zu.setOptions(e),Qu.defaults=Zu.defaults,dl(Qu.defaults),Qu},Qu.getDefaults=ll,Qu.defaults=ul;function $u(...e){return Zu.use(...e),Qu.defaults=Zu.defaults,dl(Qu.defaults),Qu}Qu.use=$u,Qu.walkTokens=function(e,t){return Zu.walkTokens(e,t)},Qu.parseInline=Zu.parseInline,Qu.Parser=Ju,Qu.parser=Ju.parse,Qu.Renderer=Ku,Qu.TextRenderer=qu,Qu.Lexer=Gu,Qu.lexer=Gu.lex,Qu.Tokenizer=Wu,Qu.Hooks=Yu,Qu.parse=Qu,Qu.options,Qu.setOptions,Qu.walkTokens,Qu.parseInline,Ju.parse,Gu.lex;var ed={};function td(e){ed=e??{}}var nd=new Xu({gfm:!0,breaks:!0});nd.use({tokenizer:{code(){}}});var rd=/^(\$\$[\s\S]*?\$\$|\\\[([\s\S]*?)\\\]|\\\(([\s\S]*?)\\\)|\$[^$\n]+?\$)/;nd.use({extensions:[{name:`twikoo-math`,level:`inline`,start(e){return e.search(rd)},tokenizer(e){let t=rd.exec(e);if(t)return{type:`twikoo-math`,raw:t[0],text:t[0]}},renderer(e){return e.text}}]});function id(e){return e.replace(/&/g,`&amp;`).replace(/"/g,`&quot;`).replace(/</g,`&lt;`).replace(/>/g,`&gt;`)}nd.use({renderer:{image(e){return e.owo?`<img class="${id([`tk-owo-emotion`,e.className].filter(Boolean).join(` `))}" loading="lazy" src="${id(e.href)}" alt="${id(e.text)}">`:!1}},extensions:[{name:`owo`,level:`inline`,start(e){return e.indexOf(`:`)},tokenizer(e){if(this.lexer.state.inRawBlock)return;let t=/^:([^\s:]+):/.exec(e);if(!t||!Object.prototype.hasOwnProperty.call(ed,t[1]))return;let n=ed[t[1]],r=typeof n==`string`?n:n?.src;if(typeof r==`string`&&r)return{type:`image`,raw:t[0],href:r,title:null,text:t[0],tokens:[{type:`text`,raw:t[0],text:t[0]}],className:typeof n==`string`?void 0:n.className,owo:!0}}}]});function ad(e){return nd.parse(e)}var od=document.createElement(`template`);function sd(e){try{return od.innerHTML=Tc.sanitize(e),od.content.querySelector(`img`)}catch(e){return zo.warn(`OwO 表情解析失败`,e),null}}function cd(e){return e.split(`#`).shift()?.split(`?`)?.shift()?.split(`/`).pop()??``}function ld(e){try{for(let t of Object.values(e))if(t.type===`image`)for(let e of t.container)e.text||=cd(sd(e.icon)?.src??``);return e}catch(e){zo.warn(`OwO 数据格式异常`,e);return}}async function ud(e){try{let{response:t,text:n}=await Do(e);if(!t.ok&&t.status!==304)return zo.warn(`OwO 数据请求失败:${t.status}`),{};try{return ld(JSON.parse(n))??{}}catch(e){return zo.warn(`OwO 数据解析失败`,e),{}}}catch(e){return zo.warn(e instanceof Eo?`OwO 数据请求超时`:`OwO 数据请求异常`,e),{}}}async function dd(e){let t={},n=await Promise.all(e.split(`,`).map(e=>ud(e.trim())));return Object.assign(t,...n),t}function fd(e){let t=Object.create(null);for(let n of Object.values(e??{}))for(let e of n.container??[]){let n=sd(e.icon);n?.src&&e.text&&(t[e.text]={src:n.src,className:n.className})}return td(t),t}var pd=`data-tk-loading`;function md(e){for(let t of Array.from(e.children))if(t.hasAttribute(pd))return t;return null}function hd(e){if(md(e))return;let t=document.createElement(`div`);t.setAttribute(pd,`1`),t.className=`tk-loading-mask`;let n=document.createElement(`div`);n.className=`tk-loading-spinner`,n.innerHTML=`<svg class="circular" viewBox="25 25 50 50"><circle class="path" cx="50" cy="50" r="20" fill="none"></circle></svg>`,t.appendChild(n),e.appendChild(t)}function gd(e){md(e)?.remove(),e.classList.remove(`tk-loading-parent--relative`)}function _d(e,t){if(t.value){let t=getComputedStyle(e).position;(!t||t===`static`)&&e.classList.add(`tk-loading-parent--relative`),hd(e)}else gd(e)}var vd={mounted:_d,updated:_d,unmounted:gd};function yd(e,t){bd(e);let n=n=>{let r=n.target;r&&e!==r&&!e.contains(r)&&t.value?.()};e.__tkClickoutside=n,document.addEventListener(`click`,n,!0)}function bd(e){let t=e;t.__tkClickoutside&&(document.removeEventListener(`click`,t.__tkClickoutside,!0),delete t.__tkClickoutside)}var xd={mounted:yd,updated:yd,unmounted:bd},Sd=e=>typeof e==`string`&&/^http(s)?:\/\//.test(e),Cd=e=>e==null||e===``;function wd(e){return String(e).trim().toLowerCase()}function Td(e){return/^[1-9][0-9]{4,10}$/.test(e)||/^[1-9][0-9]{4,10}@qq.com$/i.test(e)}function Ed(e){return e?e.substring(0,4)===`http`?e:`http://${e}`:``}function Dd(e){let t=typeof e==`number`?new Date(e):e;if(!t)return``;try{let e=Date.now()-t.getTime(),n=Math.floor(e/864e5);if(n===0){let t=e%864e5,n=Math.floor(t/36e5);if(n===0){let e=t%36e5,n=Math.floor(e/6e4);return n===0?`${Math.round(e%6e4/1e3)} ${W(`TIMEAGO_SECONDS`)}`:`${n} ${W(`TIMEAGO_MINUTES`)}`}return`${n} ${W(`TIMEAGO_HOURS`)}`}return n<0?W(`TIMEAGO_NOW`):n<8?`${n} ${W(`TIMEAGO_DAYS`)}`:Od(t)}catch(e){return zo.warn(`timeago 计算失败`,e),``}}function Od(e){return[kd(e.getFullYear(),2),kd(e.getMonth()+1,2),kd(e.getDate(),2)].join(`-`)}function kd(e,t){let n=e.toString();for(;n.length<t;)n=`0${n}`;return n}function Ad(e){let t=window.TWIKOO_MAGIC_PATH;if(t)return t;if(e&&typeof e==`string`)switch(e){case`location.pathname`:case`window.location.pathname`:return window.location.pathname;case`location.href`:case`window.location.href`:return window.location.href;default:return e}return window.location.pathname}function jd(e){return window.TWIKOO_MAGIC_HREF??(typeof e==`string`?e:window.location.href)}var Md=new Set([`localhost`,`127.0.0.1`,`0.0.0.0`,`::1`]);function Nd(){return Md.has(window.location.hostname)}async function Pd(e,t={}){let n=t.urls;if(!Array.isArray(n))throw Error(`urls 参数有误`);return n.length===0?[]:Ao(await Lo(e,`GET_COMMENTS_COUNT`,{envId:t.envId,funcName:t.funcName,urls:n,includeReply:t.includeReply})).data}async function Fd(e,t={}){let n=Ao(await Lo(e,`GET_RECENT_COMMENTS`,{envId:t.envId,funcName:t.funcName,pageSize:t.pageSize,includeReply:t.includeReply})).data;if(Array.isArray(n))for(let e of n)e.relativeTime=Dd(e.created);return n}async function Id(e,t={}){return Ao(await Lo(e,`COUNTER_GET`,{envId:t.envId,funcName:t.funcName,url:Ad(t.path),href:jd(t.href),title:t.title??document.title}))}async function Ld(e,t={}){let n=document.getElementById(`twikoo_visitors`);if(!n||Nd())return null;try{let r=await Id(e,t);return r.time!==void 0&&(n.innerHTML=String(r.time)),r}catch(e){return zo.warn(`Failed to update visitors count`,e),null}}function Rd(e){return new Promise((t,n)=>{let r=new FileReader;r.readAsText(e),r.onloadend=()=>{r.error?n(r.error):t(r.result)}})}function zd(e){return new Promise(t=>{let n=new FileReader;n.onload=e=>{let n=e.target?.result;t(typeof n==`string`?n:``)},n.readAsDataURL(e)})}async function Bd(){let e=window.navigator.userAgent;try{let t=navigator.userAgentData;if(t?.platform===`Windows`||t?.platform===`macOS`){let{platformVersion:n}=await t.getHighEntropyValues([`platformVersion`]),r=parseInt(String(n).split(`.`)[0],10);t.platform===`Windows`&&r>=13?e=e.replace(/Windows NT 10\.0/i,`Windows NT 11.0`):t.platform===`macOS`&&r>=11&&(e=e.replace(/Mac OS X 10_[0-9]+_[0-9]+/i,`Mac OS X ${String(n).replace(/\./g,`_`)}`))}}catch{}return e}function Vd(e){if(!e)return;let t=Array.isArray(e)?e:[e],n=[];for(let e of t)e&&n.push(...Array.from(e.getElementsByTagName(`a`)));for(let e of n)e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer nofollow ugc`)}function Hd(e){let t=e.target;if(!(t instanceof HTMLImageElement)||t.classList.contains(`tk-owo-emotion`))return;let n=t.closest(`.twikoo`);if(!n)return;let r=document.createElement(`div`);r.className=`tk-lightbox`;let i=document.createElement(`img`);i.className=`tk-lightbox-image`;let a=()=>{if(!i.complete||!i.naturalWidth)return;let{width:e,height:t}=i.getBoundingClientRect(),n=r.getBoundingClientRect(),a=window.devicePixelRatio||1;i.style.left=`${Math.round((n.width-e)/2*a)/a}px`,i.style.top=`${Math.round((n.height-t)/2*a)/a}px`,i.style.transform=`none`};i.addEventListener(`load`,a),i.src=t.src,r.appendChild(i),r.addEventListener(`click`,()=>{window.removeEventListener(`resize`,a),i.removeEventListener(`load`,a),r.remove()}),n.appendChild(r),window.addEventListener(`resize`,a),a()}function Ud(e,t){if(!e)return;let n=window.renderMathInElement;typeof n==`function`&&n(e,t??{delimiters:[{left:`$$`,right:`$$`,display:!0},{left:`$`,right:`$`,display:!1},{left:`\\(`,right:`\\)`,display:!1},{left:`\\[`,right:`\\]`,display:!0}],throwOnError:!1})}var Wd=[{key:`envId`,required:!0}];function Gd(e){let t=Wd.filter(t=>t.required&&Cd(e[t.key])).map(e=>e.key);if(t.length!==0){for(let e of t)zo.warn(`${e} is required`);throw Error(`Twikoo: failed to init`)}}async function Kd(e,t){let n=e;Gd(t);let r=n.init({env:t.envId??``,region:t.region}),i=r.auth({persistence:`local`});return i.hasLoginState?.()||await i.anonymousAuthProvider().signIn(),{app:r,auth:i}}function qd(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var Jd={},Yd=[],Xd=()=>{},Zd=()=>!1,Qd=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),$d=e=>e.startsWith(`onUpdate:`),ef=Object.assign,tf=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},nf=Object.prototype.hasOwnProperty,rf=(e,t)=>nf.call(e,t),af=Array.isArray,of=e=>hf(e)===`[object Map]`,sf=e=>hf(e)===`[object Set]`,cf=e=>hf(e)===`[object Date]`,lf=e=>typeof e==`function`,uf=e=>typeof e==`string`,df=e=>typeof e==`symbol`,ff=e=>typeof e==`object`&&!!e,pf=e=>(ff(e)||lf(e))&&lf(e.then)&&lf(e.catch),mf=Object.prototype.toString,hf=e=>mf.call(e),gf=e=>hf(e).slice(8,-1),_f=e=>hf(e)===`[object Object]`,vf=e=>uf(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,yf=qd(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),bf=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},xf=/-\w/g,Sf=bf(e=>e.replace(xf,e=>e.slice(1).toUpperCase())),Cf=/\B([A-Z])/g,wf=bf(e=>e.replace(Cf,`-$1`).toLowerCase()),Tf=bf(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ef=bf(e=>e?`on${Tf(e)}`:``),Df=(e,t)=>!Object.is(e,t),Of=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},kf=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},Af=e=>{let t=parseFloat(e);return isNaN(t)?e:t},jf,Mf=()=>jf||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function Nf(e){if(af(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=uf(r)?Lf(r):Nf(r);if(i)for(let e in i)t[e]=i[e]}return t}if(uf(e)||ff(e))return e}var Pf=/;(?![^(]*\))/g,Ff=/:([^]+)/,If=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Lf(e){let t={};return e.replace(If,e=>e.startsWith(`/*`)?``:e).split(Pf).forEach(e=>{if(e){let n=e.split(Ff);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Rf(e){let t=``;if(uf(e))t=e;else if(af(e))for(let n=0;n<e.length;n++){let r=Rf(e[n]);r&&(t+=r+` `)}else if(ff(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var zf=qd(`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`);function Bf(e){return!!e||e===``}function Vf(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=Gf(e[i],t[i],n);return r}function Hf(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&Gf(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Uf(e,t,n){let r=of(e),i=of(t);if(r||i||(r=sf(e),i=sf(t),r||i))return r&&i?Hf(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!Gf(e[r],t[r],n))return!1}return String(e)===String(t)}function Wf(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function Gf(e,t,n){if(e===t)return!0;let r=cf(e),i=cf(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=df(e),i=df(t),r||i?e===t:(r=af(e),i=af(t),r||i?r&&i?Wf(e,t,n,Vf):!1:(r=ff(e),i=ff(t),r||i?!r||!i?!1:Wf(e,t,n,Uf):String(e)===String(t))))}function Kf(e,t){return e.findIndex(e=>Gf(e,t))}var qf=e=>!!(e&&e.__v_isRef===!0),K=e=>uf(e)?e:e==null?``:af(e)||ff(e)&&(e.toString===mf||!lf(e.toString))?qf(e)?K(e.value):JSON.stringify(e,Jf,2):String(e),Jf=(e,t)=>qf(t)?Jf(e,t.value):of(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Yf(t,r)+` =>`]=n,e),{})}:sf(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Yf(e))}:df(t)?Yf(t):ff(t)&&!af(t)&&!_f(t)?String(t):t,Yf=(e,t=``)=>df(e)?`Symbol(${e.description??t})`:e,Xf,Zf=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Xf&&(Xf.active?(this.parent=Xf,this.index=(Xf.scopes||(Xf.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=Xf;try{return Xf=this,e()}finally{Xf=t}}}on(){++this._on===1&&(this.prevScope=Xf,Xf=this)}off(){if(this._on>0&&--this._on===0){if(Xf===this)Xf=this.prevScope;else{let e=Xf;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function Qf(){return Xf}var $f,ep=new WeakSet,tp=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Xf&&(Xf.active?Xf.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ep.has(this)&&(ep.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ap(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,vp(this),cp(this);let e=$f,t=mp;$f=this,mp=!0;try{return this.fn()}finally{lp(this),$f=e,mp=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)fp(e);this.deps=this.depsTail=void 0,vp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ep.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){up(this)&&this.run()}get dirty(){return up(this)}},np=0,rp,ip;function ap(e,t=!1){e.flags|=8,t?(e.next=ip,ip=e):(e.next=rp,rp=e)}function op(){np++}function sp(){if(--np>0)return;if(ip){let e=ip;for(ip=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;rp;){let t=rp;for(rp=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function cp(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function lp(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),fp(r),pp(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function up(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(dp(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function dp(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===yp)||(e.globalVersion=yp,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!up(e))))return;e.flags|=2;let t=e.dep,n=$f,r=mp;$f=e,mp=!0;try{cp(e);let n=e.fn(e._value);(t.version===0||Df(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{$f=n,mp=r,lp(e),e.flags&=-3}}function fp(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)fp(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function pp(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var mp=!0,hp=[];function gp(){hp.push(mp),mp=!1}function _p(){let e=hp.pop();mp=e===void 0||e}function vp(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=$f;$f=void 0;try{t()}finally{$f=e}}}var yp=0,bp=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},xp=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!$f||!mp||$f===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==$f)t=this.activeLink=new bp($f,this),$f.deps?(t.prevDep=$f.depsTail,$f.depsTail.nextDep=t,$f.depsTail=t):$f.deps=$f.depsTail=t,Sp(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=$f.depsTail,t.nextDep=void 0,$f.depsTail.nextDep=t,$f.depsTail=t,$f.deps===t&&($f.deps=e)}return t}trigger(e){this.version++,yp++,this.notify(e)}notify(e){op();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{sp()}}};function Sp(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Sp(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Cp=new WeakMap,wp=Symbol(``),Tp=Symbol(``),Ep=Symbol(``);function Dp(e,t,n){if(mp&&$f){let t=Cp.get(e);t||Cp.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new xp),r.map=t,r.key=n),r.track()}}function Op(e,t,n,r,i,a){let o=Cp.get(e);if(!o){yp++;return}let s=e=>{e&&e.trigger()};if(op(),t===`clear`)o.forEach(s);else{let i=af(e),a=i&&vf(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ep||!df(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ep)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(wp)),of(e)&&s(o.get(Tp)));break;case`delete`:i||(s(o.get(wp)),of(e)&&s(o.get(Tp)));break;case`set`:of(e)&&s(o.get(wp))}}sp()}function kp(e){let t=gm(e);return t===e||(Dp(t,`iterate`,Ep),mm(e))?t:pm(e)?fm(e)?t.map(e=>ym(vm(e))):t.map(ym):t.map(vm)}function Ap(e){return Dp(e=gm(e),`iterate`,Ep),e}function jp(e,t){return pm(e)?ym(fm(e)?vm(t):t):vm(t)}var Mp={__proto__:null,[Symbol.iterator](){return Np(this,Symbol.iterator,e=>jp(this,e))},concat(...e){return kp(this).concat(...e.map(e=>af(e)?kp(e):e))},entries(){return Np(this,`entries`,e=>(e[1]=jp(this,e[1]),e))},every(e,t){return Fp(this,`every`,e,t,void 0,arguments)},filter(e,t){return Fp(this,`filter`,e,t,e=>e.map(e=>jp(this,e)),arguments)},find(e,t){return Fp(this,`find`,e,t,e=>jp(this,e),arguments)},findIndex(e,t){return Fp(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Fp(this,`findLast`,e,t,e=>jp(this,e),arguments)},findLastIndex(e,t){return Fp(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Fp(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Lp(this,`includes`,e)},indexOf(...e){return Lp(this,`indexOf`,e)},join(e){return kp(this).join(e)},lastIndexOf(...e){return Lp(this,`lastIndexOf`,e)},map(e,t){return Fp(this,`map`,e,t,void 0,arguments)},pop(){return Rp(this,`pop`)},push(...e){return Rp(this,`push`,e)},reduce(e,...t){return Ip(this,`reduce`,e,t)},reduceRight(e,...t){return Ip(this,`reduceRight`,e,t)},shift(){return Rp(this,`shift`)},some(e,t){return Fp(this,`some`,e,t,void 0,arguments)},splice(...e){return Rp(this,`splice`,e)},toReversed(){return kp(this).toReversed()},toSorted(e){return kp(this).toSorted(e)},toSpliced(...e){return kp(this).toSpliced(...e)},unshift(...e){return Rp(this,`unshift`,e)},values(){return Np(this,`values`,e=>jp(this,e))}};function Np(e,t,n){let r=Ap(e),i=r[t]();return r!==e&&!mm(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var Pp=Array.prototype;function Fp(e,t,n,r,i,a){let o=Ap(e),s=o!==e&&!mm(e),c=o[t];if(c!==Pp[t]){let t=c.apply(e,a);return s?vm(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,jp(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function Ip(e,t,n,r){let i=Ap(e),a=i!==e&&!mm(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=jp(e,t)),n.call(this,t,jp(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?jp(e,c):c}function Lp(e,t,n){let r=gm(e);Dp(r,`iterate`,Ep);let i=r[t](...n);return(i===-1||i===!1)&&hm(n[0])?(n[0]=gm(n[0]),r[t](...n)):i}function Rp(e,t,n=[]){gp(),op();let r=gm(e)[t].apply(e,n);return sp(),_p(),r}var zp=qd(`__proto__,__v_isRef,__isVue`),Bp=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(df));function Vp(e){df(e)||(e=String(e));let t=gm(this);return Dp(t,`has`,e),t.hasOwnProperty(e)}var Hp=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?om:am:i?im:rm).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=af(e);if(!r){let e;if(a&&(e=Mp[t]))return e;if(t===`hasOwnProperty`)return Vp}let o=Reflect.get(e,t,bm(e)?e:n);if((df(t)?Bp.has(t):zp(t))||(r||Dp(e,`get`,t),i))return o;if(bm(o)){let e=a&&vf(t)?o:o.value;return r&&ff(e)?um(e):e}return ff(o)?r?um(o):cm(o):o}},Up=class extends Hp{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=af(e)&&vf(t);if(!this._isShallow){let e=pm(i);if(!mm(n)&&!pm(n)&&(i=gm(i),n=gm(n)),!a&&bm(i)&&!bm(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:rf(e,t),s=Reflect.set(e,t,n,bm(e)?e:r);return e===gm(r)&&s&&(o?Df(n,i)&&Op(e,`set`,t,n,i):Op(e,`add`,t,n)),s}deleteProperty(e,t){let n=rf(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&Op(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!df(t)||!Bp.has(t))&&Dp(e,`has`,t),n}ownKeys(e){return Dp(e,`iterate`,af(e)?`length`:wp),Reflect.ownKeys(e)}},Wp=class extends Hp{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},Gp=new Up,Kp=new Wp,qp=new Up(!0),Jp=e=>e,Yp=e=>Reflect.getPrototypeOf(e);function Xp(e,t,n){return function(...r){let i=this.__v_raw,a=gm(i),o=of(a),s=e===`entries`||e===Symbol.iterator&&o,c=e===`keys`&&o,l=i[e](...r),u=n?Jp:t?ym:vm;return!t&&Dp(a,`iterate`,c?Tp:wp),ef(Object.create(l),{next(){let{value:e,done:t}=l.next();return t?{value:e,done:t}:{value:s?[u(e[0]),u(e[1])]:u(e),done:t}}})}}function Zp(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function Qp(e,t){let n={get(n){let r=this.__v_raw,i=gm(r),a=gm(n);e||(Df(n,a)&&Dp(i,`get`,n),Dp(i,`get`,a));let{has:o}=Yp(i),s=t?Jp:e?ym:vm;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&Dp(gm(t),`iterate`,wp),t.size},has(t){let n=this.__v_raw,r=gm(n),i=gm(t);return e||(Df(t,i)&&Dp(r,`has`,t),Dp(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=gm(a),s=t?Jp:e?ym:vm;return!e&&Dp(o,`iterate`,wp),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return ef(n,e?{add:Zp(`add`),set:Zp(`set`),delete:Zp(`delete`),clear:Zp(`clear`)}:{add(e){let n=gm(this),r=Yp(n),i=gm(e),a=!t&&!mm(e)&&!pm(e)?i:e;return r.has.call(n,a)||Df(e,a)&&r.has.call(n,e)||Df(i,a)&&r.has.call(n,i)||(n.add(a),Op(n,`add`,a,a)),this},set(e,n){!t&&!mm(n)&&!pm(n)&&(n=gm(n));let r=gm(this),{has:i,get:a}=Yp(r),o=i.call(r,e);o||=(e=gm(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?Df(n,s)&&Op(r,`set`,e,n,s):Op(r,`add`,e,n),this},delete(e){let t=gm(this),{has:n,get:r}=Yp(t),i=n.call(t,e);i||=(e=gm(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&Op(t,`delete`,e,void 0,a),o},clear(){let e=gm(this),t=e.size!==0,n=e.clear();return t&&Op(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Xp(r,e,t)}),n}function $p(e,t){let n=Qp(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(rf(n,r)&&r in t?n:t,r,i)}var em={get:$p(!1,!1)},tm={get:$p(!1,!0)},nm={get:$p(!0,!1)},rm=new WeakMap,im=new WeakMap,am=new WeakMap,om=new WeakMap;function sm(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function cm(e){return pm(e)?e:dm(e,!1,Gp,em,rm)}function lm(e){return dm(e,!1,qp,tm,im)}function um(e){return dm(e,!0,Kp,nm,am)}function dm(e,t,n,r,i){if(!ff(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=sm(gf(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function fm(e){return pm(e)?fm(e.__v_raw):!!(e&&e.__v_isReactive)}function pm(e){return!!(e&&e.__v_isReadonly)}function mm(e){return!!(e&&e.__v_isShallow)}function hm(e){return e?!!e.__v_raw:!1}function gm(e){let t=e&&e.__v_raw;return t?gm(t):e}function _m(e){return!rf(e,`__v_skip`)&&Object.isExtensible(e)&&kf(e,`__v_skip`,!0),e}var vm=e=>ff(e)?cm(e):e,ym=e=>ff(e)?um(e):e;function bm(e){return e?e.__v_isRef===!0:!1}function q(e){return xm(e,!1)}function xm(e,t){return bm(e)?e:new Sm(e,t)}var Sm=class{constructor(e,t){this.dep=new xp,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:gm(e),this._value=t?e:vm(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||mm(e)||pm(e);e=n?e:gm(e),Df(e,t)&&(this._rawValue=e,this._value=n?e:vm(e),this.dep.trigger())}};function J(e){return bm(e)?e.value:e}var Cm={get:(e,t,n)=>t===`__v_raw`?e:J(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return bm(i)&&!bm(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function wm(e){return fm(e)?e:new Proxy(e,Cm)}var Tm=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new xp(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=yp-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&$f!==this)return ap(this,!0),!0}get value(){let e=this.dep.track();return dp(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Em(e,t,n=!1){let r,i;return lf(e)?r=e:(r=e.get,i=e.set),new Tm(r,i,n)}var Dm={},Om=new WeakMap,km=void 0;function Am(e,t=!1,n=km){if(n){let t=Om.get(n);t||Om.set(n,t=[]),t.push(e)}}function jm(e,t,n=Jd){let{immediate:r,deep:i,once:a,scheduler:o,augmentJob:s,call:c}=n,l=e=>i?e:mm(e)||i===!1||i===0?Mm(e,1):Mm(e),u,d,f,p,m=!1,h=!1;if(bm(e)?(d=()=>e.value,m=mm(e)):fm(e)?(d=()=>l(e),m=!0):af(e)?(h=!0,m=e.some(e=>fm(e)||mm(e)),d=()=>e.map(e=>{if(bm(e))return e.value;if(fm(e))return l(e);if(lf(e))return c?c(e,2):e()})):d=lf(e)?t?c?()=>c(e,2):e:()=>{if(f){gp();try{f()}finally{_p()}}let t=km;km=u;try{return c?c(e,3,[p]):e(p)}finally{km=t}}:Xd,t&&i){let e=d,t=i===!0?1/0:i;d=()=>Mm(e(),t)}let g=Qf(),_=()=>{u.stop(),g&&g.active&&tf(g.effects,u)};if(a&&t){let e=t;t=(...t)=>{let n=e(...t);return _(),n}}let v=h?Array(e.length).fill(Dm):Dm,y=e=>{if(u.flags&1&&(u.dirty||e)){if(t){let n=u.run();if(e||i||m||(h?n.some((e,t)=>Df(e,v[t])):Df(n,v))){f&&f();let e=km;km=u;try{let e=[n,v===Dm?void 0:h&&v[0]===Dm?[]:v,p];v=n,c?c(t,3,e):t(...e)}finally{km=e}}}else u.run()}};return s&&s(y),u=new tp(d),u.scheduler=o?()=>o(y,!1):y,p=e=>Am(e,!1,u),f=u.onStop=()=>{let e=Om.get(u);if(e){if(c)c(e,4);else for(let t of e)t();Om.delete(u)}},t?r?y(!0):v=u.run():o?o(y.bind(null,!0),!0):u.run(),_.pause=u.pause.bind(u),_.resume=u.resume.bind(u),_.stop=_,_}function Mm(e,t=1/0,n){if(t<=0||!ff(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,bm(e))Mm(e.value,t,n);else if(af(e))for(let r=0;r<e.length;r++)Mm(e[r],t,n);else if(sf(e)||of(e))e.forEach(e=>{Mm(e,t,n)});else if(_f(e)){for(let r in e)Mm(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Mm(e[r],t,n)}return e}function Nm(e,t,n,r){try{return r?e(...r):e()}catch(e){Fm(e,t,n)}}function Pm(e,t,n,r){if(lf(e)){let i=Nm(e,t,n,r);return i&&pf(i)&&i.catch(e=>{Fm(e,t,n)}),i}if(af(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Pm(e[a],t,n,r));return i}}function Fm(e,t,n,r=!0){let i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Jd;if(t){let r=t.parent,i=t.proxy,o=`https://vuejs.org/error-reference/#runtime-${n}`;for(;r;){let t=r.ec;if(t){for(let n=0;n<t.length;n++)if(t[n](e,i,o)===!1)return}r=r.parent}if(a){gp(),Nm(a,null,10,[e,i,o]),_p();return}}Im(e,n,i,r,o)}function Im(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Lm=[],Rm=-1,zm=[],Bm=null,Vm=0,Hm=Promise.resolve(),Um=null;function Wm(e){let t=Um||Hm;return e?t.then(this?e.bind(this):e):t}function Gm(e){let t=Rm+1,n=Lm.length;for(;t<n;){let r=t+n>>>1,i=Lm[r],a=Zm(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function Km(e){if(!(e.flags&1)){let t=Zm(e),n=Lm[Lm.length-1];!n||!(e.flags&2)&&t>=Zm(n)?Lm.push(e):Lm.splice(Gm(t),0,e),e.flags|=1,qm()}}function qm(){Um||=Hm.then(Qm)}function Jm(e){if(!af(e))Bm&&e.id===-1?Bm.splice(Vm+1,0,e):e.flags&1||(zm.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)zm.push(e[t]);qm()}function Ym(e,t,n=Rm+1){for(;n<Lm.length;n++){let t=Lm[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Lm.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function Xm(e){if(zm.length){let e=[...new Set(zm)].sort((e,t)=>Zm(e)-Zm(t));if(zm.length=0,Bm){for(let t=0;t<e.length;t++)Bm.push(e[t]);return}for(Bm=e,Vm=0;Vm<Bm.length;Vm++){let e=Bm[Vm];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Bm=null,Vm=0}}var Zm=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Qm(e){try{for(Rm=0;Rm<Lm.length;Rm++){let e=Lm[Rm];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Nm(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Rm<Lm.length;Rm++){let e=Lm[Rm];e&&(e.flags&=-2)}Rm=-1,Lm.length=0,Xm(e),Um=null,(Lm.length||zm.length)&&Qm(e)}}var $m=null,eh=null;function th(e){let t=$m;return $m=e,eh=e&&e.type.__scopeId||null,t}function nh(e,t=$m,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&b_(-1);let i=th(t),a=g_.length,o;try{o=e(...n)}finally{for(let e=g_.length;e>a;e--)v_();th(i),r._d&&b_(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function rh(e,t){if($m===null)return e;let n=nv($m),r=e.dirs||=[];for(let e=0;e<t.length;e++){let[i,a,o,s=Jd]=t[e];i&&(lf(i)&&(i={mounted:i,updated:i}),i.deep&&Mm(a),r.push({dir:i,instance:n,value:a,oldValue:void 0,arg:o,modifiers:s}))}return e}function ih(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(gp(),Pm(c,n,8,[e.el,s,e,t]),_p())}}function ah(e,t){if(B_){let n=B_.provides,r=B_.parent&&B_.parent.provides;r===n&&(n=B_.provides=Object.create(r)),n[e]=t}}function oh(e,t,n=!1){let r=V_();if(r||Sg){let i=Sg?Sg._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&lf(t)?t.call(r&&r.proxy):t}}var sh=Symbol.for(`v-scx`),ch=()=>oh(sh);function lh(e,t,n){return uh(e,t,n)}function uh(e,t,n=Jd){let{immediate:r,deep:i,flush:a,once:o}=n,s=ef({},n),c=t&&r||!t&&a!==`post`,l;if(q_){if(a===`sync`){let e=ch();l=e.__watcherHandles||=[]}else if(!c){let e=()=>{};return e.stop=Xd,e.resume=Xd,e.pause=Xd,e}}let u=B_;s.call=(e,t,n)=>Pm(e,u,t,n);let d=!1;a===`post`?s.scheduler=e=>{$g(e,u&&u.suspense)}:a!==`sync`&&(d=!0,s.scheduler=(e,t)=>{t?e():Km(e)}),s.augmentJob=e=>{t&&(e.flags|=4),d&&(e.flags|=2,u&&(e.id=u.uid,e.i=u))};let f=jm(e,t,s);return q_&&(l?l.push(f):c&&f()),f}function dh(e,t,n){let r=this.proxy,i=uf(e)?e.includes(`.`)?fh(r,e):()=>r[e]:e.bind(r,r),a;lf(t)?a=t:(a=t.handler,n=t);let o=W_(this),s=uh(i,a.bind(r),n);return o(),s}function fh(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var ph=Symbol(`_vte`),mh=e=>e.__isTeleport,hh=Symbol(`_leaveCb`);function gh(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==m_){t=n;break}}return t}function _h(e){if(!Eh(e))return mh(e.type)&&e.children?gh(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&lf(n.default))return n.default()}}function vh(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;vh(mh(n.type)&&_h(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function yh(e,t){return lf(e)?ef({name:e.name},t,{setup:e}):e}function bh(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function xh(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Sh=new WeakMap;function Ch(e,t,n,r,i=!1){if(af(e)){e.forEach((e,a)=>Ch(e,t&&(af(t)?t[a]:t),n,r,i));return}if(Th(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Ch(e,t,n,r.component.subTree);return}let a=r.shapeFlag&4?nv(r.component):r.el,o=i?null:a,{i:s,r:c}=e,l=t&&t.r,u=s.refs===Jd?s.refs={}:s.refs,d=s.setupState,f=gm(d),p=d===Jd?Zd:e=>!xh(u,e)&&rf(f,e),m=(e,t)=>!(t&&xh(u,t));if(l!=null&&l!==c){if(wh(t),uf(l))u[l]=null,p(l)&&(d[l]=null);else if(bm(l)){let e=t;m(l,e.k)&&(l.value=null),e.k&&(u[e.k]=null)}}if(lf(c))Nm(c,s,12,[o,u]);else{let t=uf(c),r=bm(c);if(t||r){let s=()=>{if(e.f){let n=t?p(c)?d[c]:u[c]:m(c)||!e.k?c.value:u[e.k];if(i)af(n)&&tf(n,a);else if(af(n))n.includes(a)||n.push(a);else if(t)u[c]=[a],p(c)&&(d[c]=u[c]);else{let t=[a];m(c,e.k)&&(c.value=t),e.k&&(u[e.k]=t)}}else t?(u[c]=o,p(c)&&(d[c]=o)):r&&(m(c,e.k)&&(c.value=o),e.k&&(u[e.k]=o))};if(o){let t=()=>{s(),Sh.delete(e)};t.id=-1,Sh.set(e,t),$g(t,n)}else wh(e),s()}}}function wh(e){let t=Sh.get(e);t&&(t.flags|=8,Sh.delete(e))}Mf().requestIdleCallback,Mf().cancelIdleCallback;var Th=e=>!!e.type.__asyncLoader,Eh=e=>e.type.__isKeepAlive;function Dh(e,t){kh(e,`a`,t)}function Oh(e,t){kh(e,`da`,t)}function kh(e,t,n=B_){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(jh(t,r,n),n){let e=n.parent;for(;e&&e.parent;)Eh(e.parent.vnode)&&Ah(r,t,n,e),e=e.parent}}function Ah(e,t,n,r){let i=jh(t,e,r,!0);Rh(()=>{tf(r[t],i)},n)}function jh(e,t,n=B_,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{gp();let i=W_(n),a=Pm(t,n,e,r);return i(),_p(),a};return r?i.unshift(a):i.push(a),a}}var Mh=e=>(t,n=B_)=>{(!q_||e===`sp`)&&jh(e,(...e)=>t(...e),n)},Nh=Mh(`bm`),Ph=Mh(`m`),Fh=Mh(`bu`),Ih=Mh(`u`),Lh=Mh(`bum`),Rh=Mh(`um`),zh=Mh(`sp`),Bh=Mh(`rtg`),Vh=Mh(`rtc`);function Hh(e,t=B_){jh(`ec`,e,t)}var Uh=`components`;function Wh(e,t){return Kh(Uh,e,!0,t)||e}var Gh=Symbol.for(`v-ndc`);function Kh(e,t,n=!0,r=!1){let i=$m||B_;if(i){let n=i.type;if(e===Uh){let e=rv(n,!1);if(e&&(e===t||e===Sf(t)||e===Tf(Sf(t))))return n}let a=qh(i[e]||n[e],t)||qh(i.appContext[e],t);return!a&&r?n:a}}function qh(e,t){return e&&(e[t]||e[Sf(t)]||e[Tf(Sf(t))])}function Jh(e,t,n,r){let i,a=n&&n[r],o=af(e);if(o||uf(e)){let n=o&&fm(e),r=!1,s=!1;n&&(r=!mm(e),s=pm(e),e=Ap(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?ym(vm(e[n])):vm(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(ff(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}function Yh(e,t,n,r,i,a){if(n??={},$m.ce||$m.parent&&Th($m.parent)&&$m.parent.ce){let e=a!=null&&n.key==null?ef({},n,{key:a}):n,i=Object.keys(e).length>0;return t!=="default"&&(e.name=t),Y(),S_(f_,null,[Q(`slot`,e,r&&r())],i?-2:64)}let o=e[t];o&&o._c&&(o._d=!1);let s=g_.length;Y();let c;try{let i=o&&Xh(o(n)),s=n.key||a||i&&i.key;c=S_(f_,{key:(s&&!df(s)?s:`_${t}`)+(!i&&r?`_fb`:``)},i||(r?r():[]),i&&e._===1?64:-2)}catch(e){for(let e=g_.length;e>s;e--)v_();throw e}finally{o&&o._c&&(o._d=!0)}return!i&&c.scopeId&&(c.slotScopeIds=[c.scopeId+`-s`]),c}function Xh(e){return e.some(e=>!C_(e)||!(e.type===m_||e.type===f_&&!Xh(e.children)))?e:null}var Zh=e=>e?K_(e)?nv(e):Zh(e.parent):null,Qh=ef(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Zh(e.parent),$root:e=>Zh(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>lg(e),$forceUpdate:e=>e.f||=()=>{Km(e.update)},$nextTick:e=>e.n||=Wm.bind(e.proxy),$watch:e=>dh.bind(e)}),$h=(e,t)=>e!==Jd&&!e.__isScriptSetup&&rf(e,t),eg={get({_:e},t){if(t===`__v_skip`)return!0;let{ctx:n,setupState:r,data:i,props:a,accessCache:o,type:s,appContext:c}=e;if(t[0]!==`$`){let e=o[t];if(e!==void 0)switch(e){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else if($h(r,t))return o[t]=1,r[t];else if(i!==Jd&&rf(i,t))return o[t]=2,i[t];else if(rf(a,t))return o[t]=3,a[t];else if(n!==Jd&&rf(n,t))return o[t]=4,n[t];else ig&&(o[t]=0)}let l=Qh[t],u,d;if(l)return t===`$attrs`&&Dp(e.attrs,`get`,``),l(e);if((u=s.__cssModules)&&(u=u[t]))return u;if(n!==Jd&&rf(n,t))return o[t]=4,n[t];if(d=c.config.globalProperties,rf(d,t))return d[t]},set({_:e},t,n){let{data:r,setupState:i,ctx:a}=e;return $h(i,t)?(i[t]=n,!0):r!==Jd&&rf(r,t)?(r[t]=n,!0):rf(e.props,t)||t[0]===`$`&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:a,type:o}},s){let c;return!!(n[s]||e!==Jd&&s[0]!==`$`&&rf(e,s)||$h(t,s)||rf(a,s)||rf(r,s)||rf(Qh,s)||rf(i.config.globalProperties,s)||(c=o.__cssModules)&&c[s])},defineProperty(e,t,n){return n.get==null?rf(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function tg(){return ng(`useSlots`).slots}function ng(e){let t=V_();return t.setupContext||=tv(t)}function rg(e){return af(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var ig=!0;function ag(e){let t=lg(e),n=e.proxy,r=e.ctx;ig=!1,t.beforeCreate&&sg(t.beforeCreate,e,`bc`);let{data:i,computed:a,methods:o,watch:s,provide:c,inject:l,created:u,beforeMount:d,mounted:f,beforeUpdate:p,updated:m,activated:h,deactivated:g,beforeDestroy:_,beforeUnmount:v,destroyed:y,unmounted:b,render:x,renderTracked:S,renderTriggered:C,errorCaptured:w,serverPrefetch:T,expose:E,inheritAttrs:D,components:ee,directives:te,filters:O}=t;if(l&&og(l,r,null),o)for(let e in o){let t=o[e];lf(t)&&(r[e]=t.bind(n))}if(i){let t=i.call(n,n);ff(t)&&(e.data=cm(t))}if(ig=!0,a)for(let e in a){let t=a[e],i=av({get:lf(t)?t.bind(n,n):lf(t.get)?t.get.bind(n,n):Xd,set:!lf(t)&&lf(t.set)?t.set.bind(n):Xd});Object.defineProperty(r,e,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e})}if(s)for(let e in s)cg(s[e],r,n,e);if(c){let e=lf(c)?c.call(n):c;Reflect.ownKeys(e).forEach(t=>{ah(t,e[t])})}u&&sg(u,e,`c`);function k(e,t){af(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(k(Nh,d),k(Ph,f),k(Fh,p),k(Ih,m),k(Dh,h),k(Oh,g),k(Hh,w),k(Vh,S),k(Bh,C),k(Lh,v),k(Rh,b),k(zh,T),af(E)){if(E.length){let t=e.exposed||={};E.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}x&&e.render===Xd&&(e.render=x),D!=null&&(e.inheritAttrs=D),ee&&(e.components=ee),te&&(e.directives=te),T&&bh(e)}function og(e,t,n=Xd){af(e)&&(e=mg(e));for(let n in e){let r=e[n],i;i=ff(r)?`default`in r?oh(r.from||n,r.default,!0):oh(r.from||n):oh(r),bm(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function sg(e,t,n){Pm(af(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function cg(e,t,n,r){let i=r.includes(`.`)?fh(n,r):()=>n[r];if(uf(e)){let n=t[e];lf(n)&&lh(i,n)}else if(lf(e))lh(i,e.bind(n));else if(ff(e)){if(af(e))e.forEach(e=>cg(e,t,n,r));else{let r=lf(e.handler)?e.handler.bind(n):t[e.handler];lf(r)&&lh(i,r,e)}}}function lg(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>ug(c,e,o,!0)),ug(c,t,o)),ff(t)&&a.set(t,c),c}function ug(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&ug(e,a,n,!0),i&&i.forEach(t=>ug(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=dg[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var dg={data:fg,props:_g,emits:_g,methods:gg,computed:gg,beforeCreate:hg,created:hg,beforeMount:hg,mounted:hg,beforeUpdate:hg,updated:hg,beforeDestroy:hg,beforeUnmount:hg,destroyed:hg,unmounted:hg,activated:hg,deactivated:hg,errorCaptured:hg,serverPrefetch:hg,components:gg,directives:gg,watch:vg,provide:fg,inject:pg};function fg(e,t){return t?e?function(){return ef(lf(e)?e.call(this,this):e,lf(t)?t.call(this,this):t)}:t:e}function pg(e,t){return gg(mg(e),mg(t))}function mg(e){if(af(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hg(e,t){return e?[...new Set([].concat(e,t))]:t}function gg(e,t){return e?ef(Object.create(null),e,t):t}function _g(e,t){return e?af(e)&&af(t)?[...new Set([...e,...t])]:ef(Object.create(null),rg(e),rg(t??{})):t}function vg(e,t){if(!e)return t;if(!t)return e;let n=ef(Object.create(null),e);for(let r in t)n[r]=hg(e[r],t[r]);return n}function yg(){return{app:null,config:{isNativeTag:Zd,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var bg=0;function xg(e,t){return function(n,r=null){lf(n)||(n=ef({},n)),r!=null&&!ff(r)&&(r=null);let i=yg(),a=new WeakSet,o=[],s=!1,c=i.app={_uid:bg++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:ov,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&lf(e.install)?(a.add(e),e.install(c,...t)):lf(e)&&(a.add(e),e(c,...t))),c},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),c},component(e,t){return t?(i.components[e]=t,c):i.components[e]},directive(e,t){return t?(i.directives[e]=t,c):i.directives[e]},mount(a,o,l){if(!s){let u=c._ceVNode||Q(n,r);return u.appContext=i,l===!0?l=`svg`:l===!1&&(l=void 0),o&&t?t(u,a):e(u,a,l),s=!0,c._container=a,a.__vue_app__=c,nv(u.component)}},onUnmount(e){o.push(e)},unmount(){s&&(Pm(o,c._instance,16),e(null,c._container),delete c._container.__vue_app__)},provide(e,t){return i.provides[e]=t,c},runWithContext(e){let t=Sg;Sg=c;try{return e()}finally{Sg=t}}};return c}}var Sg=null,Cg=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${Sf(t)}Modifiers`]||e[`${wf(t)}Modifiers`];function wg(e,t,...n){if(e.isUnmounted)return;let r=e.vnode.props||Jd,i=n,a=t.startsWith(`update:`),o=a&&Cg(r,t.slice(7));o&&(o.trim&&(i=n.map(e=>uf(e)?e.trim():e)),o.number&&(i=i.map(Af)));let s,c=r[s=Ef(t)]||r[s=Ef(Sf(t))];!c&&a&&(c=r[s=Ef(wf(t))]),c&&Pm(c,e,6,i);let l=r[s+`Once`];if(l){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,Pm(l,e,6,i)}}var Tg=new WeakMap;function Eg(e,t,n=!1){let r=n?Tg:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},s=!1;if(!lf(e)){let r=e=>{let n=Eg(e,t,!0);n&&(s=!0,ef(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!s?(ff(e)&&r.set(e,null),null):(af(a)?a.forEach(e=>o[e]=null):ef(o,a),ff(e)&&r.set(e,o),o)}function Dg(e,t){return!e||!Qd(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),rf(e,t[0].toLowerCase()+t.slice(1))||rf(e,wf(t))||rf(e,t))}function Og(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:o,attrs:s,emit:c,render:l,renderCache:u,props:d,data:f,setupState:p,ctx:m,inheritAttrs:h}=e,g=th(e),_,v;try{if(n.shapeFlag&4){let e=i||r,t=e;_=M_(l.call(t,e,u,d,p,f,m)),v=s}else{let e=t;_=M_(e.length>1?e(d,{attrs:s,slots:o,emit:c}):e(d,null)),v=t.props?s:kg(s)}}catch(t){g_.length=0,Fm(t,e,1),_=Q(m_)}let y=_;if(v&&h!==!1){let e=Object.keys(v),{shapeFlag:t}=y;e.length&&t&7&&(a&&e.some($d)&&(v=Ag(v,a)),y=k_(y,v,!1,!0))}return n.dirs&&(y=k_(y,null,!1,!0),y.dirs=y.dirs?y.dirs.concat(n.dirs):n.dirs),n.transition&&vh(mh(y.type)&&_h(y)||y,n.transition),_=y,th(g),_}var kg=e=>{let t;for(let n in e)(n===`class`||n===`style`||Qd(n))&&((t||={})[n]=e[n]);return t},Ag=(e,t)=>{let n={};for(let r in e)(!$d(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function jg(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Mg(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Ng(o,r,n)&&!Dg(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Mg(r,o,l):!!o;return!1}function Mg(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Ng(t,e,a)&&!Dg(n,a))return!0}return!1}function Ng(e,t,n){let r=e[n],i=t[n];return n===`style`&&ff(r)&&ff(i)?!Gf(r,i):r!==i}function Pg({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Fg={},Ig=()=>Object.create(Fg),Lg=e=>Object.getPrototypeOf(e)===Fg;function Rg(e,t,n,r=!1){let i={},a=Ig();e.propsDefaults=Object.create(null),Bg(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:lm(i):e.type.props?i:a,e.attrs=a}function zg(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=gm(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Dg(e.emitsOptions,o))continue;let u=t[o];if(c){if(rf(a,o))u!==a[o]&&(a[o]=u,l=!0);else{let t=Sf(o);i[t]=Vg(c,s,t,u,e,!1)}}else u!==a[o]&&(a[o]=u,l=!0)}}}else{Bg(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!rf(t,a)&&((r=wf(a))===a||!rf(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Vg(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!rf(t,e))&&(delete a[e],l=!0)}l&&Op(e.attrs,`set`,``)}function Bg(e,t,n,r){let[i,a]=e.propsOptions,o=!1,s;if(t)for(let c in t){if(yf(c))continue;let l=t[c],u;i&&rf(i,u=Sf(c))?!a||!a.includes(u)?n[u]=l:(s||={})[u]=l:Dg(e.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(a){let t=gm(n),r=s||Jd;for(let o=0;o<a.length;o++){let s=a[o];n[s]=Vg(i,t,s,r[s],e,!rf(r,s))}}return o}function Vg(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=rf(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&lf(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=W_(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===wf(n))&&(r=!0))}return r}var Hg=new WeakMap;function Ug(e,t,n=!1){let r=n?Hg:t.propsCache,i=r.get(e);if(i)return i;let a=e.props,o={},s=[],c=!1;if(!lf(e)){let r=e=>{c=!0;let[n,r]=Ug(e,t,!0);ef(o,n),r&&s.push(...r)};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}if(!a&&!c)return ff(e)&&r.set(e,Yd),Yd;if(af(a))for(let e=0;e<a.length;e++){let t=Sf(a[e]);Wg(t)&&(o[t]=Jd)}else if(a)for(let e in a){let t=Sf(e);if(Wg(t)){let n=a[e],r=o[t]=af(n)||lf(n)?{type:n}:ef({},n),i=r.type,c=!1,l=!0;if(af(i))for(let e=0;e<i.length;++e){let t=i[e],n=lf(t)&&t.name;if(n===`Boolean`){c=!0;break}n===`String`&&(l=!1)}else c=lf(i)&&i.name===`Boolean`;r[0]=c,r[1]=l,(c||rf(r,`default`))&&s.push(t)}}let l=[o,s];return ff(e)&&r.set(e,l),l}function Wg(e){return e[0]!==`$`&&!yf(e)}var Gg=e=>e===`_`||e===`_ctx`||e===`$stable`,Kg=e=>af(e)?e.map(M_):[M_(e)],qg=(e,t,n)=>{if(t._n)return t;let r=nh((...e)=>Kg(t(...e)),n);return r._c=!1,r},Jg=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Gg(n))continue;let i=e[n];if(lf(i))t[n]=qg(n,i,r);else if(i!=null){let e=Kg(i);t[n]=()=>e}}},Yg=(e,t)=>{let n=Kg(t);e.slots.default=()=>n},Xg=(e,t,n)=>{for(let r in t)(n||!Gg(r))&&(e[r]=t[r])},Zg=(e,t,n)=>{let r=e.slots=Ig();if(e.vnode.shapeFlag&32){let e=t._;e?(Xg(r,t,n),n&&kf(r,`_`,e,!0)):Jg(t,r)}else t&&Yg(e,t)},Qg=(e,t,n)=>{let{vnode:r,slots:i}=e,a=!0,o=Jd;if(r.shapeFlag&32){let e=t._;e?n&&e===1?a=!1:Xg(i,t,n):(a=!t.$stable,Jg(t,i)),o=t}else t&&(Yg(e,t),o={default:1});if(a)for(let e in i)!Gg(e)&&o[e]==null&&delete i[e]},$g=d_;function e_(e){return t_(e)}function t_(e,t){let n=Mf();n.__VUE__=!0;let{insert:r,remove:i,patchProp:a,createElement:o,createText:s,createComment:c,setText:l,setElementText:u,parentNode:d,nextSibling:f,setScopeId:p=Xd,insertStaticContent:m}=e,h=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!w_(e,t)&&(r=fe(e),se(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===Yd&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case p_:g(e,t,n,r);break;case m_:_(e,t,n,r);break;case h_:e??v(t,n,r,o);break;case f_:ee(e,t,n,r,i,a,o,s,c);break;default:d&1?x(e,t,n,r,i,a,o,s,c):d&6?te(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,he)}u!=null&&i?Ch(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Ch(e.ref,null,a,e,!0)},g=(e,t,n,i)=>{if(e==null)r(t.el=s(t.children),n,i);else{let n=t.el=e.el;t.children!==e.children&&l(n,t.children)}},_=(e,t,n,i)=>{e==null?r(t.el=c(t.children||``),n,i):t.el=e.el},v=(e,t,n,r)=>{[e.el,e.anchor]=m(e.children,t,n,r,e.el,e.anchor)},y=({el:e,anchor:t},n,i)=>{let a;for(;e&&e!==t;)a=f(e),r(e,n,i),e=a;r(t,n,i)},b=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=f(e),i(e),e=n;i(t)},x=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)S(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),T(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},S=(e,t,n,i,s,c,l,d)=>{let f,p,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(f=e.el=o(e.type,c,m&&m.is,m),h&8?u(f,e.children):h&16&&w(e.children,f,null,i,s,n_(e,c),l,d),_&&ih(e,null,i,`created`),C(f,e,e.scopeId,l,i),m){for(let e in m)e!==`value`&&!yf(e)&&a(f,e,null,m[e],c,i);`value`in m&&a(f,`value`,null,m.value,c),(p=m.onVnodeBeforeMount)&&I_(p,i,e)}_&&ih(e,null,i,`beforeMount`);let v=i_(s,g);v&&g.beforeEnter(f),r(f,t,n),((p=m&&m.onVnodeMounted)||v||_)&&$g(()=>{try{p&&I_(p,i,e),v&&g.enter(f),_&&ih(e,null,i,`mounted`)}finally{}},s)},C=(e,t,n,r,i)=>{if(n&&p(e,n),r)for(let t=0;t<r.length;t++)p(e,r[t]);if(i){let n=i.subTree;if(t===n||u_(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;C(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?N_(e[l]):M_(e[l]);h(null,c,t,n,r,i,a,o,s)}},T=(e,t,n,r,i,o,s)=>{let c=t.el=e.el,{patchFlag:l,dynamicChildren:d,dirs:f}=t;l|=e.patchFlag&16;let p=e.props||Jd,m=t.props||Jd,h;if(n&&r_(n,!1),(h=m.onVnodeBeforeUpdate)&&I_(h,n,t,e),f&&ih(t,e,n,`beforeUpdate`),n&&r_(n,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(l=0,s=!1,d=null),(p.innerHTML&&m.innerHTML==null||p.textContent&&m.textContent==null)&&u(c,``),d?E(e.dynamicChildren,d,c,n,r,n_(t,i),o):s||re(e,t,c,null,n,r,n_(t,i),o,!1),l>0){if(l&16)D(c,p,m,n,i);else if(l&2&&p.class!==m.class&&a(c,`class`,null,m.class,i),l&4&&a(c,`style`,p.style,m.style,i),l&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let r=e[t],o=p[r],s=m[r];(s!==o||r===`value`)&&a(c,r,o,s,i,n)}}l&1&&e.children!==t.children&&u(c,t.children)}else!s&&d==null&&D(c,p,m,n,i);((h=m.onVnodeUpdated)||f)&&$g(()=>{h&&I_(h,n,t,e),f&&ih(t,e,n,`updated`)},r)},E=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===f_||!w_(c,l)||c.shapeFlag&198)?d(c.el):n;h(c,l,u,null,r,i,a,o,!0)}},D=(e,t,n,r,i)=>{if(t!==n){if(t!==Jd)for(let o in t)!yf(o)&&!(o in n)&&a(e,o,t[o],null,i,r);for(let o in n){if(yf(o))continue;let s=n[o],c=t[o];s!==c&&o!==`value`&&a(e,o,c,s,i,r)}`value`in n&&a(e,`value`,t.value,n.value,i)}},ee=(e,t,n,i,a,o,c,l,u)=>{let d=t.el=e?e.el:s(``),f=t.anchor=e?e.anchor:s(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(l=l?l.concat(h):h),e==null?(r(d,n,i),r(f,n,i),w(t.children||[],n,f,a,o,c,l,u)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(E(e.dynamicChildren,m,n,a,o,c,l),(t.key!=null||a&&t===a.subTree)&&a_(e,t,!0)):re(e,t,n,f,a,o,c,l,u)},te=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):O(t,n,r,i,a,o,c):k(e,t,c)},O=(e,t,n,r,i,a,o)=>{let s=e.component=z_(e,r,i);if(Eh(e)&&(s.ctx.renderer=he),J_(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,A,o),!e.el){let r=s.subTree=Q(m_);_(null,r,t,n),e.placeholder=r.el}}else A(s,e,t,n,i,a,o)},k=(e,t,n)=>{let r=t.component=e.component;if(jg(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,ne(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},A=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=s_(e);if(n){t&&(t.el=c.el,ne(e,t,o)),n.asyncDep.then(()=>{$g(()=>{e.isUnmounted||l()},i)});return}}let u=t,f;r_(e,!1),t?(t.el=c.el,ne(e,t,o)):t=c,n&&Of(n),(f=t.props&&t.props.onVnodeBeforeUpdate)&&I_(f,s,t,c),r_(e,!0);let p=Og(e),m=e.subTree;e.subTree=p,h(m,p,d(m.el),fe(m),e,i,a),t.el=p.el,u===null&&Pg(e,p.el),r&&$g(r,i),(f=t.props&&t.props.onVnodeUpdated)&&$g(()=>I_(f,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Th(t);if(r_(e,!1),l&&Of(l),!m&&(o=c&&c.onVnodeBeforeMount)&&I_(o,d,t),r_(e,!0),s&&_e){let t=()=>{e.subTree=Og(e),_e(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Og(e);h(null,o,n,r,e,i,a),t.el=o.el}if(u&&$g(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;$g(()=>I_(o,d,e),i)}(t.shapeFlag&256||d&&Th(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&$g(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new tp(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>Km(u),r_(e,!0),l()},ne=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,zg(e,t.props,r,n),Qg(e,t.children,n),gp(),Ym(e),_p()},re=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,d=e?e.shapeFlag:0,f=t.children,{patchFlag:p,shapeFlag:m}=t;if(p>0){if(p&128){ae(l,f,n,r,i,a,o,s,c);return}if(p&256){ie(l,f,n,r,i,a,o,s,c);return}}m&8?(d&16&&de(l,i,a),f!==l&&u(n,f)):d&16?m&16?ae(l,f,n,r,i,a,o,s,c):de(l,i,a,!0):(d&8&&u(n,``),m&16&&w(f,n,r,i,a,o,s,c))},ie=(e,t,n,r,i,a,o,s,c)=>{e||=Yd,t||=Yd;let l=e.length,u=t.length,d=Math.min(l,u),f=0;for(;f<d;f++){let r=t[f]=c?N_(t[f]):M_(t[f]);h(e[f],r,n,null,i,a,o,s,c)}l>u?de(e,i,a,!0,!1,d):w(t,n,r,i,a,o,s,c,d)},ae=(e,t,n,r,i,a,o,s,c)=>{let l=0,u=t.length,d=e.length-1,f=u-1;for(;l<=d&&l<=f;){let r=e[l],u=t[l]=c?N_(t[l]):M_(t[l]);if(w_(r,u))h(r,u,n,null,i,a,o,s,c);else break;l++}for(;l<=d&&l<=f;){let r=e[d],l=t[f]=c?N_(t[f]):M_(t[f]);if(w_(r,l))h(r,l,n,null,i,a,o,s,c);else break;d--,f--}if(l>d){if(l<=f){let e=f+1,d=e<u?t[e].el:r;for(;l<=f;)h(null,t[l]=c?N_(t[l]):M_(t[l]),n,d,i,a,o,s,c),l++}}else if(l>f)for(;l<=d;)se(e[l],i,a,!0),l++;else{let p=l,m=l,g=new Map;for(l=m;l<=f;l++){let e=t[l]=c?N_(t[l]):M_(t[l]);e.key!=null&&g.set(e.key,l)}let _,v=0,y=f-m+1,b=!1,x=0,S=Array(y);for(l=0;l<y;l++)S[l]=0;for(l=p;l<=d;l++){let r=e[l];if(v>=y){se(r,i,a,!0);continue}let u;if(r.key!=null)u=g.get(r.key);else for(_=m;_<=f;_++)if(S[_-m]===0&&w_(r,t[_])){u=_;break}u===void 0?se(r,i,a,!0):(S[u-m]=l+1,u>=x?x=u:b=!0,h(r,t[u],n,null,i,a,o,s,c),v++)}let C=b?o_(S):Yd;for(_=C.length-1,l=y-1;l>=0;l--){let e=m+l,d=t[e],f=t[e+1],p=e+1<u?f.el||l_(f):r;S[l]===0?h(null,d,n,p,i,a,o,s,c):b&&(_<0||l!==C[_]?oe(d,n,p,2):_--)}}},oe=(e,t,n,a,o=null)=>{let{el:s,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6)oe(e.component.subTree,t,n,a);else if(d&128)e.suspense.move(t,n,a);else if(d&64)c.move(e,t,n,he);else if(c===f_){r(s,t,n);for(let e=0;e<u.length;e++)oe(u[e],t,n,a);r(e.anchor,t,n)}else if(c===h_)y(e,t,n);else if(a!==2&&d&1&&l){if(a===0)l.persisted&&!s[hh]?r(s,t,n):(l.beforeEnter(s),r(s,t,n),$g(()=>l.enter(s),o));else{let{leave:a,delayLeave:o,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?i(s):r(s,t,n)},d=()=>{let e=s._isLeaving||!!s[hh];s._isLeaving&&s[hh](!0),l.persisted&&!e?u():a(s,()=>{u(),c&&c()})};o?o(s,u,d):d()}}else r(s,t,n)},se=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(gp(),Ch(s,null,n,e,!0),_p()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Th(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&I_(_,t,e),u&6)ue(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&ih(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,he,r):l&&!l.hasOnce&&(a!==f_||d>0&&d&64)?de(l,t,n,!1,!0):(a===f_&&d&384||!i&&u&16)&&de(c,t,n),r&&ce(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&$g(()=>{_&&I_(_,t,e),h&&ih(e,null,t,`unmounted`),v&&(e.el=null)},n)},ce=e=>{let{type:t,el:n,anchor:r,transition:a}=e;if(t===f_){le(n,r);return}if(t===h_){b(e),a&&!a.persisted&&a.afterLeave&&a.afterLeave();return}let o=()=>{i(n),a&&!a.persisted&&a.afterLeave&&a.afterLeave()};if(e.shapeFlag&1&&a&&!a.persisted){let{leave:t,delayLeave:r}=a,i=()=>t(n,o);r?r(e.el,o,i):i()}else o()},le=(e,t)=>{let n;for(;e!==t;)n=f(e),i(e),e=n;i(t)},ue=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;c_(c),c_(l),r&&Of(r),i.stop(),a?(a.flags|=8,se(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,se(o,e,t,n)),s&&$g(s,t),$g(()=>{e.isUnmounted=!0},t)},de=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)se(e[o],t,n,r,i)},fe=e=>{if(e.shapeFlag&6)return fe(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=f(e.anchor||e.el),n=t&&t[ph];return n?f(n):t},pe=!1,me=(e,t,n)=>{let r;e==null?t._vnode&&(se(t._vnode,null,null,!0),r=t._vnode.component):h(t._vnode||null,e,t,null,null,null,n),t._vnode=e,pe||=(pe=!0,Ym(r),Xm(),!1)},he={p:h,um:se,m:oe,r:ce,mt:O,mc:w,pc:re,pbc:E,n:fe,o:e},ge,_e;return t&&([ge,_e]=t(he)),{render:me,hydrate:ge,createApp:xg(me,ge)}}function n_({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function r_({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function i_(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function a_(e,t,n=!1){let r=e.children,i=t.children;if(af(r)&&af(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=N_(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&a_(t,a)),a.type===p_&&(a.patchFlag===-1&&(a=i[e]=N_(a)),a.el=t.el),a.type===m_&&!a.el&&(a.el=t.el)}}function o_(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function s_(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:s_(t)}function c_(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function l_(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?l_(t.subTree):null}var u_=e=>e.__isSuspense;function d_(e,t){t&&t.pendingBranch?af(e)?t.effects.push(...e):t.effects.push(e):Jm(e)}var f_=Symbol.for(`v-fgt`),p_=Symbol.for(`v-txt`),m_=Symbol.for(`v-cmt`),h_=Symbol.for(`v-stc`),g_=[],__=null;function Y(e=!1){g_.push(__=e?null:[])}function v_(){g_.pop(),__=g_[g_.length-1]||null}var y_=1;function b_(e,t=!1){y_+=e,e<0&&__&&t&&(__.hasOnce=!0)}function x_(e){return e.dynamicChildren=y_>0?__||Yd:null,v_(),y_>0&&__&&__.push(e),e}function X(e,t,n,r,i,a){return x_(Z(e,t,n,r,i,a,!0))}function S_(e,t,n,r,i){return x_(Q(e,t,n,r,i,!0))}function C_(e){return e?e.__v_isVNode===!0:!1}function w_(e,t){return e.type===t.type&&e.key===t.key}var T_=({key:e})=>e??null,E_=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:uf(e)||bm(e)||lf(e)?{i:$m,r:e,k:t,f:!!n}:e);function Z(e,t=null,n=null,r=0,i=null,a=e===f_?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&T_(t),ref:t&&E_(t),scopeId:eh,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:$m};return s?(P_(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=uf(n)?8:16),y_>0&&!o&&__&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&__.push(c),c}var Q=D_;function D_(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Gh)&&(e=m_),C_(e)){let r=k_(e,t,!0);return n&&P_(r,n),y_>0&&!a&&__&&(r.shapeFlag&6?__[__.indexOf(e)]=r:__.push(r)),r.patchFlag=-2,r}if(iv(e)&&(e=e.__vccOpts),t){t=O_(t);let{class:e,style:n}=t;e&&!uf(e)&&(t.class=Rf(e)),ff(n)&&(hm(n)&&!af(n)&&(n=ef({},n)),t.style=Nf(n))}let o=uf(e)?1:u_(e)?128:mh(e)?64:ff(e)?4:lf(e)?2:0;return Z(e,t,n,r,i,o,a,!0)}function O_(e){return e?hm(e)||Lg(e)?ef({},e):e:null}function k_(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?F_(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&T_(l),ref:t&&t.ref?n&&a?af(a)?a.concat(E_(t)):[a,E_(t)]:E_(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==f_?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&k_(e.ssContent),ssFallback:e.ssFallback&&k_(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&vh(u,c.clone(u)),u}function A_(e=` `,t=0){return Q(p_,null,e,t)}function j_(e,t){let n=Q(h_,null,e);return n.staticCount=t,n}function $(e=``,t=!1){return t?(Y(),S_(m_,null,e)):Q(m_,null,e)}function M_(e){return e==null||typeof e==`boolean`?Q(m_):af(e)?Q(f_,null,e.slice()):C_(e)?N_(e):Q(p_,null,String(e))}function N_(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:k_(e)}function P_(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(af(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),P_(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Lg(t)?t._ctx=$m:r===3&&$m&&($m.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(lf(t)){if(r&65){P_(e,{default:t});return}t={default:t,_ctx:$m},n=32}else t=String(t),r&64?(n=16,t=[A_(t)]):n=8;e.children=t,e.shapeFlag|=n}function F_(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=Rf([t.class,r.class]));else if(e===`style`)t.style=Nf([t.style,r.style]);else if(Qd(e)){let n=t[e],i=r[e];i&&n!==i&&!(af(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!$d(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function I_(e,t,n,r=null){Pm(e,t,7,[n,r])}var L_=yg(),R_=0;function z_(e,t,n){let r=e.type,i=(t?t.appContext:e.appContext)||L_,a={uid:R_++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Zf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Ug(r,i),emitsOptions:Eg(r,i),emit:null,emitted:null,propsDefaults:Jd,inheritAttrs:r.inheritAttrs,ctx:Jd,data:Jd,props:Jd,attrs:Jd,slots:Jd,refs:Jd,setupState:Jd,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return a.ctx={_:a},a.root=t?t.root:a,a.emit=wg.bind(null,a),e.ce&&e.ce(a),a}var B_=null,V_=()=>B_||$m,H_,U_;{let e=Mf(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};H_=t(`__VUE_INSTANCE_SETTERS__`,e=>B_=e),U_=t(`__VUE_SSR_SETTERS__`,e=>q_=e)}var W_=e=>{let t=B_;return H_(e),e.scope.on(),()=>{e.scope.off(),H_(t)}},G_=()=>{B_&&B_.scope.off(),H_(null)};function K_(e){return e.vnode.shapeFlag&4}var q_=!1;function J_(e,t=!1,n=!1){t&&U_(t);let{props:r,children:i}=e.vnode,a=K_(e);Rg(e,r,a,t),Zg(e,i,n||t);let o=a?Y_(e,t):void 0;return t&&U_(!1),o}function Y_(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,eg);let{setup:r}=n;if(r){gp();let n=e.setupContext=r.length>1?tv(e):null,i=W_(e),a=Nm(r,e,0,[e.props,n]),o=pf(a);if(_p(),i(),(o||e.sp)&&!Th(e)&&bh(e),o){if(a.then(G_,G_),t)return a.then(n=>{U_(!0);try{X_(e,n,t)}finally{U_(!1)}}).catch(t=>{Fm(t,e,0)});e.asyncDep=a}else X_(e,a,t)}else $_(e,t)}function X_(e,t,n){lf(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ff(t)&&(e.setupState=wm(t)),$_(e,n)}var Z_,Q_;function $_(e,t,n){let r=e.type;if(!e.render){if(!t&&Z_&&!r.render){let t=r.template||lg(e).template;if(t){let{isCustomElement:n,compilerOptions:i}=e.appContext.config,{delimiters:a,compilerOptions:o}=r;r.render=Z_(t,ef(ef({isCustomElement:n,delimiters:a},i),o))}}e.render=r.render||Xd,Q_&&Q_(e)}{let t=W_(e);gp();try{ag(e)}finally{_p(),t()}}}var ev={get(e,t){return Dp(e,`get`,``),e[t]}};function tv(e){return{attrs:new Proxy(e.attrs,ev),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function nv(e){return e.exposed?e.exposeProxy||=new Proxy(wm(_m(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Qh)return Qh[n](e)},has(e,t){return t in e||t in Qh}}):e.proxy}function rv(e,t=!0){return lf(e)?e.displayName||e.name:e.name||t&&e.__name}function iv(e){return lf(e)&&`__vccOpts`in e}var av=(e,t)=>Em(e,t,q_),ov=`3.5.43`,sv=void 0,cv=typeof window<`u`&&window.trustedTypes;if(cv)try{sv=cv.createPolicy(`vue`,{createHTML:e=>e})}catch{}var lv=sv?e=>sv.createHTML(e):e=>e,uv=`http://www.w3.org/2000/svg`,dv=`http://www.w3.org/1998/Math/MathML`,fv=typeof document<`u`?document:null,pv=fv&&fv.createElement(`template`),mv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?fv.createElementNS(uv,e):t===`mathml`?fv.createElementNS(dv,e):n?fv.createElement(e,{is:n}):fv.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>fv.createTextNode(e),createComment:e=>fv.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>fv.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{pv.innerHTML=lv(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=pv.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},hv=Symbol(`_vtc`);function gv(e,t,n){let r=e[hv];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var _v=Symbol(`_vod`),vv=Symbol(`_vsh`),yv={name:`show`,beforeMount(e,{value:t},{transition:n}){e[_v]=e.style.display===`none`?``:e.style.display,n&&t?n.beforeEnter(e):bv(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),bv(e,!0),r.enter(e)):r.leave(e,()=>{bv(e,!1)}):bv(e,t))},beforeUnmount(e,{value:t}){bv(e,t)}};function bv(e,t){e.style.display=t?e[_v]:`none`,e[vv]=!t}var xv=Symbol(``),Sv=/(?:^|;)\s*display\s*:/;function Cv(e,t,n){let r=e.style,i=uf(n),a=!1;if(n&&!i){if(t){if(uf(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Tv(r,t,``)}else for(let e in t)n[e]??Tv(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Tv(r,i,``):kv(e,i,!uf(t)&&t?t[i]:void 0,o)||Tv(r,i,o)}}else if(i){if(t!==n){let e=r[xv];e&&(n+=`;`+e),r.cssText=n,a=Sv.test(n)}}else t&&e.removeAttribute(`style`);_v in e&&(e[_v]=a?r.display:``,e[vv]&&(r.display=`none`))}var wv=/\s*!important$/;function Tv(e,t,n){if(af(n))n.forEach(n=>Tv(e,t,n));else if(n??=``,t.startsWith(`--`))wv.test(n)?e.setProperty(t,n.replace(wv,``),`important`):e.setProperty(t,n);else{let r=Ov(e,t);wv.test(n)?e.setProperty(wf(r),n.replace(wv,``),`important`):e[r]=n}}var Ev=[`Webkit`,`Moz`,`ms`],Dv={};function Ov(e,t){let n=Dv[t];if(n)return n;let r=Sf(t);if(r!==`filter`&&r in e)return Dv[t]=r;r=Tf(r);for(let n=0;n<Ev.length;n++){let i=Ev[n]+r;if(i in e)return Dv[t]=i}return t}function kv(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&uf(r)&&n===r}var Av=`http://www.w3.org/1999/xlink`;function jv(e,t,n,r,i,a=zf(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Av,t.slice(6,t.length)):e.setAttributeNS(Av,t,n):n==null||a&&!Bf(n)?e.removeAttribute(t):e.setAttribute(t,a?``:df(n)?String(n):n)}function Mv(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?lv(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=Bf(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Nv(e,t,n,r){e.addEventListener(t,n,r)}function Pv(e,t,n,r){e.removeEventListener(t,n,r)}var Fv=Symbol(`_vei`);function Iv(e,t,n,r,i=null){let a=e[Fv]||(e[Fv]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=zv(t);r?Nv(e,n,a[t]=Uv(r,i),s):o&&(Pv(e,n,o,s),a[t]=void 0)}}var Lv=/(Once|Passive|Capture)$/,Rv=/^on:?(?:Once|Passive|Capture)$/;function zv(e){let t,n;for(;(n=e.match(Lv))&&!Rv.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):wf(e.slice(2)),t]}var Bv=0,Vv=Promise.resolve(),Hv=()=>Bv||=(Vv.then(()=>Bv=0),Date.now());function Uv(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(af(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Pm(e,t,5,a)}}else Pm(r,t,5,[e])};return n.value=e,n.attached=Hv(),n}var Wv=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Gv=(e,t,n,r,i,a)=>{let o=i===`svg`;t===`class`?gv(e,r,o):t===`style`?Cv(e,n,r):Qd(t)?$d(t)||Iv(e,t,n,r,a):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):Kv(e,t,r,o))?(Mv(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&jv(e,t,r,o,a,t!==`value`)):e._isVueCE&&(qv(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!uf(r)))?Mv(e,Sf(t),r,a,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),jv(e,t,r,o))};function Kv(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Wv(t)&&lf(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Wv(t)&&uf(n)?!1:t in e}function qv(e,t){let n=e._def.props;if(!n)return!1;let r=Sf(t);return Array.isArray(n)?n.some(e=>Sf(e)===r):Object.keys(n).some(e=>Sf(e)===r)}var Jv=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return af(t)?e=>Of(t,e):t},Yv=Symbol(`_assign`),Xv={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Nv(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?Af($v(e)):$v(e)),r=e.multiple,i=r?sf(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?af(i)?t.slice():t:i];try{e[Yv](i)}finally{Wm(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[Yv]=Jv(r)},mounted(e,{value:t}){Qv(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Yv]=Jv(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Zv(t,n[1],n[0]))&&Qv(e,t)}};function Zv(e,t,n){if(!n||af(e))return Gf(e,t);if(sf(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function Qv(e,t){let n=e.multiple,r=af(t);if(!n||r||sf(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=$v(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Kf(t,o)>-1}else a.selected=t.has(o)}else if(Gf($v(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $v(e){return`_value`in e?e._value:e.value}var ey=[`ctrl`,`shift`,`alt`,`meta`],ty={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>ey.some(n=>e[`${n}Key`]&&!t.includes(n))},ny=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=ty[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ry={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},iy=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=wf(n.key);if(t.some(e=>e===r||ry[e]===r))return e(n)}))},ay=ef({patchProp:Gv},mv),oy;function sy(){return oy||=e_(ay)}var cy=((...e)=>{let t=sy().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=uy(e);if(!r)return;let i=t._component;!lf(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,ly(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function ly(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function uy(e){return uf(e)?document.querySelector(e):e}var dy={"circle-check":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512m118-366.3c-10.7-7.8-25.7-5.4-33.5 5.3L221.1 315.2 169 263.1c-9.4-9.4-24.6-9.4-33.9 0s-9.4 24.6 0 33.9l72 72c5 5 11.8 7.5 18.8 7s13.4-4.1 17.5-9.8l135.9-187c7.8-10.7 5.4-25.7-5.3-33.5"/></svg>`,"circle-exclamation":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512m0-192a32 32 0 1 0 0 64 32 32 0 1 0 0-64m0-192c-18.2 0-32.7 15.5-31.4 33.7l7.4 104c.9 12.6 11.4 22.3 23.9 22.3 12.6 0 23-9.7 23.9-22.3l7.4-104c1.3-18.2-13.1-33.7-31.4-33.7z"/></svg>`,"circle-xmark":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512m-89-345c9.4-9.4 24.6-9.4 33.9 0l55 55 55-55c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9l-55 55 55 55c9.4 9.4 9.4 24.6 0 33.9s-24.6 9.4-33.9 0l-55-55-55 55c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l55-55-55-55c-9.4-9.4-9.4-24.6 0-33.9"/></svg>`,cog:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M195.1 9.5c3-14.8 16.1-25.5 31.3-25.5h59.8c15.2 0 28.3 10.7 31.3 25.5l14.5 70c14.1 6 27.3 13.7 39.3 22.8l67.8-22.5c14.4-4.8 30.2 1.2 37.8 14.4l29.9 51.8c7.6 13.2 4.9 29.8-6.5 39.9L447 233.3c.9 7.4 1.3 15 1.3 22.7s-.5 15.3-1.3 22.7l53.4 47.5c11.4 10.1 14 26.8 6.5 39.9L477 417.9c-7.6 13.1-23.4 19.2-37.8 14.4l-67.8-22.5c-12.1 9.1-25.3 16.7-39.3 22.8l-14.4 69.9c-3.1 14.9-16.2 25.5-31.3 25.5h-59.8c-15.2 0-28.3-10.7-31.3-25.5l-14.4-69.9c-14.1-6-27.2-13.7-39.3-22.8l-68.1 22.5c-14.4 4.8-30.2-1.2-37.8-14.4L5.8 366.1c-7.6-13.2-4.9-29.8 6.5-39.9l53.4-47.5c-.9-7.4-1.3-15-1.3-22.7s.5-15.3 1.3-22.7l-53.4-47.5C.9 175.7-1.7 159 5.8 145.9l29.9-51.8c7.6-13.2 23.4-19.2 37.8-14.4l67.8 22.5c12.1-9.1 25.3-16.7 39.3-22.8zM256.3 336a80 80 0 1 0-.6-160 80 80 0 1 0 .6 160"/></svg>`,comment:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M512 240c0 132.5-114.6 240-256 240-37.1 0-72.3-7.4-104.1-20.7L33.5 510.1c-9.4 4-20.2 1.7-27.1-5.8s-8.4-18.5-3.6-27.5l48.8-92.2C19.2 344.3 0 294.3 0 240 0 107.5 114.6 0 256 0s256 107.5 256 240"/></svg>`,"comment-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M51.9 384.9C19.3 344.6 0 294.4 0 240 0 107.5 114.6 0 256 0s256 107.5 256 240-114.6 240-256 240c-36.5 0-71.2-7.2-102.6-20L37 509.9c-3.7 1.6-7.5 2.1-11.5 2.1C11.4 512 0 500.6 0 486.5c0-4.3 1.1-8.5 3.1-12.2zm37.3-30.2c12.2 15.1 14.1 36.1 4.8 53.2L76 441l58.5-25.1c11.8-5.1 25.2-5.2 37.1-.3 25.7 10.5 54.2 16.4 84.3 16.4 117.8 0 208-88.8 208-192S373.8 48 256 48 48 136.8 48 240c0 42.8 15.1 82.4 41.2 114.7"/></svg>`,"face-smile":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512m-90.6-190.1c20.4 28 53.4 46.1 90.6 46.1s70.2-18.1 90.6-46.1c7.8-10.7 22.8-13.1 33.5-5.3s13.1 22.8 5.3 33.5C356.3 390 309.2 416 256 416s-100.3-26-129.4-65.9c-7.8-10.7-5.4-25.7 5.3-33.5s25.7-5.4 33.5 5.3M144 208a32 32 0 1 1 64 0 32 32 0 1 1-64 0m192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64"/></svg>`,heart:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="m241 87.1 15 20.7 15-20.7C296 52.5 336.2 32 378.9 32 452.4 32 512 91.6 512 165.1v2.6c0 112.2-139.9 242.5-212.9 298.2-12.4 9.4-27.6 14.1-43.1 14.1s-30.8-4.6-43.1-14.1C139.9 410.2 0 279.9 0 167.7v-2.6C0 91.6 59.6 32 133.1 32 175.8 32 216 52.5 241 87.1"/></svg>`,image:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M64 32C28.7 32 0 60.7 0 96v320c0 35.3 28.7 64 64 64h320c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64zm64 80a48 48 0 1 1 0 96 48 48 0 1 1 0-96m144 112c8.4 0 16.1 4.4 20.5 11.5l88 144c4.5 7.4 4.7 16.7.5 24.3S368.7 416 360 416H88c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l26.4 37.8 61.4-100.5c4.4-7.1 12.1-11.5 20.5-11.5z"/></svg>`,"image-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M64 80c-8.8 0-16 7.2-16 16v320c0 8.8 7.2 16 16 16h320c8.8 0 16-7.2 16-16V96c0-8.8-7.2-16-16-16zM0 96c0-35.3 28.7-64 64-64h320c35.3 0 64 28.7 64 64v320c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64zm128 32a32 32 0 1 1 0 64 32 32 0 1 1 0-64m136 72c8.5 0 16.4 4.5 20.7 11.8l80 136c4.4 7.4 4.4 16.6.1 24.1S352.6 384 344 384H104c-8.9 0-17.2-5-21.3-12.9s-3.5-17.5 1.6-24.8l56-80c4.5-6.4 11.8-10.2 19.7-10.2s15.2 3.8 19.7 10.2l17.2 24.6 46.5-79c4.3-7.3 12.2-11.8 20.7-11.8z"/></svg>`,laugh:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M256 512a256 256 0 1 0 0-512 256 256 0 1 0 0 512M101.6 314c-3.7-13.7 7.5-26 21.7-26h265.4c14.2 0 25.4 12.3 21.7 26-18.5 68-80.6 118-154.4 118s-136-50-154.4-118M144 192a32 32 0 1 1 64 0 32 32 0 1 1-64 0m192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64"/></svg>`,"laugh-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M464 256a208 208 0 1 0-416 0 208 208 0 1 0 416 0M0 256a256 256 0 1 1 512 0 256 256 0 1 1-512 0m118.3 58.2c-4.2-13.7 7.1-26.2 21.4-26.2h232.6c14.3 0 25.6 12.5 21.4 26.2C375.7 373.1 320.8 416 256 416s-119.7-42.9-137.7-101.8M144 192a32 32 0 1 1 64 0 32 32 0 1 1-64 0m192-32a32 32 0 1 1 0 64 32 32 0 1 1 0-64"/></svg>`,"location-arrow":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M477.9 75.5c4.5-11.8 1.7-25.2-7.2-34.1s-22.3-11.8-34.1-7.2l-416 160C7.9 199-.3 211.2 0 224.7s9.1 25.4 21.9 29.6l176.8 58.9L257.6 490c4.3 12.8 16.1 21.6 29.6 21.9s25.7-7.9 30.6-20.5l160-416z"/></svg>`,"magnifying-glass":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M416 208c0 45.9-14.9 88.3-40 122.7l126.6 126.7c12.5 12.5 12.5 32.8 0 45.3s-32.8 12.5-45.3 0L330.7 376c-34.4 25.1-76.8 40-122.7 40C93.1 416 0 322.9 0 208S93.1 0 208 0s208 93.1 208 208M208 352a144 144 0 1 0 0-288 144 144 0 1 0 0 288"/></svg>`,"paper-plane":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M536.4-26.3c9.8-3.5 20.6-1 28 6.3s9.8 18.2 6.3 28l-178 496.9c-5 13.9-18.1 23.1-32.8 23.1-14.2 0-27-8.6-32.3-21.7l-64.2-158c-4.5-11-2.5-23.6 5.2-32.6l94.5-112.4c5.1-6.1 4.7-15-.9-20.6s-14.6-6-20.6-.9l-112.4 94.3c-9.1 7.6-21.6 9.6-32.6 5.2L38.1 216.8c-13.1-5.3-21.7-18.1-21.7-32.3 0-14.7 9.2-27.8 23.1-32.8z"/></svg>`,reply:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M204.2 18.4c12 5 19.8 16.6 19.8 29.6v80h112c97.2 0 176 78.8 176 176 0 113.3-81.5 163.9-100.2 174.1-2.5 1.4-5.3 1.9-8.1 1.9-10.9 0-19.7-8.9-19.7-19.7 0-7.5 4.3-14.4 9.8-19.5 9.4-8.8 22.2-26.4 22.2-56.7 0-53-43-96-96-96h-96v80c0 12.9-7.8 24.6-19.8 29.6s-25.7 2.2-34.9-6.9l-160-160c-12.5-12.5-12.5-32.8 0-45.3l160-160c9.2-9.2 22.9-11.9 34.9-6.9z"/></svg>`,spinner:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M208 48a48 48 0 1 1 96 0 48 48 0 1 1-96 0m0 416a48 48 0 1 1 96 0 48 48 0 1 1-96 0M48 208a48 48 0 1 1 0 96 48 48 0 1 1 0-96m368 48a48 48 0 1 1 96 0 48 48 0 1 1-96 0M75 369.1a48 48 0 1 1 67.9 67.9A48 48 0 1 1 75 369.1M75 75a48 48 0 1 1 67.9 67.9A48 48 0 1 1 75 75m362 294.1a48 48 0 1 1-67.9 67.9 48 48 0 1 1 67.9-67.9"/></svg>`,sync:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M65.9 228.5C79.2 135.5 159.3 64 256 64c53 0 101 21.5 135.8 56.2l.6.6 7.6 7.2h-47.9c-17.7 0-32 14.3-32 32s14.3 32 32 32h128c17.7 0 32-14.3 32-32V32c0-17.7-14.3-32-32-32s-32 14.3-32 32v53.4l-11.3-10.7C390.5 28.6 326.5 0 256 0 127 0 20.3 95.4 2.6 219.5c-2.5 17.5 9.6 33.7 27.1 36.2s33.7-9.7 36.2-27.1zm443.5 64c2.5-17.5-9.7-33.7-27.1-36.2s-33.7 9.7-36.2 27.1c-13.3 93-93.4 164.5-190.1 164.5-53 0-101-21.5-135.8-56.2l-.6-.6-7.6-7.2h47.9c17.7 0 32-14.3 32-32s-14.3-32-32-32L32 320c-8.5 0-16.7 3.4-22.7 9.5S-.1 343.7 0 352.3l1 127c.1 17.7 14.6 31.9 32.3 31.7s31.9-14.6 31.7-32.3l-.4-51.5 10.7 10.1C121.6 483.4 185.5 512 256 512c129 0 235.7-95.4 253.4-219.5"/></svg>`,"thumbs-down":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M384 32c26.5 0 48 21.5 48 48 0 6.3-1.3 12.2-3.4 17.7C449 103.2 464 121.8 464 144c0 9.1-2.6 17.6-7 24.9 22.2 4.2 39 23.7 39 47.1 0 19.7-11.9 36.6-28.9 44 17 7.4 28.9 24.3 28.9 44 0 26.5-21.5 48-48 48H288l28.2 70.4c2.5 6.3 3.8 13.1 3.8 19.9v4.2c0 27.3-22.1 49.4-49.4 49.4-18.7 0-35.8-10.6-44.2-27.3l-56.3-112.3c-6.7-13.3-10.1-28-10.1-42.9V126.8c0-19.4 8.9-37.8 24-50l12.2-9.7C224.6 44.4 259.8 32 296.1 32zM80 96c17.7 0 32 14.3 32 32v256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V128c0-17.7 14.3-32 32-32z"/></svg>`,"thumbs-down-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="m360 32 7.4.4c35 3.6 62.5 32.2 64.4 67.7 17.8 11.8 30.1 31.4 32 53.9l.2 6c0 5.7-.7 11.2-2 16.5 10.2 11.5 16.8 26.3 17.8 42.7l.2 4.8c0 13.2-3.6 25.4-9.8 36 4.9 8.4 8.2 17.9 9.3 28l.4 8c0 37.3-28.3 67.9-64.6 71.6l-7.4.4H298.2l14.1 30 3.1 7.6c12.5 35.7-1.8 75.5-34.2 95l-7.2 3.9c-37.5 17.6-81.7 3.6-102.6-31.2l-.6-.9-2.7-5-.6-1.2-30.1-64c-9.4 17.8-28 29.9-49.5 29.9h-32c-30.9 0-56-25.1-56-56L0 152c0-30.9 25.1-56 56-56h32c12.4 0 23.9 4.1 33.2 11 13.2-21.4 32-39.4 55-51.6l12.2-6.5.7-.3 6.6-3.2.7-.3 7.1-3c16.7-6.6 34.5-9.9 52.6-9.9zM255.9 80c-12 0-23.9 2.3-35.1 6.6l-4.7 2-5.3 2.6-12.2 6.5c-29.2 15.5-48.3 44.9-50.7 77.6l-.2 8v112.9l.1 4.1c.5 8.2 2.5 16.2 6 23.7l56.8 120.9 2.1 3.8c8.4 13.7 26 19.1 40.8 12.2l2.9-1.6c13-7.8 18.7-23.7 13.7-38l-1.2-3-30.2-64.2c-3.5-7.4-2.9-16.1 1.5-23.1s12-11.1 20.2-11.1h147.5l2.4-.1c11.3-1.1 20.3-10.1 21.4-21.4l.1-2.5c0-7.1-3.1-13.5-8.2-18-5.2-4.6-8.2-11.1-8.2-18s3-13.4 8.2-18c4.4-3.9 7.4-9.3 8-15.3l.2-2.7c0-8.4-4.4-15.9-11.2-20.2-10.7-6.9-14.2-20.9-8-32 1.5-2.6 2.5-5.6 2.9-8.6l.2-3.2c0-10.6-6.9-19.6-16.6-22.8-11.7-3.8-18.7-15.9-16-28 .2-.9.3-1.8.4-2.6l.2-2.6c0-12.4-9.5-22.6-21.6-23.8L360 80zM56 144c-4.4 0-8 3.6-8 8v224c0 4.4 3.6 8 8 8h32c4.4 0 8-3.6 8-8V152c0-4.4-3.6-8-8-8z"/></svg>`,"thumbs-up":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M80 160c17.7 0 32 14.3 32 32v256c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32V192c0-17.7 14.3-32 32-32zM270.6 16c27.3 0 49.4 22.1 49.4 49.4v4.2c0 6.8-1.3 13.6-3.8 19.9L288 160h160c26.5 0 48 21.5 48 48 0 19.7-11.9 36.6-28.9 44 17 7.4 28.9 24.3 28.9 44 0 23.4-16.8 42.9-39 47.1 4.4 7.3 7 15.8 7 24.9 0 22.2-15 40.8-35.4 46.3 2.2 5.5 3.4 11.5 3.4 17.7 0 26.5-21.5 48-48 48h-87.9c-36.3 0-71.6-12.4-99.9-35.1l-12.2-9.7c-15.2-12.1-24-30.5-24-50V198.6c0-14.9 3.5-29.6 10.1-42.9l56.2-112.4c8.4-16.7 25.5-27.3 44.3-27.3"/></svg>`,"thumbs-up-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M171.5 38.8C192.3 4 236.5-10 274 7.6l7.2 3.8C316 32.3 330 76.5 312.4 114l-14.1 30H408l7.4.4c36.3 3.7 64.6 34.4 64.6 71.6 0 13.2-3.6 25.4-9.8 36 6.1 10.6 9.7 22.8 9.8 36 0 18.3-6.9 34.8-18 47.5 1.3 5.3 2 10.8 2 16.5 0 25.1-12.9 47-32.2 59.9-1.9 35.5-29.4 64.2-64.4 67.7l-7.4.4H255.9c-18 0-35.9-3.4-52.6-9.9l-7.1-3-.7-.3-6.6-3.2-.7-.3-12.2-6.5c-12.3-6.5-23.3-14.7-32.9-24.1-4.1 26.9-27.3 47.4-55.3 47.4h-32c-30.9 0-56-25.1-56-56L0 200c0-30.9 25.1-56 56-56h32c10.8 0 20.9 3.1 29.5 8.5L167.6 46l.6-1.2 2.7-5 .6-.9zM56 192c-4.4 0-8 3.6-8 8v224c0 4.4 3.6 8 8 8h32c4.4 0 8-3.6 8-8V200c0-4.4-3.6-8-8-8zM253.6 51c-14.8-6.9-32.3-1.6-40.7 12l-2.2 4-56.8 120.9c-3.5 7.5-5.5 15.5-6 23.7l-.1 4.2v112.9l.2 7.9c2.4 32.7 21.4 62.1 50.7 77.7l11.5 6.1 6.3 3.1c12.4 5.6 25.8 8.5 39.4 8.5H360l2.4-.1c12.1-1.2 21.6-11.5 21.6-23.9l-.2-2.6c-.1-.9-.2-1.7-.4-2.6-2.7-12.1 4.3-24.2 16-28 9.7-3.1 16.6-12.2 16.6-22.8 0-4.3-1.1-8.2-3.1-11.8-6.3-11.1-2.8-25.2 8-32 6.8-4.3 11.2-11.8 11.2-20.2 0-7.1-3.1-13.5-8.2-18-5.2-4.6-8.2-11.1-8.2-18s3-13.4 8.2-18c5.1-4.5 8.2-10.9 8.2-18l-.1-2.4c-1.1-11.3-10.1-20.3-21.4-21.4l-2.4-.1H260.7c-8.2 0-15.8-4.2-20.2-11.1s-5-15.7-1.5-23.1l30-64.3c7-15 1.4-32.7-12.5-41z"/></svg>`,times:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M55.1 73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L147.2 256 9.9 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l137.3-137.4 137.4 137.3c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.8 256l137.3-137.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192.5 210.7z"/></svg>`,trash:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M136.7 5.9C141.1-7.2 153.3-16 167.1-16H281c13.8 0 26 8.8 30.4 21.9L320 32h96c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 96 0 81.7 0 64s14.3-32 32-32h96zM32 144h384v304c0 35.3-28.7 64-64 64H96c-35.3 0-64-28.7-64-64zm88 64c-13.3 0-24 10.7-24 24v192c0 13.3 10.7 24 24 24s24-10.7 24-24V232c0-13.3-10.7-24-24-24m104 0c-13.3 0-24 10.7-24 24v192c0 13.3 10.7 24 24 24s24-10.7 24-24V232c0-13.3-10.7-24-24-24m104 0c-13.3 0-24 10.7-24 24v192c0 13.3 10.7 24 24 24s24-10.7 24-24V232c0-13.3-10.7-24-24-24"/></svg>`,"trash-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M166.2-16c-13.3 0-25.3 8.3-30 20.8L120 48H24C10.7 48 0 58.7 0 72s10.7 24 24 24h400c13.3 0 24-10.7 24-24s-10.7-24-24-24h-96L311.8 4.8c-4.7-12.5-16.6-20.8-30-20.8zM32 144v304c0 35.3 28.7 64 64 64h256c35.3 0 64-28.7 64-64V144h-48v304c0 8.8-7.2 16-16 16H96c-8.8 0-16-7.2-16-16V144zm160 72c0-13.3-10.7-24-24-24s-24 10.7-24 24v176c0 13.3 10.7 24 24 24s24-10.7 24-24zm112 0c0-13.3-10.7-24-24-24s-24 10.7-24 24v176c0 13.3 10.7 24 24 24s24-10.7 24-24z"/></svg>`,"user-circle":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M399 384.2c-22.1-38.4-63.6-64.2-111-64.2h-64c-47.4 0-88.9 25.8-111 64.2 35.2 39.2 86.2 63.8 143 63.8s107.8-24.7 143-63.8M0 256a256 256 0 1 1 512 0 256 256 0 1 1-512 0m256 16a72 72 0 1 0 0-144 72 72 0 1 0 0 144"/></svg>`,"window-maximize":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M64 64C28.7 64 0 92.7 0 128v256c0 35.3 28.7 64 64 64h384c35.3 0 64-28.7 64-64V128c0-35.3-28.7-64-64-64zm24 64h336c13.3 0 24 10.7 24 24s-10.7 24-24 24H88c-13.3 0-24-10.7-24-24s10.7-24 24-24"/></svg>`,"window-maximize-regular":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M48 224v160c0 8.8 7.2 16 16 16h384c8.8 0 16-7.2 16-16V224zM0 128c0-35.3 28.7-64 64-64h384c35.3 0 64 28.7 64 64v256c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64z"/></svg>`,android:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M131.2 61.9c5.3-.5 10.6.6 15.3 3s8.6 6.2 11.3 10.8c17 29.5 34.2 58.9 51.2 88.4q5.25-2.1 10.5-3.9c31.3-10.9 64.2-16.6 97.4-16.9h3.2c38.1 0 76.2 7 111.6 21.1L483 75.7c1.8-3.2 4.3-6 7.2-8.2s6.2-3.9 9.8-4.8c3.1-.8 6.4-1.1 9.6-.8 4.2.4 8.3 1.7 11.9 3.8 4 2.4 7.3 5.7 9.7 9.7 2 3.4 3.3 7.2 3.8 11.2s.1 8-1.2 11.7c-.6 1.9-1.4 3.7-2.4 5.5l-49.7 85.8c19.5 12.2 37.6 26.5 53.9 42.8 12.3 12.2 23.5 25.4 33.5 39.5 8.2 11.5 15.6 23.6 22.2 36.2 17.5 33.6 28.6 70.5 32.7 108.1H16c4.1-37.7 15.2-74.5 32.7-108.1 14.5-27.9 33.4-53.5 55.7-75.7 16.5-16.4 34.7-30.9 54.5-43.1l-49.5-85.4c-3.7-6.4-4.7-14.1-2.8-21.2s6.4-13.1 12.7-16.8c3.6-2.2 7.7-3.5 11.9-3.8zm67.3 215.8c-12.2-8.1-30.1-2.5-40.1 12.5s-8.2 33.8 3.9 41.9 30.1 2.5 40.1-12.5 8.2-33.8-3.9-41.9m283.6 12.5c-10-15-27.9-20.6-40.1-12.5s-13.9 26.9-3.9 41.9 27.9 20.6 40.1 12.5 13.9-26.9 3.9-41.9"/></svg>`,apple:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><path fill="currentColor" d="M319.1 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7-55.8.9-115.1 44.5-115.1 133.2 0 26.2 4.8 53.3 14.4 81.2 12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9m-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3"/></svg>`,chrome:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M0 256c0-46.6 12.5-90.4 34.3-128.9l109.8 191.2C166 357.5 207.9 384 256 384c14.3 0 27.1-2.3 40.8-6.6l-76.3 132.2C95.9 492.3 0 385.3 0 256m365.1 65.6c12.3-19.2 18.9-42.5 18.9-65.6 0-38.2-16.8-72.5-43.3-96h152.7c12 29.6 18.6 62.1 18.6 96 0 141.4-114.6 255.1-256 256zM477.8 128H256c-62.9 0-113.7 44.1-125.5 102.7L54.2 98.5C101 38.5 174 0 256 0c94.8 0 177.5 51.5 221.8 128M344 256a88 88 0 1 1-176 0 88 88 0 1 1 176 0"/></svg>`,edge:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M120.1 37.4C161.1 12.2 207.7-.8 255 0c168 0 257 123.8 257 219.5-.1 32.7-13 63.9-35.9 87.2-22.9 23.2-54 36.5-86.7 37-75.2 0-91.5-23.1-91.5-32 0-3.8 1.2-6.2 4.8-9.4l1-1.2.4-1.6c10.5-11.5 15.9-26.2 15.9-41.6 0-78.7-82.2-142.7-184-142.7-37.5-.3-74.5 8.9-107.5 26.9 27-57.5 82.7-97.6 91.3-103.8.8-.6.3-.8.3-.8zm15.6 318.1c-1.4 30 4.6 60 16.4 87.2 13.6 26.4 32.7 51 56.5 69.3-59.5-11.5-111.5-43.9-149.4-89.3C21.1 376.3 0 318.4 0 257.9c0-51.2 62.4-94.4 136-94.4 36.6-.6 72.4 10.9 101.8 32.7l-3.6 1.2c-51.5 17.6-98.5 90.7-98.5 158.1M469.8 400l-.7.1c-11.8 18.8-25.9 35.1-42.2 49.5-30.8 28-68.1 45.5-108.8 49.9-18.6.3-36.8-3.2-53.8-11.4-25.6-10.3-47.1-30-61.6-53-14.4-23.9-21.1-51.7-19-79.6-.6-20.1 5.4-40.3 15-58.2 13.9 33.1 37.5 61.3 67.6 80.8s65.5 29.5 101.4 28.6c31 .3 62.1-6.7 90.2-20.5l1.9-.9c3.9-2.3 7.7-3.9 11.6 0 4.5 4.9 1.8 9.2-1.2 14-.2.2-.3.5-.4.7"/></svg>`,"firefox-browser":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M481.6 172.9c-10.6-25.5-32.1-53-48.9-61.7 13.7 26.9 21.7 53.9 24.7 74 0 .1 0 .3.1.4-27.6-68.8-74.4-96.5-112.6-156.8-15-23.7-10.9-25.2-13.1-24.7l-.1.1c-46.7 26-75.3 78.4-82.6 122.7-16.6.9-32.9 5-47.9 12.1-1.4.6-2.5 1.7-3.1 3s-.9 2.8-.6 4.3c.2.8.6 1.6 1.1 2.3s1.2 1.3 1.9 1.7 1.6.7 2.4.8 1.7 0 2.5-.3l.5-.2c15.5-7.3 32.4-11.2 49.5-11.3 62.8-.6 97.2 44 107.6 62.3-13-9.2-36.4-18.2-58.8-14.3 87.7 43.9 64.2 194.5-57.4 189.2-59.5-2.6-97.1-51-100.5-90.8 0 0 11.2-41.9 80.6-41.9 7.5 0 28.9-20.9 29.3-27-.1-2-42.5-18.9-59.1-35.2-8.8-8.7-13.1-12.9-16.8-16.1q-3-2.55-6.3-4.8c-5.6-19.5-5.8-40-.7-59.6-25.1 11.4-44.6 29.4-58.7 45.4h-.1c-9.7-12.2-9-52.6-8.4-61.1-.1-.5-7.2 3.7-8.2 4.3-8.6 6.1-16.5 12.9-23.8 20.4-16.3 16.6-44.1 50.2-55.5 101.2-4.5 20.4-6.8 44.4-6.8 52.3 0 134.7 109.2 243.9 243.9 243.9 120.6 0 223-87.2 240.4-202.6 11.6-76.7-14.7-131.1-14.7-132z"/></svg>`,"internet-explorer":`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M483.1 159.7c10.9-24.6 21.4-60.4 21.4-87.9 0-72.7-79.6-98.4-209.7-38.6C187.2 26 83.6 106.9 57.7 219.7c30.9-34.9 78.3-82.3 122-101.2C125.4 166.8 79.1 227.9 44 291.7c-20.7 37.9-44 99.2-44 145 0 98.6 92.9 86.5 180.3 42 31.4 15.4 66.6 15.6 101.7 15.6 97.1 0 184.2-54.3 216.8-146H378c-52.5 88.6-196.8 53-196.8-47.4H510c6.4-43.6-1.7-95.7-26.9-141.2M64.6 346.9c17.7 51.1 53.7 95.8 100.2 123.3C76.1 519.1-8.4 499.3 64.6 346.9M180.5 238c2-55.2 50.3-94.9 104-94.9 53.4 0 102 39.7 104 94.9zM365.1 50.4c21.4-10.3 48.6-22 72.6-22 31.4 0 54.3 21.7 54.3 53.7 0 20-7.4 49-14.6 67.9-26.3-42.3-66-81.6-112.3-99.6"/></svg>`,linux:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="M220.9 123.3c1 .5 1.8 1.7 3 1.7 1.1 0 2.8-.4 2.9-1.5.2-1.4-1.9-2.3-3.2-2.9-1.7-.7-3.9-1-5.5-.1-.4.2-.8.7-.6 1.1.3 1.3 2.3 1.1 3.4 1.7M199 125c1.2 0 2-1.2 3-1.7 1.1-.6 3.1-.4 3.5-1.6.2-.4-.2-.9-.6-1.1-1.6-.9-3.8-.6-5.5.1-1.3.6-3.4 1.5-3.2 2.9.1 1 1.8 1.5 2.8 1.4m221 278.8c-3.6-4-5.3-11.6-7.2-19.7-1.8-8.1-3.9-16.8-10.5-22.4-1.3-1.1-2.6-2.1-4-2.9-1.3-.8-2.7-1.5-4.1-2 9.2-27.3 5.6-54.5-3.7-79.1-11.4-30.1-31.3-56.4-46.5-74.4-17.1-21.5-33.7-41.9-33.4-72C311.1 85.4 315.7.1 234.8 0 132.4-.2 158 103.4 156.9 135.2c-1.7 23.4-6.4 41.8-22.5 64.7-18.9 22.5-45.5 58.8-58.1 96.7-6 17.9-8.8 36.1-6.2 53.3-6.5 5.8-11.4 14.7-16.6 20.2-4.2 4.3-10.3 5.9-17 8.3s-14 6-18.5 14.5c-2.1 3.9-2.8 8.1-2.8 12.4 0 3.9.6 7.9 1.2 11.8 1.2 8.1 2.5 15.7.8 20.8-5.2 14.4-5.9 24.4-2.2 31.7 3.8 7.3 11.4 10.5 20.1 12.3 17.3 3.6 40.8 2.7 59.3 12.5 19.8 10.4 39.9 14.1 55.9 10.4 11.6-2.6 21.1-9.6 25.9-20.2 12.5-.1 26.3-5.4 48.3-6.6 14.9-1.2 33.6 5.3 55.1 4.1.6 2.3 1.4 4.6 2.5 6.7v.1c8.3 16.7 23.8 24.3 40.3 23 16.6-1.3 34.1-11 48.3-27.9 13.6-16.4 36-23.2 50.9-32.2 7.4-4.5 13.4-10.1 13.9-18.3.4-8.2-4.4-17.3-15.5-29.7M223.8 87.3c9.8-22.2 34.2-21.8 44-.4 6.5 14.2 3.6 30.9-4.3 40.4-1.6-.8-5.9-2.6-12.6-4.9 1.1-1.2 3.1-2.7 3.9-4.6 4.8-11.8-.2-27-9.1-27.3-7.3-.5-13.9 10.8-11.8 23-4.1-2-9.4-3.5-13-4.4-1-6.9-.3-14.6 2.9-21.8m-40.7-11.5c10.1 0 20.8 14.2 19.1 33.5-3.5 1-7.1 2.5-10.2 4.6 1.2-8.9-3.3-20.1-9.6-19.6-8.4.7-9.8 21.2-1.8 28.1 1 .8 1.9-.2-5.9 5.5-15.6-14.6-10.5-52.1 8.4-52.1m-13.6 60.7c6.2-4.6 13.6-10 14.1-10.5 4.7-4.4 13.5-14.2 27.9-14.2 7.1 0 15.6 2.3 25.9 8.9 6.3 4.1 11.3 4.4 22.6 9.3 8.4 3.5 13.7 9.7 10.5 18.2-2.6 7.1-11 14.4-22.7 18.1-11.1 3.6-19.8 16-38.2 14.9-3.9-.2-7-1-9.6-2.1-8-3.5-12.2-10.4-20-15-8.6-4.8-13.2-10.4-14.7-15.3q-2.1-7.35 4.2-12.3m3.3 334c-2.7 35.1-43.9 34.4-75.3 18-29.9-15.8-68.6-6.5-76.5-21.9-2.4-4.7-2.4-12.7 2.6-26.4v-.2c2.4-7.6.6-16-.6-23.9-1.2-7.8-1.8-15 .9-20 3.5-6.7 8.5-9.1 14.8-11.3 10.3-3.7 11.8-3.4 19.6-9.9 5.5-5.7 9.5-12.9 14.3-18 5.1-5.5 10-8.1 17.7-6.9 8.1 1.2 15.1 6.8 21.9 16l19.6 35.6c9.5 19.9 43.1 48.4 41 68.9m-1.4-25.9c-4.1-6.6-9.6-13.6-14.4-19.6 7.1 0 14.2-2.2 16.7-8.9 2.3-6.2 0-14.9-7.4-24.9-13.5-18.2-38.3-32.5-38.3-32.5-13.5-8.4-21.1-18.7-24.6-29.9s-3-23.3-.3-35.2c5.2-22.9 18.6-45.2 27.2-59.2 2.3-1.7.8 3.2-8.7 20.8-8.5 16.1-24.4 53.3-2.6 82.4.6-20.7 5.5-41.8 13.8-61.5 12-27.4 37.3-74.9 39.3-112.7 1.1.8 4.6 3.2 6.2 4.1 4.6 2.7 8.1 6.7 12.6 10.3 12.4 10 28.5 9.2 42.4 1.2 6.2-3.5 11.2-7.5 15.9-9 9.9-3.1 17.8-8.6 22.3-15 7.7 30.4 25.7 74.3 37.2 95.7 6.1 11.4 18.3 35.5 23.6 64.6 3.3-.1 7 .4 10.9 1.4 13.8-35.7-11.7-74.2-23.3-84.9-4.7-4.6-4.9-6.6-2.6-6.5 12.6 11.2 29.2 33.7 35.2 59 2.8 11.6 3.3 23.7.4 35.7 16.4 6.8 35.9 17.9 30.7 34.8-2.2-.1-3.2 0-4.2 0 3.2-10.1-3.9-17.6-22.8-26.1-19.6-8.6-36-8.6-38.3 12.5-12.1 4.2-18.3 14.7-21.4 27.3-2.8 11.2-3.6 24.7-4.4 39.9-.5 7.7-3.6 18-6.8 29-32.1 22.9-76.7 32.9-114.3 7.2m257.4-11.5c-.9 16.8-41.2 19.9-63.2 46.5-13.2 15.7-29.4 24.4-43.6 25.5s-26.5-4.8-33.7-19.3c-4.7-11.1-2.4-23.1 1.1-36.3 3.7-14.2 9.2-28.8 9.9-40.6.8-15.2 1.7-28.5 4.2-38.7 2.6-10.3 6.6-17.2 13.7-21.1.3-.2.7-.3 1-.5.8 13.2 7.3 26.6 18.8 29.5 12.6 3.3 30.7-7.5 38.4-16.3 9-.3 15.7-.9 22.6 5.1 9.9 8.5 7.1 30.3 17.1 41.6 10.6 11.6 14 19.5 13.7 24.6M173.4 148.7c2 1.9 4.7 4.5 8 7.1 6.6 5.2 15.8 10.6 27.3 10.6 11.6 0 22.5-5.9 31.8-10.8 4.9-2.6 10.9-7 14.8-10.4s5.9-6.3 3.1-6.6-2.6 2.6-6 5.1c-4.4 3.2-9.7 7.4-13.9 9.8-7.4 4.2-19.5 10.2-29.9 10.2s-18.7-4.8-24.9-9.7c-3.1-2.5-5.7-5-7.7-6.9-1.5-1.4-1.9-4.6-4.3-4.9-1.4-.1-1.8 3.7 1.7 6.5"/></svg>`,markdown:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><path fill="currentColor" d="M593.8 59.1H46.2C20.7 59.1 0 79.8 0 105.2v301.5c0 25.5 20.7 46.2 46.2 46.2h547.7c25.5 0 46.2-20.7 46.1-46.1V105.2c0-25.4-20.7-46.1-46.2-46.1M338.5 360.6H277v-120l-61.5 76.9-61.5-76.9v120H92.3V151.4h61.5l61.5 76.9 61.5-76.9h61.5v209.2zm135.3 3.1L381.5 256H443V151.4h61.5V256H566z"/></svg>`,safari:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="m274.7 274.7-37.4-37.4L166 346zM256 8a248 248 0 1 0 0 496 248 248 0 1 0 0-496m155.8 174.8 14.8-6.1c1-.4 2-.6 3.1-.6s2.1.2 3.1.6 1.8 1 2.6 1.7 1.3 1.6 1.7 2.6.6 2 .6 3.1-.2 2.1-.6 3.1-1 1.9-1.7 2.6-1.6 1.3-2.6 1.7l-14.8 6.1c-2 .8-4.2.8-6.1 0s-3.5-2.4-4.3-4.3-.8-4.2 0-6.1 2.4-3.5 4.3-4.3zM314.4 94l6.1-14.8c.8-2 2.4-3.5 4.3-4.3s4.2-.8 6.1 0 3.5 2.4 4.3 4.3.8 4.2 0 6.1l-6.1 14.8c-.8 2-2.4 3.5-4.3 4.3s-4.2.8-6.1 0c-1-.4-1.9-1-2.6-1.7s-1.3-1.6-1.7-2.6-.6-2-.6-3.1.2-2.1.6-3.1zM256 60c2.1 0 4.2.8 5.7 2.3s2.3 3.6 2.3 5.7v16c0 2.1-.8 4.2-2.3 5.7S258.2 92 256 92s-4.2-.8-5.7-2.3-2.3-3.5-2.3-5.7V68c0-2.1.8-4.2 2.3-5.7s3.6-2.3 5.7-2.3m-75 14.9c1-.4 2-.6 3.1-.6s2.1.2 3.1.6 1.9 1 2.6 1.7 1.3 1.6 1.7 2.6l6.1 14.8c.4 1 .7 2 .7 3.1s-.2 2.1-.6 3.1-1 1.9-1.7 2.6-1.6 1.4-2.6 1.8-2 .6-3.1.6-2.1-.2-3.1-.6-1.9-1-2.6-1.8-1.3-1.7-1.7-2.7l-6.1-14.8c-.8-2-.8-4.2 0-6.1s2.4-3.5 4.3-4.3zm-63.6 42.5c1.5-1.5 3.5-2.3 5.7-2.3s4.2.8 5.7 2.3l11.2 11.3c1.5 1.5 2.3 3.5 2.3 5.6s-.8 4.1-2.3 5.6-3.5 2.3-5.7 2.3-4.2-.8-5.7-2.3l-11.3-11.3c-1.5-1.5-2.3-3.5-2.3-5.6s.8-4.1 2.3-5.6zM60 256c0-2.1.8-4.2 2.3-5.7s3.6-2.3 5.7-2.3h16c2.1 0 4.2.8 5.7 2.3s2.3 3.5 2.3 5.7-.8 4.2-2.3 5.7-3.5 2.3-5.7 2.3H68c-2.1 0-4.2-.8-5.7-2.3S60 258.1 60 256m40.2 73.2-14.8 6.1c-1 .4-2 .6-3.1.6s-2.1-.2-3.1-.6-1.9-1-2.6-1.7-1.3-1.6-1.7-2.6-.6-2-.6-3.1.2-2.1.6-3.1 1-1.9 1.7-2.6 1.6-1.3 2.6-1.7l14.8-6.1c2-.8 4.2-.8 6.1 0s3.5 2.4 4.3 4.3.8 4.2 0 6.1-2.4 3.5-4.3 4.3zm4.3-136c-.4 1-1 1.9-1.7 2.6s-1.6 1.3-2.6 1.7-2 .6-3.1.6-2.1-.2-3.1-.6l-14.8-6.1c-2-.8-3.5-2.4-4.3-4.3s-.8-4.2 0-6.1 2.4-3.5 4.3-4.3 4.2-.8 6.1 0l14.8 6.1c2 .8 3.5 2.4 4.3 4.3s.8 4.2 0 6.1zM197.6 418l-6.1 14.8c-.4 1-1 1.9-1.7 2.6s-1.6 1.3-2.6 1.7-2 .6-3.1.6-2.1-.2-3.1-.6-1.9-1-2.6-1.7-1.3-1.6-1.7-2.6-.6-2-.6-3.1.2-2.1.6-3.1l6.1-14.8c.4-1 1-1.9 1.7-2.7s1.6-1.4 2.6-1.8 2-.6 3.1-.6 2.1.2 3.1.6 1.9 1 2.6 1.8 1.3 1.7 1.7 2.6.6 2 .6 3.1-.2 2.1-.7 3.1zm66.4 26c0 2.1-.8 4.2-2.3 5.7s-3.5 2.3-5.7 2.3-4.2-.8-5.7-2.3-2.3-3.5-2.3-5.7v-16c0-2.1.8-4.2 2.3-5.7s3.5-2.3 5.7-2.3 4.2.8 5.7 2.3 2.3 3.5 2.3 5.7zm67-6.9c-1 .4-2 .6-3.1.6s-2.1-.2-3.1-.6-1.9-1-2.6-1.7-1.3-1.6-1.7-2.6l-6.1-14.8c-.8-2-.8-4.2 0-6.1s2.4-3.5 4.3-4.3 4.2-.8 6.1 0 3.5 2.4 4.3 4.3l6.1 14.8c.8 2 .8 4.2 0 6.1s-2.4 3.5-4.3 4.3zm63.6-42.5c-1.5 1.5-3.5 2.3-5.7 2.3s-4.2-.8-5.7-2.3L372 383.3c-1.5-1.5-2.3-3.5-2.3-5.6s.8-4.1 2.3-5.6 3.5-2.3 5.7-2.3 4.2.8 5.7 2.3l11.3 11.3c1.5 1.5 2.3 3.5 2.3 5.6s-.8 4.1-2.3 5.6zM286.2 286.2 110.3 401.7l115.5-175.9 175.9-115.5zM437.1 331c-.8 2-2.4 3.5-4.3 4.3s-4.2.8-6.1 0l-14.8-6.1c-2-.8-3.5-2.4-4.3-4.3s-.8-4.2 0-6.1c.4-1 1-1.9 1.7-2.6s1.6-1.3 2.6-1.7 2-.6 3.1-.6 2.1.2 3.1.6l14.8 6.1c2 .8 3.5 2.4 4.3 4.3s.8 4.2 0 6.1zm6.9-67h-16c-2.1 0-4.2-.8-5.7-2.3s-2.3-3.5-2.3-5.7.8-4.2 2.3-5.7 3.5-2.3 5.7-2.3h16c2.1 0 4.2.8 5.7 2.3s2.3 3.5 2.3 5.7-.8 4.2-2.3 5.7-3.5 2.3-5.7 2.3"/></svg>`,ubuntu:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path fill="currentColor" d="M469.2 75c0-20.1-8-39.3-22.2-53.5S413.6-.7 393.5-.7s-39.3 8-53.5 22.2-22.2 33.4-22.2 53.5 8 39.3 22.1 53.5 33.4 22.1 53.5 22.1 39.3-8 53.5-22.1S469 95.1 469 75h.1zm-315 165.7a75.6 75.6 0 1 0-151.2 0 75.6 75.6 0 1 0 151.2 0M57 346c18.6 46.9 51 87 93 115.1s91.5 42.6 142 41.7c-14.7-18.6-22.9-41.5-23.2-65.2-6.8-.9-13.3-2.1-19.5-3.4-26.8-5.7-51.9-17.3-73.6-34s-39.3-38.1-51.7-62.5c-20.9 9.9-44.5 12.8-67.1 8.2zm395.1 89.8a75.6 75.6 0 1 0-151.2 0 75.6 75.6 0 1 0 151.2 0m-8.1-84.2c18.5 14.8 31.6 35.2 37.2 58.2 33.3-41.3 52.6-92.2 54.8-145.2s-12.5-105.4-42.2-149.4c-8.6 21.5-24 39.6-43.8 51.6 15.4 28.6 22.9 60.8 21.9 93.2s-10.7 64-28 91.6zM101.1 135.4c12.4 2.7 24.3 7.5 35.1 14.3 16.6-24.2 38.9-44.1 64.8-58s54.8-21.3 84.2-21.7c.2-5.9.9-11.9 2-17.7C290.8 35.6 298.3 20 309 6.8c-47.7-3.8-95.4 6-137.6 28.5S94.3 91.7 70.8 133.4c2.7-.2 5.3-.3 8-.3 7.5 0 15 .8 22.4 2.3z"/></svg>`,windows:`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="currentColor" d="m0 93.7 183.6-25.3v177.4H0zm0 324.6 183.6 25.3V268.4H0zm203.8 28L448 480V268.4H203.8zm0-380.6v180.1H448V32z"/></svg>`},fy=[`innerHTML`],py=yh({__name:`TkIcon`,props:{name:{}},setup(e){let t=e,n=av(()=>dy[t.name]||(console.warn(`[twikoo] 未注册的图标: ${t.name}(请在 components/icons.ts 登记)`),``));return(e,t)=>(Y(),X(f_,null,[$(` SVG 内容来自 fontawesome-free 官方文件(构建期内联,非运行时注入用户数据) `),$(` eslint-disable-next-line vue/no-v-html `),Z(`i`,{class:`tk-icon`,innerHTML:n.value},null,8,fy)],2112))}}),my={class:`tk-action`},hy={class:`tk-action-icon`},gy={class:`tk-action-icon tk-action-icon-solid`},_y={class:`tk-action-icon`},vy={class:`tk-action-icon tk-action-icon-solid`},yy={class:`tk-action-count`},by={class:`tk-action-icon`},xy={class:`tk-action-icon tk-action-icon-solid`},Sy={class:`tk-action-count`},Cy={class:`tk-action-icon`},wy={class:`tk-action-icon tk-action-icon-solid`},Ty={class:`tk-action-count`},Ey=yh({__name:`TkAction`,props:{liked:{type:Boolean,default:!1},disliked:{type:Boolean,default:!1},likeCount:{default:0},dislikeCount:{default:0},repliesCount:{default:0},showDislike:{type:Boolean,default:!0},showDelete:{type:Boolean,default:!1}},emits:[`like`,`dislike`,`reply`,`delete`],setup(e,{emit:t}){let n=e,r=t,i=av(()=>n.likeCount>0?`${n.likeCount}`:``),a=av(()=>n.dislikeCount>0?`${n.dislikeCount}`:``),o=av(()=>n.repliesCount>0?`${n.repliesCount}`:``);return(t,n)=>(Y(),X(`div`,my,[e.showDelete?(Y(),X(`button`,{key:0,class:`tk-action-link`,onClick:n[0]||=e=>r(`delete`)},[Z(`span`,hy,[Q(py,{name:`trash-regular`})]),Z(`span`,gy,[Q(py,{name:`trash`})]),n[4]||=Z(`span`,{class:`tk-action-count`},null,-1)])):$(`v-if`,!0),Z(`button`,{class:Rf([`tk-action-link`,{"tk-liked":e.liked}]),onClick:n[1]||=e=>r(`like`)},[Z(`span`,_y,[Q(py,{name:`thumbs-up-regular`})]),Z(`span`,vy,[Q(py,{name:`thumbs-up`})]),Z(`span`,yy,K(i.value),1)],2),e.showDislike?(Y(),X(`button`,{key:1,class:Rf([`tk-action-link`,{"tk-disliked":e.disliked}]),onClick:n[2]||=e=>r(`dislike`)},[Z(`span`,by,[Q(py,{name:`thumbs-down-regular`})]),Z(`span`,xy,[Q(py,{name:`thumbs-down`})]),Z(`span`,Sy,K(a.value),1)],2)):$(`v-if`,!0),Z(`button`,{class:`tk-action-link`,onClick:n[3]||=e=>r(`reply`)},[Z(`span`,Cy,[Q(py,{name:`comment-regular`})]),Z(`span`,wy,[Q(py,{name:`comment`})]),Z(`span`,Ty,K(o.value),1)])]))}}),Dy={},Oy={key:0,class:`tk-avatar-img`},ky=[`src`],Ay=yh({__name:`TkAvatar`,props:{nick:{default:``},avatar:{default:``},mail:{default:``},mailMd5:{default:``},link:{default:``},config:{default:Dy}},setup(e){let t=e,n=av(()=>cl({avatar:t.avatar,mailMd5:t.mailMd5,mail:t.mail,nick:t.nick},t.config));function r(){t.link&&window.open(Ed(t.link),`_blank`)?.focus()}return(t,i)=>(Y(),X(`div`,{class:Rf([`tk-avatar`,{"tk-clickable":!!e.link,"tk-has-avatar":!!n.value}]),onClick:r},[n.value?(Y(),X(`img`,{key:1,class:`tk-avatar-img`,src:n.value,alt:``},null,8,ky)):(Y(),X(`div`,Oy,[Q(py,{name:`user-circle`})]))],2))}}),jy={key:0,class:`tk-input-group__prepend`},My=[`name`,`value`,`placeholder`,`rows`,`disabled`,`readonly`,`maxlength`],Ny=[`type`,`name`,`value`,`placeholder`,`disabled`,`readonly`,`maxlength`,`min`,`max`],Py={key:3,class:`tk-input__suffix`},Fy={key:4,class:`tk-input__count`},Iy={key:5,class:`tk-input-group__append`},Ly=yh({__name:`TkInput`,props:{modelValue:{default:``},type:{default:`text`},placeholder:{default:``},rows:{default:2},autosize:{type:[Boolean,Object],default:!1},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},maxlength:{default:void 0},showWordLimit:{type:Boolean,default:!1},clearable:{type:Boolean,default:!1},size:{default:``},name:{default:``},min:{default:void 0},max:{default:void 0}},emits:[`update:modelValue`,`input`,`change`,`blur`,`focus`,`clear`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=tg(),o=q(),s=av(()=>!!a.prepend),c=av(()=>!!a.append),l=av(()=>r.clearable&&!r.disabled&&!r.readonly&&u.value),u=av(()=>r.modelValue!==``&&r.modelValue!==void 0&&r.modelValue!==null),d=av(()=>String(r.modelValue??``).length);function f(e){let t=e.target.value;i(`update:modelValue`,t),i(`input`,t,e)}function p(e){i(`change`,e.target.value)}function m(e){i(`blur`,e)}function h(e){i(`focus`,e)}function g(){i(`update:modelValue`,``),i(`clear`),o.value?.focus()}function _(){o.value?.focus()}function v(){o.value?.blur()}function y(){let e=o.value;if(r.type!==`textarea`||!r.autosize||!(e instanceof HTMLTextAreaElement))return;let t=typeof r.autosize==`object`?r.autosize.minRows??r.rows:r.rows,n=getComputedStyle(e),i=parseFloat(n.lineHeight)||20,a=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom),s=parseFloat(n.borderTopWidth)+parseFloat(n.borderBottomWidth),c=t*i+a+s;e.style.overflow=`hidden`,e.style.height=`auto`,e.style.height=`${Math.max(e.scrollHeight,c)}px`}return lh(()=>r.modelValue,()=>{Wm(y)}),Ph(()=>{Wm(y)}),t({focus:_,blur:v,inputEl:o}),(t,n)=>(Y(),X(`div`,{class:Rf([`tk-input`,[e.size?`tk-input--${e.size}`:``,e.type===`textarea`?`tk-textarea`:``,{"is-disabled":e.disabled,"tk-input--group":s.value||c.value}]])},[s.value?(Y(),X(`div`,jy,[Yh(t.$slots,`prepend`)])):$(`v-if`,!0),e.type===`textarea`?(Y(),X(`textarea`,{key:1,ref_key:`inputRef`,ref:o,class:`tk-input__inner tk-textarea__inner`,name:e.name,value:e.modelValue,placeholder:e.placeholder,rows:e.rows,disabled:e.disabled,readonly:e.readonly,maxlength:e.maxlength,onInput:f,onChange:p,onBlur:m,onFocus:h},null,40,My)):(Y(),X(`input`,{key:2,ref_key:`inputRef`,ref:o,class:`tk-input__inner`,type:e.type,name:e.name,value:e.modelValue,placeholder:e.placeholder,disabled:e.disabled,readonly:e.readonly,maxlength:e.maxlength,min:e.min,max:e.max,onInput:f,onChange:p,onBlur:m,onFocus:h},null,40,Ny)),l.value?(Y(),X(`span`,Py,[e.clearable&&!e.disabled&&!e.readonly&&u.value?(Y(),X(`i`,{key:0,class:`tk-input__icon tk-input__clear`,onClick:g},[Q(py,{name:`circle-xmark`})])):$(`v-if`,!0)])):$(`v-if`,!0),e.showWordLimit&&e.maxlength?(Y(),X(`span`,Fy,K(d.value)+`/`+K(e.maxlength),1)):$(`v-if`,!0),c.value?(Y(),X(`div`,Iy,[Yh(t.$slots,`append`)])):$(`v-if`,!0)],2))}}),Ry=new Map,zy=`configUpdated`,By=`initMeta`,Vy=`showAdminEntry`;function Hy(e,t){let n=Ry.get(e)??new Set;n.add(t),Ry.set(e,n)}function Uy(e,t){Ry.get(e)?.delete(t)}function Wy(e,...t){for(let n of Ry.get(e)??[])n(...t)}var Gy={class:`tk-meta-input`},Ky=yh({__name:`TkMetaInput`,props:{nick:{default:``},mail:{default:``},link:{default:``},config:{default:Dy}},emits:[`update`,`validate`],setup(e,{emit:t}){let n=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,r=e,i=t,a=[{key:`nick`,locale:W(`META_INPUT_NICK`),name:`nick`,type:`text`},{key:`mail`,locale:W(`META_INPUT_MAIL`),name:`mail`,type:`email`},{key:`link`,locale:W(`META_INPUT_LINK`),name:`link`,type:`text`}],o=cm({nick:``,mail:``,link:``}),s=av(()=>r.config??{}),c=av(()=>{let e=s.value.DISPLAYED_FIELDS,t=typeof e==`string`?e:void 0;return{nick:!t||t.indexOf(`nick`)!==-1,mail:!t||t.indexOf(`mail`)!==-1,link:!t||t.indexOf(`link`)!==-1}}),l=av(()=>a.filter(e=>!!c.value[e.key])),u=av(()=>{let e=s.value.REQUIRED_FIELDS,t=typeof e==`string`?e:void 0;return{nick:!t||t.indexOf(`nick`)!==-1,mail:!t||t.indexOf(`mail`)!==-1,link:t?t.indexOf(`link`)!==-1:!1}});function d(){let e=n.test(o.mail);return(!!o.nick||!u.value.nick)&&(e||!u.value.mail)&&(!!o.link||!u.value.link)}function f(){localStorage.setItem(`twikoo`,JSON.stringify(o)),i(`update`,{meta:{...o},valid:d()})}function p(e,t){let n=t.target.name;n&&(o[n]=e,i(`validate`,d()))}function m(){let e=localStorage.getItem(`twikoo`),t={};if(e)try{t=JSON.parse(e)}catch{t={}}o.nick=t.nick??r.nick??``,o.mail=t.mail??r.mail??``,o.link=t.link??r.link??``,f()}function h(){if(!Td(o.nick))return;let e=o.nick.replace(/@qq\.com/gi,``);o.mail=`${e}@qq.com`,_(e)}function g(){Td(o.nick)&&(o.nick=``,f())}async function _(e){try{let t=await Lo(null,`GET_QQ_NICK`,{qq:e}),n=t.result??t;n.nick?(o.nick=n.nick,f()):g()}catch(e){console.warn(`获取 QQ 昵称失败:`,e),g()}}function v(){let e=s.value.HIDE_ADMIN_CRYPT;Wy(Vy,!e||e===o.nick)}function y(){h(),f(),v()}function b(){r.nick!==void 0&&o.nick!==r.nick&&(o.nick=r.nick),r.mail!==void 0&&o.mail!==r.mail&&(o.mail=r.mail),r.link!==void 0&&o.link!==r.link&&(o.link=r.link)}return lh(()=>[r.nick,r.mail,r.link],b),lh(u,()=>{i(`validate`,d())}),lh(()=>s.value.VERSION,()=>{v()}),Ph(()=>{Hy(By,m),m()}),Rh(()=>{Uy(By,m)}),(e,t)=>(Y(),X(`div`,Gy,[(Y(!0),X(f_,null,Jh(l.value,e=>(Y(),S_(Ly,{key:e.key,class:`tk-meta-input__item`,name:e.name,type:e.type,"model-value":o[e.key],placeholder:u.value[e.key]?J(W)(`META_INPUT_REQUIRED`):J(W)(`META_INPUT_NOT_REQUIRED`),size:`small`,onInput:p,onChange:y},{prepend:nh(()=>[A_(K(e.locale),1)]),_:2},1032,[`name`,`type`,`model-value`,`placeholder`]))),128))]))}}),qy=[`disabled`,`type`],Jy={class:`tk-button__label`},Yy=yh({__name:`TkButton`,props:{type:{default:`default`},size:{default:``},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},nativeType:{default:`button`}},emits:[`click`],setup(e,{emit:t}){let n=e,r=t;function i(e){n.disabled||n.loading||r(`click`,e)}return(t,n)=>(Y(),X(`button`,{class:Rf([`tk-button`,[e.type==="default"?``:`tk-button--${e.type}`,e.size?`tk-button--${e.size}`:``,{"is-disabled":e.disabled,"is-loading":e.loading}]]),disabled:e.disabled||e.loading,type:e.nativeType,onClick:i},[e.loading?(Y(),S_(py,{key:0,name:`spinner`,class:`tk-button__spinner`})):$(`v-if`,!0),Z(`span`,Jy,[Yh(t.$slots,`default`)])],10,qy))}}),Xy={logo:`OwO表情`,position:`down`,maxHeight:`250px`,odata:{}},Zy=class{container;target;odata;packagesEle;logo;area;packages;preview;constructor(e){for(let[t,n]of Object.entries(Xy))n&&!e[t]&&(e[t]=n);this.container=e.container,this.target=e.target,e.position===`up`&&this.container.classList.add(`OwO-up`),this.odata=e.odata,setTimeout(()=>{this.init(e)})}init(e){this.area=e.target,this.packages=Object.keys(this.odata),this.logo=document.createElement(`div`),this.logo.className=`OwO-logo`,this.logo.appendChild(Tc.sanitize(e.logo??``,{RETURN_DOM_FRAGMENT:!0}));let t=document.createElement(`div`);t.className=`OwO-body`;let n=document.createElement(`div`);n.className=`OwO-bar`,this.packagesEle=document.createElement(`ul`),this.packagesEle.className=`OwO-packages`,n.appendChild(this.packagesEle),t.appendChild(n),this.container.replaceChildren(this.logo,t);let r=document.createElement(`template`);for(let i of this.packages){let a=this.odata[i],o=document.createElement(`ul`);o.className=`OwO-items OwO-items-${a?.type??``}`,o.style.maxHeight=`${parseInt(e.maxHeight??`250`,10)-53}px`;for(let e of a?.container??[]){let t=document.createElement(`li`);t.className=`OwO-item`,t.title=e.text??``,r.innerHTML=Tc.sanitize(e.icon);let n=r.content.querySelector(`img`);if(n){let r=document.createElement(`img`);n.src&&Tc.isValidAttribute(`img`,`src`,n.src)&&(r.src=n.src),r.className=n.className,r.classList.add(`tk-owo-emotion`),r.alt=e.text?`:${e.text}:`:``,r.loading=`lazy`,t.appendChild(r)}else t.textContent=e.icon;o.appendChild(t)}t.insertBefore(o,n);let s=document.createElement(`li`),c=document.createElement(`span`);c.textContent=i,s.appendChild(c),this.packagesEle.appendChild(s)}this.preview=document.createElement(`div`),this.preview.className=`tk-owo-preview-panel`,this.preview.hidden=!0,this.preview.setAttribute(`aria-hidden`,`true`);let i=document.createElement(`img`);i.alt=``,this.preview.appendChild(i),t.appendChild(this.preview),t.addEventListener(`pointerover`,e=>{if(e.pointerType===`touch`||!(e.target instanceof Element))return;let t=e.target.closest(`.OwO-item`)?.querySelector(`img.tk-owo-preview`);t?.getAttribute(`src`)?(i.src=t.src,i.className=t.className,i.classList.add(`tk-owo-emotion`),this.preview.hidden=!1):this.preview.hidden=!0}),t.addEventListener(`pointerout`,e=>{let t=e.target instanceof Element?e.target.closest(`.OwO-item`):null;(!t||!(e.relatedTarget instanceof Node)||!t.contains(e.relatedTarget))&&(this.preview.hidden=!0)}),t.addEventListener(`scroll`,()=>{this.preview.hidden=!0},!0),this.logo.addEventListener(`click`,()=>{this.toggle()}),t.addEventListener(`click`,e=>this.onItemClick(e));for(let e=0;e<this.packagesEle.children.length;e++)this.packagesEle.children[e].addEventListener(`click`,()=>{this.tab(e)});this.tab(0)}onItemClick(e){let t=e.target;if(!t)return;let n=null;if(t.classList.contains(`OwO-item`)?n=t:t.parentNode instanceof HTMLElement&&t.parentNode.classList.contains(`OwO-item`)&&(n=t.parentNode),!n)return;let r=this.area.selectionEnd??this.area.value.length,i=this.area.value,a=n.textContent??``,o=n.querySelector(`img`);if(o){if(n.title)a=`:${n.title}: `;else{let e=o.getAttribute(`src`);a=e?`![](<${e.replace(/</g,`%3C`).replace(/>/g,`%3E`)}>)`:``}}this.area.value=i.slice(0,r)+a+i.slice(r),this.area.dispatchEvent(new Event(`input`,{bubbles:!0})),this.area.focus(),this.toggle()}toggle(){this.preview.hidden=!0,this.container.classList.toggle(`OwO-open`)}tab(e){this.preview.hidden=!0;let t=this.container.getElementsByClassName(`OwO-items-show`)[0];t&&t.classList.remove(`OwO-items-show`),this.container.getElementsByClassName(`OwO-items`)[e]?.classList.add(`OwO-items-show`);let n=this.container.getElementsByClassName(`OwO-package-active`)[0];n&&n.classList.remove(`OwO-package-active`),this.packagesEle.getElementsByTagName(`li`)[e]?.classList.add(`OwO-package-active`)}},Qy={class:`tk-row`},$y={class:`tk-col`},eb={class:`tk-row actions`},tb={class:`tk-row-actions-start`},nb=[`innerHTML`],rb={class:`tk-submit-action-icon __markdown`,alt:`Markdown is supported`,href:`https://guides.github.com/features/mastering-markdown/`,target:`_blank`,rel:`noopener noreferrer`},ib={key:0,ref:`commentPreviewRef`,class:`tk-preview-container`},ab=[`innerHTML`],ob=yh({__name:`TkSubmit`,props:{replyId:{default:``},pid:{default:``},config:{default:Dy}},emits:[`load`,`cancel`,`error`],setup(e,{emit:t}){let n=[`apng`,`bmp`,`gif`,`jpeg`,`jpg`,`png`,`svg`,`tif`,`tiff`,`webp`],r=dy[`laugh-regular`],i=e,a=t,o=q(!1),s=q(!1),c=q(!1),l=q();lh(l,e=>{e&&a(`error`,e)});let u=q(null),d=q(``),f=q(``),p=q(``),m=q(``),h=q(``),g=q(null),_=q(null),v=q(null),y=q(),b=q(),x=q(),S=q(),C=q(),w=q(),T=q(),E=q(),D=q(),ee=av(()=>{let e=i.config;return e.CAPTCHA_PROVIDER===void 0?e.TURNSTILE_SITE_KEY?`Turnstile`:e.GEETEST_CAPTCHA_ID?`Geetest`:e.CAP_API_ENDPOINT||e.CAP_BUILTIN?`Cap`:``:e.CAPTCHA_PROVIDER}),te=av(()=>!!i.config.IMAGE_CDN),O=av(()=>!o.value&&c.value&&!!d.value.trim()),k=av(()=>{let e=Po().options.placeholder??i.config.COMMENT_PLACEHOLDER;return(typeof e==`string`?e:``).replace(/<br>/g,`
243
- `)}),A=av(()=>{let e=parseInt(String(i.config.LIMIT_LENGTH),10);return Number.isNaN(e)&&(e=500),e>0?e:void 0}),ne=av(()=>{let e=b.value?.inputEl;return e instanceof HTMLTextAreaElement?e:null});function re(){localStorage.setItem(`twikoo-draft`,d.value)}function ie(){let e=localStorage.getItem(`twikoo-draft`);!d.value&&e&&(d.value=e)}async function ae(){if(i.config.SHOW_EMOTION!==`true`)return;let e=await dd(String(i.config.EMOTION_CDN||`https://owo.imaegoo.com/owo.json`));fd(e),x.value&&ne.value&&(u.value=new Zy({logo:r,container:x.value,target:ne.value,odata:e,position:`down`,maxHeight:`250px`}))}function oe(){u.value?.container.classList.contains(`OwO-open`)&&u.value.toggle()}function se(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.onload=()=>t(),r.onerror=()=>n(Error(`脚本加载失败:${e}`)),document.head.appendChild(r)})}function ce(e,t){return{ok:e,json:()=>Promise.resolve(t)}}function le(){ee.value===`Turnstile`&&i.config.TURNSTILE_SITE_KEY&&(window.turnstile?g.value=Promise.resolve():g.value||=se(`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`))}function ue(){return new Promise((e,t)=>{g.value?.then(()=>{let n=window.turnstile,r=n.render(w.value,{sitekey:i.config.TURNSTILE_SITE_KEY,callback:t=>{e(t),setTimeout(()=>n.remove(r),1e3)},"error-callback":()=>t(Error(`验证码校验失败,请重试`)),"expired-callback":()=>t(Error(`验证码已过期,请重试`)),"timeout-callback":()=>t(Error(`验证码超时,请重试`))})})})}function de(){ee.value===`Geetest`&&i.config.GEETEST_CAPTCHA_ID&&(window.initGeetest4?_.value=Promise.resolve():_.value||=se(`https://static.geetest.com/v4/gt4.js`))}function fe(){return new Promise((e,t)=>{_.value?.then(()=>{let n=window.initGeetest4;n({captchaId:i.config.GEETEST_CAPTCHA_ID,product:`bind`,language:`zho`},n=>{n.onReady(()=>n.showCaptcha()).onSuccess(()=>{let t=n.getValidate();e({geeTestLotNumber:t.lot_number,geeTestCaptchaOutput:t.captcha_output,geeTestPassToken:t.pass_token,geeTestGenTime:t.gen_time})}).onError(e=>t(e instanceof Error?e:Error(`Geetest 验证失败,请重试`))).onClose(()=>t(Error(`验证已取消`)))})})})}function pe(){if(ee.value!==`Cap`||!i.config.CAP_API_ENDPOINT&&!i.config.CAP_BUILTIN)return;let e=window;i.config.CAP_BUILTIN&&(e.CAP_CUSTOM_FETCH=async(e,t={})=>{let n=String(e),r=t.body?JSON.parse(t.body):{};try{if(n.includes(`challenge`)){let e=await Lo(Po().tcb,`CAP_CHALLENGE`),t=e.result??e;return t.code&&t.code!==0?ce(!1,{error:t.message??`challenge_failed`}):ce(!0,{challenge:t.challenge,token:t.token,expires:t.expires})}if(n.includes(`redeem`)){let e=await Lo(Po().tcb,`CAP_REDEEM`,r),t=e.result??e;return t.code&&t.code!==0&&t.success!==!0?ce(!0,{success:!1,error:t.message??t.error??`redeem_failed`}):ce(!0,{success:t.success,token:t.token,expires:t.expires,message:t.message,error:t.error??t.message})}return ce(!1,{error:`unknown_cap_path`})}catch(e){return ce(!1,{error:e instanceof Error?e.message:`cap_fetch_failed`})}}),e.Cap||customElements.get(`cap-widget`)?v.value=Promise.resolve():v.value||=se(`https://cdn.jsdmirror.com/npm/@cap.js/widget`)}function me(){return new Promise((e,t)=>{v.value?.then(()=>{let n=document.createElement(`cap-widget`);n.setAttribute(`id`,`cap-widget`);let r=i.config.CAP_BUILTIN?`/`:String(i.config.CAP_API_ENDPOINT);n.setAttribute(`data-cap-api-endpoint`,r),D.value?.appendChild(n);let a=()=>{n.parentNode?.removeChild(n)};n.solve().then(n=>{a(),n.success?e(typeof n.token==`string`?n.token:``):t(Error(`Cap 验证失败`))}).catch(e=>{a(),t(e instanceof Error?e:Error(`Cap 验证失败`))})}).catch(t)})}function he(e){p.value=e.meta.nick,m.value=e.meta.mail,h.value=e.meta.link,c.value=e.valid}function ge(){a(`cancel`)}function _e(){re(),j()}function ve(){s.value=!s.value,j()}function j(){s.value&&(f.value=Ec(ad(d.value)),Wm(()=>{let e=C.value;e&&(Vd(e),Ud(e,Po().options.katex),i.config.HIGHLIGHT===`true`&&Vc(e,i.config.HIGHLIGHT_THEME,i.config.HIGHLIGHT_PLUGIN))}))}async function ye(){o.value=!0,l.value=void 0;try{if(d.value.match(RegExp(`!\\[${W(`IMAGE_UPLOAD_PLACEHOLDER`)}.+\\]\\(\\)`)))throw Error(W(`IMAGE_UPLOAD_PLEASE_WAIT`));let e=Po().options.title,t={nick:p.value,mail:m.value,link:h.value,ua:await Bd(),url:Ad(Po().options.path),href:jd(Po().options.href),title:typeof e==`string`?e:document.title,comment:ad(d.value),pid:i.pid?i.pid:i.replyId,rid:i.replyId};ee.value===`Turnstile`&&i.config.TURNSTILE_SITE_KEY&&(t.turnstileToken=await ue()),ee.value===`Geetest`&&i.config.GEETEST_CAPTCHA_ID&&Object.assign(t,await fe()),ee.value===`Cap`&&(i.config.CAP_API_ENDPOINT||i.config.CAP_BUILTIN)&&(t.capToken=await me());let n=Po().options.onSubmit;typeof n==`function`&&await n(t);let r=await Lo(Po().tcb,`COMMENT_SUBMIT`,t),o=r.result??r;if(o.id)d.value=``,s.value=!1,f.value=``,l.value=void 0,a(`load`),re();else throw new Oo(o.code===void 0?`UNKNOWN`:`REJECTED`,o.message??W(`COMMENT_FAILED`),{rawMessage:o.message??``})}catch(e){zo.error(`评论失败`,e),l.value=e instanceof Oo?e:new Oo(`UNKNOWN`,`${W(`COMMENT_FAILED`)}: ${jo(e)}`,{rawMessage:jo(e)})}finally{o.value=!1}}function be(e){(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&ye()}function xe(){S.value?.click()}function Se(){let e=S.value?.files?.[0];we(e)}function Ce(e){e.clipboardData&&we(e.clipboardData.files[0]??e.clipboardData.items[0]?.getAsFile()??void 0)}async function we(e){if(!e||!te.value)return;let t=e.name.split(`.`),r=t.length>1?String(t.pop()):``;if(n.indexOf(r.toLowerCase())===-1)return;let{tcb:a}=Po(),o=a?.auth?.currentUser?.uid??localStorage.getItem(`twikoo-access-token`)??``,s=`${Date.now()}-${o}`,c=t.join(`.`),l=e.type===`image/gif`,u=l?c:`${c}.webp`,d=l?r:`webp`;De(Oe(s,d));let f=String(i.config.IMAGE_CDN??``),p=await Te(e);a&&(!f||f===`qcloud`)?M(s,u,d,p):f?Ee(s,u,d,p):P(s,d,W(`IMAGE_UPLOAD_FAILED_NO_CONF`))}async function Te(e){return e.type===`image/gif`?e:new Promise(t=>{let n=new FileReader;n.onload=n=>{let r=new Image;r.onload=()=>{let n=document.createElement(`canvas`),i=r.width,a=r.height,o=1920;(i>o||a>o)&&(i>a?(a=a*o/i,i=o):(i=i*o/a,a=o)),n.width=i,n.height=a,n.getContext(`2d`)?.drawImage(r,0,0,i,a);let s=`image/webp`,c=e.name.replace(/\.[^.]+$/,`.webp`);n.toBlob(e=>t(new File([e??new Blob],c,{type:s})),s,.85)};let i=n.target?.result;r.src=typeof i==`string`?i:``},n.readAsDataURL(e)})}async function M(e,t,n,r){try{let i=Po().tcb?.app,a=await i.uploadFile({cloudPath:`tk-img/${e}.${n}`,filePath:r});if(!a.fileID)return;N(e,t,n,(await i.getTempFileURL({fileList:[a.fileID]})).fileList[0].tempFileURL)}catch(t){console.error(t),P(e,n,jo(t))}}async function Ee(e,t,n,r){try{let i=await Lo(Po().tcb,`UPLOAD_IMAGE`,{fileName:t,photo:await zd(r)}),a=i.result??i;a.data?N(e,t,n,String(a.data.url)):a.code===1041?P(e,n,W(`IMAGE_UPLOAD_NSFW`)):(console.error(a),P(e,n,a.message??a.err??W(`IMAGE_UPLOAD_FAILED`)))}catch(t){console.error(t),P(e,n,jo(t))}}function N(e,t,n,r){let i=t.replace(/[[\]]/g,`_`);d.value=d.value.replace(Oe(e,n),`![${i}](${r})`),S.value&&(S.value.value=``)}function P(e,t,n){d.value=d.value.replace(Oe(e,t),`_${W(`IMAGE_UPLOAD_FAILED`)}: ${n}_`),S.value&&(S.value.value=``)}function De(e){let t=ne.value,n=t?.selectionStart??d.value.length,r=t?.selectionEnd??d.value.length;d.value=d.value.substring(0,n)+e+d.value.substring(r),Wm(()=>{if(!t)return;let r=n+e.length;t.selectionStart=r,t.selectionEnd=r})}function Oe(e,t){return`![${W(`IMAGE_UPLOAD_PLACEHOLDER`)} ${e}.${t}]()`}function ke(){i.config.COMMENT_BG_IMG&&ne.value&&(ne.value.style[`background-image`]=`url("${String(i.config.COMMENT_BG_IMG)}")`)}function Ae(){le(),de(),pe()}return lh(()=>i.config.SHOW_EMOTION,()=>{ae()}),lh(()=>i.config.COMMENT_BG_IMG,()=>{ke()}),lh(()=>i.config.TURNSTILE_SITE_KEY,()=>{le()}),lh(()=>i.config.GEETEST_CAPTCHA_ID,()=>{de()}),lh(()=>i.config.CAP_API_ENDPOINT,()=>{pe()}),lh(ee,()=>{Ae()}),Ph(()=>{i.pid&&y.value?.scrollIntoView({behavior:`instant`,block:`center`}),ie(),ne.value?.addEventListener(`paste`,Ce),ke(),Ae(),ae()}),Rh(()=>{ne.value?.removeEventListener(`paste`,Ce)}),(t,n)=>(Y(),X(`div`,{ref_key:`tkSubmitRef`,ref:y,class:`tk-submit tk-fade-in`},[Z(`div`,Qy,[Q(Ay,{config:e.config,mail:m.value,nick:p.value},null,8,[`config`,`mail`,`nick`]),Z(`div`,$y,[Q(Ky,{nick:p.value,mail:m.value,link:h.value,config:e.config,onUpdate:he,onValidate:n[0]||=e=>c.value=e},null,8,[`nick`,`mail`,`link`,`config`]),Q(Ly,{ref_key:`textareaRef`,ref:b,modelValue:d.value,"onUpdate:modelValue":n[1]||=e=>d.value=e,class:`tk-input`,type:`textarea`,placeholder:k.value,autosize:{minRows:3},maxlength:A.value,"show-word-limit":``,onInput:_e,onKeyup:be},null,8,[`modelValue`,`placeholder`,`maxlength`])])]),Z(`div`,eb,[Z(`div`,tb,[$(` 表情按钮:首屏先渲染图标,随后由 OwO 面板以同样的 logo 接管容器内容 `),$(` 图标为构建期内联的 fontawesome 官方 SVG,非运行时用户数据 `),$(` eslint-disable vue/no-v-html `),rh(Z(`div`,{ref_key:`owoRef`,ref:x,class:`tk-submit-action-icon OwO`,innerHTML:J(r)},null,8,nb),[[yv,e.config.SHOW_EMOTION===`true`],[J(xd),oe]]),$(` eslint-enable vue/no-v-html `),rh(Z(`div`,{class:`tk-submit-action-icon`,onClick:xe},[Q(py,{name:`image-regular`})],512),[[yv,te.value]]),Z(`input`,{ref_key:`inputFileRef`,ref:S,class:`tk-input-image`,type:`file`,accept:`image/*`,value:``,onChange:Se},null,544)]),Z(`a`,rb,[Q(py,{name:`markdown`})]),e.replyId?(Y(),S_(Yy,{key:0,class:`tk-cancel`,size:`small`,onClick:ge},{default:nh(()=>[A_(K(J(W)(`SUBMIT_CANCEL`)),1)]),_:1})):$(`v-if`,!0),Q(Yy,{class:`tk-preview`,size:`small`,onClick:ve},{default:nh(()=>[A_(K(J(W)(`SUBMIT_PREVIEW`)),1)]),_:1}),Q(Yy,{class:`tk-send`,type:`primary`,size:`small`,disabled:!O.value,onClick:ye},{default:nh(()=>[A_(K(o.value?J(W)(`SUBMIT_SENDING`):J(W)(`SUBMIT_SEND`)),1)]),_:1},8,[`disabled`]),rh(Z(`div`,{ref_key:`turnstileContainerRef`,ref:T,class:`tk-turnstile-container`},[Z(`div`,{ref_key:`turnstileRef`,ref:w,class:`tk-turnstile`},null,512)],512),[[yv,ee.value===`Turnstile`]]),rh(Z(`div`,{ref_key:`geetestContainerRef`,ref:E,class:`tk-geetest-container`},null,512),[[yv,ee.value===`Geetest`]]),rh(Z(`div`,{ref_key:`capContainerRef`,ref:D,class:`tk-cap-container`},null,512),[[yv,ee.value===`Cap`]])]),s.value?(Y(),X(`div`,ib,[$(` 预览内容经 sanitizeHtml 消毒 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`div`,{innerHTML:f.value},null,8,ab)],512)):$(`v-if`,!0)],512))}}),sb=cm({serverConfig:{}});function cb(e){sb.serverConfig=e}function lb(){return sb.serverConfig}var ub=[`id`],db={class:`tk-main`},fb={class:`tk-row`},pb={class:`tk-meta`},mb={key:0,class:`tk-nick`},hb=[`href`],gb={key:2,class:`tk-tag tk-tag-green`},_b={key:3,class:`tk-tag tk-tag-red`},vb={key:4,class:`tk-tag tk-tag-yellow`},yb={class:`tk-time`},bb=[`datetime`,`title`],xb={key:5,class:`tk-actions`},Sb={key:0},Cb=[`innerHTML`],wb={key:0,class:`tk-expand-wrap`},Tb={key:1,class:`tk-collapse-wrap`},Eb={key:2,class:`tk-extras`},Db={key:0,class:`tk-extra`},Ob={class:`tk-icon __comment`},kb={class:`tk-extra-text`},Ab={key:1,class:`tk-extra`},jb={class:`tk-icon __comment`},Mb={class:`tk-extra-text`},Nb={key:2,class:`tk-extra`},Pb={class:`tk-icon __comment`},Fb={class:`tk-extra-text`},Ib={key:4,class:`tk-expand-wrap`},Lb={key:5,class:`tk-collapse-wrap`},Rb=yh({__name:`TkComment`,props:{comment:{},replyId:{default:``},replying:{type:Boolean,default:!1},config:{default:Dy}},emits:[`reply`,`load`,`expand`,`refreshed`,`error`],setup(e,{emit:t}){let n=e,r=t,i={win:`windows`,mac:`apple`,ipad:`apple`,iphone:`apple`,ios:`apple`,android:`android`,ubuntu:`ubuntu`,linux:`linux`},a={edge:`edge`,chrome:`chrome`,firefox:`firefox-browser`,safari:`safari`,explorer:`internet-explorer`,ie:`internet-explorer`},o=q(``),s=q(n.comment.ups??0),c=q(n.comment.downs??0),l=q(n.comment.liked===!0),u=q(n.comment.disliked===!0),d=q(!1),f=q(!1),p=q(!1),m=q(!1),h=q(!1),g=q(!1),_=av(()=>{let{tcb:e}=Po();return e?.auth?g.value:lb().IS_ADMIN===!0}),v=q(n.comment.isSpam===!0),y=q(n.comment.top===!0),b=q(!1),x=q(),S=q(),C=q(),w=q(),T=av(()=>Ec(n.comment.comment)),E=av(()=>Dd(n.comment.created)),D=av(()=>new Date(n.comment.created??0).toJSON()),ee=av(()=>new Date(n.comment.created??0).toLocaleString()),te=av(()=>ae(n.comment.os??``,i)),O=av(()=>ae(n.comment.browser??``,a)),k=av(()=>p.value&&!f.value),A=av(()=>p.value&&f.value),ne=av(()=>h.value&&!m.value),re=av(()=>h.value&&m.value),ie=av(()=>Ed(n.comment.link));function ae(e,t){let n=e.toLowerCase();for(let e of Object.keys(t))if(n.indexOf(e)!==-1)return t[e];return`window-maximize-regular`}function oe(){let e=w.value;n.comment.replies.length>0&&e&&(p.value=e.scrollHeight>236)}function se(){let e=S.value;e&&(h.value=h.value||e.scrollHeight>500)}function ce(){S.value?.querySelectorAll(`img`).forEach(e=>{e.onload=se})}function le(){window.location.hash.indexOf(n.comment.id)!==-1&&(x.value?.scrollIntoView({behavior:`smooth`}),r(`expand`))}function ue(e){document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`center`})}async function de(){if(!d.value){d.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_LIKE`,{id:n.comment.id,type:`up`})),l.value?s.value--:(s.value++,u.value&&c.value--),l.value=!l.value,u.value=!1}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{d.value=!1}}}async function fe(){if(!d.value){d.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_LIKE`,{id:n.comment.id,type:`down`})),u.value?c.value--:(c.value++,l.value&&s.value--),u.value=!u.value,l.value=!1}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{d.value=!1}}}function pe(e){o.value=e,r(`reply`,n.comment.id)}async function me(e){if(!b.value&&confirm(W(e?`ADMIN_COMMENT_DELETE_CONFIRM`:`COMMENT_DELETE_CONFIRM`))){b.value=!0;try{Ao(await Lo(Po().tcb,e?`COMMENT_DELETE_FOR_ADMIN`:`COMMENT_DELETE_FOR_USER`,{id:n.comment.id})),r(`load`)}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{b.value=!1}}}function he(e){o.value=e,r(`reply`,e?n.comment.id:``)}function ge(){o.value=``,r(`reply`,``)}function _e(){o.value=``,r(`reply`,``),r(`load`),f.value=!0}function ve(){r(`refreshed`),Wm(()=>{let e=w.value?.lastElementChild;n.comment.replies.length>0&&e&&e.scrollIntoView({behavior:`smooth`,block:`center`})})}async function j(){try{let{tcb:e}=Po();if(e?.auth){let t=await e.auth.getCurrentUser();g.value=t.loginType===`CUSTOM`}}catch(e){g.value=!1,alert(jo(e))}}function ye(e){Se({isSpam:e})}function be(e){Se({top:e})}function xe(e){lb().LIGHTBOX===`true`&&Hd(e)}async function Se(e){if(!b.value){b.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_SET_FOR_ADMIN`,{id:n.comment.id,set:e})),e.isSpam!==void 0&&(v.value=e.isSpam),e.top!==void 0&&(y.value=e.top)}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{b.value=!1}}}function Ce(){let e=C.value;e&&(Vd(e),Ud(e,Po().options.katex),n.config.HIGHLIGHT===`true`&&Vc(e,n.config.HIGHLIGHT_THEME,n.config.HIGHLIGHT_PLUGIN))}return lh(()=>[n.comment,n.comment.isSpam],()=>{v.value=n.comment.isSpam===!0}),lh(()=>[n.comment,n.comment.top],()=>{y.value=n.comment.top===!0}),lh(()=>[n.comment,n.comment.ups,n.comment.liked],()=>{s.value=n.comment.ups??0,l.value=n.comment.liked===!0}),lh(()=>[n.comment,n.comment.downs,n.comment.disliked],()=>{c.value=n.comment.downs??0,u.value=n.comment.disliked===!0}),lh(()=>n.config.HIGHLIGHT,e=>{e===`true`&&Wm(Ce)},{immediate:!0}),Ph(()=>{Wm(se),Wm(ce),Wm(oe),Wm(le),Wm(Ce),j()}),(t,n)=>{let i=Wh(`TkComment`,!0);return Y(),X(`div`,{id:e.comment.id,ref_key:`tkCommentRef`,ref:x,class:Rf([`tk-comment`,{"tk-master":e.comment.master}])},[Q(Ay,{config:e.config,nick:e.comment.nick,avatar:e.comment.avatar,"mail-md5":e.comment.mailMd5,link:ie.value},null,8,[`config`,`nick`,`avatar`,`mail-md5`,`link`]),Z(`div`,db,[Z(`div`,fb,[Z(`div`,pb,[ie.value?$(`v-if`,!0):(Y(),X(`strong`,mb,K(e.comment.nick),1)),ie.value?(Y(),X(`a`,{key:1,class:`tk-nick tk-nick-link`,href:ie.value,target:`_blank`,rel:`noopener noreferrer nofollow ugc`},[Z(`strong`,null,K(e.comment.nick),1)],8,hb)):$(`v-if`,!0),e.comment.master?(Y(),X(`span`,gb,K(e.config.MASTER_TAG||J(W)(`COMMENT_MASTER_TAG`)),1)):$(`v-if`,!0),y.value?(Y(),X(`span`,_b,K(J(W)(`COMMENT_TOP_TAG`)),1)):$(`v-if`,!0),v.value?(Y(),X(`span`,vb,K(J(W)(`COMMENT_REVIEWING_TAG`)),1)):$(`v-if`,!0),Z(`small`,yb,[Z(`time`,{datetime:D.value,title:ee.value},K(E.value),9,bb)]),_.value?(Y(),X(`small`,xb,[v.value?(Y(),X(`button`,{key:0,onClick:n[0]||=e=>ye(!1)},K(J(W)(`ADMIN_COMMENT_SHOW`)),1)):$(`v-if`,!0),v.value?$(`v-if`,!0):(Y(),X(`button`,{key:1,onClick:n[1]||=e=>ye(!0)},K(J(W)(`ADMIN_COMMENT_HIDE`)),1)),!e.comment.rid&&y.value?(Y(),X(`button`,{key:2,onClick:n[2]||=e=>be(!1)},K(J(W)(`ADMIN_COMMENT_UNTOP`)),1)):$(`v-if`,!0),!e.comment.rid&&!y.value?(Y(),X(`button`,{key:3,onClick:n[3]||=e=>be(!0)},K(J(W)(`ADMIN_COMMENT_TOP`)),1)):$(`v-if`,!0),Z(`button`,{onClick:n[4]||=e=>me(!0)},K(J(W)(`ADMIN_COMMENT_DELETE`)),1)])):$(`v-if`,!0)]),Q(Ey,{liked:l.value,disliked:u.value,"like-count":s.value,"dislike-count":c.value,"replies-count":e.comment.replies.length,"show-dislike":e.config.SHOW_DISLIKE!==`false`,"show-delete":e.comment.isOwner===!0,onLike:de,onDislike:fe,onReply:pe,onDelete:n[5]||=e=>me(!1)},null,8,[`liked`,`disliked`,`like-count`,`dislike-count`,`replies-count`,`show-dislike`,`show-delete`])]),Z(`div`,{ref_key:`tkContentRef`,ref:S,class:Rf([`tk-content`,{"tk-content-expand":m.value}])},[e.comment.pid?(Y(),X(`span`,Sb,[A_(K(J(W)(`COMMENT_REPLIED`))+` `,1),Z(`a`,{class:`tk-ruser`,href:`#`,onClick:n[6]||=ny(t=>ue(e.comment.pid),[`prevent`])},K(`@${e.comment.ruser}`),1),n[14]||=A_(` : `,-1)])):$(`v-if`,!0),$(` 正文:服务端已 DOMPurify 消毒,客户端再走一次 sanitizeHtml 双保险 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`span`,{ref_key:`commentRef`,ref:C,onClick:xe,innerHTML:T.value},null,8,Cb)],2),ne.value?(Y(),X(`div`,wb,[Z(`div`,{class:`tk-expand`,onClick:n[7]||=e=>m.value=!0},K(J(W)(`COMMENT_EXPAND`)),1)])):$(`v-if`,!0),re.value?(Y(),X(`div`,Tb,[Z(`div`,{class:`tk-expand _collapse`,onClick:n[8]||=e=>m.value=!1},K(J(W)(`COMMENT_COLLAPSE`)),1)])):$(`v-if`,!0),e.comment.ipRegion||e.comment.os||e.comment.browser?(Y(),X(`div`,Eb,[e.comment.ipRegion?(Y(),X(`div`,Db,[Z(`span`,Ob,[Q(py,{name:`location-arrow`})]),Z(`span`,kb,`\xA0`+K(e.comment.ipRegion),1)])):$(`v-if`,!0),e.comment.os?(Y(),X(`div`,Ab,[Z(`span`,jb,[Q(py,{name:te.value},null,8,[`name`])]),Z(`span`,Mb,`\xA0`+K(e.comment.os),1)])):$(`v-if`,!0),e.comment.browser?(Y(),X(`div`,Nb,[Z(`span`,Pb,[Q(py,{name:O.value},null,8,[`name`])]),Z(`span`,Fb,`\xA0`+K(e.comment.browser),1)])):$(`v-if`,!0)])):$(`v-if`,!0),$(` 回复框(主楼被回复时挂载;楼中楼由子评论自身挂载) `),e.replying&&!o.value?(Y(),S_(ob,{key:3,"reply-id":e.replyId?e.replyId:e.comment.id,pid:e.comment.id,config:e.config,onLoad:_e,onCancel:ge,onError:n[9]||=e=>r(`error`,e)},null,8,[`reply-id`,`pid`,`config`])):$(`v-if`,!0),$(` 回复列表 `),Z(`div`,{ref_key:`tkRepliesRef`,ref:w,class:Rf([`tk-replies`,{"tk-replies-expand":f.value||!k.value||e.replying}])},[(Y(!0),X(f_,null,Jh(e.comment.replies,t=>(Y(),S_(i,{key:t.id,comment:t,"reply-id":e.comment.id,replying:e.replying&&o.value===t.id,config:e.config,onExpand:n[10]||=e=>f.value=!0,onLoad:_e,onReply:he,onRefreshed:ve,onError:n[11]||=e=>r(`error`,e)},null,8,[`comment`,`reply-id`,`replying`,`config`]))),128))],2),k.value&&!e.replying?(Y(),X(`div`,Ib,[Z(`div`,{class:`tk-expand`,onClick:n[12]||=e=>f.value=!0},K(J(W)(`COMMENT_EXPAND`)),1)])):$(`v-if`,!0),A.value&&!e.replying?(Y(),X(`div`,Lb,[Z(`div`,{class:`tk-expand _collapse`,onClick:n[13]||=e=>f.value=!1},K(J(W)(`COMMENT_COLLAPSE`)),1)])):$(`v-if`,!0)])],10,ub)}}}),zb={class:`tk-error`},Bb={class:`tk-error__icon`},Vb={class:`tk-error__body`},Hb={class:`tk-error__title`},Ub={class:`tk-error__message`},Wb={class:`tk-error__detail`},Gb={key:0,class:`tk-error__row`},Kb={key:1,class:`tk-error__row`},qb={key:2,class:`tk-error__raw`},Jb=yh({__name:`TkError`,props:{error:{}},setup(e){let t=e,n=q(!1),r={NETWORK:`无法连接到后端`,CORS:`请求被跨域策略拦截`,TIMEOUT:`请求超时`,REJECTED:`请求过于频繁`,NOT_FOUND:`接口地址不存在`,CLIENT_ERROR:`请求失败`,SERVER_ERROR:`后端异常`,UNKNOWN:`出现未知错误`},i=av(()=>r[t.error.kind]??`出现错误`),a=av(()=>{let e=t.error.rawMessage||t.error.message;return e.length>120?`${e.slice(0,120)}...`:e}),o=av(()=>t.error.rawMessage||``),s=av(()=>t.error.httpStatus),c=av(()=>t.error.requestId);return(e,t)=>(Y(),X(`div`,zb,[Z(`div`,Bb,[Q(py,{name:`circle-exclamation`})]),Z(`div`,Vb,[Z(`div`,Hb,K(i.value),1),Z(`div`,Ub,K(a.value),1),Z(`button`,{class:`tk-error__toggle`,type:`button`,onClick:t[0]||=e=>n.value=!n.value},K(n.value?`收起详情`:`展开详情`),1),rh(Z(`div`,Wb,[s.value?(Y(),X(`div`,Gb,`HTTP: `+K(s.value),1)):$(`v-if`,!0),c.value?(Y(),X(`div`,Kb,`Request ID: `+K(c.value),1)):$(`v-if`,!0),o.value?(Y(),X(`pre`,qb,K(o.value),1)):$(`v-if`,!0)],512),[[yv,n.value]])])]))}}),Yb={class:`tk-comments`},Xb={class:`tk-comments-container`},Zb={class:`tk-comments-title`},Qb={key:0},$b={class:`tk-comments-actions`},ex={key:0,class:`tk-comments-sort`},tx={class:`tk-comments-search`},nx={key:1,class:`tk-comments-no`},rx={key:0},ix={key:1},ax={key:2,class:`tk-expand-wrap`},ox=yh({__name:`TkComments`,props:{showAdminEntry:{type:Boolean,default:!1}},emits:[`admin`,`refreshed`],setup(e,{emit:t}){let n=t,r=q(!0),i=q(!1),a=q(null),o=q({}),s=q([]),c=q(!0),l=q(0),u=q(``),d=q(1),f=q(`newest`),p=q(``),m=q(``),h=q(!1),g=q(0),_=q();async function v(){try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG`));e.config&&(o.value=e.config,cb(e.config))}catch(e){zo.warn(`加载公开配置失败`,e)}}async function y(){let e=++g.value;r.value=!0,a.value=null;let t={url:Ad(Po().options.path),sort:f.value,keyword:m.value};m.value&&(t.page=1),await k(t),e===g.value&&(r.value=!1)}function b(){s.value=[],d.value=1}function x(){let e=p.value.trim();p.value=e,m.value!==e&&(m.value=e,b(),y())}function S(){m.value&&(m.value=``,b(),y())}function C(){h.value=!h.value,h.value?setTimeout(()=>_.value?.focus(),0):(p.value=``,S())}function w(){b(),y()}async function T(){let e=++g.value;r.value=!0,a.value=null;try{let e=Ad(Po().options.path),t=d.value,n={url:e,sort:f.value,keyword:m.value};if(m.value&&(n.page=1),!await k(n))return;for(let n=2;n<=t&&await te(e,n);n++);}finally{e===g.value&&(r.value=!1)}e===g.value&&n(`refreshed`)}function E(e){f.value!==e&&(f.value=e,b(),y())}async function D(){if(!i.value){i.value=!0,d.value++;try{await te(Ad(Po().options.path),d.value)}finally{i.value=!1}}}function ee(){let e=1/0;for(let t of s.value)!t.top&&(t.created??1/0)<e&&(e=t.created??1/0);return e===1/0?void 0:e}async function te(e,t=d.value){if(m.value)return k({url:e,page:t,sort:f.value,keyword:m.value});let n=ee();return n!==void 0&&k({url:e,before:n,sort:f.value,keyword:m.value})}function O(){let e=Po().options.onCommentLoaded;typeof e==`function`&&e()}async function k(e){let t=g.value;try{let n=await Lo(Po().tcb,`COMMENT_GET`,e);if(t!==g.value)return!1;let r=Ao(n);if(r?.message)return a.value=new Oo(`CLIENT_ERROR`,r.message,{rawMessage:r.message}),!1;if(r?.data)return s.value=e.before||typeof e.page==`number`&&e.page>1?s.value.concat(r.data):r.data,c.value=r.more===!0,l.value=r.count??s.value.length,setTimeout(O,0),!0}catch(e){t===g.value&&(a.value=e instanceof Oo?e:new Oo(`UNKNOWN`,jo(e),{rawMessage:jo(e)}))}return!1}function A(e){a.value=e}function ne(e){u.value=e}function re(){n(`admin`)}function ie(){v()}function ae(){T()}return Ph(()=>{v(),y(),Hy(zy,ie),Hy(zy,ae)}),Rh(()=>{Uy(zy,ie),Uy(zy,ae)}),(t,n)=>(Y(),X(`div`,Yb,[Q(ob,{config:o.value,onLoad:y,onError:A},null,8,[`config`]),rh((Y(),X(`div`,Xb,[Z(`div`,Zb,[Z(`span`,{class:Rf([`tk-comments-count`,{__hidden:r.value||!s.value.length&&!m.value}])},[m.value?(Y(),X(`span`,Qb,K(J(W)(`COMMENTS_SEARCH_COUNT_PREFIX`)),1)):$(`v-if`,!0),Z(`span`,null,K(l.value),1),Z(`span`,null,K(J(W)(`COMMENTS_COUNT_SUFFIX`)),1)],2),Z(`span`,$b,[!r.value&&s.value.length&&o.value.SHOW_ORDER!==`false`?(Y(),X(`span`,ex,[Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`newest`}]),type:`button`,onClick:n[0]||=e=>E(`newest`)},K(J(W)(`COMMENTS_SORT_NEWEST`)),3),Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`oldest`}]),type:`button`,onClick:n[1]||=e=>E(`oldest`)},K(J(W)(`COMMENTS_SORT_OLDEST`)),3),Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`popular`}]),type:`button`,onClick:n[2]||=e=>E(`popular`)},K(J(W)(`COMMENTS_SORT_POPULAR`)),3)])):$(`v-if`,!0),!r.value&&!i.value?(Y(),X(`span`,{key:1,class:Rf([`tk-icon __comments`,{__active:h.value}]),onClick:C},[Q(py,{name:`magnifying-glass`})],2)):$(`v-if`,!0),!r.value&&!i.value?(Y(),X(`span`,{key:2,class:`tk-icon __comments`,onClick:w},[Q(py,{name:`sync`})])):$(`v-if`,!0),e.showAdminEntry?(Y(),X(`span`,{key:3,class:`tk-icon __comments`,onClick:re},[Q(py,{name:`cog`})])):$(`v-if`,!0)])]),rh(Z(`div`,tx,[Q(Ly,{ref_key:`searchInputRef`,ref:_,modelValue:p.value,"onUpdate:modelValue":n[3]||=e=>p.value=e,size:`small`,clearable:``,maxlength:100,placeholder:J(W)(`COMMENTS_SEARCH_PLACEHOLDER`),onClear:S,onKeyup:iy(x,[`enter`])},null,8,[`modelValue`,`placeholder`]),Q(Yy,{size:`small`,type:`primary`,onClick:x},{default:nh(()=>[A_(K(J(W)(`COMMENTS_SEARCH`)),1)]),_:1})],512),[[yv,h.value]]),$(` 评论区唯一错误卡片:列表/提交/回复失败共用,位于空态块上方 `),a.value?(Y(),S_(Jb,{key:0,error:a.value},null,8,[`error`])):$(`v-if`,!0),!s.value.length&&!r.value&&!a.value?(Y(),X(`div`,nx,[m.value?(Y(),X(`span`,rx,K(J(W)(`COMMENTS_SEARCH_NO_RESULT`)),1)):$(`v-if`,!0),m.value?$(`v-if`,!0):(Y(),X(`span`,ix,K(J(W)(`COMMENTS_NO_COMMENTS`)),1))])):$(`v-if`,!0),(Y(!0),X(f_,null,Jh(s.value,e=>(Y(),S_(Rb,{key:e.id,comment:e,replying:u.value===e.id,config:o.value,onReply:ne,onLoad:T,onError:A},null,8,[`comment`,`replying`,`config`]))),128)),c.value&&!r.value&&!a.value?(Y(),X(`div`,ax,[rh((Y(),X(`div`,{class:`tk-expand`,onClick:D},[A_(K(J(W)(`COMMENTS_EXPAND`)),1)])),[[J(vd),i.value]])])):$(`v-if`,!0)])),[[J(vd),r.value]])]))}}),sx={class:`tk-footer`},cx=yh({__name:`TkFooter`,setup(e){let t=wo;return(e,n)=>(Y(),X(`div`,sx,[n[0]||=A_(` Powered by `,-1),n[1]||=Z(`a`,{href:`https://twikoo.js.org`,target:`_blank`,rel:`noopener noreferrer`},`Twikoo`,-1),A_(` v`+K(J(t)),1)]))}}),lx={class:`tk-pagination`},ux={key:0,class:`tk-pagination-options`},dx={class:`tk-pagination-pagers`},fx=[`onClick`],px={key:1,class:`tk-pagination-options`},mx=yh({__name:`TkPagination`,props:{pageSize:{default:10},total:{default:0}},emits:[`current-change`,`page-size-change`],setup(e,{emit:t}){let n=e,r=t,i=q(1),a=q(0),o=q(0),s=q([]),c=av(()=>Math.ceil(n.total/n.pageSize));function l(){let e=[];for(let t=1;t<=c.value;t++)Math.abs(i.value-t)<3||t===1||t===c.value?e.push({title:`${t}`,page:t}):Math.abs(i.value-t)<4&&e.push({title:`...`,page:t});s.value=e}function u(e){i.value=parseInt(String(e),10)||1,i.value>c.value&&(i.value=c.value),i.value<1&&(i.value=1),a.value=0,r(`current-change`,i.value),l()}function d(e){o.value=0,r(`page-size-change`,parseInt(String(e),10))}function f(e){a.value=parseInt(String(e),10)}function p(e){o.value=parseInt(String(e),10)}function m(){l()}return lh(()=>n.total,m,{immediate:!0}),lh(()=>n.pageSize,m),(t,n)=>(Y(),X(`div`,lx,[c.value?(Y(),X(`div`,ux,[Z(`div`,null,[Z(`span`,null,K(J(W)(`PAGINATION_COUNT_PREFIX`)),1),Z(`span`,null,K(e.total),1),Z(`span`,null,K(J(W)(`PAGINATION_COUNT_SUFFIX`)),1)]),Q(Ly,{class:`tk-pagination-size`,type:`number`,min:1,max:100,"model-value":o.value?o.value:e.pageSize,onInput:p,onChange:d},null,8,[`model-value`]),Z(`span`,null,K(J(W)(`PAGINATION_PAGESIZE`)),1)])):$(`v-if`,!0),Z(`div`,dx,[(Y(!0),X(f_,null,Jh(s.value,e=>(Y(),X(`div`,{key:e.page,class:Rf([`tk-pagination-pager`,{__current:e.page===i.value}]),onClick:t=>u(e.page)},K(e.title),11,fx))),128))]),c.value?(Y(),X(`div`,px,[Z(`span`,null,K(J(W)(`PAGINATION_GOTO_PREFIX`)),1),Q(Ly,{class:`tk-pagination-goto`,type:`number`,min:1,max:c.value,"model-value":a.value?a.value:i.value,onInput:f,onChange:u},null,8,[`max`,`model-value`]),Z(`span`,null,K(J(W)(`PAGINATION_GOTO_SUFFIX`)),1)])):$(`v-if`,!0)]))}}),hx={class:`tk-admin-comment`},gx={key:0,class:`tk-admin-warn`},_x={class:`tk-admin-comment-filter`},vx={value:``},yx={value:`VISIBLE`},bx={value:`HIDDEN`},xx={class:`tk-admin-comment-meta`},Sx={key:0},Cx=[`href`],Tx={key:2},Ex=[`href`],Dx={key:3},Ox={class:`tk-time`},kx=[`title`],Ax=[`innerHTML`],jx={key:0,class:`tk-admin-warn tk-admin-security-alert`},Mx={class:`tk-admin-security-alert-message`},Nx={key:0,class:`tk-admin-security-alert-url`},Px={class:`tk-admin-actions`},Fx=5,Ix=yh({__name:`TkAdminComment`,setup(e){let t=lb().VERSION,n=q(!0),r=q([]),i=cm({}),a=q(typeof t==`string`?t:``),o=wo,s=q(0),c=q(Fx),l=q(1),u=cm({keyword:``,type:``}),d=q(null),f=q();function p(e){return Dd(e.created)}function m(e){i.LIGHTBOX===`true`&&Hd(e)}async function h(){n.value=!0;try{let e=Ao(await Lo(Po().tcb,`COMMENT_GET_FOR_ADMIN`,{per:c.value,page:l.value,keyword:u.keyword,type:u.type}));e&&!e.code&&(s.value=e.count??0,r.value=(e.data??[]).map(e=>({...e,comment:Ec(e.comment)}))),setTimeout(()=>{T(f.value)},0)}catch(e){alert(jo(e))}finally{n.value=!1}}async function g(){try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`));e&&!e.code&&e.config&&(Object.assign(i,e.config),a.value=typeof e.config.VERSION==`string`?e.config.VERSION:``,_())}catch(e){alert(jo(e))}}function _(){i.HIGHLIGHT||=`true`;let e={},t=localStorage.getItem(`twikoo`);if(t)try{e=JSON.parse(t)}catch{e={}}for(let t of[`nick`,`mail`,`avatar`])i[t]=e[t]??``;!e.nick&&i.BLOGGER_NICK&&(e.nick=String(i.BLOGGER_NICK)),!e.mail&&i.BLOGGER_EMAIL&&(e.mail=String(i.BLOGGER_EMAIL)),!e.link&&i.SITE_URL&&(e.link=String(i.SITE_URL)),localStorage.setItem(`twikoo`,JSON.stringify(e))}function v(e){c.value=e,h()}function y(e){l.value=e,h()}function b(e){let t=`${e.url??``}#${e._id}`;try{if(new URL(t).hostname!==window.location.hostname){d.value={commentId:e._id,message:W(`ADMIN_COMMENT_SECURITY_ALERT`),url:t};return}window.open(t)}catch{try{new URL(t,window.location.origin),window.open(t)}catch{d.value={commentId:e._id,message:W(`ADMIN_COMMENT_PARSE_ERROR`),url:e.url}}}}async function x(e){confirm(W(`ADMIN_COMMENT_DELETE_CONFIRM`))&&await w(`COMMENT_DELETE_FOR_ADMIN`,{id:e._id})}function S(e,t){w(`COMMENT_SET_FOR_ADMIN`,{id:e._id,set:{isSpam:t}})}function C(e,t){w(`COMMENT_SET_FOR_ADMIN`,{id:e._id,set:{top:t}})}async function w(e,t){if(!n.value){n.value=!0;try{Ao(await Lo(Po().tcb,e,t)),await h()}catch(e){alert(jo(e)),e instanceof ko||await h()}finally{n.value=!1}}}function T(e){if(e){Vd(e);for(let t of e.querySelectorAll(`.tk-content`))Ud(t,Po().options.katex),i.HIGHLIGHT===`true`&&Vc(t,i.HIGHLIGHT_THEME,i.HIGHLIGHT_PLUGIN)}}return Ph(async()=>{await Promise.all([g(),h()]),T(f.value)}),(e,t)=>rh((Y(),X(`div`,hx,[J(o)===a.value?$(`v-if`,!0):(Y(),X(`div`,gx,[Z(`span`,null,K(J(W)(`ADMIN_CLIENT_VERSION`))+K(J(o))+`,`,1),Z(`span`,null,K(J(W)(`ADMIN_SERVER_VERSION`))+K(a.value)+`,`,1),$(`
243
+ `)}),A=av(()=>{let e=parseInt(String(i.config.LIMIT_LENGTH),10);return Number.isNaN(e)&&(e=500),e>0?e:void 0}),ne=av(()=>{let e=b.value?.inputEl;return e instanceof HTMLTextAreaElement?e:null});function re(){localStorage.setItem(`twikoo-draft`,d.value)}function ie(){let e=localStorage.getItem(`twikoo-draft`);!d.value&&e&&(d.value=e)}async function ae(){if(i.config.SHOW_EMOTION!==`true`)return;let e=await dd(String(i.config.EMOTION_CDN||`https://owo.imaegoo.com/owo.json`));fd(e),x.value&&ne.value&&(u.value=new Zy({logo:r,container:x.value,target:ne.value,odata:e,position:`down`,maxHeight:`250px`}))}function oe(){u.value?.container.classList.contains(`OwO-open`)&&u.value.toggle()}function se(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.onload=()=>t(),r.onerror=()=>n(Error(`脚本加载失败:${e}`)),document.head.appendChild(r)})}function ce(e,t){return{ok:e,json:()=>Promise.resolve(t)}}function le(){ee.value===`Turnstile`&&i.config.TURNSTILE_SITE_KEY&&(window.turnstile?g.value=Promise.resolve():g.value||=se(`https://challenges.cloudflare.com/turnstile/v0/api.js?render=explicit`))}function ue(){return new Promise((e,t)=>{g.value?.then(()=>{let n=window.turnstile,r=n.render(w.value,{sitekey:i.config.TURNSTILE_SITE_KEY,callback:t=>{e(t),setTimeout(()=>n.remove(r),1e3)},"error-callback":()=>t(Error(`验证码校验失败,请重试`)),"expired-callback":()=>t(Error(`验证码已过期,请重试`)),"timeout-callback":()=>t(Error(`验证码超时,请重试`))})})})}function de(){ee.value===`Geetest`&&i.config.GEETEST_CAPTCHA_ID&&(window.initGeetest4?_.value=Promise.resolve():_.value||=se(`https://static.geetest.com/v4/gt4.js`))}function fe(){return new Promise((e,t)=>{_.value?.then(()=>{let n=window.initGeetest4;n({captchaId:i.config.GEETEST_CAPTCHA_ID,product:`bind`,language:`zho`},n=>{n.onReady(()=>n.showCaptcha()).onSuccess(()=>{let t=n.getValidate();e({geeTestLotNumber:t.lot_number,geeTestCaptchaOutput:t.captcha_output,geeTestPassToken:t.pass_token,geeTestGenTime:t.gen_time})}).onError(e=>t(e instanceof Error?e:Error(`Geetest 验证失败,请重试`))).onClose(()=>t(Error(`验证已取消`)))})})})}function pe(){if(ee.value!==`Cap`||!i.config.CAP_API_ENDPOINT&&!i.config.CAP_BUILTIN)return;let e=window;i.config.CAP_BUILTIN&&(e.CAP_CUSTOM_FETCH=async(e,t={})=>{let n=String(e),r=t.body?JSON.parse(t.body):{};try{if(n.includes(`challenge`)){let e=await Lo(Po().tcb,`CAP_CHALLENGE`),t=e.result??e;return t.code&&t.code!==0?ce(!1,{error:t.message??`challenge_failed`}):ce(!0,{challenge:t.challenge,token:t.token,expires:t.expires})}if(n.includes(`redeem`)){let e=await Lo(Po().tcb,`CAP_REDEEM`,r),t=e.result??e;return t.code&&t.code!==0&&t.success!==!0?ce(!0,{success:!1,error:t.message??t.error??`redeem_failed`}):ce(!0,{success:t.success,token:t.token,expires:t.expires,message:t.message,error:t.error??t.message})}return ce(!1,{error:`unknown_cap_path`})}catch(e){return ce(!1,{error:e instanceof Error?e.message:`cap_fetch_failed`})}}),e.Cap||customElements.get(`cap-widget`)?v.value=Promise.resolve():v.value||=se(`https://cdn.jsdmirror.com/npm/@cap.js/widget`)}function me(){return new Promise((e,t)=>{v.value?.then(()=>{let n=document.createElement(`cap-widget`);n.setAttribute(`id`,`cap-widget`);let r=i.config.CAP_BUILTIN?`/`:String(i.config.CAP_API_ENDPOINT);n.setAttribute(`data-cap-api-endpoint`,r),D.value?.appendChild(n);let a=()=>{n.parentNode?.removeChild(n)};n.solve().then(n=>{a(),n.success?e(typeof n.token==`string`?n.token:``):t(Error(`Cap 验证失败`))}).catch(e=>{a(),t(e instanceof Error?e:Error(`Cap 验证失败`))})}).catch(t)})}function he(e){p.value=e.meta.nick,m.value=e.meta.mail,h.value=e.meta.link,c.value=e.valid}function ge(){a(`cancel`)}function _e(){re(),j()}function ve(){s.value=!s.value,j()}function j(){s.value&&(f.value=Ec(ad(d.value)),Wm(()=>{let e=C.value;e&&(Vd(e),Ud(e,Po().options.katex),i.config.HIGHLIGHT===`true`&&Vc(e,i.config.HIGHLIGHT_THEME,i.config.HIGHLIGHT_PLUGIN))}))}async function ye(){o.value=!0,l.value=void 0;try{if(d.value.match(RegExp(`!\\[${W(`IMAGE_UPLOAD_PLACEHOLDER`)}.+\\]\\(\\)`)))throw Error(W(`IMAGE_UPLOAD_PLEASE_WAIT`));let e=Po().options.title,t={nick:p.value,mail:m.value,link:h.value,ua:await Bd(),url:Ad(Po().options.path),href:jd(Po().options.href),title:typeof e==`string`?e:document.title,comment:ad(d.value),markdown:d.value,pid:i.pid?i.pid:i.replyId,rid:i.replyId};ee.value===`Turnstile`&&i.config.TURNSTILE_SITE_KEY&&(t.turnstileToken=await ue()),ee.value===`Geetest`&&i.config.GEETEST_CAPTCHA_ID&&Object.assign(t,await fe()),ee.value===`Cap`&&(i.config.CAP_API_ENDPOINT||i.config.CAP_BUILTIN)&&(t.capToken=await me());let n=Po().options.onSubmit;typeof n==`function`&&await n(t);let r=await Lo(Po().tcb,`COMMENT_SUBMIT`,t),o=r.result??r;if(o.id)d.value=``,s.value=!1,f.value=``,l.value=void 0,a(`load`),re();else throw new Oo(o.code===void 0?`UNKNOWN`:`REJECTED`,o.message??W(`COMMENT_FAILED`),{rawMessage:o.message??``})}catch(e){zo.error(`评论失败`,e),l.value=e instanceof Oo?e:new Oo(`UNKNOWN`,`${W(`COMMENT_FAILED`)}: ${jo(e)}`,{rawMessage:jo(e)})}finally{o.value=!1}}function be(e){(e.ctrlKey||e.metaKey)&&e.key===`Enter`&&ye()}function xe(){S.value?.click()}function Se(){let e=S.value?.files?.[0];we(e)}function Ce(e){e.clipboardData&&we(e.clipboardData.files[0]??e.clipboardData.items[0]?.getAsFile()??void 0)}async function we(e){if(!e||!te.value)return;let t=e.name.split(`.`),r=t.length>1?String(t.pop()):``;if(n.indexOf(r.toLowerCase())===-1)return;let{tcb:a}=Po(),o=a?.auth?.currentUser?.uid??localStorage.getItem(`twikoo-access-token`)??``,s=`${Date.now()}-${o}`,c=t.join(`.`),l=e.type===`image/gif`,u=l?c:`${c}.webp`,d=l?r:`webp`;De(Oe(s,d));let f=String(i.config.IMAGE_CDN??``),p=await Te(e);a&&(!f||f===`qcloud`)?M(s,u,d,p):f?Ee(s,u,d,p):P(s,d,W(`IMAGE_UPLOAD_FAILED_NO_CONF`))}async function Te(e){return e.type===`image/gif`?e:new Promise(t=>{let n=new FileReader;n.onload=n=>{let r=new Image;r.onload=()=>{let n=document.createElement(`canvas`),i=r.width,a=r.height,o=1920;(i>o||a>o)&&(i>a?(a=a*o/i,i=o):(i=i*o/a,a=o)),n.width=i,n.height=a,n.getContext(`2d`)?.drawImage(r,0,0,i,a);let s=`image/webp`,c=e.name.replace(/\.[^.]+$/,`.webp`);n.toBlob(e=>t(new File([e??new Blob],c,{type:s})),s,.85)};let i=n.target?.result;r.src=typeof i==`string`?i:``},n.readAsDataURL(e)})}async function M(e,t,n,r){try{let i=Po().tcb?.app,a=await i.uploadFile({cloudPath:`tk-img/${e}.${n}`,filePath:r});if(!a.fileID)return;N(e,t,n,(await i.getTempFileURL({fileList:[a.fileID]})).fileList[0].tempFileURL)}catch(t){console.error(t),P(e,n,jo(t))}}async function Ee(e,t,n,r){try{let i=await Lo(Po().tcb,`UPLOAD_IMAGE`,{fileName:t,photo:await zd(r)}),a=i.result??i;a.data?N(e,t,n,String(a.data.url)):a.code===1041?P(e,n,W(`IMAGE_UPLOAD_NSFW`)):(console.error(a),P(e,n,a.message??a.err??W(`IMAGE_UPLOAD_FAILED`)))}catch(t){console.error(t),P(e,n,jo(t))}}function N(e,t,n,r){let i=t.replace(/[[\]]/g,`_`);d.value=d.value.replace(Oe(e,n),`![${i}](${r})`),S.value&&(S.value.value=``)}function P(e,t,n){d.value=d.value.replace(Oe(e,t),`_${W(`IMAGE_UPLOAD_FAILED`)}: ${n}_`),S.value&&(S.value.value=``)}function De(e){let t=ne.value,n=t?.selectionStart??d.value.length,r=t?.selectionEnd??d.value.length;d.value=d.value.substring(0,n)+e+d.value.substring(r),Wm(()=>{if(!t)return;let r=n+e.length;t.selectionStart=r,t.selectionEnd=r})}function Oe(e,t){return`![${W(`IMAGE_UPLOAD_PLACEHOLDER`)} ${e}.${t}]()`}function ke(){i.config.COMMENT_BG_IMG&&ne.value&&(ne.value.style[`background-image`]=`url("${String(i.config.COMMENT_BG_IMG)}")`)}function Ae(){le(),de(),pe()}return lh(()=>i.config.SHOW_EMOTION,()=>{ae()}),lh(()=>i.config.COMMENT_BG_IMG,()=>{ke()}),lh(()=>i.config.TURNSTILE_SITE_KEY,()=>{le()}),lh(()=>i.config.GEETEST_CAPTCHA_ID,()=>{de()}),lh(()=>i.config.CAP_API_ENDPOINT,()=>{pe()}),lh(ee,()=>{Ae()}),Ph(()=>{i.pid&&y.value?.scrollIntoView({behavior:`instant`,block:`center`}),ie(),ne.value?.addEventListener(`paste`,Ce),ke(),Ae(),ae()}),Rh(()=>{ne.value?.removeEventListener(`paste`,Ce)}),(t,n)=>(Y(),X(`div`,{ref_key:`tkSubmitRef`,ref:y,class:`tk-submit tk-fade-in`},[Z(`div`,Qy,[Q(Ay,{config:e.config,mail:m.value,nick:p.value},null,8,[`config`,`mail`,`nick`]),Z(`div`,$y,[Q(Ky,{nick:p.value,mail:m.value,link:h.value,config:e.config,onUpdate:he,onValidate:n[0]||=e=>c.value=e},null,8,[`nick`,`mail`,`link`,`config`]),Q(Ly,{ref_key:`textareaRef`,ref:b,modelValue:d.value,"onUpdate:modelValue":n[1]||=e=>d.value=e,class:`tk-input`,type:`textarea`,placeholder:k.value,autosize:{minRows:3},maxlength:A.value,"show-word-limit":``,onInput:_e,onKeyup:be},null,8,[`modelValue`,`placeholder`,`maxlength`])])]),Z(`div`,eb,[Z(`div`,tb,[$(` 表情按钮:首屏先渲染图标,随后由 OwO 面板以同样的 logo 接管容器内容 `),$(` 图标为构建期内联的 fontawesome 官方 SVG,非运行时用户数据 `),$(` eslint-disable vue/no-v-html `),rh(Z(`div`,{ref_key:`owoRef`,ref:x,class:`tk-submit-action-icon OwO`,innerHTML:J(r)},null,8,nb),[[yv,e.config.SHOW_EMOTION===`true`],[J(xd),oe]]),$(` eslint-enable vue/no-v-html `),rh(Z(`div`,{class:`tk-submit-action-icon`,onClick:xe},[Q(py,{name:`image-regular`})],512),[[yv,te.value]]),Z(`input`,{ref_key:`inputFileRef`,ref:S,class:`tk-input-image`,type:`file`,accept:`image/*`,value:``,onChange:Se},null,544)]),Z(`a`,rb,[Q(py,{name:`markdown`})]),e.replyId?(Y(),S_(Yy,{key:0,class:`tk-cancel`,size:`small`,onClick:ge},{default:nh(()=>[A_(K(J(W)(`SUBMIT_CANCEL`)),1)]),_:1})):$(`v-if`,!0),Q(Yy,{class:`tk-preview`,size:`small`,onClick:ve},{default:nh(()=>[A_(K(J(W)(`SUBMIT_PREVIEW`)),1)]),_:1}),Q(Yy,{class:`tk-send`,type:`primary`,size:`small`,disabled:!O.value,onClick:ye},{default:nh(()=>[A_(K(o.value?J(W)(`SUBMIT_SENDING`):J(W)(`SUBMIT_SEND`)),1)]),_:1},8,[`disabled`]),rh(Z(`div`,{ref_key:`turnstileContainerRef`,ref:T,class:`tk-turnstile-container`},[Z(`div`,{ref_key:`turnstileRef`,ref:w,class:`tk-turnstile`},null,512)],512),[[yv,ee.value===`Turnstile`]]),rh(Z(`div`,{ref_key:`geetestContainerRef`,ref:E,class:`tk-geetest-container`},null,512),[[yv,ee.value===`Geetest`]]),rh(Z(`div`,{ref_key:`capContainerRef`,ref:D,class:`tk-cap-container`},null,512),[[yv,ee.value===`Cap`]])]),s.value?(Y(),X(`div`,ib,[$(` 预览内容经 sanitizeHtml 消毒 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`div`,{innerHTML:f.value},null,8,ab)],512)):$(`v-if`,!0)],512))}}),sb=cm({serverConfig:{}});function cb(e){sb.serverConfig=e}function lb(){return sb.serverConfig}var ub=[`id`],db={class:`tk-main`},fb={class:`tk-row`},pb={class:`tk-meta`},mb={key:0,class:`tk-nick`},hb=[`href`],gb={key:2,class:`tk-tag tk-tag-green`},_b={key:3,class:`tk-tag tk-tag-red`},vb={key:4,class:`tk-tag tk-tag-yellow`},yb={class:`tk-time`},bb=[`datetime`,`title`],xb={key:5,class:`tk-actions`},Sb={key:0},Cb=[`innerHTML`],wb={key:0,class:`tk-expand-wrap`},Tb={key:1,class:`tk-collapse-wrap`},Eb={key:2,class:`tk-extras`},Db={key:0,class:`tk-extra`},Ob={class:`tk-icon __comment`},kb={class:`tk-extra-text`},Ab={key:1,class:`tk-extra`},jb={class:`tk-icon __comment`},Mb={class:`tk-extra-text`},Nb={key:2,class:`tk-extra`},Pb={class:`tk-icon __comment`},Fb={class:`tk-extra-text`},Ib={key:4,class:`tk-expand-wrap`},Lb={key:5,class:`tk-collapse-wrap`},Rb=yh({__name:`TkComment`,props:{comment:{},replyId:{default:``},replying:{type:Boolean,default:!1},config:{default:Dy}},emits:[`reply`,`load`,`expand`,`refreshed`,`error`],setup(e,{emit:t}){let n=e,r=t,i={win:`windows`,mac:`apple`,ipad:`apple`,iphone:`apple`,ios:`apple`,android:`android`,ubuntu:`ubuntu`,linux:`linux`},a={edge:`edge`,chrome:`chrome`,firefox:`firefox-browser`,safari:`safari`,explorer:`internet-explorer`,ie:`internet-explorer`},o=q(``),s=q(n.comment.ups??0),c=q(n.comment.downs??0),l=q(n.comment.liked===!0),u=q(n.comment.disliked===!0),d=q(!1),f=q(!1),p=q(!1),m=q(!1),h=q(!1),g=q(!1),_=av(()=>{let{tcb:e}=Po();return e?.auth?g.value:lb().IS_ADMIN===!0}),v=q(n.comment.isSpam===!0),y=q(n.comment.top===!0),b=q(!1),x=q(),S=q(),C=q(),w=q(),T=av(()=>Ec(n.comment.comment)),E=av(()=>Dd(n.comment.created)),D=av(()=>new Date(n.comment.created??0).toJSON()),ee=av(()=>new Date(n.comment.created??0).toLocaleString()),te=av(()=>ae(n.comment.os??``,i)),O=av(()=>ae(n.comment.browser??``,a)),k=av(()=>p.value&&!f.value),A=av(()=>p.value&&f.value),ne=av(()=>h.value&&!m.value),re=av(()=>h.value&&m.value),ie=av(()=>Ed(n.comment.link));function ae(e,t){let n=e.toLowerCase();for(let e of Object.keys(t))if(n.indexOf(e)!==-1)return t[e];return`window-maximize-regular`}function oe(){let e=w.value;n.comment.replies.length>0&&e&&(p.value=e.scrollHeight>236)}function se(){let e=S.value;e&&(h.value=h.value||e.scrollHeight>500)}function ce(){S.value?.querySelectorAll(`img`).forEach(e=>{e.onload=se})}function le(){window.location.hash.indexOf(n.comment.id)!==-1&&(x.value?.scrollIntoView({behavior:`smooth`}),r(`expand`))}function ue(e){document.getElementById(e)?.scrollIntoView({behavior:`smooth`,block:`center`})}async function de(){if(!d.value){d.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_LIKE`,{id:n.comment.id,type:`up`})),l.value?s.value--:(s.value++,u.value&&c.value--),l.value=!l.value,u.value=!1}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{d.value=!1}}}async function fe(){if(!d.value){d.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_LIKE`,{id:n.comment.id,type:`down`})),u.value?c.value--:(c.value++,l.value&&s.value--),u.value=!u.value,l.value=!1}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{d.value=!1}}}function pe(e){o.value=e,r(`reply`,n.comment.id)}async function me(e){if(!b.value&&confirm(W(e?`ADMIN_COMMENT_DELETE_CONFIRM`:`COMMENT_DELETE_CONFIRM`))){b.value=!0;try{Ao(await Lo(Po().tcb,e?`COMMENT_DELETE_FOR_ADMIN`:`COMMENT_DELETE_FOR_USER`,{id:n.comment.id})),r(`load`)}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{b.value=!1}}}function he(e){o.value=e,r(`reply`,e?n.comment.id:``)}function ge(){o.value=``,r(`reply`,``)}function _e(){o.value=``,r(`reply`,``),r(`load`),f.value=!0}function ve(){r(`refreshed`),Wm(()=>{let e=w.value?.lastElementChild;n.comment.replies.length>0&&e&&e.scrollIntoView({behavior:`smooth`,block:`center`})})}async function j(){try{let{tcb:e}=Po();if(e?.auth){let t=await e.auth.getCurrentUser();g.value=t.loginType===`CUSTOM`}}catch(e){g.value=!1,alert(jo(e))}}function ye(e){Se({isSpam:e})}function be(e){Se({top:e})}function xe(e){lb().LIGHTBOX===`true`&&Hd(e)}async function Se(e){if(!b.value){b.value=!0;try{Ao(await Lo(Po().tcb,`COMMENT_SET_FOR_ADMIN`,{id:n.comment.id,set:e})),e.isSpam!==void 0&&(v.value=e.isSpam),e.top!==void 0&&(y.value=e.top)}catch(e){alert(jo(e)),e instanceof ko||r(`load`)}finally{b.value=!1}}}function Ce(){let e=C.value;e&&(Vd(e),Ud(e,Po().options.katex),n.config.HIGHLIGHT===`true`&&Vc(e,n.config.HIGHLIGHT_THEME,n.config.HIGHLIGHT_PLUGIN))}return lh(()=>[n.comment,n.comment.isSpam],()=>{v.value=n.comment.isSpam===!0}),lh(()=>[n.comment,n.comment.top],()=>{y.value=n.comment.top===!0}),lh(()=>[n.comment,n.comment.ups,n.comment.liked],()=>{s.value=n.comment.ups??0,l.value=n.comment.liked===!0}),lh(()=>[n.comment,n.comment.downs,n.comment.disliked],()=>{c.value=n.comment.downs??0,u.value=n.comment.disliked===!0}),lh(()=>n.config.HIGHLIGHT,e=>{e===`true`&&Wm(Ce)},{immediate:!0}),Ph(()=>{Wm(se),Wm(ce),Wm(oe),Wm(le),Wm(Ce),j()}),(t,n)=>{let i=Wh(`TkComment`,!0);return Y(),X(`div`,{id:e.comment.id,ref_key:`tkCommentRef`,ref:x,class:Rf([`tk-comment`,{"tk-master":e.comment.master}])},[Q(Ay,{config:e.config,nick:e.comment.nick,avatar:e.comment.avatar,"mail-md5":e.comment.mailMd5,link:ie.value},null,8,[`config`,`nick`,`avatar`,`mail-md5`,`link`]),Z(`div`,db,[Z(`div`,fb,[Z(`div`,pb,[ie.value?$(`v-if`,!0):(Y(),X(`strong`,mb,K(e.comment.nick),1)),ie.value?(Y(),X(`a`,{key:1,class:`tk-nick tk-nick-link`,href:ie.value,target:`_blank`,rel:`noopener noreferrer nofollow ugc`},[Z(`strong`,null,K(e.comment.nick),1)],8,hb)):$(`v-if`,!0),e.comment.master?(Y(),X(`span`,gb,K(e.config.MASTER_TAG||J(W)(`COMMENT_MASTER_TAG`)),1)):$(`v-if`,!0),y.value?(Y(),X(`span`,_b,K(J(W)(`COMMENT_TOP_TAG`)),1)):$(`v-if`,!0),v.value?(Y(),X(`span`,vb,K(J(W)(`COMMENT_REVIEWING_TAG`)),1)):$(`v-if`,!0),Z(`small`,yb,[Z(`time`,{datetime:D.value,title:ee.value},K(E.value),9,bb)]),_.value?(Y(),X(`small`,xb,[v.value?(Y(),X(`button`,{key:0,onClick:n[0]||=e=>ye(!1)},K(J(W)(`ADMIN_COMMENT_SHOW`)),1)):$(`v-if`,!0),v.value?$(`v-if`,!0):(Y(),X(`button`,{key:1,onClick:n[1]||=e=>ye(!0)},K(J(W)(`ADMIN_COMMENT_HIDE`)),1)),!e.comment.rid&&y.value?(Y(),X(`button`,{key:2,onClick:n[2]||=e=>be(!1)},K(J(W)(`ADMIN_COMMENT_UNTOP`)),1)):$(`v-if`,!0),!e.comment.rid&&!y.value?(Y(),X(`button`,{key:3,onClick:n[3]||=e=>be(!0)},K(J(W)(`ADMIN_COMMENT_TOP`)),1)):$(`v-if`,!0),Z(`button`,{onClick:n[4]||=e=>me(!0)},K(J(W)(`ADMIN_COMMENT_DELETE`)),1)])):$(`v-if`,!0)]),Q(Ey,{liked:l.value,disliked:u.value,"like-count":s.value,"dislike-count":c.value,"replies-count":e.comment.replies.length,"show-dislike":e.config.SHOW_DISLIKE!==`false`,"show-delete":e.comment.isOwner===!0,onLike:de,onDislike:fe,onReply:pe,onDelete:n[5]||=e=>me(!1)},null,8,[`liked`,`disliked`,`like-count`,`dislike-count`,`replies-count`,`show-dislike`,`show-delete`])]),Z(`div`,{ref_key:`tkContentRef`,ref:S,class:Rf([`tk-content`,{"tk-content-expand":m.value}])},[e.comment.pid?(Y(),X(`span`,Sb,[A_(K(J(W)(`COMMENT_REPLIED`))+` `,1),Z(`a`,{class:`tk-ruser`,href:`#`,onClick:n[6]||=ny(t=>ue(e.comment.pid),[`prevent`])},K(`@${e.comment.ruser}`),1),n[14]||=A_(` : `,-1)])):$(`v-if`,!0),$(` 正文:服务端已 DOMPurify 消毒,客户端再走一次 sanitizeHtml 双保险 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`span`,{ref_key:`commentRef`,ref:C,onClick:xe,innerHTML:T.value},null,8,Cb)],2),ne.value?(Y(),X(`div`,wb,[Z(`div`,{class:`tk-expand`,onClick:n[7]||=e=>m.value=!0},K(J(W)(`COMMENT_EXPAND`)),1)])):$(`v-if`,!0),re.value?(Y(),X(`div`,Tb,[Z(`div`,{class:`tk-expand _collapse`,onClick:n[8]||=e=>m.value=!1},K(J(W)(`COMMENT_COLLAPSE`)),1)])):$(`v-if`,!0),e.comment.ipRegion||e.comment.os||e.comment.browser?(Y(),X(`div`,Eb,[e.comment.ipRegion?(Y(),X(`div`,Db,[Z(`span`,Ob,[Q(py,{name:`location-arrow`})]),Z(`span`,kb,`\xA0`+K(e.comment.ipRegion),1)])):$(`v-if`,!0),e.comment.os?(Y(),X(`div`,Ab,[Z(`span`,jb,[Q(py,{name:te.value},null,8,[`name`])]),Z(`span`,Mb,`\xA0`+K(e.comment.os),1)])):$(`v-if`,!0),e.comment.browser?(Y(),X(`div`,Nb,[Z(`span`,Pb,[Q(py,{name:O.value},null,8,[`name`])]),Z(`span`,Fb,`\xA0`+K(e.comment.browser),1)])):$(`v-if`,!0)])):$(`v-if`,!0),$(` 回复框(主楼被回复时挂载;楼中楼由子评论自身挂载) `),e.replying&&!o.value?(Y(),S_(ob,{key:3,"reply-id":e.replyId?e.replyId:e.comment.id,pid:e.comment.id,config:e.config,onLoad:_e,onCancel:ge,onError:n[9]||=e=>r(`error`,e)},null,8,[`reply-id`,`pid`,`config`])):$(`v-if`,!0),$(` 回复列表 `),Z(`div`,{ref_key:`tkRepliesRef`,ref:w,class:Rf([`tk-replies`,{"tk-replies-expand":f.value||!k.value||e.replying}])},[(Y(!0),X(f_,null,Jh(e.comment.replies,t=>(Y(),S_(i,{key:t.id,comment:t,"reply-id":e.comment.id,replying:e.replying&&o.value===t.id,config:e.config,onExpand:n[10]||=e=>f.value=!0,onLoad:_e,onReply:he,onRefreshed:ve,onError:n[11]||=e=>r(`error`,e)},null,8,[`comment`,`reply-id`,`replying`,`config`]))),128))],2),k.value&&!e.replying?(Y(),X(`div`,Ib,[Z(`div`,{class:`tk-expand`,onClick:n[12]||=e=>f.value=!0},K(J(W)(`COMMENT_EXPAND`)),1)])):$(`v-if`,!0),A.value&&!e.replying?(Y(),X(`div`,Lb,[Z(`div`,{class:`tk-expand _collapse`,onClick:n[13]||=e=>f.value=!1},K(J(W)(`COMMENT_COLLAPSE`)),1)])):$(`v-if`,!0)])],10,ub)}}}),zb={class:`tk-error`},Bb={class:`tk-error__icon`},Vb={class:`tk-error__body`},Hb={class:`tk-error__title`},Ub={class:`tk-error__message`},Wb={class:`tk-error__detail`},Gb={key:0,class:`tk-error__row`},Kb={key:1,class:`tk-error__row`},qb={key:2,class:`tk-error__raw`},Jb=yh({__name:`TkError`,props:{error:{}},setup(e){let t=e,n=q(!1),r={NETWORK:`无法连接到后端`,CORS:`请求被跨域策略拦截`,TIMEOUT:`请求超时`,REJECTED:`请求过于频繁`,NOT_FOUND:`接口地址不存在`,CLIENT_ERROR:`请求失败`,SERVER_ERROR:`后端异常`,UNKNOWN:`出现未知错误`},i=av(()=>r[t.error.kind]??`出现错误`),a=av(()=>{let e=t.error.rawMessage||t.error.message;return e.length>120?`${e.slice(0,120)}...`:e}),o=av(()=>t.error.rawMessage||``),s=av(()=>t.error.httpStatus),c=av(()=>t.error.requestId);return(e,t)=>(Y(),X(`div`,zb,[Z(`div`,Bb,[Q(py,{name:`circle-exclamation`})]),Z(`div`,Vb,[Z(`div`,Hb,K(i.value),1),Z(`div`,Ub,K(a.value),1),Z(`button`,{class:`tk-error__toggle`,type:`button`,onClick:t[0]||=e=>n.value=!n.value},K(n.value?`收起详情`:`展开详情`),1),rh(Z(`div`,Wb,[s.value?(Y(),X(`div`,Gb,`HTTP: `+K(s.value),1)):$(`v-if`,!0),c.value?(Y(),X(`div`,Kb,`Request ID: `+K(c.value),1)):$(`v-if`,!0),o.value?(Y(),X(`pre`,qb,K(o.value),1)):$(`v-if`,!0)],512),[[yv,n.value]])])]))}}),Yb={class:`tk-comments`},Xb={class:`tk-comments-container`},Zb={class:`tk-comments-title`},Qb={key:0},$b={class:`tk-comments-actions`},ex={key:0,class:`tk-comments-sort`},tx={class:`tk-comments-search`},nx={key:1,class:`tk-comments-no`},rx={key:0},ix={key:1},ax={key:2,class:`tk-expand-wrap`},ox=yh({__name:`TkComments`,props:{showAdminEntry:{type:Boolean,default:!1}},emits:[`admin`,`refreshed`],setup(e,{emit:t}){let n=t,r=q(!0),i=q(!1),a=q(null),o=q({}),s=q([]),c=q(!0),l=q(0),u=q(``),d=q(1),f=q(`newest`),p=q(``),m=q(``),h=q(!1),g=q(0),_=q();async function v(){try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG`));e.config&&(o.value=e.config,cb(e.config))}catch(e){zo.warn(`加载公开配置失败`,e)}}async function y(){let e=++g.value;r.value=!0,a.value=null;let t={url:Ad(Po().options.path),sort:f.value,keyword:m.value};m.value&&(t.page=1),await k(t),e===g.value&&(r.value=!1)}function b(){s.value=[],d.value=1}function x(){let e=p.value.trim();p.value=e,m.value!==e&&(m.value=e,b(),y())}function S(){m.value&&(m.value=``,b(),y())}function C(){h.value=!h.value,h.value?setTimeout(()=>_.value?.focus(),0):(p.value=``,S())}function w(){b(),y()}async function T(){let e=++g.value;r.value=!0,a.value=null;try{let e=Ad(Po().options.path),t=d.value,n={url:e,sort:f.value,keyword:m.value};if(m.value&&(n.page=1),!await k(n))return;for(let n=2;n<=t&&await te(e,n);n++);}finally{e===g.value&&(r.value=!1)}e===g.value&&n(`refreshed`)}function E(e){f.value!==e&&(f.value=e,b(),y())}async function D(){if(!i.value){i.value=!0,d.value++;try{await te(Ad(Po().options.path),d.value)}finally{i.value=!1}}}function ee(){let e=1/0;for(let t of s.value)!t.top&&(t.created??1/0)<e&&(e=t.created??1/0);return e===1/0?void 0:e}async function te(e,t=d.value){if(m.value)return k({url:e,page:t,sort:f.value,keyword:m.value});let n=ee();return n!==void 0&&k({url:e,before:n,sort:f.value,keyword:m.value})}function O(){let e=Po().options.onCommentLoaded;typeof e==`function`&&e()}async function k(e){let t=g.value;try{let n=await Lo(Po().tcb,`COMMENT_GET`,e);if(t!==g.value)return!1;let r=Ao(n);if(r?.message)return a.value=new Oo(`CLIENT_ERROR`,r.message,{rawMessage:r.message}),!1;if(r?.data)return s.value=e.before||typeof e.page==`number`&&e.page>1?s.value.concat(r.data):r.data,c.value=r.more===!0,l.value=r.count??s.value.length,setTimeout(O,0),!0}catch(e){t===g.value&&(a.value=e instanceof Oo?e:new Oo(`UNKNOWN`,jo(e),{rawMessage:jo(e)}))}return!1}function A(e){a.value=e}function ne(e){u.value=e}function re(){n(`admin`)}function ie(){v()}function ae(){T()}return Ph(()=>{v(),y(),Hy(zy,ie),Hy(zy,ae)}),Rh(()=>{Uy(zy,ie),Uy(zy,ae)}),(t,n)=>(Y(),X(`div`,Yb,[Q(ob,{config:o.value,onLoad:y,onError:A},null,8,[`config`]),rh((Y(),X(`div`,Xb,[Z(`div`,Zb,[Z(`span`,{class:Rf([`tk-comments-count`,{__hidden:r.value||!s.value.length&&!m.value}])},[m.value?(Y(),X(`span`,Qb,K(J(W)(`COMMENTS_SEARCH_COUNT_PREFIX`)),1)):$(`v-if`,!0),Z(`span`,null,K(l.value),1),Z(`span`,null,K(J(W)(`COMMENTS_COUNT_SUFFIX`)),1)],2),Z(`span`,$b,[!r.value&&s.value.length&&o.value.SHOW_ORDER!==`false`?(Y(),X(`span`,ex,[Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`newest`}]),type:`button`,onClick:n[0]||=e=>E(`newest`)},K(J(W)(`COMMENTS_SORT_NEWEST`)),3),Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`oldest`}]),type:`button`,onClick:n[1]||=e=>E(`oldest`)},K(J(W)(`COMMENTS_SORT_OLDEST`)),3),Z(`button`,{class:Rf([`tk-sort-item`,{__active:f.value===`popular`}]),type:`button`,onClick:n[2]||=e=>E(`popular`)},K(J(W)(`COMMENTS_SORT_POPULAR`)),3)])):$(`v-if`,!0),!r.value&&!i.value?(Y(),X(`span`,{key:1,class:Rf([`tk-icon __comments`,{__active:h.value}]),onClick:C},[Q(py,{name:`magnifying-glass`})],2)):$(`v-if`,!0),!r.value&&!i.value?(Y(),X(`span`,{key:2,class:`tk-icon __comments`,onClick:w},[Q(py,{name:`sync`})])):$(`v-if`,!0),e.showAdminEntry?(Y(),X(`span`,{key:3,class:`tk-icon __comments`,onClick:re},[Q(py,{name:`cog`})])):$(`v-if`,!0)])]),rh(Z(`div`,tx,[Q(Ly,{ref_key:`searchInputRef`,ref:_,modelValue:p.value,"onUpdate:modelValue":n[3]||=e=>p.value=e,size:`small`,clearable:``,maxlength:100,placeholder:J(W)(`COMMENTS_SEARCH_PLACEHOLDER`),onClear:S,onKeyup:iy(x,[`enter`])},null,8,[`modelValue`,`placeholder`]),Q(Yy,{size:`small`,type:`primary`,onClick:x},{default:nh(()=>[A_(K(J(W)(`COMMENTS_SEARCH`)),1)]),_:1})],512),[[yv,h.value]]),$(` 评论区唯一错误卡片:列表/提交/回复失败共用,位于空态块上方 `),a.value?(Y(),S_(Jb,{key:0,error:a.value},null,8,[`error`])):$(`v-if`,!0),!s.value.length&&!r.value&&!a.value?(Y(),X(`div`,nx,[m.value?(Y(),X(`span`,rx,K(J(W)(`COMMENTS_SEARCH_NO_RESULT`)),1)):$(`v-if`,!0),m.value?$(`v-if`,!0):(Y(),X(`span`,ix,K(J(W)(`COMMENTS_NO_COMMENTS`)),1))])):$(`v-if`,!0),(Y(!0),X(f_,null,Jh(s.value,e=>(Y(),S_(Rb,{key:e.id,comment:e,replying:u.value===e.id,config:o.value,onReply:ne,onLoad:T,onError:A},null,8,[`comment`,`replying`,`config`]))),128)),c.value&&!r.value&&!a.value?(Y(),X(`div`,ax,[rh((Y(),X(`div`,{class:`tk-expand`,onClick:D},[A_(K(J(W)(`COMMENTS_EXPAND`)),1)])),[[J(vd),i.value]])])):$(`v-if`,!0)])),[[J(vd),r.value]])]))}}),sx={class:`tk-footer`},cx=yh({__name:`TkFooter`,setup(e){let t=wo;return(e,n)=>(Y(),X(`div`,sx,[n[0]||=A_(` Powered by `,-1),n[1]||=Z(`a`,{href:`https://twikoo.js.org`,target:`_blank`,rel:`noopener noreferrer`},`Twikoo`,-1),A_(` v`+K(J(t)),1)]))}}),lx={class:`tk-pagination`},ux={key:0,class:`tk-pagination-options`},dx={class:`tk-pagination-pagers`},fx=[`onClick`],px={key:1,class:`tk-pagination-options`},mx=yh({__name:`TkPagination`,props:{pageSize:{default:10},total:{default:0}},emits:[`current-change`,`page-size-change`],setup(e,{emit:t}){let n=e,r=t,i=q(1),a=q(0),o=q(0),s=q([]),c=av(()=>Math.ceil(n.total/n.pageSize));function l(){let e=[];for(let t=1;t<=c.value;t++)Math.abs(i.value-t)<3||t===1||t===c.value?e.push({title:`${t}`,page:t}):Math.abs(i.value-t)<4&&e.push({title:`...`,page:t});s.value=e}function u(e){i.value=parseInt(String(e),10)||1,i.value>c.value&&(i.value=c.value),i.value<1&&(i.value=1),a.value=0,r(`current-change`,i.value),l()}function d(e){o.value=0,r(`page-size-change`,parseInt(String(e),10))}function f(e){a.value=parseInt(String(e),10)}function p(e){o.value=parseInt(String(e),10)}function m(){l()}return lh(()=>n.total,m,{immediate:!0}),lh(()=>n.pageSize,m),(t,n)=>(Y(),X(`div`,lx,[c.value?(Y(),X(`div`,ux,[Z(`div`,null,[Z(`span`,null,K(J(W)(`PAGINATION_COUNT_PREFIX`)),1),Z(`span`,null,K(e.total),1),Z(`span`,null,K(J(W)(`PAGINATION_COUNT_SUFFIX`)),1)]),Q(Ly,{class:`tk-pagination-size`,type:`number`,min:1,max:100,"model-value":o.value?o.value:e.pageSize,onInput:p,onChange:d},null,8,[`model-value`]),Z(`span`,null,K(J(W)(`PAGINATION_PAGESIZE`)),1)])):$(`v-if`,!0),Z(`div`,dx,[(Y(!0),X(f_,null,Jh(s.value,e=>(Y(),X(`div`,{key:e.page,class:Rf([`tk-pagination-pager`,{__current:e.page===i.value}]),onClick:t=>u(e.page)},K(e.title),11,fx))),128))]),c.value?(Y(),X(`div`,px,[Z(`span`,null,K(J(W)(`PAGINATION_GOTO_PREFIX`)),1),Q(Ly,{class:`tk-pagination-goto`,type:`number`,min:1,max:c.value,"model-value":a.value?a.value:i.value,onInput:f,onChange:u},null,8,[`max`,`model-value`]),Z(`span`,null,K(J(W)(`PAGINATION_GOTO_SUFFIX`)),1)])):$(`v-if`,!0)]))}}),hx={class:`tk-admin-comment`},gx={key:0,class:`tk-admin-warn`},_x={class:`tk-admin-comment-filter`},vx={value:``},yx={value:`VISIBLE`},bx={value:`HIDDEN`},xx={class:`tk-admin-comment-meta`},Sx={key:0},Cx=[`href`],Tx={key:2},Ex=[`href`],Dx={key:3},Ox={class:`tk-time`},kx=[`title`],Ax=[`innerHTML`],jx={key:0,class:`tk-admin-warn tk-admin-security-alert`},Mx={class:`tk-admin-security-alert-message`},Nx={key:0,class:`tk-admin-security-alert-url`},Px={class:`tk-admin-actions`},Fx=[`onKeyup`],Ix={class:`tk-admin-comment-editor-actions`},Lx=5,Rx=yh({__name:`TkAdminComment`,setup(e){let t=lb().VERSION,n=q(!0),r=q([]),i=cm({}),a=q(typeof t==`string`?t:``),o=wo,s=q(0),c=q(Lx),l=q(1),u=cm({keyword:``,type:``}),d=q(null),f=q(),p=q(null),m=q(``),h=q(``),g=q(),_=q(!1);function v(e){return Dd(e.created)}function y(e){i.LIGHTBOX===`true`&&Hd(e)}async function b(){n.value=!0;try{let e=Ao(await Lo(Po().tcb,`COMMENT_GET_FOR_ADMIN`,{per:c.value,page:l.value,keyword:u.keyword,type:u.type}));e&&!e.code&&(s.value=e.count??0,r.value=(e.data??[]).map(e=>({...e,comment:Ec(e.comment)}))),setTimeout(()=>{ae(f.value)},0)}catch(e){alert(jo(e))}finally{n.value=!1}}async function x(){try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`));e&&!e.code&&e.config&&(Object.assign(i,e.config),a.value=typeof e.config.VERSION==`string`?e.config.VERSION:``,S())}catch(e){alert(jo(e))}}function S(){i.HIGHLIGHT||=`true`;let e={},t=localStorage.getItem(`twikoo`);if(t)try{e=JSON.parse(t)}catch{e={}}for(let t of[`nick`,`mail`,`avatar`])i[t]=e[t]??``;!e.nick&&i.BLOGGER_NICK&&(e.nick=String(i.BLOGGER_NICK)),!e.mail&&i.BLOGGER_EMAIL&&(e.mail=String(i.BLOGGER_EMAIL)),!e.link&&i.SITE_URL&&(e.link=String(i.SITE_URL)),localStorage.setItem(`twikoo`,JSON.stringify(e))}function C(e){c.value=e,b()}function w(e){l.value=e,b()}function T(e){let t=`${e.url??``}#${e._id}`;try{if(new URL(t).hostname!==window.location.hostname){d.value={commentId:e._id,message:W(`ADMIN_COMMENT_SECURITY_ALERT`),url:t};return}window.open(t)}catch{try{new URL(t,window.location.origin),window.open(t)}catch{d.value={commentId:e._id,message:W(`ADMIN_COMMENT_PARSE_ERROR`),url:e.url}}}}function E(){(Array.isArray(g.value)?g.value[0]:g.value)?.focus()}function D(e){let t=e.markdown??e.comment??``;p.value=e._id,m.value=t,h.value=t,Wm(E)}function ee(){p.value=null,m.value=``,h.value=``}function te(){(m.value===h.value||confirm(W(`ADMIN_COMMENT_EDIT_DISCARD_CONFIRM`)))&&ee()}function O(e,t){(e.ctrlKey||e.metaKey)&&e.key===`Enter`?k(t):e.key===`Escape`&&te()}async function k(e){if(!_.value){_.value=!0;try{let t=m.value,n=Ec(ad(t));await ie(`COMMENT_SET_FOR_ADMIN`,{id:e._id,set:{comment:n,markdown:t}})&&ee()}finally{_.value=!1}}}async function A(e){confirm(W(`ADMIN_COMMENT_DELETE_CONFIRM`))&&await ie(`COMMENT_DELETE_FOR_ADMIN`,{id:e._id})}function ne(e,t){ie(`COMMENT_SET_FOR_ADMIN`,{id:e._id,set:{isSpam:t}})}function re(e,t){ie(`COMMENT_SET_FOR_ADMIN`,{id:e._id,set:{top:t}})}async function ie(e,t){if(n.value)return!1;n.value=!0;try{return Ao(await Lo(Po().tcb,e,t)),await b(),!0}catch(e){return alert(jo(e)),e instanceof ko||await b(),!1}finally{n.value=!1}}function ae(e){if(e){Vd(e);for(let t of e.querySelectorAll(`.tk-content`))Ud(t,Po().options.katex),i.HIGHLIGHT===`true`&&Vc(t,i.HIGHLIGHT_THEME,i.HIGHLIGHT_PLUGIN)}}return Ph(async()=>{await Promise.all([x(),b()]),ae(f.value)}),(e,t)=>rh((Y(),X(`div`,hx,[J(o)===a.value?$(`v-if`,!0):(Y(),X(`div`,gx,[Z(`span`,null,K(J(W)(`ADMIN_CLIENT_VERSION`))+K(J(o))+`,`,1),Z(`span`,null,K(J(W)(`ADMIN_SERVER_VERSION`))+K(a.value)+`,`,1),$(`
244
244
  用 prettier-ignore 保持单行:这一段的换行/缩进空白会被 Vue 3 的 condense 折叠成
245
245
  一个空格(Vue 2 保留、HTML 同样折叠),与两侧的 &nbsp; 叠加后会让「版本更新」
246
246
  链接左右各宽约一个空格,而 1.x 只有 &nbsp;。所以必须让 &nbsp; 与 <a> 紧贴。
247
- `),$(` prettier-ignore `),t[3]||=Z(`span`,null,[A_(`请参考\xA0`),Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},`版本更新`),A_(`\xA0进行升级`)],-1)])),Z(`div`,_x,[Q(Ly,{modelValue:u.keyword,"onUpdate:modelValue":t[0]||=e=>u.keyword=e,class:`tk-admin-comment-filter-keyword`,size:`small`,placeholder:J(W)(`ADMIN_COMMENT_SEARCH_PLACEHOLDER`),onKeyup:iy(h,[`enter`])},null,8,[`modelValue`,`placeholder`]),rh(Z(`select`,{"onUpdate:modelValue":t[1]||=e=>u.type=e,class:`tk-admin-comment-filter-type`},[Z(`option`,vx,K(J(W)(`ADMIN_COMMENT_FILTER_ALL`)),1),Z(`option`,yx,K(J(W)(`ADMIN_COMMENT_FILTER_VISIBLE`)),1),Z(`option`,bx,K(J(W)(`ADMIN_COMMENT_FILTER_HIDDEN`)),1)],512),[[Xv,u.type]]),Q(Yy,{size:`small`,type:`primary`,onClick:h},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_SEARCH`)),1)]),_:1})]),Z(`div`,{ref_key:`commentListRef`,ref:f,class:`tk-admin-comment-list`},[(Y(!0),X(f_,null,Jh(r.value,e=>(Y(),X(`div`,{key:e._id,class:`tk-admin-comment-item`},[Z(`div`,xx,[Q(Ay,{config:i,avatar:e.avatar,nick:e.nick,mail:e.mail,link:e.link},null,8,[`config`,`avatar`,`nick`,`mail`,`link`]),e.link?$(`v-if`,!0):(Y(),X(`span`,Sx,K(e.nick)+`\xA0`,1)),e.link?(Y(),X(`a`,{key:1,href:J(Ed)(e.link),target:`_blank`,rel:`noopener noreferrer`},K(e.nick)+`\xA0 `,9,Cx)):$(`v-if`,!0),e.mail?(Y(),X(`span`,Tx,[t[4]||=A_(` (`,-1),Z(`a`,{href:`mailto:${e.mail}`},K(e.mail),9,Ex),t[5]||=A_(`)\xA0 `,-1)])):$(`v-if`,!0),e.isSpam?(Y(),X(`span`,Dx,K(J(W)(`ADMIN_COMMENT_IS_SPAM_SUFFIX`))+`\xA0`,1)):$(`v-if`,!0),Z(`span`,Ox,K(p(e))+`\xA0`,1),Z(`span`,{title:e.ua},K(e.ipRegion),9,kx)]),$(` 管理端正文:服务端已消毒,客户端再走一次 sanitizeHtml 双保险 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`div`,{class:`tk-content`,onClick:m,innerHTML:e.comment},null,8,Ax),d.value&&d.value.commentId===e._id?(Y(),X(`div`,jx,[Z(`a`,{class:`tk-admin-close`,href:`#`,onClick:t[2]||=ny(e=>d.value=null,[`prevent`])},[Q(py,{name:`times`})]),Z(`div`,Mx,K(d.value.message),1),d.value.url?(Y(),X(`div`,Nx,[Z(`code`,null,K(d.value.url),1)])):$(`v-if`,!0)])):$(`v-if`,!0),Z(`div`,Px,[Q(Yy,{size:`mini`,type:`text`,onClick:t=>b(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_VIEW`)),1)]),_:1},8,[`onClick`]),e.isSpam?(Y(),S_(Yy,{key:0,size:`mini`,type:`text`,onClick:t=>S(e,!1)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_SHOW`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),e.isSpam?$(`v-if`,!0):(Y(),S_(Yy,{key:1,size:`mini`,type:`text`,onClick:t=>S(e,!0)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_HIDE`)),1)]),_:1},8,[`onClick`])),!e.rid&&e.top?(Y(),S_(Yy,{key:2,size:`mini`,type:`text`,onClick:t=>C(e,!1)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_UNTOP`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),!e.rid&&!e.top?(Y(),S_(Yy,{key:3,size:`mini`,type:`text`,onClick:t=>C(e,!0)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_TOP`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),Q(Yy,{size:`mini`,type:`text`,onClick:t=>x(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_DELETE`)),1)]),_:1},8,[`onClick`])])]))),128))],512),Q(mx,{"page-size":c.value,total:s.value,onPageSizeChange:v,onCurrentChange:y},null,8,[`page-size`,`total`])])),[[J(vd),n.value]])}}),Lx={class:`tk-admin-config`},Rx={key:0,class:`tk-admin-warn`},zx={class:`tk-admin-config-groups`},Bx={class:`tk-admin-config-group-title`},Vx=[`title`],Hx={class:`tk-admin-config-input`},Ux=[`onUpdate:modelValue`],Wx=[`value`],Gx={class:`tk-admin-config-desc`},Kx={class:`tk-admin-config-group`},qx={class:`tk-admin-config-group-title`},Jx={class:`tk-admin-config-email-test`},Yx={class:`tk-admin-config-email-test-desc`},Xx={class:`tk-admin-config-input`},Zx={class:`tk-admin-config-email-test-desc`},Qx={class:`tk-admin-config-actions`},$x={class:`tk-admin-config-message`},eS=yh({__name:`TkAdminConfig`,setup(e){function t(e){return ol.includes(e(`IMAGE_CDN`))}function n(e){return!!e(`IMAGE_CDN`)&&e(`IMAGE_CDN`)!==`s3`}function r(e){return e(`IMAGE_CDN`)===`s3`}function i(e){return t=>t(`CAPTCHA_PROVIDER`)===e}let a=()=>W(`ADMIN_CONFIG_EXAMPLE`);function o(){return[{name:W(`ADMIN_CONFIG_CATEGORY_COMMON`),items:[{key:`SITE_NAME`,desc:W(`ADMIN_CONFIG_ITEM_SITE_NAME`),ph:`${a()}虹墨空间站`,value:``},{key:`SITE_URL`,desc:W(`ADMIN_CONFIG_ITEM_SITE_URL`),ph:`${a()}https://www.imaegoo.com`,value:``},{key:`CORS_ALLOW_ORIGIN`,desc:W(`ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN`),ph:`${a()}https://www.imaegoo.com`,value:``},{key:`BLOGGER_NICK`,desc:W(`ADMIN_CONFIG_ITEM_BLOGGER_NICK`),ph:`${a()}iMaeGoo`,value:``},{key:`BLOGGER_EMAIL`,desc:W(`ADMIN_CONFIG_ITEM_BLOGGER_EMAIL`),ph:`${a()}12345@qq.com`,value:``},{key:`COMMENT_PAGE_SIZE`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE`),ph:`${a()}8`,value:``},{key:`MASTER_TAG`,desc:W(`ADMIN_CONFIG_ITEM_MASTER_TAG`),ph:`${a()}站长`,value:``},{key:`COMMENT_BG_IMG`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_BG_IMG`),ph:``,value:``},{key:`GRAVATAR_CDN`,desc:W(`ADMIN_CONFIG_ITEM_GRAVATAR_CDN`),ph:`${a()}sdn.geekzu.org`,value:``},{key:`DEFAULT_GRAVATAR`,desc:W(`ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR`),ph:`${a()}mp`,value:``},{key:`COMMENT_PLACEHOLDER`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER`),ph:`${a()}`,value:``},{key:`SHOW_ORDER`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_ORDER`),ph:`${a()}true`,value:``},{key:`SHOW_DISLIKE`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_DISLIKE`),ph:`${a()}true`,value:``},{key:`DISPLAYED_FIELDS`,desc:W(`ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS`),ph:`${a()}nick,mail,link`,value:``},{key:`REQUIRED_FIELDS`,desc:W(`ADMIN_CONFIG_ITEM_REQUIRED_FIELDS`),ph:`${a()}nick,mail,link`,value:``},{key:`HIDE_ADMIN_CRYPT`,desc:W(`ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT`),ph:`${a()}admin`,value:``},{key:`QQ_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_QQ_API_KEY`),ph:`${a()}your_api_key`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_PLUGIN`),items:[{key:`IMAGE_CDN`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN`),ph:``,value:``,options:[{value:``,label:W(`ADMIN_CONFIG_IMAGE_CDN_NONE`)},{value:`qcloud`,label:`qcloud`},{value:`7bu`,label:`7bu (https://7bu.top)`},{value:`see`,label:`see (https://s.ee)`},{value:`lskypro`,label:`lskypro`},{value:`piclist`,label:`piclist`},{value:`easyimage`,label:`easyimage`},{value:`chevereto`,label:`chevereto`},{value:`s3`,label:`S3 / R2 / MinIO`}]},{key:`IMAGE_CDN_URL`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN_URL`),ph:`${a()}https://piclist.example.com`,value:``,showIf:t},{key:`IMAGE_CDN_TOKEN`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN`),ph:`${a()}example`,value:``,showIf:n},{key:`S3_REGION`,desc:W(`ADMIN_CONFIG_ITEM_S3_REGION`),ph:`${a()}us-east-1`,value:``,showIf:r},{key:`S3_BUCKET`,desc:W(`ADMIN_CONFIG_ITEM_S3_BUCKET`),ph:`${a()}my-bucket`,value:``,showIf:r},{key:`S3_ACCESS_KEY_ID`,desc:W(`ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID`),ph:`${a()}AKIA****************`,value:``,showIf:r},{key:`S3_SECRET_ACCESS_KEY`,desc:W(`ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY`),ph:`${a()}wJal********************************EKEY`,value:``,secret:!0,showIf:r},{key:`S3_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_S3_ENDPOINT`),ph:`${a()}https://xxx.r2.cloudflarestorage.com`,value:``,showIf:r},{key:`S3_FORCE_PATH_STYLE`,desc:W(`ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE`),ph:`${a()}true`,value:``,showIf:r},{key:`S3_CDN_URL`,desc:W(`ADMIN_CONFIG_ITEM_S3_CDN_URL`),ph:`${a()}https://cdn.example.com`,value:``,showIf:r},{key:`S3_PATH_PREFIX`,desc:W(`ADMIN_CONFIG_ITEM_S3_PATH_PREFIX`),ph:`${a()}images/twikoo`,value:``,showIf:r},{key:`NSFW_API_URL`,desc:W(`ADMIN_CONFIG_ITEM_NSFW_API_URL`),ph:`${a()}https://nsfw.example.com`,value:``},{key:`NSFW_THRESHOLD`,desc:W(`ADMIN_CONFIG_ITEM_NSFW_THRESHOLD`),ph:`${a()}0.5`,value:``},{key:`SHOW_EMOTION`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_EMOTION`),ph:`${a()}false`,value:``},{key:`EMOTION_CDN`,desc:W(`ADMIN_CONFIG_ITEM_EMOTION_CDN`),ph:``,value:``},{key:`HIGHLIGHT`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT`),ph:`${a()}false`,value:``},{key:`HIGHLIGHT_THEME`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME`),ph:`${a()}tomorrow`,value:``},{key:`HIGHLIGHT_PLUGIN`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN`),ph:`${a()}showLanguage`,value:``},{key:`LIGHTBOX`,desc:W(`ADMIN_CONFIG_ITEM_LIGHTBOX`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_PRIVACY`),items:[{key:`SHOW_UA`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_UA`),ph:`${a()}false`,value:``},{key:`SHOW_REGION`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_REGION`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_SPAM`),items:[{key:`AKISMET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_AKISMET_KEY`),ph:`${a()}8651783edxxx`,value:``},{key:`QCLOUD_SECRET_ID`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID`),ph:`${a()}AKI******************************IHw`,value:``},{key:`QCLOUD_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY`),ph:`${a()}Xrk**************************3D7`,value:``,secret:!0},{key:`QCLOUD_CMS_BIZTYPE`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE`),ph:`${a()}1787728329856520192`,value:``},{key:`LIMIT_PER_MINUTE`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE`),ph:`${a()}5`,value:``},{key:`LIMIT_PER_MINUTE_ALL`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL`),ph:`${a()}5`,value:``},{key:`LIMIT_LENGTH`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_LENGTH`),ph:`${a()}100`,value:``},{key:`FORBIDDEN_WORDS`,desc:W(`ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS`),ph:`${a()}快递,空包`,value:``},{key:`BLOCKED_WORDS`,desc:W(`ADMIN_CONFIG_ITEM_BLOCKED_WORDS`),ph:`${a()}快递,空包`,value:``},{key:`NOTIFY_SPAM`,desc:W(`ADMIN_CONFIG_ITEM_NOTIFY_SPAM`),ph:`${a()}false`,value:``},{key:`HIDE_SPAM`,desc:W(`ADMIN_CONFIG_ITEM_HIDE_SPAM`),ph:`${a()}true`,value:``},{key:`JEV_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_JEV_API_KEY`),ph:`your-typesafe-api-key`,value:``,secret:!0},{key:`JEV_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT`),ph:`https://api.typesafe.ai/v1/systemone`,value:``},{key:`JEV_MODEL`,desc:W(`ADMIN_CONFIG_ITEM_JEV_MODEL`),ph:`jev-latest`,value:``},{key:`JEV_SPAM_THRESHOLD`,desc:W(`ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD`),ph:`0.85`,value:``},{key:`LLM_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_LLM_API_KEY`),ph:`sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,value:``,secret:!0},{key:`LLM_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT`),ph:`https://api.deepseek.com/v1`,value:``},{key:`LLM_MODEL`,desc:W(`ADMIN_CONFIG_ITEM_LLM_MODEL`),ph:`deepseek-v4-pro`,value:``},{key:`LLM_REQUEST_EXTRA_JSON`,desc:W(`ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON`),ph:`{"reasoning_effort":"none","temperature":0}`,value:``,type:`textarea`},{key:`LLM_SPAM_PROMPT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT`),ph:``,value:``,type:`textarea`},{key:`LLM_TIMEOUT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_TIMEOUT`),ph:`30000`,value:``},{key:`LLM_MAX_RETRIES`,desc:W(`ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES`),ph:`3`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_CAPTCHA`),items:[{key:`CAPTCHA_PROVIDER`,desc:W(`ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER`),ph:``,value:``,options:[{value:``,label:W(`ADMIN_CONFIG_CAPTCHA_NONE`)},{value:`Turnstile`,label:W(`ADMIN_CONFIG_CAPTCHA_TURNSTILE`)},{value:`Geetest`,label:W(`ADMIN_CONFIG_CAPTCHA_GEETEST`)},{value:`Cap`,label:W(`ADMIN_CONFIG_CAPTCHA_CAP`)}]},{key:`TURNSTILE_SITE_KEY`,desc:W(`ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY`),ph:`${a()}0x4AAAAAAAPLTtpBr_T12345`,value:``,showIf:i(`Turnstile`)},{key:`TURNSTILE_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY`),ph:`${a()}0x4AAAAAAAPLTmBm6gHmOnOqC1iwmU12345`,value:``,secret:!0,showIf:i(`Turnstile`)},{key:`GEETEST_CAPTCHA_ID`,desc:W(`ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID`),ph:`${a()}your_captcha_id`,value:``,showIf:i(`Geetest`)},{key:`GEETEST_CAPTCHA_KEY`,desc:W(`ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY`),ph:`${a()}your_captcha_key`,value:``,secret:!0,showIf:i(`Geetest`)},{key:`CAP_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT`),ph:`${a()}https://cap.example.com/d9256640cb53/(留空=内嵌,无需外部服务)`,value:``,showIf:i(`Cap`)},{key:`CAP_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_CAP_SECRET_KEY`),ph:`${a()}仅外部 Cap 需要;内嵌模式可留空`,value:``,secret:!0,showIf:i(`Cap`)}]},{name:W(`ADMIN_CONFIG_CATEGORY_IM`),items:[{key:`PUSHOO_CHANNEL`,desc:W(`ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL`),ph:`${a()}pushdeer`,value:``},{key:`PUSHOO_TOKEN`,desc:W(`ADMIN_CONFIG_ITEM_PUSHOO_TOKEN`),ph:`${a()}PDU431TfFHZICvR6lJrFBswSRN1cJ*****zzFvR`,value:``},{key:`SC_MAIL_NOTIFY`,desc:W(`ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_MAIL`),items:[{key:`SENDER_EMAIL`,desc:W(`ADMIN_CONFIG_ITEM_SENDER_EMAIL`),ph:`${a()}blog@imaegoo.com`,value:``},{key:`SENDER_NAME`,desc:W(`ADMIN_CONFIG_ITEM_SENDER_NAME`),ph:`${a()}虹墨空间站评论提醒`,value:``},{key:`SMTP_SERVICE`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_SERVICE`),ph:`${a()}QQ`,value:``},{key:`SMTP_HOST`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_HOST`),ph:`${a()}smtp.qq.com`,value:``},{key:`SMTP_PORT`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_PORT`),ph:`${a()}465`,value:``},{key:`SMTP_SECURE`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_SECURE`),ph:`${a()}true`,value:``},{key:`SMTP_USER`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_USER`),ph:`${a()}blog@imaegoo.com`,value:``},{key:`SMTP_PASS`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_PASS`),ph:`${a()}password`,value:``,secret:!0},{key:`MAIL_SUBJECT`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_SUBJECT`),ph:`${a()}您在虹墨空间站上的评论收到了回复`,value:``},{key:`MAIL_TEMPLATE`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_TEMPLATE`),ph:``,value:``,type:`textarea`},{key:`MAIL_SUBJECT_ADMIN`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN`),ph:`${a()}虹墨空间站上有新评论了`,value:``},{key:`MAIL_TEMPLATE_ADMIN`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN`),ph:``,value:``,type:`textarea`}]}]}let s=cm(o()),c=q(!0),l=cm({}),u=q(``),d=wo,f=q(``),p=q(``),m=q(``);async function h(){c.value=!0;try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`));return e&&!e.code&&e.config&&(Object.assign(l,e.config),u.value=String(e.config.VERSION??``),l.CAPTCHA_PROVIDER===void 0&&(l.TURNSTILE_SITE_KEY?l.CAPTCHA_PROVIDER=`Turnstile`:l.GEETEST_CAPTCHA_ID&&(l.CAPTCHA_PROVIDER=`Geetest`)),l.IMAGE_CDN===void 0&&(l.IMAGE_CDN=``),g()),!0}catch(e){return f.value=jo(e),!1}finally{c.value=!1}}function g(){for(let e of s)for(let t of e.items){let e=l[t.key];t.value=e===void 0?``:String(e)}}function _(e){return typeof e.showIf!=`function`||e.showIf(e=>{for(let t of s){let n=t.items.find(t=>t.key===e);if(n)return n.value}return``})}async function v(){c.value=!0,f.value=`正在保存`;let e={};for(let t of s)for(let n of t.items){let t=l[n.key];String(t??``)!==n.value&&(e[n.key]=n.value)}e.IMAGE_CDN!==void 0&&(e.SHOW_IMAGE=e.IMAGE_CDN?`true`:`false`),zo.info(`保存配置`,e);try{if(Ao(await Lo(Po().tcb,`SET_CONFIG`,{config:e})),!await h())return;Wy(zy),f.value=`保存成功`}catch(e){f.value=jo(e)}finally{c.value=!1}}async function y(){c.value=!0;try{let e=await Lo(Po().tcb,`EMAIL_TEST`,{mail:p.value});Ao(e),zo.info(`邮件测试`,e),m.value=JSON.stringify(e)}catch(e){m.value=jo(e)}finally{c.value=!1}}function b(){h()}return Ph(()=>{h(),Hy(zy,b)}),Rh(()=>{Uy(zy,b)}),(e,t)=>rh((Y(),X(`div`,Lx,[J(d)===u.value?$(`v-if`,!0):(Y(),X(`div`,Rx,[Z(`span`,null,K(J(W)(`ADMIN_CLIENT_VERSION`))+K(J(d))+`,`,1),Z(`span`,null,K(J(W)(`ADMIN_SERVER_VERSION`))+K(u.value)+`,`,1),$(`
247
+ `),$(` prettier-ignore `),t[4]||=Z(`span`,null,[A_(`请参考\xA0`),Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},`版本更新`),A_(`\xA0进行升级`)],-1)])),Z(`div`,_x,[Q(Ly,{modelValue:u.keyword,"onUpdate:modelValue":t[0]||=e=>u.keyword=e,class:`tk-admin-comment-filter-keyword`,size:`small`,placeholder:J(W)(`ADMIN_COMMENT_SEARCH_PLACEHOLDER`),onKeyup:iy(b,[`enter`])},null,8,[`modelValue`,`placeholder`]),rh(Z(`select`,{"onUpdate:modelValue":t[1]||=e=>u.type=e,class:`tk-admin-comment-filter-type`},[Z(`option`,vx,K(J(W)(`ADMIN_COMMENT_FILTER_ALL`)),1),Z(`option`,yx,K(J(W)(`ADMIN_COMMENT_FILTER_VISIBLE`)),1),Z(`option`,bx,K(J(W)(`ADMIN_COMMENT_FILTER_HIDDEN`)),1)],512),[[Xv,u.type]]),Q(Yy,{size:`small`,type:`primary`,onClick:b},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_SEARCH`)),1)]),_:1})]),Z(`div`,{ref_key:`commentListRef`,ref:f,class:`tk-admin-comment-list`},[(Y(!0),X(f_,null,Jh(r.value,e=>(Y(),X(`div`,{key:e._id,class:`tk-admin-comment-item`},[Z(`div`,xx,[Q(Ay,{config:i,avatar:e.avatar,nick:e.nick,mail:e.mail,link:e.link},null,8,[`config`,`avatar`,`nick`,`mail`,`link`]),e.link?$(`v-if`,!0):(Y(),X(`span`,Sx,K(e.nick)+`\xA0`,1)),e.link?(Y(),X(`a`,{key:1,href:J(Ed)(e.link),target:`_blank`,rel:`noopener noreferrer`},K(e.nick)+`\xA0 `,9,Cx)):$(`v-if`,!0),e.mail?(Y(),X(`span`,Tx,[t[5]||=A_(` (`,-1),Z(`a`,{href:`mailto:${e.mail}`},K(e.mail),9,Ex),t[6]||=A_(`)\xA0 `,-1)])):$(`v-if`,!0),e.isSpam?(Y(),X(`span`,Dx,K(J(W)(`ADMIN_COMMENT_IS_SPAM_SUFFIX`))+`\xA0`,1)):$(`v-if`,!0),Z(`span`,Ox,K(v(e))+`\xA0`,1),Z(`span`,{title:e.ua},K(e.ipRegion),9,kx)]),$(` 管理端正文:服务端已消毒,客户端再走一次 sanitizeHtml 双保险 `),$(` eslint-disable-next-line vue/no-v-html `),Z(`div`,{class:`tk-content`,onClick:y,innerHTML:e.comment},null,8,Ax),d.value&&d.value.commentId===e._id?(Y(),X(`div`,jx,[Z(`a`,{class:`tk-admin-close`,href:`#`,onClick:t[2]||=ny(e=>d.value=null,[`prevent`])},[Q(py,{name:`times`})]),Z(`div`,Mx,K(d.value.message),1),d.value.url?(Y(),X(`div`,Nx,[Z(`code`,null,K(d.value.url),1)])):$(`v-if`,!0)])):$(`v-if`,!0),Z(`div`,Px,[Q(Yy,{size:`mini`,type:`text`,onClick:t=>T(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_VIEW`)),1)]),_:1},8,[`onClick`]),e.isSpam?(Y(),S_(Yy,{key:0,size:`mini`,type:`text`,onClick:t=>ne(e,!1)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_SHOW`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),e.isSpam?$(`v-if`,!0):(Y(),S_(Yy,{key:1,size:`mini`,type:`text`,onClick:t=>ne(e,!0)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_HIDE`)),1)]),_:1},8,[`onClick`])),!e.rid&&e.top?(Y(),S_(Yy,{key:2,size:`mini`,type:`text`,onClick:t=>re(e,!1)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_UNTOP`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),!e.rid&&!e.top?(Y(),S_(Yy,{key:3,size:`mini`,type:`text`,onClick:t=>re(e,!0)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_TOP`)),1)]),_:1},8,[`onClick`])):$(`v-if`,!0),Q(Yy,{size:`mini`,type:`text`,onClick:t=>D(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_EDIT`)),1)]),_:1},8,[`onClick`]),Q(Yy,{size:`mini`,type:`text`,onClick:t=>A(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_DELETE`)),1)]),_:1},8,[`onClick`])]),p.value===e._id?(Y(),X(`div`,{key:1,class:`tk-admin-comment-editor`,onKeyup:t=>O(t,e)},[Q(Ly,{ref_for:!0,ref_key:`editorInputRef`,ref:g,modelValue:m.value,"onUpdate:modelValue":t[3]||=e=>m.value=e,class:`tk-admin-comment-editor-input`,type:`textarea`,rows:2,autosize:``},null,8,[`modelValue`]),Z(`div`,Ix,[Q(Yy,{size:`mini`,type:`text`,disabled:_.value,onClick:te},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_EDIT_CANCEL`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`mini`,type:`primary`,loading:_.value,onClick:t=>k(e)},{default:nh(()=>[A_(K(J(W)(`ADMIN_COMMENT_EDIT_SAVE`)),1)]),_:1},8,[`loading`,`onClick`])])],40,Fx)):$(`v-if`,!0)]))),128))],512),Q(mx,{"page-size":c.value,total:s.value,onPageSizeChange:C,onCurrentChange:w},null,8,[`page-size`,`total`])])),[[J(vd),n.value]])}}),zx={class:`tk-admin-config`},Bx={key:0,class:`tk-admin-warn`},Vx={class:`tk-admin-config-groups`},Hx={class:`tk-admin-config-group-title`},Ux=[`title`],Wx={class:`tk-admin-config-input`},Gx=[`onUpdate:modelValue`],Kx=[`value`],qx={class:`tk-admin-config-desc`},Jx={class:`tk-admin-config-group`},Yx={class:`tk-admin-config-group-title`},Xx={class:`tk-admin-config-email-test`},Zx={class:`tk-admin-config-email-test-desc`},Qx={class:`tk-admin-config-input`},$x={class:`tk-admin-config-email-test-desc`},eS={class:`tk-admin-config-actions`},tS={class:`tk-admin-config-message`},nS=yh({__name:`TkAdminConfig`,setup(e){function t(e){return ol.includes(e(`IMAGE_CDN`))}function n(e){return!!e(`IMAGE_CDN`)&&e(`IMAGE_CDN`)!==`s3`}function r(e){return e(`IMAGE_CDN`)===`s3`}function i(e){return t=>t(`CAPTCHA_PROVIDER`)===e}let a=()=>W(`ADMIN_CONFIG_EXAMPLE`);function o(){return[{name:W(`ADMIN_CONFIG_CATEGORY_COMMON`),items:[{key:`SITE_NAME`,desc:W(`ADMIN_CONFIG_ITEM_SITE_NAME`),ph:`${a()}虹墨空间站`,value:``},{key:`SITE_URL`,desc:W(`ADMIN_CONFIG_ITEM_SITE_URL`),ph:`${a()}https://www.imaegoo.com`,value:``},{key:`CORS_ALLOW_ORIGIN`,desc:W(`ADMIN_CONFIG_ITEM_CORS_ALLOW_ORIGIN`),ph:`${a()}https://www.imaegoo.com`,value:``},{key:`BLOGGER_NICK`,desc:W(`ADMIN_CONFIG_ITEM_BLOGGER_NICK`),ph:`${a()}iMaeGoo`,value:``},{key:`BLOGGER_EMAIL`,desc:W(`ADMIN_CONFIG_ITEM_BLOGGER_EMAIL`),ph:`${a()}12345@qq.com`,value:``},{key:`COMMENT_PAGE_SIZE`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_PAGE_SIZE`),ph:`${a()}8`,value:``},{key:`MASTER_TAG`,desc:W(`ADMIN_CONFIG_ITEM_MASTER_TAG`),ph:`${a()}站长`,value:``},{key:`COMMENT_BG_IMG`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_BG_IMG`),ph:``,value:``},{key:`GRAVATAR_CDN`,desc:W(`ADMIN_CONFIG_ITEM_GRAVATAR_CDN`),ph:`${a()}sdn.geekzu.org`,value:``},{key:`DEFAULT_GRAVATAR`,desc:W(`ADMIN_CONFIG_ITEM_DEFAULT_GRAVATAR`),ph:`${a()}mp`,value:``},{key:`COMMENT_PLACEHOLDER`,desc:W(`ADMIN_CONFIG_ITEM_COMMENT_PLACEHOLDER`),ph:`${a()}`,value:``},{key:`SHOW_ORDER`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_ORDER`),ph:`${a()}true`,value:``},{key:`SHOW_DISLIKE`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_DISLIKE`),ph:`${a()}true`,value:``},{key:`DISPLAYED_FIELDS`,desc:W(`ADMIN_CONFIG_ITEM_DISPLAYED_FIELDS`),ph:`${a()}nick,mail,link`,value:``},{key:`REQUIRED_FIELDS`,desc:W(`ADMIN_CONFIG_ITEM_REQUIRED_FIELDS`),ph:`${a()}nick,mail,link`,value:``},{key:`HIDE_ADMIN_CRYPT`,desc:W(`ADMIN_CONFIG_ITEM_HIDE_ADMIN_CRYPT`),ph:`${a()}admin`,value:``},{key:`QQ_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_QQ_API_KEY`),ph:`${a()}your_api_key`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_PLUGIN`),items:[{key:`IMAGE_CDN`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN`),ph:``,value:``,options:[{value:``,label:W(`ADMIN_CONFIG_IMAGE_CDN_NONE`)},{value:`qcloud`,label:`qcloud`},{value:`7bu`,label:`7bu (https://7bu.top)`},{value:`see`,label:`see (https://s.ee)`},{value:`lskypro`,label:`lskypro`},{value:`piclist`,label:`piclist`},{value:`easyimage`,label:`easyimage`},{value:`chevereto`,label:`chevereto`},{value:`s3`,label:`S3 / R2 / MinIO`}]},{key:`IMAGE_CDN_URL`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN_URL`),ph:`${a()}https://piclist.example.com`,value:``,showIf:t},{key:`IMAGE_CDN_TOKEN`,desc:W(`ADMIN_CONFIG_ITEM_IMAGE_CDN_TOKEN`),ph:`${a()}example`,value:``,showIf:n},{key:`S3_REGION`,desc:W(`ADMIN_CONFIG_ITEM_S3_REGION`),ph:`${a()}us-east-1`,value:``,showIf:r},{key:`S3_BUCKET`,desc:W(`ADMIN_CONFIG_ITEM_S3_BUCKET`),ph:`${a()}my-bucket`,value:``,showIf:r},{key:`S3_ACCESS_KEY_ID`,desc:W(`ADMIN_CONFIG_ITEM_S3_ACCESS_KEY_ID`),ph:`${a()}AKIA****************`,value:``,showIf:r},{key:`S3_SECRET_ACCESS_KEY`,desc:W(`ADMIN_CONFIG_ITEM_S3_SECRET_ACCESS_KEY`),ph:`${a()}wJal********************************EKEY`,value:``,secret:!0,showIf:r},{key:`S3_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_S3_ENDPOINT`),ph:`${a()}https://xxx.r2.cloudflarestorage.com`,value:``,showIf:r},{key:`S3_FORCE_PATH_STYLE`,desc:W(`ADMIN_CONFIG_ITEM_S3_FORCE_PATH_STYLE`),ph:`${a()}true`,value:``,showIf:r},{key:`S3_CDN_URL`,desc:W(`ADMIN_CONFIG_ITEM_S3_CDN_URL`),ph:`${a()}https://cdn.example.com`,value:``,showIf:r},{key:`S3_PATH_PREFIX`,desc:W(`ADMIN_CONFIG_ITEM_S3_PATH_PREFIX`),ph:`${a()}images/twikoo`,value:``,showIf:r},{key:`NSFW_API_URL`,desc:W(`ADMIN_CONFIG_ITEM_NSFW_API_URL`),ph:`${a()}https://nsfw.example.com`,value:``},{key:`NSFW_THRESHOLD`,desc:W(`ADMIN_CONFIG_ITEM_NSFW_THRESHOLD`),ph:`${a()}0.5`,value:``},{key:`SHOW_EMOTION`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_EMOTION`),ph:`${a()}false`,value:``},{key:`EMOTION_CDN`,desc:W(`ADMIN_CONFIG_ITEM_EMOTION_CDN`),ph:``,value:``},{key:`HIGHLIGHT`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT`),ph:`${a()}false`,value:``},{key:`HIGHLIGHT_THEME`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT_THEME`),ph:`${a()}tomorrow`,value:``},{key:`HIGHLIGHT_PLUGIN`,desc:W(`ADMIN_CONFIG_ITEM_HIGHLIGHT_PLUGIN`),ph:`${a()}showLanguage`,value:``},{key:`LIGHTBOX`,desc:W(`ADMIN_CONFIG_ITEM_LIGHTBOX`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_PRIVACY`),items:[{key:`SHOW_UA`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_UA`),ph:`${a()}false`,value:``},{key:`SHOW_REGION`,desc:W(`ADMIN_CONFIG_ITEM_SHOW_REGION`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_SPAM`),items:[{key:`AKISMET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_AKISMET_KEY`),ph:`${a()}8651783edxxx`,value:``},{key:`QCLOUD_SECRET_ID`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_SECRET_ID`),ph:`${a()}AKI******************************IHw`,value:``},{key:`QCLOUD_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_SECRET_KEY`),ph:`${a()}Xrk**************************3D7`,value:``,secret:!0},{key:`QCLOUD_CMS_BIZTYPE`,desc:W(`ADMIN_CONFIG_ITEM_QCLOUD_CMS_BIZTYPE`),ph:`${a()}1787728329856520192`,value:``},{key:`LIMIT_PER_MINUTE`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE`),ph:`${a()}5`,value:``},{key:`LIMIT_PER_MINUTE_ALL`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_PER_MINUTE_ALL`),ph:`${a()}5`,value:``},{key:`LIMIT_LENGTH`,desc:W(`ADMIN_CONFIG_ITEM_LIMIT_LENGTH`),ph:`${a()}100`,value:``},{key:`FORBIDDEN_WORDS`,desc:W(`ADMIN_CONFIG_ITEM_FORBIDDEN_WORDS`),ph:`${a()}快递,空包`,value:``},{key:`BLOCKED_WORDS`,desc:W(`ADMIN_CONFIG_ITEM_BLOCKED_WORDS`),ph:`${a()}快递,空包`,value:``},{key:`NOTIFY_SPAM`,desc:W(`ADMIN_CONFIG_ITEM_NOTIFY_SPAM`),ph:`${a()}false`,value:``},{key:`HIDE_SPAM`,desc:W(`ADMIN_CONFIG_ITEM_HIDE_SPAM`),ph:`${a()}true`,value:``},{key:`JEV_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_JEV_API_KEY`),ph:`your-typesafe-api-key`,value:``,secret:!0},{key:`JEV_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_JEV_API_ENDPOINT`),ph:`https://api.typesafe.ai/v1/systemone`,value:``},{key:`JEV_MODEL`,desc:W(`ADMIN_CONFIG_ITEM_JEV_MODEL`),ph:`jev-latest`,value:``},{key:`JEV_SPAM_THRESHOLD`,desc:W(`ADMIN_CONFIG_ITEM_JEV_SPAM_THRESHOLD`),ph:`0.85`,value:``},{key:`LLM_API_KEY`,desc:W(`ADMIN_CONFIG_ITEM_LLM_API_KEY`),ph:`sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`,value:``,secret:!0},{key:`LLM_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_API_ENDPOINT`),ph:`https://api.deepseek.com/v1`,value:``},{key:`LLM_MODEL`,desc:W(`ADMIN_CONFIG_ITEM_LLM_MODEL`),ph:`deepseek-v4-pro`,value:``},{key:`LLM_REQUEST_EXTRA_JSON`,desc:W(`ADMIN_CONFIG_ITEM_LLM_REQUEST_EXTRA_JSON`),ph:`{"reasoning_effort":"none","temperature":0}`,value:``,type:`textarea`},{key:`LLM_SPAM_PROMPT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_SPAM_PROMPT`),ph:``,value:``,type:`textarea`},{key:`LLM_TIMEOUT`,desc:W(`ADMIN_CONFIG_ITEM_LLM_TIMEOUT`),ph:`30000`,value:``},{key:`LLM_MAX_RETRIES`,desc:W(`ADMIN_CONFIG_ITEM_LLM_MAX_RETRIES`),ph:`3`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_CAPTCHA`),items:[{key:`CAPTCHA_PROVIDER`,desc:W(`ADMIN_CONFIG_ITEM_CAPTCHA_PROVIDER`),ph:``,value:``,options:[{value:``,label:W(`ADMIN_CONFIG_CAPTCHA_NONE`)},{value:`Turnstile`,label:W(`ADMIN_CONFIG_CAPTCHA_TURNSTILE`)},{value:`Geetest`,label:W(`ADMIN_CONFIG_CAPTCHA_GEETEST`)},{value:`Cap`,label:W(`ADMIN_CONFIG_CAPTCHA_CAP`)}]},{key:`TURNSTILE_SITE_KEY`,desc:W(`ADMIN_CONFIG_ITEM_TURNSTILE_SITE_KEY`),ph:`${a()}0x4AAAAAAAPLTtpBr_T12345`,value:``,showIf:i(`Turnstile`)},{key:`TURNSTILE_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_TURNSTILE_SECRET_KEY`),ph:`${a()}0x4AAAAAAAPLTmBm6gHmOnOqC1iwmU12345`,value:``,secret:!0,showIf:i(`Turnstile`)},{key:`GEETEST_CAPTCHA_ID`,desc:W(`ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_ID`),ph:`${a()}your_captcha_id`,value:``,showIf:i(`Geetest`)},{key:`GEETEST_CAPTCHA_KEY`,desc:W(`ADMIN_CONFIG_ITEM_GEETEST_CAPTCHA_KEY`),ph:`${a()}your_captcha_key`,value:``,secret:!0,showIf:i(`Geetest`)},{key:`CAP_API_ENDPOINT`,desc:W(`ADMIN_CONFIG_ITEM_CAP_API_ENDPOINT`),ph:`${a()}https://cap.example.com/d9256640cb53/(留空=内嵌,无需外部服务)`,value:``,showIf:i(`Cap`)},{key:`CAP_SECRET_KEY`,desc:W(`ADMIN_CONFIG_ITEM_CAP_SECRET_KEY`),ph:`${a()}仅外部 Cap 需要;内嵌模式可留空`,value:``,secret:!0,showIf:i(`Cap`)}]},{name:W(`ADMIN_CONFIG_CATEGORY_IM`),items:[{key:`PUSHOO_CHANNEL`,desc:W(`ADMIN_CONFIG_ITEM_PUSHOO_CHANNEL`),ph:`${a()}pushdeer`,value:``},{key:`PUSHOO_TOKEN`,desc:W(`ADMIN_CONFIG_ITEM_PUSHOO_TOKEN`),ph:`${a()}PDU431TfFHZICvR6lJrFBswSRN1cJ*****zzFvR`,value:``},{key:`SC_MAIL_NOTIFY`,desc:W(`ADMIN_CONFIG_ITEM_SC_MAIL_NOTIFY`),ph:`${a()}true`,value:``}]},{name:W(`ADMIN_CONFIG_CATEGORY_MAIL`),items:[{key:`SENDER_EMAIL`,desc:W(`ADMIN_CONFIG_ITEM_SENDER_EMAIL`),ph:`${a()}blog@imaegoo.com`,value:``},{key:`SENDER_NAME`,desc:W(`ADMIN_CONFIG_ITEM_SENDER_NAME`),ph:`${a()}虹墨空间站评论提醒`,value:``},{key:`SMTP_SERVICE`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_SERVICE`),ph:`${a()}QQ`,value:``},{key:`SMTP_HOST`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_HOST`),ph:`${a()}smtp.qq.com`,value:``},{key:`SMTP_PORT`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_PORT`),ph:`${a()}465`,value:``},{key:`SMTP_SECURE`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_SECURE`),ph:`${a()}true`,value:``},{key:`SMTP_USER`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_USER`),ph:`${a()}blog@imaegoo.com`,value:``},{key:`SMTP_PASS`,desc:W(`ADMIN_CONFIG_ITEM_SMTP_PASS`),ph:`${a()}password`,value:``,secret:!0},{key:`MAIL_SUBJECT`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_SUBJECT`),ph:`${a()}您在虹墨空间站上的评论收到了回复`,value:``},{key:`MAIL_TEMPLATE`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_TEMPLATE`),ph:``,value:``,type:`textarea`},{key:`MAIL_SUBJECT_ADMIN`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_SUBJECT_ADMIN`),ph:`${a()}虹墨空间站上有新评论了`,value:``},{key:`MAIL_TEMPLATE_ADMIN`,desc:W(`ADMIN_CONFIG_ITEM_MAIL_TEMPLATE_ADMIN`),ph:``,value:``,type:`textarea`}]}]}let s=cm(o()),c=q(!0),l=cm({}),u=q(``),d=wo,f=q(``),p=q(``),m=q(``);async function h(){c.value=!0;try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`));return e&&!e.code&&e.config&&(Object.assign(l,e.config),u.value=String(e.config.VERSION??``),l.CAPTCHA_PROVIDER===void 0&&(l.TURNSTILE_SITE_KEY?l.CAPTCHA_PROVIDER=`Turnstile`:l.GEETEST_CAPTCHA_ID&&(l.CAPTCHA_PROVIDER=`Geetest`)),l.IMAGE_CDN===void 0&&(l.IMAGE_CDN=``),g()),!0}catch(e){return f.value=jo(e),!1}finally{c.value=!1}}function g(){for(let e of s)for(let t of e.items){let e=l[t.key];t.value=e===void 0?``:String(e)}}function _(e){return typeof e.showIf!=`function`||e.showIf(e=>{for(let t of s){let n=t.items.find(t=>t.key===e);if(n)return n.value}return``})}async function v(){c.value=!0,f.value=`正在保存`;let e={};for(let t of s)for(let n of t.items){let t=l[n.key];String(t??``)!==n.value&&(e[n.key]=n.value)}e.IMAGE_CDN!==void 0&&(e.SHOW_IMAGE=e.IMAGE_CDN?`true`:`false`),zo.info(`保存配置`,e);try{if(Ao(await Lo(Po().tcb,`SET_CONFIG`,{config:e})),!await h())return;Wy(zy),f.value=`保存成功`}catch(e){f.value=jo(e)}finally{c.value=!1}}async function y(){c.value=!0;try{let e=await Lo(Po().tcb,`EMAIL_TEST`,{mail:p.value});Ao(e),zo.info(`邮件测试`,e),m.value=JSON.stringify(e)}catch(e){m.value=jo(e)}finally{c.value=!1}}function b(){h()}return Ph(()=>{h(),Hy(zy,b)}),Rh(()=>{Uy(zy,b)}),(e,t)=>rh((Y(),X(`div`,zx,[J(d)===u.value?$(`v-if`,!0):(Y(),X(`div`,Bx,[Z(`span`,null,K(J(W)(`ADMIN_CLIENT_VERSION`))+K(J(d))+`,`,1),Z(`span`,null,K(J(W)(`ADMIN_SERVER_VERSION`))+K(u.value)+`,`,1),$(`
248
248
  用 prettier-ignore 保持单行:这一段的换行/缩进空白会被 Vue 3 的 condense 折叠成
249
249
  一个空格(Vue 2 保留、HTML 同样折叠),与两侧的 &nbsp; 叠加后会让「版本更新」
250
250
  链接左右各宽约一个空格,而 1.x 只有 &nbsp;。所以必须让 &nbsp; 与 <a> 紧贴。
251
- `),$(` prettier-ignore `),t[1]||=Z(`span`,null,[A_(`请参考\xA0`),Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},`版本更新`),A_(`\xA0进行升级`)],-1)])),Z(`form`,{onSubmit:ny(v,[`prevent`])},[Z(`div`,zx,[(Y(!0),X(f_,null,Jh(s,e=>(Y(),X(`details`,{key:e.name,class:`tk-admin-config-group`},[Z(`summary`,Bx,K(e.name),1),(Y(!0),X(f_,null,Jh(e.items,e=>rh((Y(),X(`div`,{key:e.key,class:`tk-admin-config-item`},[Z(`div`,{class:`tk-admin-config-title`,title:e.key},K(e.key),9,Vx),Z(`div`,Hx,[e.options?rh((Y(),X(`select`,{key:0,"onUpdate:modelValue":t=>e.value=t,class:`tk-admin-config-select`},[(Y(!0),X(f_,null,Jh(e.options,e=>(Y(),X(`option`,{key:e.value,value:e.value},K(e.label),9,Wx))),128))],8,Ux)),[[Xv,e.value]]):e.type===`textarea`?(Y(),S_(Ly,{key:1,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,type:`textarea`,rows:5,size:`small`,placeholder:e.ph},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(Y(),S_(Ly,{key:2,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,type:e.secret?`password`:`text`,size:`small`,placeholder:e.ph},null,8,[`modelValue`,`onUpdate:modelValue`,`type`,`placeholder`]))]),t[2]||=Z(`div`,null,null,-1),Z(`div`,Gx,K(e.desc),1)])),[[yv,_(e)]])),128))]))),128)),Z(`details`,Kx,[Z(`summary`,qx,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST`)),1),Z(`div`,Jx,[Z(`div`,Yx,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_HELP`)),1),Z(`div`,Xx,[Q(Ly,{modelValue:p.value,"onUpdate:modelValue":t[0]||=e=>p.value=e,size:`small`},{append:nh(()=>[Q(Yy,{type:`info`,onClick:y},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_BTN`)),1)]),_:1})]),_:1},8,[`modelValue`])]),Z(`div`,Zx,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_RESULT`))+K(m.value),1)])])]),Z(`div`,Qx,[Q(Yy,{size:`small`,type:`primary`,"native-type":`submit`},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_SAVE`)),1)]),_:1}),Q(Yy,{size:`small`,type:`info`,onClick:g},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_RESET`)),1)]),_:1})])],32),Z(`div`,$x,K(f.value),1)])),[[J(vd),c.value]])}}),tS={class:`tk-admin-import`},nS={class:`tk-admin-warn tk-admin-import-warn`},rS={class:`tk-admin-import-label`},iS={disabled:``,value:``},aS={class:`tk-admin-import-label`},oS={class:`tk-admin-import-actions`},sS=yh({__name:`TkAdminImport`,setup(e){let t=q(!1),n=q(``),r=q(``),i=cm({valine:W(`ADMIN_IMPORT_TIP_VALINE`),disqus:W(`ADMIN_IMPORT_TIP_DISQUS`),artalk:W(`ADMIN_IMPORT_TIP_ARTALK`),artalk2:``,twikoo:``}),a=q(),o=q();function s(e){r.value+=`${new Date().toLocaleString()} ${e}\n`,Wm(()=>{let e=o.value?.inputEl;e&&(e.scrollTop=e.scrollHeight)})}async function c(){if(!n.value){s(W(`ADMIN_IMPORT_SOURCE_REQUIRED`));return}let e=a.value?.files?.[0];if(!e)s(W(`ADMIN_IMPORT_FILE_REQUIRED`));else{s(W(`ADMIN_IMPORT_START`)),t.value=!0;try{let t=Po().tcb;if(t){let n=await t.app.uploadFile({cloudPath:`import/${Date.now()}`,filePath:e,onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);s(`${W(`ADMIN_IMPORT_UPLOADING`)}${t}%`)}});s(`${W(`ADMIN_IMPORT_UPLOADED`)}${n.fileID}`),await l(String(n.fileID))}else await u(e)}catch(e){console.error(e),s(jo(e))}finally{t.value=!1}}}async function l(e){s(`${W(`ADMIN_IMPORT_IMPORTING`)}${n.value}`);let t=Ao(await Lo(Po().tcb,`COMMENT_IMPORT_FOR_ADMIN`,{fileId:e,source:n.value}));r.value+=t.log??``,s(`${W(`ADMIN_IMPORT_IMPORTED`)}${n.value}`)}async function u(e){s(`${W(`ADMIN_IMPORT_IMPORTING`)}${n.value}`);let t=Ao(await Lo(Po().tcb,`COMMENT_IMPORT_FOR_ADMIN`,{file:await Rd(e),source:n.value}));r.value+=t.log??``,s(`${W(`ADMIN_IMPORT_IMPORTED`)}${n.value}`)}function d(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:Object.values(e).every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)}async function f(){if(n.value!==`twikoo`){s(W(`ADMIN_CONFIG_IMPORT_SOURCE_INVALID`));return}let e=a.value?.files?.[0];if(!e){s(W(`ADMIN_IMPORT_FILE_REQUIRED`));return}t.value=!0;let r=!1;try{let t=JSON.parse(await Rd(e));if(!d(t)){s(W(`ADMIN_CONFIG_IMPORT_INVALID`));return}let n={...t};delete n.CREDENTIALS,s(W(`ADMIN_CONFIG_IMPORTING`)),r=!0;let i=Ao(await Lo(Po().tcb,`SET_CONFIG`,{config:n}));if(i.code===0)Wy(zy),s(W(`ADMIN_CONFIG_IMPORTED`));else{let e=typeof i.message==`string`?i.message:``;s(`${W(`ADMIN_CONFIG_IMPORT_FAILED`)}${e}`)}}catch(e){console.error(e),s(`${W(`ADMIN_CONFIG_IMPORT_FAILED`)}${jo(e)}`),r&&!(e instanceof ko)&&Wy(zy)}finally{t.value=!1}}return(e,s)=>(Y(),X(`div`,tS,[Z(`div`,nS,[Z(`p`,null,K(J(W)(`ADMIN_IMPORT_WARN`)),1),Z(`p`,null,K(i[n.value]),1)]),Z(`div`,rS,K(J(W)(`ADMIN_IMPORT_SELECT_SOURCE`)),1),rh(Z(`select`,{"onUpdate:modelValue":s[0]||=e=>n.value=e},[Z(`option`,iS,K(J(W)(`ADMIN_IMPORT_SELECT`)),1),s[2]||=j_(`<option value="valine">Valine (JSON)</option><option value="disqus">Disqus (XML)</option><option value="artalk">Artalk v1 (JSON)</option><option value="artalk2">Artalk v2 (Artrans)</option><option value="twikoo">Twikoo (JSON)</option>`,5)],512),[[Xv,n.value]]),Z(`div`,aS,K(J(W)(`ADMIN_IMPORT_SELECT_FILE`)),1),Z(`input`,{ref_key:`inputFileRef`,ref:a,type:`file`,value:``},null,512),Z(`div`,oS,[Q(Yy,{size:`small`,disabled:t.value,onClick:c},{default:nh(()=>[A_(K(J(W)(`ADMIN_IMPORT_COMMENT`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:f},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_IMPORT`)),1)]),_:1},8,[`disabled`])]),Q(Ly,{ref_key:`logTextAreaRef`,ref:o,modelValue:r.value,"onUpdate:modelValue":s[1]||=e=>r.value=e,type:`textarea`,rows:10,readonly:``,placeholder:J(W)(`ADMIN_IMPORT_LOG`)},null,8,[`modelValue`,`placeholder`])]))}}),cS={class:`tk-admin-export`},lS={class:`tk-admin-warn tk-admin-import-warn`},uS=yh({__name:`TkAdminExport`,setup(e){let t=q(!1);async function n(e){t.value=!0;try{let t=Ao(await Lo(Po().tcb,`COMMENT_EXPORT_FOR_ADMIN`,{collection:e}));t.data&&i(`twikoo-${e}.json`,t.data)}catch(e){alert(jo(e))}finally{t.value=!1}}async function r(){t.value=!0;try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`,{}));if(!e.config)return;let t={...e.config};delete t.VERSION,i(`twikoo-config-${new Date().toISOString().slice(0,10)}.json`,t)}catch(e){alert(jo(e))}finally{t.value=!1}}function i(e,t){let n=t instanceof Object?JSON.stringify(t,null,2):String(t),r=new Blob([n]),i=document.createElementNS(`http://www.w3.org/1999/xhtml`,`a`);i.href=URL.createObjectURL(r),i.download=e,i.click()}return(e,i)=>(Y(),X(`div`,cS,[Z(`div`,lS,[Z(`p`,null,K(J(W)(`ADMIN_EXPORT_WARN`)),1)]),Q(Yy,{size:`small`,disabled:t.value,onClick:i[0]||=e=>n(`comment`)},{default:nh(()=>[A_(K(J(W)(`ADMIN_EXPORT_COMMENT`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:i[1]||=e=>n(`counter`)},{default:nh(()=>[A_(K(J(W)(`ADMIN_EXPORT_COUNTER`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:r},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_EXPORT`)),1)]),_:1},8,[`disabled`])]))}}),dS={class:`tk-admin-container`},fS={key:0,class:`tk-login-title`},pS={key:1},mS={key:0,class:`tk-login`},hS={class:`tk-login-title`},gS={key:0,class:`tk-login-msg`},_S={href:`https://twikoo.js.org/faq.html`,rel:`noopener noreferrer`,target:`_blank`},vS={key:1,class:`tk-regist`},yS={class:`tk-login-title`},bS={key:0,class:`tk-login-msg`},xS={key:1,class:`tk-login-msg`},SS={href:`https://twikoo.js.org/faq.html`,rel:`noopener noreferrer`,target:`_blank`},CS={key:2,class:`tk-panel`},wS={class:`tk-panel-title`},TS={class:`tk-tabs`},ES=yh({__name:`TkAdmin`,props:{show:{type:Boolean,default:!1}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=q(!0),a=q(``),o=q(!1),s=q(!1),c=q(!0),l=q(!1),u=q(``),d=q(``),f=q(``),p=q(``),m=q(`comment`),h=q(),g=av(()=>!c.value&&!!d.value&&d.value===f.value&&(l.value||!!u.value));async function _(){if(!d.value)p.value=W(`ADMIN_PASSWORD_REQUIRED`);else{i.value=!0,p.value=``;try{let e=(0,Hc.default)(d.value),t=Po().tcb,n=Ao(await Lo(t,`LOGIN`,{password:e}));n.message?p.value=n.message:n.ticket?(await t?.auth?.customAuthProvider().signIn(n.ticket),zo.info(`登录成功`),d.value=``,await S()):n.code===0&&(zo.info(`登录成功`),localStorage.setItem(`twikoo-access-token`,e),d.value=``,await S())}catch(e){p.value=jo(e)}finally{i.value=!1}}}async function v(e){e.preventDefault(),i.value=!0;try{let e=Po().tcb;e?.auth?(await e.auth.signOut(),s.value=!1,await e.auth.anonymousAuthProvider().signIn()):localStorage.removeItem(`twikoo-access-token`),s.value=!1}catch(e){alert(jo(e))}finally{i.value=!1}}async function y(){i.value=!0;try{let e=(0,Hc.default)(d.value);Ao(await Lo(Po().tcb,`SET_PASSWORD`,{password:e,credentials:u.value})),c.value=!0,await _()}catch(e){if(p.value=jo(e),!(e instanceof ko))try{await C()}catch(e){zo.warn(`重新检查密码状态失败`,e)}}finally{i.value=!1}}async function b(){i.value=!0;try{await S(),s.value||(await C(),x())}catch(e){p.value=jo(e)}finally{i.value=!1}}function x(){setTimeout(()=>h.value?.focus(),500)}async function S(){let e=Po().tcb;if(e?.auth){let t=await e.auth.getCurrentUser();s.value=t.loginType===`CUSTOM`}else{let t=Ao(await Lo(e,`GET_CONFIG`));s.value=t?.config?.IS_ADMIN===!0}}async function C(){try{let e=Ao(await Lo(Po().tcb,`GET_PASSWORD_STATUS`));a.value=e.version??``,c.value=e.status===!0,l.value=!Po().tcb}catch(e){throw o.value=!0,i.value=!1,e}}function w(){r(`close`)}return lh(()=>n.show,e=>{e&&b()}),(t,n)=>(Y(),X(`div`,dS,[rh((Y(),X(`div`,{class:Rf([`tk-admin`,{__show:e.show}])},[Z(`button`,{class:`tk-admin-close`,onClick:w},[Q(py,{name:`times`})]),o.value?(Y(),X(`div`,fS,[Z(`div`,null,K(J(W)(`ADMIN_NEED_UPDATE`)),1),n[10]||=Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},` https://twikoo.js.org/update.html `,-1)])):(Y(),X(`div`,pS,[!s.value&&c.value?(Y(),X(`div`,mS,[Z(`div`,hS,K(J(W)(`ADMIN_LOGIN_TITLE`)),1),Z(`form`,{onSubmit:n[1]||=ny(()=>{},[`prevent`])},[n[11]||=Z(`input`,{type:`hidden`},null,-1),Q(Ly,{ref_key:`focusmeRef`,ref:h,modelValue:d.value,"onUpdate:modelValue":n[0]||=e=>d.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_PASSWORD_PLACEHOLDER`),onKeyup:iy(_,[`enter`])},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_PASSWORD`)),1)]),append:nh(()=>[Q(Yy,{onClick:_},{default:nh(()=>[A_(K(J(W)(`ADMIN_LOGIN`)),1)]),_:1})]),_:1},8,[`modelValue`,`placeholder`])],32),p.value?(Y(),X(`div`,gS,[A_(K(p.value)+` `,1),Z(`a`,_S,K(J(W)(`ADMIN_FORGOT`)),1)])):$(`v-if`,!0)])):$(`v-if`,!0),!s.value&&!c.value?(Y(),X(`div`,vS,[Z(`div`,yS,K(J(W)(`ADMIN_LOGIN_TITLE`)),1),Z(`form`,{onSubmit:n[5]||=ny(()=>{},[`prevent`])},[l.value?$(`v-if`,!0):(Y(),S_(Ly,{key:0,ref_key:`focusmeRef`,ref:h,modelValue:u.value,"onUpdate:modelValue":n[2]||=e=>u.value=e,class:`tk-password`,placeholder:J(W)(`ADMIN_CREDENTIALS_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_CREDENTIALS`)),1)]),_:1},8,[`modelValue`,`placeholder`])),Q(Ly,{modelValue:d.value,"onUpdate:modelValue":n[3]||=e=>d.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_SET_PASSWORD_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_SET_PASSWORD`)),1)]),_:1},8,[`modelValue`,`placeholder`]),Q(Ly,{modelValue:f.value,"onUpdate:modelValue":n[4]||=e=>f.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_SET_PASSWORD_CONFIRM_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_SET_PASSWORD_CONFIRM`)),1)]),_:1},8,[`modelValue`,`placeholder`])],32),Q(Yy,{class:`tk-regist-button`,disabled:!g.value,onClick:y},{default:nh(()=>[A_(K(J(W)(`ADMIN_REGIST`)),1)]),_:1},8,[`disabled`]),p.value?(Y(),X(`div`,bS,K(p.value),1)):$(`v-if`,!0),l.value?$(`v-if`,!0):(Y(),X(`div`,xS,[Z(`a`,SS,K(J(W)(`ADMIN_CREDENTIALS_FAQ`)),1)]))])):$(`v-if`,!0),s.value?(Y(),X(`div`,CS,[Z(`div`,wS,[Z(`div`,null,K(J(W)(`ADMIN_TITLE`)),1),Z(`a`,{class:`tk-panel-logout`,href:`#`,onClick:ny(v,[`prevent`])},K(J(W)(`ADMIN_LOGOUT`)),1)]),Z(`div`,TS,[Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`comment`}]),onClick:n[6]||=e=>m.value=`comment`},K(J(W)(`ADMIN_COMMENT`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`config`}]),onClick:n[7]||=e=>m.value=`config`},K(J(W)(`ADMIN_CONFIG`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`import`}]),onClick:n[8]||=e=>m.value=`import`},K(J(W)(`ADMIN_IMPORT`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`export`}]),onClick:n[9]||=e=>m.value=`export`},K(J(W)(`ADMIN_EXPORT`)),3)]),rh(Q(Ix,null,null,512),[[yv,m.value===`comment`]]),rh(Q(eS,null,null,512),[[yv,m.value===`config`]]),rh(Q(sS,null,null,512),[[yv,m.value===`import`]]),rh(Q(uS,null,null,512),[[yv,m.value===`export`]])])):$(`v-if`,!0)]))],2)),[[J(vd),i.value]])]))}}),DS={id:`twikoo`,class:`twikoo`},OS=yh({__name:`App`,setup(e){let t=q(!1),n=q(!1);function r(e){n.value=e===!0}return Ph(()=>{Hy(Vy,r)}),Rh(()=>{Uy(Vy,r)}),(e,r)=>(Y(),X(`div`,DS,[Q(ox,{"show-admin-entry":n.value,onAdmin:r[0]||=e=>t.value=!0},null,8,[`show-admin-entry`]),Q(cx),Q(ES,{show:t.value,onClose:r[1]||=e=>t.value=!1},null,8,[`show`])]))}}),kS=null;function AS(e,t={}){return kS&&=(kS.unmount(),null),kS=cy(OS),kS.config.globalProperties.$tcb=e,kS.config.globalProperties.$twikoo=t,No(e,t),kS.mount(t.el||`#twikoo`),kS}var jS=()=>globalThis.cloudbase;function MS(e){jS=e}async function NS(e){if(Sd(e.envId))return null;let t=jS();return t===void 0?(zo.error(`Please import cloudbase firstly:
252
- <script src="https://imgcache.qq.com/qcloud/cloudbase-js-sdk/1.3.3/cloudbase.full.js"><\/script>`),null):await Kd(t,e)}async function PS(e={}){let t=await NS(e);await Xo({lang:e.lang,localeBaseUrl:e.localeBaseUrl}),AS(t,e),await Ld(t,e)}async function FS(e={}){return await Pd(await NS(e),e)}async function IS(e={}){return await Fd(await NS(e),e)}async function LS(e={}){return await Id(await NS(e),e)}MS(()=>uo),e.default=PS,e.init=PS,e.getCommentsCount=FS,e.getRecentComments=IS,e.getVisitorsCount=LS,e.setCloudbaseProvider=MS,e.version=wo});
251
+ `),$(` prettier-ignore `),t[1]||=Z(`span`,null,[A_(`请参考\xA0`),Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},`版本更新`),A_(`\xA0进行升级`)],-1)])),Z(`form`,{onSubmit:ny(v,[`prevent`])},[Z(`div`,Vx,[(Y(!0),X(f_,null,Jh(s,e=>(Y(),X(`details`,{key:e.name,class:`tk-admin-config-group`},[Z(`summary`,Hx,K(e.name),1),(Y(!0),X(f_,null,Jh(e.items,e=>rh((Y(),X(`div`,{key:e.key,class:`tk-admin-config-item`},[Z(`div`,{class:`tk-admin-config-title`,title:e.key},K(e.key),9,Ux),Z(`div`,Wx,[e.options?rh((Y(),X(`select`,{key:0,"onUpdate:modelValue":t=>e.value=t,class:`tk-admin-config-select`},[(Y(!0),X(f_,null,Jh(e.options,e=>(Y(),X(`option`,{key:e.value,value:e.value},K(e.label),9,Kx))),128))],8,Gx)),[[Xv,e.value]]):e.type===`textarea`?(Y(),S_(Ly,{key:1,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,type:`textarea`,rows:5,size:`small`,placeholder:e.ph},null,8,[`modelValue`,`onUpdate:modelValue`,`placeholder`])):(Y(),S_(Ly,{key:2,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,type:e.secret?`password`:`text`,size:`small`,placeholder:e.ph},null,8,[`modelValue`,`onUpdate:modelValue`,`type`,`placeholder`]))]),t[2]||=Z(`div`,null,null,-1),Z(`div`,qx,K(e.desc),1)])),[[yv,_(e)]])),128))]))),128)),Z(`details`,Jx,[Z(`summary`,Yx,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST`)),1),Z(`div`,Xx,[Z(`div`,Zx,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_HELP`)),1),Z(`div`,Qx,[Q(Ly,{modelValue:p.value,"onUpdate:modelValue":t[0]||=e=>p.value=e,size:`small`},{append:nh(()=>[Q(Yy,{type:`info`,onClick:y},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_BTN`)),1)]),_:1})]),_:1},8,[`modelValue`])]),Z(`div`,$x,K(J(W)(`ADMIN_CONFIG_EMAIL_TEST_RESULT`))+K(m.value),1)])])]),Z(`div`,eS,[Q(Yy,{size:`small`,type:`primary`,"native-type":`submit`},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_SAVE`)),1)]),_:1}),Q(Yy,{size:`small`,type:`info`,onClick:g},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_RESET`)),1)]),_:1})])],32),Z(`div`,tS,K(f.value),1)])),[[J(vd),c.value]])}}),rS={class:`tk-admin-import`},iS={class:`tk-admin-warn tk-admin-import-warn`},aS={class:`tk-admin-import-label`},oS={disabled:``,value:``},sS={class:`tk-admin-import-label`},cS={class:`tk-admin-import-actions`},lS=yh({__name:`TkAdminImport`,setup(e){let t=q(!1),n=q(``),r=q(``),i=cm({valine:W(`ADMIN_IMPORT_TIP_VALINE`),disqus:W(`ADMIN_IMPORT_TIP_DISQUS`),artalk:W(`ADMIN_IMPORT_TIP_ARTALK`),artalk2:``,twikoo:``}),a=q(),o=q();function s(e){r.value+=`${new Date().toLocaleString()} ${e}\n`,Wm(()=>{let e=o.value?.inputEl;e&&(e.scrollTop=e.scrollHeight)})}async function c(){if(!n.value){s(W(`ADMIN_IMPORT_SOURCE_REQUIRED`));return}let e=a.value?.files?.[0];if(!e)s(W(`ADMIN_IMPORT_FILE_REQUIRED`));else{s(W(`ADMIN_IMPORT_START`)),t.value=!0;try{let t=Po().tcb;if(t){let n=await t.app.uploadFile({cloudPath:`import/${Date.now()}`,filePath:e,onUploadProgress:e=>{let t=Math.round(e.loaded*100/e.total);s(`${W(`ADMIN_IMPORT_UPLOADING`)}${t}%`)}});s(`${W(`ADMIN_IMPORT_UPLOADED`)}${n.fileID}`),await l(String(n.fileID))}else await u(e)}catch(e){console.error(e),s(jo(e))}finally{t.value=!1}}}async function l(e){s(`${W(`ADMIN_IMPORT_IMPORTING`)}${n.value}`);let t=Ao(await Lo(Po().tcb,`COMMENT_IMPORT_FOR_ADMIN`,{fileId:e,source:n.value}));r.value+=t.log??``,s(`${W(`ADMIN_IMPORT_IMPORTED`)}${n.value}`)}async function u(e){s(`${W(`ADMIN_IMPORT_IMPORTING`)}${n.value}`);let t=Ao(await Lo(Po().tcb,`COMMENT_IMPORT_FOR_ADMIN`,{file:await Rd(e),source:n.value}));r.value+=t.log??``,s(`${W(`ADMIN_IMPORT_IMPORTED`)}${n.value}`)}function d(e){return!e||typeof e!=`object`||Array.isArray(e)?!1:Object.values(e).every(e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`)}async function f(){if(n.value!==`twikoo`){s(W(`ADMIN_CONFIG_IMPORT_SOURCE_INVALID`));return}let e=a.value?.files?.[0];if(!e){s(W(`ADMIN_IMPORT_FILE_REQUIRED`));return}t.value=!0;let r=!1;try{let t=JSON.parse(await Rd(e));if(!d(t)){s(W(`ADMIN_CONFIG_IMPORT_INVALID`));return}let n={...t};delete n.CREDENTIALS,s(W(`ADMIN_CONFIG_IMPORTING`)),r=!0;let i=Ao(await Lo(Po().tcb,`SET_CONFIG`,{config:n}));if(i.code===0)Wy(zy),s(W(`ADMIN_CONFIG_IMPORTED`));else{let e=typeof i.message==`string`?i.message:``;s(`${W(`ADMIN_CONFIG_IMPORT_FAILED`)}${e}`)}}catch(e){console.error(e),s(`${W(`ADMIN_CONFIG_IMPORT_FAILED`)}${jo(e)}`),r&&!(e instanceof ko)&&Wy(zy)}finally{t.value=!1}}return(e,s)=>(Y(),X(`div`,rS,[Z(`div`,iS,[Z(`p`,null,K(J(W)(`ADMIN_IMPORT_WARN`)),1),Z(`p`,null,K(i[n.value]),1)]),Z(`div`,aS,K(J(W)(`ADMIN_IMPORT_SELECT_SOURCE`)),1),rh(Z(`select`,{"onUpdate:modelValue":s[0]||=e=>n.value=e},[Z(`option`,oS,K(J(W)(`ADMIN_IMPORT_SELECT`)),1),s[2]||=j_(`<option value="valine">Valine (JSON)</option><option value="disqus">Disqus (XML)</option><option value="artalk">Artalk v1 (JSON)</option><option value="artalk2">Artalk v2 (Artrans)</option><option value="twikoo">Twikoo (JSON)</option>`,5)],512),[[Xv,n.value]]),Z(`div`,sS,K(J(W)(`ADMIN_IMPORT_SELECT_FILE`)),1),Z(`input`,{ref_key:`inputFileRef`,ref:a,type:`file`,value:``},null,512),Z(`div`,cS,[Q(Yy,{size:`small`,disabled:t.value,onClick:c},{default:nh(()=>[A_(K(J(W)(`ADMIN_IMPORT_COMMENT`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:f},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_IMPORT`)),1)]),_:1},8,[`disabled`])]),Q(Ly,{ref_key:`logTextAreaRef`,ref:o,modelValue:r.value,"onUpdate:modelValue":s[1]||=e=>r.value=e,type:`textarea`,rows:10,readonly:``,placeholder:J(W)(`ADMIN_IMPORT_LOG`)},null,8,[`modelValue`,`placeholder`])]))}}),uS={class:`tk-admin-export`},dS={class:`tk-admin-warn tk-admin-import-warn`},fS=yh({__name:`TkAdminExport`,setup(e){let t=q(!1);async function n(e){t.value=!0;try{let t=Ao(await Lo(Po().tcb,`COMMENT_EXPORT_FOR_ADMIN`,{collection:e}));t.data&&i(`twikoo-${e}.json`,t.data)}catch(e){alert(jo(e))}finally{t.value=!1}}async function r(){t.value=!0;try{let e=Ao(await Lo(Po().tcb,`GET_CONFIG_FOR_ADMIN`,{}));if(!e.config)return;let t={...e.config};delete t.VERSION,i(`twikoo-config-${new Date().toISOString().slice(0,10)}.json`,t)}catch(e){alert(jo(e))}finally{t.value=!1}}function i(e,t){let n=t instanceof Object?JSON.stringify(t,null,2):String(t),r=new Blob([n]),i=document.createElementNS(`http://www.w3.org/1999/xhtml`,`a`);i.href=URL.createObjectURL(r),i.download=e,i.click()}return(e,i)=>(Y(),X(`div`,uS,[Z(`div`,dS,[Z(`p`,null,K(J(W)(`ADMIN_EXPORT_WARN`)),1)]),Q(Yy,{size:`small`,disabled:t.value,onClick:i[0]||=e=>n(`comment`)},{default:nh(()=>[A_(K(J(W)(`ADMIN_EXPORT_COMMENT`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:i[1]||=e=>n(`counter`)},{default:nh(()=>[A_(K(J(W)(`ADMIN_EXPORT_COUNTER`)),1)]),_:1},8,[`disabled`]),Q(Yy,{size:`small`,disabled:t.value,onClick:r},{default:nh(()=>[A_(K(J(W)(`ADMIN_CONFIG_EXPORT`)),1)]),_:1},8,[`disabled`])]))}}),pS={class:`tk-admin-container`},mS={key:0,class:`tk-login-title`},hS={key:1},gS={key:0,class:`tk-login`},_S={class:`tk-login-title`},vS={key:0,class:`tk-login-msg`},yS={href:`https://twikoo.js.org/faq.html`,rel:`noopener noreferrer`,target:`_blank`},bS={key:1,class:`tk-regist`},xS={class:`tk-login-title`},SS={key:0,class:`tk-login-msg`},CS={key:1,class:`tk-login-msg`},wS={href:`https://twikoo.js.org/faq.html`,rel:`noopener noreferrer`,target:`_blank`},TS={key:2,class:`tk-panel`},ES={class:`tk-panel-title`},DS={class:`tk-tabs`},OS=yh({__name:`TkAdmin`,props:{show:{type:Boolean,default:!1}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=q(!0),a=q(``),o=q(!1),s=q(!1),c=q(!0),l=q(!1),u=q(``),d=q(``),f=q(``),p=q(``),m=q(`comment`),h=q(),g=av(()=>!c.value&&!!d.value&&d.value===f.value&&(l.value||!!u.value));async function _(){if(!d.value)p.value=W(`ADMIN_PASSWORD_REQUIRED`);else{i.value=!0,p.value=``;try{let e=(0,Hc.default)(d.value),t=Po().tcb,n=Ao(await Lo(t,`LOGIN`,{password:e}));n.message?p.value=n.message:n.ticket?(await t?.auth?.customAuthProvider().signIn(n.ticket),zo.info(`登录成功`),d.value=``,await S()):n.code===0&&(zo.info(`登录成功`),localStorage.setItem(`twikoo-access-token`,e),d.value=``,await S())}catch(e){p.value=jo(e)}finally{i.value=!1}}}async function v(e){e.preventDefault(),i.value=!0;try{let e=Po().tcb;e?.auth?(await e.auth.signOut(),s.value=!1,await e.auth.anonymousAuthProvider().signIn()):localStorage.removeItem(`twikoo-access-token`),s.value=!1}catch(e){alert(jo(e))}finally{i.value=!1}}async function y(){i.value=!0;try{let e=(0,Hc.default)(d.value);Ao(await Lo(Po().tcb,`SET_PASSWORD`,{password:e,credentials:u.value})),c.value=!0,await _()}catch(e){if(p.value=jo(e),!(e instanceof ko))try{await C()}catch(e){zo.warn(`重新检查密码状态失败`,e)}}finally{i.value=!1}}async function b(){i.value=!0;try{await S(),s.value||(await C(),x())}catch(e){p.value=jo(e)}finally{i.value=!1}}function x(){setTimeout(()=>h.value?.focus(),500)}async function S(){let e=Po().tcb;if(e?.auth){let t=await e.auth.getCurrentUser();s.value=t.loginType===`CUSTOM`}else{let t=Ao(await Lo(e,`GET_CONFIG`));s.value=t?.config?.IS_ADMIN===!0}}async function C(){try{let e=Ao(await Lo(Po().tcb,`GET_PASSWORD_STATUS`));a.value=e.version??``,c.value=e.status===!0,l.value=!Po().tcb}catch(e){throw o.value=!0,i.value=!1,e}}function w(){r(`close`)}return lh(()=>n.show,e=>{e&&b()}),(t,n)=>(Y(),X(`div`,pS,[rh((Y(),X(`div`,{class:Rf([`tk-admin`,{__show:e.show}])},[Z(`button`,{class:`tk-admin-close`,onClick:w},[Q(py,{name:`times`})]),o.value?(Y(),X(`div`,mS,[Z(`div`,null,K(J(W)(`ADMIN_NEED_UPDATE`)),1),n[10]||=Z(`a`,{href:`https://twikoo.js.org/update.html`,target:`_blank`,rel:`noopener noreferrer`},` https://twikoo.js.org/update.html `,-1)])):(Y(),X(`div`,hS,[!s.value&&c.value?(Y(),X(`div`,gS,[Z(`div`,_S,K(J(W)(`ADMIN_LOGIN_TITLE`)),1),Z(`form`,{onSubmit:n[1]||=ny(()=>{},[`prevent`])},[n[11]||=Z(`input`,{type:`hidden`},null,-1),Q(Ly,{ref_key:`focusmeRef`,ref:h,modelValue:d.value,"onUpdate:modelValue":n[0]||=e=>d.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_PASSWORD_PLACEHOLDER`),onKeyup:iy(_,[`enter`])},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_PASSWORD`)),1)]),append:nh(()=>[Q(Yy,{onClick:_},{default:nh(()=>[A_(K(J(W)(`ADMIN_LOGIN`)),1)]),_:1})]),_:1},8,[`modelValue`,`placeholder`])],32),p.value?(Y(),X(`div`,vS,[A_(K(p.value)+` `,1),Z(`a`,yS,K(J(W)(`ADMIN_FORGOT`)),1)])):$(`v-if`,!0)])):$(`v-if`,!0),!s.value&&!c.value?(Y(),X(`div`,bS,[Z(`div`,xS,K(J(W)(`ADMIN_LOGIN_TITLE`)),1),Z(`form`,{onSubmit:n[5]||=ny(()=>{},[`prevent`])},[l.value?$(`v-if`,!0):(Y(),S_(Ly,{key:0,ref_key:`focusmeRef`,ref:h,modelValue:u.value,"onUpdate:modelValue":n[2]||=e=>u.value=e,class:`tk-password`,placeholder:J(W)(`ADMIN_CREDENTIALS_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_CREDENTIALS`)),1)]),_:1},8,[`modelValue`,`placeholder`])),Q(Ly,{modelValue:d.value,"onUpdate:modelValue":n[3]||=e=>d.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_SET_PASSWORD_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_SET_PASSWORD`)),1)]),_:1},8,[`modelValue`,`placeholder`]),Q(Ly,{modelValue:f.value,"onUpdate:modelValue":n[4]||=e=>f.value=e,class:`tk-password`,type:`password`,placeholder:J(W)(`ADMIN_SET_PASSWORD_CONFIRM_PLACEHOLDER`)},{prepend:nh(()=>[A_(K(J(W)(`ADMIN_SET_PASSWORD_CONFIRM`)),1)]),_:1},8,[`modelValue`,`placeholder`])],32),Q(Yy,{class:`tk-regist-button`,disabled:!g.value,onClick:y},{default:nh(()=>[A_(K(J(W)(`ADMIN_REGIST`)),1)]),_:1},8,[`disabled`]),p.value?(Y(),X(`div`,SS,K(p.value),1)):$(`v-if`,!0),l.value?$(`v-if`,!0):(Y(),X(`div`,CS,[Z(`a`,wS,K(J(W)(`ADMIN_CREDENTIALS_FAQ`)),1)]))])):$(`v-if`,!0),s.value?(Y(),X(`div`,TS,[Z(`div`,ES,[Z(`div`,null,K(J(W)(`ADMIN_TITLE`)),1),Z(`a`,{class:`tk-panel-logout`,href:`#`,onClick:ny(v,[`prevent`])},K(J(W)(`ADMIN_LOGOUT`)),1)]),Z(`div`,DS,[Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`comment`}]),onClick:n[6]||=e=>m.value=`comment`},K(J(W)(`ADMIN_COMMENT`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`config`}]),onClick:n[7]||=e=>m.value=`config`},K(J(W)(`ADMIN_CONFIG`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`import`}]),onClick:n[8]||=e=>m.value=`import`},K(J(W)(`ADMIN_IMPORT`)),3),Z(`div`,{class:Rf([`tk-tab`,{__active:m.value===`export`}]),onClick:n[9]||=e=>m.value=`export`},K(J(W)(`ADMIN_EXPORT`)),3)]),rh(Q(Rx,null,null,512),[[yv,m.value===`comment`]]),rh(Q(nS,null,null,512),[[yv,m.value===`config`]]),rh(Q(lS,null,null,512),[[yv,m.value===`import`]]),rh(Q(fS,null,null,512),[[yv,m.value===`export`]])])):$(`v-if`,!0)]))],2)),[[J(vd),i.value]])]))}}),kS={id:`twikoo`,class:`twikoo`},AS=yh({__name:`App`,setup(e){let t=q(!1),n=q(!1);function r(e){n.value=e===!0}return Ph(()=>{Hy(Vy,r)}),Rh(()=>{Uy(Vy,r)}),(e,r)=>(Y(),X(`div`,kS,[Q(ox,{"show-admin-entry":n.value,onAdmin:r[0]||=e=>t.value=!0},null,8,[`show-admin-entry`]),Q(cx),Q(OS,{show:t.value,onClose:r[1]||=e=>t.value=!1},null,8,[`show`])]))}}),jS=null;function MS(e,t={}){return jS&&=(jS.unmount(),null),jS=cy(AS),jS.config.globalProperties.$tcb=e,jS.config.globalProperties.$twikoo=t,No(e,t),jS.mount(t.el||`#twikoo`),jS}var NS=()=>globalThis.cloudbase;function PS(e){NS=e}async function FS(e){if(Sd(e.envId))return null;let t=NS();return t===void 0?(zo.error(`Please import cloudbase firstly:
252
+ <script src="https://imgcache.qq.com/qcloud/cloudbase-js-sdk/1.3.3/cloudbase.full.js"><\/script>`),null):await Kd(t,e)}async function IS(e={}){let t=await FS(e);await Xo({lang:e.lang,localeBaseUrl:e.localeBaseUrl}),MS(t,e),await Ld(t,e)}async function LS(e={}){return await Pd(await FS(e),e)}async function RS(e={}){return await Fd(await FS(e),e)}async function zS(e={}){return await Id(await FS(e),e)}PS(()=>uo),e.default=IS,e.init=IS,e.getCommentsCount=LS,e.getRecentComments=RS,e.getVisitorsCount=zS,e.setCloudbaseProvider=PS,e.version=wo});