@talisdev/bibliographic-resource-parsers-lib 5.32.0 → 5.32.1
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.
|
@@ -2752,20 +2752,19 @@ const Tl = (e) => {
|
|
|
2752
2752
|
"#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span"
|
|
2753
2753
|
)?.textContent ?? void 0;
|
|
2754
2754
|
return (t ? /\d+/.exec(t)?.[0] : null) ?? void 0;
|
|
2755
|
-
}, Fl = ({
|
|
2756
|
-
const
|
|
2755
|
+
}, Fl = ({ document: e }) => {
|
|
2756
|
+
const t = ql(e), r = Zl(e), n = jl(e), o = Dl(e), s = Bl(e), i = Ul(e), a = e.getElementById("productTitle")?.textContent.trim() ?? void 0, c = Vl(e);
|
|
2757
2757
|
return {
|
|
2758
2758
|
bookmarkingWorkflowUrl: null,
|
|
2759
2759
|
resource: F(y.Book, {
|
|
2760
|
-
au:
|
|
2761
|
-
date:
|
|
2762
|
-
edition:
|
|
2763
|
-
isbn:
|
|
2764
|
-
pub:
|
|
2765
|
-
series:
|
|
2766
|
-
title:
|
|
2767
|
-
tpages:
|
|
2768
|
-
uri: e
|
|
2760
|
+
au: t,
|
|
2761
|
+
date: o,
|
|
2762
|
+
edition: r,
|
|
2763
|
+
isbn: n,
|
|
2764
|
+
pub: s,
|
|
2765
|
+
series: i,
|
|
2766
|
+
title: a,
|
|
2767
|
+
tpages: c
|
|
2769
2768
|
})
|
|
2770
2769
|
};
|
|
2771
2770
|
}, p = (e, t, r) => {
|
|
@@ -5135,7 +5134,7 @@ const Zn = {
|
|
|
5135
5134
|
LaTrobeOpal: rm,
|
|
5136
5135
|
BYUScholarsArchive: ep,
|
|
5137
5136
|
Informit: pm
|
|
5138
|
-
}, fm = "5.32.
|
|
5137
|
+
}, fm = "5.32.1", Ys = () => fm, hm = ["com.au", "com", "ca", "co.uk", "de", "fr", "nl"], dm = hm.flatMap((e) => [
|
|
5139
5138
|
`amazon.${e}`,
|
|
5140
5139
|
`www.amazon.${e}`
|
|
5141
5140
|
]), Eg = {
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
newResult[${Q}] = ${U}.value;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
`)}g.write("payload.value = newResult;"),g.write("return payload;");const K=g.compile();return(T,U)=>K(m,T,U)};let s;const i=Qe,a=!kn.jitless,u=a&&Ci.value,l=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const C=m.value;return i(C)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),m=s(m,g),l?Wn([],C,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),m)}});function Gn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Le(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>_e(i,n,ve())))}),t)}const vc=d("$ZodUnion",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Nt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Gn(c,o,e,s)):Gn(a,o,e,s)}}),bc=d("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Xn(r,c,u)):Xn(r,s,i)}});function qt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ne(e)&&Ne(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=qt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=qt(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Xn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Le(e))return e;const n=qt(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const _c=d("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Ne(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;r.value={};for(const c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...xe(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...xe(c,u.issues)),r.value[c]=u.value)}let a;for(const c in o)i.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>_e(u,n,ve())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:o[i],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...xe(i,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...xe(i,c.issues)),r.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>r):r}}),yc=d("$ZodEnum",(e,t)=>{X.init(e,t);const r=Ii(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Pi.has(typeof o)).map(o=>typeof o=="string"?ze(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),Sc=d("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ze(r):r?ze(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Ec=d("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new In(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Oe;return r.value=o,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ac=d("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Hn(s,r.value)):Hn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),$c=d("$ZodNullable",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Rc=d("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Yn(s,t)):Yn(o,t)}});function Yn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wc=d("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ic=d("$ZodNonOptional",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Kn(s,e)):Kn(o,e)}});function Kn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const kc=d("$ZodCatch",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>_e(i,n,ve()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>_e(s,n,ve()))},input:r.value}),r.issues=[]),r)}}),Cc=d("$ZodPipe",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>st(i,t.in,n)):st(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>st(s,t.out,n)):st(o,t.out,n)}});function st(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Pc=d("$ZodReadonly",(e,t)=>{X.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Qn):Qn(o)}});function Qn(e){return e.value=Object.freeze(e.value),e}const Oc=d("$ZodCustom",(e,t)=>{se.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>eo(s,r,n,e));eo(o,r,n,e)}});function eo(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(De(o))}}class Nc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function zc(){return new Nc}const it=zc();function Lc(e,t){return new e({type:"string",...$(t)})}function xc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function to(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Tc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function qc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function Zc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function Dc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function ro(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function jc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function Bc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Uc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Vc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Fc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function Jc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function Mc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Wc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Gc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function Xc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function Hc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function Yc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function Kc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function Qc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function eu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function tu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function ru(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function nu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function ou(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function su(e,t){return new e({type:"number",checks:[],...$(t)})}function iu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function au(e,t){return new e({type:"null",...$(t)})}function cu(e){return new e({type:"unknown"})}function uu(e,t){return new e({type:"never",...$(t)})}function no(e,t){return new Bn({check:"less_than",...$(t),value:e,inclusive:!1})}function Zt(e,t){return new Bn({check:"less_than",...$(t),value:e,inclusive:!0})}function oo(e,t){return new Un({check:"greater_than",...$(t),value:e,inclusive:!1})}function Dt(e,t){return new Un({check:"greater_than",...$(t),value:e,inclusive:!0})}function so(e,t){return new Ra({check:"multiple_of",...$(t),value:e})}function io(e,t){return new Ia({check:"max_length",...$(t),maximum:e})}function at(e,t){return new ka({check:"min_length",...$(t),minimum:e})}function ao(e,t){return new Ca({check:"length_equals",...$(t),length:e})}function lu(e,t){return new Pa({check:"string_format",format:"regex",...$(t),pattern:e})}function pu(e){return new Oa({check:"string_format",format:"lowercase",...$(e)})}function hu(e){return new Na({check:"string_format",format:"uppercase",...$(e)})}function fu(e,t){return new za({check:"string_format",format:"includes",...$(t),includes:e})}function mu(e,t){return new La({check:"string_format",format:"starts_with",...$(t),prefix:e})}function du(e,t){return new xa({check:"string_format",format:"ends_with",...$(t),suffix:e})}function je(e){return new Ta({check:"overwrite",tx:e})}function gu(e){return je(t=>t.normalize(e))}function vu(){return je(e=>e.trim())}function bu(){return je(e=>e.toLowerCase())}function _u(){return je(e=>e.toUpperCase())}function yu(e,t,r){return new e({type:"array",element:t,...$(r)})}function Su(e,t,r){const n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Eu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function Au(e){const t=$u(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(De(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(De(o))}},e(r.value,r)));return t}function $u(e,t){const r=new se({check:"custom",...$(t)});return r._zod.check=e,r}const Ru=d("ZodISODateTime",(e,t)=>{Ha.init(e,t),H.init(e,t)});function wu(e){return tu(Ru,e)}const Iu=d("ZodISODate",(e,t)=>{Ya.init(e,t),H.init(e,t)});function ku(e){return ru(Iu,e)}const Cu=d("ZodISOTime",(e,t)=>{Ka.init(e,t),H.init(e,t)});function Pu(e){return nu(Cu,e)}const Ou=d("ZodISODuration",(e,t)=>{Qa.init(e,t),H.init(e,t)});function Nu(e){return ou(Ou,e)}const ce=d("ZodError",(e,t)=>{Ln.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Bi(e,r)},flatten:{value:r=>ji(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ct,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ct,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),zu=Lt(ce),Lu=xt(ce),xu=tt(ce),Tu=rt(ce),qu=Fi(ce),Zu=Ji(ce),Du=Mi(ce),ju=Wi(ce),Bu=Gi(ce),Uu=Xi(ce),Vu=Hi(ce),Fu=Yi(ce),Y=d("ZodType",(e,t)=>(X.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(we(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>be(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>zu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>xu(e,r,n),e.parseAsync=async(r,n)=>Lu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tu(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>qu(e,r,n),e.decode=(r,n)=>Zu(e,r,n),e.encodeAsync=async(r,n)=>Du(e,r,n),e.decodeAsync=async(r,n)=>ju(e,r,n),e.safeEncode=(r,n)=>Bu(e,r,n),e.safeDecode=(r,n)=>Uu(e,r,n),e.safeEncodeAsync=async(r,n)=>Vu(e,r,n),e.safeDecodeAsync=async(r,n)=>Fu(e,r,n),e.refine=(r,n)=>e.check(xl(r,n)),e.superRefine=r=>e.check(Tl(r)),e.overwrite=r=>e.check(je(r)),e.optional=()=>fe(e),e.nullable=()=>bo(e),e.nullish=()=>fe(bo(e)),e.nonoptional=r=>kl(e,r),e.array=()=>B(e),e.or=r=>he([e,r]),e.and=r=>bl(e,r),e.transform=r=>yo(e,El(r)),e.default=r=>Rl(e,r),e.prefault=r=>Il(e,r),e.catch=r=>Pl(e,r),e.pipe=r=>yo(e,r),e.readonly=()=>zl(e),e.describe=r=>{const n=e.clone();return it.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return it.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return it.get(e);const n=e.clone();return it.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),co=d("_ZodString",(e,t)=>{Tt.init(e,t),Y.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(lu(...n)),e.includes=(...n)=>e.check(fu(...n)),e.startsWith=(...n)=>e.check(mu(...n)),e.endsWith=(...n)=>e.check(du(...n)),e.min=(...n)=>e.check(at(...n)),e.max=(...n)=>e.check(io(...n)),e.length=(...n)=>e.check(ao(...n)),e.nonempty=(...n)=>e.check(at(1,...n)),e.lowercase=n=>e.check(pu(n)),e.uppercase=n=>e.check(hu(n)),e.trim=()=>e.check(vu()),e.normalize=(...n)=>e.check(gu(...n)),e.toLowerCase=()=>e.check(bu()),e.toUpperCase=()=>e.check(_u())}),Ju=d("ZodString",(e,t)=>{Tt.init(e,t),co.init(e,t),e.email=r=>e.check(xc(Mu,r)),e.url=r=>e.check(ro(lo,r)),e.jwt=r=>e.check(eu(cl,r)),e.emoji=r=>e.check(jc(Gu,r)),e.guid=r=>e.check(to(uo,r)),e.uuid=r=>e.check(Tc(ct,r)),e.uuidv4=r=>e.check(qc(ct,r)),e.uuidv6=r=>e.check(Zc(ct,r)),e.uuidv7=r=>e.check(Dc(ct,r)),e.nanoid=r=>e.check(Bc(Xu,r)),e.guid=r=>e.check(to(uo,r)),e.cuid=r=>e.check(Uc(Hu,r)),e.cuid2=r=>e.check(Vc(Yu,r)),e.ulid=r=>e.check(Fc(Ku,r)),e.base64=r=>e.check(Yc(sl,r)),e.base64url=r=>e.check(Kc(il,r)),e.xid=r=>e.check(Jc(Qu,r)),e.ksuid=r=>e.check(Mc(el,r)),e.ipv4=r=>e.check(Wc(tl,r)),e.ipv6=r=>e.check(Gc(rl,r)),e.cidrv4=r=>e.check(Xc(nl,r)),e.cidrv6=r=>e.check(Hc(ol,r)),e.e164=r=>e.check(Qc(al,r)),e.datetime=r=>e.check(wu(r)),e.date=r=>e.check(ku(r)),e.time=r=>e.check(Pu(r)),e.duration=r=>e.check(Nu(r))});function h(e){return Lc(Ju,e)}const H=d("ZodStringFormat",(e,t)=>{M.init(e,t),co.init(e,t)}),Mu=d("ZodEmail",(e,t)=>{Ba.init(e,t),H.init(e,t)}),uo=d("ZodGUID",(e,t)=>{Da.init(e,t),H.init(e,t)}),ct=d("ZodUUID",(e,t)=>{ja.init(e,t),H.init(e,t)}),lo=d("ZodURL",(e,t)=>{Ua.init(e,t),H.init(e,t)});function Wu(e){return ro(lo,e)}const Gu=d("ZodEmoji",(e,t)=>{Va.init(e,t),H.init(e,t)}),Xu=d("ZodNanoID",(e,t)=>{Fa.init(e,t),H.init(e,t)}),Hu=d("ZodCUID",(e,t)=>{Ja.init(e,t),H.init(e,t)}),Yu=d("ZodCUID2",(e,t)=>{Ma.init(e,t),H.init(e,t)}),Ku=d("ZodULID",(e,t)=>{Wa.init(e,t),H.init(e,t)}),Qu=d("ZodXID",(e,t)=>{Ga.init(e,t),H.init(e,t)}),el=d("ZodKSUID",(e,t)=>{Xa.init(e,t),H.init(e,t)}),tl=d("ZodIPv4",(e,t)=>{ec.init(e,t),H.init(e,t)}),rl=d("ZodIPv6",(e,t)=>{tc.init(e,t),H.init(e,t)}),nl=d("ZodCIDRv4",(e,t)=>{rc.init(e,t),H.init(e,t)}),ol=d("ZodCIDRv6",(e,t)=>{nc.init(e,t),H.init(e,t)}),sl=d("ZodBase64",(e,t)=>{oc.init(e,t),H.init(e,t)}),il=d("ZodBase64URL",(e,t)=>{ic.init(e,t),H.init(e,t)}),al=d("ZodE164",(e,t)=>{ac.init(e,t),H.init(e,t)}),cl=d("ZodJWT",(e,t)=>{uc.init(e,t),H.init(e,t)}),po=d("ZodNumber",(e,t)=>{Fn.init(e,t),Y.init(e,t),e.gt=(n,o)=>e.check(oo(n,o)),e.gte=(n,o)=>e.check(Dt(n,o)),e.min=(n,o)=>e.check(Dt(n,o)),e.lt=(n,o)=>e.check(no(n,o)),e.lte=(n,o)=>e.check(Zt(n,o)),e.max=(n,o)=>e.check(Zt(n,o)),e.int=n=>e.check(fo(n)),e.safe=n=>e.check(fo(n)),e.positive=n=>e.check(oo(0,n)),e.nonnegative=n=>e.check(Dt(0,n)),e.negative=n=>e.check(no(0,n)),e.nonpositive=n=>e.check(Zt(0,n)),e.multipleOf=(n,o)=>e.check(so(n,o)),e.step=(n,o)=>e.check(so(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ho(e){return su(po,e)}const ul=d("ZodNumberFormat",(e,t)=>{lc.init(e,t),po.init(e,t)});function fo(e){return iu(ul,e)}const ll=d("ZodNull",(e,t)=>{pc.init(e,t),Y.init(e,t)});function ut(e){return au(ll,e)}const pl=d("ZodUnknown",(e,t)=>{hc.init(e,t),Y.init(e,t)});function mo(){return cu(pl)}const hl=d("ZodNever",(e,t)=>{fc.init(e,t),Y.init(e,t)});function fl(e){return uu(hl,e)}const ml=d("ZodArray",(e,t)=>{mc.init(e,t),Y.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(at(r,n)),e.nonempty=r=>e.check(at(1,r)),e.max=(r,n)=>e.check(io(r,n)),e.length=(r,n)=>e.check(ao(r,n)),e.unwrap=()=>e.element});function B(e,t){return yu(ml,e,t)}const dl=d("ZodObject",(e,t)=>{gc.init(e,t),Y.init(e,t),V(e,"shape",()=>t.shape),e.keyof=()=>Be(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mo()}),e.loose=()=>e.clone({...e._zod.def,catchall:mo()}),e.strict=()=>e.clone({...e._zod.def,catchall:fl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>xi(e,r),e.safeExtend=r=>Ti(e,r),e.merge=r=>qi(e,r),e.pick=r=>zi(e,r),e.omit=r=>Li(e,r),e.partial=(...r)=>Zi(vo,e,r[0]),e.required=(...r)=>Di(_o,e,r[0])});function I(e,t){const r={type:"object",shape:e??{},...$(t)};return new dl(r)}const gl=d("ZodUnion",(e,t)=>{vc.init(e,t),Y.init(e,t),e.options=t.options});function he(e,t){return new gl({type:"union",options:e,...$(t)})}const vl=d("ZodIntersection",(e,t)=>{bc.init(e,t),Y.init(e,t)});function bl(e,t){return new vl({type:"intersection",left:e,right:t})}const _l=d("ZodRecord",(e,t)=>{_c.init(e,t),Y.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function go(e,t,r){return new _l({type:"record",keyType:e,valueType:t,...$(r)})}const jt=d("ZodEnum",(e,t)=>{yc.init(e,t),Y.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new jt({...t,checks:[],...$(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new jt({...t,checks:[],...$(o),entries:s})}});function Be(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new jt({type:"enum",entries:r,...$(t)})}const yl=d("ZodLiteral",(e,t)=>{Sc.init(e,t),Y.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function W(e,t){return new yl({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const Sl=d("ZodTransform",(e,t)=>{Ec.init(e,t),Y.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new In(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(De(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(De(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function El(e){return new Sl({type:"transform",transform:e})}const vo=d("ZodOptional",(e,t)=>{Ac.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fe(e){return new vo({type:"optional",innerType:e})}const Al=d("ZodNullable",(e,t)=>{$c.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bo(e){return new Al({type:"nullable",innerType:e})}const $l=d("ZodDefault",(e,t)=>{Rc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rl(e,t){return new $l({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Nn(t)}})}const wl=d("ZodPrefault",(e,t)=>{wc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Il(e,t){return new wl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Nn(t)}})}const _o=d("ZodNonOptional",(e,t)=>{Ic.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function kl(e,t){return new _o({type:"nonoptional",innerType:e,...$(t)})}const Cl=d("ZodCatch",(e,t)=>{kc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pl(e,t){return new Cl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ol=d("ZodPipe",(e,t)=>{Cc.init(e,t),Y.init(e,t),e.in=t.in,e.out=t.out});function yo(e,t){return new Ol({type:"pipe",in:e,out:t})}const Nl=d("ZodReadonly",(e,t)=>{Pc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zl(e){return new Nl({type:"readonly",innerType:e})}const So=d("ZodCustom",(e,t)=>{Oc.init(e,t),Y.init(e,t)});function Ll(e,t){return Su(So,e??(()=>!0),t)}function xl(e,t={}){return Eu(So,e,t)}function Tl(e){return Au(e)}var S=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(S||{});const ql=he([W("book"),W("bookitem"),W("conference"),W("document"),W("report"),W("proceeding"),W("unknown")]),Zl=he([W("article"),W("conference"),W("issue"),W("journal"),W("preprint"),W("proceeding"),W("unknown")]),de=I({artnum:h(),atitle:h(),aufirst:h(),aulast:h(),auinit:h(),auinit1:h(),auinitm:h(),ausuffix:h(),au:B(h()),aucorp:h(),bici:h(),btitle:h(),chron:h(),coden:h(),date:h(),edition:h(),eissn:h(),epage:h(),externalDBID:h(),externalDocID:h(),genre:Be(S),id:h(),isbn:h(),issn:h(),issue:h(),jtitle:h(),pages:h(),part:h(),place:h(),pub:h(),quarter:h(),rft_id:B(h()),series:h(),sici:h(),spage:h(),ssn:h(),stitle:h(),title:h(),tpages:h(),volume:h()}).partial(),Bt=I({bibid:h(),doi:h(),uri:h()}).partial(),Dl=de.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),jl=de.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),Bl=de.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Ul=de.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),Vl=de.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Fl=de.pick({au:!0,date:!0,title:!0}).partial(),Eo=I({...de.shape,...Bt.shape}),F=(e,t)=>({...t,genre:e}),Z=(e,t)=>({...t,genre:e}),me=e=>({...e,genre:S.AudioVisualDocument}),Ao=e=>({...e,genre:S.Image}),Ut=e=>({...e,genre:S.Document}),lt=e=>({...e,genre:S.Webpage}),$o=e=>Object.keys(e.shape),Ro=$o(de),Vt=$o(Bt),Jl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},Ml=(e,t,r)=>{e.append(t,r)},Wl=(e,t,r)=>{e.append(`rft.${t}`,r)},wo=e=>Vt.includes(e),Io=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?Jl(t,r,n):typeof n=="string"&&n&&(wo(r)?Ml(t,r,n):Wl(t,r,n))}),t},ko=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},Co=e=>{const t=Gl(e),r=(o,s)=>{if(s==="au")return ko(o,t,"rft.au","au");if(s==="rft_id")return ko(o,t,"rft_id","rft_id");const i=wo(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...Ro,...Vt].reduce(r,{});return Object.keys(n).length===0?null:n},Gl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Xl(e){return typeof e!="string"?!1:Object.values(S).includes(e)}var ye=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(ye||{});const Ft=I({id:h(),name:h(),region:Be(ye)}),Hl=I({tenants:B(Ft)}),Po=9*1024*1024,Oo=I({url:Wu({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:h({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(Po,{error:`"html" should be a string with a MAX Length of ${Po}`}),tenantCode:h({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:Be([ye.EUAPAC,ye.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function Yl(e){return Oo.safeParse(e).success}const Jt=I({name:h(),region:Be(ye),apps:go(h(),h())}),No=go(h(),Jt),zo=e=>Jt.safeParse(e).success,Lo=e=>No.safeParse(e).success;function xo(e){return Ft.safeParse(e).success}function Kl(e){return typeof e=="string"&&Object.keys(ye).includes(e)}const Ql=e=>{if(!Lo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>ep(r,n))}},ep=(e,t)=>{if(!zo(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!xo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},Mt=I({parserType:h(),parserName:h().nullable(),uri:h(),referrer:h()}),Wt=I({parserType:h(),parserName:h().nullable(),referrer:h()}),Gt=I({bookmarkingWorkflowUrl:ut(),resource:ut()}),Xt=I({bookmarkingWorkflowUrl:h(),resource:ut()}),Ht=I({bookmarkingWorkflowUrl:ut(),resource:Eo}),Yt=I({z3988SearchResult:W(!0)}),Kt=I({summonSearchResult:W(!0)}),pt=he([Xt,Gt,Ht,Yt,Kt]),To=I({meta:Mt}).and(pt),qo=I({meta:Wt}).and(pt);function tp(e){return{bookmarkingWorkflowUrl:e,resource:null}}function x(){return{bookmarkingWorkflowUrl:null,resource:null}}function A(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Zo(){return{z3988SearchResult:!0}}function Do(){return{summonSearchResult:!0}}const rp=e=>{const t=e.getAttribute("title");return t?Co(t):null},Qt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return x();const r=t.map(rp).find(n=>n!==null);return r?A(r):x()},np=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},op=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,sp=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},ip=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,ap=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,cp=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,up=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},lp=({url:e,document:t})=>{const r=np(t),n=op(t),o=sp(t),s=ip(t),i=ap(t),a=cp(t),c=t.getElementById("productTitle")?.textContent.trim()??void 0,u=up(t);return{bookmarkingWorkflowUrl:null,resource:F(S.Book,{au:r,date:s,edition:n,isbn:o,pub:i,series:a,title:c,tpages:u,uri:e})}},p=(e,t,r)=>{const n=te(e,t,r);return n.length>0?n[0]:void 0},te=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),jo=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,s,i]=n.split(":");t.set(o,{type:s,value:i})}return t};var v=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e[e.Document=7]="Document",e))(v||{});const pp=e=>{if(!e)return;const t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},Ue=e=>{const t=e.querySelector("#publication_date p")?.textContent.trim()??p(e,"name","bepress_citation_date");return pp(t)},hp=e=>{const t=p(e,"name","bepress_citation_firstpage"),r=p(e,"name","bepress_citation_lastpage");return{spage:t,epage:r}},er=e=>{const t=/https?:\/\/doi\.org\/(.+)/i,n=e.querySelector("#source p")?.textContent.trim()?.match(t);if(n?.length===2)return n[1];const s=e.querySelector("#recommended_citation p a")?.textContent.trim()?.match(t);if(s?.length===2)return s[1]},fp=e=>{const t=[],r=e.querySelectorAll("tbody td");for(const n of r){const o=n.querySelector("strong");if(o&&!o.querySelector("a")){const s=o.textContent.trim();s&&t.push(s)}}return t},Ve=e=>p(e,"name","bepress_citation_title")??e.querySelector("title")?.textContent.trim(),ht=e=>te(e,"name","author"),ft=e=>p(e,"name","bepress_citation_publisher"),tr=e=>p(e,"name","bepress_citation_pdf_url"),mp=(e,t)=>{if(t.includes("/etd/"))return v.Document;if(t.includes("/sophpm_music/")||t.includes("/streaming/"))return v.AudioVisual;if(t.includes("/vol"))return v.Article;if(t.includes("/facpub")||t.includes("/studentpub/")){const r={"book chapter":v.Book,"conference paper":v.Book,"peer-reviewed article":v.Article,other:v.Document},n=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();return n?r[n]:void 0}return v.Journal},dp=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=p(e,"name","bepress_citation_journal_title"),s=p(e,"name","bepress_citation_volume"),i=p(e,"name","bepress_citation_issue"),{epage:a,spage:c}=hp(e),u=tr(e),l=er(e);return Z(S.Article,{atitle:t,jtitle:o,au:r,date:n,volume:s,issue:i,epage:a,spage:c,doi:l,uri:u})},gp=(e,t)=>{const r=e.querySelector(".inherit-title a")?.textContent.trim()??Ve(e),n=fp(e),o=Ue(e),s=ft(e),i=er(e);return Z(S.Journal,{jtitle:r,au:n,date:o,pub:s,doi:i,uri:t})},vp=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=ft(e),s=tr(e),i=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();if(i==="book chapter"){const c=e.querySelector("#source p")?.textContent.trim();return F(S.Bookitem,{pub:o,atitle:t,btitle:c,au:r,date:n,uri:s})}const a=er(e);return i==="conference paper"?F(S.Conference,{pub:o,title:t,au:r,date:n,doi:a,uri:s}):F(S.Document,{pub:o,title:t,au:r,date:n,doi:a,uri:s})},bp=(e,t)=>{const r=Ve(e),n=ht(e),o=Ue(e),s=ft(e);return me({title:r,au:n,date:o,pub:s,uri:t})},_p=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=ft(e),s=tr(e);return Ut({pub:o,title:t,au:r,date:n,uri:s})},yp=({url:e,document:t})=>{switch(mp(t,e)){case v.Article:return A(dp(t));case v.Journal:return A(gp(t,e));case v.Book:return A(vp(t));case v.AudioVisual:return A(bp(t,e));case v.Document:return A(_p(t));default:return x()}},ge=e=>{if(e)return e.replace(/[^0-9]/g,"")},Bo=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),Uo=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Vo=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),Sp=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,s]=(r?.split(",")??[]).map(i=>i.trim());return{volume:ge(o),issue:ge(s),jtitle:n}},Ep=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,s]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:i,volume:a,issue:c}=Sp(e);return A(Z(S.Article,{au:Bo(e),atitle:Uo(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:c}))},Ap=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Vo(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return A(F(S.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},$p=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:s,pub:i}=Vo(o);return{edition:r,btitle:n,date:s,pub:i}},Rp=e=>{const{edition:t,btitle:r,date:n,pub:o}=$p(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return A(F(S.Bookitem,{au:Bo(e),atitle:Uo(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},wp=/^[0-9X]$/,rr=e=>{if(!e)return;let t="";for(const r of e)wp.test(r)&&(t+=r);if(t)return t},Ip=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),s=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),i=rr(s.iterateNext()?.textContent);return A({genre:S.Document,title:r,pub:n,date:o,uri:t,isbn:i})},Fo=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),kp=e=>Fo(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),Cp=e=>{const t=Fo(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:ge(c),issue:ge(u)}}const n=t?.querySelector("p")?.textContent,[o,s]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:ge(o),issue:ge(s)}},Pp=e=>{const{date:t,volume:r,issue:n}=Cp(e);return A(Z(S.Journal,{jtitle:kp(e),date:t,volume:r,issue:n}))};var Jo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(Jo||{});const Op=e=>Object.values(Jo).includes(e),Np=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&Op(n))return n},zp=({url:e,document:t})=>{switch(Np(t,e)){case"Book":return Ap(t);case"Book Chapter":return Rp(t);case"Full Text Article":return Ep(t);case"Journal":return Pp(t);case"Guideline":return Ip(t,e);case void 0:return x()}},Ie=I({"@context":h()}),Lp=e=>Ie.safeParse(e).success,Mo='script[type="application/ld+json"]',Wo=e=>Array.from(e.querySelectorAll(Mo)),mt=e=>e.querySelector(Mo),Fe=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Lp(r))return r}catch{return null}return null},xp=I({"@id":h(),"@type":h(),author:I({"@id":h()}).optional(),datePublished:h().optional(),dateModified:h().optional(),description:h().optional(),inLanguage:h().optional(),isPartOf:I({"@id":h()}).optional(),name:h().optional(),url:h().optional()}),Tp=Ie.extend({"@graph":B(xp)}),qp=e=>Tp.safeParse(e).success,Zp=e=>{const t=Wo(e);if(t.length===0)return null;const r=t.map(Fe).filter(qp).map(n=>n["@graph"]);return r.length!==1?null:r[0]},Dp=(e,t)=>e.find(r=>r["@type"]===t)??null,jp=(e,t)=>e.find(r=>r["@id"]===t)??null,Bp=e=>{const t=Dp(e,"WebPage");if(!t)return null;const r=t.author?jp(e,t.author["@id"]):void 0;return lt({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},Up=({document:e})=>{const t=Zp(e);return t?{bookmarkingWorkflowUrl:null,resource:Bp(t)}:x()},Go=()=>x(),Vp=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},Fp=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[s,i]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return A(Z(S.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},Jp=e=>{let t,r;const n=te(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},Mp=e=>{const t=p(e,"name","citation_journal_title"),r=p(e,"name","citation_title"),n=te(e,"name","citation_author"),o=p(e,"name","citation_doi"),{eissn:s,issn:i}=Jp(e),a=p(e,"name","citation_publisher"),c=p(e,"name","citation_publication_date"),u=p(e,"name","citation_volume"),l=p(e,"name","citation_issue"),f=p(e,"name","citation_firstpage"),m=p(e,"name","citation_lastpage");return A(Z(S.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:c,volume:u,issue:l,spage:f,epage:m}))},Wp=({document:e,url:t})=>{switch(Vp(t)){case"journal":return Fp(e);case"article":return Mp(e);case void 0:return x()}},Gp=e=>{const t=p(e,"name","pbContext");if(!t)return v.None;const r=jo(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return v.Article;case"Table of Contents":return v.Journal;default:return v.None}},Xp=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},Xo=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(s=>s.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},Hp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Yp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Kp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Qp=e=>e.querySelector("h1")?.textContent??void 0,eh=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const s=r?.match(/(\d{4})$/);return s&&t.set("date",s[1]),t},th=e=>{const t=Xp(e.document),r=p(e.document,"name","dc.Date"),n=Kp(e.document),o=Xo(e.document),s=o.get("issn"),i=o.get("eissn"),a=Yp(e.document),c=p(e.document,"name","citation_journal_title"),u=p(e.document,"name","dc.Publisher"),l=p(e.document,"name","dc.Title"),f=Hp(e.document);return Z(S.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},rh=e=>{const t=Xo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Qp(e.document),s=eh(e.document),i=s.get("issue"),a=s.get("volume"),c=s.get("date");return Z(S.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:c})},nh=e=>{switch(Gp(e.document)){case v.Article:return A(th(e));case v.Journal:return A(rh(e));default:return x()}},oh=e=>{const t=p(e,"name","citation_type"),r=p(e,"name","citation_article_type");return t==="JOUR"&&r?v.Article:t==="CHP"?v.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?v.Book:e.getElementById("journal-title")?v.Journal:v.None},nr=e=>p(e,"name","citation_doi")??p(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,sh=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,s=n.querySelector("p")?.textContent;o&&s&&r.set(o,s)}return r},or=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},ih=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},ah=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},ch=e=>{const t=sh(e),r=p(e,"property","og:title"),n=p(e,"property","og:book:isbn"),o=t.get("Published"),s=or(e,".authors-container .author-detail h3"),i=nr(e)??ah(t);return F(S.Book,{au:s,date:o,doi:i,isbn:n,title:r})},uh=e=>{const t=p(e,"property","og:title"),r=p(e,"property","og:book:isbn"),n=p(e,"name","citation_publication_date"),o=or(e,".author-group .button-link-text"),s=p(e,"name","citation_firstpage"),i=p(e,"name","citation_lastpage"),a=p(e,"name","citation_publisher"),c=nr(e),u=p(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return F(S.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:i,isbn:r,pub:a,spage:s,title:t})},lh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","citation_issn"),n=p(e,"name","citation_publication_date"),o=or(e,".author-group .button-link-text"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_issue"),c=p(e,"name","citation_volume"),u=nr(e),l=p(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return Z(S.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:s,spage:i,title:t,volume:c})},ph=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=ih(e);return Z(S.Journal,{issn:r,title:t})},hh=({document:e})=>{switch(oh(e)){case v.Book:return A(ch(e));case v.Chapter:return A(uh(e));case v.Article:return A(lh(e));case v.Journal:return A(ph(e));default:return x()}},fh=e=>{const t=p(e,"name","pbContext");return t&&jo(t).has("article")?v.Article:v.Journal},mh=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},dh=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},gh=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},vh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","dc.Date"),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=te(e,"name","dc.Creator"),a=dh(e),c=gh(e),u=mh(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return Z(S.Article,{au:i,jtitle:s,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},bh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","publication_doi");return Z(S.Journal,{doi:r,title:t})},_h=({document:e})=>{switch(fh(e)){case v.Article:return A(vh(e));case v.Journal:return A(bh(e));default:return x()}},yh=e=>pt.safeParse(e).success,Sh=e=>To.safeParse(e).success,Eh=e=>qo.safeParse(e).success,Ah=e=>Mt.safeParse(e).success,$h=e=>Wt.safeParse(e).success;function Rh(e){return Xt.safeParse(e).success}function dt(e){return Ht.safeParse(e).success}function Ho(e){return Yt.safeParse(e).success}function Yo(e){return Kt.safeParse(e).success}function wh(e){return Gt.safeParse(e).success}const Ih=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,kh=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},Ch=e=>{const{url:t,document:r}=e,n=Qt(e);if(!dt(n))return n;const o=Ih(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=kh(t),n},Ph=Ie.extend({"@type":W("VideoObject"),name:h(),author:h(),genre:h(),description:h(),uploadDate:h(),duration:h(),thumbnailUrl:B(h())}),Oh=e=>Ph.safeParse(e).success,Nh=e=>{const t=Wo(e);if(t.length===0)return null;const r=t.map(Fe).filter(Oh);return r.length!==1?null:r[0]},zh=({url:e,document:t})=>{const r=Nh(t);return r?{bookmarkingWorkflowUrl:null,resource:me({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:x()},Ko=e=>p(e,"name","doi")??p(e,"name","DOI")??p(e,"name","citation_doi")??p(e,"name","dc.identifier")??p(e,"name","prism.doi")??void 0,Qo=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Je=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Je||{}),Se=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Se||{}),ue=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(ue||{});const es=I({"@type":W(Je.ScholarlyArticle),author:B(I({"@type":h(),name:h()})).optional(),editor:B(I({"@type":h(),name:h()})).optional(),datePublished:h().optional(),headline:h().optional(),issn:B(h()).optional(),pageStart:h().optional(),pageEnd:h().optional(),isPartOf:I({"@type":he([h(),B(h())]),name:h(),issn:B(h()).optional(),volumeNumber:h().optional(),isbn:B(h()).optional()}),publisher:I({"@type":h(),name:h()}).optional()}),ts=e=>es.safeParse(e).success,Lh=Ie.extend({"@type":W(Je.WebPage),mainEntity:es}),xh=e=>Lh.safeParse(e).success,Th=I({"@type":B(h()),name:h().optional(),issn:B(h()),volumeNumber:h().optional()}),rs=e=>Th.safeParse(e).success,qh=(e,t)=>p(e,"name","citation_issn")??p(e,"name","prism.issn")??(ts(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),ns=(e,t)=>{const r=Qo(t),n=p(e,"name","citation_online_date"),o=Ko(e),s=p(e,"name","citation_issue"),i=qh(e,t),a=rs(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,m=rs(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return Z(S.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:m})},Zh=Ie.extend({"@type":W(Je.Book),copyrightYear:h().optional(),author:B(I({"@type":h(),name:h()})).optional(),editor:B(I({"@type":h(),name:h()})).optional(),isbn:h().optional(),name:h().optional(),numberOfPages:ho().optional(),publisher:I({"@type":h(),name:h()}).optional()}),Dh=e=>Zh.safeParse(e).success,jh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),s=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&s&&r.set(o,s)}),r},Bh=(e,t)=>{const r=jh(e),n=Qo(t),o=t.copyrightYear?.toString(),s=Ko(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return F(S.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:c,pub:u})},Uh=I({"@type":W("Periodical"),name:h(),url:h(),issn:B(h()),editor:B(I({givenName:h(),familyName:h()})),publisher:I({name:h()}),description:h()}),Vh=e=>Uh.safeParse(e).success,Fh=e=>{const t=e.editor.map(({givenName:i,familyName:a})=>`${i} ${a}`),r=e.name,[n,o]=e.issn,s=e.publisher.name;return Z(S.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},Jh=I({"@type":W(Je.VideoObject),name:h().optional(),description:h().optional(),thumbnailUrl:h().optional(),uploadDate:h().optional(),contentUrl:h().optional(),duration:h().optional()}),Mh=e=>Jh.safeParse(e).success,Wh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(i=>i.textContent.trim()).filter(i=>!!i),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??p(e,"property","og:title")??void 0,s=e.querySelector("video-about-doi")?.textContent??void 0;return me({au:r.length>0?r:void 0,date:n,doi:s,title:o})},Gh=e=>{const t=p(e,"property","og:title");return lt({title:t})},Xh=(e,t)=>{const r=p(t,"property","og:type");return r===Se.Article&&e.includes(ue.Article)?v.Article:r===Se.Book&&(e.includes(ue.Book)||e.includes(ue.ReferenceWork))?v.Book:r===Se.Paper&&e.includes(ue.Chapter)?v.Chapter:r===Se.Paper&&(e.includes(ue.ReferenceWorkEntry)||e.includes(ue.Protocol))?v.Article:r===Se.Video&&e.includes(ue.Video)?v.AudioVisual:r===Se.Website&&(e.includes(ue.Collections)||e.includes(ue.JournalIssue))?v.Webpage:r===Se.Website&&e.includes(ue.Journal)?v.Journal:v.None},Hh=(e,t,r)=>e===v.AudioVisual&&Mh(r)?A(Wh(t,r)):e===v.Book&&Dh(r)?A(Bh(t,r)):(e===v.Chapter||e===v.Article)&&ts(r)?A(ns(t,r)):e===v.Article&&xh(r)?A(ns(t,r.mainEntity)):e===v.Journal&&Vh(r)?A(Fh(r)):x(),Yh=({url:e,document:t})=>{const r=Xh(e,t);if(r===v.Webpage)return A(Gh(t));const n=mt(t);if(!n)return x();const o=Fe(n);return o?Hh(r,t,o):x()},Kh=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Qh=I({content:I({item:I({title:h(),"published-date":h()}),group:I({volume:h(),issue:h()}),series:I({title:h(),type:h(),eissn:h()})}).optional()}),os=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},sr=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},ef=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{const o=JSON.parse(n[1]);return Qh.parse(o)}catch{return}},tf=(e,t)=>{const r=p(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?v.Book:r==="Chapter"?v.Chapter:r==="Journal"?v.Journal:r==="Article"||n?v.Article:v.None},gt=e=>{const t=te(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},rf=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return sr(t)},vt=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const s=os(n.textContent,":"),i=os(o.textContent,":");!s||!i||Kh.has(s)&&t.set(s,i)}return t},bt=(e,t)=>p(e,"property","books:release_date")??p(e,"name","citation_online_date")??t.get("First published")??void 0,ir=(e,t)=>p(e,"name","dc.identifier")??p(e,"name","citation_doi")??p(e,"name","publication_doi")??t.get("DOI")??void 0,ss=(e,t)=>{const r=new Set([p(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},nf=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n?.childNodes.length===2){const[o,s]=n.childNodes;o.textContent&&(t=sr(o.textContent)),s.textContent&&(r=sr(s.textContent))}return{volume:t,issue:r}},of=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},sf=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,s;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(s=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:s}},af=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},cf=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(i=>i.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,s]=(n?.split("-")??[void 0,void 0]).map(i=>i?.trim());return o?.toLowerCase()==="n/a"&&s?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:s}},uf=e=>{const t=vt(e),r=gt(e),n=p(e,"property","og:title"),o=bt(e,t),s=ir(e,t),i=ss(e,t),a=rf(e);return F(S.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},lf=e=>{const t=vt(e),r=gt(e),n=p(e,"name","citation_book_title"),o=bt(e,t),s=ir(e,t),i=ss(e,t),a=p(e,"name","citation_publisher"),c=p(e,"property","og:title");return F(S.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:c})},pf=e=>{const t=vt(e),r=gt(e),n=bt(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=p(e,"property","og:title"),{volume:a,issue:c}=nf(e);return Z(S.Journal,{au:r,date:n,eissn:o,issn:s,issue:c,title:i,volume:a})},hf=e=>{const t=vt(e),r=ef(e),n=gt(e)??of(e),o=bt(e,t)??r?.content?.item["published-date"],s=ir(e,t),{issn:i,eissn:a}=sf(e),{volume:c,issue:u}=af(r),l=p(e,"property","og:title")??r?.content?.item.title,f=p(e,"name","citation_journal_title")??r?.content?.series.title,{spage:m,epage:g}=cf(e);return Z(S.Article,{au:n,date:o,doi:s,eissn:a,issn:i??p(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:m,epage:g})},ff=({document:e,url:t})=>{switch(tf(e,t)){case v.Book:return A(uf(e));case v.Chapter:return A(lf(e));case v.Journal:return A(pf(e));case v.Article:return A(hf(e));default:return x()}},mf=e=>{const t=te(e,"name","citation_author");return t.length>0?t:void 0},df=({document:e})=>{const t=mf(e),r=p(e,"name","citation_publication_date"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_isbn"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_title")??e.title,a=me({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return A(a)},gf=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?x():Zo(),_t=e=>{if(!(!e||e.length===0))return e[0]};function ar(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return _t(r)??null}function vf(e,t){const r=t.flatMap(n=>Array.from(e.querySelectorAll(n)).flatMap(s=>{const i=s.textContent;return i&&i.trim()!==""?i.split(";").map(a=>a.trim()).filter(a=>a.length>0):[]}));return r.length>0?r:null}const Me=(e,t)=>ar(e,[t])?.trim(),bf=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},_f=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},yf=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Sf=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},ke=e=>{const t=new Set([...yf(e)??[],...bf(e)??[],...Sf(e)??[],..._f(e)??[]]);return t.size?[...t]:void 0},Ce=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??Te(t?.get("date"))??Te(t?.get("copyright date"))??Te(t?.get("published date")),is=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},as=e=>{const t=e.get("local identifier");if(t?.length)return is(t)},Ef=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,Te=e=>{if(e?.length)return e[0]},Pe=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),s=Array.from(r.querySelectorAll(".metadata-value")).map(i=>i.textContent).filter(i=>!!i);return{name:o,values:s}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},cs=e=>{const t=Pe(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,s=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??Te(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:s&&s.trim()!==""?s:void 0,jtitle:o&&o.trim()!==""?o:void 0}},Af=e=>{const t=ar(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},yt=e=>ge(e.querySelector('[data-qa="page-count"]')?.textContent),We=(e,t)=>e.querySelector(".publisher-link")?.textContent??Te(t?.get("publisher")),Ee=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Ae=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},$f=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const s of o)s.startsWith("Volume")?n=ge(s):s.startsWith("Issue")&&(r=ge(s))}return{issue:r,volume:n}},Rf=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??p(e,"property","og:description")??p(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),s=o?o[1]:void 0,i=/pp\.\s*(\d+)-(\d+)/.exec(t),a=i?i[1]:void 0,c=i?i[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:s,volume:n,spage:a,epage:c,pages:l}},wf=e=>{const t=ar(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const s=/\d{4}/.exec(o);return s?s[0]:void 0});return _t(n)},If=(e,t)=>{const r=Ee(e),n=ke(e),o=Ce(e)??wf(e),s=cs(e),i=s.jtitle??Af(e)??void 0,a=s.pub,c=$f(e),u=Rf(e),l=c.issue??u.issue,f=c.volume??u.volume,m=yt(e)??u.pages,g=u.spage,C=u.epage,_=Ae(t),O=is(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(D=>D.textContent??""))??Ef(e);return Z(S.Article,{atitle:r,au:n,date:o,doi:O,epage:C,issue:l,jtitle:i,pages:m,pub:a,spage:g,uri:_,volume:f})},kf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=We(e,r),a=Ae(t);return me({au:n,date:o,pub:i,title:s,uri:a})},Cf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=Ce(e),i=yt(e),a=We(e,r),c=Ae(t),u=as(r);return F(S.Book,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},Pf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=e.querySelector(".book-title-link")?.textContent??void 0,i=Ce(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(m=>m.textContent),c=yt(e),u=a.find(m=>m.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=We(e,r),f=Ae(t);return F(S.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},Of=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=Ce(e),i=yt(e),a=We(e,r),c=Ae(t),u=as(r);return F(S.Document,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},Nf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=Ae(t);return Ao({au:n,date:o,title:s,uri:i})},zf=(e,t)=>{const{pub:r}=cs(e),n=Ee(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=Ae(t);return Z(S.Journal,{eissn:o,issn:s,jtitle:n,pub:r,uri:i})};var ie=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ie||{});const Lf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=We(e,r),a=Ae(t);return me({au:n,date:o,pub:i,title:s,uri:a})},xf=e=>Object.values(ie).includes(e),Tf=e=>{if(e.querySelector(".journal_header-title"))return ie.Journal;if(e.querySelector(".journal-link"))return ie.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return xf(n)?n:null},qf=(e,t)=>{switch(Tf(e)){case ie.Article:case ie.Serial:return If(e,t);case ie.Audio:return kf(e,t);case ie.Book:return Cf(e,t);case ie.Chapter:case ie.ResearchReport:return Pf(e,t);case ie.Document:return Of(e,t);case ie.Image:return Nf(e,t);case ie.Journal:return zf(e,t);case ie.Video:return Lf(e,t);default:return null}},Zf=({document:e,url:t})=>{const r=qf(e,t);return r?A(r):x()},Ge=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},us=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Ge(e[0].name):Ge(e.name)},St=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},Df=e=>{const t=us(e.mainEntity.creator);return t?[t]:void 0},Xe=({lcn:e,title:t})=>({bibid:e,title:t}),jf=(e,t)=>{const r=St(...(e&&Df(e))??[],...t.authors??[]),n=St(...t.eissns??[]),o=St(e?.mainEntity.isbn?rr(e.mainEntity.isbn):void 0,...t.isbns??[]),s=St(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Ge(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Ge(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Ge(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??us(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},Bf=e=>Z(S.Article,{...Xe(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),Uf=e=>me({...Xe(e),au:e.authors,date:e.date,pub:e.publisher}),Vf=e=>F(S.Book,{...Xe(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),Ff=e=>Z(S.Journal,{...Xe(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),ls=I({"@type":W("Organization"),name:he([h(),B(h())])}),ps=I({"@type":W("Person"),name:he([h(),B(h())])}),Jf=Ie.extend({identifier:I({"@type":h(),propertyID:h(),value:h()}),mainEntity:I({"@type":h(),"@id":h(),creator:fe(he([h(),ps,B(ps)])),edition:fe(h()),isbn:fe(h()),issn:fe(B(h())),issueNumber:fe(h()),pagination:fe(h()),publisher:fe(he([h(),ls,B(ls)])),volumeNumber:fe(h())}),name:h()}),Mf=e=>{const t=mt(e);if(!t)return null;const r=Fe(t),n=Jf.safeParse(r);return n.success?n.data:null},Wf=e=>me({...Xe(e),au:e.authors,date:e.date,pub:e.publisher}),Gf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,hs=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,cr=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,Xf=e=>{if(!e)return;const t=Gf.exec(e);if(t)return t.length>1?t[1]:void 0},Hf=e=>{const t=Array.from(e.querySelectorAll(cr("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=hs.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:hs.lastIndex});o.forEach(({id:i,start:a},c)=>{r[i]??=[],r[i].push(n.substring(a,o[c+1]?.index))})}),r},Yf=e=>Array.from(e.querySelectorAll(cr("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(cr(t))?.textContent.trim(),Kf=e=>{const t=$e(e,"Creation Date"),r=$e(e,"Edition"),n=$e(e,"Publication Date"),o=$e(e,"Is Part Of"),s=$e(e,"Publisher"),i=$e(e,"Title"),a=$e(e,"MMS ID")??$e(e,"Record ID"),c=Yf(e),u=Hf(e),[l]=o?.split(",")??[],f=Xf(n??t),m=[...u.isbn??[],...u.eisbn??[]].map(g=>rr(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:m,issns:u.issn,jtitle:l,lcn:a,publisher:s,title:i}};var fs=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))(fs||{});const Qf=e=>Object.values(fs).includes(e),em=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Qf(r))return r},tm=({document:e})=>{const t=Mf(e),r=Kf(e),n=jf(t,r);switch(em(e,t)){case"Article":return A(Bf(n));case"Book":return A(Vf(n));case"Periodical":case"Journal":return A(Ff(n));case"Audio CD":case"CreativeWork":return A(Uf(n));case"Movie":case"Video":return A(Wf(n));default:return x()}},rm=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(s=>s.textContent.includes("Document Type"))?.textContent,o=p(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?v.Article:o?.startsWith("urn:issn:")?v.Journal:void 0},nm=e=>{const t=p(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},om=e=>{const t=p(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},sm=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,im=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},am=e=>{const t=p(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},cm=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=am(e),o=nm(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?im(o.pages):void 0,u=c?.spage,l=c?.epage,f=te(e,"name","DC.creator"),m=om(e);return Z(S.Article,{au:f,jtitle:s,date:n,doi:m,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:i})},um=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=sm(e);return Z(S.Journal,{issn:n,title:t,pub:r})},lm=({document:e})=>{switch(rm(e)){case v.Article:return A(cm(e));case v.Journal:return A(um(e));default:return x()}},pm=/^\d{4}-\d{3}[\dX]$/i,hm=e=>pm.test(e),ms=e=>{const t=e.filter(hm);return t.length?t:void 0},ur=e=>{const t=te(e,"name","citation_author");return t.length?t:void 0},lr=e=>p(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],fm=e=>p(e,"name","citation_doi"),ds=e=>{const t=te(e,"name","citation_isbn");return t.length?t.join(","):void 0},gs=e=>ms(te(e,"name","citation_issn")),pr=e=>p(e,"name","citation_journal_title"),hr=e=>p(e,"name","citation_publisher"),Et=e=>p(e,"name","citation_title"),mm=e=>p(e,"name","citation_doi"),fr=e=>p(e,"name","citation_firstpage"),mr=e=>p(e,"name","citation_lastpage"),dm=e=>p(e,"name","citation_issue"),gm=e=>p(e,"name","citation_volume"),vm=e=>Z(S.Article,{atitle:Et(e),au:ur(e),date:lr(e),doi:fm(e),issn:gs(e)?.[0],issue:dm(e),jtitle:pr(e),pub:hr(e),volume:gm(e),spage:fr(e),epage:mr(e)}),bm=e=>F(S.Bookitem,{atitle:Et(e),au:ur(e),btitle:pr(e),date:lr(e),isbn:ds(e),pub:hr(e),spage:fr(e),epage:mr(e)}),_m=e=>Ut({title:Et(e),au:ur(e),date:lr(e),pub:hr(e),spage:fr(e),epage:mr(e)}),vs=e=>!!e.isbn,ym=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!vs(e)&&!!e.journalTitle,Sm=e=>!!e.title,Em=e=>{const t={type:mm(e),isbn:ds(e),issn:gs(e),journalTitle:pr(e),title:Et(e)};return vs(t)?bm(e):ym(t)?vm(e):Sm(t)?_m(e):null},Am=({url:e,document:t})=>{const r=Em(t);return r?A({...r,uri:e}):x()},$m=I({"@content":h(),datePublished:h().optional(),mainEntity:I({type:h().optional(),name:h().optional(),author:B(I({name:h()})).optional(),publisher:I({type:h(),name:h()}).optional(),isbn:h().optional()})}),Rm=e=>$m.safeParse(e).success,wm=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Rm(r))return r}catch{return null}return null},Im=({document:e})=>{const t=mt(e);if(!t)return x();const r=wm(t);if(!r)return x();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;switch(n){case"Book":return A(F(S.Book,{au:o,date:s,title:i,isbn:a,pub:c}));default:return x()}},km=Ie.extend({"@type":h().optional(),name:h().optional(),copyrightYear:ho().optional(),author:B(I({name:h()})).optional(),publisher:B(I({name:h()})).optional()}),Cm=e=>km.safeParse(e).success,Pm=({document:e,url:t})=>{const r=mt(e);if(!r)return x();const n=Fe(r);if(!n||!Cm(n))return x();const o=n["@type"],s=n.author?.map(l=>l.name),i=n.copyrightYear?.toString()??p(e,"property","og:book:release_date"),a=n.name,c=_t(n.publisher?.map(l=>l.name)),u=p(e,"property","og:book:isbn");switch(o){case"Book":return A(F(S.Book,{au:s,date:i,title:a,isbn:u,pub:c,uri:t}));default:return x()}},Om=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Nm=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},zm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=Om(t),o=p(t,"property","article:published_time"),s=Nm(t),i=F(S.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return A(i)},Lm=({document:e,url:t})=>{switch(xm(t)){case v.Chapter:return A(jm(e));case v.Book:return A(Bm(e));case v.Article:return A(Tm(e));case v.Journal:return A(qm(e));default:return x()}},xm=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?v.Chapter:t.includes("/books/")?v.Book:/\/journals\/.+\/article\//.exec(t)!=null?v.Article:t.includes("/journals/")?v.Journal:v.None},Tm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_journal_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_volume"),s=p(e,"name","citation_issue"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_lastpage"),c=p(e,"name","citation_publication_date")?.substring(0,4),u=p(e,"name","citation_publisher"),l=bs(e),f=ms(te(e,"name","citation_issn"));return Z(S.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:c,pub:u})},qm=e=>{const t=Zm(e),r=Dm(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),s=n?n.value:void 0,i=o?o.value:void 0;return Z(S.Journal,{title:t,issn:s,eissn:i})},Zm=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,Dm=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(s=>s.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(i=>{const a=i.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},jm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_inbook_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher");return F(S.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},Bm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_doi"),n=p(e,"name","citation_isbn"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher"),i=bs(e);return F(S.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},bs=e=>{const t=te(e,"name","citation_author");return t.length?t:void 0},Um=e=>{switch(p(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function Vm(e){const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","publication_doi");return A(Z(S.Journal,{jtitle:t,pub:r,doi:n}))}function Fm(e){const t=p(e,"name","dc.Title"),r=te(e,"name","dc.Creator"),n=p(e,"name","dc.Date")?.substring(0,4),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=p(e,"name","dc.Publisher");return A(Z(S.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const Jm=({document:e})=>{switch(Um(e)){case"Journal":return Vm(e);case"Article":return Fm(e);default:return x()}},Mm=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},Wm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return v.Article},Gm=e=>{const t=p(e,"name","DC.Source"),r=p(e,"name","DC.Title"),n=te(e,"name","DC.Creator.PersonalName"),o=p(e,"name","DC.Source.ISSN"),s=p(e,"name","citation_date")?.substring(0,4),i=p(e,"name","DC.Source.Volume"),a=p(e,"name","DC.Source.Issue"),c=p(e,"name","DC.Identifier.URI"),u=p(e,"name","DC.Identifier.pageNumber"),l=u?Mm(u):void 0,f=l?.spage,m=l?.epage;return Z(S.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:m,volume:i,issue:a,uri:c})},Xm=({document:e,url:t})=>{switch(Wm(t)){case v.Article:return A(Gm(e));default:return x()}},Hm=e=>{switch(Ym(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Ym=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Km(e,t){const r=_s(e),n=dr(e),o=Ss(e),s=Es(e),i=As(e),a=$s(e),c=dr(e),u=t,{startPage:l,endPage:f}=Rs(e)??{};return A(F(S.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:c,uri:u}))}function Qm(e,t){const r=_s(e),n=ys(e),o=dr(e),s=Ss(e),i=Es(e),a=As(e),c=$s(e),u=ys(e),l=t,{startPage:f,endPage:m}=Rs(e)??{};return A(F(S.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:m,isbn:a,pub:c,spage:f,title:u,uri:l}))}const _s=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},qe=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,ed=e=>p(e,"property","og:title"),dr=e=>qe(e,"titlevalue")??ed(e),ys=e=>qe(e,"chapter-title-squid"),Ss=e=>qe(e,"pubdate-squid"),Es=e=>qe(e,"doi-squid"),As=e=>qe(e,"isbn-squid"),$s=e=>qe(e,"pubname-squid"),Rs=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},td=({document:e,url:t})=>{switch(Hm(e)){case"Book":return Km(e,t);case"Chapter":return Qm(e,t);default:return x()}},rd=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),nd=e=>{switch(rd(e,"Medium")){case"book":case"e-book":return S.Book;case"e-journal":return S.Journal;default:return S.Unknown}},od=e=>{delete e.rft_id},sd=e=>{const t=Qt(e);if(dt(t)){const r=nd(e.document);t.resource.genre=r,od(t.resource)}return t},id=e=>{const t=p(e,"name","type")?.toLowerCase(),r=p(e,"name","og:type")?.toLowerCase(),n=p(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return v.Article;const o=p(e,"name","twitter:title")?.trim(),s=p(e,"name","description")?.trim();if(o||s)return v.Webpage},ad=e=>{const t=p(e,"name","DC.Title"),r=p(e,"name","DC.Publisher"),n=p(e,"name","DC.Date"),o=p(e,"name","DC.Identifier"),s=p(e,"name","citation_journal_title"),i=p(e,"name","citation_volume"),a=p(e,"name","citation_issn"),c=te(e,"name","citation_author");return Z(S.Article,{au:c,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},cd=(e,t)=>{const r=p(t,"name","twitter:title");return lt({uri:e,title:r})},ud=({url:e,document:t})=>{switch(id(t)){case v.Article:return A(ad(t));case v.Webpage:return A(cd(e,t))}return x()},ld=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?x():Do(),pd=/([0-9]{4})\s+at/;function hd(e){if(!e)return;const t=pd.exec(e);if(t&&t.length>1)return t[1]}function ws(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function fd(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=ws(n,"title"),s=ws(n,"content");return o&&s&&(r[o]=s),r},t)}function md(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=fd(t[0]),n=hd(r.Published),o=r.Show;return{date:n,series:o}}const dd=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return x();const n=S.AudioDocument,o=p(t,"property","og:site_name"),s=p(t,"property","og:title"),i=md(t);return A({genre:n,pub:o,title:s,uri:e,...i})},gd=e=>{const t=p(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},vd=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},bd=({document:e})=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_pdf_url"),n=te(e,"name","citation_author"),o=gd(e),s=vd(e);return!t&&n.length===0&&!o&&!s?x():A(Z(S.Article,{au:n,date:o,doi:s,title:t,uri:r}))},_d=e=>{const t=Me(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},yd=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(s=>s.textContent.replace(",","").trim()).filter(s=>!!s);o.length&&t.set(n,o)}),t},Sd=({url:e,document:t})=>{const r=yd(t),n=_d(t)??r.get("director"),o=Me(t,"div.product-release-year"),s=Me(t,"div.studio-section div.term-info-section-item")??Te(r.get("supplier")),i=Me(t,".product-title")??Me(t,".movie-title"),a=me({au:n,date:o,pub:s,title:i,uri:e});return A(a)},Ed=e=>{if(p(e,"property","og:type")==="article")return v.Article};function Ad(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const s=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");s&&(t[s]=a[0])}),t}function $d(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:p(e,"name","DC.publisher")}function Rd(e){const t=p(e,"name","citation_publication_date");return t?t.substring(0,4):p(e,"name","citation_online_date")?.substring(0,4)}const wd=e=>{const t=Ad(e),r=p(e,"name","DataCite.title"),n=te(e,"name","DataCite.contributor"),o=Rd(e),s=p(e,"name","DC.identifier.DOI"),i=Object.keys(t),a=$d(e,t,i),c=i.includes("journal")?t.journal:void 0,u=i.includes("volume")?t.volume:void 0,l=i.includes("issue")?t.issue:void 0,f=i.includes("issn")?t.issn:void 0,m=i.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return Z(S.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:s,volume:u,issue:l,issn:f,uri:m})},Id=({document:e})=>{switch(Ed(e)){case v.Article:return A(wd(e));default:return x()}},kd=e=>{const t=ae(e,"resource type");return t?t==="Other Journal Article"||t==="Journal Article"||t==="Journal Item"||t==="Book Review"?v.Article:t==="Book Chapter"||t==="Book Part"||t==="Conference Abstract"||t==="Book ChapterConference Paper"||t==="Conference Paper"||t==="Other Book Part"?v.Document:v.None:v.None},Cd=e=>e.replace(":","").replace(" | ","").trim().toLowerCase(),Pd=e=>{const t=new Map,r=e.querySelector("ul.rlist.publication-details__list");return r&&Array.from(r.querySelectorAll("li")).forEach(n=>{const o=Array.from(n.querySelectorAll("span.label")),s=Array.from(n.querySelectorAll("span.info"));o.forEach((i,a)=>{const c=Cd(i.textContent),u=s[a]?.textContent?.trim();c&&u&&(t.has(c)||t.set(c,[]),t.get(c)?.push(u))})}),t},ae=(e,t)=>{const r=e.get(t);if(r)return _t(r)},Od=e=>te(e,"name","dc.Creator").map(t=>t.trim()),Nd=e=>{const t=vf(e,[".loa-accordion a.author-name"]);return t?t.map(n=>n.replace("Authors:","").trim()):void 0},gr=e=>{const t=Od(e);return t.length>0?t:Nd(e)},vr=e=>p(e,"name","dc.Title")??p(e,"property","og:title"),br=e=>p(e,"name","publication_doi"),_r=(e,t)=>ae(t,"date of publication")??p(e,"name","dc.Date"),Is=e=>{const t=ae(e,"page range");let r,n;return t?.includes("-")&&(r=t?t.split("-")[0].trim():void 0,n=t?t.split("-")[1].trim():void 0),{pages:t,spage:r,epage:n}},zd=(e,t,r)=>{const n=vr(e),o=ae(t,"journal"),s=p(e,"name","citation_journal_title"),i=o??s,a=br(e),c=_r(e,t),u=ae(t,"publisher"),l=gr(e),f=ae(t,"volume"),m=ae(t,"issue"),g=Is(t),C=ae(t,"issn (print)"),_=ae(t,"issn (electronic)");return Z(S.Article,{title:n,jtitle:i,doi:a,date:c,pub:u,au:l,volume:f,issue:m,pages:g.pages,spage:g.spage,epage:g.epage,issn:C,eissn:_,uri:r})},Ld=(e,t,r)=>{const n=vr(e),o=ae(t,"book title"),s=br(e),i=_r(e,t),a=ae(t,"publisher"),c=gr(e),u=Is(t),l=ae(t,"isbn (print)");return F(S.Conference,{title:n,btitle:o,doi:s,date:i,pub:a,au:c,pages:u.pages,spage:u.spage,epage:u.epage,isbn:l,uri:r})},xd=(e,t,r)=>{const n=vr(e),o=br(e),s=_r(e,t),i=ae(t,"publisher"),a=gr(e),c=ae(t,"isbn (print)");return F(S.Document,{title:n,doi:o,date:s,pub:i,au:a,uri:r,isbn:c})},Td=({url:e,document:t})=>{const r=Pd(t);switch(kd(r)){case v.Article:return A(zd(t,r,e));case v.Document:return A(Ld(t,r,e));case v.None:return A(xd(t,r,e));default:return x()}};var L=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e.BYUScholarsArchive="BYUScholarsArchive",e.Informit="Informit",e))(L||{});const yr={NoResourceFound:Go,Z3988:Qt,Z3988SearchResult:gf,Amazon:lp,CupOfJo:Up,Jstor:Zf,Youtube:zh,SagePub:nh,SageVideo:df,ScienceDirect:hh,Springer:Yh,TaylorFrancis:_h,Wiley:ff,VuFind:Ch,ClinicalKey:zp,DOAJ:Wp,Primo:tm,IngentaConnect:lm,Ebscohost:Am,OpenStax:Im,OpenTextbook:Pm,Milne:zm,CambridgeJournalsOnline:Lm,AhaJournals:Jm,Ijees:Xm,BloomsburyCollections:td,HeritageCirqa:sd,BritishMedicalJournal:ud,SummonSearchResult:ld,ApplePodcasts:dd,Arxiv:bd,KanopyVideo:Sd,LaTrobeOpal:Id,BYUScholarsArchive:yp,Informit:Td},qd="5.32.0",Sr=()=>qd,Zd=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),Dd={version:Sr(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[L.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[L.SummonSearchResult]},{matcher:{regexp:"cupofjo[.-]com"},name:"Cup of Jo",parsers:[L.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[L.Youtube]},{matcher:{regexp:"www[-.]sciencedirect[.-]com"},name:"Science Direct",parsers:[L.ScienceDirect]},{matcher:{hostnames:Zd},name:"Amazon",parsers:[L.Amazon]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[L.SageVideo]},{matcher:{regexp:"[/.-]((www|journals)[.-])?sagepub[.-]com"},name:"Sage Publishing",parsers:[L.SagePub]},{matcher:{regexp:"www[.-]tandfonline[.-]com"},name:"Taylor & Francis",parsers:[L.TaylorFrancis]},{matcher:{regexp:"[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"},name:"Wiley",parsers:[L.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/"},name:"Worldcat",parsers:[L.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[L.Z3988]},{matcher:{regexp:"link[.-]springer[.-]com"},name:"Springer",parsers:[L.Springer]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[L.VuFind]},{matcher:{regexp:"www[.-]clinicalkey[.-]com"},name:"ClinicalKey",parsers:[L.ClinicalKey]},{matcher:{regexp:"www[.-]jstor[.-]org"},name:"JSTOR",parsers:[L.Jstor]},{matcher:{regexp:"doaj[.-]org"},name:"DOAJ",parsers:[L.DOAJ]},{matcher:{regexp:"[/.-]ingentaconnect[.-]com"},name:"IngentaConnect",parsers:[L.IngentaConnect]},{matcher:{regexp:"research[.-]ebsco[.-]com"},name:"EBSCOHost",parsers:[L.Ebscohost]},{matcher:{regexp:"openstax[-.]org"},name:"OpenStax",parsers:[L.OpenStax]},{matcher:{regexp:"open[.-]umn[.-]edu"},name:"OpenTextbook",parsers:[L.OpenTextbook]},{matcher:{regexp:"milneopentextbooks[-.]org"},name:"Milne Open Textbooks",parsers:[L.Milne]},{matcher:{regexp:"www[.-]perlego[.-]com"},name:"Perlego",parsers:[L.Z3988]},{matcher:{regexp:"www[.-]ahajournals[.-]org"},name:"AHA Journals",parsers:[L.AhaJournals]},{matcher:{regexp:"www[.-]cambridge[.-]org"},name:"Cambridge Journals Online",parsers:[L.CambridgeJournalsOnline]},{matcher:{regexp:"www[.-]nieindia[.-]org"},name:"International Journal of Ecology and Environmental Sciences",parsers:[L.Ijees]},{matcher:{regexp:"www[.-]bloomsburycollections[.-]com"},name:"Bloomsbury Collections",parsers:[L.BloomsburyCollections]},{matcher:{regexp:"cirqahosting[.-]com"},name:"Heritage Cirqa",parsers:[L.HeritageCirqa]},{matcher:{regexp:"www[.-]bmj[.-]com"},name:"British Medical Journal",parsers:[L.BritishMedicalJournal]},{matcher:{regexp:"podcasts[.-]apple[.-]com"},name:"Apple Podcasts",parsers:[L.ApplePodcasts]},{matcher:{regexp:"arxiv[.-]org"},name:"arxiv",parsers:[L.Arxiv]},{matcher:{regexp:"kanopy[.-]com"},name:"Kanopy Video",parsers:[L.KanopyVideo]},{matcher:{regexp:"opal[.-]latrobe[.-]edu[.-]au"},name:"La Trobe Opal",parsers:[L.LaTrobeOpal]},{matcher:{hostnames:["scholarsarchive.byu.edu"]},name:"BYU Scholars Archive",parsers:[L.BYUScholarsArchive]},{matcher:{regexp:"informit[.-]org"},name:"Informit",parsers:[L.Informit]}]},Er=I({hostnames:B(h()).min(1)}),Ar=I({regexp:h()}),$r=he([Er,Ar]),Rr=I({matcher:$r,name:h(),parsers:B(h()),libraryVersionRange:h().optional()}),ks=I({siteRegistrations:B(Rr),version:h()}),jd=e=>ks.safeParse(e).success,Bd=e=>Rr.safeParse(e).success,Ud=e=>$r.safeParse(e).success,Cs=e=>Object.values(L).includes(e),Vd=e=>typeof e=="object"&&e!==null,Ps=I({url:h(),document:Ll(Vd)}),Fd=e=>Ps.safeParse(e).success;var At={exports:{}},wr,Os;function $t(){if(Os)return wr;Os=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return wr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},wr}var Ir,Ns;function Rt(){return Ns||(Ns=1,Ir=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Ir}var zs;function He(){return zs||(zs=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=$t(),s=Rt();t=e.exports={};const i=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const m="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[m,n]],C=O=>{for(const[D,K]of g)O=O.split(`${D}*`).join(`${D}{0,${K}}`).split(`${D}+`).join(`${D}{1,${K}}`);return O},_=(O,D,K)=>{const T=C(D),U=f++;s(O,U,D),l[O]=U,c[U]=D,u[U]=T,i[U]=new RegExp(D,K?"g":void 0),a[U]=new RegExp(T,K?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),_("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${m}+`),_("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),_("FULL",`^${c[l.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),_("LOOSE",`^${c[l.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),_("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",c[l.COERCE],!0),_("COERCERTLFULL",c[l.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",_("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",_("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(At,At.exports)),At.exports}var kr,Ls;function Cr(){if(Ls)return kr;Ls=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return kr=n=>n?typeof n!="object"?e:n:t,kr}var Pr,xs;function Ts(){if(xs)return Pr;xs=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const s=e.test(n),i=e.test(o);return s&&i&&(n=+n,o=+o),n===o?0:s&&!i?-1:i&&!s?1:n<o?-1:1};return Pr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Pr}var Or,qs;function ne(){if(qs)return Or;qs=1;const e=Rt(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=$t(),{safeRe:n,t:o}=He(),s=Cr(),{compareIdentifiers:i}=Ts();class a{constructor(u,l){if(l=s(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const g=+m;if(g>=0&&g<r)return g}return m}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],m=u.prerelease[l];if(e("prerelease compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],m=u.build[l];if(e("build compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const m=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!m||m[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(l){let g=[l,m];f===!1&&(g=[l]),i(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Or=a,Or}var Nr,Zs;function Ze(){if(Zs)return Nr;Zs=1;const e=ne();return Nr=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},Nr}var zr,Ds;function Jd(){if(Ds)return zr;Ds=1;const e=Ze();return zr=(r,n)=>{const o=e(r,n);return o?o.version:null},zr}var Lr,js;function Md(){if(js)return Lr;js=1;const e=Ze();return Lr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Lr}var xr,Bs;function Wd(){if(Bs)return xr;Bs=1;const e=ne();return xr=(r,n,o,s,i)=>{typeof o=="string"&&(i=s,s=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,s,i).version}catch{return null}},xr}var Tr,Us;function Gd(){if(Us)return Tr;Us=1;const e=Ze();return Tr=(r,n)=>{const o=e(r,null,!0),s=e(n,null,!0),i=o.compare(s);if(i===0)return null;const a=i>0,c=a?o:s,u=a?s:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const m=l?"pre":"";return o.major!==s.major?m+"major":o.minor!==s.minor?m+"minor":o.patch!==s.patch?m+"patch":"prerelease"},Tr}var qr,Vs;function Xd(){if(Vs)return qr;Vs=1;const e=ne();return qr=(r,n)=>new e(r,n).major,qr}var Zr,Fs;function Hd(){if(Fs)return Zr;Fs=1;const e=ne();return Zr=(r,n)=>new e(r,n).minor,Zr}var Dr,Js;function Yd(){if(Js)return Dr;Js=1;const e=ne();return Dr=(r,n)=>new e(r,n).patch,Dr}var jr,Ms;function Kd(){if(Ms)return jr;Ms=1;const e=Ze();return jr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},jr}var Br,Ws;function le(){if(Ws)return Br;Ws=1;const e=ne();return Br=(r,n,o)=>new e(r,o).compare(new e(n,o)),Br}var Ur,Gs;function Qd(){if(Gs)return Ur;Gs=1;const e=le();return Ur=(r,n,o)=>e(n,r,o),Ur}var Vr,Xs;function eg(){if(Xs)return Vr;Xs=1;const e=le();return Vr=(r,n)=>e(r,n,!0),Vr}var Fr,Hs;function Jr(){if(Hs)return Fr;Hs=1;const e=ne();return Fr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Fr}var Mr,Ys;function tg(){if(Ys)return Mr;Ys=1;const e=Jr();return Mr=(r,n)=>r.sort((o,s)=>e(o,s,n)),Mr}var Wr,Ks;function rg(){if(Ks)return Wr;Ks=1;const e=Jr();return Wr=(r,n)=>r.sort((o,s)=>e(s,o,n)),Wr}var Gr,Qs;function wt(){if(Qs)return Gr;Qs=1;const e=le();return Gr=(r,n,o)=>e(r,n,o)>0,Gr}var Xr,ei;function Hr(){if(ei)return Xr;ei=1;const e=le();return Xr=(r,n,o)=>e(r,n,o)<0,Xr}var Yr,ti;function ri(){if(ti)return Yr;ti=1;const e=le();return Yr=(r,n,o)=>e(r,n,o)===0,Yr}var Kr,ni;function oi(){if(ni)return Kr;ni=1;const e=le();return Kr=(r,n,o)=>e(r,n,o)!==0,Kr}var Qr,si;function en(){if(si)return Qr;si=1;const e=le();return Qr=(r,n,o)=>e(r,n,o)>=0,Qr}var tn,ii;function rn(){if(ii)return tn;ii=1;const e=le();return tn=(r,n,o)=>e(r,n,o)<=0,tn}var nn,ai;function ci(){if(ai)return nn;ai=1;const e=ri(),t=oi(),r=wt(),n=en(),o=Hr(),s=rn();return nn=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return s(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},nn}var on,ui;function ng(){if(ui)return on;ui=1;const e=ne(),t=Ze(),{safeRe:r,t:n}=He();return on=(s,i)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;i=i||{};let a=null;if(!i.rtl)a=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let C;for(;(C=g.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||C.index+C[0].length!==a.index+a[0].length)&&(a=C),g.lastIndex=C.index+C[1].length+C[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",m=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${m}`,i)},on}var sn,li;function og(){if(li)return sn;li=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return sn=e,sn}var an,pi;function pe(){if(pi)return an;pi=1;const e=/\s+/g;class t{constructor(y,k){if(k=o(k),y instanceof t)return y.loose===!!k.loose&&y.includePrerelease===!!k.includePrerelease?y:new t(y.raw,k);if(y instanceof s)return this.raw=y.value,this.set=[[y]],this.formatted=void 0,this;if(this.options=k,this.loose=!!k.loose,this.includePrerelease=!!k.includePrerelease,this.raw=y.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(P=>!_(P[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&O(P[0])){this.set=[P];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let y=0;y<this.set.length;y++){y>0&&(this.formatted+="||");const k=this.set[y];for(let R=0;R<k.length;R++)R>0&&(this.formatted+=" "),this.formatted+=k[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(y){const R=((this.options.includePrerelease&&g)|(this.options.loose&&C))+":"+y,P=n.get(R);if(P)return P;const w=this.options.loose,N=w?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];y=y.replace(N,Rn(this.options.includePrerelease)),i("hyphen replace",y),y=y.replace(c[u.COMPARATORTRIM],l),i("comparator trim",y),y=y.replace(c[u.TILDETRIM],f),i("tilde trim",y),y=y.replace(c[u.CARETTRIM],m),i("caret trim",y);let j=y.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>$n(ee,this.options));w&&(j=j.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(c[u.COMPARATORLOOSE])))),i("range list",j);const q=new Map,J=j.map(ee=>new s(ee,this.options));for(const ee of J){if(_(ee))return[ee];q.set(ee.value,ee)}q.size>1&&q.has("")&&q.delete("");const oe=[...q.values()];return n.set(R,oe),oe}intersects(y,k){if(!(y instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>D(R,k)&&y.set.some(P=>D(P,k)&&R.every(w=>P.every(N=>w.intersects(N,k)))))}test(y){if(!y)return!1;if(typeof y=="string")try{y=new a(y,this.options)}catch{return!1}for(let k=0;k<this.set.length;k++)if(wn(this.set[k],y,this.options))return!0;return!1}}an=t;const r=og(),n=new r,o=Cr(),s=It(),i=Rt(),a=ne(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:m}=He(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:C}=$t(),_=E=>E.value==="<0.0.0-0",O=E=>E.value==="",D=(E,y)=>{let k=!0;const R=E.slice();let P=R.pop();for(;k&&R.length;)k=R.every(w=>P.intersects(w,y)),P=R.pop();return k},K=(E,y)=>(E=E.replace(c[u.BUILD],""),i("comp",E,y),E=G(E,y),i("caret",E),E=U(E,y),i("tildes",E),E=z(E,y),i("xrange",E),E=An(E,y),i("stars",E),E),T=E=>!E||E.toLowerCase()==="x"||E==="*",U=(E,y)=>E.trim().split(/\s+/).map(k=>Q(k,y)).join(" "),Q=(E,y)=>{const k=y.loose?c[u.TILDELOOSE]:c[u.TILDE];return E.replace(k,(R,P,w,N,j)=>{i("tilde",E,R,P,w,N,j);let q;return T(P)?q="":T(w)?q=`>=${P}.0.0 <${+P+1}.0.0-0`:T(N)?q=`>=${P}.${w}.0 <${P}.${+w+1}.0-0`:j?(i("replaceTilde pr",j),q=`>=${P}.${w}.${N}-${j} <${P}.${+w+1}.0-0`):q=`>=${P}.${w}.${N} <${P}.${+w+1}.0-0`,i("tilde return",q),q})},G=(E,y)=>E.trim().split(/\s+/).map(k=>re(k,y)).join(" "),re=(E,y)=>{i("caret",E,y);const k=y.loose?c[u.CARETLOOSE]:c[u.CARET],R=y.includePrerelease?"-0":"";return E.replace(k,(P,w,N,j,q)=>{i("caret",E,P,w,N,j,q);let J;return T(w)?J="":T(N)?J=`>=${w}.0.0${R} <${+w+1}.0.0-0`:T(j)?w==="0"?J=`>=${w}.${N}.0${R} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.0${R} <${+w+1}.0.0-0`:q?(i("replaceCaret pr",q),w==="0"?N==="0"?J=`>=${w}.${N}.${j}-${q} <${w}.${N}.${+j+1}-0`:J=`>=${w}.${N}.${j}-${q} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.${j}-${q} <${+w+1}.0.0-0`):(i("no pr"),w==="0"?N==="0"?J=`>=${w}.${N}.${j}${R} <${w}.${N}.${+j+1}-0`:J=`>=${w}.${N}.${j}${R} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.${j} <${+w+1}.0.0-0`),i("caret return",J),J})},z=(E,y)=>(i("replaceXRanges",E,y),E.split(/\s+/).map(k=>Ye(k,y)).join(" ")),Ye=(E,y)=>{E=E.trim();const k=y.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return E.replace(k,(R,P,w,N,j,q)=>{i("xRange",E,R,P,w,N,j,q);const J=T(w),oe=J||T(N),ee=oe||T(j),Ke=ee;return P==="="&&Ke&&(P=""),q=y.includePrerelease?"-0":"",J?P===">"||P==="<"?R="<0.0.0-0":R="*":P&&Ke?(oe&&(N=0),j=0,P===">"?(P=">=",oe?(w=+w+1,N=0,j=0):(N=+N+1,j=0)):P==="<="&&(P="<",oe?w=+w+1:N=+N+1),P==="<"&&(q="-0"),R=`${P+w}.${N}.${j}${q}`):oe?R=`>=${w}.0.0${q} <${+w+1}.0.0-0`:ee&&(R=`>=${w}.${N}.0${q} <${w}.${+N+1}.0-0`),i("xRange return",R),R})},An=(E,y)=>(i("replaceStars",E,y),E.trim().replace(c[u.STAR],"")),$n=(E,y)=>(i("replaceGTE0",E,y),E.trim().replace(c[y.includePrerelease?u.GTE0PRE:u.GTE0],"")),Rn=E=>(y,k,R,P,w,N,j,q,J,oe,ee,Ke)=>(T(R)?k="":T(P)?k=`>=${R}.0.0${E?"-0":""}`:T(w)?k=`>=${R}.${P}.0${E?"-0":""}`:N?k=`>=${k}`:k=`>=${k}${E?"-0":""}`,T(J)?q="":T(oe)?q=`<${+J+1}.0.0-0`:T(ee)?q=`<${J}.${+oe+1}.0-0`:Ke?q=`<=${J}.${oe}.${ee}-${Ke}`:E?q=`<${J}.${oe}.${+ee+1}-0`:q=`<=${q}`,`${k} ${q}`.trim()),wn=(E,y,k)=>{for(let R=0;R<E.length;R++)if(!E[R].test(y))return!1;if(y.prerelease.length&&!k.includePrerelease){for(let R=0;R<E.length;R++)if(i(E[R].semver),E[R].semver!==s.ANY&&E[R].semver.prerelease.length>0){const P=E[R].semver;if(P.major===y.major&&P.minor===y.minor&&P.patch===y.patch)return!0}return!1}return!0};return an}var cn,hi;function It(){if(hi)return cn;hi=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),i("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],m=l.match(f);if(!m)throw new TypeError(`Invalid comparator: ${l}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new a(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(i("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}cn=t;const r=Cr(),{safeRe:n,t:o}=He(),s=ci(),i=Rt(),a=ne(),c=pe();return cn}var un,fi;function kt(){if(fi)return un;fi=1;const e=pe();return un=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},un}var ln,mi;function sg(){if(mi)return ln;mi=1;const e=pe();return ln=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),ln}var pn,di;function ig(){if(di)return pn;di=1;const e=ne(),t=pe();return pn=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===-1)&&(i=u,a=new e(i,s))}),i},pn}var hn,gi;function ag(){if(gi)return hn;gi=1;const e=ne(),t=pe();return hn=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===1)&&(i=u,a=new e(i,s))}),i},hn}var fn,vi;function cg(){if(vi)return fn;vi=1;const e=ne(),t=pe(),r=wt();return fn=(o,s)=>{o=new t(o,s);let i=new e("0.0.0");if(o.test(i)||(i=new e("0.0.0-0"),o.test(i)))return i;i=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!i||r(i,u))&&(i=u)}return i&&o.test(i)?i:null},fn}var mn,bi;function ug(){if(bi)return mn;bi=1;const e=pe();return mn=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},mn}var dn,_i;function gn(){if(_i)return dn;_i=1;const e=ne(),t=It(),{ANY:r}=t,n=pe(),o=kt(),s=wt(),i=Hr(),a=rn(),c=en();return dn=(l,f,m,g)=>{l=new e(l,g),f=new n(f,g);let C,_,O,D,K;switch(m){case">":C=s,_=a,O=i,D=">",K=">=";break;case"<":C=i,_=c,O=s,D="<",K="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let T=0;T<f.set.length;++T){const U=f.set[T];let Q=null,G=null;if(U.forEach(re=>{re.semver===r&&(re=new t(">=0.0.0")),Q=Q||re,G=G||re,C(re.semver,Q.semver,g)?Q=re:O(re.semver,G.semver,g)&&(G=re)}),Q.operator===D||Q.operator===K||(!G.operator||G.operator===D)&&_(l,G.semver))return!1;if(G.operator===K&&O(l,G.semver))return!1}return!0},dn}var vn,yi;function lg(){if(yi)return vn;yi=1;const e=gn();return vn=(r,n,o)=>e(r,n,">",o),vn}var bn,Si;function pg(){if(Si)return bn;Si=1;const e=gn();return bn=(r,n,o)=>e(r,n,"<",o),bn}var _n,Ei;function hg(){if(Ei)return _n;Ei=1;const e=pe();return _n=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),_n}var yn,Ai;function fg(){if(Ai)return yn;Ai=1;const e=kt(),t=le();return yn=(r,n,o)=>{const s=[];let i=null,a=null;const c=r.sort((m,g)=>t(m,g,o));for(const m of c)e(m,n,o)?(a=m,i||(i=m)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const u=[];for(const[m,g]of s)m===g?u.push(m):!g&&m===c[0]?u.push("*"):g?m===c[0]?u.push(`<=${g}`):u.push(`${m} - ${g}`):u.push(`>=${m}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},yn}var Sn,$i;function mg(){if($i)return Sn;$i=1;const e=pe(),t=It(),{ANY:r}=t,n=kt(),o=le(),s=(f,m,g={})=>{if(f===m)return!0;f=new e(f,g),m=new e(m,g);let C=!1;e:for(const _ of f.set){for(const O of m.set){const D=c(_,O,g);if(C=C||D!==null,D)continue e}if(C)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,m,g)=>{if(f===m)return!0;if(f.length===1&&f[0].semver===r){if(m.length===1&&m[0].semver===r)return!0;g.includePrerelease?f=i:f=a}if(m.length===1&&m[0].semver===r){if(g.includePrerelease)return!0;m=a}const C=new Set;let _,O;for(const z of f)z.operator===">"||z.operator===">="?_=u(_,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):C.add(z.semver);if(C.size>1)return null;let D;if(_&&O){if(D=o(_.semver,O.semver,g),D>0)return null;if(D===0&&(_.operator!==">="||O.operator!=="<="))return null}for(const z of C){if(_&&!n(z,String(_),g)||O&&!n(z,String(O),g))return null;for(const Ye of m)if(!n(z,String(Ye),g))return!1;return!0}let K,T,U,Q,G=O&&!g.includePrerelease&&O.semver.prerelease.length?O.semver:!1,re=_&&!g.includePrerelease&&_.semver.prerelease.length?_.semver:!1;G&&G.prerelease.length===1&&O.operator==="<"&&G.prerelease[0]===0&&(G=!1);for(const z of m){if(Q=Q||z.operator===">"||z.operator===">=",U=U||z.operator==="<"||z.operator==="<=",_){if(re&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===re.major&&z.semver.minor===re.minor&&z.semver.patch===re.patch&&(re=!1),z.operator===">"||z.operator===">="){if(K=u(_,z,g),K===z&&K!==_)return!1}else if(_.operator===">="&&!n(_.semver,String(z),g))return!1}if(O){if(G&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===G.major&&z.semver.minor===G.minor&&z.semver.patch===G.patch&&(G=!1),z.operator==="<"||z.operator==="<="){if(T=l(O,z,g),T===z&&T!==O)return!1}else if(O.operator==="<="&&!n(O.semver,String(z),g))return!1}if(!z.operator&&(O||_)&&D!==0)return!1}return!(_&&U&&!O&&D!==0||O&&Q&&!_&&D!==0||re||G)},u=(f,m,g)=>{if(!f)return m;const C=o(f.semver,m.semver,g);return C>0?f:C<0||m.operator===">"&&f.operator===">="?m:f},l=(f,m,g)=>{if(!f)return m;const C=o(f.semver,m.semver,g);return C<0?f:C>0||m.operator==="<"&&f.operator==="<="?m:f};return Sn=s,Sn}var En,Ri;function dg(){if(Ri)return En;Ri=1;const e=He(),t=$t(),r=ne(),n=Ts(),o=Ze(),s=Jd(),i=Md(),a=Wd(),c=Gd(),u=Xd(),l=Hd(),f=Yd(),m=Kd(),g=le(),C=Qd(),_=eg(),O=Jr(),D=tg(),K=rg(),T=wt(),U=Hr(),Q=ri(),G=oi(),re=en(),z=rn(),Ye=ci(),An=ng(),$n=It(),Rn=pe(),wn=kt(),E=sg(),y=ig(),k=ag(),R=cg(),P=ug(),w=gn(),N=lg(),j=pg(),q=hg(),J=fg(),oe=mg();return En={parse:o,valid:s,clean:i,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:m,compare:g,rcompare:C,compareLoose:_,compareBuild:O,sort:D,rsort:K,gt:T,lt:U,eq:Q,neq:G,gte:re,lte:z,cmp:Ye,coerce:An,Comparator:$n,Range:Rn,satisfies:wn,toComparators:E,maxSatisfying:y,minSatisfying:k,minVersion:R,validRange:P,outside:w,gtr:N,ltr:j,intersects:q,simplifyRange:J,subset:oe,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},En}var gg=dg();const vg=(e,t)=>bg(t)?t.hostnames.includes(new URL(e).hostname):_g(t)?!!e.match(t.regexp):!1,bg=e=>Er.safeParse(e).success,_g=e=>Ar.safeParse(e).success,yg=(e,t)=>t?gg.satisfies(e,t):!0,Sg=(e,t,r)=>yg(t,r.libraryVersionRange)&&vg(e,r.matcher),Eg=(e,t)=>e.siteRegistrations.filter(r=>Sg(t,Sr(),r)),Ag=(e,t)=>Eg(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>Cs(i)&&i in yr).map(i=>({parser:yr[i],parserType:i,name:s}))),wi=(e,t)=>{const r=Ag(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(dt(i)||Ho(i)||Yo(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...Go(),meta:{parserName:null,parserType:L.NoResourceFound,uri:t.url,referrer:t.url}}},$g=(e,t)=>{const r=wi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},Rg=(e,t)=>{switch(t){case ye.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}},wg=(e,t)=>{const r=Rg(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Ig=(e,t,r)=>{const n=Io(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};b.BookGenresSchema=ql,b.CustomerListSchema=No,b.CustomerSchema=Jt,b.DirectLinkOnlyResultSchema=Xt,b.Genre=S,b.HostnamesMatcherSchema=Er,b.JournalGenresSchema=Zl,b.NON_OPENURL_PROPERTIES=Vt,b.NonOpenUrlPropertiesSchema=Bt,b.NothingParsedResultSchema=Gt,b.OPENURL_KEYS=Ro,b.OpenUrlAudioVisualResourceSchema=Bl,b.OpenUrlBookResourceSchema=Dl,b.OpenUrlDocumentResourceSchema=Vl,b.OpenUrlImageResourceSchema=Ul,b.OpenUrlJournalResourceSchema=jl,b.OpenUrlResourceSchema=de,b.OpenUrlResultSchema=Ht,b.OpenUrlWebpageResourceSchema=Fl,b.PARSERS=yr,b.ParserRegistrySchema=ks,b.ParserType=L,b.ParsingMetadataSchema=Mt,b.ParsingMetadataV2Schema=Wt,b.ParsingRequestSchema=Oo,b.ParsingResponseSchema=To,b.ParsingResponseV2Schema=qo,b.ParsingResultSchema=pt,b.REGISTRY=Dd,b.RegExpMatcherSchema=Ar,b.ResourceDataSchema=Ps,b.ResourceSchema=Eo,b.SiteRegistrationSchema=Rr,b.SummonSearchResultSchema=Kt,b.TenantRegion=ye,b.TenantRegistrySchema=Hl,b.TenantSchema=Ft,b.UrlMatcherSchema=$r,b.Z3988SearchResultSchema=Yt,b.convertCustomerListToTenantRegistry=Ql,b.createAudioVisual=me,b.createBook=F,b.createDocument=Ut,b.createImage=Ao,b.createJournal=Z,b.createWebpage=lt,b.directLinkOnly=tp,b.fromOpenUrl=Co,b.getBaseBookmarkingUrl=wg,b.getLibraryVersion=Sr,b.isCustomer=zo,b.isCustomerList=Lo,b.isDirectLinkOnlyResult=Rh,b.isGenre=Xl,b.isNothingParsedResult=wh,b.isOpenUrlResult=dt,b.isParserRegistry=jd,b.isParserType=Cs,b.isParsingMetadata=Ah,b.isParsingMetadataV2=$h,b.isParsingRequest=Yl,b.isParsingResponse=Sh,b.isParsingResponseV2=Eh,b.isParsingResult=yh,b.isResourceData=Fd,b.isSiteRegistration=Bd,b.isSummonSearchResult=Yo,b.isTenant=xo,b.isTenantRegion=Kl,b.isUrlMatcher=Ud,b.isZ3988SearchResult=Ho,b.nothingParsed=x,b.openUrlResource=A,b.parseResource=wi,b.parseResourceV2=$g,b.summonSearchResult=Do,b.toBookmarkingWorkflowUrl=Ig,b.toOpenUrl=Io,b.z3988SearchResult=Zo,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
|
|
20
|
+
`)}g.write("payload.value = newResult;"),g.write("return payload;");const K=g.compile();return(T,U)=>K(m,T,U)};let s;const i=Qe,a=!kn.jitless,u=a&&Ci.value,l=t.catchall;let f;e._zod.parse=(m,g)=>{f??(f=n.value);const C=m.value;return i(C)?a&&u&&g?.async===!1&&g.jitless!==!0?(s||(s=o(t.shape)),m=s(m,g),l?Wn([],C,m,g,f,e):m):r(m,g):(m.issues.push({expected:"object",code:"invalid_type",input:C,inst:e}),m)}});function Gn(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!Le(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(i=>_e(i,n,ve())))}),t)}const vc=d("$ZodUnion",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Nt(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let i=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:o.value,issues:[]},s);if(u instanceof Promise)a.push(u),i=!0;else{if(u.issues.length===0)return u;a.push(u)}}return i?Promise.all(a).then(c=>Gn(c,o,e,s)):Gn(a,o,e,s)}}),bc=d("$ZodIntersection",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>Xn(r,c,u)):Xn(r,s,i)}});function qt(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ne(e)&&Ne(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const i=qt(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],i=qt(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Xn(e,t,r){if(t.issues.length&&e.issues.push(...t.issues),r.issues.length&&e.issues.push(...r.issues),Le(e))return e;const n=qt(t.value,r.value);if(!n.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(n.mergeErrorPath)}`);return e.value=n.data,e}const _c=d("$ZodRecord",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Ne(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[];if(t.keyType._zod.values){const i=t.keyType._zod.values;r.value={};for(const c of i)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){const u=t.valueType._zod.run({value:o[c],issues:[]},n);u instanceof Promise?s.push(u.then(l=>{l.issues.length&&r.issues.push(...xe(c,l.issues)),r.value[c]=l.value})):(u.issues.length&&r.issues.push(...xe(c,u.issues)),r.value[c]=u.value)}let a;for(const c in o)i.has(c)||(a=a??[],a.push(c));a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:a})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;const a=t.keyType._zod.run({value:i,issues:[]},n);if(a instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(a.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(u=>_e(u,n,ve())),input:i,path:[i],inst:e}),r.value[a.value]=a.value;continue}const c=t.valueType._zod.run({value:o[i],issues:[]},n);c instanceof Promise?s.push(c.then(u=>{u.issues.length&&r.issues.push(...xe(i,u.issues)),r.value[a.value]=u.value})):(c.issues.length&&r.issues.push(...xe(i,c.issues)),r.value[a.value]=c.value)}}return s.length?Promise.all(s).then(()=>r):r}}),yc=d("$ZodEnum",(e,t)=>{X.init(e,t);const r=Ii(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Pi.has(typeof o)).map(o=>typeof o=="string"?ze(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:r,input:i,inst:e}),o}}),Sc=d("$ZodLiteral",(e,t)=>{if(X.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");e._zod.values=new Set(t.values),e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ze(r):r?ze(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return e._zod.values.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Ec=d("$ZodTransform",(e,t)=>{X.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new In(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(r.value=i,r));if(o instanceof Promise)throw new Oe;return r.value=o,r}});function Hn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Ac=d("$ZodOptional",(e,t)=>{X.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Hn(s,r.value)):Hn(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),$c=d("$ZodNullable",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Nt(r.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Rc=d("$ZodDefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Yn(s,t)):Yn(o,t)}});function Yn(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const wc=d("$ZodPrefault",(e,t)=>{X.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Ic=d("$ZodNonOptional",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>Kn(s,e)):Kn(o,e)}});function Kn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const kc=d("$ZodCatch",(e,t)=>{X.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(i=>_e(i,n,ve()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>_e(s,n,ve()))},input:r.value}),r.issues=[]),r)}}),Cc=d("$ZodPipe",(e,t)=>{X.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(i=>st(i,t.in,n)):st(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>st(s,t.out,n)):st(o,t.out,n)}});function st(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Pc=d("$ZodReadonly",(e,t)=>{X.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(Qn):Qn(o)}});function Qn(e){return e.value=Object.freeze(e.value),e}const Oc=d("$ZodCustom",(e,t)=>{se.init(e,t),X.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>eo(s,r,n,e));eo(o,r,n,e)}});function eo(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(De(o))}}class Nc{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function zc(){return new Nc}const it=zc();function Lc(e,t){return new e({type:"string",...$(t)})}function xc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function to(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function Tc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function qc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function Zc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function Dc(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function ro(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function jc(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function Bc(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function Uc(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function Vc(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function Fc(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function Jc(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function Mc(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function Wc(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function Gc(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function Xc(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function Hc(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function Yc(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function Kc(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function Qc(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function eu(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function tu(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function ru(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function nu(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function ou(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function su(e,t){return new e({type:"number",checks:[],...$(t)})}function iu(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...$(t)})}function au(e,t){return new e({type:"null",...$(t)})}function cu(e){return new e({type:"unknown"})}function uu(e,t){return new e({type:"never",...$(t)})}function no(e,t){return new Bn({check:"less_than",...$(t),value:e,inclusive:!1})}function Zt(e,t){return new Bn({check:"less_than",...$(t),value:e,inclusive:!0})}function oo(e,t){return new Un({check:"greater_than",...$(t),value:e,inclusive:!1})}function Dt(e,t){return new Un({check:"greater_than",...$(t),value:e,inclusive:!0})}function so(e,t){return new Ra({check:"multiple_of",...$(t),value:e})}function io(e,t){return new Ia({check:"max_length",...$(t),maximum:e})}function at(e,t){return new ka({check:"min_length",...$(t),minimum:e})}function ao(e,t){return new Ca({check:"length_equals",...$(t),length:e})}function lu(e,t){return new Pa({check:"string_format",format:"regex",...$(t),pattern:e})}function pu(e){return new Oa({check:"string_format",format:"lowercase",...$(e)})}function hu(e){return new Na({check:"string_format",format:"uppercase",...$(e)})}function fu(e,t){return new za({check:"string_format",format:"includes",...$(t),includes:e})}function mu(e,t){return new La({check:"string_format",format:"starts_with",...$(t),prefix:e})}function du(e,t){return new xa({check:"string_format",format:"ends_with",...$(t),suffix:e})}function je(e){return new Ta({check:"overwrite",tx:e})}function gu(e){return je(t=>t.normalize(e))}function vu(){return je(e=>e.trim())}function bu(){return je(e=>e.toLowerCase())}function _u(){return je(e=>e.toUpperCase())}function yu(e,t,r){return new e({type:"array",element:t,...$(r)})}function Su(e,t,r){const n=$(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Eu(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function Au(e){const t=$u(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(De(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(De(o))}},e(r.value,r)));return t}function $u(e,t){const r=new se({check:"custom",...$(t)});return r._zod.check=e,r}const Ru=d("ZodISODateTime",(e,t)=>{Ha.init(e,t),H.init(e,t)});function wu(e){return tu(Ru,e)}const Iu=d("ZodISODate",(e,t)=>{Ya.init(e,t),H.init(e,t)});function ku(e){return ru(Iu,e)}const Cu=d("ZodISOTime",(e,t)=>{Ka.init(e,t),H.init(e,t)});function Pu(e){return nu(Cu,e)}const Ou=d("ZodISODuration",(e,t)=>{Qa.init(e,t),H.init(e,t)});function Nu(e){return ou(Ou,e)}const ce=d("ZodError",(e,t)=>{Ln.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>Bi(e,r)},flatten:{value:r=>ji(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ct,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ct,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),zu=Lt(ce),Lu=xt(ce),xu=tt(ce),Tu=rt(ce),qu=Fi(ce),Zu=Ji(ce),Du=Mi(ce),ju=Wi(ce),Bu=Gi(ce),Uu=Xi(ce),Vu=Hi(ce),Fu=Yi(ce),Y=d("ZodType",(e,t)=>(X.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(we(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]})),e.clone=(r,n)=>be(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>zu(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>xu(e,r,n),e.parseAsync=async(r,n)=>Lu(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Tu(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>qu(e,r,n),e.decode=(r,n)=>Zu(e,r,n),e.encodeAsync=async(r,n)=>Du(e,r,n),e.decodeAsync=async(r,n)=>ju(e,r,n),e.safeEncode=(r,n)=>Bu(e,r,n),e.safeDecode=(r,n)=>Uu(e,r,n),e.safeEncodeAsync=async(r,n)=>Vu(e,r,n),e.safeDecodeAsync=async(r,n)=>Fu(e,r,n),e.refine=(r,n)=>e.check(xl(r,n)),e.superRefine=r=>e.check(Tl(r)),e.overwrite=r=>e.check(je(r)),e.optional=()=>fe(e),e.nullable=()=>bo(e),e.nullish=()=>fe(bo(e)),e.nonoptional=r=>kl(e,r),e.array=()=>B(e),e.or=r=>he([e,r]),e.and=r=>bl(e,r),e.transform=r=>yo(e,El(r)),e.default=r=>Rl(e,r),e.prefault=r=>Il(e,r),e.catch=r=>Pl(e,r),e.pipe=r=>yo(e,r),e.readonly=()=>zl(e),e.describe=r=>{const n=e.clone();return it.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){return it.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return it.get(e);const n=e.clone();return it.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),co=d("_ZodString",(e,t)=>{Tt.init(e,t),Y.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(lu(...n)),e.includes=(...n)=>e.check(fu(...n)),e.startsWith=(...n)=>e.check(mu(...n)),e.endsWith=(...n)=>e.check(du(...n)),e.min=(...n)=>e.check(at(...n)),e.max=(...n)=>e.check(io(...n)),e.length=(...n)=>e.check(ao(...n)),e.nonempty=(...n)=>e.check(at(1,...n)),e.lowercase=n=>e.check(pu(n)),e.uppercase=n=>e.check(hu(n)),e.trim=()=>e.check(vu()),e.normalize=(...n)=>e.check(gu(...n)),e.toLowerCase=()=>e.check(bu()),e.toUpperCase=()=>e.check(_u())}),Ju=d("ZodString",(e,t)=>{Tt.init(e,t),co.init(e,t),e.email=r=>e.check(xc(Mu,r)),e.url=r=>e.check(ro(lo,r)),e.jwt=r=>e.check(eu(cl,r)),e.emoji=r=>e.check(jc(Gu,r)),e.guid=r=>e.check(to(uo,r)),e.uuid=r=>e.check(Tc(ct,r)),e.uuidv4=r=>e.check(qc(ct,r)),e.uuidv6=r=>e.check(Zc(ct,r)),e.uuidv7=r=>e.check(Dc(ct,r)),e.nanoid=r=>e.check(Bc(Xu,r)),e.guid=r=>e.check(to(uo,r)),e.cuid=r=>e.check(Uc(Hu,r)),e.cuid2=r=>e.check(Vc(Yu,r)),e.ulid=r=>e.check(Fc(Ku,r)),e.base64=r=>e.check(Yc(sl,r)),e.base64url=r=>e.check(Kc(il,r)),e.xid=r=>e.check(Jc(Qu,r)),e.ksuid=r=>e.check(Mc(el,r)),e.ipv4=r=>e.check(Wc(tl,r)),e.ipv6=r=>e.check(Gc(rl,r)),e.cidrv4=r=>e.check(Xc(nl,r)),e.cidrv6=r=>e.check(Hc(ol,r)),e.e164=r=>e.check(Qc(al,r)),e.datetime=r=>e.check(wu(r)),e.date=r=>e.check(ku(r)),e.time=r=>e.check(Pu(r)),e.duration=r=>e.check(Nu(r))});function h(e){return Lc(Ju,e)}const H=d("ZodStringFormat",(e,t)=>{M.init(e,t),co.init(e,t)}),Mu=d("ZodEmail",(e,t)=>{Ba.init(e,t),H.init(e,t)}),uo=d("ZodGUID",(e,t)=>{Da.init(e,t),H.init(e,t)}),ct=d("ZodUUID",(e,t)=>{ja.init(e,t),H.init(e,t)}),lo=d("ZodURL",(e,t)=>{Ua.init(e,t),H.init(e,t)});function Wu(e){return ro(lo,e)}const Gu=d("ZodEmoji",(e,t)=>{Va.init(e,t),H.init(e,t)}),Xu=d("ZodNanoID",(e,t)=>{Fa.init(e,t),H.init(e,t)}),Hu=d("ZodCUID",(e,t)=>{Ja.init(e,t),H.init(e,t)}),Yu=d("ZodCUID2",(e,t)=>{Ma.init(e,t),H.init(e,t)}),Ku=d("ZodULID",(e,t)=>{Wa.init(e,t),H.init(e,t)}),Qu=d("ZodXID",(e,t)=>{Ga.init(e,t),H.init(e,t)}),el=d("ZodKSUID",(e,t)=>{Xa.init(e,t),H.init(e,t)}),tl=d("ZodIPv4",(e,t)=>{ec.init(e,t),H.init(e,t)}),rl=d("ZodIPv6",(e,t)=>{tc.init(e,t),H.init(e,t)}),nl=d("ZodCIDRv4",(e,t)=>{rc.init(e,t),H.init(e,t)}),ol=d("ZodCIDRv6",(e,t)=>{nc.init(e,t),H.init(e,t)}),sl=d("ZodBase64",(e,t)=>{oc.init(e,t),H.init(e,t)}),il=d("ZodBase64URL",(e,t)=>{ic.init(e,t),H.init(e,t)}),al=d("ZodE164",(e,t)=>{ac.init(e,t),H.init(e,t)}),cl=d("ZodJWT",(e,t)=>{uc.init(e,t),H.init(e,t)}),po=d("ZodNumber",(e,t)=>{Fn.init(e,t),Y.init(e,t),e.gt=(n,o)=>e.check(oo(n,o)),e.gte=(n,o)=>e.check(Dt(n,o)),e.min=(n,o)=>e.check(Dt(n,o)),e.lt=(n,o)=>e.check(no(n,o)),e.lte=(n,o)=>e.check(Zt(n,o)),e.max=(n,o)=>e.check(Zt(n,o)),e.int=n=>e.check(fo(n)),e.safe=n=>e.check(fo(n)),e.positive=n=>e.check(oo(0,n)),e.nonnegative=n=>e.check(Dt(0,n)),e.negative=n=>e.check(no(0,n)),e.nonpositive=n=>e.check(Zt(0,n)),e.multipleOf=(n,o)=>e.check(so(n,o)),e.step=(n,o)=>e.check(so(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function ho(e){return su(po,e)}const ul=d("ZodNumberFormat",(e,t)=>{lc.init(e,t),po.init(e,t)});function fo(e){return iu(ul,e)}const ll=d("ZodNull",(e,t)=>{pc.init(e,t),Y.init(e,t)});function ut(e){return au(ll,e)}const pl=d("ZodUnknown",(e,t)=>{hc.init(e,t),Y.init(e,t)});function mo(){return cu(pl)}const hl=d("ZodNever",(e,t)=>{fc.init(e,t),Y.init(e,t)});function fl(e){return uu(hl,e)}const ml=d("ZodArray",(e,t)=>{mc.init(e,t),Y.init(e,t),e.element=t.element,e.min=(r,n)=>e.check(at(r,n)),e.nonempty=r=>e.check(at(1,r)),e.max=(r,n)=>e.check(io(r,n)),e.length=(r,n)=>e.check(ao(r,n)),e.unwrap=()=>e.element});function B(e,t){return yu(ml,e,t)}const dl=d("ZodObject",(e,t)=>{gc.init(e,t),Y.init(e,t),V(e,"shape",()=>t.shape),e.keyof=()=>Be(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:mo()}),e.loose=()=>e.clone({...e._zod.def,catchall:mo()}),e.strict=()=>e.clone({...e._zod.def,catchall:fl()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>xi(e,r),e.safeExtend=r=>Ti(e,r),e.merge=r=>qi(e,r),e.pick=r=>zi(e,r),e.omit=r=>Li(e,r),e.partial=(...r)=>Zi(vo,e,r[0]),e.required=(...r)=>Di(_o,e,r[0])});function I(e,t){const r={type:"object",shape:e??{},...$(t)};return new dl(r)}const gl=d("ZodUnion",(e,t)=>{vc.init(e,t),Y.init(e,t),e.options=t.options});function he(e,t){return new gl({type:"union",options:e,...$(t)})}const vl=d("ZodIntersection",(e,t)=>{bc.init(e,t),Y.init(e,t)});function bl(e,t){return new vl({type:"intersection",left:e,right:t})}const _l=d("ZodRecord",(e,t)=>{_c.init(e,t),Y.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType});function go(e,t,r){return new _l({type:"record",keyType:e,valueType:t,...$(r)})}const jt=d("ZodEnum",(e,t)=>{yc.init(e,t),Y.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const i of n)if(r.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new jt({...t,checks:[],...$(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const i of n)if(r.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new jt({...t,checks:[],...$(o),entries:s})}});function Be(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new jt({type:"enum",entries:r,...$(t)})}const yl=d("ZodLiteral",(e,t)=>{Sc.init(e,t),Y.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function W(e,t){return new yl({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const Sl=d("ZodTransform",(e,t)=>{Ec.init(e,t),Y.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new In(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(De(s,r.value,t));else{const i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(De(i))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function El(e){return new Sl({type:"transform",transform:e})}const vo=d("ZodOptional",(e,t)=>{Ac.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function fe(e){return new vo({type:"optional",innerType:e})}const Al=d("ZodNullable",(e,t)=>{$c.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function bo(e){return new Al({type:"nullable",innerType:e})}const $l=d("ZodDefault",(e,t)=>{Rc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Rl(e,t){return new $l({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Nn(t)}})}const wl=d("ZodPrefault",(e,t)=>{wc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function Il(e,t){return new wl({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Nn(t)}})}const _o=d("ZodNonOptional",(e,t)=>{Ic.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function kl(e,t){return new _o({type:"nonoptional",innerType:e,...$(t)})}const Cl=d("ZodCatch",(e,t)=>{kc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Pl(e,t){return new Cl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ol=d("ZodPipe",(e,t)=>{Cc.init(e,t),Y.init(e,t),e.in=t.in,e.out=t.out});function yo(e,t){return new Ol({type:"pipe",in:e,out:t})}const Nl=d("ZodReadonly",(e,t)=>{Pc.init(e,t),Y.init(e,t),e.unwrap=()=>e._zod.def.innerType});function zl(e){return new Nl({type:"readonly",innerType:e})}const So=d("ZodCustom",(e,t)=>{Oc.init(e,t),Y.init(e,t)});function Ll(e,t){return Su(So,e??(()=>!0),t)}function xl(e,t={}){return Eu(So,e,t)}function Tl(e){return Au(e)}var S=(e=>(e.Article="article",e.AudioDocument="audiodocument",e.AudioVisualDocument="audiovisualdocument",e.Book="book",e.Bookitem="bookitem",e.Conference="conference",e.Document="document",e.Image="image",e.Issue="issue",e.Journal="journal",e.Preprint="preprint",e.Proceeding="proceeding",e.Report="report",e.Unknown="unknown",e.Webpage="webpage",e))(S||{});const ql=he([W("book"),W("bookitem"),W("conference"),W("document"),W("report"),W("proceeding"),W("unknown")]),Zl=he([W("article"),W("conference"),W("issue"),W("journal"),W("preprint"),W("proceeding"),W("unknown")]),de=I({artnum:h(),atitle:h(),aufirst:h(),aulast:h(),auinit:h(),auinit1:h(),auinitm:h(),ausuffix:h(),au:B(h()),aucorp:h(),bici:h(),btitle:h(),chron:h(),coden:h(),date:h(),edition:h(),eissn:h(),epage:h(),externalDBID:h(),externalDocID:h(),genre:Be(S),id:h(),isbn:h(),issn:h(),issue:h(),jtitle:h(),pages:h(),part:h(),place:h(),pub:h(),quarter:h(),rft_id:B(h()),series:h(),sici:h(),spage:h(),ssn:h(),stitle:h(),title:h(),tpages:h(),volume:h()}).partial(),Bt=I({bibid:h(),doi:h(),uri:h()}).partial(),Dl=de.pick({atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,bici:!0,btitle:!0,date:!0,edition:!0,epage:!0,id:!0,isbn:!0,issn:!0,pages:!0,place:!0,pub:!0,rft_id:!0,title:!0,tpages:!0,series:!0,spage:!0}).partial(),jl=de.pick({artnum:!0,atitle:!0,aufirst:!0,aulast:!0,auinit:!0,auinit1:!0,auinitm:!0,ausuffix:!0,au:!0,aucorp:!0,chron:!0,coden:!0,date:!0,epage:!0,id:!0,isbn:!0,eissn:!0,issn:!0,issue:!0,title:!0,jtitle:!0,pages:!0,part:!0,pub:!0,rft_id:!0,sici:!0,spage:!0,stitle:!0,ssn:!0,quarter:!0,volume:!0}).partial(),Bl=de.pick({au:!0,date:!0,isbn:!0,pub:!0,title:!0}).partial(),Ul=de.pick({au:!0,date:!0,pub:!0,title:!0}).partial(),Vl=de.pick({au:!0,date:!0,pub:!0,title:!0,spage:!0,epage:!0}).partial(),Fl=de.pick({au:!0,date:!0,title:!0}).partial(),Eo=I({...de.shape,...Bt.shape}),F=(e,t)=>({...t,genre:e}),Z=(e,t)=>({...t,genre:e}),me=e=>({...e,genre:S.AudioVisualDocument}),Ao=e=>({...e,genre:S.Image}),Ut=e=>({...e,genre:S.Document}),lt=e=>({...e,genre:S.Webpage}),$o=e=>Object.keys(e.shape),Ro=$o(de),Vt=$o(Bt),Jl=(e,t,r)=>{if(r.length>0&&typeof r[0]=="string"){const n=t.startsWith("rft_")?t:`rft.${t}`;e.append(n,r[0])}},Ml=(e,t,r)=>{e.append(t,r)},Wl=(e,t,r)=>{e.append(`rft.${t}`,r)},wo=e=>Vt.includes(e),Io=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([r,n])=>{Array.isArray(n)?Jl(t,r,n):typeof n=="string"&&n&&(wo(r)?Ml(t,r,n):Wl(t,r,n))}),t},ko=(e,t,r,n)=>{const o=t.getAll(r).filter(s=>!!s).map(s=>s.trim());return o.length===0?e:{...e,[n]:o}},Co=e=>{const t=Gl(e),r=(o,s)=>{if(s==="au")return ko(o,t,"rft.au","au");if(s==="rft_id")return ko(o,t,"rft_id","rft_id");const i=wo(s)?s:`rft.${s}`,a=t.get(i);return a?{...o,[s]:a.trim()}:o},n=[...Ro,...Vt].reduce(r,{});return Object.keys(n).length===0?null:n},Gl=e=>URL.canParse(e)?new URL(e).searchParams:new URLSearchParams(e);function Xl(e){return typeof e!="string"?!1:Object.values(S).includes(e)}var ye=(e=>(e.CA="CA",e.EUAPAC="EUAPAC",e))(ye||{});const Ft=I({id:h(),name:h(),region:Be(ye)}),Hl=I({tenants:B(Ft)}),Po=9*1024*1024,Oo=I({url:Wu({error:e=>e.input===void 0?'should have the required string property "url"':'"url" must be a string'}),html:h({error:e=>e.input===void 0?'should have the required string property "html"':void 0}).max(Po,{error:`"html" should be a string with a MAX Length of ${Po}`}),tenantCode:h({error:e=>e.input===void 0?'should have the required string property "tenantCode"':void 0}).min(1,{error:'"tenantCode" must be a string'}),region:Be([ye.EUAPAC,ye.CA],{error:e=>e.input===void 0?'should have the required string property "region"':'"region" must be a string of EUAPAC or CA'})});function Yl(e){return Oo.safeParse(e).success}const Jt=I({name:h(),region:Be(ye),apps:go(h(),h())}),No=go(h(),Jt),zo=e=>Jt.safeParse(e).success,Lo=e=>No.safeParse(e).success;function xo(e){return Ft.safeParse(e).success}function Kl(e){return typeof e=="string"&&Object.keys(ye).includes(e)}const Ql=e=>{if(!Lo(e))throw new Error("Error: the customer list data is invalid.");return{tenants:Object.entries(e).map(([r,n])=>ep(r,n))}},ep=(e,t)=>{if(!zo(t))throw new Error(`Invalid customer: ${t}`);const{name:r,region:n}=t,o={id:e,name:r,region:n};if(!xo(o))throw new Error(`Invalid tenant: ${JSON.stringify(o)}`);return o},Mt=I({parserType:h(),parserName:h().nullable(),uri:h(),referrer:h()}),Wt=I({parserType:h(),parserName:h().nullable(),referrer:h()}),Gt=I({bookmarkingWorkflowUrl:ut(),resource:ut()}),Xt=I({bookmarkingWorkflowUrl:h(),resource:ut()}),Ht=I({bookmarkingWorkflowUrl:ut(),resource:Eo}),Yt=I({z3988SearchResult:W(!0)}),Kt=I({summonSearchResult:W(!0)}),pt=he([Xt,Gt,Ht,Yt,Kt]),To=I({meta:Mt}).and(pt),qo=I({meta:Wt}).and(pt);function tp(e){return{bookmarkingWorkflowUrl:e,resource:null}}function x(){return{bookmarkingWorkflowUrl:null,resource:null}}function A(e){return{bookmarkingWorkflowUrl:null,resource:e}}function Zo(){return{z3988SearchResult:!0}}function Do(){return{summonSearchResult:!0}}const rp=e=>{const t=e.getAttribute("title");return t?Co(t):null},Qt=({document:e})=>{const t=Array.from(e.querySelectorAll(".Z3988"));if(t.length===0)return x();const r=t.map(rp).find(n=>n!==null);return r?A(r):x()},np=e=>{const t=Array.from(e.querySelectorAll(".author > a")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},op=e=>e.querySelector("#rpi-attribute-book_details-edition > .rpi-attribute-value > span")?.textContent??void 0,sp=e=>{const t=e.querySelector("#rpi-attribute-book_details-isbn10 > .rpi-attribute-value > span")?.textContent??void 0,r=e.querySelector("#rpi-attribute-book_details-isbn13 > .rpi-attribute-value > span")?.textContent??void 0;if(t&&r)return`${t},${r}`;if(t)return t;if(r)return r},ip=e=>e.querySelector("#rpi-attribute-book_details-publication_date > .rpi-attribute-value > span")?.textContent??void 0,ap=e=>e.querySelector("#rpi-attribute-book_details-publisher > .rpi-attribute-value > span")?.textContent??void 0,cp=e=>e.querySelector("#rpi-attribute-book_details-series > .rpi-attribute-value > a")?.textContent??void 0,up=e=>{const t=e.querySelector("#rpi-attribute-book_details-fiona_pages > .rpi-attribute-value > span")?.textContent??void 0;return(t?/\d+/.exec(t)?.[0]:null)??void 0},lp=({document:e})=>{const t=np(e),r=op(e),n=sp(e),o=ip(e),s=ap(e),i=cp(e),a=e.getElementById("productTitle")?.textContent.trim()??void 0,c=up(e);return{bookmarkingWorkflowUrl:null,resource:F(S.Book,{au:t,date:o,edition:r,isbn:n,pub:s,series:i,title:a,tpages:c})}},p=(e,t,r)=>{const n=te(e,t,r);return n.length>0?n[0]:void 0},te=(e,t,r)=>Array.from(e.querySelectorAll(`meta[${t}='${r}']`)).map(n=>n.getAttribute("content")).filter(n=>!!n?.trim()),jo=e=>{const t=new Map,r=e.split(";").filter(n=>!!n);for(const n of r){const[o,s,i]=n.split(":");t.set(o,{type:s,value:i})}return t};var v=(e=>(e[e.None=0]="None",e[e.Book=1]="Book",e[e.Chapter=2]="Chapter",e[e.Journal=3]="Journal",e[e.Article=4]="Article",e[e.AudioVisual=5]="AudioVisual",e[e.Webpage=6]="Webpage",e[e.Document=7]="Document",e))(v||{});const pp=e=>{if(!e)return;const t=/\b\d{4}\b/.exec(e);return t?t[0]:void 0},Ue=e=>{const t=e.querySelector("#publication_date p")?.textContent.trim()??p(e,"name","bepress_citation_date");return pp(t)},hp=e=>{const t=p(e,"name","bepress_citation_firstpage"),r=p(e,"name","bepress_citation_lastpage");return{spage:t,epage:r}},er=e=>{const t=/https?:\/\/doi\.org\/(.+)/i,n=e.querySelector("#source p")?.textContent.trim()?.match(t);if(n?.length===2)return n[1];const s=e.querySelector("#recommended_citation p a")?.textContent.trim()?.match(t);if(s?.length===2)return s[1]},fp=e=>{const t=[],r=e.querySelectorAll("tbody td");for(const n of r){const o=n.querySelector("strong");if(o&&!o.querySelector("a")){const s=o.textContent.trim();s&&t.push(s)}}return t},Ve=e=>p(e,"name","bepress_citation_title")??e.querySelector("title")?.textContent.trim(),ht=e=>te(e,"name","author"),ft=e=>p(e,"name","bepress_citation_publisher"),tr=e=>p(e,"name","bepress_citation_pdf_url"),mp=(e,t)=>{if(t.includes("/etd/"))return v.Document;if(t.includes("/sophpm_music/")||t.includes("/streaming/"))return v.AudioVisual;if(t.includes("/vol"))return v.Article;if(t.includes("/facpub")||t.includes("/studentpub/")){const r={"book chapter":v.Book,"conference paper":v.Book,"peer-reviewed article":v.Article,other:v.Document},n=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();return n?r[n]:void 0}return v.Journal},dp=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=p(e,"name","bepress_citation_journal_title"),s=p(e,"name","bepress_citation_volume"),i=p(e,"name","bepress_citation_issue"),{epage:a,spage:c}=hp(e),u=tr(e),l=er(e);return Z(S.Article,{atitle:t,jtitle:o,au:r,date:n,volume:s,issue:i,epage:a,spage:c,doi:l,uri:u})},gp=(e,t)=>{const r=e.querySelector(".inherit-title a")?.textContent.trim()??Ve(e),n=fp(e),o=Ue(e),s=ft(e),i=er(e);return Z(S.Journal,{jtitle:r,au:n,date:o,pub:s,doi:i,uri:t})},vp=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=ft(e),s=tr(e),i=e.querySelector("#document_type p")?.textContent.toLowerCase().trim();if(i==="book chapter"){const c=e.querySelector("#source p")?.textContent.trim();return F(S.Bookitem,{pub:o,atitle:t,btitle:c,au:r,date:n,uri:s})}const a=er(e);return i==="conference paper"?F(S.Conference,{pub:o,title:t,au:r,date:n,doi:a,uri:s}):F(S.Document,{pub:o,title:t,au:r,date:n,doi:a,uri:s})},bp=(e,t)=>{const r=Ve(e),n=ht(e),o=Ue(e),s=ft(e);return me({title:r,au:n,date:o,pub:s,uri:t})},_p=e=>{const t=Ve(e),r=ht(e),n=Ue(e),o=ft(e),s=tr(e);return Ut({pub:o,title:t,au:r,date:n,uri:s})},yp=({url:e,document:t})=>{switch(mp(t,e)){case v.Article:return A(dp(t));case v.Journal:return A(gp(t,e));case v.Book:return A(vp(t));case v.AudioVisual:return A(bp(t,e));case v.Document:return A(_p(t));default:return x()}},ge=e=>{if(e)return e.replace(/[^0-9]/g,"")},Bo=e=>Array.from(e.querySelectorAll(".author-source-list li a")).filter(t=>t.childNodes.length>0).map(t=>t.childNodes[0].textContent?.trim()).filter(t=>!!t),Uo=e=>e.querySelector(".article-header")?.querySelector("h1 span")?.textContent.trim(),Vo=e=>({date:e?.textContent.match(/\d{4}/)?.[0],pub:"Elsevier Inc."}),Sp=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".issue")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,[o,s]=(r?.split(",")??[]).map(i=>i.trim());return{volume:ge(o),issue:ge(s),jtitle:n}},Ep=e=>{const t=e.querySelector(".article-header .source")?.textContent,r=t?.match(/\d{4}-\d{2}-\d{2}/)?.[0],n=t?.match(/Pages (\d+-\d+)/),[o,s]=(n?.[1].split("-")??[]).map(u=>u.trim()),{jtitle:i,volume:a,issue:c}=Sp(e);return A(Z(S.Article,{au:Bo(e),atitle:Uo(e),spage:o,epage:s,date:r,jtitle:i,volume:a,issue:c}))},Ap=e=>{const[t,r]=e.querySelectorAll(".source"),{date:n,pub:o}=Vo(r),s=e.querySelector(".browse__book-toc"),[i,a]=(s?.querySelector("h1")?.textContent.split(",")??[]).map(c=>c.trim());return A(F(S.Book,{btitle:i,edition:a,pub:o,au:t.textContent?[t.textContent]:void 0,date:n}))},$p=e=>{const t=e.querySelector(".article-meta");if(!t)return{};const r=t.querySelector(".edition")?.textContent??void 0,n=t.querySelector(".title")?.textContent.trim()??void 0,o=t.querySelector(".copyright"),{date:s,pub:i}=Vo(o);return{edition:r,btitle:n,date:s,pub:i}},Rp=e=>{const{edition:t,btitle:r,date:n,pub:o}=$p(e),s=e.querySelector(".article-header .source")?.textContent,i=/(\d+-\d+|[IVXLCDM]+-[IVXLCDM]+)/i,a=s?.match(i),[c,u]=(a?.[1].split("-")??[]).map(l=>l.trim());return A(F(S.Bookitem,{au:Bo(e),atitle:Uo(e),btitle:r,edition:t,pub:o,date:n,spage:c,epage:u}))},wp=/^[0-9X]$/,rr=e=>{if(!e)return;let t="";for(const r of e)wp.test(r)&&(t+=r);if(t)return t},Ip=(e,t)=>{const r=e.querySelector(".c-cksc-content-header__title")?.textContent.trim(),n=e.querySelector(".c-cksc-content-nice__button")?.textContent.trim(),o=e.querySelector(".c-cksc-content-nice__date")?.textContent.trim(),s=e.evaluate('//p[contains(text(), "ISBN")]',e,null,XPathResult.ANY_TYPE),i=rr(s.iterateNext()?.textContent);return A({genre:S.Document,title:r,pub:n,date:o,uri:t,isbn:i})},Fo=e=>e.querySelector(".browse-toc")??e.querySelector(".browse__journal"),kp=e=>Fo(e)?.querySelector("h1")?.firstElementChild?.textContent.trim(),Cp=e=>{const t=Fo(e),r=t?.querySelector("figure figcaption.source");if(r){const[a,c,u]=r.textContent.split(",").map(l=>l.trim());return{date:a,volume:ge(c),issue:ge(u)}}const n=t?.querySelector("p")?.textContent,[o,s]=n?.split(",")??[];return{date:t?.querySelector(".source span")?.textContent??void 0,volume:ge(o),issue:ge(s)}},Pp=e=>{const{date:t,volume:r,issue:n}=Cp(e);return A(Z(S.Journal,{jtitle:kp(e),date:t,volume:r,issue:n}))};var Jo=(e=>(e.Book="Book",e.Chapter="Book Chapter",e.Article="Full Text Article",e.Journal="Journal",e.Guideline="Guideline",e))(Jo||{});const Op=e=>Object.values(Jo).includes(e),Np=(e,t)=>{const r=e.querySelector(".content-type")??e.querySelector(".c-cksc-content-header__content-type");if(!r)return t.includes("journal")?"Journal":void 0;const n=r.textContent;if(n&&Op(n))return n},zp=({url:e,document:t})=>{switch(Np(t,e)){case"Book":return Ap(t);case"Book Chapter":return Rp(t);case"Full Text Article":return Ep(t);case"Journal":return Pp(t);case"Guideline":return Ip(t,e);case void 0:return x()}},Ie=I({"@context":h()}),Lp=e=>Ie.safeParse(e).success,Mo='script[type="application/ld+json"]',Wo=e=>Array.from(e.querySelectorAll(Mo)),mt=e=>e.querySelector(Mo),Fe=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Lp(r))return r}catch{return null}return null},xp=I({"@id":h(),"@type":h(),author:I({"@id":h()}).optional(),datePublished:h().optional(),dateModified:h().optional(),description:h().optional(),inLanguage:h().optional(),isPartOf:I({"@id":h()}).optional(),name:h().optional(),url:h().optional()}),Tp=Ie.extend({"@graph":B(xp)}),qp=e=>Tp.safeParse(e).success,Zp=e=>{const t=Wo(e);if(t.length===0)return null;const r=t.map(Fe).filter(qp).map(n=>n["@graph"]);return r.length!==1?null:r[0]},Dp=(e,t)=>e.find(r=>r["@type"]===t)??null,jp=(e,t)=>e.find(r=>r["@id"]===t)??null,Bp=e=>{const t=Dp(e,"WebPage");if(!t)return null;const r=t.author?jp(e,t.author["@id"]):void 0;return lt({au:r?.name?[r.name]:void 0,date:t.datePublished,title:t.name})},Up=({document:e})=>{const t=Zp(e);return t?{bookmarkingWorkflowUrl:null,resource:Bp(t)}:x()},Go=()=>x(),Vp=e=>{const{pathname:t}=new URL(e);return t.startsWith("/toc/")?"journal":t.startsWith("/article/")?"article":void 0},Fp=e=>{const t=e.querySelector("header h1 span")?.firstChild?.textContent?.trim(),r=e.querySelector("header p span")?.textContent.trim(),n=/\d{4}-\d{3}[\dX]/g,o=r?.match(n)??[],[s,i]=[o[0],o[1]],a=e.evaluate('//dt[contains(text(), "Publisher")]/following-sibling::dd/a',e,null,XPathResult.STRING_TYPE).stringValue.trim();return A(Z(S.Journal,{pub:a,jtitle:t,issn:s,eissn:i}))},Jp=e=>{let t,r;const n=te(e,"name","citation_issn");return n.length===2?(t=n[1],r=n[0]):t=n[0],{eissn:t,issn:r}},Mp=e=>{const t=p(e,"name","citation_journal_title"),r=p(e,"name","citation_title"),n=te(e,"name","citation_author"),o=p(e,"name","citation_doi"),{eissn:s,issn:i}=Jp(e),a=p(e,"name","citation_publisher"),c=p(e,"name","citation_publication_date"),u=p(e,"name","citation_volume"),l=p(e,"name","citation_issue"),f=p(e,"name","citation_firstpage"),m=p(e,"name","citation_lastpage");return A(Z(S.Article,{jtitle:t,atitle:r,au:n,doi:o,eissn:s,issn:i,pub:a,date:c,volume:u,issue:l,spage:f,epage:m}))},Wp=({document:e,url:t})=>{switch(Vp(t)){case"journal":return Fp(e);case"article":return Mp(e);case void 0:return x()}},Gp=e=>{const t=p(e,"name","pbContext");if(!t)return v.None;const r=jo(t);switch(r.has("page")?r.get("page")?.value:null){case"Article/Chapter View":return v.Article;case"Table of Contents":return v.Journal;default:return v.None}},Xp=e=>{const t=e.querySelector('meta[property="article:author"]')?.getAttribute("content")?.split(",").map(r=>r.trim());return t&&t.length>0?t:void 0},Xo=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".rlist>li>span")).map(s=>s.textContent.trim()).join(""),n=/^ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);n&&t.set("issn",n[1]);const o=/Online ISSN:\s(\d{4}-\d{3}(?:\d|X))/.exec(r);return o&&t.set("eissn",o[1]),t},Hp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationVolume"] > span[property="volumeNumber"]')?.textContent??void 0,Yp=e=>e.querySelector('span[property="isPartOf"][typeof="PublicationIssue"] > span[property="issueNumber"]')?.textContent??void 0,Kp=e=>e.querySelector('meta[name="dc.Identifier"][scheme="doi"]')?.getAttribute("content")??void 0,Qp=e=>e.querySelector("h1")?.textContent??void 0,eh=e=>{const t=new Map,r=e.querySelector("h2.heading-m")?.textContent,n=r?.match(/Issue\s+(\d+(?:-\d+)?)/);n&&t.set("issue",n[1]);const o=r?.match(/Volume\s+(\d+)/);o&&t.set("volume",o[1]);const s=r?.match(/(\d{4})$/);return s&&t.set("date",s[1]),t},th=e=>{const t=Xp(e.document),r=p(e.document,"name","dc.Date"),n=Kp(e.document),o=Xo(e.document),s=o.get("issn"),i=o.get("eissn"),a=Yp(e.document),c=p(e.document,"name","citation_journal_title"),u=p(e.document,"name","dc.Publisher"),l=p(e.document,"name","dc.Title"),f=Hp(e.document);return Z(S.Article,{au:t,date:r,eissn:i,issn:s,issue:a,jtitle:c,pub:u,title:l,volume:f,doi:n})},rh=e=>{const t=Xo(e.document),r=t.get("issn"),n=t.get("eissn"),o=Qp(e.document),s=eh(e.document),i=s.get("issue"),a=s.get("volume"),c=s.get("date");return Z(S.Journal,{eissn:n,issn:r,jtitle:o,title:o,issue:i,volume:a,date:c})},nh=e=>{switch(Gp(e.document)){case v.Article:return A(th(e));case v.Journal:return A(rh(e));default:return x()}},oh=e=>{const t=p(e,"name","citation_type"),r=p(e,"name","citation_article_type");return t==="JOUR"&&r?v.Article:t==="CHP"?v.Chapter:e.querySelector(".book-edition-year")?.textContent.includes("Book")?v.Book:e.getElementById("journal-title")?v.Journal:v.None},nr=e=>p(e,"name","citation_doi")??p(e,"name","dc.identifier")??e.querySelector(".doi .anchor-text")?.textContent??void 0,sh=e=>{const t=Array.from(e.querySelectorAll(".kf-details .kf-detail-item:has(h3)")),r=new Map;for(const n of t){const o=n.querySelector("h3")?.textContent,s=n.querySelector("p")?.textContent;o&&s&&r.set(o,s)}return r},or=(e,t)=>{const r=Array.from(e.querySelectorAll(t)).map(n=>n.textContent).filter(n=>!!n);return r.length>0?r:void 0},ih=e=>{const t=e.querySelector(".js-issn")?.textContent;if(t)return t.replace("Online ISSN: ","")},ah=e=>{const t=e.get("DOI");if(t)return URL.canParse(t)?new URL(t).pathname.substring(1):t},ch=e=>{const t=sh(e),r=p(e,"property","og:title"),n=p(e,"property","og:book:isbn"),o=t.get("Published"),s=or(e,".authors-container .author-detail h3"),i=nr(e)??ah(t);return F(S.Book,{au:s,date:o,doi:i,isbn:n,title:r})},uh=e=>{const t=p(e,"property","og:title"),r=p(e,"property","og:book:isbn"),n=p(e,"name","citation_publication_date"),o=or(e,".author-group .button-link-text"),s=p(e,"name","citation_firstpage"),i=p(e,"name","citation_lastpage"),a=p(e,"name","citation_publisher"),c=nr(e),u=p(e,"name","citation_inbook_title")??e.querySelector(".publication-title")?.textContent??void 0;return F(S.Bookitem,{au:o,btitle:u,date:n,doi:c,epage:i,isbn:r,pub:a,spage:s,title:t})},lh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","citation_issn"),n=p(e,"name","citation_publication_date"),o=or(e,".author-group .button-link-text"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_issue"),c=p(e,"name","citation_volume"),u=nr(e),l=p(e,"name","citation_journal_title")??e.querySelector(".publication-title")?.textContent??void 0;return Z(S.Article,{au:o,jtitle:l,date:n,doi:u,issn:r,issue:a,pub:s,spage:i,title:t,volume:c})},ph=e=>{const t=e.getElementById("journal-title")?.textContent??void 0,r=ih(e);return Z(S.Journal,{issn:r,title:t})},hh=({document:e})=>{switch(oh(e)){case v.Book:return A(ch(e));case v.Chapter:return A(uh(e));case v.Article:return A(lh(e));case v.Journal:return A(ph(e));default:return x()}},fh=e=>{const t=p(e,"name","pbContext");return t&&jo(t).has("article")?v.Article:v.Journal},mh=e=>{const t=e.querySelector(".itemPageRangeHistory");if(!t)return;const n=Array.from(t.childNodes).find(o=>o.textContent?.trim().startsWith("Page"));if(n)return n.textContent?.replace(/Pages?/,"").trim()??void 0},dh=e=>{const t=e.querySelector(".issue-heading")?.textContent;return t?t.split(",")[0]?.replace("Volume","").trim():void 0},gh=e=>{const t=e.querySelector(".issue-heading .nav-toc-list")?.textContent;return t?t.replace("Issue","").trim():void 0},vh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","dc.Date"),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=te(e,"name","dc.Creator"),a=dh(e),c=gh(e),u=mh(e),l=u?.includes("-")?u.split("-")[0]:u,f=u?.includes("-")?u.split("-")[1]:u;return Z(S.Article,{au:i,jtitle:s,date:n,doi:o,issue:c,pub:r,spage:l,epage:f,title:t,volume:a})},bh=e=>{const t=p(e,"property","og:title"),r=p(e,"name","publication_doi");return Z(S.Journal,{doi:r,title:t})},_h=({document:e})=>{switch(fh(e)){case v.Article:return A(vh(e));case v.Journal:return A(bh(e));default:return x()}},yh=e=>pt.safeParse(e).success,Sh=e=>To.safeParse(e).success,Eh=e=>qo.safeParse(e).success,Ah=e=>Mt.safeParse(e).success,$h=e=>Wt.safeParse(e).success;function Rh(e){return Xt.safeParse(e).success}function dt(e){return Ht.safeParse(e).success}function Ho(e){return Yt.safeParse(e).success}function Yo(e){return Kt.safeParse(e).success}function wh(e){return Gt.safeParse(e).success}const Ih=e=>Array.from(e.querySelectorAll("tr th")).find(n=>n.textContent.trim()==="DOI:")?.nextElementSibling?.querySelector('span[property="identifier"]')?.textContent??void 0,kh=e=>{const t=/Record\/(\d+)/.exec(e);if(t&&t.length>1)return t[1]},Ch=e=>{const{url:t,document:r}=e,n=Qt(e);if(!dt(n))return n;const o=Ih(r);return o&&(n.resource.rft_id=[`info:doi/${o}`]),n.resource.bibid=kh(t),n},Ph=Ie.extend({"@type":W("VideoObject"),name:h(),author:h(),genre:h(),description:h(),uploadDate:h(),duration:h(),thumbnailUrl:B(h())}),Oh=e=>Ph.safeParse(e).success,Nh=e=>{const t=Wo(e);if(t.length===0)return null;const r=t.map(Fe).filter(Oh);return r.length!==1?null:r[0]},zh=({url:e,document:t})=>{const r=Nh(t);return r?{bookmarkingWorkflowUrl:null,resource:me({au:[r.author],date:r.uploadDate,title:r.name,uri:e})}:x()},Ko=e=>p(e,"name","doi")??p(e,"name","DOI")??p(e,"name","citation_doi")??p(e,"name","dc.identifier")??p(e,"name","prism.doi")??void 0,Qo=e=>{const t=e.editor?.map(o=>o.name)??[],n=[...e.author?.map(o=>o.name)??[],...t];if(n.length!==0)return n};var Je=(e=>(e.Book="Book",e.Journal="Journal",e.Periodical="Periodical",e.PublicationVolume="PublicationVolume",e.ScholarlyArticle="ScholarlyArticle",e.VideoObject="VideoObject",e.WebPage="WebPage",e))(Je||{}),Se=(e=>(e.Article="article",e.Book="book",e.Paper="Paper",e.Video="video.other",e.Website="website",e))(Se||{}),ue=(e=>(e.Article="/article/",e.Book="/book/",e.Chapter="/chapter/",e.Video="/video/",e.ReferenceWorkEntry="/referenceworkentry/",e.ReferenceWork="/referencework/",e.Protocol="/protocol/",e.Collections="/collections/",e.Journal="/journal/",e.JournalIssue="/volumes-and-issues/",e))(ue||{});const es=I({"@type":W(Je.ScholarlyArticle),author:B(I({"@type":h(),name:h()})).optional(),editor:B(I({"@type":h(),name:h()})).optional(),datePublished:h().optional(),headline:h().optional(),issn:B(h()).optional(),pageStart:h().optional(),pageEnd:h().optional(),isPartOf:I({"@type":he([h(),B(h())]),name:h(),issn:B(h()).optional(),volumeNumber:h().optional(),isbn:B(h()).optional()}),publisher:I({"@type":h(),name:h()}).optional()}),ts=e=>es.safeParse(e).success,Lh=Ie.extend({"@type":W(Je.WebPage),mainEntity:es}),xh=e=>Lh.safeParse(e).success,Th=I({"@type":B(h()),name:h().optional(),issn:B(h()),volumeNumber:h().optional()}),rs=e=>Th.safeParse(e).success,qh=(e,t)=>p(e,"name","citation_issn")??p(e,"name","prism.issn")??(ts(t.isPartOf)?t.isPartOf.issn?.[0]:void 0),ns=(e,t)=>{const r=Qo(t),n=p(e,"name","citation_online_date"),o=Ko(e),s=p(e,"name","citation_issue"),i=qh(e,t),a=rs(t.isPartOf)&&t.isPartOf.issn.length>0?t.isPartOf.issn[1]:void 0,c=t.pageStart,u=t.pageEnd,l=t.headline,f=t.isPartOf.name,m=rs(t.isPartOf)?t.isPartOf.volumeNumber:void 0;return Z(S.Article,{au:r,date:n,doi:o,issue:s,eissn:i,issn:a,spage:c,epage:u,atitle:l,jtitle:f,volume:m})},Zh=Ie.extend({"@type":W(Je.Book),copyrightYear:h().optional(),author:B(I({"@type":h(),name:h()})).optional(),editor:B(I({"@type":h(),name:h()})).optional(),isbn:h().optional(),name:h().optional(),numberOfPages:ho().optional(),publisher:I({"@type":h(),name:h()}).optional()}),Dh=e=>Zh.safeParse(e).success,jh=e=>{const t=e.querySelectorAll(".c-bibliographic-information__list-item"),r=new Map;return t.forEach(n=>{const o=n.querySelector(".u-text-bold")?.textContent.trim(),s=n.querySelector(".c-bibliographic-information__value")?.textContent.trim();o&&s&&r.set(o,s)}),r},Bh=(e,t)=>{const r=jh(e),n=Qo(t),o=t.copyrightYear?.toString(),s=Ko(e)??r.get("DOI"),i=t.name??r.get("Book Title"),a=t.isbn??r.get("Softcover ISBN"),c=t.numberOfPages?.toString()??r.get("Number of Pages"),u=t.publisher?.name??r.get("Publisher");return F(S.Book,{au:n,date:o,doi:s,title:i,isbn:a,tpages:c,pub:u})},Uh=I({"@type":W("Periodical"),name:h(),url:h(),issn:B(h()),editor:B(I({givenName:h(),familyName:h()})),publisher:I({name:h()}),description:h()}),Vh=e=>Uh.safeParse(e).success,Fh=e=>{const t=e.editor.map(({givenName:i,familyName:a})=>`${i} ${a}`),r=e.name,[n,o]=e.issn,s=e.publisher.name;return Z(S.Journal,{au:t,jtitle:r,eissn:n,issn:o,pub:s})},Jh=I({"@type":W(Je.VideoObject),name:h().optional(),description:h().optional(),thumbnailUrl:h().optional(),uploadDate:h().optional(),contentUrl:h().optional(),duration:h().optional()}),Mh=e=>Jh.safeParse(e).success,Wh=(e,t)=>{const r=Array.from(e.querySelectorAll('dd[data-test="video-segment-author"]')).map(i=>i.textContent.trim()).filter(i=>!!i),n=t?.uploadDate?new Date(t.uploadDate).getFullYear().toString():void 0,o=t?.name??p(e,"property","og:title")??void 0,s=e.querySelector("video-about-doi")?.textContent??void 0;return me({au:r.length>0?r:void 0,date:n,doi:s,title:o})},Gh=e=>{const t=p(e,"property","og:title");return lt({title:t})},Xh=(e,t)=>{const r=p(t,"property","og:type");return r===Se.Article&&e.includes(ue.Article)?v.Article:r===Se.Book&&(e.includes(ue.Book)||e.includes(ue.ReferenceWork))?v.Book:r===Se.Paper&&e.includes(ue.Chapter)?v.Chapter:r===Se.Paper&&(e.includes(ue.ReferenceWorkEntry)||e.includes(ue.Protocol))?v.Article:r===Se.Video&&e.includes(ue.Video)?v.AudioVisual:r===Se.Website&&(e.includes(ue.Collections)||e.includes(ue.JournalIssue))?v.Webpage:r===Se.Website&&e.includes(ue.Journal)?v.Journal:v.None},Hh=(e,t,r)=>e===v.AudioVisual&&Mh(r)?A(Wh(t,r)):e===v.Book&&Dh(r)?A(Bh(t,r)):(e===v.Chapter||e===v.Article)&&ts(r)?A(ns(t,r)):e===v.Article&&xh(r)?A(ns(t,r.mainEntity)):e===v.Journal&&Vh(r)?A(Fh(r)):x(),Yh=({url:e,document:t})=>{const r=Xh(e,t);if(r===v.Webpage)return A(Gh(t));const n=mt(t);if(!n)return x();const o=Fe(n);return o?Hh(r,t,o):x()},Kh=new Set(["Print ISBN","Online ISBN","DOI","First published","Online ISSN","Print ISSN"]),Qh=I({content:I({item:I({title:h(),"published-date":h()}),group:I({volume:h(),issue:h()}),series:I({title:h(),type:h(),eissn:h()})}).optional()}),os=(e,t)=>{if(!e)return;const r=e.indexOf(t);return r>-1?e.substring(0,r):e},sr=e=>{const r=/\d+/.exec(e);if(r?.[0])return r[0]},ef=e=>{const t=e.querySelectorAll("script"),n=Array.from(t).find(o=>o.textContent.includes("adobeDataLayerJson"))?.textContent.match(/var adobeDataLayerJson = (\{.*?});/s);if(n?.length===2)try{const o=JSON.parse(n[1]);return Qh.parse(o)}catch{return}},tf=(e,t)=>{const r=p(e,"property","og:type"),n=t.includes("epdf");return r==="Book"||r==="books.book"?v.Book:r==="Chapter"?v.Chapter:r==="Journal"?v.Journal:r==="Article"||n?v.Article:v.None},gt=e=>{const t=te(e,"name","citation_author"),r=Array.from(e.querySelectorAll("#product-details-content .product-authors")).map(o=>o.textContent).filter(o=>!!o),n=new Set([...t,...r]);return n.size>0?[...n]:void 0},rf=e=>{const t=Array.from(e.querySelectorAll("#product-details-content .text-piped p")).map(r=>r.textContent).find(r=>r.endsWith(" pages"));if(t)return sr(t)},vt=e=>{const t=new Map,r=Array.from(e.querySelectorAll(".journal-info-container .info-block")).flatMap(n=>Array.from(n.querySelectorAll(".info_label")));for(const n of r){const o=n.nextElementSibling;if(!o?.classList.contains("info_value"))continue;const s=os(n.textContent,":"),i=os(o.textContent,":");!s||!i||Kh.has(s)&&t.set(s,i)}return t},bt=(e,t)=>p(e,"property","books:release_date")??p(e,"name","citation_online_date")??t.get("First published")??void 0,ir=(e,t)=>p(e,"name","dc.identifier")??p(e,"name","citation_doi")??p(e,"name","publication_doi")??t.get("DOI")??void 0,ss=(e,t)=>{const r=new Set([p(e,"property","books:isbn"),t.get("Print ISBN"),t.get("Online ISBN")].filter(n=>!!n));return r.size>0?[...r].join(","):void 0},nf=e=>{let t,r;const n=e.querySelector(".cover-image__details div:first-of-type");if(n?.childNodes.length===2){const[o,s]=n.childNodes;o.textContent&&(t=sr(o.textContent)),s.textContent&&(r=sr(s.textContent))}return{volume:t,issue:r}},of=e=>{const r=Array.from(e.querySelectorAll(".authors .author")).map(n=>n.textContent.trim().replace(",","")).filter(n=>!!n);return r.length>0?r:void 0},sf=e=>{const t=Array.from(e.querySelectorAll(".details-section .details-entry")),r=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="ISSN"),n=t.find(i=>i.querySelector(".details-label")?.textContent.trim()==="eISSN");let o,s;return r&&(o=r.querySelector(".details-value")?.textContent.trim()),n&&(s=n.querySelector(".details-value")?.textContent.trim()),{issn:o,eissn:s}},af=e=>{if(!e?.content?.group)return{volume:void 0,issue:void 0};const t=e.content.group.volume,r=e.content.group.issue;return r==="0"&&t==="0"?{volume:void 0,issue:void 0}:{volume:t,issue:r}},cf=e=>{const n=Array.from(e.querySelectorAll(".details-section .details-entry")).find(i=>i.querySelector(".details-label")?.textContent.trim()==="Pages")?.querySelector(".details-value")?.textContent.trim(),[o,s]=(n?.split("-")??[void 0,void 0]).map(i=>i?.trim());return o?.toLowerCase()==="n/a"&&s?.toLowerCase()==="n/a"?{spage:void 0,epage:void 0}:{spage:o,epage:s}},uf=e=>{const t=vt(e),r=gt(e),n=p(e,"property","og:title"),o=bt(e,t),s=ir(e,t),i=ss(e,t),a=rf(e);return F(S.Book,{au:r,date:o,doi:s,isbn:i,pages:a,title:n})},lf=e=>{const t=vt(e),r=gt(e),n=p(e,"name","citation_book_title"),o=bt(e,t),s=ir(e,t),i=ss(e,t),a=p(e,"name","citation_publisher"),c=p(e,"property","og:title");return F(S.Bookitem,{au:r,btitle:n,date:o,doi:s,isbn:i,pub:a,title:c})},pf=e=>{const t=vt(e),r=gt(e),n=bt(e,t),o=t.get("Online ISSN"),s=t.get("Print ISSN"),i=p(e,"property","og:title"),{volume:a,issue:c}=nf(e);return Z(S.Journal,{au:r,date:n,eissn:o,issn:s,issue:c,title:i,volume:a})},hf=e=>{const t=vt(e),r=ef(e),n=gt(e)??of(e),o=bt(e,t)??r?.content?.item["published-date"],s=ir(e,t),{issn:i,eissn:a}=sf(e),{volume:c,issue:u}=af(r),l=p(e,"property","og:title")??r?.content?.item.title,f=p(e,"name","citation_journal_title")??r?.content?.series.title,{spage:m,epage:g}=cf(e);return Z(S.Article,{au:n,date:o,doi:s,eissn:a,issn:i??p(e,"name","citation_issn"),issue:u,jtitle:f,title:l,volume:c,spage:m,epage:g})},ff=({document:e,url:t})=>{switch(tf(e,t)){case v.Book:return A(uf(e));case v.Chapter:return A(lf(e));case v.Journal:return A(pf(e));case v.Article:return A(hf(e));default:return x()}},mf=e=>{const t=te(e,"name","citation_author");return t.length>0?t:void 0},df=({document:e})=>{const t=mf(e),r=p(e,"name","citation_publication_date"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_isbn"),s=p(e,"name","citation_publisher"),i=p(e,"name","citation_title")??e.title,a=me({au:t,date:r,doi:n,isbn:o,pub:s,title:i});return A(a)},gf=({document:e})=>Array.from(e.querySelectorAll(".Z3988")).length<=1?x():Zo(),_t=e=>{if(!(!e||e.length===0))return e[0]};function ar(e,t){const r=t.map(n=>{const o=e.querySelector(n)?.textContent??null;if(o&&o.trim()!=="")return o}).filter(n=>n);return _t(r)??null}function vf(e,t){const r=t.flatMap(n=>Array.from(e.querySelectorAll(n)).flatMap(s=>{const i=s.textContent;return i&&i.trim()!==""?i.split(";").map(a=>a.trim()).filter(a=>a.length>0):[]}));return r.length>0?r:null}const Me=(e,t)=>ar(e,[t])?.trim(),bf=e=>{const t=e.querySelector(".content-meta-data__authors")?.textContent;if(t)return t.split(/,\s+|\s+and\s+/).filter(r=>!!r)},_f=e=>{const t=Array.from(e.querySelectorAll('.tombstone-metadata [data-qa="item-authors"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},yf=e=>{const t=Array.from(e.querySelectorAll('.item-authors [data-qa="item-contributors"], .item-authors [data-qa="item-creators"]')).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},Sf=e=>{const t=Array.from(e.querySelectorAll(".contrib-type-author .name")).map(r=>r.textContent).filter(r=>!!r);return t.length?t:void 0},ke=e=>{const t=new Set([...yf(e)??[],...bf(e)??[],...Sf(e)??[],..._f(e)??[]]);return t.size?[...t]:void 0},Ce=(e,t)=>e.querySelector('[data-qa="published-date"]')?.textContent??e.querySelector(".summary-image")?.textContent??Te(t?.get("date"))??Te(t?.get("copyright date"))??Te(t?.get("published date")),is=e=>{const t=e.find(r=>r.startsWith("https://doi.org/"));if(t)return t.replace("https://doi.org/","")},as=e=>{const t=e.get("local identifier");if(t?.length)return is(t)},Ef=e=>e.querySelector(".doi")?.getAttribute("href")??void 0,Te=e=>{if(e?.length)return e[0]},Pe=e=>{const t=new Map;return Array.from(e.querySelectorAll(".metadata-element, .metadata")).map(r=>{const o=r.querySelector(".metadata-label")?.textContent.trim().toLowerCase(),s=Array.from(r.querySelectorAll(".metadata-value")).map(i=>i.textContent).filter(i=>!!i);return{name:o,values:s}}).forEach(({name:r,values:n})=>{!r||!n.length||t.set(r,n)}),t},cs=e=>{const t=Pe(e),r=e.querySelector(".summary-journal"),n=Array.from(r?.childNodes??[]),o=n[0]?.textContent??e.querySelector(".journal-link")?.textContent??void 0,s=n[2]?.textContent?.replace(/Published By:\s+?/i,"")??Te(t.get("publisher"))??e.querySelector(".publisher-link")?.textContent??void 0;return{pub:s&&s.trim()!==""?s:void 0,jtitle:o&&o.trim()!==""?o:void 0}},Af=e=>{const t=ar(e,['[data-qa="journal"]:first-child cite','[data-qa="copyright-statement"] > cite','[data-qa="collection-links"] mfe-content-details-pharos-link']);return t&&t.trim()!==""?t:void 0},yt=e=>ge(e.querySelector('[data-qa="page-count"]')?.textContent),We=(e,t)=>e.querySelector(".publisher-link")?.textContent??Te(t?.get("publisher")),Ee=e=>e.querySelector('[data-qa="item-title"]')?.textContent.trim()??e.querySelector("mfe-turnaway-pharos-heading")?.textContent.trim()??e.querySelector(".metadata mfe-toc-pharos-heading")?.textContent.trim()??e.querySelector(".journal_header-title")?.textContent.trim()??void 0,Ae=e=>{if(!URL.canParse(e))return;const t=new URL(e);return t.origin+t.pathname},$f=e=>{const t=e.querySelector(".ccda-container > :first-child");let r,n;if(t?.textContent.includes("Volume")||t?.textContent.includes("Issue")){const o=t.textContent.trim().split(/,\s+/);for(const s of o)s.startsWith("Volume")?n=ge(s):s.startsWith("Issue")&&(r=ge(s))}return{issue:r,volume:n}},Rf=e=>{const t=e.querySelector('[data-qa="item-src-info"]')?.textContent??p(e,"property","og:description")??p(e,"name","description");if(!t)return{};const r=/Vol\.\s*(\d+)/.exec(t),n=r?r[1]:void 0,o=/No\.\s*(\d+)/.exec(t),s=o?o[1]:void 0,i=/pp\.\s*(\d+)-(\d+)/.exec(t),a=i?i[1]:void 0,c=i?i[2]:void 0,u=/pp\.\s*\d+-\d+\s*\((\d+)\s*pages\)/.exec(t),l=u?u[1]:void 0;return{issue:s,volume:n,spage:a,epage:c,pages:l}},wf=e=>{const t=ar(e,["mfe-turnaway-pharos-link",'[data-qa="item-src-info"]']);if(!t)return;const n=/\(.+\)/.exec(t)?.map(o=>{const s=/\d{4}/.exec(o);return s?s[0]:void 0});return _t(n)},If=(e,t)=>{const r=Ee(e),n=ke(e),o=Ce(e)??wf(e),s=cs(e),i=s.jtitle??Af(e)??void 0,a=s.pub,c=$f(e),u=Rf(e),l=c.issue??u.issue,f=c.volume??u.volume,m=yt(e)??u.pages,g=u.spage,C=u.epage,_=Ae(t),O=is(Array.from(e.querySelector(".content-meta-data-stables")?.childNodes??[]).map(D=>D.textContent??""))??Ef(e);return Z(S.Article,{atitle:r,au:n,date:o,doi:O,epage:C,issue:l,jtitle:i,pages:m,pub:a,spage:g,uri:_,volume:f})},kf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=We(e,r),a=Ae(t);return me({au:n,date:o,pub:i,title:s,uri:a})},Cf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=Ce(e),i=yt(e),a=We(e,r),c=Ae(t),u=as(r);return F(S.Book,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},Pf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=e.querySelector(".book-title-link")?.textContent??void 0,i=Ce(e,r),a=Array.from(e.querySelectorAll('[data-qa="book"] > span')).map(m=>m.textContent),c=yt(e),u=a.find(m=>m.includes("pp."))?.match(/(\d+)-(\d+)/)??void 0,l=We(e,r),f=Ae(t);return F(S.Bookitem,{atitle:o,au:n,btitle:s,date:i,epage:u?.[2],pub:l,pages:c,spage:u?.[1],uri:f})},Of=(e,t)=>{const r=Pe(e),n=ke(e),o=Ee(e),s=Ce(e),i=yt(e),a=We(e,r),c=Ae(t),u=as(r);return F(S.Document,{au:n,date:s,doi:u,pages:i,pub:a,title:o,uri:c})},Nf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=Ae(t);return Ao({au:n,date:o,title:s,uri:i})},zf=(e,t)=>{const{pub:r}=cs(e),n=Ee(e),o=e.querySelector(".eissn")?.textContent.replace(/EISSN\s+/,"").trim()??void 0,s=e.querySelector(".issn")?.textContent.replace(/ISSN\s+/,"").trim()??void 0,i=Ae(t);return Z(S.Journal,{eissn:o,issn:s,jtitle:n,pub:r,uri:i})};var ie=(e=>(e.Article="journal article",e.Audio="audio",e.Book="book",e.Chapter="book chapter",e.Document="document",e.Image="image",e.Journal="journal",e.ResearchReport="research report",e.Serial="serial",e.Video="video",e))(ie||{});const Lf=(e,t)=>{const r=Pe(e),n=ke(e),o=Ce(e,r),s=Ee(e),i=We(e,r),a=Ae(t);return me({au:n,date:o,pub:i,title:s,uri:a})},xf=e=>Object.values(ie).includes(e),Tf=e=>{if(e.querySelector(".journal_header-title"))return ie.Journal;if(e.querySelector(".journal-link"))return ie.Article;const n=e.querySelector(".content-type > span")?.textContent.toLowerCase().trim()??e.querySelector(".content-meta-data-label")?.textContent.toLowerCase().trim();return xf(n)?n:null},qf=(e,t)=>{switch(Tf(e)){case ie.Article:case ie.Serial:return If(e,t);case ie.Audio:return kf(e,t);case ie.Book:return Cf(e,t);case ie.Chapter:case ie.ResearchReport:return Pf(e,t);case ie.Document:return Of(e,t);case ie.Image:return Nf(e,t);case ie.Journal:return zf(e,t);case ie.Video:return Lf(e,t);default:return null}},Zf=({document:e,url:t})=>{const r=qf(e,t);return r?A(r):x()},Ge=e=>{if(e){if(typeof e=="string")return e;if(e.length>0)return e[0]}else return},us=e=>{if(e)return typeof e=="string"?e:Array.isArray(e)?e.length===0?void 0:Ge(e[0].name):Ge(e.name)},St=(...e)=>{const t=new Set(e.filter(r=>!!r));if(t.size!==0)return[...t]},Df=e=>{const t=us(e.mainEntity.creator);return t?[t]:void 0},Xe=({lcn:e,title:t})=>({bibid:e,title:t}),jf=(e,t)=>{const r=St(...(e&&Df(e))??[],...t.authors??[]),n=St(...t.eissns??[]),o=St(e?.mainEntity.isbn?rr(e.mainEntity.isbn):void 0,...t.isbns??[]),s=St(...e?.mainEntity.issn??[],...t.issns??[]),[i,a]=e?.mainEntity.pagination?.split("-")??[];return{authors:r,date:t.date,doi:Ge(t.dois),edition:e?.mainEntity.edition??t.edition,epage:a,eissn:Ge(n),lcn:t.lcn??e?.identifier.value,isbn:o?.join(","),issn:Ge(s),issue:e?.mainEntity.issueNumber,jtitle:t.jtitle,publisher:t.publisher??us(e?.mainEntity.publisher),spage:i,title:e?.name??t.title,volume:e?.mainEntity.volumeNumber}},Bf=e=>Z(S.Article,{...Xe(e),au:e.authors,doi:e.doi,eissn:e.eissn,epage:e.epage,issn:e.issn,issue:e.issue,jtitle:e.jtitle,pub:e.publisher,spage:e.spage,volume:e.volume}),Uf=e=>me({...Xe(e),au:e.authors,date:e.date,pub:e.publisher}),Vf=e=>F(S.Book,{...Xe(e),au:e.authors,date:e.date,doi:e.doi,edition:e.edition,epage:e.epage,isbn:e.isbn,pub:e.publisher,spage:e.spage}),Ff=e=>Z(S.Journal,{...Xe(e),date:e.date,doi:e.doi,eissn:e.eissn,issn:e.issn,pub:e.publisher}),ls=I({"@type":W("Organization"),name:he([h(),B(h())])}),ps=I({"@type":W("Person"),name:he([h(),B(h())])}),Jf=Ie.extend({identifier:I({"@type":h(),propertyID:h(),value:h()}),mainEntity:I({"@type":h(),"@id":h(),creator:fe(he([h(),ps,B(ps)])),edition:fe(h()),isbn:fe(h()),issn:fe(B(h())),issueNumber:fe(h()),pagination:fe(h()),publisher:fe(he([h(),ls,B(ls)])),volumeNumber:fe(h())}),name:h()}),Mf=e=>{const t=mt(e);if(!t)return null;const r=Fe(t),n=Jf.safeParse(r);return n.success?n.data:null},Wf=e=>me({...Xe(e),au:e.authors,date:e.date,pub:e.publisher}),Gf=/([0-9]{4}-[0-9]{1,2}-[0-9]{1,2}|[0-9]{4}-[0-9]{1,2}|[0-9]{4})/,hs=/(E?ISBN|E?ISSN|DOI)\s*:\s*/g,cr=e=>`*:has([title*="${e}" i]) + .item-details-element-container prm-highlight`,Xf=e=>{if(!e)return;const t=Gf.exec(e);if(t)return t.length>1?t[1]:void 0},Hf=e=>{const t=Array.from(e.querySelectorAll(cr("Identifier"))),r={};return t.map(n=>n.textContent).filter(n=>!!n).forEach(n=>{const o=[];let s;for(;(s=hs.exec(n))!==null;)o.push({id:s[1].toLowerCase(),index:s.index,start:hs.lastIndex});o.forEach(({id:i,start:a},c)=>{r[i]??=[],r[i].push(n.substring(a,o[c+1]?.index))})}),r},Yf=e=>Array.from(e.querySelectorAll(cr("Author"))).filter(t=>!!t.textContent&&t.parentElement!==null&&t.parentElement.getAttribute("aria-hidden")!=="true").map(t=>t.textContent.trim()),$e=(e,t)=>e.querySelector(cr(t))?.textContent.trim(),Kf=e=>{const t=$e(e,"Creation Date"),r=$e(e,"Edition"),n=$e(e,"Publication Date"),o=$e(e,"Is Part Of"),s=$e(e,"Publisher"),i=$e(e,"Title"),a=$e(e,"MMS ID")??$e(e,"Record ID"),c=Yf(e),u=Hf(e),[l]=o?.split(",")??[],f=Xf(n??t),m=[...u.isbn??[],...u.eisbn??[]].map(g=>rr(g)).filter(g=>!!g);return{authors:c,date:f,dois:u.doi,edition:r,eissns:u.eissn,isbns:m,issns:u.issn,jtitle:l,lcn:a,publisher:s,title:i}};var fs=(e=>(e.Article="Article",e.Book="Book",e.Periodical="Periodical",e.Journal="Journal",e.AudioCD="Audio CD",e.CreativeWork="CreativeWork",e.Movie="Movie",e.Video="Video",e))(fs||{});const Qf=e=>Object.values(fs).includes(e),em=(e,t)=>{const r=t?.mainEntity["@type"]??e.querySelector(".media-content-type")?.textContent??void 0;if(Qf(r))return r},tm=({document:e})=>{const t=Mf(e),r=Kf(e),n=jf(t,r);switch(em(e,t)){case"Article":return A(Bf(n));case"Book":return A(Vf(n));case"Periodical":case"Journal":return A(Ff(n));case"Audio CD":case"CreativeWork":return A(Uf(n));case"Movie":case"Video":return A(Wf(n));default:return x()}},rm=e=>{const t=e.querySelectorAll('[id="Info"] > p'),n=Array.from(t).find(s=>s.textContent.includes("Document Type"))?.textContent,o=p(e,"name","DC.identifier");return o?.startsWith("info:doi/")||n?.includes("Article")?v.Article:o?.startsWith("urn:issn:")?v.Journal:void 0},nm=e=>{const t=p(e,"name","DCTERMS.bibliographicCitation"),[r,n,o,s]=t?.split(",")??[];return{journalTitle:r,volume:n,issue:o,pages:s}},om=e=>{const t=p(e,"name","DC.identifier");return(t?t.split("info:doi/"):null)?.[1]??void 0},sm=e=>e.evaluate('//*[@id="altLayoutPublisherLogo"]/p/a[1]',e,null,XPathResult.STRING_TYPE,null).stringValue,im=e=>{const[t,r]=e?e.trim().split("-"):[void 0,void 0],n=r?.replace(/\(\d+\)/,"").trim();return{spage:t,epage:n}},am=e=>{const t=p(e,"name","DCTERMS.issued");if(!t)return;const n=/\d{4}/.exec(t);return n?n[0]:void 0},cm=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=am(e),o=nm(e),s=o.journalTitle?.trim(),i=o.volume?.trim(),a=o.issue?.trim(),c=o.pages?im(o.pages):void 0,u=c?.spage,l=c?.epage,f=te(e,"name","DC.creator"),m=om(e);return Z(S.Article,{au:f,jtitle:s,date:n,doi:m,issue:a,pub:r,spage:u,epage:l,atitle:t,volume:i})},um=e=>{const t=p(e,"name","DC.title"),r=p(e,"name","DC.publisher"),n=sm(e);return Z(S.Journal,{issn:n,title:t,pub:r})},lm=({document:e})=>{switch(rm(e)){case v.Article:return A(cm(e));case v.Journal:return A(um(e));default:return x()}},pm=/^\d{4}-\d{3}[\dX]$/i,hm=e=>pm.test(e),ms=e=>{const t=e.filter(hm);return t.length?t:void 0},ur=e=>{const t=te(e,"name","citation_author");return t.length?t:void 0},lr=e=>p(e,"name","citation_publication_date")?.match(/^\d{4}/)?.[0],fm=e=>p(e,"name","citation_doi"),ds=e=>{const t=te(e,"name","citation_isbn");return t.length?t.join(","):void 0},gs=e=>ms(te(e,"name","citation_issn")),pr=e=>p(e,"name","citation_journal_title"),hr=e=>p(e,"name","citation_publisher"),Et=e=>p(e,"name","citation_title"),mm=e=>p(e,"name","citation_doi"),fr=e=>p(e,"name","citation_firstpage"),mr=e=>p(e,"name","citation_lastpage"),dm=e=>p(e,"name","citation_issue"),gm=e=>p(e,"name","citation_volume"),vm=e=>Z(S.Article,{atitle:Et(e),au:ur(e),date:lr(e),doi:fm(e),issn:gs(e)?.[0],issue:dm(e),jtitle:pr(e),pub:hr(e),volume:gm(e),spage:fr(e),epage:mr(e)}),bm=e=>F(S.Bookitem,{atitle:Et(e),au:ur(e),btitle:pr(e),date:lr(e),isbn:ds(e),pub:hr(e),spage:fr(e),epage:mr(e)}),_m=e=>Ut({title:Et(e),au:ur(e),date:lr(e),pub:hr(e),spage:fr(e),epage:mr(e)}),vs=e=>!!e.isbn,ym=e=>!!e.issn||e.type==="Article"&&!!e.journalTitle||!vs(e)&&!!e.journalTitle,Sm=e=>!!e.title,Em=e=>{const t={type:mm(e),isbn:ds(e),issn:gs(e),journalTitle:pr(e),title:Et(e)};return vs(t)?bm(e):ym(t)?vm(e):Sm(t)?_m(e):null},Am=({url:e,document:t})=>{const r=Em(t);return r?A({...r,uri:e}):x()},$m=I({"@content":h(),datePublished:h().optional(),mainEntity:I({type:h().optional(),name:h().optional(),author:B(I({name:h()})).optional(),publisher:I({type:h(),name:h()}).optional(),isbn:h().optional()})}),Rm=e=>$m.safeParse(e).success,wm=e=>{const t=e.textContent;if(!t)return null;try{const r=JSON.parse(t);if(Rm(r))return r}catch{return null}return null},Im=({document:e})=>{const t=mt(e);if(!t)return x();const r=wm(t);if(!r)return x();const n=r.mainEntity.type,o=r.mainEntity.author?.map(u=>u.name),s=r.datePublished?.substring(0,4),i=r.mainEntity.name,a=r.mainEntity.isbn,c=r.mainEntity.publisher?.name;switch(n){case"Book":return A(F(S.Book,{au:o,date:s,title:i,isbn:a,pub:c}));default:return x()}},km=Ie.extend({"@type":h().optional(),name:h().optional(),copyrightYear:ho().optional(),author:B(I({name:h()})).optional(),publisher:B(I({name:h()})).optional()}),Cm=e=>km.safeParse(e).success,Pm=({document:e,url:t})=>{const r=mt(e);if(!r)return x();const n=Fe(r);if(!n||!Cm(n))return x();const o=n["@type"],s=n.author?.map(l=>l.name),i=n.copyrightYear?.toString()??p(e,"property","og:book:release_date"),a=n.name,c=_t(n.publisher?.map(l=>l.name)),u=p(e,"property","og:book:isbn");switch(o){case"Book":return A(F(S.Book,{au:s,date:i,title:a,isbn:u,pub:c,uri:t}));default:return x()}},Om=e=>{const t=Array.from(e.querySelectorAll("a[rel=author]")).map(r=>r.textContent.trim()).filter(Boolean);return t.length?t:void 0},Nm=e=>{const t=Array.from(e.querySelectorAll("strong")).filter(r=>r.textContent.startsWith("ISBN")).map(r=>r.nextElementSibling?.textContent.trim());if(t.length!==0)return t[0]?.replace(/\s+/,",")},zm=({url:e,document:t})=>{const r=t.querySelector("h3.page-title")?.textContent.trim()??void 0,n=Om(t),o=p(t,"property","article:published_time"),s=Nm(t),i=F(S.Book,{au:n,date:o?.substring(0,4),isbn:s,pub:"Milne Open Textbooks",title:r,uri:e});return A(i)},Lm=({document:e,url:t})=>{switch(xm(t)){case v.Chapter:return A(jm(e));case v.Book:return A(Bm(e));case v.Article:return A(Tm(e));case v.Journal:return A(qm(e));default:return x()}},xm=e=>{const{pathname:t}=new URL(e);return t.includes("/books/abs/")?v.Chapter:t.includes("/books/")?v.Book:/\/journals\/.+\/article\//.exec(t)!=null?v.Article:t.includes("/journals/")?v.Journal:v.None},Tm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_journal_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_volume"),s=p(e,"name","citation_issue"),i=p(e,"name","citation_firstpage"),a=p(e,"name","citation_lastpage"),c=p(e,"name","citation_publication_date")?.substring(0,4),u=p(e,"name","citation_publisher"),l=bs(e),f=ms(te(e,"name","citation_issn"));return Z(S.Article,{atitle:t,au:l,jtitle:r,doi:n,volume:o,issue:s,issn:f?.[0],spage:i,epage:a,date:c,pub:u})},qm=e=>{const t=Zm(e),r=Dm(e),n=r.find(a=>a.type==="Print"),o=r.find(a=>a.type==="Online"),s=n?n.value:void 0,i=o?o.value:void 0;return Z(S.Journal,{title:t,issn:s,eissn:i})},Zm=e=>e.querySelector("h1.title")?.textContent.trim()??void 0,Dm=e=>{const r=Array.from(e.querySelectorAll("span.bold")).find(s=>s.textContent.trim()==="ISSN:"),n=/^([0-9]{4}-[0-9]{3}[0-9X]) \((Print|Online)\)/,o=[];return r&&r.parentElement?.querySelectorAll("span.value")?.forEach(i=>{const a=i.textContent.trim(),c=n.exec(a);c&&o.push({value:c[1],type:c[2]})}),o},jm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_inbook_title"),n=p(e,"name","citation_doi"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher");return F(S.Bookitem,{atitle:t,btitle:r,doi:n,date:o,pub:s})},Bm=e=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_doi"),n=p(e,"name","citation_isbn"),o=p(e,"name","citation_publication_date")?.substring(0,4),s=p(e,"name","citation_publisher"),i=bs(e);return F(S.Book,{title:t,au:i,doi:r,isbn:n,date:o,pub:s})},bs=e=>{const t=te(e,"name","citation_author");return t.length?t:void 0},Um=e=>{switch(p(e,"property","og:type")){case"Article":return"Article";case"Journal":return"Journal";default:return}};function Vm(e){const t=p(e,"property","og:title"),r=p(e,"name","dc.Publisher"),n=p(e,"name","publication_doi");return A(Z(S.Journal,{jtitle:t,pub:r,doi:n}))}function Fm(e){const t=p(e,"name","dc.Title"),r=te(e,"name","dc.Creator"),n=p(e,"name","dc.Date")?.substring(0,4),o=p(e,"name","publication_doi"),s=p(e,"name","citation_journal_title"),i=p(e,"name","dc.Publisher");return A(Z(S.Article,{atitle:t,au:r,date:n,doi:o,jtitle:s,pub:i}))}const Jm=({document:e})=>{switch(Um(e)){case"Journal":return Vm(e);case"Article":return Fm(e);default:return x()}},Mm=e=>{if(!e)return;const[t,r]=e.trim().split("-");return{spage:t,epage:r}},Wm=e=>{const{pathname:t}=new URL(e);if(t.includes("/article/"))return v.Article},Gm=e=>{const t=p(e,"name","DC.Source"),r=p(e,"name","DC.Title"),n=te(e,"name","DC.Creator.PersonalName"),o=p(e,"name","DC.Source.ISSN"),s=p(e,"name","citation_date")?.substring(0,4),i=p(e,"name","DC.Source.Volume"),a=p(e,"name","DC.Source.Issue"),c=p(e,"name","DC.Identifier.URI"),u=p(e,"name","DC.Identifier.pageNumber"),l=u?Mm(u):void 0,f=l?.spage,m=l?.epage;return Z(S.Article,{jtitle:t,atitle:r,au:n,issn:o,date:s,spage:f,epage:m,volume:i,issue:a,uri:c})},Xm=({document:e,url:t})=>{switch(Wm(t)){case v.Article:return A(Gm(e));default:return x()}},Hm=e=>{switch(Ym(e)){case"eBook":return"Book";case"Reference":return"Chapter";default:return}},Ym=e=>e.querySelector("#vol-contentType a")?.textContent??void 0;function Km(e,t){const r=_s(e),n=dr(e),o=Ss(e),s=Es(e),i=As(e),a=$s(e),c=dr(e),u=t,{startPage:l,endPage:f}=Rs(e)??{};return A(F(S.Book,{au:r,btitle:n,date:o,doi:s,epage:f,isbn:i,pub:a,spage:l,title:c,uri:u}))}function Qm(e,t){const r=_s(e),n=ys(e),o=dr(e),s=Ss(e),i=Es(e),a=As(e),c=$s(e),u=ys(e),l=t,{startPage:f,endPage:m}=Rs(e)??{};return A(F(S.Book,{au:r,atitle:n,btitle:o,date:s,doi:i,epage:m,isbn:a,pub:c,spage:f,title:u,uri:l}))}const _s=e=>{const t=e.querySelectorAll("div#article_author p.author-bio b"),r=Array.from(t).map(n=>n.textContent).filter(n=>!!n).map(n=>n.trim());return r.length>0?r:void 0},qe=(e,t)=>e.querySelector(`input#${t}`)?.getAttribute("value")??void 0,ed=e=>p(e,"property","og:title"),dr=e=>qe(e,"titlevalue")??ed(e),ys=e=>qe(e,"chapter-title-squid"),Ss=e=>qe(e,"pubdate-squid"),Es=e=>qe(e,"doi-squid"),As=e=>qe(e,"isbn-squid"),$s=e=>qe(e,"pubname-squid"),Rs=e=>{const t=e.querySelector("#pageRange")?.textContent??void 0;if(!t)return;const n=/(\d+)–(\d+)/.exec(t);if(n)return{startPage:n[1],endPage:n[2]}},td=({document:e,url:t})=>{switch(Hm(e)){case"Book":return Km(e,t);case"Chapter":return Qm(e,t);default:return x()}},rd=(e,t)=>e.evaluate(`//*[@class="singleRecord_view_label"][contains(text(), "${t}")]/following-sibling::*[@class="singleRecord_view_data"]`,e,null,XPathResult.STRING_TYPE).stringValue.toLowerCase().trim(),nd=e=>{switch(rd(e,"Medium")){case"book":case"e-book":return S.Book;case"e-journal":return S.Journal;default:return S.Unknown}},od=e=>{delete e.rft_id},sd=e=>{const t=Qt(e);if(dt(t)){const r=nd(e.document);t.resource.genre=r,od(t.resource)}return t},id=e=>{const t=p(e,"name","type")?.toLowerCase(),r=p(e,"name","og:type")?.toLowerCase(),n=p(e,"name","citation_article_type")?.toLowerCase();if(t==="article"||n==="article"||r==="article")return v.Article;const o=p(e,"name","twitter:title")?.trim(),s=p(e,"name","description")?.trim();if(o||s)return v.Webpage},ad=e=>{const t=p(e,"name","DC.Title"),r=p(e,"name","DC.Publisher"),n=p(e,"name","DC.Date"),o=p(e,"name","DC.Identifier"),s=p(e,"name","citation_journal_title"),i=p(e,"name","citation_volume"),a=p(e,"name","citation_issn"),c=te(e,"name","citation_author");return Z(S.Article,{au:c,jtitle:s,date:n,doi:o,issn:a,pub:r,title:t,volume:i})},cd=(e,t)=>{const r=p(t,"name","twitter:title");return lt({uri:e,title:r})},ud=({url:e,document:t})=>{switch(id(t)){case v.Article:return A(ad(t));case v.Webpage:return A(cd(e,t))}return x()},ld=({document:e})=>Array.from(e.querySelectorAll(".availability.documentSummaryAvailability.availabilityContent")).length<=1?x():Do(),pd=/([0-9]{4})\s+at/;function hd(e){if(!e)return;const t=pd.exec(e);if(t&&t.length>1)return t[1]}function ws(e,t){const r=e.getElementsByClassName(t);if(r.length!==0)return r[0].textContent}function fd(e){const t={};return Array.from(e.getElementsByTagName("li")).reduce((r,n)=>{const o=ws(n,"title"),s=ws(n,"content");return o&&s&&(r[o]=s),r},t)}function md(e){const t=e.getElementsByClassName("information");if(t.length===0)return{};const r=fd(t[0]),n=hd(r.Published),o=r.Show;return{date:n,series:o}}const dd=({url:e,document:t})=>{if(!new URL(e).searchParams.has("i"))return x();const n=S.AudioDocument,o=p(t,"property","og:site_name"),s=p(t,"property","og:title"),i=md(t);return A({genre:n,pub:o,title:s,uri:e,...i})},gd=e=>{const t=p(e,"name","citation_date");return t?t.split("/").find(o=>/^\d{4}/.test(o))??void 0:void 0},vd=e=>{const t=e.querySelector("#arxiv-doi-link")?.textContent;return t?t.replace("https://doi.org/","").trim():void 0},bd=({document:e})=>{const t=p(e,"name","citation_title"),r=p(e,"name","citation_pdf_url"),n=te(e,"name","citation_author"),o=gd(e),s=vd(e);return!t&&n.length===0&&!o&&!s?x():A(Z(S.Article,{au:n,date:o,doi:s,title:t,uri:r}))},_d=e=>{const t=Me(e,"div.director-section div.term-info-section-items");if(!t)return;const r=t.split(",").map(n=>n.replace(/\s+/g," ").trim()).filter(n=>n.length>0);return r.length>0?r:void 0},yd=e=>{const t=new Map;return Array.from(e.querySelectorAll(".info-section-container")).forEach(r=>{const n=r.querySelector(".info-section-header .info-section-title")?.textContent.trim().toLowerCase();if(!n)return;const o=Array.from(r.querySelectorAll(".term-info-section-item")).map(s=>s.textContent.replace(",","").trim()).filter(s=>!!s);o.length&&t.set(n,o)}),t},Sd=({url:e,document:t})=>{const r=yd(t),n=_d(t)??r.get("director"),o=Me(t,"div.product-release-year"),s=Me(t,"div.studio-section div.term-info-section-item")??Te(r.get("supplier")),i=Me(t,".product-title")??Me(t,".movie-title"),a=me({au:n,date:o,pub:s,title:i,uri:e});return A(a)},Ed=e=>{if(p(e,"property","og:type")==="article")return v.Article};function Ad(e){const t={},r=e.querySelector("[data-id=layout-form]");return r&&Array.from(r.getElementsByTagName("h2")).forEach(o=>{const s=o.textContent.toLowerCase(),a=Array.from(o.parentElement?.getElementsByTagName("span")??[]).map(c=>c.textContent||"");s&&(t[s]=a[0])}),t}function $d(e,t,r){return r.includes("publisher")?t.publisher:r.includes("place of publication, exhibition, or creation")?t["place of publication, exhibition, or creation"]:p(e,"name","DC.publisher")}function Rd(e){const t=p(e,"name","citation_publication_date");return t?t.substring(0,4):p(e,"name","citation_online_date")?.substring(0,4)}const wd=e=>{const t=Ad(e),r=p(e,"name","DataCite.title"),n=te(e,"name","DataCite.contributor"),o=Rd(e),s=p(e,"name","DC.identifier.DOI"),i=Object.keys(t),a=$d(e,t,i),c=i.includes("journal")?t.journal:void 0,u=i.includes("volume")?t.volume:void 0,l=i.includes("issue")?t.issue:void 0,f=i.includes("issn")?t.issn:void 0,m=i.includes("electronic location (url)")?t["electronic location (url)"]:void 0;return Z(S.Article,{jtitle:c,atitle:r,pub:a,au:n,date:o,doi:s,volume:u,issue:l,issn:f,uri:m})},Id=({document:e})=>{switch(Ed(e)){case v.Article:return A(wd(e));default:return x()}},kd=e=>{const t=ae(e,"resource type");return t?t==="Other Journal Article"||t==="Journal Article"||t==="Journal Item"||t==="Book Review"?v.Article:t==="Book Chapter"||t==="Book Part"||t==="Conference Abstract"||t==="Book ChapterConference Paper"||t==="Conference Paper"||t==="Other Book Part"?v.Document:v.None:v.None},Cd=e=>e.replace(":","").replace(" | ","").trim().toLowerCase(),Pd=e=>{const t=new Map,r=e.querySelector("ul.rlist.publication-details__list");return r&&Array.from(r.querySelectorAll("li")).forEach(n=>{const o=Array.from(n.querySelectorAll("span.label")),s=Array.from(n.querySelectorAll("span.info"));o.forEach((i,a)=>{const c=Cd(i.textContent),u=s[a]?.textContent?.trim();c&&u&&(t.has(c)||t.set(c,[]),t.get(c)?.push(u))})}),t},ae=(e,t)=>{const r=e.get(t);if(r)return _t(r)},Od=e=>te(e,"name","dc.Creator").map(t=>t.trim()),Nd=e=>{const t=vf(e,[".loa-accordion a.author-name"]);return t?t.map(n=>n.replace("Authors:","").trim()):void 0},gr=e=>{const t=Od(e);return t.length>0?t:Nd(e)},vr=e=>p(e,"name","dc.Title")??p(e,"property","og:title"),br=e=>p(e,"name","publication_doi"),_r=(e,t)=>ae(t,"date of publication")??p(e,"name","dc.Date"),Is=e=>{const t=ae(e,"page range");let r,n;return t?.includes("-")&&(r=t?t.split("-")[0].trim():void 0,n=t?t.split("-")[1].trim():void 0),{pages:t,spage:r,epage:n}},zd=(e,t,r)=>{const n=vr(e),o=ae(t,"journal"),s=p(e,"name","citation_journal_title"),i=o??s,a=br(e),c=_r(e,t),u=ae(t,"publisher"),l=gr(e),f=ae(t,"volume"),m=ae(t,"issue"),g=Is(t),C=ae(t,"issn (print)"),_=ae(t,"issn (electronic)");return Z(S.Article,{title:n,jtitle:i,doi:a,date:c,pub:u,au:l,volume:f,issue:m,pages:g.pages,spage:g.spage,epage:g.epage,issn:C,eissn:_,uri:r})},Ld=(e,t,r)=>{const n=vr(e),o=ae(t,"book title"),s=br(e),i=_r(e,t),a=ae(t,"publisher"),c=gr(e),u=Is(t),l=ae(t,"isbn (print)");return F(S.Conference,{title:n,btitle:o,doi:s,date:i,pub:a,au:c,pages:u.pages,spage:u.spage,epage:u.epage,isbn:l,uri:r})},xd=(e,t,r)=>{const n=vr(e),o=br(e),s=_r(e,t),i=ae(t,"publisher"),a=gr(e),c=ae(t,"isbn (print)");return F(S.Document,{title:n,doi:o,date:s,pub:i,au:a,uri:r,isbn:c})},Td=({url:e,document:t})=>{const r=Pd(t);switch(kd(r)){case v.Article:return A(zd(t,r,e));case v.Document:return A(Ld(t,r,e));case v.None:return A(xd(t,r,e));default:return x()}};var L=(e=>(e.NoResourceFound="NoResourceFound",e.Z3988="Z3988",e.Z3988SearchResult="Z3988SearchResult",e.Amazon="Amazon",e.CupOfJo="CupOfJo",e.IngentaConnect="IngentaConnect",e.Jstor="Jstor",e.Milne="Milne",e.Primo="Primo",e.SagePub="SagePub",e.SageVideo="SageVideo",e.ScienceDirect="ScienceDirect",e.Springer="Springer",e.Youtube="Youtube",e.TaylorFrancis="TaylorFrancis",e.Wiley="Wiley",e.VuFind="VuFind",e.ClinicalKey="ClinicalKey",e.DOAJ="DOAJ",e.Ebscohost="Ebscohost",e.OpenStax="OpenStax",e.CambridgeJournalsOnline="CambridgeJournalsOnline",e.OpenTextbook="OpenTextbook",e.AhaJournals="AhaJournals",e.Ijees="Ijees",e.BloomsburyCollections="BloomsburyCollections",e.HeritageCirqa="HeritageCirqa",e.BritishMedicalJournal="BritishMedicalJournal",e.SummonSearchResult="SummonSearchResult",e.ApplePodcasts="ApplePodcasts",e.Arxiv="Arxiv",e.KanopyVideo="KanopyVideo",e.LaTrobeOpal="LaTrobeOpal",e.BYUScholarsArchive="BYUScholarsArchive",e.Informit="Informit",e))(L||{});const yr={NoResourceFound:Go,Z3988:Qt,Z3988SearchResult:gf,Amazon:lp,CupOfJo:Up,Jstor:Zf,Youtube:zh,SagePub:nh,SageVideo:df,ScienceDirect:hh,Springer:Yh,TaylorFrancis:_h,Wiley:ff,VuFind:Ch,ClinicalKey:zp,DOAJ:Wp,Primo:tm,IngentaConnect:lm,Ebscohost:Am,OpenStax:Im,OpenTextbook:Pm,Milne:zm,CambridgeJournalsOnline:Lm,AhaJournals:Jm,Ijees:Xm,BloomsburyCollections:td,HeritageCirqa:sd,BritishMedicalJournal:ud,SummonSearchResult:ld,ApplePodcasts:dd,Arxiv:bd,KanopyVideo:Sd,LaTrobeOpal:Id,BYUScholarsArchive:yp,Informit:Td},qd="5.32.1",Sr=()=>qd,Zd=["com.au","com","ca","co.uk","de","fr","nl"].flatMap(e=>[`amazon.${e}`,`www.amazon.${e}`]),Dd={version:Sr(),siteRegistrations:[{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/search"},name:"Worldcat Search Results",parsers:[L.Z3988SearchResult]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.summon\\.serialssolutions\\.com/"},name:"Summon Search Results",parsers:[L.SummonSearchResult]},{matcher:{regexp:"cupofjo[.-]com"},name:"Cup of Jo",parsers:[L.CupOfJo]},{matcher:{hostnames:["youtube.com","www.youtube.com"]},name:"Youtube",parsers:[L.Youtube]},{matcher:{regexp:"www[-.]sciencedirect[.-]com"},name:"Science Direct",parsers:[L.ScienceDirect]},{matcher:{hostnames:Zd},name:"Amazon",parsers:[L.Amazon]},{matcher:{regexp:"^https://sk\\.sagepub\\.com/video/"},name:"Sage Video",parsers:[L.SageVideo]},{matcher:{regexp:"[/.-]((www|journals)[.-])?sagepub[.-]com"},name:"Sage Publishing",parsers:[L.SagePub]},{matcher:{regexp:"www[.-]tandfonline[.-]com"},name:"Taylor & Francis",parsers:[L.TaylorFrancis]},{matcher:{regexp:"[/.-]((www|onlinelibrary)[.-])?wiley[.-]com"},name:"Wiley",parsers:[L.Wiley]},{matcher:{regexp:"^https://[a-z0-9\\-]+\\.on\\.worldcat\\.org/"},name:"Worldcat",parsers:[L.Z3988]},{matcher:{hostnames:["catalogue.rau.ac.uk"]},name:"Royal Agricultural University Library",parsers:[L.Z3988]},{matcher:{regexp:"link[.-]springer[.-]com"},name:"Springer",parsers:[L.Springer]},{matcher:{regexp:"^https://vufind\\.lboro\\.ac\\.uk/(Record|PrimoRecord)"},name:"VuFind",parsers:[L.VuFind]},{matcher:{regexp:"www[.-]clinicalkey[.-]com"},name:"ClinicalKey",parsers:[L.ClinicalKey]},{matcher:{regexp:"www[.-]jstor[.-]org"},name:"JSTOR",parsers:[L.Jstor]},{matcher:{regexp:"doaj[.-]org"},name:"DOAJ",parsers:[L.DOAJ]},{matcher:{regexp:"[/.-]ingentaconnect[.-]com"},name:"IngentaConnect",parsers:[L.IngentaConnect]},{matcher:{regexp:"research[.-]ebsco[.-]com"},name:"EBSCOHost",parsers:[L.Ebscohost]},{matcher:{regexp:"openstax[-.]org"},name:"OpenStax",parsers:[L.OpenStax]},{matcher:{regexp:"open[.-]umn[.-]edu"},name:"OpenTextbook",parsers:[L.OpenTextbook]},{matcher:{regexp:"milneopentextbooks[-.]org"},name:"Milne Open Textbooks",parsers:[L.Milne]},{matcher:{regexp:"www[.-]perlego[.-]com"},name:"Perlego",parsers:[L.Z3988]},{matcher:{regexp:"www[.-]ahajournals[.-]org"},name:"AHA Journals",parsers:[L.AhaJournals]},{matcher:{regexp:"www[.-]cambridge[.-]org"},name:"Cambridge Journals Online",parsers:[L.CambridgeJournalsOnline]},{matcher:{regexp:"www[.-]nieindia[.-]org"},name:"International Journal of Ecology and Environmental Sciences",parsers:[L.Ijees]},{matcher:{regexp:"www[.-]bloomsburycollections[.-]com"},name:"Bloomsbury Collections",parsers:[L.BloomsburyCollections]},{matcher:{regexp:"cirqahosting[.-]com"},name:"Heritage Cirqa",parsers:[L.HeritageCirqa]},{matcher:{regexp:"www[.-]bmj[.-]com"},name:"British Medical Journal",parsers:[L.BritishMedicalJournal]},{matcher:{regexp:"podcasts[.-]apple[.-]com"},name:"Apple Podcasts",parsers:[L.ApplePodcasts]},{matcher:{regexp:"arxiv[.-]org"},name:"arxiv",parsers:[L.Arxiv]},{matcher:{regexp:"kanopy[.-]com"},name:"Kanopy Video",parsers:[L.KanopyVideo]},{matcher:{regexp:"opal[.-]latrobe[.-]edu[.-]au"},name:"La Trobe Opal",parsers:[L.LaTrobeOpal]},{matcher:{hostnames:["scholarsarchive.byu.edu"]},name:"BYU Scholars Archive",parsers:[L.BYUScholarsArchive]},{matcher:{regexp:"informit[.-]org"},name:"Informit",parsers:[L.Informit]}]},Er=I({hostnames:B(h()).min(1)}),Ar=I({regexp:h()}),$r=he([Er,Ar]),Rr=I({matcher:$r,name:h(),parsers:B(h()),libraryVersionRange:h().optional()}),ks=I({siteRegistrations:B(Rr),version:h()}),jd=e=>ks.safeParse(e).success,Bd=e=>Rr.safeParse(e).success,Ud=e=>$r.safeParse(e).success,Cs=e=>Object.values(L).includes(e),Vd=e=>typeof e=="object"&&e!==null,Ps=I({url:h(),document:Ll(Vd)}),Fd=e=>Ps.safeParse(e).success;var At={exports:{}},wr,Os;function $t(){if(Os)return wr;Os=1;const e="2.0.0",t=256,r=Number.MAX_SAFE_INTEGER||9007199254740991,n=16,o=t-6;return wr={MAX_LENGTH:t,MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:r,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:e,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},wr}var Ir,Ns;function Rt(){return Ns||(Ns=1,Ir=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{}),Ir}var zs;function He(){return zs||(zs=1,(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:o}=$t(),s=Rt();t=e.exports={};const i=t.re=[],a=t.safeRe=[],c=t.src=[],u=t.safeSrc=[],l=t.t={};let f=0;const m="[a-zA-Z0-9-]",g=[["\\s",1],["\\d",o],[m,n]],C=O=>{for(const[D,K]of g)O=O.split(`${D}*`).join(`${D}{0,${K}}`).split(`${D}+`).join(`${D}{1,${K}}`);return O},_=(O,D,K)=>{const T=C(D),U=f++;s(O,U,D),l[O]=U,c[U]=D,u[U]=T,i[U]=new RegExp(D,K?"g":void 0),a[U]=new RegExp(T,K?"g":void 0)};_("NUMERICIDENTIFIER","0|[1-9]\\d*"),_("NUMERICIDENTIFIERLOOSE","\\d+"),_("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${m}*`),_("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),_("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASEIDENTIFIER",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIER]})`),_("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NONNUMERICIDENTIFIER]}|${c[l.NUMERICIDENTIFIERLOOSE]})`),_("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),_("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),_("BUILDIDENTIFIER",`${m}+`),_("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),_("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),_("FULL",`^${c[l.FULLPLAIN]}$`),_("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),_("LOOSE",`^${c[l.LOOSEPLAIN]}$`),_("GTLT","((?:<|>)?=?)"),_("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),_("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),_("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),_("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),_("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),_("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),_("COERCEPLAIN",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?`),_("COERCE",`${c[l.COERCEPLAIN]}(?:$|[^\\d])`),_("COERCEFULL",c[l.COERCEPLAIN]+`(?:${c[l.PRERELEASE]})?(?:${c[l.BUILD]})?(?:$|[^\\d])`),_("COERCERTL",c[l.COERCE],!0),_("COERCERTLFULL",c[l.COERCEFULL],!0),_("LONETILDE","(?:~>?)"),_("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",_("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),_("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),_("LONECARET","(?:\\^)"),_("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",_("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),_("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),_("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),_("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),_("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",_("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),_("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),_("STAR","(<|>)?=?\\s*\\*"),_("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),_("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(At,At.exports)),At.exports}var kr,Ls;function Cr(){if(Ls)return kr;Ls=1;const e=Object.freeze({loose:!0}),t=Object.freeze({});return kr=n=>n?typeof n!="object"?e:n:t,kr}var Pr,xs;function Ts(){if(xs)return Pr;xs=1;const e=/^[0-9]+$/,t=(n,o)=>{if(typeof n=="number"&&typeof o=="number")return n===o?0:n<o?-1:1;const s=e.test(n),i=e.test(o);return s&&i&&(n=+n,o=+o),n===o?0:s&&!i?-1:i&&!s?1:n<o?-1:1};return Pr={compareIdentifiers:t,rcompareIdentifiers:(n,o)=>t(o,n)},Pr}var Or,qs;function ne(){if(qs)return Or;qs=1;const e=Rt(),{MAX_LENGTH:t,MAX_SAFE_INTEGER:r}=$t(),{safeRe:n,t:o}=He(),s=Cr(),{compareIdentifiers:i}=Ts();class a{constructor(u,l){if(l=s(l),u instanceof a){if(u.loose===!!l.loose&&u.includePrerelease===!!l.includePrerelease)return u;u=u.version}else if(typeof u!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof u}".`);if(u.length>t)throw new TypeError(`version is longer than ${t} characters`);e("SemVer",u,l),this.options=l,this.loose=!!l.loose,this.includePrerelease=!!l.includePrerelease;const f=u.trim().match(l.loose?n[o.LOOSE]:n[o.FULL]);if(!f)throw new TypeError(`Invalid Version: ${u}`);if(this.raw=u,this.major=+f[1],this.minor=+f[2],this.patch=+f[3],this.major>r||this.major<0)throw new TypeError("Invalid major version");if(this.minor>r||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>r||this.patch<0)throw new TypeError("Invalid patch version");f[4]?this.prerelease=f[4].split(".").map(m=>{if(/^[0-9]+$/.test(m)){const g=+m;if(g>=0&&g<r)return g}return m}):this.prerelease=[],this.build=f[5]?f[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(u){if(e("SemVer.compare",this.version,this.options,u),!(u instanceof a)){if(typeof u=="string"&&u===this.version)return 0;u=new a(u,this.options)}return u.version===this.version?0:this.compareMain(u)||this.comparePre(u)}compareMain(u){return u instanceof a||(u=new a(u,this.options)),this.major<u.major?-1:this.major>u.major?1:this.minor<u.minor?-1:this.minor>u.minor?1:this.patch<u.patch?-1:this.patch>u.patch?1:0}comparePre(u){if(u instanceof a||(u=new a(u,this.options)),this.prerelease.length&&!u.prerelease.length)return-1;if(!this.prerelease.length&&u.prerelease.length)return 1;if(!this.prerelease.length&&!u.prerelease.length)return 0;let l=0;do{const f=this.prerelease[l],m=u.prerelease[l];if(e("prerelease compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}compareBuild(u){u instanceof a||(u=new a(u,this.options));let l=0;do{const f=this.build[l],m=u.build[l];if(e("build compare",l,f,m),f===void 0&&m===void 0)return 0;if(m===void 0)return 1;if(f===void 0)return-1;if(f===m)continue;return i(f,m)}while(++l)}inc(u,l,f){if(u.startsWith("pre")){if(!l&&f===!1)throw new Error("invalid increment argument: identifier is empty");if(l){const m=`-${l}`.match(this.options.loose?n[o.PRERELEASELOOSE]:n[o.PRERELEASE]);if(!m||m[1]!==l)throw new Error(`invalid identifier: ${l}`)}}switch(u){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",l,f);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",l,f);break;case"prepatch":this.prerelease.length=0,this.inc("patch",l,f),this.inc("pre",l,f);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",l,f),this.inc("pre",l,f);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const m=Number(f)?1:0;if(this.prerelease.length===0)this.prerelease=[m];else{let g=this.prerelease.length;for(;--g>=0;)typeof this.prerelease[g]=="number"&&(this.prerelease[g]++,g=-2);if(g===-1){if(l===this.prerelease.join(".")&&f===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(m)}}if(l){let g=[l,m];f===!1&&(g=[l]),i(this.prerelease[0],l)===0?isNaN(this.prerelease[1])&&(this.prerelease=g):this.prerelease=g}break}default:throw new Error(`invalid increment argument: ${u}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}return Or=a,Or}var Nr,Zs;function Ze(){if(Zs)return Nr;Zs=1;const e=ne();return Nr=(r,n,o=!1)=>{if(r instanceof e)return r;try{return new e(r,n)}catch(s){if(!o)return null;throw s}},Nr}var zr,Ds;function Jd(){if(Ds)return zr;Ds=1;const e=Ze();return zr=(r,n)=>{const o=e(r,n);return o?o.version:null},zr}var Lr,js;function Md(){if(js)return Lr;js=1;const e=Ze();return Lr=(r,n)=>{const o=e(r.trim().replace(/^[=v]+/,""),n);return o?o.version:null},Lr}var xr,Bs;function Wd(){if(Bs)return xr;Bs=1;const e=ne();return xr=(r,n,o,s,i)=>{typeof o=="string"&&(i=s,s=o,o=void 0);try{return new e(r instanceof e?r.version:r,o).inc(n,s,i).version}catch{return null}},xr}var Tr,Us;function Gd(){if(Us)return Tr;Us=1;const e=Ze();return Tr=(r,n)=>{const o=e(r,null,!0),s=e(n,null,!0),i=o.compare(s);if(i===0)return null;const a=i>0,c=a?o:s,u=a?s:o,l=!!c.prerelease.length;if(!!u.prerelease.length&&!l){if(!u.patch&&!u.minor)return"major";if(u.compareMain(c)===0)return u.minor&&!u.patch?"minor":"patch"}const m=l?"pre":"";return o.major!==s.major?m+"major":o.minor!==s.minor?m+"minor":o.patch!==s.patch?m+"patch":"prerelease"},Tr}var qr,Vs;function Xd(){if(Vs)return qr;Vs=1;const e=ne();return qr=(r,n)=>new e(r,n).major,qr}var Zr,Fs;function Hd(){if(Fs)return Zr;Fs=1;const e=ne();return Zr=(r,n)=>new e(r,n).minor,Zr}var Dr,Js;function Yd(){if(Js)return Dr;Js=1;const e=ne();return Dr=(r,n)=>new e(r,n).patch,Dr}var jr,Ms;function Kd(){if(Ms)return jr;Ms=1;const e=Ze();return jr=(r,n)=>{const o=e(r,n);return o&&o.prerelease.length?o.prerelease:null},jr}var Br,Ws;function le(){if(Ws)return Br;Ws=1;const e=ne();return Br=(r,n,o)=>new e(r,o).compare(new e(n,o)),Br}var Ur,Gs;function Qd(){if(Gs)return Ur;Gs=1;const e=le();return Ur=(r,n,o)=>e(n,r,o),Ur}var Vr,Xs;function eg(){if(Xs)return Vr;Xs=1;const e=le();return Vr=(r,n)=>e(r,n,!0),Vr}var Fr,Hs;function Jr(){if(Hs)return Fr;Hs=1;const e=ne();return Fr=(r,n,o)=>{const s=new e(r,o),i=new e(n,o);return s.compare(i)||s.compareBuild(i)},Fr}var Mr,Ys;function tg(){if(Ys)return Mr;Ys=1;const e=Jr();return Mr=(r,n)=>r.sort((o,s)=>e(o,s,n)),Mr}var Wr,Ks;function rg(){if(Ks)return Wr;Ks=1;const e=Jr();return Wr=(r,n)=>r.sort((o,s)=>e(s,o,n)),Wr}var Gr,Qs;function wt(){if(Qs)return Gr;Qs=1;const e=le();return Gr=(r,n,o)=>e(r,n,o)>0,Gr}var Xr,ei;function Hr(){if(ei)return Xr;ei=1;const e=le();return Xr=(r,n,o)=>e(r,n,o)<0,Xr}var Yr,ti;function ri(){if(ti)return Yr;ti=1;const e=le();return Yr=(r,n,o)=>e(r,n,o)===0,Yr}var Kr,ni;function oi(){if(ni)return Kr;ni=1;const e=le();return Kr=(r,n,o)=>e(r,n,o)!==0,Kr}var Qr,si;function en(){if(si)return Qr;si=1;const e=le();return Qr=(r,n,o)=>e(r,n,o)>=0,Qr}var tn,ii;function rn(){if(ii)return tn;ii=1;const e=le();return tn=(r,n,o)=>e(r,n,o)<=0,tn}var nn,ai;function ci(){if(ai)return nn;ai=1;const e=ri(),t=oi(),r=wt(),n=en(),o=Hr(),s=rn();return nn=(a,c,u,l)=>{switch(c){case"===":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a===u;case"!==":return typeof a=="object"&&(a=a.version),typeof u=="object"&&(u=u.version),a!==u;case"":case"=":case"==":return e(a,u,l);case"!=":return t(a,u,l);case">":return r(a,u,l);case">=":return n(a,u,l);case"<":return o(a,u,l);case"<=":return s(a,u,l);default:throw new TypeError(`Invalid operator: ${c}`)}},nn}var on,ui;function ng(){if(ui)return on;ui=1;const e=ne(),t=Ze(),{safeRe:r,t:n}=He();return on=(s,i)=>{if(s instanceof e)return s;if(typeof s=="number"&&(s=String(s)),typeof s!="string")return null;i=i||{};let a=null;if(!i.rtl)a=s.match(i.includePrerelease?r[n.COERCEFULL]:r[n.COERCE]);else{const g=i.includePrerelease?r[n.COERCERTLFULL]:r[n.COERCERTL];let C;for(;(C=g.exec(s))&&(!a||a.index+a[0].length!==s.length);)(!a||C.index+C[0].length!==a.index+a[0].length)&&(a=C),g.lastIndex=C.index+C[1].length+C[2].length;g.lastIndex=-1}if(a===null)return null;const c=a[2],u=a[3]||"0",l=a[4]||"0",f=i.includePrerelease&&a[5]?`-${a[5]}`:"",m=i.includePrerelease&&a[6]?`+${a[6]}`:"";return t(`${c}.${u}.${l}${f}${m}`,i)},on}var sn,li;function og(){if(li)return sn;li=1;class e{constructor(){this.max=1e3,this.map=new Map}get(r){const n=this.map.get(r);if(n!==void 0)return this.map.delete(r),this.map.set(r,n),n}delete(r){return this.map.delete(r)}set(r,n){if(!this.delete(r)&&n!==void 0){if(this.map.size>=this.max){const s=this.map.keys().next().value;this.delete(s)}this.map.set(r,n)}return this}}return sn=e,sn}var an,pi;function pe(){if(pi)return an;pi=1;const e=/\s+/g;class t{constructor(y,k){if(k=o(k),y instanceof t)return y.loose===!!k.loose&&y.includePrerelease===!!k.includePrerelease?y:new t(y.raw,k);if(y instanceof s)return this.raw=y.value,this.set=[[y]],this.formatted=void 0,this;if(this.options=k,this.loose=!!k.loose,this.includePrerelease=!!k.includePrerelease,this.raw=y.trim().replace(e," "),this.set=this.raw.split("||").map(R=>this.parseRange(R.trim())).filter(R=>R.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const R=this.set[0];if(this.set=this.set.filter(P=>!_(P[0])),this.set.length===0)this.set=[R];else if(this.set.length>1){for(const P of this.set)if(P.length===1&&O(P[0])){this.set=[P];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let y=0;y<this.set.length;y++){y>0&&(this.formatted+="||");const k=this.set[y];for(let R=0;R<k.length;R++)R>0&&(this.formatted+=" "),this.formatted+=k[R].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(y){const R=((this.options.includePrerelease&&g)|(this.options.loose&&C))+":"+y,P=n.get(R);if(P)return P;const w=this.options.loose,N=w?c[u.HYPHENRANGELOOSE]:c[u.HYPHENRANGE];y=y.replace(N,Rn(this.options.includePrerelease)),i("hyphen replace",y),y=y.replace(c[u.COMPARATORTRIM],l),i("comparator trim",y),y=y.replace(c[u.TILDETRIM],f),i("tilde trim",y),y=y.replace(c[u.CARETTRIM],m),i("caret trim",y);let j=y.split(" ").map(ee=>K(ee,this.options)).join(" ").split(/\s+/).map(ee=>$n(ee,this.options));w&&(j=j.filter(ee=>(i("loose invalid filter",ee,this.options),!!ee.match(c[u.COMPARATORLOOSE])))),i("range list",j);const q=new Map,J=j.map(ee=>new s(ee,this.options));for(const ee of J){if(_(ee))return[ee];q.set(ee.value,ee)}q.size>1&&q.has("")&&q.delete("");const oe=[...q.values()];return n.set(R,oe),oe}intersects(y,k){if(!(y instanceof t))throw new TypeError("a Range is required");return this.set.some(R=>D(R,k)&&y.set.some(P=>D(P,k)&&R.every(w=>P.every(N=>w.intersects(N,k)))))}test(y){if(!y)return!1;if(typeof y=="string")try{y=new a(y,this.options)}catch{return!1}for(let k=0;k<this.set.length;k++)if(wn(this.set[k],y,this.options))return!0;return!1}}an=t;const r=og(),n=new r,o=Cr(),s=It(),i=Rt(),a=ne(),{safeRe:c,t:u,comparatorTrimReplace:l,tildeTrimReplace:f,caretTrimReplace:m}=He(),{FLAG_INCLUDE_PRERELEASE:g,FLAG_LOOSE:C}=$t(),_=E=>E.value==="<0.0.0-0",O=E=>E.value==="",D=(E,y)=>{let k=!0;const R=E.slice();let P=R.pop();for(;k&&R.length;)k=R.every(w=>P.intersects(w,y)),P=R.pop();return k},K=(E,y)=>(E=E.replace(c[u.BUILD],""),i("comp",E,y),E=G(E,y),i("caret",E),E=U(E,y),i("tildes",E),E=z(E,y),i("xrange",E),E=An(E,y),i("stars",E),E),T=E=>!E||E.toLowerCase()==="x"||E==="*",U=(E,y)=>E.trim().split(/\s+/).map(k=>Q(k,y)).join(" "),Q=(E,y)=>{const k=y.loose?c[u.TILDELOOSE]:c[u.TILDE];return E.replace(k,(R,P,w,N,j)=>{i("tilde",E,R,P,w,N,j);let q;return T(P)?q="":T(w)?q=`>=${P}.0.0 <${+P+1}.0.0-0`:T(N)?q=`>=${P}.${w}.0 <${P}.${+w+1}.0-0`:j?(i("replaceTilde pr",j),q=`>=${P}.${w}.${N}-${j} <${P}.${+w+1}.0-0`):q=`>=${P}.${w}.${N} <${P}.${+w+1}.0-0`,i("tilde return",q),q})},G=(E,y)=>E.trim().split(/\s+/).map(k=>re(k,y)).join(" "),re=(E,y)=>{i("caret",E,y);const k=y.loose?c[u.CARETLOOSE]:c[u.CARET],R=y.includePrerelease?"-0":"";return E.replace(k,(P,w,N,j,q)=>{i("caret",E,P,w,N,j,q);let J;return T(w)?J="":T(N)?J=`>=${w}.0.0${R} <${+w+1}.0.0-0`:T(j)?w==="0"?J=`>=${w}.${N}.0${R} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.0${R} <${+w+1}.0.0-0`:q?(i("replaceCaret pr",q),w==="0"?N==="0"?J=`>=${w}.${N}.${j}-${q} <${w}.${N}.${+j+1}-0`:J=`>=${w}.${N}.${j}-${q} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.${j}-${q} <${+w+1}.0.0-0`):(i("no pr"),w==="0"?N==="0"?J=`>=${w}.${N}.${j}${R} <${w}.${N}.${+j+1}-0`:J=`>=${w}.${N}.${j}${R} <${w}.${+N+1}.0-0`:J=`>=${w}.${N}.${j} <${+w+1}.0.0-0`),i("caret return",J),J})},z=(E,y)=>(i("replaceXRanges",E,y),E.split(/\s+/).map(k=>Ye(k,y)).join(" ")),Ye=(E,y)=>{E=E.trim();const k=y.loose?c[u.XRANGELOOSE]:c[u.XRANGE];return E.replace(k,(R,P,w,N,j,q)=>{i("xRange",E,R,P,w,N,j,q);const J=T(w),oe=J||T(N),ee=oe||T(j),Ke=ee;return P==="="&&Ke&&(P=""),q=y.includePrerelease?"-0":"",J?P===">"||P==="<"?R="<0.0.0-0":R="*":P&&Ke?(oe&&(N=0),j=0,P===">"?(P=">=",oe?(w=+w+1,N=0,j=0):(N=+N+1,j=0)):P==="<="&&(P="<",oe?w=+w+1:N=+N+1),P==="<"&&(q="-0"),R=`${P+w}.${N}.${j}${q}`):oe?R=`>=${w}.0.0${q} <${+w+1}.0.0-0`:ee&&(R=`>=${w}.${N}.0${q} <${w}.${+N+1}.0-0`),i("xRange return",R),R})},An=(E,y)=>(i("replaceStars",E,y),E.trim().replace(c[u.STAR],"")),$n=(E,y)=>(i("replaceGTE0",E,y),E.trim().replace(c[y.includePrerelease?u.GTE0PRE:u.GTE0],"")),Rn=E=>(y,k,R,P,w,N,j,q,J,oe,ee,Ke)=>(T(R)?k="":T(P)?k=`>=${R}.0.0${E?"-0":""}`:T(w)?k=`>=${R}.${P}.0${E?"-0":""}`:N?k=`>=${k}`:k=`>=${k}${E?"-0":""}`,T(J)?q="":T(oe)?q=`<${+J+1}.0.0-0`:T(ee)?q=`<${J}.${+oe+1}.0-0`:Ke?q=`<=${J}.${oe}.${ee}-${Ke}`:E?q=`<${J}.${oe}.${+ee+1}-0`:q=`<=${q}`,`${k} ${q}`.trim()),wn=(E,y,k)=>{for(let R=0;R<E.length;R++)if(!E[R].test(y))return!1;if(y.prerelease.length&&!k.includePrerelease){for(let R=0;R<E.length;R++)if(i(E[R].semver),E[R].semver!==s.ANY&&E[R].semver.prerelease.length>0){const P=E[R].semver;if(P.major===y.major&&P.minor===y.minor&&P.patch===y.patch)return!0}return!1}return!0};return an}var cn,hi;function It(){if(hi)return cn;hi=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(l,f){if(f=r(f),l instanceof t){if(l.loose===!!f.loose)return l;l=l.value}l=l.trim().split(/\s+/).join(" "),i("comparator",l,f),this.options=f,this.loose=!!f.loose,this.parse(l),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(l){const f=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR],m=l.match(f);if(!m)throw new TypeError(`Invalid comparator: ${l}`);this.operator=m[1]!==void 0?m[1]:"",this.operator==="="&&(this.operator=""),m[2]?this.semver=new a(m[2],this.options.loose):this.semver=e}toString(){return this.value}test(l){if(i("Comparator.test",l,this.options.loose),this.semver===e||l===e)return!0;if(typeof l=="string")try{l=new a(l,this.options)}catch{return!1}return s(l,this.operator,this.semver,this.options)}intersects(l,f){if(!(l instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(l.value,f).test(this.value):l.operator===""?l.value===""?!0:new c(this.value,f).test(l.semver):(f=r(f),f.includePrerelease&&(this.value==="<0.0.0-0"||l.value==="<0.0.0-0")||!f.includePrerelease&&(this.value.startsWith("<0.0.0")||l.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&l.operator.startsWith(">")||this.operator.startsWith("<")&&l.operator.startsWith("<")||this.semver.version===l.semver.version&&this.operator.includes("=")&&l.operator.includes("=")||s(this.semver,"<",l.semver,f)&&this.operator.startsWith(">")&&l.operator.startsWith("<")||s(this.semver,">",l.semver,f)&&this.operator.startsWith("<")&&l.operator.startsWith(">")))}}cn=t;const r=Cr(),{safeRe:n,t:o}=He(),s=ci(),i=Rt(),a=ne(),c=pe();return cn}var un,fi;function kt(){if(fi)return un;fi=1;const e=pe();return un=(r,n,o)=>{try{n=new e(n,o)}catch{return!1}return n.test(r)},un}var ln,mi;function sg(){if(mi)return ln;mi=1;const e=pe();return ln=(r,n)=>new e(r,n).set.map(o=>o.map(s=>s.value).join(" ").trim().split(" ")),ln}var pn,di;function ig(){if(di)return pn;di=1;const e=ne(),t=pe();return pn=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===-1)&&(i=u,a=new e(i,s))}),i},pn}var hn,gi;function ag(){if(gi)return hn;gi=1;const e=ne(),t=pe();return hn=(n,o,s)=>{let i=null,a=null,c=null;try{c=new t(o,s)}catch{return null}return n.forEach(u=>{c.test(u)&&(!i||a.compare(u)===1)&&(i=u,a=new e(i,s))}),i},hn}var fn,vi;function cg(){if(vi)return fn;vi=1;const e=ne(),t=pe(),r=wt();return fn=(o,s)=>{o=new t(o,s);let i=new e("0.0.0");if(o.test(i)||(i=new e("0.0.0-0"),o.test(i)))return i;i=null;for(let a=0;a<o.set.length;++a){const c=o.set[a];let u=null;c.forEach(l=>{const f=new e(l.semver.version);switch(l.operator){case">":f.prerelease.length===0?f.patch++:f.prerelease.push(0),f.raw=f.format();case"":case">=":(!u||r(f,u))&&(u=f);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${l.operator}`)}}),u&&(!i||r(i,u))&&(i=u)}return i&&o.test(i)?i:null},fn}var mn,bi;function ug(){if(bi)return mn;bi=1;const e=pe();return mn=(r,n)=>{try{return new e(r,n).range||"*"}catch{return null}},mn}var dn,_i;function gn(){if(_i)return dn;_i=1;const e=ne(),t=It(),{ANY:r}=t,n=pe(),o=kt(),s=wt(),i=Hr(),a=rn(),c=en();return dn=(l,f,m,g)=>{l=new e(l,g),f=new n(f,g);let C,_,O,D,K;switch(m){case">":C=s,_=a,O=i,D=">",K=">=";break;case"<":C=i,_=c,O=s,D="<",K="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(o(l,f,g))return!1;for(let T=0;T<f.set.length;++T){const U=f.set[T];let Q=null,G=null;if(U.forEach(re=>{re.semver===r&&(re=new t(">=0.0.0")),Q=Q||re,G=G||re,C(re.semver,Q.semver,g)?Q=re:O(re.semver,G.semver,g)&&(G=re)}),Q.operator===D||Q.operator===K||(!G.operator||G.operator===D)&&_(l,G.semver))return!1;if(G.operator===K&&O(l,G.semver))return!1}return!0},dn}var vn,yi;function lg(){if(yi)return vn;yi=1;const e=gn();return vn=(r,n,o)=>e(r,n,">",o),vn}var bn,Si;function pg(){if(Si)return bn;Si=1;const e=gn();return bn=(r,n,o)=>e(r,n,"<",o),bn}var _n,Ei;function hg(){if(Ei)return _n;Ei=1;const e=pe();return _n=(r,n,o)=>(r=new e(r,o),n=new e(n,o),r.intersects(n,o)),_n}var yn,Ai;function fg(){if(Ai)return yn;Ai=1;const e=kt(),t=le();return yn=(r,n,o)=>{const s=[];let i=null,a=null;const c=r.sort((m,g)=>t(m,g,o));for(const m of c)e(m,n,o)?(a=m,i||(i=m)):(a&&s.push([i,a]),a=null,i=null);i&&s.push([i,null]);const u=[];for(const[m,g]of s)m===g?u.push(m):!g&&m===c[0]?u.push("*"):g?m===c[0]?u.push(`<=${g}`):u.push(`${m} - ${g}`):u.push(`>=${m}`);const l=u.join(" || "),f=typeof n.raw=="string"?n.raw:String(n);return l.length<f.length?l:n},yn}var Sn,$i;function mg(){if($i)return Sn;$i=1;const e=pe(),t=It(),{ANY:r}=t,n=kt(),o=le(),s=(f,m,g={})=>{if(f===m)return!0;f=new e(f,g),m=new e(m,g);let C=!1;e:for(const _ of f.set){for(const O of m.set){const D=c(_,O,g);if(C=C||D!==null,D)continue e}if(C)return!1}return!0},i=[new t(">=0.0.0-0")],a=[new t(">=0.0.0")],c=(f,m,g)=>{if(f===m)return!0;if(f.length===1&&f[0].semver===r){if(m.length===1&&m[0].semver===r)return!0;g.includePrerelease?f=i:f=a}if(m.length===1&&m[0].semver===r){if(g.includePrerelease)return!0;m=a}const C=new Set;let _,O;for(const z of f)z.operator===">"||z.operator===">="?_=u(_,z,g):z.operator==="<"||z.operator==="<="?O=l(O,z,g):C.add(z.semver);if(C.size>1)return null;let D;if(_&&O){if(D=o(_.semver,O.semver,g),D>0)return null;if(D===0&&(_.operator!==">="||O.operator!=="<="))return null}for(const z of C){if(_&&!n(z,String(_),g)||O&&!n(z,String(O),g))return null;for(const Ye of m)if(!n(z,String(Ye),g))return!1;return!0}let K,T,U,Q,G=O&&!g.includePrerelease&&O.semver.prerelease.length?O.semver:!1,re=_&&!g.includePrerelease&&_.semver.prerelease.length?_.semver:!1;G&&G.prerelease.length===1&&O.operator==="<"&&G.prerelease[0]===0&&(G=!1);for(const z of m){if(Q=Q||z.operator===">"||z.operator===">=",U=U||z.operator==="<"||z.operator==="<=",_){if(re&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===re.major&&z.semver.minor===re.minor&&z.semver.patch===re.patch&&(re=!1),z.operator===">"||z.operator===">="){if(K=u(_,z,g),K===z&&K!==_)return!1}else if(_.operator===">="&&!n(_.semver,String(z),g))return!1}if(O){if(G&&z.semver.prerelease&&z.semver.prerelease.length&&z.semver.major===G.major&&z.semver.minor===G.minor&&z.semver.patch===G.patch&&(G=!1),z.operator==="<"||z.operator==="<="){if(T=l(O,z,g),T===z&&T!==O)return!1}else if(O.operator==="<="&&!n(O.semver,String(z),g))return!1}if(!z.operator&&(O||_)&&D!==0)return!1}return!(_&&U&&!O&&D!==0||O&&Q&&!_&&D!==0||re||G)},u=(f,m,g)=>{if(!f)return m;const C=o(f.semver,m.semver,g);return C>0?f:C<0||m.operator===">"&&f.operator===">="?m:f},l=(f,m,g)=>{if(!f)return m;const C=o(f.semver,m.semver,g);return C<0?f:C>0||m.operator==="<"&&f.operator==="<="?m:f};return Sn=s,Sn}var En,Ri;function dg(){if(Ri)return En;Ri=1;const e=He(),t=$t(),r=ne(),n=Ts(),o=Ze(),s=Jd(),i=Md(),a=Wd(),c=Gd(),u=Xd(),l=Hd(),f=Yd(),m=Kd(),g=le(),C=Qd(),_=eg(),O=Jr(),D=tg(),K=rg(),T=wt(),U=Hr(),Q=ri(),G=oi(),re=en(),z=rn(),Ye=ci(),An=ng(),$n=It(),Rn=pe(),wn=kt(),E=sg(),y=ig(),k=ag(),R=cg(),P=ug(),w=gn(),N=lg(),j=pg(),q=hg(),J=fg(),oe=mg();return En={parse:o,valid:s,clean:i,inc:a,diff:c,major:u,minor:l,patch:f,prerelease:m,compare:g,rcompare:C,compareLoose:_,compareBuild:O,sort:D,rsort:K,gt:T,lt:U,eq:Q,neq:G,gte:re,lte:z,cmp:Ye,coerce:An,Comparator:$n,Range:Rn,satisfies:wn,toComparators:E,maxSatisfying:y,minSatisfying:k,minVersion:R,validRange:P,outside:w,gtr:N,ltr:j,intersects:q,simplifyRange:J,subset:oe,SemVer:r,re:e.re,src:e.src,tokens:e.t,SEMVER_SPEC_VERSION:t.SEMVER_SPEC_VERSION,RELEASE_TYPES:t.RELEASE_TYPES,compareIdentifiers:n.compareIdentifiers,rcompareIdentifiers:n.rcompareIdentifiers},En}var gg=dg();const vg=(e,t)=>bg(t)?t.hostnames.includes(new URL(e).hostname):_g(t)?!!e.match(t.regexp):!1,bg=e=>Er.safeParse(e).success,_g=e=>Ar.safeParse(e).success,yg=(e,t)=>t?gg.satisfies(e,t):!0,Sg=(e,t,r)=>yg(t,r.libraryVersionRange)&&vg(e,r.matcher),Eg=(e,t)=>e.siteRegistrations.filter(r=>Sg(t,Sr(),r)),Ag=(e,t)=>Eg(e,t).flatMap(({parsers:o,name:s})=>o.filter(i=>Cs(i)&&i in yr).map(i=>({parser:yr[i],parserType:i,name:s}))),wi=(e,t)=>{const r=Ag(e,t.url);for(const{parser:n,parserType:o,name:s}of r){const i=n(t);if(dt(i)||Ho(i)||Yo(i))return{...i,meta:{parserName:s,parserType:o,uri:t.url,referrer:t.url}}}return{...Go(),meta:{parserName:null,parserType:L.NoResourceFound,uri:t.url,referrer:t.url}}},$g=(e,t)=>{const r=wi(e,t),{uri:n,...o}=r.meta;return{...r,meta:o}},Rg=(e,t)=>{switch(t){case ye.CA:return new URL(`https://${e}.rl.ca.talis.com`);default:return new URL(`https://${e}.rl.talis.com`)}},wg=(e,t)=>{const r=Rg(e,t);return new URL("/ui/forms/bookmarklet.html",r)},Ig=(e,t,r)=>{const n=Io(t);n.append("fast","true"),n.append("breakout","true"),r&&(r.parserName&&n.append("targetTitle",r.parserName),n.append("referrer",r.referrer));const o=new URL(e.toString());return o.search=n.toString(),o};b.BookGenresSchema=ql,b.CustomerListSchema=No,b.CustomerSchema=Jt,b.DirectLinkOnlyResultSchema=Xt,b.Genre=S,b.HostnamesMatcherSchema=Er,b.JournalGenresSchema=Zl,b.NON_OPENURL_PROPERTIES=Vt,b.NonOpenUrlPropertiesSchema=Bt,b.NothingParsedResultSchema=Gt,b.OPENURL_KEYS=Ro,b.OpenUrlAudioVisualResourceSchema=Bl,b.OpenUrlBookResourceSchema=Dl,b.OpenUrlDocumentResourceSchema=Vl,b.OpenUrlImageResourceSchema=Ul,b.OpenUrlJournalResourceSchema=jl,b.OpenUrlResourceSchema=de,b.OpenUrlResultSchema=Ht,b.OpenUrlWebpageResourceSchema=Fl,b.PARSERS=yr,b.ParserRegistrySchema=ks,b.ParserType=L,b.ParsingMetadataSchema=Mt,b.ParsingMetadataV2Schema=Wt,b.ParsingRequestSchema=Oo,b.ParsingResponseSchema=To,b.ParsingResponseV2Schema=qo,b.ParsingResultSchema=pt,b.REGISTRY=Dd,b.RegExpMatcherSchema=Ar,b.ResourceDataSchema=Ps,b.ResourceSchema=Eo,b.SiteRegistrationSchema=Rr,b.SummonSearchResultSchema=Kt,b.TenantRegion=ye,b.TenantRegistrySchema=Hl,b.TenantSchema=Ft,b.UrlMatcherSchema=$r,b.Z3988SearchResultSchema=Yt,b.convertCustomerListToTenantRegistry=Ql,b.createAudioVisual=me,b.createBook=F,b.createDocument=Ut,b.createImage=Ao,b.createJournal=Z,b.createWebpage=lt,b.directLinkOnly=tp,b.fromOpenUrl=Co,b.getBaseBookmarkingUrl=wg,b.getLibraryVersion=Sr,b.isCustomer=zo,b.isCustomerList=Lo,b.isDirectLinkOnlyResult=Rh,b.isGenre=Xl,b.isNothingParsedResult=wh,b.isOpenUrlResult=dt,b.isParserRegistry=jd,b.isParserType=Cs,b.isParsingMetadata=Ah,b.isParsingMetadataV2=$h,b.isParsingRequest=Yl,b.isParsingResponse=Sh,b.isParsingResponseV2=Eh,b.isParsingResult=yh,b.isResourceData=Fd,b.isSiteRegistration=Bd,b.isSummonSearchResult=Yo,b.isTenant=xo,b.isTenantRegion=Kl,b.isUrlMatcher=Ud,b.isZ3988SearchResult=Ho,b.nothingParsed=x,b.openUrlResource=A,b.parseResource=wi,b.parseResourceV2=$g,b.summonSearchResult=Do,b.toBookmarkingWorkflowUrl=Ig,b.toOpenUrl=Io,b.z3988SearchResult=Zo,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"})}));
|