w-serv-orm 1.1.12 → 1.1.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -11,6 +11,14 @@ An operator for orm in server.
11
11
  ## Documentation
12
12
  To view documentation or get support, visit [docs](https://yuda-lyu.github.io/w-serv-orm/WServOrm.html).
13
13
 
14
+ ## Conditions (find) and delAll
15
+ `procOrm` 之 `select`、`delAll` 之條件(find)僅支援 w-orm 系列白名單,由各 `w-orm-*` 後端依相同規則檢核(須為已實作該白名單之 `w-orm-*` 版本;舊版或尚未更新者仍可能接受白名單外之運算子,不在下述保證內),本套件不依運算子放行或攔截(僅把字串型主鍵條件中的有限數字轉為字串,見 JSDoc):
16
+ * 欄位等值 `{ 欄: 純量 }`(多欄為 AND);欄位運算子 `$eq $ne $gt $gte $lt $lte`(值為純量)與 `$in $nin`(值為純量陣列);文件層 `$and $or`(值為條件物件之非空陣列)。純量為字串(不含 NUL 字元與孤立代理字元)、有限數字、布林、有效 Date,`null` 僅可用於欄位等值、`$eq`、`$ne`。欄名、清單長度與巢狀深度等另有上限,完整規則見各 `w-orm-*` 之文件。
17
+ * 白名單外之運算子(例如 `$not $nor $regex $options $exists $all $where $expr`)、欄位層 `$and/$or`、函數值、`undefined` 值、空的 `$nin/$and/$or` 等由後端整批 reject,`procOrm` 以固定字串回傳(`select` 為 `failed to select data`,`delAll` 為 `failed to delete data`),後端錯誤原文只由 `console.log` 輸出,`delAll` 不刪除任何數據。
18
+ * `select` 未給、為 `undefined` 或 `{}` 回傳全部數據;傳了值卻不是條件物件(`null`、陣列、字串、數字、布林、函數、類別實例等)整批 reject。
19
+ * 條件內任何位置(含 `$and`/`$or` 元素與欄位運算子物件)若有 Symbol 鍵、不可列舉鍵(`invalid find of select, unsupported symbol key or non-enumerable property`),或 Proxy(含已撤銷者、原型為 Proxy 者)、帶 `Symbol.toStringTag` 者(含 Map、Set 等內建品牌物件)、內建品牌物件(含原型被改為 `null` 者)、非純物件(類別實例、偽原型等)、有空洞或額外屬性或不可列舉元素之陣列、帶自有屬性之 Date、函數值、Symbol 值(`invalid find of select, unsupported irregular object or array`),整批 reject(`delAll` 同),不查詢亦不刪除,且檢查期間與拒收後之診斷輸出皆不執行使用端程式(Proxy 陷阱、getter、`Symbol.toStringTag`、`util.inspect.custom`;被拒條件以本層建立之純資料快照輸出至 `console.log`,字串長度、層數與項數有上限)。這些結構在字串型主鍵表之轉型複製時會被洗掉,令後端本會拒收之條件變成較寬甚至無條件;JSON 資料通道無法產生這些結構。以 Proxy 包裝之條件(如 Vue 響應式物件)或 Mongoose、Sequelize 等文件須先轉為純物件(如 `{ ...filter }` 或 `JSON.parse(JSON.stringify(filter))`)。跨 realm(如 `vm`)之純物件照常:於字串型主鍵表之複製位置(頂層、`$and`/`$or` 元素、`id` 之運算子物件)被複製為本 realm 物件,其餘位置原樣交後端,現行 `w-orm-*` 之條件白名單要求本 realm 物件,故會 reject。
20
+ * **`delAll` 為破壞性操作,須審慎使用,非必要不用**(刪除單筆請用 `del`):不給條件(未給、`undefined` 或 `{}`)即刪除全部數據,不另行確認;給了條件才是部分刪除。經資料通道(前端直接操作資料表)呼叫之 `delAll` 與此語意一致,不另加通道專屬限制,授權由開放處負責。條件值若來自可能為 `undefined`、`null` 或空陣列之變數,呼叫端須先自行判斷;經 JSON 傳輸時顯式傳入之 `undefined` 會成為 `null` 而被 reject,須省略參數或傳 `{}`。建議先以 `select(find)` 確認命中範圍再刪除(ORM 啟用快取而他方已寫入時,`select` 可能回傳快取,而 `delAll` 一律直讀資料庫,預覽不保證即實際刪除之集合)。
21
+
14
22
  ## Installation
15
23
 
16
24
  ### Using npm(ES6 module):
@@ -1,7 +1,7 @@
1
1
  /*!
2
- * w-serv-orm v1.1.12
2
+ * w-serv-orm v1.1.14
3
3
  * (c) 2018-2021 yuda-lyu(semisphere)
4
4
  * Released under the MIT License.
5
5
  */
6
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("fs")):"function"==typeof define&&define.amd?define(["fs"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-serv-orm"]=e(t.fs)}(this,(function(t){"use strict";function e(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}var r=/\s/;var n=/^\s+/;function o(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&r.test(t.charAt(e)););return e}(t)+1).replace(n,""):t}function i(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var a="object"==typeof global&&global&&global.Object===Object&&global,u="object"==typeof self&&self&&self.Object===Object&&self,s=a||u||Function("return this")(),c=s.Symbol,l=Object.prototype,f=l.hasOwnProperty,d=l.toString,p=c?c.toStringTag:void 0;var h=Object.prototype.toString;var g="[object Null]",v="[object Undefined]",b=c?c.toStringTag:void 0;function y(t){return null==t?void 0===t?v:g:b&&b in Object(t)?function(t){var e=f.call(t,p),r=t[p];try{t[p]=void 0;var n=!0}catch(t){}var o=d.call(t);return n&&(e?t[p]=r:delete t[p]),o}(t):function(t){return h.call(t)}(t)}function m(t){return null!=t&&"object"==typeof t}var w="[object Symbol]";function j(t){return"symbol"==typeof t||m(t)&&y(t)==w}var $=NaN,O=/^[-+]0x[0-9a-f]+$/i,x=/^0b[01]+$/i,_=/^0o[0-7]+$/i,S=parseInt;var A=1/0,k=17976931348623157e292;function P(t){return t?(t=function(t){if("number"==typeof t)return t;if(j(t))return $;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=o(t);var r=x.test(t);return r||_.test(t)?S(t.slice(2),r?2:8):O.test(t)?$:+t}(t))===A||t===-A?(t<0?-1:1)*k:t==t?t:0:0===t?t:0}function I(t){var e=P(t),r=e%1;return e==e?r?e-r:e:0}function T(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var D,M=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var u=i[D?a:++n];if(!1===e(o[u],u,o))break}return t};function E(t){return m(t)&&"[object Arguments]"==y(t)}var C=Object.prototype,z=C.hasOwnProperty,L=C.propertyIsEnumerable,F=E(function(){return arguments}())?E:function(t){return m(t)&&z.call(t,"callee")&&!L.call(t,"callee")},U=F,N=Array.isArray;var W="object"==typeof exports&&exports&&!exports.nodeType&&exports,B=W&&"object"==typeof module&&module&&!module.nodeType&&module,H=B&&B.exports===W?s.Buffer:void 0,V=(H?H.isBuffer:void 0)||function(){return!1},R=9007199254740991,Y=/^(?:0|[1-9]\d*)$/;function q(t,e){var r=typeof t;return!!(e=null==e?R:e)&&("number"==r||"symbol"!=r&&Y.test(t))&&t>-1&&t%1==0&&t<e}var X=9007199254740991;function Z(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=X}var G={};function J(t){return function(e){return t(e)}}G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G["[object Arguments]"]=G["[object Array]"]=G["[object ArrayBuffer]"]=G["[object Boolean]"]=G["[object DataView]"]=G["[object Date]"]=G["[object Error]"]=G["[object Function]"]=G["[object Map]"]=G["[object Number]"]=G["[object Object]"]=G["[object RegExp]"]=G["[object Set]"]=G["[object String]"]=G["[object WeakMap]"]=!1;var Q="object"==typeof exports&&exports&&!exports.nodeType&&exports,K=Q&&"object"==typeof module&&module&&!module.nodeType&&module,tt=K&&K.exports===Q&&a.process,et=function(){try{var t=K&&K.require&&K.require("util").types;return t||tt&&tt.binding&&tt.binding("util")}catch(t){}}(),rt=et&&et.isTypedArray,nt=rt?J(rt):function(t){return m(t)&&Z(t.length)&&!!G[y(t)]},ot=Object.prototype.hasOwnProperty;function it(t,e){var r=N(t),n=!r&&U(t),o=!r&&!n&&V(t),i=!r&&!n&&!o&&nt(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],s=u.length;for(var c in t)!e&&!ot.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||q(c,s))||u.push(c);return u}var at=Object.prototype;function ut(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||at)}function st(t,e){return function(r){return t(e(r))}}var ct=st(Object.keys,Object),lt=Object.prototype.hasOwnProperty;function ft(t){if(!ut(t))return ct(t);var e=[];for(var r in Object(t))lt.call(t,r)&&"constructor"!=r&&e.push(r);return e}var dt="[object AsyncFunction]",pt="[object Function]",ht="[object GeneratorFunction]",gt="[object Proxy]";function vt(t){if(!i(t))return!1;var e=y(t);return e==pt||e==ht||e==dt||e==gt}function bt(t){return null!=t&&Z(t.length)&&!vt(t)}function yt(t){return bt(t)?it(t):ft(t)}var mt=function(t,e){return function(r,n){if(null==r)return r;if(!bt(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}((function(t,e){return t&&M(t,e,yt)})),wt=mt;function jt(t){return t}function $t(t,e){var r;return(N(t)?T:wt)(t,"function"==typeof(r=e)?r:jt)}function Ot(t){return"[object Array]"===Object.prototype.toString.call(t)}function xt(t){return"[object Object]"===Object.prototype.toString.call(t)}function _t(t){return vt(t)}function St(t,r){let n=function(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}();if(!Ot(t)&&!xt(t))return n.reject("rs is not an array or object"),n;let o=!1;if(xt(t)){o=!0;let e=[];$t(t,((t,r)=>{e.push({k:r,v:t})})),t=e}_t(r)||($t(t,(t=>{!function(t){try{t instanceof Promise&&Promise.prototype.then.call(t,void 0,(()=>{}))}catch(t){}}(o?t.v:t)})),r=function(t){return t});let i=_t(r),a=-1,u=[];return t.reduce((function(t,e){return t.then((function(t){u.push(t),a+=1;let n=a,s=e;return o&&(n=e.k,s=e.v),i?r(s,n):s}))}),Promise.resolve()).then((function(t){var r,o,i,a;u.push(t),a=null==(r=u)?0:r.length,u=a?e(r,(o=i||void 0===o?1:I(o))<0?0:o,a):[],n.resolve(u)})).catch((function(t){n.reject(t)})),n}var At=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,kt=/^\w*$/;function Pt(t,e){if(N(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!j(t))||(kt.test(t)||!At.test(t)||null!=e&&t in Object(e))}var It,Tt=s["__core-js_shared__"],Dt=(It=/[^.]+$/.exec(Tt&&Tt.keys&&Tt.keys.IE_PROTO||""))?"Symbol(src)_1."+It:"";var Mt=Function.prototype.toString;function Et(t){if(null!=t){try{return Mt.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Ct=/^\[object .+?Constructor\]$/,zt=Function.prototype,Lt=Object.prototype,Ft=zt.toString,Ut=Lt.hasOwnProperty,Nt=RegExp("^"+Ft.call(Ut).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Wt(t){return!(!i(t)||(e=t,Dt&&Dt in e))&&(vt(t)?Nt:Ct).test(Et(t));var e}function Bt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Wt(r)?r:void 0}var Ht=Bt(Object,"create");var Vt=Object.prototype.hasOwnProperty;var Rt=Object.prototype.hasOwnProperty;function Yt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function qt(t,e){return t===e||t!=t&&e!=e}function Xt(t,e){for(var r=t.length;r--;)if(qt(t[r][0],e))return r;return-1}Yt.prototype.clear=function(){this.__data__=Ht?Ht(null):{},this.size=0},Yt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Yt.prototype.get=function(t){var e=this.__data__;if(Ht){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Vt.call(e,t)?e[t]:void 0},Yt.prototype.has=function(t){var e=this.__data__;return Ht?void 0!==e[t]:Rt.call(e,t)},Yt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&void 0===e?"__lodash_hash_undefined__":e,this};var Zt=Array.prototype.splice;function Gt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Gt.prototype.clear=function(){this.__data__=[],this.size=0},Gt.prototype.delete=function(t){var e=this.__data__,r=Xt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Zt.call(e,r,1),--this.size,!0)},Gt.prototype.get=function(t){var e=this.__data__,r=Xt(e,t);return r<0?void 0:e[r][1]},Gt.prototype.has=function(t){return Xt(this.__data__,t)>-1},Gt.prototype.set=function(t,e){var r=this.__data__,n=Xt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Jt=Bt(s,"Map");function Qt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Kt.prototype.clear=function(){this.size=0,this.__data__={hash:new Yt,map:new(Jt||Gt),string:new Yt}},Kt.prototype.delete=function(t){var e=Qt(this,t).delete(t);return this.size-=e?1:0,e},Kt.prototype.get=function(t){return Qt(this,t).get(t)},Kt.prototype.has=function(t){return Qt(this,t).has(t)},Kt.prototype.set=function(t,e){var r=Qt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var te="Expected a function";function ee(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(te);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(ee.Cache||Kt),r}ee.Cache=Kt;var re,ne,oe,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ae=/\\(\\)?/g,ue=(re=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ie,(function(t,r,n,o){e.push(n?o.replace(ae,"$1"):r||t)})),e},ne=ee(re,(function(t){return 500===oe.size&&oe.clear(),t})),oe=ne.cache,ne),se=ue;function ce(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var le=1/0,fe=c?c.prototype:void 0,de=fe?fe.toString:void 0;function pe(t){if("string"==typeof t)return t;if(N(t))return ce(t,pe)+"";if(j(t))return de?de.call(t):"";var e=t+"";return"0"==e&&1/t==-le?"-0":e}function he(t){return null==t?"":pe(t)}function ge(t,e){return N(t)?t:Pt(t,e)?[t]:se(he(t))}var ve=1/0;function be(t){if("string"==typeof t||j(t))return t;var e=t+"";return"0"==e&&1/t==-ve?"-0":e}function ye(t,e){for(var r=0,n=(e=ge(e,t)).length;null!=t&&r<n;)t=t[be(e[r++])];return r&&r==n?t:void 0}function me(t,e,r){var n=null==t?void 0:ye(t,e);return void 0===n?r:n}function we(t){let e="procOrm does not authorize users, authorize where procOrm is exposed to clients",r=[["useCheckUser",e],["getUserById",e],["useExcludeWhenNotAdmin","procOrm does not filter select results by user, use addFunPostProcessing if needed"]];for(let[e,n]of r){let r=me(t,e);if(null!=r&&!1!==r)throw new Error(`opt.${e} has been removed, ${n}`)}}function je(t,r,n){var o=t.length;return n=void 0===n?o:n,!r&&n>=o?t:e(t,r,n)}function $e(t){return t!=t}function Oe(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,$e,r)}var xe=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function _e(t){return xe.test(t)}var Se="\\ud800-\\udfff",Ae="["+Se+"]",ke="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",Pe="\\ud83c[\\udffb-\\udfff]",Ie="[^"+Se+"]",Te="(?:\\ud83c[\\udde6-\\uddff]){2}",De="[\\ud800-\\udbff][\\udc00-\\udfff]",Me="(?:"+ke+"|"+Pe+")"+"?",Ee="[\\ufe0e\\ufe0f]?",Ce=Ee+Me+("(?:\\u200d(?:"+[Ie,Te,De].join("|")+")"+Ee+Me+")*"),ze="(?:"+[Ie+ke+"?",ke,Te,De,Ae].join("|")+")",Le=RegExp(Pe+"(?="+Pe+")|"+ze+Ce,"g");function Fe(t){return _e(t)?function(t){return t.match(Le)||[]}(t):function(t){return t.split("")}(t)}function Ue(t,e,r){if((t=he(t))&&(r||void 0===e))return o(t);if(!t||!(e=pe(e)))return t;var n=Fe(t),i=Fe(e),a=function(t,e){for(var r=-1,n=t.length;++r<n&&Oe(e,t[r],0)>-1;);return r}(n,i),u=function(t,e){for(var r=t.length;r--&&Oe(e,t[r],0)>-1;);return r}(n,i)+1;return je(n,a,u).join("")}var Ne=Bt(s,"DataView"),We=Bt(s,"Promise"),Be=Bt(s,"Set"),He=Bt(s,"WeakMap"),Ve="[object Map]",Re="[object Promise]",Ye="[object Set]",qe="[object WeakMap]",Xe="[object DataView]",Ze=Et(Ne),Ge=Et(Jt),Je=Et(We),Qe=Et(Be),Ke=Et(He),tr=y;(Ne&&tr(new Ne(new ArrayBuffer(1)))!=Xe||Jt&&tr(new Jt)!=Ve||We&&tr(We.resolve())!=Re||Be&&tr(new Be)!=Ye||He&&tr(new He)!=qe)&&(tr=function(t){var e=y(t),r="[object Object]"==e?t.constructor:void 0,n=r?Et(r):"";if(n)switch(n){case Ze:return Xe;case Ge:return Ve;case Je:return Re;case Qe:return Ye;case Ke:return qe}return e});var er=tr,rr="[object String]";function nr(t){return function(e){return null==e?void 0:e[t]}}var or=nr("length"),ir="\\ud800-\\udfff",ar="["+ir+"]",ur="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",sr="\\ud83c[\\udffb-\\udfff]",cr="[^"+ir+"]",lr="(?:\\ud83c[\\udde6-\\uddff]){2}",fr="[\\ud800-\\udbff][\\udc00-\\udfff]",dr="(?:"+ur+"|"+sr+")"+"?",pr="[\\ufe0e\\ufe0f]?",hr=pr+dr+("(?:\\u200d(?:"+[cr,lr,fr].join("|")+")"+pr+dr+")*"),gr="(?:"+[cr+ur+"?",ur,lr,fr,ar].join("|")+")",vr=RegExp(sr+"(?="+sr+")|"+gr+hr,"g");function br(t){return _e(t)?function(t){for(var e=vr.lastIndex=0;vr.test(t);)++e;return e}(t):or(t)}var yr="[object Map]",mr="[object Set]";function wr(t){if(null==t)return 0;if(bt(t))return"string"==typeof(e=t)||!N(e)&&m(e)&&y(e)==rr?br(t):t.length;var e,r=er(t);return r==yr||r==mr?t.size:ft(t).length}function jr(t){let e=me(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!function(t){let e=me(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs"),r=!1;try{e.statSync(t),r=!0}catch{r=!1}return r}(t,{fs:e})&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function $r(t){if(xt(t)){for(let e in t)return!0;return!1}return!1}function Or(t){return"[object String]"===Object.prototype.toString.call(t)}function xr(t){if(t!=t)return!0;if(null!==t&&"object"==typeof t)try{let e=Number.prototype.valueOf.call(t);return Number.isNaN(e)}catch(t){return!1}return!1}function _r(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(xt(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!Or(t)||0!==t.length)}(t)||(!!function(t){return!!Ot(t)&&0===t.length}(t)||!!xr(t)))))}function Sr(t){return!!Ot(t)&&(0!==t.length&&(1!==t.length||!_r(t[0])))}function Ar(t){return!!(Or(t)&&t.length>0)}var kr="[object Boolean]";function Pr(t){return!0===(e=t)||!1===e||m(e)&&y(e)==kr;var e}let Ir={backup:async function(t){if(!$r(t))throw console.log("woItems",t),new Error("invalid woItems");return await St(t,(async(t,e)=>(console.log("backup...",e),{name:e,data:await t.select()})))},recover:async function(e,r,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!jr(e,{fs:t}))throw console.log("fp",e),new Error("fp is not exist");if(!$r(r))throw console.log("woItems",r),new Error("invalid woItems");_t(n)||(n=null),Pr(o)||(o=!1);let i=t.readFileSync(e,"utf8");i=Ue(i);let a=function(t){let e=me(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"returnWithStateAndMsg",null);Pr(e)||(e=!1);let r=t=>e?{state:"error",msg:t}:{};if(!Ar(t))return r("invalid v");let n={};try{n=JSON.parse(t)}catch(t){return r(t.toString())}return e?{state:"success",msg:n}:n}(i);if(!Sr(a))throw new Error("invalid backup data, need a non-empty array");$t(a,((t,e)=>{let n=me(t,"name");if(!Ar(n))throw new Error(`invalid backup data, rs[${e}].name is not a string`);if(!Object.prototype.hasOwnProperty.call(r,n))throw new Error(`invalid backup data, table[${n}] is not in woItems`)})),_t(n)&&n(),await St(a,(async t=>{console.log("recover...",t.name),o&&(console.log("needCreateStorage"),await r[t.name].createStorage());let e=null;return wr(t.data)>0&&(e=await r[t.name].insert(t.data)),e}))}};function Tr(t){var e=this.__data__=new Gt(t);this.size=e.size}Tr.prototype.clear=function(){this.__data__=new Gt,this.size=0},Tr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Tr.prototype.get=function(t){return this.__data__.get(t)},Tr.prototype.has=function(t){return this.__data__.has(t)},Tr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Gt){var n=r.__data__;if(!Jt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Kt(n)}return r.set(t,e),this.size=r.size,this};function Dr(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new Kt;++e<r;)this.add(t[e])}function Mr(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function Er(t,e){return t.has(e)}Dr.prototype.add=Dr.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dr.prototype.has=function(t){return this.__data__.has(t)};var Cr=1,zr=2;function Lr(t,e,r,n,o,i){var a=r&Cr,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,d=!0,p=r&zr?new Dr:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var h=t[f],g=e[f];if(n)var v=a?n(g,h,f,e,t,i):n(h,g,f,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Mr(e,(function(t,e){if(!Er(p,e)&&(h===t||o(h,t,r,n,i)))return p.push(e)}))){d=!1;break}}else if(h!==g&&!o(h,g,r,n,i)){d=!1;break}}return i.delete(t),i.delete(e),d}var Fr=s.Uint8Array;function Ur(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Nr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Wr=1,Br=2,Hr="[object Boolean]",Vr="[object Date]",Rr="[object Error]",Yr="[object Map]",qr="[object Number]",Xr="[object RegExp]",Zr="[object Set]",Gr="[object String]",Jr="[object Symbol]",Qr="[object ArrayBuffer]",Kr="[object DataView]",tn=c?c.prototype:void 0,en=tn?tn.valueOf:void 0;function rn(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function nn(t,e,r){var n=e(t);return N(t)?n:rn(n,r(t))}function on(){return[]}var an=Object.prototype.propertyIsEnumerable,un=Object.getOwnPropertySymbols,sn=un?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(un(t),(function(e){return an.call(t,e)})))}:on,cn=sn;function ln(t){return nn(t,yt,cn)}var fn=1,dn=Object.prototype.hasOwnProperty;var pn=1,hn="[object Arguments]",gn="[object Array]",vn="[object Object]",bn=Object.prototype.hasOwnProperty;function yn(t,e,r,n,o,i){var a=N(t),u=N(e),s=a?gn:er(t),c=u?gn:er(e),l=(s=s==hn?vn:s)==vn,f=(c=c==hn?vn:c)==vn,d=s==c;if(d&&V(t)){if(!V(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new Tr),a||nt(t)?Lr(t,e,r,n,o,i):function(t,e,r,n,o,i,a){switch(r){case Kr:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Qr:return!(t.byteLength!=e.byteLength||!i(new Fr(t),new Fr(e)));case Hr:case Vr:case qr:return qt(+t,+e);case Rr:return t.name==e.name&&t.message==e.message;case Xr:case Gr:return t==e+"";case Yr:var u=Ur;case Zr:var s=n&Wr;if(u||(u=Nr),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;n|=Br,a.set(t,e);var l=Lr(u(t),u(e),n,o,i,a);return a.delete(t),l;case Jr:if(en)return en.call(t)==en.call(e)}return!1}(t,e,s,r,n,o,i);if(!(r&pn)){var p=l&&bn.call(t,"__wrapped__"),h=f&&bn.call(e,"__wrapped__");if(p||h){var g=p?t.value():t,v=h?e.value():e;return i||(i=new Tr),o(g,v,r,n,i)}}return!!d&&(i||(i=new Tr),function(t,e,r,n,o,i){var a=r&fn,u=ln(t),s=u.length;if(s!=ln(e).length&&!a)return!1;for(var c=s;c--;){var l=u[c];if(!(a?l in e:dn.call(e,l)))return!1}var f=i.get(t),d=i.get(e);if(f&&d)return f==e&&d==t;var p=!0;i.set(t,e),i.set(e,t);for(var h=a;++c<s;){var g=t[l=u[c]],v=e[l];if(n)var b=a?n(v,g,l,e,t,i):n(g,v,l,t,e,i);if(!(void 0===b?g===v||o(g,v,r,n,i):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var y=t.constructor,m=e.constructor;y==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,n,o,i))}function mn(t,e,r,n,o){return t===e||(null==t||null==e||!m(t)&&!m(e)?t!=t&&e!=e:yn(t,e,r,n,mn,o))}var wn=1,jn=2;function $n(t){return t==t&&!i(t)}function On(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function xn(t){var e=function(t){for(var e=yt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,$n(o)]}return e}(t);return 1==e.length&&e[0][2]?On(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var s=(u=r[o])[0],c=t[s],l=u[1];if(a&&u[2]){if(void 0===c&&!(s in t))return!1}else{var f=new Tr;if(n)var d=n(c,l,s,t,e,f);if(!(void 0===d?mn(l,c,wn|jn,n,f):d))return!1}}return!0}(r,t,e)}}function _n(t,e){return null!=t&&e in Object(t)}function Sn(t,e){return null!=t&&function(t,e,r){for(var n=-1,o=(e=ge(e,t)).length,i=!1;++n<o;){var a=be(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&Z(o)&&q(a,o)&&(N(t)||U(t))}(t,e,_n)}var An=1,kn=2;function Pn(t){return Pt(t)?nr(be(t)):function(t){return function(e){return ye(e,t)}}(t)}function In(t){return"function"==typeof t?t:null==t?jt:"object"==typeof t?N(t)?(e=t[0],r=t[1],Pt(e)&&$n(r)?On(be(e),r):function(t){var n=me(t,e);return void 0===n&&n===r?Sn(t,e):mn(r,n,An|kn)}):xn(t):Pn(t);var e,r}function Tn(t,e){var r=-1,n=bt(t)?Array(t.length):[];return wt(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function Dn(t,e){return(N(t)?ce:Tn)(t,In(e))}var Mn=Array.prototype.join;function En(t,e){return null==t?"":Mn.call(t,e)}var Cn=et&&et.isRegExp,zn=Cn?J(Cn):function(t){return m(t)&&"[object RegExp]"==y(t)},Ln=30,Fn="...",Un=/\w*$/;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Nn={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",u="day",s="week",c="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},b=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},y={s:b,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+b(n,2,"0")+":"+b(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,c),i=r-o<0,a=e.clone().add(n+(i?-1:1),c);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:f,w:s,d:u,D:d,h:a,m:i,s:o,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",w={};w[m]=v;var j="$isDayjsObject",$=function(t){return t instanceof S||!(!t||!t[j])},O=function t(e,r,n){var o;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=e.split("-");if(!o&&a.length>1)return t(a[0])}else{var u=e.name;w[u]=e,o=u}return!n&&o&&(m=o),o||!n&&m},x=function(t,e){if($(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},_=y;_.l=O,_.i=$,_.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function v(t){this.$L=O(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[j]=!0}var b=v.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(h);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return _},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(t,e){var r=x(t);return this.startOf(e)<=r&&r<=this.endOf(e)},b.isAfter=function(t,e){return x(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<x(t)},b.$g=function(t,e,r){return _.u(t)?this[e]:this.set(r,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var r=this,n=!!_.u(e)||e,l=_.p(t),p=function(t,e){var o=_.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?o:o.endOf(u)},h=function(t,e){return _.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},g=this.$W,v=this.$M,b=this.$D,y="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case c:return n?p(1,v):p(0,v+1);case s:var m=this.$locale().weekStart||0,w=(g<m?g+7:g)-m;return p(n?b-w:b+(6-w),v);case u:case d:return h(y+"Hours",0);case a:return h(y+"Minutes",1);case i:return h(y+"Seconds",2);case o:return h(y+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var r,s=_.p(t),l="set"+(this.$u?"UTC":""),p=(r={},r[u]=l+"Date",r[d]=l+"Date",r[c]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[i]=l+"Minutes",r[o]=l+"Seconds",r[n]=l+"Milliseconds",r)[s],h=s===u?this.$D+(e-this.$W):e;if(s===c||s===f){var g=this.clone().set(d,1);g.$d[p](h),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[_.p(t)]()},b.add=function(n,l){var d,p=this;n=Number(n);var h=_.p(l),g=function(t){var e=x(p);return _.w(e.date(e.date()+Math.round(t*n)),p)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return g(1);if(h===s)return g(7);var v=(d={},d[i]=e,d[a]=r,d[o]=t,d)[h]||1,b=this.$d.getTime()+n*v;return _.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",o=_.z(this),i=this.$H,a=this.$m,u=this.$M,s=r.weekdays,c=r.months,l=r.meridiem,f=function(t,r,o,i){return t&&(t[r]||t(e,n))||o[r].slice(0,i)},d=function(t){return _.s(i%12||12,t,"0")},h=l||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(g,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return _.s(e.$y,4,"0");case"M":return u+1;case"MM":return _.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,c,3);case"MMMM":return f(c,u);case"D":return e.$D;case"DD":return _.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,s,2);case"ddd":return f(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(i);case"HH":return _.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return _.s(a,2,"0");case"s":return String(e.$s);case"ss":return _.s(e.$s,2,"0");case"SSS":return _.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(n,d,p){var h,g=this,v=_.p(d),b=x(n),y=(b.utcOffset()-this.utcOffset())*e,m=this-b,w=function(){return _.m(g,b)};switch(v){case f:h=w()/12;break;case c:h=w();break;case l:h=w()/3;break;case s:h=(m-y)/6048e5;break;case u:h=(m-y)/864e5;break;case a:h=m/r;break;case i:h=m/e;break;case o:h=m/t;break;default:h=m}return p?h:_.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=O(t,e,!0);return n&&(r.$L=n),r},b.clone=function(){return _.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},v}(),A=S.prototype;return x.prototype=A,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",u],["$M",c],["$y",f],["$D",d]].forEach((function(t){A[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),x.extend=function(t,e){return t.$i||(t(e,S,x),t.$i=!0),x},x.locale=O,x.isDayjs=$,x.unix=function(t){return x(1e3*t)},x.en=w[m],x.Ls=w,x.p={},x}()}({get exports(){return Nn},set exports(t){Nn=t}});var Wn=Nn;const Bn=[];for(let t=0;t<256;++t)Bn.push((t+256).toString(16).slice(1));const Hn=new Uint8Array(16);function Vn(){return crypto.getRandomValues(Hn)}const Rn={};function Yn(t,e,r){let n;if(t)n=qn(t.random??t.rng?.()??Vn(),t.msecs,t.seq,e,r);else{const t=Date.now(),o=Vn();!function(t,e,r){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=Xn(r),t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Rn,t,o),n=qn(o,Rn.msecs,Rn.seq,e,r)}return e??function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(Bn[t[e+0]]+Bn[t[e+1]]+Bn[t[e+2]]+Bn[t[e+3]]+"-"+Bn[t[e+4]]+Bn[t[e+5]]+"-"+Bn[t[e+6]]+Bn[t[e+7]]+"-"+Bn[t[e+8]]+Bn[t[e+9]]+"-"+Bn[t[e+10]]+Bn[t[e+11]]+Bn[t[e+12]]+Bn[t[e+13]]+Bn[t[e+14]]+Bn[t[e+15]]).toLowerCase()}(n)}function qn(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else n=new Uint8Array(16),o=0;return e??=Date.now(),r??=Xn(t),n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=255&e,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|3&t[10],n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}function Xn(t){return(127&t[6])<<24|t[7]<<16|t[8]<<8|t[9]}function Zn(t){let e=!1;if(Ar(t)){if(""===t.trim())return!1;e=!isNaN(Number(t))}else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(xr(t))return!1;e=!0}return e}var Gn=function(){try{var t=Bt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),Jn=Gn;function Qn(t,e,r){"__proto__"==e&&Jn?Jn(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var Kn=Object.prototype.hasOwnProperty;function to(t,e,r){var n=t[e];Kn.call(t,e)&&qt(n,r)&&(void 0!==r||e in t)||Qn(t,e,r)}function eo(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=n?n(r[u],t[u],u,r,t):void 0;void 0===s&&(s=t[u]),o?Qn(r,u,s):to(r,u,s)}return r}var ro=Object.prototype.hasOwnProperty;function no(t){if(!i(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=ut(t),r=[];for(var n in t)("constructor"!=n||!e&&ro.call(t,n))&&r.push(n);return r}function oo(t){return bt(t)?it(t,!0):no(t)}var io="object"==typeof exports&&exports&&!exports.nodeType&&exports,ao=io&&"object"==typeof module&&module&&!module.nodeType&&module,uo=ao&&ao.exports===io?s.Buffer:void 0,so=uo?uo.allocUnsafe:void 0;var co=st(Object.getPrototypeOf,Object),lo=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)rn(e,cn(t)),t=co(t);return e}:on,fo=lo;function po(t){return nn(t,oo,fo)}var ho=Object.prototype.hasOwnProperty;function go(t){var e=new t.constructor(t.byteLength);return new Fr(e).set(new Fr(t)),e}var vo=/\w*$/;var bo=c?c.prototype:void 0,yo=bo?bo.valueOf:void 0;var mo="[object Boolean]",wo="[object Date]",jo="[object Map]",$o="[object Number]",Oo="[object RegExp]",xo="[object Set]",_o="[object String]",So="[object Symbol]",Ao="[object ArrayBuffer]",ko="[object DataView]",Po="[object Float32Array]",Io="[object Float64Array]",To="[object Int8Array]",Do="[object Int16Array]",Mo="[object Int32Array]",Eo="[object Uint8Array]",Co="[object Uint8ClampedArray]",zo="[object Uint16Array]",Lo="[object Uint32Array]";function Fo(t,e,r){var n,o=t.constructor;switch(e){case Ao:return go(t);case mo:case wo:return new o(+t);case ko:return function(t,e){var r=e?go(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case Po:case Io:case To:case Do:case Mo:case Eo:case Co:case zo:case Lo:return function(t,e){var r=e?go(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case jo:return new o;case $o:case _o:return new o(t);case Oo:return function(t){var e=new t.constructor(t.source,vo.exec(t));return e.lastIndex=t.lastIndex,e}(t);case xo:return new o;case So:return n=t,yo?Object(yo.call(n)):{}}}var Uo=Object.create,No=function(){function t(){}return function(e){if(!i(e))return{};if(Uo)return Uo(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Wo=No;var Bo=et&&et.isMap,Ho=Bo?J(Bo):function(t){return m(t)&&"[object Map]"==er(t)};var Vo=et&&et.isSet,Ro=Vo?J(Vo):function(t){return m(t)&&"[object Set]"==er(t)},Yo=1,qo=2,Xo=4,Zo="[object Arguments]",Go="[object Function]",Jo="[object GeneratorFunction]",Qo="[object Object]",Ko={};function ti(t,e,r,n,o,a){var u,s=e&Yo,c=e&qo,l=e&Xo;if(r&&(u=o?r(t,n,o,a):r(t)),void 0!==u)return u;if(!i(t))return t;var f=N(t);if(f){if(u=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&ho.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,u)}else{var d=er(t),p=d==Go||d==Jo;if(V(t))return function(t,e){if(e)return t.slice();var r=t.length,n=so?so(r):new t.constructor(r);return t.copy(n),n}(t,s);if(d==Qo||d==Zo||p&&!o){if(u=c||p?{}:function(t){return"function"!=typeof t.constructor||ut(t)?{}:Wo(co(t))}(t),!s)return c?function(t,e){return eo(t,fo(t),e)}(t,function(t,e){return t&&eo(e,oo(e),t)}(u,t)):function(t,e){return eo(t,cn(t),e)}(t,function(t,e){return t&&eo(e,yt(e),t)}(u,t))}else{if(!Ko[d])return o?t:{};u=Fo(t,d,s)}}a||(a=new Tr);var h=a.get(t);if(h)return h;a.set(t,u),Ro(t)?t.forEach((function(n){u.add(ti(n,e,r,n,t,a))})):Ho(t)&&t.forEach((function(n,o){u.set(o,ti(n,e,r,o,t,a))}));var g=f?void 0:(l?c?po:ln:c?oo:yt)(t);return T(g||t,(function(n,o){g&&(n=t[o=n]),to(u,o,ti(n,e,r,o,t,a))})),u}Ko[Zo]=Ko["[object Array]"]=Ko["[object ArrayBuffer]"]=Ko["[object DataView]"]=Ko["[object Boolean]"]=Ko["[object Date]"]=Ko["[object Float32Array]"]=Ko["[object Float64Array]"]=Ko["[object Int8Array]"]=Ko["[object Int16Array]"]=Ko["[object Int32Array]"]=Ko["[object Map]"]=Ko["[object Number]"]=Ko[Qo]=Ko["[object RegExp]"]=Ko["[object Set]"]=Ko["[object String]"]=Ko["[object Symbol]"]=Ko["[object Uint8Array]"]=Ko["[object Uint8ClampedArray]"]=Ko["[object Uint16Array]"]=Ko["[object Uint32Array]"]=!0,Ko["[object Error]"]=Ko[Go]=Ko["[object WeakMap]"]=!1;var ei=1,ri=4;var ni={},oi={get exports(){return ni},set exports(t){ni=t}},ii={},ai={},ui={get exports(){return ai},set exports(t){ai=t}},si={};function ci(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var li=/javascript\s*\:/gim;si.whiteList=ci(),si.getDefaultWhiteList=ci,si.onAttr=function(t,e,r){},si.onIgnoreAttr=function(t,e,r){},si.safeAttrValue=function(t,e){return li.test(e)?"":e};var fi={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var di=function(t,e){";"!==(t=fi.trimRight(t))[t.length-1]&&(t+=";");var r=t.length,n=!1,o=0,i=0,a="";function u(){if(!n){var r=fi.trim(t.slice(o,i)),u=r.indexOf(":");if(-1!==u){var s=fi.trim(r.slice(0,u)),c=fi.trim(r.slice(u+1));if(s){var l=e(o,a.length,s,c,r);l&&(a+=l+"; ")}}}o=i+1}for(;i<r;i++){var s=t[i];if("/"===s&&"*"===t[i+1]){var c=t.indexOf("*/",i+2);if(-1===c)break;o=(i=c+1)+1,n=!1}else"("===s?n=!0:")"===s?n=!1:";"===s?n||u():"\n"===s&&u()}return fi.trim(a)},pi=si,hi=di;function gi(t){return null==t}function vi(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).whiteList=t.whiteList||pi.whiteList,t.onAttr=t.onAttr||pi.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||pi.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||pi.safeAttrValue,this.options=t}vi.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,r=e.whiteList,n=e.onAttr,o=e.onIgnoreAttr,i=e.safeAttrValue;return hi(t,(function(t,e,a,u,s){var c=r[a],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(u):c instanceof RegExp&&(l=c.test(u)),!0!==l&&(l=!1),u=i(a,u)){var f,d={position:e,sourcePosition:t,source:s,isWhite:l};return l?gi(f=n(a,u,d))?a+":"+u:f:gi(f=o(a,u,d))?void 0:f}}))};var bi=vi;!function(t,e){var r=si,n=bi;for(var o in(e=t.exports=function(t,e){return new n(e).process(t)}).FilterCSS=n,r)e[o]=r[o];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(ui,ai);var yi={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},mi=ai.FilterCSS,wi=ai.getDefaultWhiteList,ji=yi;function $i(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Oi=new mi;function xi(t){return t.replace(_i,"&lt;").replace(Si,"&gt;")}var _i=/</g,Si=/>/g,Ai=/"/g,ki=/&quot;/g,Pi=/&#([a-zA-Z0-9]*);?/gim,Ii=/&colon;?/gim,Ti=/&newline;?/gim,Di=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,Mi=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Ei=/u\s*r\s*l\s*\(.*/gi;function Ci(t){return t.replace(Ai,"&quot;")}function zi(t){return t.replace(ki,'"')}function Li(t){return t.replace(Pi,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function Fi(t){return t.replace(Ii,":").replace(Ti," ")}function Ui(t){for(var e="",r=0,n=t.length;r<n;r++)e+=t.charCodeAt(r)<32?" ":t.charAt(r);return ji.trim(e)}function Ni(t){return t=Ui(t=Fi(t=Li(t=zi(t))))}function Wi(t){return t=xi(t=Ci(t))}ii.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},ii.getDefaultWhiteList=$i,ii.onTag=function(t,e,r){},ii.onIgnoreTag=function(t,e,r){},ii.onTagAttr=function(t,e,r){},ii.onIgnoreTagAttr=function(t,e,r){},ii.safeAttrValue=function(t,e,r,n){if(r=Ni(r),"href"===e||"src"===e){if("#"===(r=ji.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===e){if(Di.lastIndex=0,Di.test(r))return""}else if("style"===e){if(Mi.lastIndex=0,Mi.test(r))return"";if(Ei.lastIndex=0,Ei.test(r)&&(Di.lastIndex=0,Di.test(r)))return"";!1!==n&&(r=(n=n||Oi).process(r))}return r=Wi(r)},ii.escapeHtml=xi,ii.escapeQuote=Ci,ii.unescapeQuote=zi,ii.escapeHtmlEntities=Li,ii.escapeDangerHtml5Entities=Fi,ii.clearNonPrintableCharacter=Ui,ii.friendlyAttrValue=Ni,ii.escapeAttrValue=Wi,ii.onIgnoreTagStripAll=function(){return""},ii.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var r=!Array.isArray(t),n=[],o=!1;return{onIgnoreTag:function(i,a,u){if(function(e){return!!r||-1!==ji.indexOf(t,e)}(i)){if(u.isClosing){var s="[/removed]",c=u.position+s.length;return n.push([!1!==o?o:u.position,c]),o=!1,s}return o||(o=u.position),"[removed]"}return e(i,a,u)},remove:function(t){var e="",r=0;return ji.forEach(n,(function(n){e+=t.slice(r,n[0]),r=n[1]})),e+=t.slice(r)}}},ii.stripCommentTag=function(t){for(var e="",r=0;r<t.length;){var n=t.indexOf("\x3c!--",r);if(-1===n){e+=t.slice(r);break}e+=t.slice(r,n);var o=t.indexOf("--\x3e",n);if(-1===o)break;r=o+3}return e},ii.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},ii.attributeWrapSign='"',ii.cssFilter=Oi,ii.getDefaultCSSWhiteList=wi;var Bi={},Hi=yi;function Vi(t){var e,r=Hi.spaceIndex(t);return e=-1===r?t.slice(1,-1):t.slice(1,r+1),"/"===(e=Hi.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function Ri(t){return"</"===t.slice(0,2)}var Yi=/[^a-zA-Z0-9\\_:.-]/gim;function qi(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Xi(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"'"===r||'"'===r?e:-1}}function Zi(t,e){for(;e>0;e--){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Gi(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}Bi.parseTag=function(t,e,r){var n="",o=0,i=!1,a=!1,u=0,s=t.length,c="",l="";t:for(u=0;u<s;u++){var f=t.charAt(u);if(!1===i){if("<"===f){i=u;continue}}else if(!1===a){if("<"===f){n+=r(t.slice(o,u)),i=u,o=u;continue}if(">"===f||u===s-1){n+=r(t.slice(o,i)),c=Vi(l=t.slice(i,u+1)),n+=e(i,n.length,c,l,Ri(l)),o=u+1,i=!1;continue}if('"'===f||"'"===f)for(var d=1,p=t.charAt(u-d);""===p.trim()||"="===p;){if("="===p){a=f;continue t}p=t.charAt(u-++d)}}else if(f===a){a=!1;continue}}return o<s&&(n+=r(t.substr(o))),n},Bi.parseAttr=function(t,e){var r=0,n=0,o=[],i=!1,a=t.length;function u(t,r){if(!((t=(t=Hi.trim(t)).replace(Yi,"").toLowerCase()).length<1)){var n=e(t,r||"");n&&o.push(n)}}for(var s=0;s<a;s++){var c,l=t.charAt(s);if(!1!==i||"="!==l)if(!1===i||s!==n)if(/\s|\n|\t/.test(l)){if(t=t.replace(/\s|\n|\t/g," "),!1===i){if(-1===(c=qi(t,s))){u(Hi.trim(t.slice(r,s))),i=!1,r=s+1;continue}s=c-1;continue}if(-1===(c=Zi(t,s-1))){u(i,Gi(Hi.trim(t.slice(r,s)))),i=!1,r=s+1;continue}}else;else{if(-1===(c=t.indexOf(l,s+1)))break;u(i,Hi.trim(t.slice(n+1,c))),i=!1,r=(s=c)+1}else i=t.slice(r,s),r=s+1,n='"'===t.charAt(r)||"'"===t.charAt(r)?r:Xi(t,s+1)}return r<t.length&&(!1===i?u(t.slice(r)):u(i,Gi(Hi.trim(t.slice(r))))),Hi.trim(o.join(" "))};var Ji=ai.FilterCSS,Qi=ii,Ki=Bi,ta=Ki.parseTag,ea=Ki.parseAttr,ra=yi;function na(t){return null==t}function oa(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=Qi.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var r in t)Array.isArray(t[r])?e[r.toLowerCase()]=t[r].map((function(t){return t.toLowerCase()})):e[r.toLowerCase()]=t[r];return e}(t.whiteList||t.allowList):t.whiteList=Qi.whiteList,this.attributeWrapSign=!0===t.singleQuotedAttributeValue?"'":Qi.attributeWrapSign,t.onTag=t.onTag||Qi.onTag,t.onTagAttr=t.onTagAttr||Qi.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||Qi.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||Qi.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||Qi.safeAttrValue,t.escapeHtml=t.escapeHtml||Qi.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new Ji(t.css))}oa.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this,r=e.options,n=r.whiteList,o=r.onTag,i=r.onIgnoreTag,a=r.onTagAttr,u=r.onIgnoreTagAttr,s=r.safeAttrValue,c=r.escapeHtml,l=e.attributeWrapSign,f=e.cssFilter;r.stripBlankChar&&(t=Qi.stripBlankChar(t)),r.allowCommentTag||(t=Qi.stripCommentTag(t));var d=!1;r.stripIgnoreTagBody&&(d=Qi.StripTagBody(r.stripIgnoreTagBody,i),i=d.onIgnoreTag);var p=ta(t,(function(t,e,r,d,p){var h={sourcePosition:t,position:e,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(n,r)},g=o(r,d,h);if(!na(g))return g;if(h.isWhite){if(h.isClosing)return"</"+r+">";var v=function(t){var e=ra.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var r="/"===(t=ra.trim(t.slice(e+1,-1)))[t.length-1];return r&&(t=ra.trim(t.slice(0,-1))),{html:t,closing:r}}(d),b=n[r],y=ea(v.html,(function(t,e){var n=-1!==ra.indexOf(b,t),o=a(r,t,e,n);return na(o)?n?(e=s(r,t,e,f))?t+"="+l+e+l:t:na(o=u(r,t,e,n))?void 0:o:o}));return d="<"+r,y&&(d+=" "+y),v.closing&&(d+=" /"),d+=">"}return na(g=i(r,d,h))?c(d):g}),c);return d&&(p=d.remove(p)),p};var ia=oa;!function(t,e){var r=ii,n=Bi,o=ia;function i(t,e){return new o(e).process(t)}(e=t.exports=i).filterXSS=i,e.FilterXSS=o,function(){for(var t in r)e[t]=r[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(oi,ni);var aa=ni;function ua(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let sa=/<(?=[A-Za-z!/?]|$)/g;function ca(t){return t.replace(sa,"&lt;")}let la={getFilterXSS:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:aa;if(_t(t))return t;let e=ua(),r=me(e,"filterXSS",null);if(_t(r))return r;let n=me(e,"xss",null);if(_t(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(t){return{escapeHtml:ca,onIgnoreTagAttr:function(e,r,n,o){if("style"===r)return r+'="'+t.escapeAttrValue(n)+'"'}}}};function fa(t){let e=null,r=null;let n=function t(n){return Ot(n)||xt(n)?($t(n,(function(e,r){n[r]=t(e)})),n):Ar(n)?(o=n,null===e&&(e=la.getFilterXSS(),r=la.getOpt(e)),e(o,r)):n;var o}(ti(t,ei|ri));return n}function da(t,e){if(!Ot(t))return[];Ot(e)||(e=[e]);let r=[];return $t(t,((t,n)=>{0===me(t,"ok")&&r.push({k:n,id:me(e,[n,"id"]),err:me(t,"err","")})})),r}function pa(t,r){let n=Dn((a=10,(o=r)&&o.length?e(o,0,(a=u||void 0===a?1:I(a))<0?0:a):[]),(t=>Ar(t.ref)?t.ref:Ar(t.id)||Zn(t.id)?`id[${function(t,e){var r=Ln,n=Fn;if(i(e)){var o="separator"in e?e.separator:o;r="length"in e?I(e.length):r,n="omission"in e?pe(e.omission):n}var a=(t=he(t)).length;if(_e(t)){var u=Fe(t);a=u.length}if(r>=a)return t;var s=r-br(n);if(s<1)return n;var c=u?je(u,0,s).join(""):t.slice(0,s);if(void 0===o)return c+n;if(u&&(s+=c.length-s),zn(o)){if(t.slice(s).search(o)){var l,f=c;for(o.global||(o=RegExp(o.source,he(Un.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var d=l.index;c=c.slice(0,void 0===d?s:d)}}else if(t.indexOf(pe(o),s)!=s){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+n}(String(t.id),{length:100,omission:"…"})}]`:`data[${t.k}]`));var o,a,u;let s=`${t}: ${En(n,", ")}`;return wr(r)>10&&(s+=`, ... (${wr(r)} in total)`),s}function ha(t,e){if(e.indexOf("id")<0)return!1;let r=me(t,"settings",null);if($r(r)&&!0!==me(r,"id.pk"))return!1;let n=me(r,"id.type","")||me(t,"kpType.id","");return!(Ar(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.split("(")[0].trim().toUpperCase())<0)}function ga(t,e){return null!==t&&"object"==typeof t&&"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e)?void 0===t[e]?null:t[e]:null}function va(t){return"number"==typeof t&&Number.isFinite(t)}function ba(t){return va(t)?String(t):t}function ya(t,e){return Object.fromEntries(Object.keys(t).map((r=>[r,e(t[r],r)])))}const ma=Object.freeze({proto:"unsupported key[__proto__]",accessor:"unsupported accessor property",unreadable:"unreadable value",deep:"too deep"}),wa=64;function ja(t){try{for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];console.log(t,...r)}catch(e){try{console.log(t,"(unprintable)")}catch(t){}}}function $a(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0;try{let r=new Set,n=[t,1];for(;n.length>0;){let t=n.pop(),o=n.pop(),i=Array.isArray(o);if(r.has(o)||!i&&!xt(o))continue;if(t>e)return"deep";if(r.add(o),Object.prototype.hasOwnProperty.call(o,"__proto__"))return"proto";let a=i?null:Object.keys(o),u=i?o.length:a.length;for(let e=0;e<u;e++){let r=Object.getOwnPropertyDescriptor(o,i?e:a[e]);if(void 0!==r){if(void 0!==r.get||void 0!==r.set)return"accessor";"object"==typeof r.value&&null!==r.value&&n.push(r.value,t+1)}}}return null}catch(t){return"unreadable"}}function Oa(t,e){try{if(void 0!==e&&!function(t){if(!xt(t))return!1;let e=Object.getPrototypeOf(t);return null===e||null===Object.getPrototypeOf(e)&&"function"==typeof e.constructor&&Function.prototype.toString.call(e.constructor)===Function.prototype.toString.call(Object)}(e))return`invalid find of ${t}, need an object`;let r=$a(e,wa);return null!==r?`invalid find of ${t}, ${ma[r]}`:null}catch(e){return`invalid find of ${t}, ${ma.unreadable}`}}function xa(t,e){let r=new Map,n=(t,e)=>{r.has(t)||r.set(t,[]),r.get(t).push({k:e})};if(Array.isArray(e))for(let t=0;t<e.length;t++)try{let r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r)continue;if(void 0!==r.get||void 0!==r.set){n("accessor",t);continue}let o=$a(r.value);null!==o&&n(o,t)}catch(e){n("unreadable",t)}else{let t=$a(e);null!==t&&n(t,0)}return Dn([...r],(e=>{let[r,n]=e;return pa(`${t}, ${ma[r]}`,n)}))}function _a(t){let e=!Ot(t),r=Dn(e?[t]:t,(t=>xt(t)&&va(t.id)?{...t,id:ba(t.id)}:t));return e?r[0]:r}function Sa(t){return xt(t)?ya(t,((t,e)=>"$not"===e?Sa(t):["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin","$all"].indexOf(e)>=0?Ot(t)?Dn(t,ba):ba(t):t)):ba(t)}function Aa(t){return xt(t)?ya(t,((t,e)=>"id"===e?Sa(t):["$and","$or","$nor"].indexOf(e)>=0&&Ot(t)?Dn(t,Aa):t)):t}function ka(t){let e=[];return $t(Ot(t)?t:[t],((t,r)=>{xt(t)||e.push({k:r})})),e}function Pa(t){let e=ba(me(t,"id"));return Ar(e)?e:null}function Ia(t){let e=[];return $t(Ot(t)?t:[t],((t,r)=>{let n=me(t,"id");Ar(n)&&fa(n)!==n&&e.push({k:r,id:n})})),e}function Ta(t,e){return pa(`${t}, id contains HTML markup`,Dn(e,(t=>({k:t.k}))))}function Da(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"save";if(!$r(t))throw console.log("ds",t),new Error("invalid ds");let i=t[e].keys,a=!1;Ot(n)||(a=!0,n=[n]);let u=function(){if(!_t(Wn))throw new Error("invalid dayjs");return Wn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}();if(o.indexOf("insert")>=0&&(i.indexOf("userId")>=0&&$t(n,((t,e)=>{n[e].userId=r})),i.indexOf("timeCreate")>=0&&$t(n,((t,e)=>{n[e].timeCreate=u})),i.indexOf("userIdUpdate")>=0&&$t(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&$t(n,((t,e)=>{n[e].timeUpdate=u}))),(o.indexOf("insert")>=0||o.indexOf("save")>=0)&&(i.indexOf("userIdUpdate")>=0&&$t(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&$t(n,((t,e)=>{n[e].timeUpdate=u}))),n=Dn(n,(t=>ya(t,(t=>fa(t))))),ha(t[e],i)){(a?$r(n[0]):Sr(n))&&$t(n,(t=>{Ar(t.id)||(t.id=Yn())}))}return n=a?n[0]:n}async function Ma(t,e,r,n,o,i){try{return await async function(t,e,r,n,o,i){let a,u=null;if(!$r(e))return Promise.reject("invalid woItems");let s=ga(e,n);if(null===s)return Promise.reject(`can not find table[${"string"==typeof n?n:""}] in ORM`);let c=function(t,e){let r=ga(t,e),n=me(r,"keys",null);return!!Ot(n)&&ha(r,n)}(t,n);if("select"===o){let t=Oa("select",i);if(null!==t)return ja(`${n}.select invalid find`,i),Promise.reject(t);if(a=await s.select(c?Aa(i):i).catch((t=>{console.log(`${n}.select catch`,t),u="failed to select data"})),Ar(u))return Promise.reject(u)}else if("insert"===o||"save"===o){let e=i,l="insert"===o?"failed to insert data":"failed to save data",f=ka(i);if(wr(f)>0)return console.log(`${n}.${o} data is not an object`,f),Promise.reject(pa(`${l}, not an object`,f));let d=xa(l,i);if(wr(d)>0)return console.log(`${n}.${o} data has unsupported key`,d),Promise.reject(En(d,"; "));c&&(i=_a(i));let p=Ia(i);if(wr(p)>0)return console.log(`${n}.${o} id changed by clearXSS`,p),Promise.reject(Ta(l,p));try{i=Da(t,n,r,i,o)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if("insert"===o?a=await s.insert(i).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})):"save"===o&&(a=await s.save(i).catch((t=>{console.log(`${n}.save catch`,t),u="failed to save data"}))),Ar(u))return Promise.reject(u);if("save"===o){let t=da(a,i);if(wr(t)>0)return console.log(`${n}.save fail`,t),Promise.reject(pa("failed to save data",da(a,e)))}a=Ot(i)?Dn(i,(t=>({id:t.id}))):{id:i.id}}else if("del"===o){if(c&&(i=_a(i)),a=await s.del(i).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"})),!Ar(u)){let t=da(a,i);wr(t)>0&&(console.log(`${n}.del fail`,t),u=pa("failed to delete data",t))}}else if("delAll"===o){let t=Oa("delAll",i);if(null!==t)return ja(`${n}.delAll invalid find`,i),Promise.reject(t);a=await s.delAll(c?Aa(i):i).catch((t=>{console.log(`${n}.delAll catch`,t),u="failed to delete data"}))}else if("mix"===o){if(!$r(i))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");for(let t of["add","del","diff"]){let e=Object.getOwnPropertyDescriptor(i,t);if(void 0!==e&&(void 0!==e.get||void 0!==e.set))return Promise.reject(`invalid input of mix, ${ma.accessor}`)}i={add:i.add,del:i.del,diff:i.diff};for(let t of["add","del","diff"])if(void 0!==i[t]&&!Ot(i[t]))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let e=[];for(let[t,r]of[["add","failed to insert data"],["diff","failed to update data"]]){let o=ka(me(i,t,[]));wr(o)>0&&(console.log(`${n}.mix ${t} data is not an object`,o),e.push(pa(`${r}, not an object`,o)))}if(wr(e)>0)return Promise.reject(En(e,"; "));let o=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]])o.push(...xa(e,me(i,t,[])));if(wr(o)>0)return console.log(`${n}.mix data has unsupported key`,o),Promise.reject(En(o,"; "));if(c){i={...i};for(let t of["add","del","diff"])Ot(i[t])&&(i[t]=_a(i[t]))}let l=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]]){let r=Ia(me(i,t,[]));wr(r)>0&&(console.log(`${n}.mix ${t} id changed by clearXSS`,r),l.push(Ta(e,r)))}if(wr(l)>0)return Promise.reject(En(l,"; "));let f,d=function(t){let e=[];for(let[r,n]of[["add","del"],["del","diff"]]){let o=new Map;$t(me(t,r,[]),((t,e)=>{let r=Pa(t);null!==r&&o.set(r,[...o.get(r)||[],e])}));let i=[],a=[];if($t(me(t,n,[]),((t,e)=>{let r=Pa(t);null!==r&&o.has(r)&&(i=[...i,...o.get(r)],a.push(e))})),wr(a)>0){let t=[...Dn([...new Set(i)].sort(((t,e)=>t-e)),(t=>({ref:`${r}[${t}]`}))),...Dn(a,(t=>({ref:`${n}[${t}]`})))];e.push(pa(`invalid input of mix, same id in ${r} and ${n}`,t))}}return e}(i);if(wr(d)>0)return console.log(`${n}.mix same id across steps`,d),Promise.reject(En(d,"; "));a=[];let p=[],h=me(i,"add",[]);if(wr(h)>0){try{h=Da(t,n,r,h,"insert+save")}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if(await s.insert(h).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})),Ar(u))return Promise.reject(u);f=Dn(h,(t=>({id:t.id}))),a=[...a,...f]}let g=me(i,"del",[]);if(wr(g)>0){let t=await s.del(g).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"}));if(Ar(u))return Promise.reject(u);let e=da(t,g);wr(e)>0&&(console.log(`${n}.del fail`,e),p.push(pa("failed to delete data",e))),f=Dn(g,(t=>({id:t.id}))),a=[...a,...f]}let v=me(i,"diff",[]);if(wr(v)>0){let e=v;try{v=Da(t,n,r,v)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}let o=await s.save(v).catch((t=>{console.log(`${n}.save catch`,t),u="failed to update data"}));if(Ar(u))return Promise.reject(u);let i=da(o,v);wr(i)>0&&(console.log(`${n}.save fail`,i),p.push(pa("failed to update data",da(o,e)))),f=Dn(v,(t=>({id:t.id}))),a=[...a,...f]}if(wr(p)>0)return Promise.reject(En(p,"; "))}else u=`invalid mode: ${o}`;if(Ar(u))return Promise.reject(u);return a}(t,e,r,n,o,i)}catch(t){return"string"==typeof t?Promise.reject(t):(ja(`${"string"==typeof n?n:""}.${"string"==typeof o?o:""} mapOrm catch`,t),Promise.reject("failed to process input"))}}function Ea(t,e){return async(r,n,o,i)=>Ma(t,e,r,n,o,i)}function Ca(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!_t(e)){let o=`${r} needs a function, but got ${typeof e}`;throw n&&t.push((()=>Promise.reject(o))),new Error(o)}setTimeout((()=>{t.push(e)}),1)}function za(t){if(we(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),!_t(t))throw new Error("invalid mapOrm");let e={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:t};return{addFunCheck:t=>{Ca(e.funChecks,t,"addFunCheck",!0)},addFunPreProcessing:t=>{Ca(e.funPreProcessing,t,"addFunPreProcessing")},addFunPostProcessing:t=>{Ca(e.funPostProcessing,t,"addFunPostProcessing")},procOrm:async(t,r,n,o)=>async function(t,e,r,n,o){await St(t.funChecks,(t=>t({woName:r,userId:e,mode:n,input:o})));for(let i of[...t.funPreProcessing]){let t=await i({woName:r,userId:e,mode:n,input:o});if(!$r(t)||void 0===t.input)return Promise.reject("invalid return of pre-processing, need an object with input");o=t.input}let i=await t.mapOrm(e,r,n,o);for(let a of[...t.funPostProcessing])i=await a({woName:r,userId:e,mode:n,input:o,output:i});return i}(e,t,r,n,o)}}return function(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};we(o);let i=function(t,e,r,n){if(!$r(t))throw console.log("ds",t),new Error("invalid ds");if(!_t(e))throw console.log("WOrm",e),new Error("invalid WOrm");if(!Ar(r))throw console.log("url",r),new Error("invalid url");if(!Ar(n))throw console.log("db",n),new Error("invalid db");let o={};return $t(yt(t),(t=>{let i=new e({url:r,db:n,cl:t});Object.defineProperty(o,t,{value:i,enumerable:!0,writable:!0,configurable:!0})})),o}(t,e,r,n),a=za(Ea(t,i),o);return{...Ir,woItems:i,closeAll:async()=>{await St(i,(async t=>{t&&_t(t.close)&&await t.close()}))},...a}}}));
6
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("fs"),require("util")):"function"==typeof define&&define.amd?define(["fs","util"],e):(t="undefined"!=typeof globalThis?globalThis:t||self)["w-serv-orm"]=e(t.fs,t.util$2)}(this,(function(t,e){"use strict";function r(t,e,r){var n=-1,o=t.length;e<0&&(e=-e>o?0:o+e),(r=r>o?o:r)<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+e];return i}var n=/\s/;var o=/^\s+/;function i(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}(t)+1).replace(o,""):t}function a(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var u="object"==typeof global&&global&&global.Object===Object&&global,s="object"==typeof self&&self&&self.Object===Object&&self,c=u||s||Function("return this")(),l=c.Symbol,f=Object.prototype,d=f.hasOwnProperty,p=f.toString,h=l?l.toStringTag:void 0;var g=Object.prototype.toString;var v="[object Null]",b="[object Undefined]",y=l?l.toStringTag:void 0;function m(t){return null==t?void 0===t?b:v:y&&y in Object(t)?function(t){var e=d.call(t,h),r=t[h];try{t[h]=void 0;var n=!0}catch(t){}var o=p.call(t);return n&&(e?t[h]=r:delete t[h]),o}(t):function(t){return g.call(t)}(t)}function w(t){return null!=t&&"object"==typeof t}var j="[object Symbol]";function O(t){return"symbol"==typeof t||w(t)&&m(t)==j}var $=NaN,x=/^[-+]0x[0-9a-f]+$/i,_=/^0b[01]+$/i,S=/^0o[0-7]+$/i,A=parseInt;var k=1/0,P=17976931348623157e292;function I(t){return t?(t=function(t){if("number"==typeof t)return t;if(O(t))return $;if(a(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=a(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=i(t);var r=_.test(t);return r||S.test(t)?A(t.slice(2),r?2:8):x.test(t)?$:+t}(t))===k||t===-k?(t<0?-1:1)*P:t==t?t:0:0===t?t:0}function D(t){var e=I(t),r=e%1;return e==e?r?e-r:e:0}function T(t,e){for(var r=-1,n=null==t?0:t.length;++r<n&&!1!==e(t[r],r,t););return t}var M,E=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var u=i[M?a:++n];if(!1===e(o[u],u,o))break}return t};function C(t){return w(t)&&"[object Arguments]"==m(t)}var z=Object.prototype,F=z.hasOwnProperty,L=z.propertyIsEnumerable,U=C(function(){return arguments}())?C:function(t){return w(t)&&F.call(t,"callee")&&!L.call(t,"callee")},R=U,W=Array.isArray;var N="object"==typeof exports&&exports&&!exports.nodeType&&exports,B=N&&"object"==typeof module&&module&&!module.nodeType&&module,V=B&&B.exports===N?c.Buffer:void 0,H=(V?V.isBuffer:void 0)||function(){return!1},Y=9007199254740991,q=/^(?:0|[1-9]\d*)$/;function X(t,e){var r=typeof t;return!!(e=null==e?Y:e)&&("number"==r||"symbol"!=r&&q.test(t))&&t>-1&&t%1==0&&t<e}var K=9007199254740991;function Z(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=K}var G={};function J(t){return function(e){return t(e)}}G["[object Float32Array]"]=G["[object Float64Array]"]=G["[object Int8Array]"]=G["[object Int16Array]"]=G["[object Int32Array]"]=G["[object Uint8Array]"]=G["[object Uint8ClampedArray]"]=G["[object Uint16Array]"]=G["[object Uint32Array]"]=!0,G["[object Arguments]"]=G["[object Array]"]=G["[object ArrayBuffer]"]=G["[object Boolean]"]=G["[object DataView]"]=G["[object Date]"]=G["[object Error]"]=G["[object Function]"]=G["[object Map]"]=G["[object Number]"]=G["[object Object]"]=G["[object RegExp]"]=G["[object Set]"]=G["[object String]"]=G["[object WeakMap]"]=!1;var Q="object"==typeof exports&&exports&&!exports.nodeType&&exports,tt=Q&&"object"==typeof module&&module&&!module.nodeType&&module,et=tt&&tt.exports===Q&&u.process,rt=function(){try{var t=tt&&tt.require&&tt.require("util").types;return t||et&&et.binding&&et.binding("util")}catch(t){}}(),nt=rt&&rt.isTypedArray,ot=nt?J(nt):function(t){return w(t)&&Z(t.length)&&!!G[m(t)]},it=Object.prototype.hasOwnProperty;function at(t,e){var r=W(t),n=!r&&R(t),o=!r&&!n&&H(t),i=!r&&!n&&!o&&ot(t),a=r||n||o||i,u=a?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],s=u.length;for(var c in t)!e&&!it.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||X(c,s))||u.push(c);return u}var ut=Object.prototype;function st(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||ut)}function ct(t,e){return function(r){return t(e(r))}}var lt=ct(Object.keys,Object),ft=Object.prototype.hasOwnProperty;function dt(t){if(!st(t))return lt(t);var e=[];for(var r in Object(t))ft.call(t,r)&&"constructor"!=r&&e.push(r);return e}var pt="[object AsyncFunction]",ht="[object Function]",gt="[object GeneratorFunction]",vt="[object Proxy]";function bt(t){if(!a(t))return!1;var e=m(t);return e==ht||e==gt||e==pt||e==vt}function yt(t){return null!=t&&Z(t.length)&&!bt(t)}function mt(t){return yt(t)?at(t):dt(t)}var wt=function(t,e){return function(r,n){if(null==r)return r;if(!yt(r))return t(r,n);for(var o=r.length,i=e?o:-1,a=Object(r);(e?i--:++i<o)&&!1!==n(a[i],i,a););return r}}((function(t,e){return t&&E(t,e,mt)})),jt=wt;function Ot(t){return t}function $t(t,e){var r;return(W(t)?T:jt)(t,"function"==typeof(r=e)?r:Ot)}function xt(t){return bt(t)}function _t(t){try{t instanceof Promise&&Promise.prototype.then.call(t,void 0,(()=>{}))}catch(t){}}function St(t){return"[object Array]"===Object.prototype.toString.call(t)}function At(t){return"[object Object]"===Object.prototype.toString.call(t)}function kt(t,e){let n=function(){let t,e,r=new Promise((function(){t=arguments[0],e=arguments[1]}));return r.resolve=t,r.reject=e,r}(),o=!1;try{let e=function(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[],n=!1;try{if(Array.isArray(t)){let e=t.length;r.length=e;for(let n=0;n<e;n++)n in t&&(r[n]=t[n])}else{if(e||!At(t)&&!St(t))return null;{n=!0;let e=Object.keys(t);for(let n=0;n<e.length;n++)r.push({k:e[n],v:t[e[n]]})}}}catch(t){throw r.forEach((t=>{_t(n?t.v:t)})),t}return{items:r,useObj:n}}(t);if(null===e)return n.reject("rs is not an array or object"),n;t=e.items,o=e.useObj}catch(t){return n.reject(t),n}xt(e)||($t(t,(t=>{_t(o?t.v:t)})),e=function(t){return t});let i=xt(e),a=-1,u=[];return t.reduce((function(t,r){return t.then((function(t){u.push(t),a+=1;let n=a,s=r;return o&&(n=r.k,s=r.v),i?e(s,n):s}))}),Promise.resolve()).then((function(t){var e,o,i,a;u.push(t),a=null==(e=u)?0:e.length,u=a?r(e,(o=i||void 0===o?1:D(o))<0?0:o,a):[],n.resolve(u)})).catch((function(t){n.reject(t)})),n}var Pt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,It=/^\w*$/;function Dt(t,e){if(W(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!O(t))||(It.test(t)||!Pt.test(t)||null!=e&&t in Object(e))}var Tt,Mt=c["__core-js_shared__"],Et=(Tt=/[^.]+$/.exec(Mt&&Mt.keys&&Mt.keys.IE_PROTO||""))?"Symbol(src)_1."+Tt:"";var Ct=Function.prototype.toString;function zt(t){if(null!=t){try{return Ct.call(t)}catch(t){}try{return t+""}catch(t){}}return""}var Ft=/^\[object .+?Constructor\]$/,Lt=Function.prototype,Ut=Object.prototype,Rt=Lt.toString,Wt=Ut.hasOwnProperty,Nt=RegExp("^"+Rt.call(Wt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Bt(t){return!(!a(t)||(e=t,Et&&Et in e))&&(bt(t)?Nt:Ft).test(zt(t));var e}function Vt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return Bt(r)?r:void 0}var Ht=Vt(Object,"create");var Yt=Object.prototype.hasOwnProperty;var qt=Object.prototype.hasOwnProperty;function Xt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function Kt(t,e){return t===e||t!=t&&e!=e}function Zt(t,e){for(var r=t.length;r--;)if(Kt(t[r][0],e))return r;return-1}Xt.prototype.clear=function(){this.__data__=Ht?Ht(null):{},this.size=0},Xt.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},Xt.prototype.get=function(t){var e=this.__data__;if(Ht){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Yt.call(e,t)?e[t]:void 0},Xt.prototype.has=function(t){var e=this.__data__;return Ht?void 0!==e[t]:qt.call(e,t)},Xt.prototype.set=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Ht&&void 0===e?"__lodash_hash_undefined__":e,this};var Gt=Array.prototype.splice;function Jt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Jt.prototype.clear=function(){this.__data__=[],this.size=0},Jt.prototype.delete=function(t){var e=this.__data__,r=Zt(e,t);return!(r<0)&&(r==e.length-1?e.pop():Gt.call(e,r,1),--this.size,!0)},Jt.prototype.get=function(t){var e=this.__data__,r=Zt(e,t);return r<0?void 0:e[r][1]},Jt.prototype.has=function(t){return Zt(this.__data__,t)>-1},Jt.prototype.set=function(t,e){var r=this.__data__,n=Zt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};var Qt=Vt(c,"Map");function te(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function ee(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}ee.prototype.clear=function(){this.size=0,this.__data__={hash:new Xt,map:new(Qt||Jt),string:new Xt}},ee.prototype.delete=function(t){var e=te(this,t).delete(t);return this.size-=e?1:0,e},ee.prototype.get=function(t){return te(this,t).get(t)},ee.prototype.has=function(t){return te(this,t).has(t)},ee.prototype.set=function(t,e){var r=te(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};var re="Expected a function";function ne(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError(re);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(ne.Cache||ee),r}ne.Cache=ee;var oe,ie,ae,ue=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,se=/\\(\\)?/g,ce=(oe=function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ue,(function(t,r,n,o){e.push(n?o.replace(se,"$1"):r||t)})),e},ie=ne(oe,(function(t){return 500===ae.size&&ae.clear(),t})),ae=ie.cache,ie),le=ce;function fe(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}var de=1/0,pe=l?l.prototype:void 0,he=pe?pe.toString:void 0;function ge(t){if("string"==typeof t)return t;if(W(t))return fe(t,ge)+"";if(O(t))return he?he.call(t):"";var e=t+"";return"0"==e&&1/t==-de?"-0":e}function ve(t){return null==t?"":ge(t)}function be(t,e){return W(t)?t:Dt(t,e)?[t]:le(ve(t))}var ye=1/0;function me(t){if("string"==typeof t||O(t))return t;var e=t+"";return"0"==e&&1/t==-ye?"-0":e}function we(t,e){for(var r=0,n=(e=be(e,t)).length;null!=t&&r<n;)t=t[me(e[r++])];return r&&r==n?t:void 0}function je(t,e,r){var n=null==t?void 0:we(t,e);return void 0===n?r:n}function Oe(t){let e="procOrm does not authorize users, authorize where procOrm is exposed to clients",r=[["useCheckUser",e],["getUserById",e],["useExcludeWhenNotAdmin","procOrm does not filter select results by user, use addFunPostProcessing if needed"]];for(let[e,n]of r){let r=je(t,e);if(null!=r&&!1!==r)throw new Error(`opt.${e} has been removed, ${n}`)}}function $e(t,e,n){var o=t.length;return n=void 0===n?o:n,!e&&n>=o?t:r(t,e,n)}function xe(t){return t!=t}function _e(t,e,r){return e==e?function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}(t,e,r):function(t,e,r,n){for(var o=t.length,i=r+(n?1:-1);n?i--:++i<o;)if(e(t[i],i,t))return i;return-1}(t,xe,r)}var Se=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]");function Ae(t){return Se.test(t)}var ke="\\ud800-\\udfff",Pe="["+ke+"]",Ie="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",De="\\ud83c[\\udffb-\\udfff]",Te="[^"+ke+"]",Me="(?:\\ud83c[\\udde6-\\uddff]){2}",Ee="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="(?:"+Ie+"|"+De+")"+"?",ze="[\\ufe0e\\ufe0f]?",Fe=ze+Ce+("(?:\\u200d(?:"+[Te,Me,Ee].join("|")+")"+ze+Ce+")*"),Le="(?:"+[Te+Ie+"?",Ie,Me,Ee,Pe].join("|")+")",Ue=RegExp(De+"(?="+De+")|"+Le+Fe,"g");function Re(t){return Ae(t)?function(t){return t.match(Ue)||[]}(t):function(t){return t.split("")}(t)}function We(t,e,r){if((t=ve(t))&&(r||void 0===e))return i(t);if(!t||!(e=ge(e)))return t;var n=Re(t),o=Re(e),a=function(t,e){for(var r=-1,n=t.length;++r<n&&_e(e,t[r],0)>-1;);return r}(n,o),u=function(t,e){for(var r=t.length;r--&&_e(e,t[r],0)>-1;);return r}(n,o)+1;return $e(n,a,u).join("")}var Ne=Vt(c,"DataView"),Be=Vt(c,"Promise"),Ve=Vt(c,"Set"),He=Vt(c,"WeakMap"),Ye="[object Map]",qe="[object Promise]",Xe="[object Set]",Ke="[object WeakMap]",Ze="[object DataView]",Ge=zt(Ne),Je=zt(Qt),Qe=zt(Be),tr=zt(Ve),er=zt(He),rr=m;(Ne&&rr(new Ne(new ArrayBuffer(1)))!=Ze||Qt&&rr(new Qt)!=Ye||Be&&rr(Be.resolve())!=qe||Ve&&rr(new Ve)!=Xe||He&&rr(new He)!=Ke)&&(rr=function(t){var e=m(t),r="[object Object]"==e?t.constructor:void 0,n=r?zt(r):"";if(n)switch(n){case Ge:return Ze;case Je:return Ye;case Qe:return qe;case tr:return Xe;case er:return Ke}return e});var nr=rr,or="[object String]";function ir(t){return function(e){return null==e?void 0:e[t]}}var ar=ir("length"),ur="\\ud800-\\udfff",sr="["+ur+"]",cr="[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]",lr="\\ud83c[\\udffb-\\udfff]",fr="[^"+ur+"]",dr="(?:\\ud83c[\\udde6-\\uddff]){2}",pr="[\\ud800-\\udbff][\\udc00-\\udfff]",hr="(?:"+cr+"|"+lr+")"+"?",gr="[\\ufe0e\\ufe0f]?",vr=gr+hr+("(?:\\u200d(?:"+[fr,dr,pr].join("|")+")"+gr+hr+")*"),br="(?:"+[fr+cr+"?",cr,dr,pr,sr].join("|")+")",yr=RegExp(lr+"(?="+lr+")|"+br+vr,"g");function mr(t){return Ae(t)?function(t){for(var e=yr.lastIndex=0;yr.test(t);)++e;return e}(t):ar(t)}var wr="[object Map]",jr="[object Set]";function Or(t){if(null==t)return 0;if(yt(t))return"string"==typeof(e=t)||!W(e)&&w(e)&&m(e)==or?mr(t):t.length;var e,r=nr(t);return r==wr||r==jr?t.size:dt(t).length}function $r(t){let e=je(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs");return!!function(t){let e=je(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"fs"),r=!1;try{e.statSync(t),r=!0}catch{r=!1}return r}(t,{fs:e})&&(!e.lstatSync(t).isDirectory()&&!e.lstatSync(t).isSymbolicLink())}function xr(t){if(At(t)){for(let e in t)return!0;return!1}return!1}function _r(t){return"[object String]"===Object.prototype.toString.call(t)}function Sr(t){if(t!=t)return!0;if(null!==t&&"object"==typeof t)try{let e=Number.prototype.valueOf.call(t);return Number.isNaN(e)}catch(t){return!1}return!1}function Ar(t){return!!function(t){return"[object Undefined]"===Object.prototype.toString.call(t)}(t)||(!!function(t){return"[object Null]"===Object.prototype.toString.call(t)}(t)||(!!function(t){if(At(t)){for(let e in t)return!1;return!0}return!1}(t)||(!!function(t){return!(!_r(t)||0!==t.length)}(t)||(!!function(t){return!!St(t)&&0===t.length}(t)||!!Sr(t)))))}function kr(t){return!!St(t)&&(0!==t.length&&(1!==t.length||!Ar(t[0])))}function Pr(t){return!!(_r(t)&&t.length>0)}var Ir="[object Boolean]";function Dr(t){return!0===(e=t)||!1===e||w(e)&&m(e)==Ir;var e}let Tr={backup:async function(t){if(!xr(t))throw console.log("woItems",t),new Error("invalid woItems");return await kt(t,(async(t,e)=>(console.log("backup...",e),{name:e,data:await t.select()})))},recover:async function(e,r,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!$r(e,{fs:t}))throw console.log("fp",e),new Error("fp is not exist");if(!xr(r))throw console.log("woItems",r),new Error("invalid woItems");xt(n)||(n=null),Dr(o)||(o=!1);let i=t.readFileSync(e,"utf8");i=We(i);let a=function(t){let e=je(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},"returnWithStateAndMsg",null);Dr(e)||(e=!1);let r=t=>e?{state:"error",msg:t}:{};if(!Pr(t))return r("invalid v");let n={};try{n=JSON.parse(t)}catch(t){return r(t.toString())}return e?{state:"success",msg:n}:n}(i);if(!kr(a))throw new Error("invalid backup data, need a non-empty array");$t(a,((t,e)=>{let n=je(t,"name");if(!Pr(n))throw new Error(`invalid backup data, rs[${e}].name is not a string`);if(!Object.prototype.hasOwnProperty.call(r,n))throw new Error(`invalid backup data, table[${n}] is not in woItems`)})),xt(n)&&n(),await kt(a,(async t=>{console.log("recover...",t.name),o&&(console.log("needCreateStorage"),await r[t.name].createStorage());let e=null;return Or(t.data)>0&&(e=await r[t.name].insert(t.data)),e}))}};function Mr(t){var e=this.__data__=new Jt(t);this.size=e.size}Mr.prototype.clear=function(){this.__data__=new Jt,this.size=0},Mr.prototype.delete=function(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r},Mr.prototype.get=function(t){return this.__data__.get(t)},Mr.prototype.has=function(t){return this.__data__.has(t)},Mr.prototype.set=function(t,e){var r=this.__data__;if(r instanceof Jt){var n=r.__data__;if(!Qt||n.length<199)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new ee(n)}return r.set(t,e),this.size=r.size,this};function Er(t){var e=-1,r=null==t?0:t.length;for(this.__data__=new ee;++e<r;)this.add(t[e])}function Cr(t,e){for(var r=-1,n=null==t?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}function zr(t,e){return t.has(e)}Er.prototype.add=Er.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Er.prototype.has=function(t){return this.__data__.has(t)};var Fr=1,Lr=2;function Ur(t,e,r,n,o,i){var a=r&Fr,u=t.length,s=e.length;if(u!=s&&!(a&&s>u))return!1;var c=i.get(t),l=i.get(e);if(c&&l)return c==e&&l==t;var f=-1,d=!0,p=r&Lr?new Er:void 0;for(i.set(t,e),i.set(e,t);++f<u;){var h=t[f],g=e[f];if(n)var v=a?n(g,h,f,e,t,i):n(h,g,f,t,e,i);if(void 0!==v){if(v)continue;d=!1;break}if(p){if(!Cr(e,(function(t,e){if(!zr(p,e)&&(h===t||o(h,t,r,n,i)))return p.push(e)}))){d=!1;break}}else if(h!==g&&!o(h,g,r,n,i)){d=!1;break}}return i.delete(t),i.delete(e),d}var Rr=c.Uint8Array;function Wr(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function Nr(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var Br=1,Vr=2,Hr="[object Boolean]",Yr="[object Date]",qr="[object Error]",Xr="[object Map]",Kr="[object Number]",Zr="[object RegExp]",Gr="[object Set]",Jr="[object String]",Qr="[object Symbol]",tn="[object ArrayBuffer]",en="[object DataView]",rn=l?l.prototype:void 0,nn=rn?rn.valueOf:void 0;function on(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}function an(t,e,r){var n=e(t);return W(t)?n:on(n,r(t))}function un(){return[]}var sn=Object.prototype.propertyIsEnumerable,cn=Object.getOwnPropertySymbols,ln=cn?function(t){return null==t?[]:(t=Object(t),function(t,e){for(var r=-1,n=null==t?0:t.length,o=0,i=[];++r<n;){var a=t[r];e(a,r,t)&&(i[o++]=a)}return i}(cn(t),(function(e){return sn.call(t,e)})))}:un,fn=ln;function dn(t){return an(t,mt,fn)}var pn=1,hn=Object.prototype.hasOwnProperty;var gn=1,vn="[object Arguments]",bn="[object Array]",yn="[object Object]",mn=Object.prototype.hasOwnProperty;function wn(t,e,r,n,o,i){var a=W(t),u=W(e),s=a?bn:nr(t),c=u?bn:nr(e),l=(s=s==vn?yn:s)==yn,f=(c=c==vn?yn:c)==yn,d=s==c;if(d&&H(t)){if(!H(e))return!1;a=!0,l=!1}if(d&&!l)return i||(i=new Mr),a||ot(t)?Ur(t,e,r,n,o,i):function(t,e,r,n,o,i,a){switch(r){case en:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case tn:return!(t.byteLength!=e.byteLength||!i(new Rr(t),new Rr(e)));case Hr:case Yr:case Kr:return Kt(+t,+e);case qr:return t.name==e.name&&t.message==e.message;case Zr:case Jr:return t==e+"";case Xr:var u=Wr;case Gr:var s=n&Br;if(u||(u=Nr),t.size!=e.size&&!s)return!1;var c=a.get(t);if(c)return c==e;n|=Vr,a.set(t,e);var l=Ur(u(t),u(e),n,o,i,a);return a.delete(t),l;case Qr:if(nn)return nn.call(t)==nn.call(e)}return!1}(t,e,s,r,n,o,i);if(!(r&gn)){var p=l&&mn.call(t,"__wrapped__"),h=f&&mn.call(e,"__wrapped__");if(p||h){var g=p?t.value():t,v=h?e.value():e;return i||(i=new Mr),o(g,v,r,n,i)}}return!!d&&(i||(i=new Mr),function(t,e,r,n,o,i){var a=r&pn,u=dn(t),s=u.length;if(s!=dn(e).length&&!a)return!1;for(var c=s;c--;){var l=u[c];if(!(a?l in e:hn.call(e,l)))return!1}var f=i.get(t),d=i.get(e);if(f&&d)return f==e&&d==t;var p=!0;i.set(t,e),i.set(e,t);for(var h=a;++c<s;){var g=t[l=u[c]],v=e[l];if(n)var b=a?n(v,g,l,e,t,i):n(g,v,l,t,e,i);if(!(void 0===b?g===v||o(g,v,r,n,i):b)){p=!1;break}h||(h="constructor"==l)}if(p&&!h){var y=t.constructor,m=e.constructor;y==m||!("constructor"in t)||!("constructor"in e)||"function"==typeof y&&y instanceof y&&"function"==typeof m&&m instanceof m||(p=!1)}return i.delete(t),i.delete(e),p}(t,e,r,n,o,i))}function jn(t,e,r,n,o){return t===e||(null==t||null==e||!w(t)&&!w(e)?t!=t&&e!=e:wn(t,e,r,n,jn,o))}var On=1,$n=2;function xn(t){return t==t&&!a(t)}function _n(t,e){return function(r){return null!=r&&(r[t]===e&&(void 0!==e||t in Object(r)))}}function Sn(t){var e=function(t){for(var e=mt(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,xn(o)]}return e}(t);return 1==e.length&&e[0][2]?_n(e[0][0],e[0][1]):function(r){return r===t||function(t,e,r,n){var o=r.length,i=o,a=!n;if(null==t)return!i;for(t=Object(t);o--;){var u=r[o];if(a&&u[2]?u[1]!==t[u[0]]:!(u[0]in t))return!1}for(;++o<i;){var s=(u=r[o])[0],c=t[s],l=u[1];if(a&&u[2]){if(void 0===c&&!(s in t))return!1}else{var f=new Mr;if(n)var d=n(c,l,s,t,e,f);if(!(void 0===d?jn(l,c,On|$n,n,f):d))return!1}}return!0}(r,t,e)}}function An(t,e){return null!=t&&e in Object(t)}function kn(t,e){return null!=t&&function(t,e,r){for(var n=-1,o=(e=be(e,t)).length,i=!1;++n<o;){var a=me(e[n]);if(!(i=null!=t&&r(t,a)))break;t=t[a]}return i||++n!=o?i:!!(o=null==t?0:t.length)&&Z(o)&&X(a,o)&&(W(t)||R(t))}(t,e,An)}var Pn=1,In=2;function Dn(t){return Dt(t)?ir(me(t)):function(t){return function(e){return we(e,t)}}(t)}function Tn(t){return"function"==typeof t?t:null==t?Ot:"object"==typeof t?W(t)?(e=t[0],r=t[1],Dt(e)&&xn(r)?_n(me(e),r):function(t){var n=je(t,e);return void 0===n&&n===r?kn(t,e):jn(r,n,Pn|In)}):Sn(t):Dn(t);var e,r}function Mn(t,e){var r=-1,n=yt(t)?Array(t.length):[];return jt(t,(function(t,o,i){n[++r]=e(t,o,i)})),n}function En(t,e){return(W(t)?fe:Mn)(t,Tn(e))}var Cn=Array.prototype.join;function zn(t,e){return null==t?"":Cn.call(t,e)}var Fn=rt&&rt.isRegExp,Ln=Fn?J(Fn):function(t){return w(t)&&"[object RegExp]"==m(t)},Un=30,Rn="...",Wn=/\w*$/;function Nn(t,e){var r=Un,n=Rn;if(a(e)){var o="separator"in e?e.separator:o;r="length"in e?D(e.length):r,n="omission"in e?ge(e.omission):n}var i=(t=ve(t)).length;if(Ae(t)){var u=Re(t);i=u.length}if(r>=i)return t;var s=r-mr(n);if(s<1)return n;var c=u?$e(u,0,s).join(""):t.slice(0,s);if(void 0===o)return c+n;if(u&&(s+=c.length-s),Ln(o)){if(t.slice(s).search(o)){var l,f=c;for(o.global||(o=RegExp(o.source,ve(Wn.exec(o))+"g")),o.lastIndex=0;l=o.exec(f);)var d=l.index;c=c.slice(0,void 0===d?s:d)}}else if(t.indexOf(ge(o),s)!=s){var p=c.lastIndexOf(o);p>-1&&(c=c.slice(0,p))}return c+n}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var Bn={};!function(t,e){t.exports=function(){var t=1e3,e=6e4,r=36e5,n="millisecond",o="second",i="minute",a="hour",u="day",s="week",c="month",l="quarter",f="year",d="date",p="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}},b=function(t,e,r){var n=String(t);return!n||n.length>=e?t:""+Array(e+1-n.length).join(r)+t},y={s:b,z:function(t){var e=-t.utcOffset(),r=Math.abs(e),n=Math.floor(r/60),o=r%60;return(e<=0?"+":"-")+b(n,2,"0")+":"+b(o,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var n=12*(r.year()-e.year())+(r.month()-e.month()),o=e.clone().add(n,c),i=r-o<0,a=e.clone().add(n+(i?-1:1),c);return+(-(n+(r-o)/(i?o-a:a-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:c,y:f,w:s,d:u,D:d,h:a,m:i,s:o,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",w={};w[m]=v;var j="$isDayjsObject",O=function(t){return t instanceof S||!(!t||!t[j])},$=function t(e,r,n){var o;if(!e)return m;if("string"==typeof e){var i=e.toLowerCase();w[i]&&(o=i),r&&(w[i]=r,o=i);var a=e.split("-");if(!o&&a.length>1)return t(a[0])}else{var u=e.name;w[u]=e,o=u}return!n&&o&&(m=o),o||!n&&m},x=function(t,e){if(O(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new S(r)},_=y;_.l=$,_.i=O,_.w=function(t,e){return x(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function v(t){this.$L=$(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[j]=!0}var b=v.prototype;return b.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if(_.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var n=e.match(h);if(n){var o=n[2]-1||0,i=(n[7]||"0").substring(0,3);return r?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,i)}}return new Date(e)}(t),this.init()},b.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},b.$utils=function(){return _},b.isValid=function(){return!(this.$d.toString()===p)},b.isSame=function(t,e){var r=x(t);return this.startOf(e)<=r&&r<=this.endOf(e)},b.isAfter=function(t,e){return x(t)<this.startOf(e)},b.isBefore=function(t,e){return this.endOf(e)<x(t)},b.$g=function(t,e,r){return _.u(t)?this[e]:this.set(r,t)},b.unix=function(){return Math.floor(this.valueOf()/1e3)},b.valueOf=function(){return this.$d.getTime()},b.startOf=function(t,e){var r=this,n=!!_.u(e)||e,l=_.p(t),p=function(t,e){var o=_.w(r.$u?Date.UTC(r.$y,e,t):new Date(r.$y,e,t),r);return n?o:o.endOf(u)},h=function(t,e){return _.w(r.toDate()[t].apply(r.toDate("s"),(n?[0,0,0,0]:[23,59,59,999]).slice(e)),r)},g=this.$W,v=this.$M,b=this.$D,y="set"+(this.$u?"UTC":"");switch(l){case f:return n?p(1,0):p(31,11);case c:return n?p(1,v):p(0,v+1);case s:var m=this.$locale().weekStart||0,w=(g<m?g+7:g)-m;return p(n?b-w:b+(6-w),v);case u:case d:return h(y+"Hours",0);case a:return h(y+"Minutes",1);case i:return h(y+"Seconds",2);case o:return h(y+"Milliseconds",3);default:return this.clone()}},b.endOf=function(t){return this.startOf(t,!1)},b.$set=function(t,e){var r,s=_.p(t),l="set"+(this.$u?"UTC":""),p=(r={},r[u]=l+"Date",r[d]=l+"Date",r[c]=l+"Month",r[f]=l+"FullYear",r[a]=l+"Hours",r[i]=l+"Minutes",r[o]=l+"Seconds",r[n]=l+"Milliseconds",r)[s],h=s===u?this.$D+(e-this.$W):e;if(s===c||s===f){var g=this.clone().set(d,1);g.$d[p](h),g.init(),this.$d=g.set(d,Math.min(this.$D,g.daysInMonth())).$d}else p&&this.$d[p](h);return this.init(),this},b.set=function(t,e){return this.clone().$set(t,e)},b.get=function(t){return this[_.p(t)]()},b.add=function(n,l){var d,p=this;n=Number(n);var h=_.p(l),g=function(t){var e=x(p);return _.w(e.date(e.date()+Math.round(t*n)),p)};if(h===c)return this.set(c,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===u)return g(1);if(h===s)return g(7);var v=(d={},d[i]=e,d[a]=r,d[o]=t,d)[h]||1,b=this.$d.getTime()+n*v;return _.w(b,this)},b.subtract=function(t,e){return this.add(-1*t,e)},b.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||p;var n=t||"YYYY-MM-DDTHH:mm:ssZ",o=_.z(this),i=this.$H,a=this.$m,u=this.$M,s=r.weekdays,c=r.months,l=r.meridiem,f=function(t,r,o,i){return t&&(t[r]||t(e,n))||o[r].slice(0,i)},d=function(t){return _.s(i%12||12,t,"0")},h=l||function(t,e,r){var n=t<12?"AM":"PM";return r?n.toLowerCase():n};return n.replace(g,(function(t,n){return n||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return _.s(e.$y,4,"0");case"M":return u+1;case"MM":return _.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,c,3);case"MMMM":return f(c,u);case"D":return e.$D;case"DD":return _.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,s,2);case"ddd":return f(r.weekdaysShort,e.$W,s,3);case"dddd":return s[e.$W];case"H":return String(i);case"HH":return _.s(i,2,"0");case"h":return d(1);case"hh":return d(2);case"a":return h(i,a,!0);case"A":return h(i,a,!1);case"m":return String(a);case"mm":return _.s(a,2,"0");case"s":return String(e.$s);case"ss":return _.s(e.$s,2,"0");case"SSS":return _.s(e.$ms,3,"0");case"Z":return o}return null}(t)||o.replace(":","")}))},b.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},b.diff=function(n,d,p){var h,g=this,v=_.p(d),b=x(n),y=(b.utcOffset()-this.utcOffset())*e,m=this-b,w=function(){return _.m(g,b)};switch(v){case f:h=w()/12;break;case c:h=w();break;case l:h=w()/3;break;case s:h=(m-y)/6048e5;break;case u:h=(m-y)/864e5;break;case a:h=m/r;break;case i:h=m/e;break;case o:h=m/t;break;default:h=m}return p?h:_.a(h)},b.daysInMonth=function(){return this.endOf(c).$D},b.$locale=function(){return w[this.$L]},b.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),n=$(t,e,!0);return n&&(r.$L=n),r},b.clone=function(){return _.w(this.$d,this)},b.toDate=function(){return new Date(this.valueOf())},b.toJSON=function(){return this.isValid()?this.toISOString():null},b.toISOString=function(){return this.$d.toISOString()},b.toString=function(){return this.$d.toUTCString()},v}(),A=S.prototype;return x.prototype=A,[["$ms",n],["$s",o],["$m",i],["$H",a],["$W",u],["$M",c],["$y",f],["$D",d]].forEach((function(t){A[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),x.extend=function(t,e){return t.$i||(t(e,S,x),t.$i=!0),x},x.locale=$,x.isDayjs=O,x.unix=function(t){return x(1e3*t)},x.en=w[m],x.Ls=w,x.p={},x}()}({get exports(){return Bn},set exports(t){Bn=t}});var Vn=Bn;const Hn=[];for(let t=0;t<256;++t)Hn.push((t+256).toString(16).slice(1));const Yn=new Uint8Array(16);function qn(){return crypto.getRandomValues(Yn)}const Xn={};function Kn(t,e,r){let n;if(t)n=Zn(t.random??t.rng?.()??qn(),t.msecs,t.seq,e,r);else{const t=Date.now(),o=qn();!function(t,e,r){t.msecs??=-1/0,t.seq??=0,e>t.msecs?(t.seq=Gn(r),t.msecs=e):(t.seq=t.seq+1|0,0===t.seq&&t.msecs++)}(Xn,t,o),n=Zn(o,Xn.msecs,Xn.seq,e,r)}return e??function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(Hn[t[e+0]]+Hn[t[e+1]]+Hn[t[e+2]]+Hn[t[e+3]]+"-"+Hn[t[e+4]]+Hn[t[e+5]]+"-"+Hn[t[e+6]]+Hn[t[e+7]]+"-"+Hn[t[e+8]]+Hn[t[e+9]]+"-"+Hn[t[e+10]]+Hn[t[e+11]]+Hn[t[e+12]]+Hn[t[e+13]]+Hn[t[e+14]]+Hn[t[e+15]]).toLowerCase()}(n)}function Zn(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(t.length<16)throw new Error("Random bytes length must be >= 16");if(n){if(o<0||o+16>n.length)throw new RangeError(`UUID byte range ${o}:${o+15} is out of buffer bounds`)}else n=new Uint8Array(16),o=0;return e??=Date.now(),r??=Gn(t),n[o++]=e/1099511627776&255,n[o++]=e/4294967296&255,n[o++]=e/16777216&255,n[o++]=e/65536&255,n[o++]=e/256&255,n[o++]=255&e,n[o++]=112|r>>>28&15,n[o++]=r>>>20&255,n[o++]=128|r>>>14&63,n[o++]=r>>>6&255,n[o++]=r<<2&255|3&t[10],n[o++]=t[11],n[o++]=t[12],n[o++]=t[13],n[o++]=t[14],n[o++]=t[15],n}function Gn(t){return(127&t[6])<<24|t[7]<<16|t[8]<<8|t[9]}function Jn(t){let e=!1;if(Pr(t)){if(""===t.trim())return!1;e=!isNaN(Number(t))}else if(function(t){return"[object Number]"===Object.prototype.toString.call(t)}(t)){if(Sr(t))return!1;e=!0}return e}var Qn=function(){try{var t=Vt(Object,"defineProperty");return t({},"",{}),t}catch(t){}}(),to=Qn;function eo(t,e,r){"__proto__"==e&&to?to(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var ro=Object.prototype.hasOwnProperty;function no(t,e,r){var n=t[e];ro.call(t,e)&&Kt(n,r)&&(void 0!==r||e in t)||eo(t,e,r)}function oo(t,e,r,n){var o=!r;r||(r={});for(var i=-1,a=e.length;++i<a;){var u=e[i],s=n?n(r[u],t[u],u,r,t):void 0;void 0===s&&(s=t[u]),o?eo(r,u,s):no(r,u,s)}return r}var io=Object.prototype.hasOwnProperty;function ao(t){if(!a(t))return function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}(t);var e=st(t),r=[];for(var n in t)("constructor"!=n||!e&&io.call(t,n))&&r.push(n);return r}function uo(t){return yt(t)?at(t,!0):ao(t)}var so="object"==typeof exports&&exports&&!exports.nodeType&&exports,co=so&&"object"==typeof module&&module&&!module.nodeType&&module,lo=co&&co.exports===so?c.Buffer:void 0,fo=lo?lo.allocUnsafe:void 0;var po=ct(Object.getPrototypeOf,Object),ho=Object.getOwnPropertySymbols?function(t){for(var e=[];t;)on(e,fn(t)),t=po(t);return e}:un,go=ho;function vo(t){return an(t,uo,go)}var bo=Object.prototype.hasOwnProperty;function yo(t){var e=new t.constructor(t.byteLength);return new Rr(e).set(new Rr(t)),e}var mo=/\w*$/;var wo=l?l.prototype:void 0,jo=wo?wo.valueOf:void 0;var Oo="[object Boolean]",$o="[object Date]",xo="[object Map]",_o="[object Number]",So="[object RegExp]",Ao="[object Set]",ko="[object String]",Po="[object Symbol]",Io="[object ArrayBuffer]",Do="[object DataView]",To="[object Float32Array]",Mo="[object Float64Array]",Eo="[object Int8Array]",Co="[object Int16Array]",zo="[object Int32Array]",Fo="[object Uint8Array]",Lo="[object Uint8ClampedArray]",Uo="[object Uint16Array]",Ro="[object Uint32Array]";function Wo(t,e,r){var n,o=t.constructor;switch(e){case Io:return yo(t);case Oo:case $o:return new o(+t);case Do:return function(t,e){var r=e?yo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,r);case To:case Mo:case Eo:case Co:case zo:case Fo:case Lo:case Uo:case Ro:return function(t,e){var r=e?yo(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,r);case xo:return new o;case _o:case ko:return new o(t);case So:return function(t){var e=new t.constructor(t.source,mo.exec(t));return e.lastIndex=t.lastIndex,e}(t);case Ao:return new o;case Po:return n=t,jo?Object(jo.call(n)):{}}}var No=Object.create,Bo=function(){function t(){}return function(e){if(!a(e))return{};if(No)return No(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}(),Vo=Bo;var Ho=rt&&rt.isMap,Yo=Ho?J(Ho):function(t){return w(t)&&"[object Map]"==nr(t)};var qo=rt&&rt.isSet,Xo=qo?J(qo):function(t){return w(t)&&"[object Set]"==nr(t)},Ko=1,Zo=2,Go=4,Jo="[object Arguments]",Qo="[object Function]",ti="[object GeneratorFunction]",ei="[object Object]",ri={};function ni(t,e,r,n,o,i){var u,s=e&Ko,c=e&Zo,l=e&Go;if(r&&(u=o?r(t,n,o,i):r(t)),void 0!==u)return u;if(!a(t))return t;var f=W(t);if(f){if(u=function(t){var e=t.length,r=new t.constructor(e);return e&&"string"==typeof t[0]&&bo.call(t,"index")&&(r.index=t.index,r.input=t.input),r}(t),!s)return function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}(t,u)}else{var d=nr(t),p=d==Qo||d==ti;if(H(t))return function(t,e){if(e)return t.slice();var r=t.length,n=fo?fo(r):new t.constructor(r);return t.copy(n),n}(t,s);if(d==ei||d==Jo||p&&!o){if(u=c||p?{}:function(t){return"function"!=typeof t.constructor||st(t)?{}:Vo(po(t))}(t),!s)return c?function(t,e){return oo(t,go(t),e)}(t,function(t,e){return t&&oo(e,uo(e),t)}(u,t)):function(t,e){return oo(t,fn(t),e)}(t,function(t,e){return t&&oo(e,mt(e),t)}(u,t))}else{if(!ri[d])return o?t:{};u=Wo(t,d,s)}}i||(i=new Mr);var h=i.get(t);if(h)return h;i.set(t,u),Xo(t)?t.forEach((function(n){u.add(ni(n,e,r,n,t,i))})):Yo(t)&&t.forEach((function(n,o){u.set(o,ni(n,e,r,o,t,i))}));var g=f?void 0:(l?c?vo:dn:c?uo:mt)(t);return T(g||t,(function(n,o){g&&(n=t[o=n]),no(u,o,ni(n,e,r,o,t,i))})),u}ri[Jo]=ri["[object Array]"]=ri["[object ArrayBuffer]"]=ri["[object DataView]"]=ri["[object Boolean]"]=ri["[object Date]"]=ri["[object Float32Array]"]=ri["[object Float64Array]"]=ri["[object Int8Array]"]=ri["[object Int16Array]"]=ri["[object Int32Array]"]=ri["[object Map]"]=ri["[object Number]"]=ri[ei]=ri["[object RegExp]"]=ri["[object Set]"]=ri["[object String]"]=ri["[object Symbol]"]=ri["[object Uint8Array]"]=ri["[object Uint8ClampedArray]"]=ri["[object Uint16Array]"]=ri["[object Uint32Array]"]=!0,ri["[object Error]"]=ri[Qo]=ri["[object WeakMap]"]=!1;var oi=1,ii=4;var ai={},ui={get exports(){return ai},set exports(t){ai=t}},si={},ci={},li={get exports(){return ci},set exports(t){ci=t}},fi={};function di(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var pi=/javascript\s*\:/gim;fi.whiteList=di(),fi.getDefaultWhiteList=di,fi.onAttr=function(t,e,r){},fi.onIgnoreAttr=function(t,e,r){},fi.safeAttrValue=function(t,e){return pi.test(e)?"":e};var hi={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var gi=function(t,e){";"!==(t=hi.trimRight(t))[t.length-1]&&(t+=";");var r=t.length,n=!1,o=0,i=0,a="";function u(){if(!n){var r=hi.trim(t.slice(o,i)),u=r.indexOf(":");if(-1!==u){var s=hi.trim(r.slice(0,u)),c=hi.trim(r.slice(u+1));if(s){var l=e(o,a.length,s,c,r);l&&(a+=l+"; ")}}}o=i+1}for(;i<r;i++){var s=t[i];if("/"===s&&"*"===t[i+1]){var c=t.indexOf("*/",i+2);if(-1===c)break;o=(i=c+1)+1,n=!1}else"("===s?n=!0:")"===s?n=!1:";"===s?n||u():"\n"===s&&u()}return hi.trim(a)},vi=fi,bi=gi;function yi(t){return null==t}function mi(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).whiteList=t.whiteList||vi.whiteList,t.onAttr=t.onAttr||vi.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||vi.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||vi.safeAttrValue,this.options=t}mi.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,r=e.whiteList,n=e.onAttr,o=e.onIgnoreAttr,i=e.safeAttrValue;return bi(t,(function(t,e,a,u,s){var c=r[a],l=!1;if(!0===c?l=c:"function"==typeof c?l=c(u):c instanceof RegExp&&(l=c.test(u)),!0!==l&&(l=!1),u=i(a,u)){var f,d={position:e,sourcePosition:t,source:s,isWhite:l};return l?yi(f=n(a,u,d))?a+":"+u:f:yi(f=o(a,u,d))?void 0:f}}))};var wi=mi;!function(t,e){var r=fi,n=wi;for(var o in(e=t.exports=function(t,e){return new n(e).process(t)}).FilterCSS=n,r)e[o]=r[o];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(li,ci);var ji={indexOf:function(t,e){var r,n;if(Array.prototype.indexOf)return t.indexOf(e);for(r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1},forEach:function(t,e,r){var n,o;if(Array.prototype.forEach)return t.forEach(e,r);for(n=0,o=t.length;n<o;n++)e.call(r,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},Oi=ci.FilterCSS,$i=ci.getDefaultWhiteList,xi=ji;function _i(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Si=new Oi;function Ai(t){return t.replace(ki,"&lt;").replace(Pi,"&gt;")}var ki=/</g,Pi=/>/g,Ii=/"/g,Di=/&quot;/g,Ti=/&#([a-zA-Z0-9]*);?/gim,Mi=/&colon;?/gim,Ei=/&newline;?/gim,Ci=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,zi=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,Fi=/u\s*r\s*l\s*\(.*/gi;function Li(t){return t.replace(Ii,"&quot;")}function Ui(t){return t.replace(Di,'"')}function Ri(t){return t.replace(Ti,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function Wi(t){return t.replace(Mi,":").replace(Ei," ")}function Ni(t){for(var e="",r=0,n=t.length;r<n;r++)e+=t.charCodeAt(r)<32?" ":t.charAt(r);return xi.trim(e)}function Bi(t){return t=Ni(t=Wi(t=Ri(t=Ui(t))))}function Vi(t){return t=Ai(t=Li(t))}si.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},si.getDefaultWhiteList=_i,si.onTag=function(t,e,r){},si.onIgnoreTag=function(t,e,r){},si.onTagAttr=function(t,e,r){},si.onIgnoreTagAttr=function(t,e,r){},si.safeAttrValue=function(t,e,r,n){if(r=Bi(r),"href"===e||"src"===e){if("#"===(r=xi.trim(r)))return"#";if("http://"!==r.substr(0,7)&&"https://"!==r.substr(0,8)&&"mailto:"!==r.substr(0,7)&&"tel:"!==r.substr(0,4)&&"data:image/"!==r.substr(0,11)&&"ftp://"!==r.substr(0,6)&&"./"!==r.substr(0,2)&&"../"!==r.substr(0,3)&&"#"!==r[0]&&"/"!==r[0])return""}else if("background"===e){if(Ci.lastIndex=0,Ci.test(r))return""}else if("style"===e){if(zi.lastIndex=0,zi.test(r))return"";if(Fi.lastIndex=0,Fi.test(r)&&(Ci.lastIndex=0,Ci.test(r)))return"";!1!==n&&(r=(n=n||Si).process(r))}return r=Vi(r)},si.escapeHtml=Ai,si.escapeQuote=Li,si.unescapeQuote=Ui,si.escapeHtmlEntities=Ri,si.escapeDangerHtml5Entities=Wi,si.clearNonPrintableCharacter=Ni,si.friendlyAttrValue=Bi,si.escapeAttrValue=Vi,si.onIgnoreTagStripAll=function(){return""},si.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var r=!Array.isArray(t),n=[],o=!1;return{onIgnoreTag:function(i,a,u){if(function(e){return!!r||-1!==xi.indexOf(t,e)}(i)){if(u.isClosing){var s="[/removed]",c=u.position+s.length;return n.push([!1!==o?o:u.position,c]),o=!1,s}return o||(o=u.position),"[removed]"}return e(i,a,u)},remove:function(t){var e="",r=0;return xi.forEach(n,(function(n){e+=t.slice(r,n[0]),r=n[1]})),e+=t.slice(r)}}},si.stripCommentTag=function(t){for(var e="",r=0;r<t.length;){var n=t.indexOf("\x3c!--",r);if(-1===n){e+=t.slice(r);break}e+=t.slice(r,n);var o=t.indexOf("--\x3e",n);if(-1===o)break;r=o+3}return e},si.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},si.attributeWrapSign='"',si.cssFilter=Si,si.getDefaultCSSWhiteList=$i;var Hi={},Yi=ji;function qi(t){var e,r=Yi.spaceIndex(t);return e=-1===r?t.slice(1,-1):t.slice(1,r+1),"/"===(e=Yi.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function Xi(t){return"</"===t.slice(0,2)}var Ki=/[^a-zA-Z0-9\\_:.-]/gim;function Zi(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Gi(t,e){for(;e<t.length;e++){var r=t[e];if(" "!==r)return"'"===r||'"'===r?e:-1}}function Ji(t,e){for(;e>0;e--){var r=t[e];if(" "!==r)return"="===r?e:-1}}function Qi(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}Hi.parseTag=function(t,e,r){var n="",o=0,i=!1,a=!1,u=0,s=t.length,c="",l="";t:for(u=0;u<s;u++){var f=t.charAt(u);if(!1===i){if("<"===f){i=u;continue}}else if(!1===a){if("<"===f){n+=r(t.slice(o,u)),i=u,o=u;continue}if(">"===f||u===s-1){n+=r(t.slice(o,i)),c=qi(l=t.slice(i,u+1)),n+=e(i,n.length,c,l,Xi(l)),o=u+1,i=!1;continue}if('"'===f||"'"===f)for(var d=1,p=t.charAt(u-d);""===p.trim()||"="===p;){if("="===p){a=f;continue t}p=t.charAt(u-++d)}}else if(f===a){a=!1;continue}}return o<s&&(n+=r(t.substr(o))),n},Hi.parseAttr=function(t,e){var r=0,n=0,o=[],i=!1,a=t.length;function u(t,r){if(!((t=(t=Yi.trim(t)).replace(Ki,"").toLowerCase()).length<1)){var n=e(t,r||"");n&&o.push(n)}}for(var s=0;s<a;s++){var c,l=t.charAt(s);if(!1!==i||"="!==l)if(!1===i||s!==n)if(/\s|\n|\t/.test(l)){if(t=t.replace(/\s|\n|\t/g," "),!1===i){if(-1===(c=Zi(t,s))){u(Yi.trim(t.slice(r,s))),i=!1,r=s+1;continue}s=c-1;continue}if(-1===(c=Ji(t,s-1))){u(i,Qi(Yi.trim(t.slice(r,s)))),i=!1,r=s+1;continue}}else;else{if(-1===(c=t.indexOf(l,s+1)))break;u(i,Yi.trim(t.slice(n+1,c))),i=!1,r=(s=c)+1}else i=t.slice(r,s),r=s+1,n='"'===t.charAt(r)||"'"===t.charAt(r)?r:Gi(t,s+1)}return r<t.length&&(!1===i?u(t.slice(r)):u(i,Qi(Yi.trim(t.slice(r))))),Yi.trim(o.join(" "))};var ta=ci.FilterCSS,ea=si,ra=Hi,na=ra.parseTag,oa=ra.parseAttr,ia=ji;function aa(t){return null==t}function ua(t){(t=function(t){var e={};for(var r in t)e[r]=t[r];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=ea.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var r in t)Array.isArray(t[r])?e[r.toLowerCase()]=t[r].map((function(t){return t.toLowerCase()})):e[r.toLowerCase()]=t[r];return e}(t.whiteList||t.allowList):t.whiteList=ea.whiteList,this.attributeWrapSign=!0===t.singleQuotedAttributeValue?"'":ea.attributeWrapSign,t.onTag=t.onTag||ea.onTag,t.onTagAttr=t.onTagAttr||ea.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||ea.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||ea.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||ea.safeAttrValue,t.escapeHtml=t.escapeHtml||ea.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new ta(t.css))}ua.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this,r=e.options,n=r.whiteList,o=r.onTag,i=r.onIgnoreTag,a=r.onTagAttr,u=r.onIgnoreTagAttr,s=r.safeAttrValue,c=r.escapeHtml,l=e.attributeWrapSign,f=e.cssFilter;r.stripBlankChar&&(t=ea.stripBlankChar(t)),r.allowCommentTag||(t=ea.stripCommentTag(t));var d=!1;r.stripIgnoreTagBody&&(d=ea.StripTagBody(r.stripIgnoreTagBody,i),i=d.onIgnoreTag);var p=na(t,(function(t,e,r,d,p){var h={sourcePosition:t,position:e,isClosing:p,isWhite:Object.prototype.hasOwnProperty.call(n,r)},g=o(r,d,h);if(!aa(g))return g;if(h.isWhite){if(h.isClosing)return"</"+r+">";var v=function(t){var e=ia.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var r="/"===(t=ia.trim(t.slice(e+1,-1)))[t.length-1];return r&&(t=ia.trim(t.slice(0,-1))),{html:t,closing:r}}(d),b=n[r],y=oa(v.html,(function(t,e){var n=-1!==ia.indexOf(b,t),o=a(r,t,e,n);return aa(o)?n?(e=s(r,t,e,f))?t+"="+l+e+l:t:aa(o=u(r,t,e,n))?void 0:o:o}));return d="<"+r,y&&(d+=" "+y),v.closing&&(d+=" /"),d+=">"}return aa(g=i(r,d,h))?c(d):g}),c);return d&&(p=d.remove(p)),p};var sa=ua;!function(t,e){var r=si,n=Hi,o=sa;function i(t,e){return new o(e).process(t)}(e=t.exports=i).filterXSS=i,e.FilterXSS=o,function(){for(var t in r)e[t]=r[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(ui,ai);var ca=ai;function la(){return"undefined"!=typeof self?self:"undefined"!=typeof window&&void 0!==window.document?window:"undefined"!=typeof global?global:null}let fa=/<(?=[A-Za-z!/?]|$)/g;function da(t){return t.replace(fa,"&lt;")}let pa={getFilterXSS:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ca;if(xt(t))return t;let e=la(),r=je(e,"filterXSS",null);if(xt(r))return r;let n=je(e,"xss",null);if(xt(n))return n;throw new Error("invalid filterXSS, g.filterXSS, use script for import")},getOpt:function(t){return{escapeHtml:da,onIgnoreTagAttr:function(e,r,n,o){if("style"===r)return r+'="'+t.escapeAttrValue(n)+'"'}}}};function ha(t){let e=null,r=null;let n=function t(n){if(Array.isArray(n)){for(let e=0;e<n.length;e++)n[e]=t(n[e]);return n}if(At(n)||St(n)){for(let e of Object.keys(n))n[e]=t(n[e]);return n}return Pr(n)?(o=n,null===e&&(e=pa.getFilterXSS(),r=pa.getOpt(e)),e(o,r)):n;var o}(ni(t,oi|ii));return n}function ga(t,e){if(!St(t))return[];St(e)||(e=[e]);let r=[];return $t(t,((t,n)=>{0===je(t,"ok")&&r.push({k:n,id:je(e,[n,"id"]),err:je(t,"err","")})})),r}function va(t,e){var n,o,i;let a=`${t}: ${zn(En((o=10,(n=e)&&n.length?r(n,0,(o=i||void 0===o?1:D(o))<0?0:o):[]),(t=>Pr(t.ref)?t.ref:Pr(t.id)||Jn(t.id)?`id[${Nn(String(t.id),{length:100,omission:"…"})}]`:`data[${t.k}]`)),", ")}`;return Or(e)>10&&(a+=`, ... (${Or(e)} in total)`),a}function ba(t,e){if(e.indexOf("id")<0)return!1;let r=je(t,"settings",null);if(xr(r)&&!0!==je(r,"id.pk"))return!1;let n=je(r,"id.type","")||je(t,"kpType.id","");return!(Pr(n)&&["STRING","TEXT","CHAR","UUID","CITEXT"].indexOf(n.split("(")[0].trim().toUpperCase())<0)}function ya(t,e){return null!==t&&"object"==typeof t&&"string"==typeof e&&Object.prototype.hasOwnProperty.call(t,e)?void 0===t[e]?null:t[e]:null}function ma(t){return"number"==typeof t&&Number.isFinite(t)}function wa(t){return ma(t)?String(t):t}function ja(t,e){return Object.fromEntries(Object.keys(t).map((r=>[r,e(t[r],r)])))}const Oa=Object.freeze({proto:"unsupported key[__proto__]",accessor:"unsupported accessor property",unreadable:"unreadable value",deep:"too deep",hidden:"unsupported symbol key or non-enumerable property",irregular:"unsupported irregular object or array"}),$a=64,xa=4e6,_a=200,Sa=8,Aa=50,ka=200,Pa="function"==typeof WeakRef?Function.prototype.call.bind(WeakRef.prototype.deref):null,Ia="function"==typeof FinalizationRegistry?Function.prototype.call.bind(FinalizationRegistry.prototype.unregister):null,Da={};function Ta(t){for(let r=t;null!==r;r=Object.getPrototypeOf(r))if(e.types.isProxy(r)||Object.prototype.hasOwnProperty.call(r,Symbol.toStringTag))return!1;return!0}function Ma(t){return e.types.isMap(t)||e.types.isSet(t)||e.types.isWeakMap(t)||e.types.isWeakSet(t)||e.types.isPromise(t)||e.types.isAnyArrayBuffer(t)||e.types.isArrayBufferView(t)||e.types.isBoxedPrimitive(t)||e.types.isRegExp(t)||e.types.isNativeError(t)||e.types.isGeneratorObject(t)||e.types.isMapIterator(t)||e.types.isSetIterator(t)||e.types.isModuleNamespaceObject(t)}function Ea(t){if("object"!=typeof t||null===t||!Ta(t)||!At(t))return!1;let r=Object.getPrototypeOf(t);return null===r||r===Object.prototype||function(t){if(null!==Object.getPrototypeOf(t))return!1;let r=Reflect.ownKeys(Object.prototype);if(Reflect.ownKeys(t).length!==r.length)return!1;for(let e of r)if(!Object.prototype.hasOwnProperty.call(t,e))return!1;let n=Object.getOwnPropertyDescriptor(t,"constructor");if(void 0===n||"function"!=typeof n.value||e.types.isProxy(n.value))return!1;if(Function.prototype.toString.call(n.value)!==Function.prototype.toString.call(Object))return!1;let o=Object.getOwnPropertyDescriptor(n.value,"prototype");return void 0!==o&&o.value===t}(r)}function Ca(t){return"object"!=typeof t||null===t||!Ta(t)||Ma(t)?null:Array.isArray(t)?"arr":At(t)?"obj":null}function za(t){if(null!==Pa)try{return Pa(t),!0}catch(t){}if(null!==Ia)try{return Ia(t,Da),!0}catch(t){}return!1}function Fa(t){try{for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n<e;n++)r[n-1]=arguments[n];console.log(t,...r)}catch(e){try{console.log(t,"(unprintable)")}catch(t){}}}function La(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{n:0},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(r.n>=_a)return"[...]";if(r.n++,"string"==typeof t)return Nn(t,{length:ka});if("function"==typeof t)return"[Function]";if("symbol"==typeof t)return"[Symbol]";if("object"!=typeof t||null===t)return t;if(e.types.isProxy(t))return"[Proxy]";if(e.types.isDate(t))return"[Date]";if(Ma(t))return"[Object]";if(n>=Sa)return"[...]";let o=t=>void 0===t?"[empty]":void 0!==t.get||void 0!==t.set?"[Getter/Setter]":La(t.value,r,n+1);if(Array.isArray(t)){let e=Math.min(t.length,Aa),r=[];for(let n=0;n<e;n++)r.push(o(Object.getOwnPropertyDescriptor(t,n)));return t.length>e&&r.push(`[${t.length-e} more]`),r}let i=Reflect.ownKeys(t),a={};for(let e of i.slice(0,Aa)){let r=Object.getOwnPropertyDescriptor(t,e),n="symbol"==typeof e?String(e):e;Object.defineProperty(a,r.enumerable?n:`${n} (non-enumerable)`,{value:o(r),enumerable:!0,writable:!0,configurable:!0})}return i.length>Aa&&Object.defineProperty(a,"[more]",{value:i.length-Aa,enumerable:!0,writable:!0,configurable:!0}),a}function Ua(t,e){let r;try{r=La(e)}catch(t){r="(unprintable)"}Fa(t,r)}function Ra(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1/0,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];try{let o=new Set,i=[t,1],a=0,u=[];for(;i.length>0;){let t,s=i.pop(),c=i.pop();if(o.has(c))continue;if(n){if("object"==typeof c&&null!==c){if(!Ta(c)||Ma(c))return"irregular";if(e.types.isDate(c)){if(Reflect.ownKeys(c).length>0)return"irregular";continue}}t=Ca(c)}else t=Array.isArray(c)?"arr":At(c)?"obj":null;if(null===t)continue;let l="arr"===t;if(s>r)return"deep";if(o.add(c),Object.prototype.hasOwnProperty.call(c,"__proto__"))return"proto";let f=l?null:Object.keys(c);if(n&&!l){if(!Ea(c))return"irregular";if(Reflect.ownKeys(c).length!==f.length)return"hidden";u.push(c)}let d=l?c.length:f.length;for(let t=0;t<d;t++){let e=Object.getOwnPropertyDescriptor(c,l?t:f[t]);if(void 0!==e){if(void 0!==e.get||void 0!==e.set)return"accessor";if(n&&l&&!e.enumerable)return"irregular";n&&(a+=l?0:f[t].length,"string"==typeof e.value&&(a+=e.value.length)),"object"==typeof e.value&&null!==e.value&&i.push(e.value,s+1)}else if(n)return"irregular"}if(n&&l&&Reflect.ownKeys(c).length!==d+1)return"irregular"}if(n&&"object"==typeof t&&null!==t)if(a<=xa&&"function"==typeof structuredClone){if(function(t){if("function"!=typeof structuredClone)return!1;let e;try{e=structuredClone(t)}catch(t){return!0}let r=new Set,n=[e];for(;n.length>0;){let t=n.pop();if("object"!=typeof t||null===t||r.has(t))continue;r.add(t);let e=Object.getPrototypeOf(t);if(e!==Date.prototype){if(e!==Object.prototype&&e!==Array.prototype)return!0;for(let e of Object.keys(t))n.push(t[e])}}return!1}(t))return"irregular"}else for(let t=0;t<u.length;t++)if(za(u[t]))return"irregular";return null}catch(t){return"unreadable"}}function Wa(t,r){try{if(void 0!==r&&"object"==typeof r&&null!==r&&e.types.isProxy(r))return`invalid find of ${t}, ${Oa.irregular}`;if(void 0!==r&&!Ea(r))return`invalid find of ${t}, need an object`;let n=Ra(r,$a,!0);return null!==n?`invalid find of ${t}, ${Oa[n]}`:null}catch(e){return`invalid find of ${t}, ${Oa.unreadable}`}}function Na(t,e){let r=new Map,n=(t,e)=>{r.has(t)||r.set(t,[]),r.get(t).push({k:e})};if(Array.isArray(e))for(let t=0;t<e.length;t++)try{let r=Object.getOwnPropertyDescriptor(e,t);if(void 0===r)continue;if(void 0!==r.get||void 0!==r.set){n("accessor",t);continue}let o=Ra(r.value);null!==o&&n(o,t)}catch(e){n("unreadable",t)}else{let t=Ra(e);null!==t&&n(t,0)}return En([...r],(e=>{let[r,n]=e;return va(`${t}, ${Oa[r]}`,n)}))}function Ba(t){let e=!St(t),r=En(e?[t]:t,(t=>At(t)&&ma(t.id)?{...t,id:wa(t.id)}:t));return e?r[0]:r}function Va(t){return"obj"!==Ca(t)?t:ja(t,((t,e)=>{return"id"===e?"obj"!==Ca(r=t)?wa(r):ja(r,((t,e)=>["$eq","$ne","$gt","$gte","$lt","$lte","$in","$nin"].indexOf(e)>=0?"arr"===Ca(t)?En(t,wa):wa(t):t)):["$and","$or"].indexOf(e)>=0&&"arr"===Ca(t)?En(t,Va):t;var r}))}function Ha(t){let e=[];return $t(St(t)?t:[t],((t,r)=>{At(t)||e.push({k:r})})),e}function Ya(t){let e=wa(je(t,"id"));return Pr(e)?e:null}function qa(t){let e=[];return $t(St(t)?t:[t],((t,r)=>{let n=je(t,"id");Pr(n)&&ha(n)!==n&&e.push({k:r,id:n})})),e}function Xa(t,e){return va(`${t}, id contains HTML markup`,En(e,(t=>({k:t.k}))))}function Ka(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"save";if(!xr(t))throw console.log("ds",t),new Error("invalid ds");let i=t[e].keys,a=!1;St(n)||(a=!0,n=[n]);let u=function(){if(!xt(Vn))throw new Error("invalid dayjs");return Vn().format("YYYY-MM-DDTHH:mm:ss.SSSZ")}();if(o.indexOf("insert")>=0&&(i.indexOf("userId")>=0&&$t(n,((t,e)=>{n[e].userId=r})),i.indexOf("timeCreate")>=0&&$t(n,((t,e)=>{n[e].timeCreate=u})),i.indexOf("userIdUpdate")>=0&&$t(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&$t(n,((t,e)=>{n[e].timeUpdate=u}))),(o.indexOf("insert")>=0||o.indexOf("save")>=0)&&(i.indexOf("userIdUpdate")>=0&&$t(n,((t,e)=>{n[e].userIdUpdate=r})),i.indexOf("timeUpdate")>=0&&$t(n,((t,e)=>{n[e].timeUpdate=u}))),n=En(n,(t=>ja(t,(t=>ha(t))))),ba(t[e],i)){(a?xr(n[0]):kr(n))&&$t(n,(t=>{Pr(t.id)||(t.id=Kn())}))}return n=a?n[0]:n}async function Za(t,e,r,n,o,i){try{return await async function(t,e,r,n,o,i){let a,u=null;if(!xr(e))return Promise.reject("invalid woItems");let s=ya(e,n);if(null===s)return Promise.reject(`can not find table[${"string"==typeof n?n:""}] in ORM`);let c=function(t,e){let r=ya(t,e),n=je(r,"keys",null);return!!St(n)&&ba(r,n)}(t,n);if("select"===o){let t=Wa("select",i);if(null!==t)return Ua(`${n}.select invalid find`,i),Promise.reject(t);if(a=await s.select(c?Va(i):i).catch((t=>{console.log(`${n}.select catch`,t),u="failed to select data"})),Pr(u))return Promise.reject(u)}else if("insert"===o||"save"===o){let e=i,l="insert"===o?"failed to insert data":"failed to save data",f=Ha(i);if(Or(f)>0)return console.log(`${n}.${o} data is not an object`,f),Promise.reject(va(`${l}, not an object`,f));let d=Na(l,i);if(Or(d)>0)return console.log(`${n}.${o} data has unsupported key`,d),Promise.reject(zn(d,"; "));c&&(i=Ba(i));let p=qa(i);if(Or(p)>0)return console.log(`${n}.${o} id changed by clearXSS`,p),Promise.reject(Xa(l,p));try{i=Ka(t,n,r,i,o)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if("insert"===o?a=await s.insert(i).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})):"save"===o&&(a=await s.save(i).catch((t=>{console.log(`${n}.save catch`,t),u="failed to save data"}))),Pr(u))return Promise.reject(u);if("save"===o){let t=ga(a,i);if(Or(t)>0)return console.log(`${n}.save fail`,t),Promise.reject(va("failed to save data",ga(a,e)))}a=St(i)?En(i,(t=>({id:t.id}))):{id:i.id}}else if("del"===o){if(c&&(i=Ba(i)),a=await s.del(i).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"})),!Pr(u)){let t=ga(a,i);Or(t)>0&&(console.log(`${n}.del fail`,t),u=va("failed to delete data",t))}}else if("delAll"===o){let t=Wa("delAll",i);if(null!==t)return Ua(`${n}.delAll invalid find`,i),Promise.reject(t);a=await s.delAll(c?Va(i):i).catch((t=>{console.log(`${n}.delAll catch`,t),u="failed to delete data"}))}else if("mix"===o){if(!xr(i))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");for(let t of["add","del","diff"]){let e=Object.getOwnPropertyDescriptor(i,t);if(void 0!==e&&(void 0!==e.get||void 0!==e.set))return Promise.reject(`invalid input of mix, ${Oa.accessor}`)}i={add:i.add,del:i.del,diff:i.diff};for(let t of["add","del","diff"])if(void 0!==i[t]&&!St(i[t]))return Promise.reject("invalid input of mix, need the result object of ltdtDiffByKey");let e=[];for(let[t,r]of[["add","failed to insert data"],["diff","failed to update data"]]){let o=Ha(je(i,t,[]));Or(o)>0&&(console.log(`${n}.mix ${t} data is not an object`,o),e.push(va(`${r}, not an object`,o)))}if(Or(e)>0)return Promise.reject(zn(e,"; "));let o=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]])o.push(...Na(e,je(i,t,[])));if(Or(o)>0)return console.log(`${n}.mix data has unsupported key`,o),Promise.reject(zn(o,"; "));if(c){i={...i};for(let t of["add","del","diff"])St(i[t])&&(i[t]=Ba(i[t]))}let l=[];for(let[t,e]of[["add","failed to insert data"],["diff","failed to update data"]]){let r=qa(je(i,t,[]));Or(r)>0&&(console.log(`${n}.mix ${t} id changed by clearXSS`,r),l.push(Xa(e,r)))}if(Or(l)>0)return Promise.reject(zn(l,"; "));let f,d=function(t){let e=[];for(let[r,n]of[["add","del"],["del","diff"]]){let o=new Map;$t(je(t,r,[]),((t,e)=>{let r=Ya(t);null!==r&&o.set(r,[...o.get(r)||[],e])}));let i=[],a=[];if($t(je(t,n,[]),((t,e)=>{let r=Ya(t);null!==r&&o.has(r)&&(i=[...i,...o.get(r)],a.push(e))})),Or(a)>0){let t=[...En([...new Set(i)].sort(((t,e)=>t-e)),(t=>({ref:`${r}[${t}]`}))),...En(a,(t=>({ref:`${n}[${t}]`})))];e.push(va(`invalid input of mix, same id in ${r} and ${n}`,t))}}return e}(i);if(Or(d)>0)return console.log(`${n}.mix same id across steps`,d),Promise.reject(zn(d,"; "));a=[];let p=[],h=je(i,"add",[]);if(Or(h)>0){try{h=Ka(t,n,r,h,"insert+save")}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}if(await s.insert(h).catch((t=>{console.log(`${n}.insert catch`,t),u="failed to insert data"})),Pr(u))return Promise.reject(u);f=En(h,(t=>({id:t.id}))),a=[...a,...f]}let g=je(i,"del",[]);if(Or(g)>0){let t=await s.del(g).catch((t=>{console.log(`${n}.del catch`,t),u="failed to delete data"}));if(Pr(u))return Promise.reject(u);let e=ga(t,g);Or(e)>0&&(console.log(`${n}.del fail`,e),p.push(va("failed to delete data",e))),f=En(g,(t=>({id:t.id}))),a=[...a,...f]}let v=je(i,"diff",[]);if(Or(v)>0){let e=v;try{v=Ka(t,n,r,v)}catch(t){return console.log(`${n}.adjustData catch`,t.toString()),u="failed to adjust data",Promise.reject(u)}let o=await s.save(v).catch((t=>{console.log(`${n}.save catch`,t),u="failed to update data"}));if(Pr(u))return Promise.reject(u);let i=ga(o,v);Or(i)>0&&(console.log(`${n}.save fail`,i),p.push(va("failed to update data",ga(o,e)))),f=En(v,(t=>({id:t.id}))),a=[...a,...f]}if(Or(p)>0)return Promise.reject(zn(p,"; "))}else u=`invalid mode: ${o}`;if(Pr(u))return Promise.reject(u);return a}(t,e,r,n,o,i)}catch(t){return"string"==typeof t?Promise.reject(t):(Fa(`${"string"==typeof n?n:""}.${"string"==typeof o?o:""} mapOrm catch`,t),Promise.reject("failed to process input"))}}function Ga(t,e){return async(r,n,o,i)=>Za(t,e,r,n,o,i)}function Ja(t,e,r){let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!xt(e)){let o=`${r} needs a function, but got ${typeof e}`;throw n&&t.push((()=>Promise.reject(o))),new Error(o)}setTimeout((()=>{t.push(e)}),1)}function Qa(t){if(Oe(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}),!xt(t))throw new Error("invalid mapOrm");let e={funChecks:[],funPreProcessing:[],funPostProcessing:[],mapOrm:t};return{addFunCheck:t=>{Ja(e.funChecks,t,"addFunCheck",!0)},addFunPreProcessing:t=>{Ja(e.funPreProcessing,t,"addFunPreProcessing")},addFunPostProcessing:t=>{Ja(e.funPostProcessing,t,"addFunPostProcessing")},procOrm:async(t,r,n,o)=>async function(t,e,r,n,o){await kt(t.funChecks,(t=>t({woName:r,userId:e,mode:n,input:o})));for(let i of[...t.funPreProcessing]){let t=await i({woName:r,userId:e,mode:n,input:o});if(!xr(t)||void 0===t.input)return Promise.reject("invalid return of pre-processing, need an object with input");o=t.input}let i=await t.mapOrm(e,r,n,o);for(let a of[...t.funPostProcessing])i=await a({woName:r,userId:e,mode:n,input:o,output:i});return i}(e,t,r,n,o)}}return function(t,e,r,n){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};Oe(o);let i=function(t,e,r,n){if(!xr(t))throw console.log("ds",t),new Error("invalid ds");if(!xt(e))throw console.log("WOrm",e),new Error("invalid WOrm");if(!Pr(r))throw console.log("url",r),new Error("invalid url");if(!Pr(n))throw console.log("db",n),new Error("invalid db");let o={};return $t(mt(t),(t=>{let i=new e({url:r,db:n,cl:t});Object.defineProperty(o,t,{value:i,enumerable:!0,writable:!0,configurable:!0})})),o}(t,e,r,n),a=Qa(Ga(t,i),o);return{...Tr,woItems:i,closeAll:async()=>{await kt(i,(async t=>{t&&xt(t.close)&&await t.close()}))},...a}}}));
7
7
  //# sourceMappingURL=w-serv-orm.umd.js.map