@mptool/all 0.10.1 → 0.10.2

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/lib/index.mjs CHANGED
@@ -9,5 +9,5 @@ Options:
9
9
  fieldset[disabled]:not(fieldset[disabled] legend:first-of-type *)
10
10
  )`,enabled:":not(:disabled)",checked:":is(:is(input[type=radio], input[type=checkbox])[checked], option:selected)",required:":is(input, select, textarea)[required]",optional:":is(input, select, textarea):not([required])",selected:"option:is([selected], select:not([multiple]):not(:has(> option[selected])) > :first-of-type)",checkbox:"[type=checkbox]",file:"[type=file]",password:"[type=password]",radio:"[type=radio]",reset:"[type=reset]",image:"[type=image]",submit:"[type=submit]",parent:":not(:empty)",header:":is(h1, h2, h3, h4, h5, h6)",button:":is(button, input[type=button])",input:":is(input, textarea, select, button)",text:"input:is(:not([type!='']), [type=text])"},Pi={};function dl(t,e){return t===w.falseFunc?w.falseFunc:n=>e.isTag(n)&&t(n)}function Di(t,e){const n=e.getSiblings(t);if(n.length<=1)return[];const r=n.indexOf(t);return r<0||r===n.length-1?[]:n.slice(r+1).filter(e.isTag)}function vn(t){return{xmlMode:!!t.xmlMode,lowerCaseAttributeNames:!!t.lowerCaseAttributeNames,lowerCaseTags:!!t.lowerCaseTags,quirksMode:!!t.quirksMode,cacheResults:!!t.cacheResults,pseudos:t.pseudos,adapter:t.adapter,equals:t.equals}}const Sn=(t,e,n,r,i)=>{const s=i(e,vn(n),r);return s===w.trueFunc?t:s===w.falseFunc?w.falseFunc:a=>s(a)&&t(a)},An={is:Sn,matches:Sn,where:Sn,not(t,e,n,r,i){const s=i(e,vn(n),r);return s===w.falseFunc?t:s===w.trueFunc?w.falseFunc:a=>!s(a)&&t(a)},has(t,e,n,r,i){const{adapter:s}=n,a=vn(n);a.relativeSelector=!0;const c=e.some(h=>h.some(yn))?[Pi]:void 0,o=i(e,a,c);if(o===w.falseFunc)return w.falseFunc;const l=dl(o,s);if(c&&o!==w.trueFunc){const{shouldTestNextSiblings:h=!1}=o;return d=>{if(!t(d))return!1;c[0]=d;const f=s.getChildren(d),g=h?[...f,...Di(d,s)]:f;return s.existsOne(l,g)}}return h=>t(h)&&s.existsOne(l,s.getChildren(h))}};function fl(t,e,n,r,i){var s;const{name:a,data:c}=e;if(Array.isArray(c)){if(!(a in An))throw new Error(`Unknown pseudo-class :${a}(${c})`);return An[a](t,c,n,r,i)}const o=(s=n.pseudos)===null||s===void 0?void 0:s[a],l=typeof o=="string"?o:ul[a];if(typeof l=="string"){if(c!=null)throw new Error(`Pseudo ${a} doesn't have any arguments`);const h=Ae(l);return An.is(t,h,n,r,i)}if(typeof o=="function")return Oi(o,a,c,1),h=>o(h,c)&&t(h);if(a in wn)return wn[a](t,c,n,r);if(a in qi){const h=qi[a];return Oi(h,a,c,2),d=>h(d,n,c)&&t(d)}throw new Error(`Unknown pseudo-class :${a}`)}function $n(t,e){const n=e.getParent(t);return n&&e.isTag(n)?n:null}function pl(t,e,n,r,i){const{adapter:s,equals:a}=n;switch(e.type){case m.PseudoElement:throw new Error("Pseudo-elements are not supported by css-select");case m.ColumnCombinator:throw new Error("Column combinators are not yet supported by css-select");case m.Attribute:{if(e.namespace!=null)throw new Error("Namespaced attributes are not yet supported by css-select");return(!n.xmlMode||n.lowerCaseAttributeNames)&&(e.name=e.name.toLowerCase()),al[e.action](t,e,n)}case m.Pseudo:return fl(t,e,n,r,i);case m.Tag:{if(e.namespace!=null)throw new Error("Namespaced tag names are not yet supported by css-select");let{name:c}=e;return(!n.xmlMode||n.lowerCaseTags)&&(c=c.toLowerCase()),function(o){return s.getName(o)===c&&t(o)}}case m.Descendant:{if(n.cacheResults===!1||typeof WeakSet=="undefined")return function(o){let l=o;for(;l=$n(l,s);)if(t(l))return!0;return!1};const c=new WeakSet;return function(o){let l=o;for(;l=$n(l,s);)if(!c.has(l)){if(s.isTag(l)&&t(l))return!0;c.add(l)}return!1}}case"_flexibleDescendant":return function(c){let o=c;do if(t(o))return!0;while(o=$n(o,s));return!1};case m.Parent:return function(c){return s.getChildren(c).some(o=>s.isTag(o)&&t(o))};case m.Child:return function(c){const o=s.getParent(c);return o!=null&&s.isTag(o)&&t(o)};case m.Sibling:return function(c){const o=s.getSiblings(c);for(let l=0;l<o.length;l++){const h=o[l];if(a(c,h))break;if(s.isTag(h)&&t(h))return!0}return!1};case m.Adjacent:return s.prevElementSibling?function(c){const o=s.prevElementSibling(c);return o!=null&&t(o)}:function(c){const o=s.getSiblings(c);let l;for(let h=0;h<o.length;h++){const d=o[h];if(a(c,d))break;s.isTag(d)&&(l=d)}return!!l&&t(l)};case m.Universal:{if(e.namespace!=null&&e.namespace!=="*")throw new Error("Namespaced universal selectors are not yet supported by css-select");return t}}}function _i(t){return t.type===m.Pseudo&&(t.name==="scope"||Array.isArray(t.data)&&t.data.some(e=>e.some(_i)))}const gl={type:m.Descendant},ml={type:"_flexibleDescendant"},bl={type:m.Pseudo,name:"scope",data:null};function yl(t,{adapter:e},n){const r=!!(n!=null&&n.every(i=>{const s=e.isTag(i)&&e.getParent(i);return i===Pi||s&&e.isTag(s)}));for(const i of t){if(!(i.length>0&&yn(i[0])&&i[0].type!==m.Descendant))if(r&&!i.some(_i))i.unshift(gl);else continue;i.unshift(bl)}}function Li(t,e,n){var r;t.forEach(rl),n=(r=e.context)!==null&&r!==void 0?r:n;const i=Array.isArray(n),s=n&&(Array.isArray(n)?n:[n]);if(e.relativeSelector!==!1)yl(t,e,s);else if(t.some(o=>o.length>0&&yn(o[0])))throw new Error("Relative selectors are not allowed when the `relativeSelector` option is disabled");let a=!1;const c=t.map(o=>{if(o.length>=2){const[l,h]=o;l.type!==m.Pseudo||l.name!=="scope"||(i&&h.type===m.Descendant?o[1]=ml:(h.type===m.Adjacent||h.type===m.Sibling)&&(a=!0))}return wl(o,e,s)}).reduce(xl,w.falseFunc);return c.shouldTestNextSiblings=a,c}function wl(t,e,n){var r;return t.reduce((i,s)=>i===w.falseFunc?w.falseFunc:pl(i,s,e,n,Li),(r=e.rootFunc)!==null&&r!==void 0?r:w.trueFunc)}function xl(t,e){return e===w.falseFunc||t===w.trueFunc?t:t===w.falseFunc||e===w.trueFunc?e:function(n){return t(n)||e(n)}}const ji=(t,e)=>t===e,vl={adapter:xe,equals:ji};function Sl(t){var e,n,r,i;const s=t!=null?t:vl;return(e=s.adapter)!==null&&e!==void 0||(s.adapter=xe),(n=s.equals)!==null&&n!==void 0||(s.equals=(i=(r=s.adapter)===null||r===void 0?void 0:r.equals)!==null&&i!==void 0?i:ji),s}function Al(t){return function(e,n,r){const i=Sl(n);return t(e,i,r)}}const Cn=Al(Li);function Mi(t,e,n=!1){return n&&(t=$l(t,e)),Array.isArray(t)?e.removeSubsets(t):e.getChildren(t)}function $l(t,e){const n=Array.isArray(t)?t.slice(0):[t],r=n.length;for(let i=0;i<r;i++){const s=Di(n[i],e);n.push(...s)}return n}const Cl=new Set(["first","last","eq","gt","nth","lt","even","odd"]);function ke(t){return t.type!=="pseudo"?!1:Cl.has(t.name)?!0:t.name==="not"&&Array.isArray(t.data)?t.data.some(e=>e.some(ke)):!1}function El(t,e,n){const r=e!=null?parseInt(e,10):NaN;switch(t){case"first":return 1;case"nth":case"eq":return isFinite(r)?r>=0?r+1:1/0:0;case"lt":return isFinite(r)?r>=0?Math.min(r,n):1/0:0;case"gt":return isFinite(r)?1/0:0;case"odd":return 2*n;case"even":return 2*n-1;case"last":case"not":return 1/0}}function kl(t){for(;t.parent;)t=t.parent;return t}function En(t){const e=[],n=[];for(const r of t)r.some(ke)?e.push(r):n.push(r);return[n,e]}const Tl={type:m.Universal,namespace:null},Il={type:m.Pseudo,name:"scope",data:null};function Bi(t,e,n={}){return Fi([t],e,n)}function Fi(t,e,n={}){if(typeof e=="function")return t.some(e);const[r,i]=En(Ae(e));return r.length>0&&t.some(Cn(r,n))||i.some(s=>Vi(s,t,n).length>0)}function Nl(t,e,n,r){const i=typeof n=="string"?parseInt(n,10):NaN;switch(t){case"first":case"lt":return e;case"last":return e.length>0?[e[e.length-1]]:e;case"nth":case"eq":return isFinite(i)&&Math.abs(i)<e.length?[i<0?e[e.length+i]:e[i]]:[];case"gt":return isFinite(i)?e.slice(i+1):[];case"even":return e.filter((s,a)=>a%2===0);case"odd":return e.filter((s,a)=>a%2===1);case"not":{const s=new Set(Ri(n,e,r));return e.filter(a=>!s.has(a))}}}function Ui(t,e,n={}){return Ri(Ae(t),e,n)}function Ri(t,e,n){if(e.length===0)return[];const[r,i]=En(t);let s;if(r.length){const a=Tn(e,r,n);if(i.length===0)return a;a.length&&(s=new Set(a))}for(let a=0;a<i.length&&(s==null?void 0:s.size)!==e.length;a++){const c=i[a];if((s?e.filter(l=>y(l)&&!s.has(l)):e).length===0)break;const o=Vi(c,e,n);if(o.length)if(s)o.forEach(l=>s.add(l));else{if(a===i.length-1)return o;s=new Set(o)}}return typeof s!="undefined"?s.size===e.length?e:e.filter(a=>s.has(a)):[]}function Vi(t,e,n){var r;if(t.some(Mt)){const i=(r=n.root)!==null&&r!==void 0?r:kl(e[0]),s=mt(_({},n),{context:e,relativeSelector:!1});return t.push(Il),Te(i,t,s,!0,e.length)}return Te(e,t,n,!1,e.length)}function ql(t,e,n={},r=1/0){if(typeof t=="function")return Hi(e,t);const[i,s]=En(Ae(t)),a=s.map(c=>Te(e,c,n,!0,r));return i.length&&a.push(kn(e,i,n,r)),a.length===0?[]:a.length===1?a[0]:wt(a.reduce((c,o)=>[...c,...o]))}function Te(t,e,n,r,i){const s=e.findIndex(ke),a=e.slice(0,s),c=e[s],o=e.length-1===s?i:1/0,l=El(c.name,c.data,o);if(l===0)return[];const h=(a.length===0&&!Array.isArray(t)?me(t).filter(y):a.length===0?(Array.isArray(t)?t:[t]).filter(y):r||a.some(Mt)?kn(t,[a],n,l):Tn(t,[a],n)).slice(0,l);let d=Nl(c.name,h,c.data,n);if(d.length===0||e.length===s+1)return d;const f=e.slice(s+1),g=f.some(Mt);if(g){if(Mt(f[0])){const{type:p}=f[0];(p===m.Sibling||p===m.Adjacent)&&(d=Mi(d,xe,!0)),f.unshift(Tl)}n=mt(_({},n),{relativeSelector:!1,rootFunc:p=>d.includes(p)})}else n.rootFunc&&n.rootFunc!==$e.trueFunc&&(n=mt(_({},n),{rootFunc:$e.trueFunc}));return f.some(ke)?Te(d,f,n,!1,i):g?kn(d,[f],n,i):Tn(d,[f],n)}function kn(t,e,n,r){const i=Cn(e,n,t);return Hi(t,i,r)}function Hi(t,e,n=1/0){const r=Mi(t,xe,e.shouldTestNextSiblings);return un(i=>y(i)&&e(i),r,!0,n)}function Tn(t,e,n){const r=(Array.isArray(t)?t:[t]).filter(y);if(r.length===0)return r;const i=Cn(e,n);return i===$e.trueFunc?r:r.filter(i)}const Ol=/^\s*[+~]/;function Pl(t){if(!t)return this._make([]);if(typeof t!="string"){const e=W(t)?t.toArray():[t],n=this.toArray();return this._make(e.filter(r=>n.some(i=>gi(i,r))))}return this._findBySelector(t,Number.POSITIVE_INFINITY)}function Dl(t,e){var n;const r=this.toArray(),i=Ol.test(t)?r:this.children().toArray(),s={context:r,root:(n=this._root)===null||n===void 0?void 0:n[0],xmlMode:this.options.xmlMode,lowerCaseTags:this.options.lowerCaseTags,lowerCaseAttributeNames:this.options.lowerCaseAttributeNames,pseudos:this.options.pseudos,quirksMode:this.options.quirksMode};return this._make(ql(t,i,s,e))}function In(t){return function(e,...n){return function(r){var i;let s=t(e,this);return r&&(s=On(s,r,this.options.xmlMode,(i=this._root)===null||i===void 0?void 0:i[0])),this._make(this.length>1&&s.length>1?n.reduce((a,c)=>c(a),s):s)}}}const Ft=In((t,e)=>{let n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i.length>0&&(n=n.concat(i))}return n}),Nn=In((t,e)=>{const n=[];for(let r=0;r<e.length;r++){const i=t(e[r]);i!==null&&n.push(i)}return n});function qn(t,...e){let n=null;const r=In((i,s)=>{const a=[];return A(s,c=>{for(let o;(o=i(c))&&!(n!=null&&n(o,a.length));c=o)a.push(o)}),a})(t,...e);return function(i,s){n=typeof i=="string"?c=>Bi(c,i,this.options):i?Ut(i):null;const a=r.call(this,s);return n=null,a}}function vt(t){return t.length>1?Array.from(new Set(t)):t}const _l=Nn(({parent:t})=>t&&!it(t)?t:null,vt),Ll=Ft(t=>{const e=[];for(;t.parent&&!it(t.parent);)e.push(t.parent),t=t.parent;return e},wt,t=>t.reverse()),jl=qn(({parent:t})=>t&&!it(t)?t:null,wt,t=>t.reverse());function Ml(t){var e;const n=[];if(!t)return this._make(n);const r={xmlMode:this.options.xmlMode,root:(e=this._root)===null||e===void 0?void 0:e[0]},i=typeof t=="string"?s=>Bi(s,t,r):Ut(t);return A(this,s=>{for(s&&!it(s)&&!y(s)&&(s=s.parent);s&&y(s);){if(i(s,0)){n.includes(s)||n.push(s);break}s=s.parent}}),this._make(n)}const Bl=Nn(t=>ln(t)),Fl=Ft(t=>{const e=[];for(;t.next;)t=t.next,y(t)&&e.push(t);return e},vt),Ul=qn(t=>ln(t),vt),Rl=Nn(t=>hn(t)),Vl=Ft(t=>{const e=[];for(;t.prev;)t=t.prev,y(t)&&e.push(t);return e},vt),Hl=qn(t=>hn(t),vt),Gl=Ft(t=>ci(t).filter(e=>y(e)&&e!==t),wt),zl=Ft(t=>me(t).filter(y),vt);function Wl(){const t=this.toArray().reduce((e,n)=>E(n)?e.concat(n.children):e,[]);return this._make(t)}function Ql(t){let e=0;const n=this.length;for(;e<n&&t.call(this[e],e,this[e])!==!1;)++e;return this}function Zl(t){let e=[];for(let n=0;n<this.length;n++){const r=this[n],i=t.call(r,n,r);i!=null&&(e=e.concat(i))}return this._make(e)}function Ut(t){return typeof t=="function"?(e,n)=>t.call(e,n,e):W(t)?e=>Array.prototype.includes.call(t,e):function(e){return t===e}}function Jl(t){var e;return this._make(On(this.toArray(),t,this.options.xmlMode,(e=this._root)===null||e===void 0?void 0:e[0]))}function On(t,e,n,r){return typeof e=="string"?Ui(e,t,{xmlMode:n,root:r}):t.filter(Ut(e))}function Yl(t){const e=this.toArray();return typeof t=="string"?Fi(e.filter(y),t,this.options):t?e.some(Ut(t)):!1}function Xl(t){let e=this.toArray();if(typeof t=="string"){const n=new Set(Ui(t,e,this.options));e=e.filter(r=>!n.has(r))}else{const n=Ut(t);e=e.filter((r,i)=>!n(r,i))}return this._make(e)}function Kl(t){return this.filter(typeof t=="string"?`:has(${t})`:(e,n)=>this._make(n).find(t).length>0)}function th(){return this.length>1?this._make(this[0]):this}function eh(){return this.length>0?this._make(this[this.length-1]):this}function nh(t){var e;return t=+t,t===0&&this.length<=1?this:(t<0&&(t=this.length+t),this._make((e=this[t])!==null&&e!==void 0?e:[]))}function rh(t){return t==null?this.toArray():this[t<0?this.length+t:t]}function ih(){return Array.prototype.slice.call(this)}function sh(t){let e,n;return t==null?(e=this.parent().children(),n=this[0]):typeof t=="string"?(e=this._make(t),n=this[0]):(e=this,n=W(t)?t[0]:t),Array.prototype.indexOf.call(e,n)}function ah(t,e){return this._make(Array.prototype.slice.call(this,t,e))}function oh(){var t;return(t=this.prevObject)!==null&&t!==void 0?t:this._make([])}function ch(t,e){const n=this._make(t,e),r=wt([...this.get(),...n.get()]);return this._make(r)}function lh(t){return this.prevObject?this.add(t?this.prevObject.filter(t):this.prevObject):this}var hh=Object.freeze({__proto__:null,_findBySelector:Dl,add:ch,addBack:lh,children:zl,closest:Ml,contents:Wl,each:Ql,end:oh,eq:nh,filter:Jl,filterArray:On,find:Pl,first:th,get:rh,has:Kl,index:sh,is:Yl,last:eh,map:Zl,next:Bl,nextAll:Fl,nextUntil:Ul,not:Xl,parent:_l,parents:Ll,parentsUntil:jl,prev:Rl,prevAll:Vl,prevUntil:Hl,siblings:Gl,slice:ah,toArray:ih});function uh(t){return function(e,n,r,i){if(typeof Buffer!="undefined"&&Buffer.isBuffer(e)&&(e=e.toString()),typeof e=="string")return t(e,n,r,i);const s=e;if(!Array.isArray(s)&&it(s))return s;const a=new Pt([]);return ct(s,a),a}}function ct(t,e){const n=Array.isArray(t)?t:[t];e?e.children=n:e=null;for(let r=0;r<n.length;r++){const i=n[r];i.parent&&i.parent.children!==n&&st(i),e?(i.prev=n[r-1]||null,i.next=n[r+1]||null):i.prev=i.next=null,i.parent=e}return e}function dh(t,e){if(t==null)return[];if(typeof t=="string")return this._parse(t,this.options,!1,null).children.slice(0);if("length"in t){if(t.length===1)return this._makeDomArray(t[0],e);const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(typeof i=="object"){if(i==null)continue;if(!("length"in i)){n.push(e?Dt(i,!0):i);continue}}n.push(...this._makeDomArray(i,e))}return n}return[e?Dt(t,!0):t]}function Gi(t){return function(...e){const n=this.length-1;return A(this,(r,i)=>{if(!E(r))return;const s=typeof e[0]=="function"?e[0].call(r,i,this._render(r.children)):e,a=this._makeDomArray(s,i<n);t(a,r.children,r)})}}function K(t,e,n,r,i){var s,a;const c=[e,n,...r],o=e===0?null:t[e-1],l=e+n>=t.length?null:t[e+n];for(let h=0;h<r.length;++h){const d=r[h],f=d.parent;if(f){const g=f.children.indexOf(d);g>-1&&(f.children.splice(g,1),i===f&&e>g&&c[0]--)}d.parent=i,d.prev&&(d.prev.next=(s=d.next)!==null&&s!==void 0?s:null),d.next&&(d.next.prev=(a=d.prev)!==null&&a!==void 0?a:null),d.prev=h===0?o:r[h-1],d.next=h===r.length-1?l:r[h+1]}return o&&(o.next=r[0]),l&&(l.prev=r[r.length-1]),t.splice(...c)}function fh(t){return(W(t)?t:this._make(t)).append(this),this}function ph(t){return(W(t)?t:this._make(t)).prepend(this),this}const gh=Gi((t,e,n)=>{K(e,e.length,0,t,n)}),mh=Gi((t,e,n)=>{K(e,0,0,t,n)});function zi(t){return function(e){const n=this.length-1,r=this.parents().last();for(let i=0;i<this.length;i++){const s=this[i],a=typeof e=="function"?e.call(s,i,s):typeof e=="string"&&!fn(e)?r.find(e).clone():e,[c]=this._makeDomArray(a,i<n);if(!c||!E(c))continue;let o=c,l=0;for(;l<o.children.length;){const h=o.children[l];y(h)?(o=h,l=0):l++}t(s,o,[c])}return this}}const bh=zi((t,e,n)=>{const{parent:r}=t;if(!r)return;const i=r.children,s=i.indexOf(t);ct([t],e),K(i,s,0,n,r)}),yh=zi((t,e,n)=>{E(t)&&(ct(t.children,e),ct(n,t))});function wh(t){return this.parent(t).not("body").each((e,n)=>{this._make(n).replaceWith(n.children)}),this}function xh(t){const e=this[0];if(e){const n=this._make(typeof t=="function"?t.call(e,0,e):t).insertBefore(e);let r;for(let s=0;s<n.length;s++)n[s].type==="tag"&&(r=n[s]);let i=0;for(;r&&i<r.children.length;){const s=r.children[i];s.type==="tag"?(r=s,i=0):i++}r&&this._make(r).append(this)}return this}function vh(...t){const e=this.length-1;return A(this,(n,r)=>{if(!E(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const a=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,c=this._makeDomArray(a,r<e);K(i,s+1,0,c,n.parent)})}function Sh(t){typeof t=="string"&&(t=this._make(t)),this.remove();const e=[];for(const n of this._makeDomArray(t)){const r=this.clone().toArray(),{parent:i}=n;if(!i)continue;const s=i.children,a=s.indexOf(n);a<0||(K(s,a+1,0,r,i),e.push(...r))}return this._make(e)}function Ah(...t){const e=this.length-1;return A(this,(n,r)=>{if(!E(n)||!n.parent)return;const i=n.parent.children,s=i.indexOf(n);if(s<0)return;const a=typeof t[0]=="function"?t[0].call(n,r,this._render(n.children)):t,c=this._makeDomArray(a,r<e);K(i,s,0,c,n.parent)})}function $h(t){const e=this._make(t);this.remove();const n=[];return A(e,r=>{const i=this.clone().toArray(),{parent:s}=r;if(!s)return;const a=s.children,c=a.indexOf(r);c<0||(K(a,c,0,i,s),n.push(...i))}),this._make(n)}function Ch(t){const e=t?this.filter(t):this;return A(e,n=>{st(n),n.prev=n.next=n.parent=null}),this}function Eh(t){return A(this,(e,n)=>{const{parent:r}=e;if(!r)return;const i=r.children,s=typeof t=="function"?t.call(e,n,e):t,a=this._makeDomArray(s);ct(a,null);const c=i.indexOf(e);K(i,c,1,a,r),a.includes(e)||(e.parent=e.prev=e.next=null)})}function kh(){return A(this,t=>{if(E(t)){for(const e of t.children)e.next=e.prev=e.parent=null;t.children.length=0}})}function Th(t){if(t===void 0){const e=this[0];return!e||!E(e)?null:this._render(e.children)}return A(this,e=>{if(!E(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=W(t)?t.toArray():this._parse(`${t}`,this.options,!1,e).children;ct(n,e)})}function Ih(){return this._render(this)}function Nh(t){return t===void 0?_t(this):typeof t=="function"?A(this,(e,n)=>this._make(e).text(t.call(e,n,_t([e])))):A(this,e=>{if(!E(e))return;for(const r of e.children)r.next=r.prev=r.parent=null;const n=new ue(`${t}`);ct(n,e)})}function qh(){const t=Array.prototype.map.call(this.get(),n=>Dt(n,!0)),e=new Pt(t);for(const n of t)n.parent=e;return this._make(t)}var Oh=Object.freeze({__proto__:null,_makeDomArray:dh,after:vh,append:gh,appendTo:fh,before:Ah,clone:qh,empty:kh,html:Th,insertAfter:Sh,insertBefore:$h,prepend:mh,prependTo:ph,remove:Ch,replaceWith:Eh,text:Nh,toString:Ih,unwrap:wh,wrap:bh,wrapAll:xh,wrapInner:yh});function Ph(t,e){if(t!=null&&e!=null||typeof t=="object"&&!Array.isArray(t))return A(this,(n,r)=>{y(n)&&Wi(n,t,e,r)});if(this.length!==0)return Qi(this[0],t)}function Wi(t,e,n,r){if(typeof e=="string"){const i=Qi(t),s=typeof n=="function"?n.call(t,r,i[e]):n;s===""?delete i[e]:s!=null&&(i[e]=s),t.attribs.style=Dh(i)}else if(typeof e=="object"){const i=Object.keys(e);for(let s=0;s<i.length;s++){const a=i[s];Wi(t,a,e[a],s)}}}function Qi(t,e){if(!t||!y(t))return;const n=_h(t.attribs.style);if(typeof e=="string")return n[e];if(Array.isArray(e)){const r={};for(const i of e)n[i]!=null&&(r[i]=n[i]);return r}return n}function Dh(t){return Object.keys(t).reduce((e,n)=>`${e}${e?" ":""}${n}: ${t[n]};`,"")}function _h(t){if(t=(t||"").trim(),!t)return{};const e={};let n;for(const r of t.split(";")){const i=r.indexOf(":");if(i<1||i===r.length-1){const s=r.trimEnd();s.length>0&&n!==void 0&&(e[n]+=`;${s}`)}else n=r.slice(0,i).trim(),e[n]=r.slice(i+1).trim()}return e}var Lh=Object.freeze({__proto__:null,css:Ph});const Zi="input,select,textarea,keygen",jh=/%20/g,Ji=/\r?\n/g;function Mh(){return this.serializeArray().map(t=>`${encodeURIComponent(t.name)}=${encodeURIComponent(t.value)}`).join("&").replace(jh,"+")}function Bh(){return this.map((t,e)=>{const n=this._make(e);return y(e)&&e.name==="form"?n.find(Zi).toArray():n.filter(Zi).toArray()}).filter('[name!=""]:enabled:not(:submit, :button, :image, :reset, :file):matches([checked], :not(:checkbox, :radio))').map((t,e)=>{var n;const r=this._make(e),i=r.attr("name"),s=(n=r.val())!==null&&n!==void 0?n:"";return Array.isArray(s)?s.map(a=>({name:i,value:a.replace(Ji,`\r
11
11
  `)})):{name:i,value:s.replace(Ji,`\r
12
- `)}}).toArray()}var Fh=Object.freeze({__proto__:null,serialize:Mh,serializeArray:Bh});function Uh(t){var e;return typeof t=="string"?{selector:t,value:"textContent"}:{selector:t.selector,value:(e=t.value)!==null&&e!==void 0?e:"textContent"}}function Rh(t){const e={};for(const n in t){const r=t[n],i=Array.isArray(r),{selector:s,value:a}=Uh(i?r[0]:r),c=typeof a=="function"?a:typeof a=="string"?o=>this._make(o).prop(a):o=>this._make(o).extract(a);if(i)e[n]=this._findBySelector(s,Number.POSITIVE_INFINITY).map((o,l)=>c(l,n,e)).get();else{const o=this._findBySelector(s,1);e[n]=o.length>0?c(o[0],n,e):void 0}}return e}var Vh=Object.freeze({__proto__:null,extract:Rh});class Rt{constructor(e,n,r){if(this.length=0,this.options=r,this._root=n,e){for(let i=0;i<e.length;i++)this[i]=e[i];this.length=e.length}}}Rt.prototype.cheerio="[cheerio object]",Rt.prototype.splice=Array.prototype.splice,Rt.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Rt.prototype,Zc,hh,Oh,Lh,Fh,Vh);function Hh(t,e){return function n(r,i,s=!0){if(r==null)throw new Error("cheerio.load() expects a string");const a=tn(i),c=t(r,a,s,null);class o extends Rt{_make(d,f){const g=l(d,f);return g.prevObject=this,g}_parse(d,f,g,p){return t(d,f,g,p)}_render(d){return e(d,this.options)}}function l(h,d,f=c,g){if(h&&W(h))return h;const p=tn(g,a),S=typeof f=="string"?[t(f,p,!1,null)]:"length"in f?f:[f],$=W(S)?S:new o(S,null,p);if($._root=$,!h)return new o(void 0,$,p);const lt=typeof h=="string"&&fn(h)?t(h,p,!1,null).children:Gh(h)?[h]:Array.isArray(h)?h:void 0,ht=new o(lt,$,p);if(lt)return ht;if(typeof h!="string")throw new TypeError("Unexpected type of selector");let At=h;const $t=d?typeof d=="string"?fn(d)?new o([t(d,p,!1,null)],$,p):(At=`${d} ${At}`,$):W(d)?d:new o(Array.isArray(d)?d:[d],$,p):$;return $t?$t.find(At):ht}return Object.assign(l,jc,{load:n,_root:c,_options:a,fn:o.prototype,prototype:o.prototype}),l}}function Gh(t){return!!t.name||t.type==="root"||t.type==="text"||t.type==="comment"}var b;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(b||(b={}));var u;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"})(u||(u={}));function Q(t){return t===b.Space||t===b.NewLine||t===b.Tab||t===b.FormFeed||t===b.CarriageReturn}function Ie(t){return t===b.Slash||t===b.Gt||Q(t)}function zh(t){return t>=b.LowerA&&t<=b.LowerZ||t>=b.UpperA&&t<=b.UpperZ}var V;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(V||(V={}));const N={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Wh{constructor({xmlMode:e=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=u.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new ti(e?Kr:Xr,(i,s)=>this.emitCodePoint(i,s))}reset(){this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=u.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===b.Lt||!this.decodeEntities&&this.fastForwardTo(b.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=u.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Ie(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=u.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===b.Gt||Q(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===N.TitleEnd?this.decodeEntities&&e===b.Amp&&this.startEntity():this.fastForwardTo(b.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===b.Lt)}stateCDATASequence(e){e===N.Cdata[this.sequenceIndex]?++this.sequenceIndex===N.Cdata.length&&(this.state=u.InCommentLike,this.currentSequence=N.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=u.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=u.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Ie(e):zh(e)}startSpecial(e,n){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=n,this.state=u.SpecialStartSequence}stateBeforeTagName(e){if(e===b.ExclamationMark)this.state=u.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===b.Questionmark)this.state=u.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const n=e|32;this.sectionStart=this.index,this.xmlMode?this.state=u.InTagName:n===N.ScriptEnd[2]?this.state=u.BeforeSpecialS:n===N.TitleEnd[2]?this.state=u.BeforeSpecialT:this.state=u.InTagName}else e===b.Slash?this.state=u.BeforeClosingTagName:(this.state=u.Text,this.stateText(e))}stateInTagName(e){Ie(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Q(e)||(e===b.Gt?this.state=u.Text:(this.state=this.isTagStartChar(e)?u.InClosingTagName:u.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===b.Gt||Q(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===b.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=u.InSpecialTag,this.sequenceIndex=0):this.state=u.Text,this.sectionStart=this.index+1):e===b.Slash?this.state=u.InSelfClosingTag:Q(e)||(this.state=u.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===b.Gt?(this.cbs.onselfclosingtag(this.index),this.state=u.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Q(e)||(this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===b.Eq||Ie(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=u.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===b.Eq?this.state=u.BeforeAttributeValue:e===b.Slash||e===b.Gt?(this.cbs.onattribend(V.NoValue,this.sectionStart),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):Q(e)||(this.cbs.onattribend(V.NoValue,this.sectionStart),this.state=u.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===b.DoubleQuote?(this.state=u.InAttributeValueDq,this.sectionStart=this.index+1):e===b.SingleQuote?(this.state=u.InAttributeValueSq,this.sectionStart=this.index+1):Q(e)||(this.sectionStart=this.index,this.state=u.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===b.DoubleQuote?V.Double:V.Single,this.index+1),this.state=u.BeforeAttributeName):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,b.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,b.SingleQuote)}stateInAttributeValueNoQuotes(e){Q(e)||e===b.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(V.Unquoted,this.index),this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===b.OpeningSquareBracket?(this.state=u.CDATASequence,this.sequenceIndex=0):this.state=e===b.Dash?u.BeforeComment:u.InDeclaration}stateInDeclaration(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===b.Dash?(this.state=u.InCommentLike,this.currentSequence=N.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=u.InDeclaration}stateInSpecialComment(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const n=e|32;n===N.ScriptEnd[3]?this.startSpecial(N.ScriptEnd,4):n===N.StyleEnd[3]?this.startSpecial(N.StyleEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const n=e|32;n===N.TitleEnd[3]?this.startSpecial(N.TitleEnd,4):n===N.TextareaEnd[3]?this.startSpecial(N.TextareaEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=u.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?R.Strict:this.baseState===u.Text||this.baseState===u.InSpecialTag?R.Legacy:R.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,e===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===u.Text||this.state===u.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===u.InAttributeValueDq||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case u.Text:{this.stateText(e);break}case u.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case u.InSpecialTag:{this.stateInSpecialTag(e);break}case u.CDATASequence:{this.stateCDATASequence(e);break}case u.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case u.InAttributeName:{this.stateInAttributeName(e);break}case u.InCommentLike:{this.stateInCommentLike(e);break}case u.InSpecialComment:{this.stateInSpecialComment(e);break}case u.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case u.InTagName:{this.stateInTagName(e);break}case u.InClosingTagName:{this.stateInClosingTagName(e);break}case u.BeforeTagName:{this.stateBeforeTagName(e);break}case u.AfterAttributeName:{this.stateAfterAttributeName(e);break}case u.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case u.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case u.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case u.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case u.BeforeSpecialS:{this.stateBeforeSpecialS(e);break}case u.BeforeSpecialT:{this.stateBeforeSpecialT(e);break}case u.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case u.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case u.InDeclaration:{this.stateInDeclaration(e);break}case u.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case u.BeforeComment:{this.stateBeforeComment(e);break}case u.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case u.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===u.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===u.InCommentLike?this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===u.InTagName||this.state===u.BeforeAttributeName||this.state===u.BeforeAttributeValue||this.state===u.AfterAttributeName||this.state===u.InAttributeName||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueDq||this.state===u.InAttributeValueNq||this.state===u.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){this.baseState!==u.Text&&this.baseState!==u.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const St=new Set(["input","option","optgroup","select","button","datalist","textarea"]),v=new Set(["p"]),Yi=new Set(["thead","tbody"]),Xi=new Set(["dd","dt"]),Ki=new Set(["rt","rp"]),Qh=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",v],["h1",v],["h2",v],["h3",v],["h4",v],["h5",v],["h6",v],["select",St],["input",St],["output",St],["button",St],["datalist",St],["textarea",St],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Xi],["dt",Xi],["address",v],["article",v],["aside",v],["blockquote",v],["details",v],["div",v],["dl",v],["fieldset",v],["figcaption",v],["figure",v],["footer",v],["form",v],["header",v],["hr",v],["main",v],["nav",v],["ol",v],["pre",v],["section",v],["table",v],["ul",v],["rt",Ki],["rp",Ki],["tbody",Yi],["tfoot",Yi]]),Zh=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ts=new Set(["math","svg"]),es=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Jh=/\s|\//;class Yh{constructor(e,n={}){var r,i,s,a,c,o;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e!=null?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((a=n.Tokenizer)!==null&&a!==void 0?a:Wh)(this.options,this),this.foreignContext=[!this.htmlMode],(o=(c=this.cbs).onparserinit)===null||o===void 0||o.call(c,this)}ontext(e,n){var r,i;const s=this.getSlice(e,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,s),this.startIndex=n}ontextentity(e,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,on(e)),this.startIndex=n}isVoidElement(e){return this.htmlMode&&Zh.has(e)}onopentagname(e,n){this.endIndex=n;let r=this.getSlice(e,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(e){var n,r,i,s;this.openTagStart=this.startIndex,this.tagname=e;const a=this.htmlMode&&Qh.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){const c=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,c,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ts.has(e)?this.foreignContext.unshift(!0):es.has(e)&&this.foreignContext.unshift(!1))),(s=(i=this.cbs).onopentagname)===null||s===void 0||s.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,i,s,a,c,o,l,h;this.endIndex=n;let d=this.getSlice(e,n);if(this.lowerCaseTagNames&&(d=d.toLowerCase()),this.htmlMode&&(ts.has(d)||es.has(d))&&this.foreignContext.shift(),this.isVoidElement(d))this.htmlMode&&d==="br"&&((a=(s=this.cbs).onopentagname)===null||a===void 0||a.call(s,"br"),(o=(c=this.cbs).onopentag)===null||o===void 0||o.call(c,"br",{},!0),(h=(l=this.cbs).onclosetag)===null||h===void 0||h.call(l,"br",!1));else{const f=this.stack.indexOf(d);if(f!==-1)for(let g=0;g<=f;g++){const p=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,p,g!==f)}else this.htmlMode&&d==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var n,r;const i=this.tagname;this.endOpenTag(e),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!e),this.stack.shift())}onattribname(e,n){this.startIndex=e;const r=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=on(e)}onattribend(e,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,e===V.Double?'"':e===V.Single?"'":e===V.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(Jh);let r=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(e,n,r){var i,s,a,c;this.endIndex=n,(s=(i=this.cbs).oncomment)===null||s===void 0||s.call(i,this.getSlice(e,n-r)),(c=(a=this.cbs).oncommentend)===null||c===void 0||c.call(a),this.startIndex=n+1}oncdata(e,n,r){var i,s,a,c,o,l,h,d,f,g;this.endIndex=n;const p=this.getSlice(e,n-r);!this.htmlMode||this.options.recognizeCDATA?((s=(i=this.cbs).oncdatastart)===null||s===void 0||s.call(i),(c=(a=this.cbs).ontext)===null||c===void 0||c.call(a,p),(l=(o=this.cbs).oncdataend)===null||l===void 0||l.call(o)):((d=(h=this.cbs).oncomment)===null||d===void 0||d.call(h,`[CDATA[${p}]]`),(g=(f=this.cbs).oncommentend)===null||g===void 0||g.call(f)),this.startIndex=n+1}onend(){var e,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(e=this.cbs).onend)===null||n===void 0||n.call(e)}reset(){var e,n,r,i;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,n){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}function Xh(t,e){const n=new Lo(void 0,e);return new Yh(n,e).end(t),n.root}const Kh=Hh(uh(Xh),fe),tu=Kh(""),Pn=t=>{var e;return(e=tu.parseHTML(t))!=null?e:[]};var eu=Object.defineProperty,ns=Object.getOwnPropertySymbols,nu=Object.prototype.hasOwnProperty,ru=Object.prototype.propertyIsEnumerable,rs=(t,e,n)=>e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,is=(t,e)=>{for(var n in e||(e={}))nu.call(e,n)&&rs(t,n,e[n]);if(ns)for(var n of ns(e))ru.call(e,n)&&rs(t,n,e[n]);return t},ss=(t,e,n)=>new Promise((r,i)=>{var s=o=>{try{c(n.next(o))}catch(l){i(l)}},a=o=>{try{c(n.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(s,a);c((n=n.apply(t,e)).next())});const as=t=>{const e=t.filter(i=>!!i),n=e[0];n&&n.type==="text"&&!n.text.trim()&&e.shift();const r=e[e.length-1];return r&&r.type==="text"&&!r.text.trim()&&e.pop(),e},os=(t,e)=>ss(void 0,[t,e],function*(n,{appendClass:r,transform:i}){if(n.type==="text")return{type:"text",text:n.data.replace(/\r/g,"")};if(n.type==="tag"){const s=Gr.find(([a])=>n.name===a);if(s){const a=Object.fromEntries(n.attributes.filter(({name:h})=>{var d;return["class","style"].includes(h)||((d=s[1])==null?void 0:d.includes(h))}).map(({name:h,value:d})=>[h,d])),c=as(yield Promise.all(n.children.map(h=>os(h,{appendClass:r,transform:i}))));r&&(a.class=a.class?`${a.class} ${n.name}`:n.name);const o=is(is({type:"node",name:n.name},Object.keys(a).length?{attrs:a}:{}),c.length?{children:c}:{}),l=i[n.name];return yield l?l(o):o}}return null}),iu=(t,...e)=>ss(void 0,[t,...e],function*(n,{appendClass:r=!0,transform:i={}}={}){return as(yield Promise.all((Array.isArray(n)?n:Pn(n)).map(s=>os(s,{appendClass:r,transform:i}))))}),cs=t=>(typeof t=="string"?Pn(t)||[]:t).map(e=>e.type==="text"?e.data:"childNodes"in e?cs(e.childNodes):"").join("");export{Js as $App,ya as $Component,ea as $Config,wa as $Page,Gr as ALLOWED_TAGS,ae as Cookie,le as CookieStore,Qt as Emitter,Ye as Headers,Ls as MpError,Jn as Queue,Vt as URLSearchParams,Es as addContact,Ga as check,za as checkAsync,ks as compareVersion,ys as confirm,yo as createRequest,Ds as decodeBase64,ee as dirname,zt as downLoad,z as emitter,Ps as encodeBase64,Ue as exists,zs as funcQueue,Ua as get,Ra as getAsync,se as getCookieScopeDomain,Rn as getCurrentPage,Ts as getCurrentRoute,ie as getDomain,iu as getRichTextNodes,cs as getText,Ve as getUrlInfo,xs as getWindowInfo,Sr as isDir,ka as isFile,Zn as isFunction,Oe as isMp,qe as isQQ,Hn as isWx,Hs as lock,Z as logger,Ia as ls,ne as mkdir,ft as normalizeDomain,Gs as once,Is as openDocument,Je as parseCookieHeader,Pn as parseHTML,Cr as parseUrl,ja as put,Wn as query,Na as readFile,qa as readJSON,Va as remove,Ha as removeAsync,Vn as reportNetworkStatus,Rr as request,Ke as requestCookieStore,ws as retry,Ta as rm,Ns as saveDocument,Oa as saveFile,Pa as saveOnlineFile,qs as savePhoto,Ba as set,Fa as setAsync,Ct as showModal,P as showToast,re as storage,Ma as take,Qn as type,La as unzip,Os as updateApp,B as wrapFunction,bs as writeClipboard,Da as writeFile,_a as writeJSON};
12
+ `)}}).toArray()}var Fh=Object.freeze({__proto__:null,serialize:Mh,serializeArray:Bh});function Uh(t){var e;return typeof t=="string"?{selector:t,value:"textContent"}:{selector:t.selector,value:(e=t.value)!==null&&e!==void 0?e:"textContent"}}function Rh(t){const e={};for(const n in t){const r=t[n],i=Array.isArray(r),{selector:s,value:a}=Uh(i?r[0]:r),c=typeof a=="function"?a:typeof a=="string"?o=>this._make(o).prop(a):o=>this._make(o).extract(a);if(i)e[n]=this._findBySelector(s,Number.POSITIVE_INFINITY).map((o,l)=>c(l,n,e)).get();else{const o=this._findBySelector(s,1);e[n]=o.length>0?c(o[0],n,e):void 0}}return e}var Vh=Object.freeze({__proto__:null,extract:Rh});class Rt{constructor(e,n,r){if(this.length=0,this.options=r,this._root=n,e){for(let i=0;i<e.length;i++)this[i]=e[i];this.length=e.length}}}Rt.prototype.cheerio="[cheerio object]",Rt.prototype.splice=Array.prototype.splice,Rt.prototype[Symbol.iterator]=Array.prototype[Symbol.iterator],Object.assign(Rt.prototype,Zc,hh,Oh,Lh,Fh,Vh);function Hh(t,e){return function n(r,i,s=!0){if(r==null)throw new Error("cheerio.load() expects a string");const a=tn(i),c=t(r,a,s,null);class o extends Rt{_make(d,f){const g=l(d,f);return g.prevObject=this,g}_parse(d,f,g,p){return t(d,f,g,p)}_render(d){return e(d,this.options)}}function l(h,d,f=c,g){if(h&&W(h))return h;const p=tn(g,a),S=typeof f=="string"?[t(f,p,!1,null)]:"length"in f?f:[f],$=W(S)?S:new o(S,null,p);if($._root=$,!h)return new o(void 0,$,p);const lt=typeof h=="string"&&fn(h)?t(h,p,!1,null).children:Gh(h)?[h]:Array.isArray(h)?h:void 0,ht=new o(lt,$,p);if(lt)return ht;if(typeof h!="string")throw new TypeError("Unexpected type of selector");let At=h;const $t=d?typeof d=="string"?fn(d)?new o([t(d,p,!1,null)],$,p):(At=`${d} ${At}`,$):W(d)?d:new o(Array.isArray(d)?d:[d],$,p):$;return $t?$t.find(At):ht}return Object.assign(l,jc,{load:n,_root:c,_options:a,fn:o.prototype,prototype:o.prototype}),l}}function Gh(t){return!!t.name||t.type==="root"||t.type==="text"||t.type==="comment"}var b;(function(t){t[t.Tab=9]="Tab",t[t.NewLine=10]="NewLine",t[t.FormFeed=12]="FormFeed",t[t.CarriageReturn=13]="CarriageReturn",t[t.Space=32]="Space",t[t.ExclamationMark=33]="ExclamationMark",t[t.Number=35]="Number",t[t.Amp=38]="Amp",t[t.SingleQuote=39]="SingleQuote",t[t.DoubleQuote=34]="DoubleQuote",t[t.Dash=45]="Dash",t[t.Slash=47]="Slash",t[t.Zero=48]="Zero",t[t.Nine=57]="Nine",t[t.Semi=59]="Semi",t[t.Lt=60]="Lt",t[t.Eq=61]="Eq",t[t.Gt=62]="Gt",t[t.Questionmark=63]="Questionmark",t[t.UpperA=65]="UpperA",t[t.LowerA=97]="LowerA",t[t.UpperF=70]="UpperF",t[t.LowerF=102]="LowerF",t[t.UpperZ=90]="UpperZ",t[t.LowerZ=122]="LowerZ",t[t.LowerX=120]="LowerX",t[t.OpeningSquareBracket=91]="OpeningSquareBracket"})(b||(b={}));var u;(function(t){t[t.Text=1]="Text",t[t.BeforeTagName=2]="BeforeTagName",t[t.InTagName=3]="InTagName",t[t.InSelfClosingTag=4]="InSelfClosingTag",t[t.BeforeClosingTagName=5]="BeforeClosingTagName",t[t.InClosingTagName=6]="InClosingTagName",t[t.AfterClosingTagName=7]="AfterClosingTagName",t[t.BeforeAttributeName=8]="BeforeAttributeName",t[t.InAttributeName=9]="InAttributeName",t[t.AfterAttributeName=10]="AfterAttributeName",t[t.BeforeAttributeValue=11]="BeforeAttributeValue",t[t.InAttributeValueDq=12]="InAttributeValueDq",t[t.InAttributeValueSq=13]="InAttributeValueSq",t[t.InAttributeValueNq=14]="InAttributeValueNq",t[t.BeforeDeclaration=15]="BeforeDeclaration",t[t.InDeclaration=16]="InDeclaration",t[t.InProcessingInstruction=17]="InProcessingInstruction",t[t.BeforeComment=18]="BeforeComment",t[t.CDATASequence=19]="CDATASequence",t[t.InSpecialComment=20]="InSpecialComment",t[t.InCommentLike=21]="InCommentLike",t[t.BeforeSpecialS=22]="BeforeSpecialS",t[t.BeforeSpecialT=23]="BeforeSpecialT",t[t.SpecialStartSequence=24]="SpecialStartSequence",t[t.InSpecialTag=25]="InSpecialTag",t[t.InEntity=26]="InEntity"})(u||(u={}));function Q(t){return t===b.Space||t===b.NewLine||t===b.Tab||t===b.FormFeed||t===b.CarriageReturn}function Ie(t){return t===b.Slash||t===b.Gt||Q(t)}function zh(t){return t>=b.LowerA&&t<=b.LowerZ||t>=b.UpperA&&t<=b.UpperZ}var V;(function(t){t[t.NoValue=0]="NoValue",t[t.Unquoted=1]="Unquoted",t[t.Single=2]="Single",t[t.Double=3]="Double"})(V||(V={}));const N={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101]),TextareaEnd:new Uint8Array([60,47,116,101,120,116,97,114,101,97])};class Wh{constructor({xmlMode:e=!1,decodeEntities:n=!0},r){this.cbs=r,this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.entityStart=0,this.baseState=u.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.xmlMode=e,this.decodeEntities=n,this.entityDecoder=new ti(e?Kr:Xr,(i,s)=>this.emitCodePoint(i,s))}reset(){this.state=u.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=u.Text,this.currentSequence=void 0,this.running=!0,this.offset=0}write(e){this.offset+=this.buffer.length,this.buffer=e,this.parse()}end(){this.running&&this.finish()}pause(){this.running=!1}resume(){this.running=!0,this.index<this.buffer.length+this.offset&&this.parse()}stateText(e){e===b.Lt||!this.decodeEntities&&this.fastForwardTo(b.Lt)?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=u.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateSpecialStartSequence(e){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?Ie(e):(e|32)===this.currentSequence[this.sequenceIndex]))this.isSpecial=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=u.InTagName,this.stateInTagName(e)}stateInSpecialTag(e){if(this.sequenceIndex===this.currentSequence.length){if(e===b.Gt||Q(e)){const n=this.index-this.currentSequence.length;if(this.sectionStart<n){const r=this.index;this.index=n,this.cbs.ontext(this.sectionStart,n),this.index=r}this.isSpecial=!1,this.sectionStart=n+2,this.stateInClosingTagName(e);return}this.sequenceIndex=0}(e|32)===this.currentSequence[this.sequenceIndex]?this.sequenceIndex+=1:this.sequenceIndex===0?this.currentSequence===N.TitleEnd?this.decodeEntities&&e===b.Amp&&this.startEntity():this.fastForwardTo(b.Lt)&&(this.sequenceIndex=1):this.sequenceIndex=+(e===b.Lt)}stateCDATASequence(e){e===N.Cdata[this.sequenceIndex]?++this.sequenceIndex===N.Cdata.length&&(this.state=u.InCommentLike,this.currentSequence=N.CdataEnd,this.sequenceIndex=0,this.sectionStart=this.index+1):(this.sequenceIndex=0,this.state=u.InDeclaration,this.stateInDeclaration(e))}fastForwardTo(e){for(;++this.index<this.buffer.length+this.offset;)if(this.buffer.charCodeAt(this.index-this.offset)===e)return!0;return this.index=this.buffer.length+this.offset-1,!1}stateInCommentLike(e){e===this.currentSequence[this.sequenceIndex]?++this.sequenceIndex===this.currentSequence.length&&(this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,this.index,2):this.cbs.oncomment(this.sectionStart,this.index,2),this.sequenceIndex=0,this.sectionStart=this.index+1,this.state=u.Text):this.sequenceIndex===0?this.fastForwardTo(this.currentSequence[0])&&(this.sequenceIndex=1):e!==this.currentSequence[this.sequenceIndex-1]&&(this.sequenceIndex=0)}isTagStartChar(e){return this.xmlMode?!Ie(e):zh(e)}startSpecial(e,n){this.isSpecial=!0,this.currentSequence=e,this.sequenceIndex=n,this.state=u.SpecialStartSequence}stateBeforeTagName(e){if(e===b.ExclamationMark)this.state=u.BeforeDeclaration,this.sectionStart=this.index+1;else if(e===b.Questionmark)this.state=u.InProcessingInstruction,this.sectionStart=this.index+1;else if(this.isTagStartChar(e)){const n=e|32;this.sectionStart=this.index,this.xmlMode?this.state=u.InTagName:n===N.ScriptEnd[2]?this.state=u.BeforeSpecialS:n===N.TitleEnd[2]?this.state=u.BeforeSpecialT:this.state=u.InTagName}else e===b.Slash?this.state=u.BeforeClosingTagName:(this.state=u.Text,this.stateText(e))}stateInTagName(e){Ie(e)&&(this.cbs.onopentagname(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateBeforeClosingTagName(e){Q(e)||(e===b.Gt?this.state=u.Text:(this.state=this.isTagStartChar(e)?u.InClosingTagName:u.InSpecialComment,this.sectionStart=this.index))}stateInClosingTagName(e){(e===b.Gt||Q(e))&&(this.cbs.onclosetag(this.sectionStart,this.index),this.sectionStart=-1,this.state=u.AfterClosingTagName,this.stateAfterClosingTagName(e))}stateAfterClosingTagName(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeAttributeName(e){e===b.Gt?(this.cbs.onopentagend(this.index),this.isSpecial?(this.state=u.InSpecialTag,this.sequenceIndex=0):this.state=u.Text,this.sectionStart=this.index+1):e===b.Slash?this.state=u.InSelfClosingTag:Q(e)||(this.state=u.InAttributeName,this.sectionStart=this.index)}stateInSelfClosingTag(e){e===b.Gt?(this.cbs.onselfclosingtag(this.index),this.state=u.Text,this.sectionStart=this.index+1,this.isSpecial=!1):Q(e)||(this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e))}stateInAttributeName(e){(e===b.Eq||Ie(e))&&(this.cbs.onattribname(this.sectionStart,this.index),this.sectionStart=this.index,this.state=u.AfterAttributeName,this.stateAfterAttributeName(e))}stateAfterAttributeName(e){e===b.Eq?this.state=u.BeforeAttributeValue:e===b.Slash||e===b.Gt?(this.cbs.onattribend(V.NoValue,this.sectionStart),this.sectionStart=-1,this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):Q(e)||(this.cbs.onattribend(V.NoValue,this.sectionStart),this.state=u.InAttributeName,this.sectionStart=this.index)}stateBeforeAttributeValue(e){e===b.DoubleQuote?(this.state=u.InAttributeValueDq,this.sectionStart=this.index+1):e===b.SingleQuote?(this.state=u.InAttributeValueSq,this.sectionStart=this.index+1):Q(e)||(this.sectionStart=this.index,this.state=u.InAttributeValueNq,this.stateInAttributeValueNoQuotes(e))}handleInAttributeValue(e,n){e===n||!this.decodeEntities&&this.fastForwardTo(n)?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(n===b.DoubleQuote?V.Double:V.Single,this.index+1),this.state=u.BeforeAttributeName):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateInAttributeValueDoubleQuotes(e){this.handleInAttributeValue(e,b.DoubleQuote)}stateInAttributeValueSingleQuotes(e){this.handleInAttributeValue(e,b.SingleQuote)}stateInAttributeValueNoQuotes(e){Q(e)||e===b.Gt?(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=-1,this.cbs.onattribend(V.Unquoted,this.index),this.state=u.BeforeAttributeName,this.stateBeforeAttributeName(e)):this.decodeEntities&&e===b.Amp&&this.startEntity()}stateBeforeDeclaration(e){e===b.OpeningSquareBracket?(this.state=u.CDATASequence,this.sequenceIndex=0):this.state=e===b.Dash?u.BeforeComment:u.InDeclaration}stateInDeclaration(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.ondeclaration(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateInProcessingInstruction(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.onprocessinginstruction(this.sectionStart,this.index),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeComment(e){e===b.Dash?(this.state=u.InCommentLike,this.currentSequence=N.CommentEnd,this.sequenceIndex=2,this.sectionStart=this.index+1):this.state=u.InDeclaration}stateInSpecialComment(e){(e===b.Gt||this.fastForwardTo(b.Gt))&&(this.cbs.oncomment(this.sectionStart,this.index,0),this.state=u.Text,this.sectionStart=this.index+1)}stateBeforeSpecialS(e){const n=e|32;n===N.ScriptEnd[3]?this.startSpecial(N.ScriptEnd,4):n===N.StyleEnd[3]?this.startSpecial(N.StyleEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}stateBeforeSpecialT(e){const n=e|32;n===N.TitleEnd[3]?this.startSpecial(N.TitleEnd,4):n===N.TextareaEnd[3]?this.startSpecial(N.TextareaEnd,4):(this.state=u.InTagName,this.stateInTagName(e))}startEntity(){this.baseState=this.state,this.state=u.InEntity,this.entityStart=this.index,this.entityDecoder.startEntity(this.xmlMode?R.Strict:this.baseState===u.Text||this.baseState===u.InSpecialTag?R.Legacy:R.Attribute)}stateInEntity(){const e=this.entityDecoder.write(this.buffer,this.index-this.offset);e>=0?(this.state=this.baseState,e===0&&(this.index=this.entityStart)):this.index=this.offset+this.buffer.length-1}cleanup(){this.running&&this.sectionStart!==this.index&&(this.state===u.Text||this.state===u.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===u.InAttributeValueDq||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))}shouldContinue(){return this.index<this.buffer.length+this.offset&&this.running}parse(){for(;this.shouldContinue();){const e=this.buffer.charCodeAt(this.index-this.offset);switch(this.state){case u.Text:{this.stateText(e);break}case u.SpecialStartSequence:{this.stateSpecialStartSequence(e);break}case u.InSpecialTag:{this.stateInSpecialTag(e);break}case u.CDATASequence:{this.stateCDATASequence(e);break}case u.InAttributeValueDq:{this.stateInAttributeValueDoubleQuotes(e);break}case u.InAttributeName:{this.stateInAttributeName(e);break}case u.InCommentLike:{this.stateInCommentLike(e);break}case u.InSpecialComment:{this.stateInSpecialComment(e);break}case u.BeforeAttributeName:{this.stateBeforeAttributeName(e);break}case u.InTagName:{this.stateInTagName(e);break}case u.InClosingTagName:{this.stateInClosingTagName(e);break}case u.BeforeTagName:{this.stateBeforeTagName(e);break}case u.AfterAttributeName:{this.stateAfterAttributeName(e);break}case u.InAttributeValueSq:{this.stateInAttributeValueSingleQuotes(e);break}case u.BeforeAttributeValue:{this.stateBeforeAttributeValue(e);break}case u.BeforeClosingTagName:{this.stateBeforeClosingTagName(e);break}case u.AfterClosingTagName:{this.stateAfterClosingTagName(e);break}case u.BeforeSpecialS:{this.stateBeforeSpecialS(e);break}case u.BeforeSpecialT:{this.stateBeforeSpecialT(e);break}case u.InAttributeValueNq:{this.stateInAttributeValueNoQuotes(e);break}case u.InSelfClosingTag:{this.stateInSelfClosingTag(e);break}case u.InDeclaration:{this.stateInDeclaration(e);break}case u.BeforeDeclaration:{this.stateBeforeDeclaration(e);break}case u.BeforeComment:{this.stateBeforeComment(e);break}case u.InProcessingInstruction:{this.stateInProcessingInstruction(e);break}case u.InEntity:{this.stateInEntity();break}}this.index++}this.cleanup()}finish(){this.state===u.InEntity&&(this.entityDecoder.end(),this.state=this.baseState),this.handleTrailingData(),this.cbs.onend()}handleTrailingData(){const e=this.buffer.length+this.offset;this.sectionStart>=e||(this.state===u.InCommentLike?this.currentSequence===N.CdataEnd?this.cbs.oncdata(this.sectionStart,e,0):this.cbs.oncomment(this.sectionStart,e,0):this.state===u.InTagName||this.state===u.BeforeAttributeName||this.state===u.BeforeAttributeValue||this.state===u.AfterAttributeName||this.state===u.InAttributeName||this.state===u.InAttributeValueSq||this.state===u.InAttributeValueDq||this.state===u.InAttributeValueNq||this.state===u.InClosingTagName||this.cbs.ontext(this.sectionStart,e))}emitCodePoint(e,n){this.baseState!==u.Text&&this.baseState!==u.InSpecialTag?(this.sectionStart<this.entityStart&&this.cbs.onattribdata(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.onattribentity(e)):(this.sectionStart<this.entityStart&&this.cbs.ontext(this.sectionStart,this.entityStart),this.sectionStart=this.entityStart+n,this.index=this.sectionStart-1,this.cbs.ontextentity(e,this.sectionStart))}}const St=new Set(["input","option","optgroup","select","button","datalist","textarea"]),v=new Set(["p"]),Yi=new Set(["thead","tbody"]),Xi=new Set(["dd","dt"]),Ki=new Set(["rt","rp"]),Qh=new Map([["tr",new Set(["tr","th","td"])],["th",new Set(["th"])],["td",new Set(["thead","th","td"])],["body",new Set(["head","link","script"])],["li",new Set(["li"])],["p",v],["h1",v],["h2",v],["h3",v],["h4",v],["h5",v],["h6",v],["select",St],["input",St],["output",St],["button",St],["datalist",St],["textarea",St],["option",new Set(["option"])],["optgroup",new Set(["optgroup","option"])],["dd",Xi],["dt",Xi],["address",v],["article",v],["aside",v],["blockquote",v],["details",v],["div",v],["dl",v],["fieldset",v],["figcaption",v],["figure",v],["footer",v],["form",v],["header",v],["hr",v],["main",v],["nav",v],["ol",v],["pre",v],["section",v],["table",v],["ul",v],["rt",Ki],["rp",Ki],["tbody",Yi],["tfoot",Yi]]),Zh=new Set(["area","base","basefont","br","col","command","embed","frame","hr","img","input","isindex","keygen","link","meta","param","source","track","wbr"]),ts=new Set(["math","svg"]),es=new Set(["mi","mo","mn","ms","mtext","annotation-xml","foreignobject","desc","title"]),Jh=/\s|\//;class Yh{constructor(e,n={}){var r,i,s,a,c,o;this.options=n,this.startIndex=0,this.endIndex=0,this.openTagStart=0,this.tagname="",this.attribname="",this.attribvalue="",this.attribs=null,this.stack=[],this.buffers=[],this.bufferOffset=0,this.writeIndex=0,this.ended=!1,this.cbs=e!=null?e:{},this.htmlMode=!this.options.xmlMode,this.lowerCaseTagNames=(r=n.lowerCaseTags)!==null&&r!==void 0?r:this.htmlMode,this.lowerCaseAttributeNames=(i=n.lowerCaseAttributeNames)!==null&&i!==void 0?i:this.htmlMode,this.recognizeSelfClosing=(s=n.recognizeSelfClosing)!==null&&s!==void 0?s:!this.htmlMode,this.tokenizer=new((a=n.Tokenizer)!==null&&a!==void 0?a:Wh)(this.options,this),this.foreignContext=[!this.htmlMode],(o=(c=this.cbs).onparserinit)===null||o===void 0||o.call(c,this)}ontext(e,n){var r,i;const s=this.getSlice(e,n);this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,s),this.startIndex=n}ontextentity(e,n){var r,i;this.endIndex=n-1,(i=(r=this.cbs).ontext)===null||i===void 0||i.call(r,on(e)),this.startIndex=n}isVoidElement(e){return this.htmlMode&&Zh.has(e)}onopentagname(e,n){this.endIndex=n;let r=this.getSlice(e,n);this.lowerCaseTagNames&&(r=r.toLowerCase()),this.emitOpenTag(r)}emitOpenTag(e){var n,r,i,s;this.openTagStart=this.startIndex,this.tagname=e;const a=this.htmlMode&&Qh.get(e);if(a)for(;this.stack.length>0&&a.has(this.stack[0]);){const c=this.stack.shift();(r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,c,!0)}this.isVoidElement(e)||(this.stack.unshift(e),this.htmlMode&&(ts.has(e)?this.foreignContext.unshift(!0):es.has(e)&&this.foreignContext.unshift(!1))),(s=(i=this.cbs).onopentagname)===null||s===void 0||s.call(i,e),this.cbs.onopentag&&(this.attribs={})}endOpenTag(e){var n,r;this.startIndex=this.openTagStart,this.attribs&&((r=(n=this.cbs).onopentag)===null||r===void 0||r.call(n,this.tagname,this.attribs,e),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""}onopentagend(e){this.endIndex=e,this.endOpenTag(!1),this.startIndex=e+1}onclosetag(e,n){var r,i,s,a,c,o,l,h;this.endIndex=n;let d=this.getSlice(e,n);if(this.lowerCaseTagNames&&(d=d.toLowerCase()),this.htmlMode&&(ts.has(d)||es.has(d))&&this.foreignContext.shift(),this.isVoidElement(d))this.htmlMode&&d==="br"&&((a=(s=this.cbs).onopentagname)===null||a===void 0||a.call(s,"br"),(o=(c=this.cbs).onopentag)===null||o===void 0||o.call(c,"br",{},!0),(h=(l=this.cbs).onclosetag)===null||h===void 0||h.call(l,"br",!1));else{const f=this.stack.indexOf(d);if(f!==-1)for(let g=0;g<=f;g++){const p=this.stack.shift();(i=(r=this.cbs).onclosetag)===null||i===void 0||i.call(r,p,g!==f)}else this.htmlMode&&d==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=n+1}onselfclosingtag(e){this.endIndex=e,this.recognizeSelfClosing||this.foreignContext[0]?(this.closeCurrentTag(!1),this.startIndex=e+1):this.onopentagend(e)}closeCurrentTag(e){var n,r;const i=this.tagname;this.endOpenTag(e),this.stack[0]===i&&((r=(n=this.cbs).onclosetag)===null||r===void 0||r.call(n,i,!e),this.stack.shift())}onattribname(e,n){this.startIndex=e;const r=this.getSlice(e,n);this.attribname=this.lowerCaseAttributeNames?r.toLowerCase():r}onattribdata(e,n){this.attribvalue+=this.getSlice(e,n)}onattribentity(e){this.attribvalue+=on(e)}onattribend(e,n){var r,i;this.endIndex=n,(i=(r=this.cbs).onattribute)===null||i===void 0||i.call(r,this.attribname,this.attribvalue,e===V.Double?'"':e===V.Single?"'":e===V.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""}getInstructionName(e){const n=e.search(Jh);let r=n<0?e:e.substr(0,n);return this.lowerCaseTagNames&&(r=r.toLowerCase()),r}ondeclaration(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`!${i}`,`!${r}`)}this.startIndex=n+1}onprocessinginstruction(e,n){this.endIndex=n;const r=this.getSlice(e,n);if(this.cbs.onprocessinginstruction){const i=this.getInstructionName(r);this.cbs.onprocessinginstruction(`?${i}`,`?${r}`)}this.startIndex=n+1}oncomment(e,n,r){var i,s,a,c;this.endIndex=n,(s=(i=this.cbs).oncomment)===null||s===void 0||s.call(i,this.getSlice(e,n-r)),(c=(a=this.cbs).oncommentend)===null||c===void 0||c.call(a),this.startIndex=n+1}oncdata(e,n,r){var i,s,a,c,o,l,h,d,f,g;this.endIndex=n;const p=this.getSlice(e,n-r);!this.htmlMode||this.options.recognizeCDATA?((s=(i=this.cbs).oncdatastart)===null||s===void 0||s.call(i),(c=(a=this.cbs).ontext)===null||c===void 0||c.call(a,p),(l=(o=this.cbs).oncdataend)===null||l===void 0||l.call(o)):((d=(h=this.cbs).oncomment)===null||d===void 0||d.call(h,`[CDATA[${p}]]`),(g=(f=this.cbs).oncommentend)===null||g===void 0||g.call(f)),this.startIndex=n+1}onend(){var e,n;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(let r=0;r<this.stack.length;r++)this.cbs.onclosetag(this.stack[r],!0)}(n=(e=this.cbs).onend)===null||n===void 0||n.call(e)}reset(){var e,n,r,i;(n=(e=this.cbs).onreset)===null||n===void 0||n.call(e),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(i=(r=this.cbs).onparserinit)===null||i===void 0||i.call(r,this),this.buffers.length=0,this.foreignContext.length=0,this.foreignContext.unshift(!this.htmlMode),this.bufferOffset=0,this.writeIndex=0,this.ended=!1}parseComplete(e){this.reset(),this.end(e)}getSlice(e,n){for(;e-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();let r=this.buffers[0].slice(e-this.bufferOffset,n-this.bufferOffset);for(;n-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),r+=this.buffers[0].slice(0,n-this.bufferOffset);return r}shiftBuffer(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()}write(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".write() after done!"));return}this.buffers.push(e),this.tokenizer.running&&(this.tokenizer.write(e),this.writeIndex++)}end(e){var n,r;if(this.ended){(r=(n=this.cbs).onerror)===null||r===void 0||r.call(n,new Error(".end() after done!"));return}e&&this.write(e),this.ended=!0,this.tokenizer.end()}pause(){this.tokenizer.pause()}resume(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex<this.buffers.length;)this.tokenizer.write(this.buffers[this.writeIndex++]);this.ended&&this.tokenizer.end()}parseChunk(e){this.write(e)}done(e){this.end(e)}}function Xh(t,e){const n=new Lo(void 0,e);return new Yh(n,e).end(t),n.root}const Kh=Hh(uh(Xh),fe),tu=Kh(""),Pn=t=>{var e;return(e=tu.parseHTML(t))!=null?e:[]};var eu=Object.defineProperty,ns=Object.getOwnPropertySymbols,nu=Object.prototype.hasOwnProperty,ru=Object.prototype.propertyIsEnumerable,rs=(t,e,n)=>e in t?eu(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,is=(t,e)=>{for(var n in e||(e={}))nu.call(e,n)&&rs(t,n,e[n]);if(ns)for(var n of ns(e))ru.call(e,n)&&rs(t,n,e[n]);return t},ss=(t,e,n)=>new Promise((r,i)=>{var s=o=>{try{c(n.next(o))}catch(l){i(l)}},a=o=>{try{c(n.throw(o))}catch(l){i(l)}},c=o=>o.done?r(o.value):Promise.resolve(o.value).then(s,a);c((n=n.apply(t,e)).next())});const as=t=>{const e=t.filter(i=>!!i),n=e[0];n&&n.type==="text"&&!n.text.trim()&&e.shift();const r=e[e.length-1];return r&&r.type==="text"&&!r.text.trim()&&e.pop(),e},os=(t,e)=>ss(void 0,[t,e],function*(n,{appendClass:r,transform:i}){if(n.type==="text")return{type:"text",text:n.data.replace(/\r/g,"")};if(n.type==="tag"){const s=Gr.find(([a])=>n.name===a);if(s){const a=Object.fromEntries(n.attributes.filter(({name:h})=>{var d;return["class","style"].includes(h)||((d=s[1])==null?void 0:d.includes(h))}).map(({name:h,value:d})=>[h,d])),c=as(yield Promise.all(n.children.map(h=>os(h,{appendClass:r,transform:i}))));r&&(a.class=a.class?`${a.class} ${n.name}`:n.name);const o=is(is({type:"node",name:n.name},Object.keys(a).length?{attrs:a}:{}),c.length?{children:c}:{}),l=i[n.name];return yield l?l(o):o}}return null}),iu=(t,...e)=>ss(void 0,[t,...e],function*(n,{appendClass:r=!0,transform:i={}}={}){return as(yield Promise.all((Array.isArray(n)?n:Pn(n)).map(s=>os(s,{appendClass:r,transform:i}))))}),cs=t=>(typeof t=="string"?Pn(t)||[]:t).map(e=>e.type==="text"?e.data:"childNodes"in e?cs(e.childNodes):"").join("");export{Js as $App,ya as $Component,ea as $Config,wa as $Page,Gr as ALLOWED_TAGS,ae as Cookie,le as CookieStore,Qt as Emitter,Ye as Headers,Ls as MpError,Jn as Queue,Vt as URLSearchParams,Es as addContact,Ga as check,za as checkAsync,ks as compareVersion,ys as confirm,yo as createRequest,Ds as decodeBase64,ee as dirname,zt as download,z as emitter,Ps as encodeBase64,Ue as exists,zs as funcQueue,Ua as get,Ra as getAsync,se as getCookieScopeDomain,Rn as getCurrentPage,Ts as getCurrentRoute,ie as getDomain,iu as getRichTextNodes,cs as getText,Ve as getUrlInfo,xs as getWindowInfo,Sr as isDir,ka as isFile,Zn as isFunction,Oe as isMp,qe as isQQ,Hn as isWx,Hs as lock,Z as logger,Ia as ls,ne as mkdir,ft as normalizeDomain,Gs as once,Is as openDocument,Je as parseCookieHeader,Pn as parseHTML,Cr as parseUrl,ja as put,Wn as query,Na as readFile,qa as readJSON,Va as remove,Ha as removeAsync,Vn as reportNetworkStatus,Rr as request,Ke as requestCookieStore,ws as retry,Ta as rm,Ns as saveDocument,Oa as saveFile,Pa as saveOnlineFile,qs as savePhoto,Ba as set,Fa as setAsync,Ct as showModal,P as showToast,re as storage,Ma as take,Qn as type,La as unzip,Os as updateApp,B as wrapFunction,bs as writeClipboard,Da as writeFile,_a as writeJSON};
13
13
  //# sourceMappingURL=index.mjs.map