315 lines
455 KiB
JavaScript
315 lines
455 KiB
JavaScript
|
|
var e=Object.defineProperty,t=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},n=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};let r=require("obsidian");var i=globalThis.process?.env?.NODE_ENV,a=i&&!i.toLowerCase().startsWith(`prod`),o=Array.isArray,s=Array.prototype.indexOf,c=Array.prototype.includes,l=Array.from,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,p=Object.prototype,m=Array.prototype,h=Object.getPrototypeOf,g=Object.isExtensible;function _(e){return typeof e==`function`}var v=()=>{};function y(e){return e()}function b(e){for(var t=0;t<e.length;t++)e[t]()}function x(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function S(e){"@babel/helpers - typeof";return S=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},S(e)}function ee(e,t){if(S(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(S(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function te(e){var t=ee(e,`string`);return S(t)==`symbol`?t:t+``}function ne(e,t,n){return(t=te(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var re=1024,ie=2048,ae=4096,oe=8192,se=16384,ce=32768,le=1<<25,ue=65536,de=1<<19,fe=1<<20,pe=1<<25,me=65536,he=1<<21,ge=1<<22,_e=1<<23,ve=Symbol(`$state`),ye=Symbol(`legacy props`),be=Symbol(``),xe=Symbol(`proxy path`),Se=Symbol(`attributes`),Ce=Symbol(`class`),we=Symbol(`style`),Te=Symbol(`text`),Ee=Symbol(`hmr anchor`),De=new class extends Error{constructor(...e){super(...e),ne(this,`name`,`StaleReactionError`),ne(this,`message`,"The reaction that called `getAbortSignal()` was re-run or destroyed")}},Oe=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ke(e){return e===this.v}function Ae(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function je(e){return!Ae(e,this.v)}function Me(e){if(a){let t=Error(`lifecycle_outside_component\n\`${e}(...)\` can only be used during component initialisation\nhttps://svelte.dev/e/lifecycle_outside_component`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function Ne(){if(a){let e=Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/async_derived_orphan`)}function Pe(){if(a){let e=Error(`derived_references_self
|
|||
|
|
A derived value cannot reference itself recursively
|
|||
|
|
https://svelte.dev/e/derived_references_self`);throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/derived_references_self`)}function Fe(e,t,n){if(a){let r=Error(`each_key_duplicate\n${n?`Keyed each block has duplicate key \`${n}\` at indexes ${e} and ${t}`:`Keyed each block has duplicate key at indexes ${e} and ${t}`}\nhttps://svelte.dev/e/each_key_duplicate`);throw r.name=`Svelte error`,r}throw Error(`https://svelte.dev/e/each_key_duplicate`)}function Ie(e,t,n){if(a){let r=Error(`each_key_volatile\nKeyed each block has key that is not idempotent — the key for item at index ${e} was \`${t}\` but is now \`${n}\`. Keys must be the same each time for a given item\nhttps://svelte.dev/e/each_key_volatile`);throw r.name=`Svelte error`,r}throw Error(`https://svelte.dev/e/each_key_volatile`)}function Le(e){if(a){let t=Error(`effect_in_teardown\n\`${e}\` cannot be used inside an effect cleanup function\nhttps://svelte.dev/e/effect_in_teardown`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/effect_in_teardown`)}function Re(){if(a){let e=Error(`effect_in_unowned_derived
|
|||
|
|
Effect cannot be created inside a \`$derived\` value that was not itself created inside an effect
|
|||
|
|
https://svelte.dev/e/effect_in_unowned_derived`);throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function ze(e){if(a){let t=Error(`effect_orphan\n\`${e}\` can only be used inside an effect (e.g. during component initialisation)\nhttps://svelte.dev/e/effect_orphan`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/effect_orphan`)}function Be(){if(a){let e=Error(`effect_update_depth_exceeded
|
|||
|
|
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
|
|||
|
|
https://svelte.dev/e/effect_update_depth_exceeded`);throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function Ve(e){if(a){let t=Error(`lifecycle_legacy_only\n\`${e}(...)\` cannot be used in runes mode\nhttps://svelte.dev/e/lifecycle_legacy_only`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/lifecycle_legacy_only`)}function He(e){if(a){let t=Error(`props_invalid_value\nCannot do \`bind:${e}={undefined}\` when \`${e}\` has a fallback value\nhttps://svelte.dev/e/props_invalid_value`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/props_invalid_value`)}function Ue(e){if(a){let t=Error(`rune_outside_svelte\nThe \`${e}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files\nhttps://svelte.dev/e/rune_outside_svelte`);throw t.name=`Svelte error`,t}throw Error(`https://svelte.dev/e/rune_outside_svelte`)}function We(){if(a){let e=Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ge(){if(a){let e=Error(`state_prototype_fixed
|
|||
|
|
Cannot set prototype of \`$state\` object
|
|||
|
|
https://svelte.dev/e/state_prototype_fixed`);throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function Ke(){if(a){let e=Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function qe(){if(a){let e=Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw e.name=`Svelte error`,e}throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}var Je=!1;function Ye(){Je=!0}var Xe={},Ze=Symbol(`uninitialized`),Qe=Symbol(`filename`);function $e(e,t){return e.label=t,et(e.v,t),e}function et(e,t){return e?.[xe]?.(t),e}function tt(e){let t=Error(),n=nt();return n.length===0?null:(n.unshift(`
|
|||
|
|
`),u(t,`stack`,{value:n.join(`
|
|||
|
|
`)}),u(t,`name`,{value:e}),t)}function nt(){let e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let t=Error().stack;if(Error.stackTraceLimit=e,!t)return[];let n=t.split(`
|
|||
|
|
`),r=[];for(let e=0;e<n.length;e++){let t=n[e],i=t.replaceAll(`\\`,`/`);if(t.trim()!==`Error`){if(t.includes(`validate_each_keys`))return[];i.includes(`svelte/src/internal`)||i.includes(`node_modules/.vite`)||r.push(t)}}return r}var rt=null;function it(e){rt=e}var at=null;function ot(e){at=e}var st=null;function ct(e){st=e}function lt(e,t=!1,n){rt={p:rt,i:!1,c:null,e:null,s:e,x:null,r:M,l:Je&&!t?{s:null,u:null,$:[]}:null},a&&(rt.function=n,st=n)}function ut(e){var t=rt,n=t.e;if(n!==null){t.e=null;for(var r of n)qi(r)}return e!==void 0&&(t.x=e),t.i=!0,rt=t.p,a&&(st=rt?.function??null),e??{}}function dt(){return!Je||rt!==null&&rt.l===null}var ft=[];function pt(){var e=ft;ft=[],b(e)}function mt(e){if(ft.length===0&&!vr){var t=ft;queueMicrotask(()=>{t===ft&&pt()})}ft.push(e)}var ht=!1;function gt(e){ht=e}var _t;function vt(e){if(e===null)throw Xe;return _t=e}function yt(){return vt(Lt(_t))}function C(e){if(ht){if(Lt(_t)!==null)throw Xe;_t=e}}function bt(e=1){if(ht){for(var t=e,n=_t;t--;)n=Lt(n);_t=n}}function xt(e=!0){for(var t=0,n=_t;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else(r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=Lt(n);e&&n.remove(),n=i}}function St(e){if(!e||e.nodeType!==8)throw Xe;return e.data}var Ct=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function wt(e){if(typeof e!=`object`||!e||ve in e)return e;let t=h(e);if(t!==p&&t!==m)return e;var n=new Map,r=o(e),i=si(0),s=null,c=ki,l=e=>{if(ki===c)return e();var t=_i,n=ki;yi(null),Ai(c);var r=e();return yi(t),Ai(n),r};r&&(n.set(`length`,si(e.length,s)),a&&(e=Ot(e)));var u=``;let f=!1;function g(e){if(!f){f=!0,u=e,$e(i,`${u} version`);for(let[e,t]of n)$e(t,Tt(u,e));f=!1}}return new Proxy(e,{defineProperty(e,t,r){(!(`value`in r)||r.configurable===!1||r.enumerable===!1||r.writable===!1)&&We();var i=n.get(t);return i===void 0?l(()=>{var e=si(r.value,s);return n.set(t,e),a&&typeof t==`string`&&$e(e,Tt(u,t)),e}):j(i,r.value,!0),!0},deleteProperty(e,t){var r=n.get(t);if(r===void 0){if(t in e){let e=l(()=>si(Ze,s));n.set(t,e),di(i),a&&$e(e,Tt(u,t))}}else j(r,Ze),di(i);return!0},get(t,r,i){if(r===ve)return e;if(a&&r===xe)return g;var o=n.get(r),c=r in t;if(o===void 0&&(!c||d(t,r)?.writable)&&(o=l(()=>{var e=si(wt(c?t[r]:Ze),s);return a&&$e(e,Tt(u,r)),e}),n.set(r,o)),o!==void 0){var f=N(o);return f===Ze?void 0:f}return Reflect.get(t,r,i)},getOwnPropertyDescriptor(e,t){var r=Reflect.getOwnPropertyDescriptor(e,t);if(r&&`value`in r){var i=n.get(t);i&&(r.value=N(i))}else if(r===void 0){var a=n.get(t),o=a?.v;if(a!==void 0&&o!==Ze)return{enumerable:!0,configurable:!0,value:o,writable:!0}}return r},has(e,t){if(t===ve)return!0;var r=n.get(t),i=r!==void 0&&r.v!==Ze||Reflect.has(e,t);return(r!==void 0||M!==null&&(!i||d(e,t)?.writable))&&(r===void 0&&(r=l(()=>{var n=si(i?wt(e[t]):Ze,s);return a&&$e(n,Tt(u,t)),n}),n.set(t,r)),N(r)===Ze)?!1:i},set(e,t,o,c){var f=n.get(t),p=t in e;if(r&&t===`length`)for(var m=o;m<f.v;m+=1){var h=n.get(m+``);h===void 0?m in e&&(h=l(()=>si(Ze,s)),n.set(m+``,h),a&&$e(h,Tt(u,m))):j(h,Ze)}if(f===void 0)(!p||d(e,t)?.writable)&&(f=l(()=>si(void 0,s)),a&&$e(f,Tt(u,t)),j(f,wt(o)),n.set(t,f));else{p=f.v!==Ze;var g=l(()=>wt(o));j(f,g)}var _=Reflect.getOwnPropertyDescriptor(e,t);if(_?.set&&_.set.call(c,o),!p){if(r&&typeof t==`string`){var v=n.get(`length`),y=Number(t);Number.isInteger(y)&&y>=v.v&&j(v,y+1)}di(i)}return!0},ownKeys(e){N(i);var t=Reflect.ownKeys(e).filter(e=>{var t=n.get(e);return t===void 0||t.v!==Ze});for(var[r,a]of n)a.v!==Ze&&!(r in e)&&t.push(r);return t},setPrototypeOf(){Ge()}})}function Tt(e,t){return typeof t==`symbol`?`${e}[Symbol(${t.description??``})]`:Ct.test(t)?`${e}.${t}`:/^\d+$/.test(t)?`${e}[${t}]`:`${e}['${t}']`}function Et(e){try{if(typeof e==`object`&&e&&ve in e)return e[ve]}catch{}return e}var Dt=new Set([`copyWithin`,`fill`,`pop`,`push`,`reverse`,`shift`,`sort`,`splice`,`unshift`]);function Ot(e){return new Proxy(e,{get(e,t,n){var r=Reflect.get(e,t,n);return Dt.has(t)?function(...e){ai();var t=r.apply(this,e);return ui(),t}:r}})}function kt(){let e=Array.prototype,t=Array.__svelte_cleanup;t&&t
|
|||
|
|
`).filter(e=>!e.includes(`svelte/src/internal`)).join(`
|
|||
|
|
`)}}}function qt(e){let t=Ut.get(e);t&&(u(e,`message`,{value:t.message}),u(e,`stack`,{value:t.stack}))}var Jt=~(ie|ae|re);function Yt(e,t){e.f=e.f&Jt|t}function Xt(e){e.f&512||e.deps===null?Yt(e,re):Yt(e,ae)}function Zt(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=me,Zt(t.deps))}function Qt(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Zt(e.deps),Yt(e,re)}function $t(e,t,n){if(e==null)return t(void 0),n&&n(void 0),v;let r=P(()=>e.subscribe(t,n));return r.unsubscribe?()=>r.unsubscribe():r}var en=[];function tn(e,t){return{subscribe:nn(e,t).subscribe}}function nn(e,t=v){let n=null,r=new Set;function i(t){if(Ae(e,t)&&(e=t,n)){let t=!en.length;for(let t of r)t[1](),en.push(t,e);if(t){for(let e=0;e<en.length;e+=2)en[e][0](en[e+1]);en.length=0}}}function a(t){i(t(e))}function o(o,s=v){let c=[o,s];return r.add(c),r.size===1&&(n=t(i,a)||v),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:i,update:a,subscribe:o}}function E(e){let t;return $t(e,e=>t=e)(),t}var rn=!1,an=!1,on=Symbol(`unmounted`);function sn(e,t,n){let r=n[t]??(n[t]={store:null,source:A(void 0),unsubscribe:v});if(a&&(r.source.label=t),r.store!==e&&!(on in n)){if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=v;else{var i=!0;r.unsubscribe=$t(e,e=>{i?r.source.v=e:j(r.source,e)}),i=!1}}return e&&on in n?E(e):N(r.source)}function cn(e,t){return un(e,t),t}function ln(){let e={};function t(){Gi(()=>{for(var t in e)e[t].unsubscribe();u(e,on,{enumerable:!1,value:!0})})}return[e,t]}function un(e,t){rn=!0;try{e.set(t)}finally{rn=!1}}function dn(){an=!0}function fn(e){var t=an;try{return an=!1,[e(),an]}finally{an=t}}function pn(e,t,n,r=!0){r&&n();for(var i of t)e.addEventListener(i,n);Gi(()=>{for(var r of t)e.removeEventListener(r,n)})}function mn(e){var t=_i,n=M;yi(null),bi(null);try{return e()}finally{yi(t),bi(n)}}function hn(e){let t=0,n=oi(0),r;return a&&$e(n,`createSubscriber version`),()=>{Wi()&&(N(n),ea(()=>(t===0&&(r=P(()=>e(()=>di(n)))),t+=1,()=>{mt(()=>{--t,t===0&&(r?.(),r=void 0,di(n))})})))}}function gn(e,t){if(t.has(e))throw TypeError(`Cannot initialize the same private elements twice on an object`)}function _n(e,t){gn(e,t),t.add(e)}function D(e,t,n){gn(e,t),t.set(e,n)}function vn(e,t,n){if(typeof e==`function`?e===t:e.has(t))return arguments.length<3?t:n;throw TypeError(`Private element is not present on this object`)}function O(e,t,n){return e.set(vn(e,t),n),n}function k(e,t){return e.get(vn(e,t))}var yn=ue|de;function bn(e,t,n,r){new Rn(e,t,n,r)}var xn=new WeakMap,Sn=new WeakMap,Cn=new WeakMap,wn=new WeakMap,Tn=new WeakMap,En=new WeakMap,Dn=new WeakMap,On=new WeakMap,kn=new WeakMap,An=new WeakMap,jn=new WeakMap,Mn=new WeakMap,Nn=new WeakMap,Pn=new WeakMap,Fn=new WeakMap,In=new WeakMap,Ln=new WeakSet,Rn=class{constructor(e,t,n,r){_n(this,Ln),ne(this,`parent`,void 0),ne(this,`is_pending`,!1),ne(this,`transform_error`,void 0),D(this,xn,void 0),D(this,Sn,ht?_t:null),D(this,Cn,void 0),D(this,wn,void 0),D(this,Tn,void 0),D(this,En,null),D(this,Dn,null),D(this,On,null),D(this,kn,null),D(this,An,0),D(this,jn,0),D(this,Mn,!1),D(this,Nn,new Set),D(this,Pn,new Set),D(this,Fn,null),D(this,In,hn(()=>(O(Fn,this,oi(k(An,this))),a&&$e(k(Fn,this),`$effect.pending()`),()=>{O(Fn,this,null)}))),O(xn,this,e),O(Cn,this,t),O(wn,this,e=>{var t=M;t.b=this,t.f|=128,n(e)}),this.parent=M.b,this.transform_error=r??this.parent?.transform_error??(e=>e),O(Tn,this,na(()=>{if(ht){let e=k(Sn,this);yt();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));vn(Ln,this,Bn).call(this,t)}else t?vn(Ln,this,Hn).call(this):vn(Ln,this,zn).call(this)}else vn(Ln,this,Un).call(this)},yn)),ht&&O(xn,this,_t)}defer_effect(e){Qt(e,k(Nn,this),k(Pn,this))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!k(Cn,this).pending}update_pending_count(e,t){vn(Ln,this,Kn).call(this,e,t),O(An,this,k(An,this)+e),!(!k(Fn,this)||k(Mn,this))&&(O(Mn,this,!0),mt(()=>{O(Mn,this,!1),k(Fn,this)&&li(k(Fn,this),k(An,this))}))}get_effect_pending(){return k(In,this).call(this),N(k(Fn,this))}error(e
|
|||
|
|
|
|||
|
|
`)}var Ea=`podcast_player_view`,Da={icon:`lucide-star`,name:`Favorites`,shouldEpisodeRemoveAfterPlay:!1,shouldRepeat:!1},Oa={icon:`list-ordered`,name:`Queue`,shouldEpisodeRemoveAfterPlay:!0,shouldRepeat:!1},ka={icon:`folder`,name:`Local Files`,shouldEpisodeRemoveAfterPlay:!1,shouldRepeat:!1},Aa={icon:`check-square`,name:`Played`,shouldEpisodeRemoveAfterPlay:!1,shouldRepeat:!1},ja={savedFeeds:{},podNotes:{},defaultPlaybackRate:1,defaultVolume:1,hidePlayedEpisodes:!1,episodeListLimit:10,playedEpisodes:{},favorites:{...Da,episodes:[]},queue:{...Oa,episodes:[]},autoQueue:!0,playlists:{},skipBackwardLength:15,skipForwardLength:15,currentEpisode:void 0,timestamp:{template:`- {{time}} `,offset:0},note:{path:`PodNotes/{{podcast}}/{{title}}.md`,template:`---
|
|||
|
|
type: podcastEpisode
|
|||
|
|
podcast: "{{podcastlink}}"
|
|||
|
|
date: {{date:YYYY-MM-DD}}
|
|||
|
|
tags:
|
|||
|
|
- podcastEpisode
|
|||
|
|
status:
|
|||
|
|
rating:
|
|||
|
|
favorite: false
|
|||
|
|
---
|
|||
|
|
# {{title}}
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
[Resume in PodNotes]({{episodelink}})
|
|||
|
|
|
|||
|
|
{{url}}
|
|||
|
|
|
|||
|
|
{{description}}
|
|||
|
|
`},feedNote:{path:`PodNotes/Podcasts/{{podcast}}.md`,template:`---
|
|||
|
|
type: podcast
|
|||
|
|
podcast: "{{podcast}}"
|
|||
|
|
image: "{{artwork}}"
|
|||
|
|
url: "{{url}}"
|
|||
|
|
feedUrl: "{{feedurl}}"
|
|||
|
|
tags:
|
|||
|
|
- podcast
|
|||
|
|
---
|
|||
|
|
# {{title}}
|
|||
|
|
{{author}}
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
{{description}}
|
|||
|
|
`},download:{path:`PodNotes/{{podcast}}/{{title}}`},downloadedEpisodes:{},localFiles:{...ka,episodes:[]},openAISecretId:``,deepgramSecretId:``,transcript:{path:`transcripts/{{podcast}}/{{title}}.md`,template:`# {{title}}
|
|||
|
|
|
|||
|
|
Podcast: {{podcast}}
|
|||
|
|
Date: {{date}}
|
|||
|
|
|
|||
|
|
{{transcript}}`,diarization:{enabled:!1,provider:`openai`,speakerTemplate:ga}},feedCache:{enabled:!0,ttlHours:6}},Ma=.5,Na=.1;function Pa(e,t=1){let n=typeof e==`number`?e:Number(e),r=Number.isFinite(t)?t:1;return Ia(Number.isFinite(n)?n:r)}function Fa(e,t){return Pa(La(e+t))}function Ia(e){return Math.min(4,Math.max(Ma,La(e)))}function La(e){return Math.round(e*10)/10}var Ra=`::`;function za(e,t){return e.includes(Ra)||t.includes(Ra)||e.endsWith(`:`)||t.startsWith(`:`)}var Ba=`\0`;function Va(e){return e.replace(/\\/g,`\\\\`).replace(/:/g,`\\c`)}function Ha(e){if(!e||!e.title)return``;if(e.podcastName){let{podcastName:t,title:n}=e;return za(t,n)?`${Ba}${Va(t)}:${Va(n)}`:`${t}${Ra}${n}`}return e.title}function Ua(e,t){return!e||!t?!1:Ha(e)===t||e.title===t}function Wa(e,t){return!e||!t?!1:Ua(e,Ha(t))?!0:!e.podcastName&&!!t.title&&e.title===t.title}function Ga(e,t){if(!t)return;let n=Ha(t);if(n&&e[n])return e[n];if(t.title&&e[t.title])return e[t.title]}function Ka(e,t){return Ga(t,e)?.finished??!1}function qa(e){return e.podcastName?`${e.podcastName}::${e.title}`:e.title}function Ja(e,t,n){let r=new Set,i=qa(t);for(let[a,o]of Object.entries(e))(a===n||a===i||Za(o,t))&&r.add(a);return Array.from(r)}function Ya(e){let t=new Map;for(let[n,r]of Object.entries(e)){if(!r.finished)continue;let e=qa(r);(!t.get(e)||Xa(n))&&t.set(e,{key:n,episode:r})}return Array.from(t.values())}function Xa(e){return e.includes(`::`)}function Za(e,t){return e.title===t.title?!e.podcastName||!t.podcastName||e.podcastName===t.podcastName:!1}function Qa(e){let t;if(e instanceof Date)t=new Date(e.getTime());else if(typeof e==`string`&&e.trim()!==``)t=new Date(e);else return;return Number.isFinite(t.getTime())?t:void 0}function $a(e){return Qa(e)?.toISOString()}function eo(e){if(e instanceof Date){let t=e.getTime();return Number.isFinite(t)?t:void 0}return Qa(e)?.getTime()}function to(e){let t=typeof e==`number`?e:Number(e);return!Number.isFinite(t)||t<1?10:Math.min(Math.floor(t),75)}var no=nn(0),ro=nn({}),io=nn({}),ao=nn(10);function oo(e){return eo(e?.episodeDate)??0}function so(e,t){return e?.length?[...e].sort((e,t)=>oo(t)-oo(e)).slice(0,t):[]}function co(e,t){if(!e||!t||e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}var lo=e=>`${e.podcastName}::${e.title}`;function uo(e,t,n){let r=[...e],i=oo(t),a=0,o=r.length;for(;a<o;){let e=a+o>>1;i>oo(r[e])?o=e:a=e+1}return r.splice(a,0,t),r.length>n&&(r.length=n),r}function fo(e,t=[]){if(!t?.length)return e;let n=new Set(t.map(lo));return e.filter(e=>!n.has(lo(e)))}function po(e,t,n,r){let i=fo(e,t);if(!n?.length)return i;for(let e of n)i=uo(i,e,r);return i}var mo=tn([],e=>{let t=new Map,n=new Map,r=[],i=to(E(ao));function a(a){let o=Object.entries(a),s=o.length,c=Math.max(1,i*Math.max(s,1)),l=!1,u=r,d=new Map,f=new Map;for(let[e,r]of o){d.set(e,r);let a=n.get(e),o=t.get(e)||[],s=a===r&&o?o:so(r,i);f.set(e,s),co(o,s)||(l=!0,u=po(u,o,s,c))}for(let e of t.keys())d.has(e)||(l=!0,u=fo(u,t.get(e)));n=d,t=f,l&&(r=u,e(r))}function o(){let a=E(io),o=Object.entries(a),s=o.length,c=Math.max(1,i*Math.max(s,1)),l=new Map,u=new Map,d=[];for(let[e,t]of o){let n=so(t,i);l.set(e,t),u.set(e,n),d.push(...n)}let f=d.sort((e,t)=>oo(t)-oo(e)).slice(0,c);n=l,t=u,co(r,f)||(r=f,e(r))}let s=io.subscribe(a),c=ao.subscribe(e=>{let t=to(e);t!==i&&(i=t,o())});return()=>{t.clear(),n.clear(),r=[],c(),s()}}),ho=(()=>{let e=nn({}),{subscribe:t,update:n,set:r}=e;function i(t){return E(e)[t.podcastName]?.some(e=>e.title===t.title)}return{subscribe:t,set:r,update:n,isEpisodeDownloaded:i,addEpisode:(e,t,r)=>{let i;return n(n=>{let a=n[e.podcastName]||[],o=a.findIndex(t=>t.title===e.title);if(o!==-1){let n=a[o].filePath;n&&n!==t&&(i=n),a[o]={...e,filePath:t,size:r}}else a.push({...e,filePath:t,size:r});return n[e.podcastName]=a,n}),i},removeEpisode:e=>{let t;return n(n=>{let r=n[e.podcastName]||[],i=r.findIndex(t=>t.title===e.title);return i===-1?n:(t=r[i].filePath,r.splice(i,1),n[e.podcastName]=r,n)}),t},getEpisode:t=>E(e)[t.podcastName]?.find(e=>e.title===t.title)}})(),L=nn(),go=nn(0),_o=nn(null),vo=n
|
|||
|
|
\r\f\xA0\v`];function Xs(e,t,n){var r=e==null?``:``+e;if(t&&(r=r?r+` `+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+` `+i:i;else if(r.length)for(var a=i.length,o=0;(o=r.indexOf(i,o))>=0;){var s=o+a;(o===0||Ys.includes(r[o-1]))&&(s===r.length||Ys.includes(r[s]))?r=(o===0?``:r.substring(0,o))+r.substring(s+1):o=s}}return r===``?null:r}function Zs(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function Qs(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function $s(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(Qs)),i&&c.push(...Object.keys(i).map(Qs));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=Qs(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=Zs(r)),i&&(n+=Zs(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function ec(e,t,n,r,i,a){var o=e[Ce];if(ht||o!==n||o===void 0){var s=Xs(n,r,a);(!ht||s!==e.getAttribute(`class`))&&(s==null?e.removeAttribute(`class`):t?e.className=s:e.setAttribute(`class`,s)),e[Ce]=n}else if(a&&i!==a)for(var c in a){var l=!!a[c];(i==null||l!==!!i[c])&&e.classList.toggle(c,l)}return a}function tc(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function nc(e,t,n,r){var i=e[we];if(ht||i!==t){var a=$s(t,r);(!ht||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e[we]=t}else r&&(Array.isArray(r)?(tc(e,n?.[0],r[0]),tc(e,n?.[1],r[1],`important`)):tc(e,n,r));return r}var rc=Symbol(`is custom element`),ic=Symbol(`is html`),ac=Oe?`link`:`LINK`;function oc(e,t,n,r){var i=sc(e);if(ht&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===ac)){r||uc(e,t,n??``);return}i[t]!==(i[t]=n)&&(t===`loading`&&(e[be]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&lc(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function sc(e){return e[Se]??(e[Se]={[rc]:e.nodeName.includes(`-`),[ic]:e.namespaceURI===`http://www.w3.org/1999/xhtml`})}var cc=new Map;function lc(e){var t=e.getAttribute(`is`)||e.nodeName,n=cc.get(t);if(n)return n;cc.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=f(i),r)r[o].set&&o!==`innerHTML`&&o!==`textContent`&&o!==`innerText`&&n.push(o);i=h(i)}return n}function uc(e,t,n){a&&(t===`srcset`&&pc(e,n)||dc(e.getAttribute(t)??``,n)||e.outerHTML.replace(e.innerHTML,e.innerHTML&&`...`))}function dc(e,t){return e===t||new URL(e,document.baseURI).href===new URL(t,document.baseURI).href}function fc(e){return e.split(`,`).map(e=>e.trim().split(` `).filter(Boolean))}function pc(e,t){var n=fc(e.srcset),r=fc(t);return r.length===n.length&&r.every(([e,t],r)=>t===n[r][1]&&(dc(n[r][0],e)||dc(e,n[r][0])))}function mc(e,t,n=t){var r,i,a=()=>{cancelAnimationFrame(r),e.paused||(r=requestAnimationFrame(a));var t=e.currentTime;i!==t&&n(i=t)};r=requestAnimationFrame(a),e.addEventListener(`timeupdate`,a),ea(()=>{var n=Number(t());i!==n&&!isNaN(n)&&(e.currentTime=i=n)}),Gi(()=>{cancelAnimationFrame(r),e.removeEventListener(`timeupdate`,a)})}function hc(e,t,n=t){var r=t();pn(e,[`play`,`pause`,`canplay`],()=>{r!==e.paused&&n(r=e.paused)},r==null),Xi(()=>{(r=!!t())!==e.paused&&(r?e.pause():e.play().catch(e=>{throw n(r=!0),e}))})}function gc(e,t,n=t){var r=()=>{n(e.volume)};t()??r(),pn(e,[`volumechange`],r,!1),ea(()=>{var n=Number(t());n!==e.volume&&!isNaN(n)&&(e.volume=n)})}var _c,vc=new WeakMap,yc=new WeakMap,bc=new WeakMap,xc=new WeakSet,Sc=class{constructor(e){_n(this,xc),D(this,vc,new WeakMap),D(this,yc,void 0),D(this,bc,void 0),O(bc,this,e)}observe(e,t){var n=k(vc,this).get(e)||new Set;return n.add(t),k(vc,this).set(e,n),vn(xc,this,Cc).call(this).observe(e,k(bc
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
* This modal is the designated mobile reorder surface, so its move/remove
|
|||
|
|
* controls need a comfortable touch target. Scope the sizing to the modal's
|
|||
|
|
* own buttons so the shared Icon component stays untouched elsewhere.
|
|||
|
|
*/.queue-reorder-actions.svelte-ohpjsg .icon-button {min-width:2.25rem;min-height:2.25rem;padding:0.25rem;}.queue-reorder-footer.svelte-ohpjsg {display:flex;justify-content:flex-end;}`};function Zc(e,t){lt(t,!1),Gs(e,Xc);let n=()=>sn(ko,`$queue`,r),[r,i]=ln(),a=A(),o=V(t,`close`,8,()=>{});function s(e){return n().episodes.findIndex(t=>t.title===e.title)}function c(e){let t=s(e);t>0&&ko.moveToTop(t)}function l(e){let t=s(e);t>0&&ko.moveUp(t)}function u(e){let t=s(e);t!==-1&&t<n().episodes.length-1&&ko.moveDown(t)}function d(e){let t=s(e);t!==-1&&t<n().episodes.length-1&&ko.moveToBottom(t)}function f(e){ko.remove(e)}Zi(()=>n(),()=>{j(a,n().episodes)}),Qi(),Oc();var p=Yc(),m=w(p),h=e=>{B(e,Gc())},g=e=>{var t=Jc();Ds(t,7,()=>N(a),e=>e.title,(e,t,n)=>{var r=qc(),i=w(r),o=w(i,!0);C(i);var s=T(i,2),p=w(s),m=w(p,!0);C(p);var h=T(p,2),g=e=>{var n=Kc(),r=w(n,!0);C(n),ta(()=>cs(r,(N(t),P(()=>N(t).podcastName)))),B(e,n)};Ss(h,e=>{N(t),P(()=>N(t).podcastName)&&e(g)}),C(s);var _=T(s,2),v=w(_);{let e=ar(()=>N(n)===0);Wc(v,{icon:`chevrons-up`,label:`Move to top`,size:20,get disabled(){return N(e)},$$events:{click:()=>c(N(t))}})}var y=T(v,2);{let e=ar(()=>N(n)===0);Wc(y,{icon:`chevron-up`,label:`Move up`,size:20,get disabled(){return N(e)},$$events:{click:()=>l(N(t))}})}var b=T(y,2);{let e=ar(()=>(F(N(n)),N(a),P(()=>N(n)===N(a).length-1)));Wc(b,{icon:`chevron-down`,label:`Move down`,size:20,get disabled(){return N(e)},$$events:{click:()=>u(N(t))}})}var x=T(b,2);{let e=ar(()=>(F(N(n)),N(a),P(()=>N(n)===N(a).length-1)));Wc(x,{icon:`chevrons-down`,label:`Move to bottom`,size:20,get disabled(){return N(e)},$$events:{click:()=>d(N(t))}})}Wc(T(x,2),{icon:`x`,label:`Remove from queue`,size:20,$$events:{click:()=>f(N(t))}}),C(_),C(r),ta(()=>{cs(o,N(n)+1),cs(m,(N(t),P(()=>N(t).title)))}),B(e,r)}),C(t),B(e,t)};Ss(m,e=>{N(a),P(()=>N(a).length===0)?e(h):e(g,-1)});var _=T(m,2),v=w(_);C(_),C(p),R(`click`,v,function(...e){o()?.apply(this,e)}),B(e,p),ut(),i()}var Qc=class extends r.Modal{constructor(e){super(e),this.component=null}onOpen(){this.titleEl.setText(`Reorder Queue`),this.component=ls(Zc,{target:this.contentEl,props:{close:()=>this.close()}})}onClose(){this.component&&(ps(this.component),this.component=null),this.contentEl.empty()}};function $c(e){return Array.isArray?Array.isArray(e):ll(e)===`[object Array]`}function el(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function tl(e){return e==null?``:el(e)}function nl(e){return typeof e==`string`}function rl(e){return typeof e==`number`}function il(e){return e===!0||e===!1||ol(e)&&ll(e)==`[object Boolean]`}function al(e){return typeof e==`object`}function ol(e){return al(e)&&e!==null}function sl(e){return e!=null}function cl(e){return!e.trim().length}function ll(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var ul=`Incorrect 'index' type`,dl=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,fl=e=>`Invalid value for key ${e}`,pl=e=>`Pattern length exceeds max of ${e}.`,ml=e=>`Missing ${e} property in key`,hl=e=>`Property 'weight' in key '${e}' must be a positive integer`,gl=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,_l=Object.prototype.hasOwnProperty,vl=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=yl(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function yl(e){let t=null,n=null,r=null,i=1,a=null;if(nl(e)||$c(e))r=e,t=bl(e),n=xl(e);else{if(!_l.call(e,`name`))throw Error(ml(`name`));let o=e.name;if(r=o,_l.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(hl(xl(o)));t=bl(o),n=xl(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function bl(e){return $c(e)?e:e.split(`.`)}functio
|
|||
|
|
`):n.join(`
|
|||
|
|
`)}function Ld(e){return Pu(e)&&e.filePath?e.url:Kd(e.url)}function Rd(e,t,n={}){let[r,i]=Ed(),a=Ld(t);i(`title`,Md(t.title)),i(`description`,e=>{let n=Fd(t.description).replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`);return e?n.split(`
|
|||
|
|
`).map(t=>`${e}${t}`).join(`
|
|||
|
|
`):n}),i(`content`,e=>e?Fd(t.content).split(`
|
|||
|
|
`).map(t=>`${e}${t}`).join(`
|
|||
|
|
`):Fd(t.content)),i(`safetitle`,Jd(t.title)),i(`stream`,qd(t.streamUrl)),i(`url`,a),i(`date`,e=>t.episodeDate?Eu(t.episodeDate,e??`YYYY-MM-DD`):``),i(`currentdate`,e=>Eu(new Date,e??`YYYY-MM-DD`)),i(`episodenumber`,e=>ku(Dd(t),e)),i(`duration`,e=>t.duration===void 0?``:Ou(t.duration,e)),i(`chapters`,e=>Id(n.chapters,e)),i(`podcast`,Jd(t.podcastName)),i(`artwork`,qd(t.artworkUrl??``)),i(`episodeurl`,a),i(`episodeartwork`,qd(t.artworkUrl??``)),i(`feedurl`,Kd(t.feedUrl??``));let o=E(L)?.settings?.savedFeeds?.[t.podcastName];return i(`feedartwork`,qd(o?.artworkUrl??t.artworkUrl??``)),i(`podcastlink`,Gd(t.podcastName)),i(`episodelink`,Fu(t)),r(e)}function zd(e,t={}){let[n,r]=Ed(),{api:i,settings:a}=E(L),o=a.timestamp.offset??0;return r(`time`,e=>i.getPodcastTimeFormatted(e??`HH:mm:ss`,!1,o)),r(`linktime`,e=>i.getPodcastTimeFormatted(e??`HH:mm:ss`,!0,o)),r(`segment`,e=>t.segment?i.getPodcastSegmentFormatted(e??`HH:mm:ss`,t.segment.startTime,t.segment.endTime,!1):i.getPodcastTimeFormatted(e??`HH:mm:ss`,!1,o)),r(`linksegment`,e=>t.segment?i.getPodcastSegmentFormatted(e??`HH:mm:ss`,t.segment.startTime,t.segment.endTime,!0):i.getPodcastTimeFormatted(e??`HH:mm:ss`,!0,o)),n(e)}function Bd(e,t,n=Jd){let[r,i]=Ed();return kd(i,t,n),r(e)}function Vd(e,t){let n=Tu(e),r=n?e.replace(RegExp(`\\.${n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}$`,`i`),``):e,[i,a]=Ed();return kd(a,t),i(r)}function Hd(e,t,n){let[r,i]=Ed();return kd(i,t),i(`duration`,e=>t.duration===void 0?``:Ou(t.duration,e)),i(`transcript`,n),i(`description`,e=>e?Fd(t.description).split(`
|
|||
|
|
`).map(t=>`${e}${t}`).join(`
|
|||
|
|
`):Fd(t.description)),i(`url`,Ld(t)),i(`artwork`,qd(t.artworkUrl??``)),r(e)}function Ud(e,t){let[n,r]=Ed(),i=Jd(t.title);return r(`title`,Md(t.title)),r(`safetitle`,i),r(`podcast`,i),r(`url`,Kd(t.link??``)),r(`feedurl`,Kd(t.url)),r(`artwork`,qd(t.artworkUrl??``)),r(`feedartwork`,qd(t.artworkUrl??``)),r(`author`,Md(t.author??``)),r(`description`,e=>{let n=Fd(t.description??``).replace(/\n{3,}/g,`
|
|||
|
|
|
|||
|
|
`);return e?n.split(`
|
|||
|
|
`).map(t=>`${e}${t}`).join(`
|
|||
|
|
`):n}),r(`date`,e=>Eu(new Date,e??`YYYY-MM-DD`)),n(e)}function Wd(e,t){let[n,r]=Ed(),i=Od(t.title);return r(`title`,i),r(`podcast`,i),r(`date`,e=>Eu(new Date,e??`YYYY-MM-DD`)),n(e)}function Gd(e){let t=Jd(e),n=E(L)?.settings?.feedNote?.path?.trim();if(!n)return`[[${t}]]`;let r=qu(Iu(Wd(n,{title:e,url:``,artworkUrl:``}),`md`)).replace(/\.md$/i,``).trim(),i=r.split(`/`).pop()?.trim()||t;return r.includes(`/`)?`[[${r}|${i}]]`:`[[${i}]]`}function Kd(e){return e.replace(/[\u0000-\u0020"'`()[\]<>\\]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`)}`)}function qd(e){if(!e||!Cd(e))return``;let t=new URL(e);return t.username||t.password?``:Kd(e)}function Jd(e){return e.replace(/[\\,#%&{}/*<>$'":@\u2023|?[\]]/g,``).replace(/[\u0000-\u001f]/g,` `).replace(/\s+/g,` `).trim().replace(/^\.+/,``).replace(/\.+$/,``).trim()}function Yd(e){return e.replace(/[\\,#%&{}/*<>$'":@\u2023|\\.?]/g,``).replace(/\n/g,` `).replace(` `,` `)}function Xd(e){return e.replace(/^\s*(?:>\s?)+/,``)}function Zd(e){return Xd(e).includes(`|`)}function Qd(e){let t=Xd(e).trim();if(!t.includes(`|`))return!1;let n=t.replace(/^\|/,``).replace(/\|$/,``).split(`|`);return n.length>0&&n.every(e=>/^\s*:?-+:?\s*$/.test(e))}function $d(e,t,n){let r=e(n);if(!r||!Zd(r))return!1;for(let t=n;t>=0;t--){let n=e(t);if(!n||!Zd(n))break;if(Qd(n))return!0}for(let r=n;r<t;r++){let t=e(r);if(!t||!Zd(t))break;if(Qd(t))return!0}return!1}function ef(e){return e.replace(/\r\n?|\n/g,` `).replace(/(\\*)\|/g,(e,t)=>t.length%2==0?`${t}\\|`:e)}function tf(e,t){return $d(t.getLine,t.lineCount,t.cursorLine)?ef(e):e}function nf(e,t){if(!Number.isFinite(e)||!Number.isFinite(t))return null;let n={startTime:Math.max(0,e),endTime:Math.max(0,t)};return n.endTime>n.startTime?n:null}function rf(e,t,n=0){if(!Number.isFinite(e)||!Number.isFinite(t)||t<=0)return null;let r=Math.max(0,e-n);return nf(Math.max(0,r-t),r)}function af(e,t,n){return`${Du(Math.max(0,e),n)}-${Du(Math.max(0,t),n)}`}function of(e){if(/\{\{(?:linksegment|segment)(?::\s*?.+?)?\}\}/i.test(e))return e;let t=e.replace(/\{\{linktime(:\s*?.+?)?\}\}/gi,`{{linksegment$1}}`).replace(/\{\{time(:\s*?.+?)?\}\}/gi,`{{segment$1}}`);return t===e?`- {{linksegment}}`:t}async function sf(e,t=E(L).app.vault,n){let r=e.split(`/`).filter(Boolean),i=``;for(let e of r)if(n?.(),i=i?`${i}/${e}`:e,!t.getAbstractFileByPath(i)){try{await t.createFolder(i)}catch(e){if(n?.(),!(e instanceof Error&&/already exists/i.test(e.message))&&!t.getAbstractFileByPath(i))throw e}n?.()}}var cf=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,`byteLength`)?.get,lf={"invalid-options":`Network request options are invalid.`,"unsafe-target":`Network request target is not allowed.`,"request-too-large":`Network request body exceeds the configured limit.`,"response-too-large":`Network response exceeds the configured limit.`,"unexpected-status":`Network response status is not accepted.`,timeout:`Network request timed out.`,aborted:`Network request was aborted.`,"transport-failure":`Network request failed.`,"invalid-response":`Network response is invalid.`},uf=new Set(Object.keys(lf)),df=class extends Error{constructor(e,t){let n=e===`unexpected-status`&&Number.isSafeInteger(t)&&t!==void 0&&t>=100&&t<=599?t:void 0;super(n===void 0?lf[e]:`Network response returned HTTP ${n}.`),this.code=e,this.name=`NetworkError`,this.status=n}},ff=class extends df{constructor(){super(`timeout`),this.name=`TimeoutError`}};function pf(e,t){try{if(e instanceof df){let t=e.code;if(typeof t==`string`&&uf.has(t)){let n=t;return n===`timeout`?new ff:new df(n,e.status)}}}catch{}return new df(t)}function mf(){return new df(`invalid-options`)}function hf(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function gf(e){if(e!==void 0){if(typeof e!=`object`||!e)throw mf();try{let t=Reflect.get(e,`addEventListener`),n=Reflect.get(e,`removeEventListener`);if(typeof t!=`function`||typeof n!=`function`)throw mf();return{target:e,addEventListener:t,removeEventListener:n}}catch{throw mf()}}}function _f(e){try{let t=Reflect.get(e.target,`aborted`);if(typeof t!=`boolean`)throw mf();retu
|
|||
|
|
box-shadow 150ms ease,
|
|||
|
|
border-color 150ms ease;}.podcast-result-card.svelte-bw0itx:hover {border-color:var(--interactive-accent);box-shadow:0 4px 12px rgba(0, 0, 0, 0.1);transform:translateY(-1px);}.podcast-artwork-container.svelte-bw0itx {width:4rem;height:4rem;flex-shrink:0;overflow:hidden;border-radius:0.375rem;position:relative;background:var(--background-modifier-border);}.podcast-artwork.svelte-bw0itx {width:100%;height:100%;object-fit:cover;position:absolute;top:0;left:0;}.podcast-info.svelte-bw0itx {flex:1 1 auto;min-width:0;}.podcast-title.svelte-bw0itx {margin:0;font-size:0.9rem;font-weight:600;line-height:1.4;color:var(--text-normal);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;}
|
|||
|
|
|
|||
|
|
/*
|
|||
|
|
* The Add/Remove control uses Obsidian's native call-to-action / warning
|
|||
|
|
* button styling with a text label. A label is always visible and is sized
|
|||
|
|
* correctly per platform (Obsidian renders larger buttons on mobile/iPad),
|
|||
|
|
* unlike the previous icon-only button whose glyph failed to render on iPad
|
|||
|
|
* and left an empty, unrecognisable tap target — the root cause of #109.
|
|||
|
|
*/.podcast-actions.svelte-bw0itx {display:flex;align-items:center;flex-shrink:0;}`};function Sh(e,t){lt(t,!1),Gs(e,xh);let n=V(t,`podcast`,8),r=V(t,`isSaved`,8,!1),i=Fc();Oc();var a=bh(),o=w(a),s=w(o);C(o);var c=T(o,2),l=w(c),u=w(l,!0);C(l),C(c);var d=T(c,2),f=w(d),p=e=>{{let t=ar(()=>(F(n()),P(()=>`Remove ${n().title} podcast`)));_h(e,{text:`Remove`,warning:!0,get ariaLabel(){return N(t)},$$events:{click:()=>i(`removePodcast`,{podcast:n()})}})}},m=e=>{{let t=ar(()=>(F(n()),P(()=>`Add ${n().title} podcast`)));_h(e,{text:`Add`,cta:!0,get ariaLabel(){return N(t)},$$events:{click:()=>i(`addPodcast`,{podcast:n()})}})}};Ss(f,e=>{r()?e(p):e(m,-1)}),C(d),C(a),ta(()=>{oc(s,`src`,(F(n()),P(()=>n().artworkUrl))),oc(s,`alt`,(F(n()),P(()=>`Artwork for ${n().title}`))),cs(u,(F(n()),P(()=>n().title)))}),Us(3,a,()=>yh,()=>({duration:300})),B(e,a),ut()}var Ch=z(`<div class="podcast-query-status svelte-8ek8i8" role="status" aria-live="polite">Searching...</div>`),wh=z(`<div class="podcast-query-status podcast-query-error svelte-8ek8i8" role="alert"> </div>`),Th=z(`<div class="podcast-query-status svelte-8ek8i8" role="status" aria-live="polite">No results.</div>`),Eh=z(`<div role="listitem"><!></div>`),Dh=z(`<div class="podcast-query-container svelte-8ek8i8"><!> <!> <div class="podcast-query-results svelte-8ek8i8" role="list" aria-label="Podcast search results"></div></div>`),Oh={hash:`svelte-8ek8i8`,code:`.podcast-query-container.svelte-8ek8i8 {margin-bottom:1.5rem;}.podcast-query-status.svelte-8ek8i8 {margin-bottom:0.75rem;font-size:0.85rem;color:var(--text-muted);}.podcast-query-error.svelte-8ek8i8 {color:var(--text-error);}.podcast-query-results.svelte-8ek8i8 {display:grid;gap:0.75rem;grid-template-columns:1fr;}
|
|||
|
|
|
|||
|
|
@media (min-width: 500px) {.podcast-query-results.svelte-8ek8i8 {grid-template-columns:repeat(auto-fill, minmax(18rem, 1fr));}
|
|||
|
|
}`};function kh(e,t){lt(t,!1),Gs(e,Oh);let n=()=>sn(ro,`$savedFeeds`,a),i=()=>sn(no,`$podcastsUpdated`,a),[a,o]=ln(),s=A([]),c=A(`grid-3`),l=A(``),u=A(!1),d=A(``),f=A();Mc(()=>{p(),N(f)&&N(f).focus()});function p(){N(l).trim()===``&&j(s,Object.values(n()))}let m=(0,r.debounce)(async({detail:{value:e}})=>{j(l,e),j(d,``);let t=ph(e);if((t?.protocol===`http:`||t?.protocol===`https:`)&&t){j(u,!0);try{let e=await new Fp().getFeed(t.href);j(s,[e])}catch(e){j(s,[]);let t=e instanceof Error?e.message:String(e);j(d,`Could not load feed: ${t}`),new r.Notice(N(d))}finally{j(u,!1)}}else if(e.trim()===``)p();else{j(u,!0);try{j(s,await th(e))}catch{j(s,[]),j(d,`Could not search podcasts. Please try again.`)}finally{j(u,!1)}}},300,!0);function h(e){let t=Hp(e.detail.podcast,E(L).feedUrls);ro.update(e=>({...e,[t.title]:t})),p()}function g(e){let{podcast:t}=e.detail;ro.update(e=>{let n=e[t.title],r={...e};delete r[t.title];let i=Object.values(r).some(e=>e.urlSecretId===n?.urlSecretId);return n?.urlSecretId&&!i&&E(L).feedUrls.delete(n.urlSecretId),r}),p()}Zi(()=>(N(l),n(),i()),()=>{N(l).trim()===``&&j(s,Object.values(n())),i()}),Zi(()=>N(s),()=>{N(s).length%3==0||N(s).length>3?j(c,`grid-3`):N(s).length%2==0?j(c,`grid-2`):N(s).length%1==0&&j(c,`grid-1`)}),Qi(),Oc();var _=Dh(),v=w(_);hh(v,{placeholder:`Search or enter feed URL...`,style:{width:`100%`,"margin-bottom":`1rem`},get el(){return N(f)},set el(e){j(f,e)},$$events:{change:m},$$legacy:!0});var y=T(v,2),b=e=>{B(e,Ch())},x=e=>{var t=wh(),n=w(t,!0);C(t),ta(()=>cs(n,N(d))),B(e,t)},S=e=>{B(e,Th())},ee=ir(()=>(N(l),N(s),P(()=>N(l).trim()!==``&&N(s).length===0)));Ss(y,e=>{N(u)?e(b):N(d)?e(x,1):N(ee)&&e(S,2)});var te=T(y,2);Ds(te,5,()=>N(s),e=>e.url,(e,t)=>{var r=Eh(),i=w(r);{let e=ar(()=>(N(t),n(),P(()=>typeof N(t).url==`string`&&n()[N(t).title]?.url===N(t).url)));Sh(i,{get podcast(){return N(t)},get isSaved(){return N(e)},$$events:{addPodcast:h,removePodcast:g}})}C(r),B(e,r)}),C(te),C(_),Us(3,_,()=>yh,()=>({duration:300})),B(e,_),ut(),o()}var Ah=z(`<button type="button"><!></button>`),jh=z(`<div class="playlist-item svelte-jzsw7l"><div class="playlist-item-left svelte-jzsw7l"><!> <span class="playlist-name svelte-jzsw7l"> </span> <span class="playlist-count svelte-jzsw7l"> </span></div> <div class="playlist-item-controls svelte-jzsw7l"><!></div></div>`),Mh={hash:`svelte-jzsw7l`,code:`.playlist-item.svelte-jzsw7l {display:flex;align-items:center;justify-content:space-between;gap:0.75rem;padding:0.625rem 0.75rem;width:100%;background:var(--background-secondary);transition:background-color 120ms ease;}.playlist-item.svelte-jzsw7l:not(:last-child) {border-bottom:1px solid var(--background-modifier-border);}.playlist-item.svelte-jzsw7l:hover {background:var(--background-secondary-alt);}.playlist-item-left.svelte-jzsw7l {display:flex;align-items:center;gap:0.5rem;min-width:0;}.playlist-name.svelte-jzsw7l {font-weight:500;font-size:0.9rem;color:var(--text-normal);}.playlist-count.svelte-jzsw7l {font-size:0.8rem;color:var(--text-muted);}.playlist-item-controls.svelte-jzsw7l {display:flex;align-items:center;gap:0.25rem;}.delete-button.svelte-jzsw7l {display:flex;align-items:center;justify-content:center;padding:0.375rem;border:none;border-radius:0.25rem;background:transparent;color:var(--text-muted);cursor:pointer;transition:background-color 120ms ease,
|
|||
|
|
color 120ms ease;}.delete-button.svelte-jzsw7l:hover {background:var(--background-modifier-hover);color:var(--text-error);}.delete-button.confirm.svelte-jzsw7l {color:var(--text-success);}.delete-button.confirm.svelte-jzsw7l:hover {color:var(--text-success);}`};function Nh(e,t){lt(t,!1),Gs(e,Mh);let n=V(t,`playlist`,8),r=V(t,`showDeleteButton`,8,!0),i=A(!1),a=Fc();function o(){if(N(i)){a(`delete`,{value:n()});return}j(i,!0),setTimeout(()=>{j(i,!1)},2e3)}Zi(()=>F(n()),()=>{n()&&j(i,!1)}),Qi(),Oc();var s=jh(),c=w(s),l=w(c);Wc(l,{get icon(){return F(n()),P(()=>n().icon)},clickable:!1,size:18});var u=T(l,2),d=w(u,!0);C(u);var f=T(u,2),p=w(f);C(f),C(c);var m=T(c,2),h=w(m),g=e=>{var t=Ah();let n;var r=w(t);{let e=ar(()=>N(i)?`check`:`trash`);Wc(r,{get icon(){return N(e)},clickable:!1,size:16})}C(t),ta(()=>{n=ec(t,1,`delete-button svelte-jzsw7l`,null,n,{confirm:N(i)}),oc(t,`aria-label`,N(i)?`Confirm deletion`:`Delete playlist`)}),R(`click`,t,o),B(e,t)};Ss(h,e=>{r()&&e(g)}),C(m),C(s),ta(()=>{cs(d,(F(n()),P(()=>n().name))),cs(p,`(${F(n()),P(()=>n().episodes.length)??``})`)}),B(e,s),ut()}var Ph=z(`<span></span>`);function Fh(e,t){lt(t,!1);let n=V(t,`value`,8,``),i=V(t,`options`,24,()=>({})),a=V(t,`disabled`,8,!1),o=A(),s=A(),c=V(t,`style`,8),l=Fc();Mc(()=>{j(s,new r.DropdownComponent(N(o))),d(N(s))});function u(e){return typeof e.getValue==`function`?e.getValue():e.selectEl?.value}function d(e){i()&&e.addOptions(i()),n()&&e.setValue(n()),a()&&e.setDisabled(a()),e.onChange(e=>{l(`change`,{value:e})}),c()&&e.selectEl.setAttr(`style`,Bc(c()))}Zi(()=>(N(s),F(n())),()=>{N(s)&&n()!==void 0&&u(N(s))!==n()&&N(s).setValue(n())}),Qi(),Oc();var f=Ph();Tc(f,e=>j(o,e),()=>N(o)),B(e,f),ut()}var Ih=`activity.airplay.alarm-check.alarm-clock-off.alarm-clock.alarm-minus.alarm-plus.album.alert-circle.alert-octagon.alert-triangle.align-center-horizontal.align-center-vertical.align-center.align-end-horizontal.align-end-vertical.align-horizontal-distribute-center.align-horizontal-distribute-end.align-horizontal-distribute-start.align-horizontal-justify-center.align-horizontal-justify-end.align-horizontal-justify-start.align-horizontal-space-around.align-horizontal-space-between.align-justify.align-left.align-right.align-start-horizontal.align-start-vertical.align-vertical-distribute-center.align-vertical-distribute-end.align-vertical-distribute-start.align-vertical-justify-center.align-vertical-justify-end.align-vertical-justify-start.align-vertical-space-around.align-vertical-space-between.anchor.aperture.archive.arrow-big-down.arrow-big-left.arrow-big-right.arrow-big-up.arrow-down-circle.arrow-down-left.arrow-down-right.arrow-down.arrow-left-circle.arrow-left-right.arrow-left.arrow-right-circle.arrow-right.arrow-up-circle.arrow-up-left.arrow-up-right.arrow-up.asterisk.at-sign.award.axe.banknote.bar-chart-2.bar-chart.baseline.battery-charging.battery-full.battery-low.battery-medium.battery.beaker.bell-minus.bell-off.bell-plus.bell-ring.bell.bike.binary.bitcoin.bluetooth-connected.bluetooth-off.bluetooth-searching.bluetooth.bold.book-open.book.bookmark-minus.bookmark-plus.bookmark.bot.box-select.box.briefcase.brush.bug.building-2.building.bus.calculator.calendar.camera-off.camera.car.carrot.cast.check-circle-2.check-circle.check-square.check.chevron-down.chevron-first.chevron-last.chevron-left.chevron-right.chevron-up.chevrons-down-up.chevrons-down.chevrons-left.chevrons-right.chevrons-up-down.chevrons-up.chrome.circle-slashed.circle.clipboard-check.clipboard-copy.clipboard-list.clipboard-x.clipboard.clock-1.clock-10.clock-11.clock-12.clock-2.clock-3.clock-4.clock-5.clock-6.clock-7.clock-8.clock-9.clock.cloud-drizzle.cloud-fog.cloud-hail.cloud-lightning.cloud-moon.cloud-off.cloud-rain-wind.cloud-rain.cloud-snow.cloud-sun.cloud.cloudy.clover.code-2.code.codepen.codesandbox.coffee.coins.columns.command.compass.contact.contrast.cookie.copy.copyleft.copyright.corner-down-left.corner-down-right.corner-left-down.corner-left-up.corner-right-down.corner-right-up.corner-up-left.corner-up-right.cpu.credit-card.crop.cross.crosshair.crown.currency.database.del
|
|||
|
|
type: podcastEpisode
|
|||
|
|
podcast: "{{podcastlink}}"
|
|||
|
|
url: "{{url}}"
|
|||
|
|
date: {{date:YYYY-MM-DD}}
|
|||
|
|
tags:
|
|||
|
|
- podcastEpisode
|
|||
|
|
---
|
|||
|
|
# {{title}}
|
|||
|
|
|
|||
|
|

|
|||
|
|
|
|||
|
|
{{description}}`)}))}addFeedNoteSettings(e){let t=e.createDiv();new r.Setting(t).setName(`Podcast feed note settings`).setHeading(),t.createEl(`p`,{text:`Create a note for a whole podcast (the feed), not a single episode. Run the "Create podcast feed note" command to pick a saved podcast. Available tags: {{title}}, {{podcast}}, {{url}} (website), {{feedurl}} (RSS), {{artwork}}, {{author}}, {{description}}, {{date}}.`}).setCssStyles({fontSize:`var(--font-ui-smaller)`,color:`var(--text-muted)`});let n=ev();X_(new r.Setting(t).setName(`Feed note file path`).setHeading().addText(e=>{e.setValue(this.plugin.settings.feedNote.path),e.setPlaceholder(`PodNotes/Podcasts/{{podcast}}.md`),e.onChange(e=>{this.plugin.settings.feedNote.path=e,this.plugin.saveSettings(),a(e)}),e.inputEl.setCssStyles({width:`100%`})}));let i=t.createDiv(),a=e=>{Z_(Wd(e,n),i)};a(this.plugin.settings.feedNote.path),X_(new r.Setting(t).setName(`Feed note template`).setHeading().addTextArea(e=>{e.setValue(this.plugin.settings.feedNote.template),e.onChange(e=>{this.plugin.settings.feedNote.template=e,this.plugin.saveSettings()}),e.inputEl.setCssStyles({width:`100%`,height:`25vh`})}))}addDownloadSettings(e){new r.Setting(e).setName(`Download settings`).setHeading();let t=$_();X_(new r.Setting(e).setName(`Episode download path`).setDesc(`The path where the episode will be downloaded to. Avoid setting an extension, as it will be added automatically.`).setHeading().addText(e=>{e.setValue(this.plugin.settings.download.path),e.setPlaceholder(`inputs/podcasts/{{podcast}} - {{title}}`),e.onChange(e=>{this.plugin.settings.download.path=e,this.plugin.saveSettings(),a(e)}),e.inputEl.setCssStyles({width:`100%`})}));let n=e.createDiv(),i=e.createDiv();i.setCssStyles({color:`var(--text-error)`});let a=e=>{Z_(`${Vd(e,t)}.mp3`,n),i.toggle(!/\{\{title(:[^}]*)?\}\}/i.test(e)),i.setText(`⚠ This path has no {{title}}, so multiple episodes can resolve to the same file — downloads will overwrite each other or fail. Add {{title}}, e.g. PodNotes/{{podcast}}/{{title}}.`)};a(this.plugin.settings.download.path)}addPerformanceSettings(e){new r.Setting(e).setName(`Performance`).setHeading(),new r.Setting(e).setName(`Cache podcast feeds`).setDesc(`Store recently downloaded feeds locally for faster startup.`).addToggle(e=>e.setValue(this.plugin.settings.feedCache.enabled).onChange(async e=>{this.plugin.settings.feedCache.enabled=e,await this.plugin.saveSettings()})),new r.Setting(e).setName(`Cache duration (hours)`).setDesc(`Choose how long to reuse cached feeds before fetching again.`).addSlider(e=>e.setLimits(1,24,1).setValue(this.plugin.settings.feedCache.ttlHours).setDynamicTooltip().onChange(async e=>{this.plugin.settings.feedCache.ttlHours=e,await this.plugin.saveSettings()})),new r.Setting(e).setName(`Clear cached feeds`).setDesc(`Remove stored feed data. PodNotes will refetch feeds as needed.`).addButton(e=>e.setButtonText(`Clear cache`).onClick(()=>{Ng(),io.set({}),new r.Notice(`Cleared cached podcast feeds.`)}))}addImportExportSettings(e){new r.Setting(e).setName(`Import/Export`).setHeading(),new r.Setting(e).setName(`Import OPML`).setDesc(`Import podcasts from an OPML file.`).addButton(e=>e.setButtonText(`Import`).onClick(()=>{this.pickFile(`.opml`,async e=>{try{await Uh(e)}catch(e){new r.Notice(`Error importing OPML: ${e instanceof Error?e.message:`Unknown error`}`,1e4)}},{tooLargeMessage:`That file is too large to be an OPML file.`})}));let t=`PodNotes_Export.opml`;new r.Setting(e).setName(`Export OPML`).setDesc(`Export saved podcast feeds to an OPML file.`).addText(e=>e.setPlaceholder(`Export file name`).setValue(t).onChange(e=>{t=e})).addButton(e=>e.setButtonText(`Export`).onClick(()=>{let e=Object.values(E(ro));if(e.length===0){new r.Notice(`No podcasts to export.`);return}Wh(this.app,e,t.endsWith(`.opml`)?t:`${t}.opml`)})),this.addSettingsTransferControls(e)}addSettingsTransferControls(e){new r.Setting(e).setName(`Settings & templates`).setHeading(),new r.Setting(e).setName(`Import settings`).setDesc(`Import PodNotes preferences, templates, feeds, and playlists from a
|
|||
|
|
|
|||
|
|
Podcast: {{podcast}}
|
|||
|
|
Date: {{date}}
|
|||
|
|
URL: {{url}}
|
|||
|
|
|
|||
|
|
## Description
|
|||
|
|
|
|||
|
|
{{description}}
|
|||
|
|
|
|||
|
|
## Transcript
|
|||
|
|
|
|||
|
|
{{transcript}}`).setValue(this.plugin.settings.transcript.template).onChange(async e=>{this.plugin.settings.transcript.template=e,await this.plugin.saveSettings()}),e.inputEl.setCssStyles({width:`100%`,height:`25vh`})})),this.addDiarizationSettings(e)}addDiarizationSettings(e){let t=e.createDiv(),n=this.plugin.settings.transcript.diarization,i=()=>{};new r.Setting(t).setName(`Speaker diarization`).setDesc(`Label transcript segments by speaker. Routes the episode audio to a diarization-capable provider instead of plain Whisper.`).addToggle(e=>e.setValue(n.enabled).onChange(async e=>{this.plugin.settings.transcript.diarization.enabled=e,await this.plugin.saveSettings(),i()}));let a=new r.Setting(t).setName(`Diarization provider`).setDesc(`OpenAI reuses your OpenAI API key above (long episodes are chunked, so speaker labels can reset across chunks). Deepgram needs its own key and keeps speaker labels consistent across the whole episode.`).addDropdown(e=>e.addOption(`openai`,`OpenAI (gpt-4o-transcribe-diarize)`).addOption(`deepgram`,`Deepgram`).setValue(n.provider).onChange(async e=>{this.plugin.settings.transcript.diarization.provider=e,await this.plugin.saveSettings(),i()})),o=new r.Setting(t).setName(`Deepgram API key`),s=()=>{o.setDesc(this.plugin.credentials.status(this.plugin.settings,`deepgram`)===`missing`?`The selected secret is not available on this device. Select an existing secret or create one.`:`Select an Obsidian secret for Deepgram diarization, or create one at deepgram.com.`)};s(),o.addComponent(e=>{let t=new r.SecretComponent(this.app,e).setValue(this.plugin.settings.deepgramSecretId);return t.onChange(async e=>{await this.handleSecretSelection(`deepgramSecretId`,e,t,s)}),t});let c=new r.Setting(t).setName(`Speaker label format`).setDesc(`Prefix added before each speaker's turn. Use {{speaker}} for the speaker label (OpenAI labels speakers A, B, …; Deepgram labels them 1, 2, …).`).addText(e=>e.setPlaceholder(ga).setValue(n.speakerTemplate).onChange(async e=>{this.plugin.settings.transcript.diarization.speakerTemplate=e,await this.plugin.saveSettings()}));i=()=>{a.settingEl.toggle(n.enabled),o.settingEl.toggle(n.enabled&&n.provider===`deepgram`),c.settingEl.toggle(n.enabled)},i()}};function $_(){let e={description:`demo`,content:`demo`,podcastName:`demo`,title:`demo`,url:`demo`,artworkUrl:`demo`,streamUrl:`demo`,episodeDate:new Date,feedUrl:`demo`},t=Object.values(E(io));if(!t.length)return e;let n=t[Math.floor(Math.random()*t.length)];return n.length?n[Math.floor(Math.random()*n.length)]:e}function ev(){let e={title:`Demo Podcast`,url:`https://example.com/feed.xml`,artworkUrl:`https://example.com/artwork.jpg`,description:`A demo podcast feed.`,link:`https://example.com`,author:`Demo Author`},t=Object.values(E(ro));return t.length?t[Math.floor(Math.random()*t.length)]:e}var tv=class extends r.Modal{constructor(e,t,n,r,i){super(e),this.title=t,this.body=n,this.confirmText=r,this.onConfirm=i}onOpen(){let{contentEl:e}=this;e.createEl(`h3`,{text:this.title}),e.createEl(`p`,{text:this.body}),new r.Setting(e).addButton(e=>e.setButtonText(`Cancel`).onClick(()=>this.close())).addButton(e=>e.setButtonText(this.confirmText).setWarning().onClick(()=>{this.close(),this.onConfirm()}))}onClose(){this.contentEl.empty()}},nv=z(`<button type="button" class="playlist-card svelte-5dhk44"><!> <span class="playlist-card-name svelte-5dhk44"> </span> <span class="playlist-card-count svelte-5dhk44"> </span></button>`),rv={hash:`svelte-5dhk44`,code:`.playlist-card.svelte-5dhk44 {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.25rem;width:100%;min-height:5rem;padding:0.75rem 0.5rem;
|
|||
|
|
/* \`min-height\` is a floor, not a cap: the card must grow to fit icon +
|
|||
|
|
name + count. The grid uses min-content rows, so the row grows with it. */height:auto;border:1px solid var(--background-modifier-border);border-radius:0.5rem;text-align:center;background:var(--background-secondary);cursor:pointer;transition:transform 150ms ease,
|
|||
|
|
box-shadow 150ms ease,
|
|||
|
|
border-color 150ms ease,
|
|||
|
|
background-color 150ms ease;}.playlist-card.svelte-5dhk44:hover {transform:scale(1.02);border-color:var(--interactive-accent);background-color:var(--background-secondary-alt);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);}.playlist-card.svelte-5dhk44:active {transform:scale(0.98);}
|
|||
|
|
|
|||
|
|
/* Keep the icon, name, and count at their natural height so flexbox never
|
|||
|
|
compresses/clips a label to fit the min-height (the bug where the name
|
|||
|
|
overlapped the count). The card grows instead. */.playlist-card-name.svelte-5dhk44,
|
|||
|
|
.playlist-card-count.svelte-5dhk44 {flex-shrink:0;}.playlist-card.svelte-5dhk44 .icon-static {flex-shrink:0;}.playlist-card-name.svelte-5dhk44 {max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:0.85rem;line-height:1.3;color:var(--text-normal);}.playlist-card-count.svelte-5dhk44 {font-size:0.8rem;line-height:1.3;color:var(--text-muted);}`};function iv(e,t){lt(t,!1),Gs(e,rv);let n=V(t,`playlist`,8),r=Fc();function i(e){r(`clickPlaylist`,{playlist:n(),event:e})}Oc();var a=nv(),o=w(a);Wc(o,{get icon(){return F(n()),P(()=>n().icon)},size:32,clickable:!1});var s=T(o,2),c=w(s,!0);C(s);var l=T(s,2),u=w(l);C(l),C(a),ta(()=>{oc(a,`aria-label`,(F(n()),P(()=>n().name))),oc(a,`title`,(F(n()),P(()=>n().name))),cs(c,(F(n()),P(()=>n().name))),cs(u,`(${F(n()),P(()=>n().episodes.length)??``})`)}),R(`click`,a,i),B(e,a),ut()}var av=z(`<button type="button" class="pn_image_container svelte-ds4mor"><img draggable="false"/></button>`),ov=z(`<div class="pn_image_container pn_image_container--static svelte-ds4mor"><img draggable="false"/></div>`),sv={hash:`svelte-ds4mor`,code:`.pn_image_container.svelte-ds4mor {width:100%;height:100%;display:block;position:relative;overflow:hidden;border:none;padding:0;background:var(--background-secondary);}.pn_image_container--static.svelte-ds4mor {cursor:default;}.pn_image_container.svelte-ds4mor:not(.pn_image_container--static) {cursor:pointer;}.pn_image_container.svelte-ds4mor img:where(.svelte-ds4mor) {display:block;width:100%;height:100%;object-fit:cover;}`};function cv(e,t){lt(t,!1),Gs(e,sv);let n=V(t,`src`,8),r=V(t,`alt`,8),i=V(t,`fadeIn`,8,!1),a=V(t,`opacity`,8,0),o=V(t,`interactive`,8,!1),s=V(t,`loading`,8,`lazy`),c=V(t,`class`,8,``),l=A(!1),u=A(!0),d=A(!1),f=Fc();function p(e){f(`click`,{event:e})}Oc();var m=os(),h=Rt(m),g=e=>{var t=os(),f=Rt(t),m=e=>{var t=av(),o=w(t);let f;C(t),ta(()=>{oc(o,`src`,n()),oc(o,`alt`,r()),oc(o,`loading`,s()),ec(o,1,Js(c()),`svelte-ds4mor`),f=nc(o,``,f,{opacity:a()?a():i()?+!!N(l):1,transition:i()?`opacity 0.5s ease-out`:``})}),R(`load`,o,()=>{j(l,!0),j(u,!1)}),R(`error`,o,()=>{j(d,!0),j(u,!1)}),R(`click`,t,p),B(e,t)},h=e=>{var t=ov(),o=w(t);let f;C(t),ta(()=>{oc(o,`src`,n()),oc(o,`alt`,r()),oc(o,`loading`,s()),ec(o,1,Js(c()),`svelte-ds4mor`),f=nc(o,``,f,{opacity:a()?a():i()?+!!N(l):1,transition:i()?`opacity 0.5s ease-out`:``})}),R(`load`,o,()=>{j(l,!0),j(u,!1)}),R(`error`,o,()=>{j(d,!0),j(u,!1)}),B(e,t)};Ss(f,e=>{o()?e(m):e(h,-1)}),B(e,t)},_=e=>{var n=os();Ps(Rt(n),t,`fallback`,{},null),B(e,n)};Ss(h,e=>{N(u)||N(l)?e(g):N(d)&&e(_,1)}),B(e,m),ut()}var lv={hash:`svelte-o3c98i`,code:`.podcast-image {width:100%;height:100%;aspect-ratio:1;cursor:pointer !important;object-fit:cover;background-size:cover;background-position:center;background-repeat:no-repeat;border:1px solid var(--background-modifier-border);border-radius:0.5rem;transition:transform 150ms ease,
|
|||
|
|
box-shadow 150ms ease,
|
|||
|
|
border-color 150ms ease;}.podcast-image:hover {transform:scale(1.02);border-color:var(--interactive-accent);box-shadow:0 4px 12px rgba(0, 0, 0, 0.15);}.podcast-image:active {transform:scale(0.98);}`};function uv(e,t){lt(t,!1),Gs(e,lv);let n=V(t,`feed`,8),r=Fc();function i(e){r(`clickPodcast`,{feed:e})}Oc();var a=ir(()=>i.bind(null,n()));cv(e,{get src(){return F(n()),P(()=>n().artworkUrl)},get alt(){return F(n()),P(()=>n().title)},interactive:!0,class:`podcast-image`,$$events:{click(...e){N(a)?.apply(this,e)}}}),ut()}var dv=z(`<div><p>No saved podcasts.</p></div>`),fv=z(`<div class="podcast-grid svelte-1x0bcng"><!> <!></div>`),pv={hash:`svelte-1x0bcng`,code:`.podcast-grid.svelte-1x0bcng {display:grid;grid-template-columns:repeat(auto-fill, minmax(6rem, 1fr));grid-auto-rows:min-content;gap:0.5rem;padding:0.5rem;flex:1;min-height:0;overflow-y:auto;}
|
|||
|
|
|
|||
|
|
@media (min-width: 400px) {.podcast-grid.svelte-1x0bcng {grid-template-columns:repeat(auto-fill, minmax(7rem, 1fr));gap:0.75rem;padding:0.75rem;}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
@media (min-width: 600px) {.podcast-grid.svelte-1x0bcng {grid-template-columns:repeat(auto-fill, minmax(8rem, 1fr));}
|
|||
|
|
}`};function mv(e,t){lt(t,!1),Gs(e,pv);let n=V(t,`feeds`,24,()=>[]),r=V(t,`playlists`,24,()=>[]),i=Fc();function a({detail:{playlist:e,event:t}}){i(`clickPlaylist`,{playlist:e,event:t})}Oc();var o=fv(),s=w(o),c=e=>{var t=os();Ds(Rt(t),1,r,e=>e.name,(e,t)=>{iv(e,{get playlist(){return N(t)},$$events:{clickPlaylist:a}})}),B(e,t)};Ss(s,e=>{F(r()),P(()=>r().length>0)&&e(c)});var l=T(s,2),u=e=>{var r=os();Ds(Rt(r),1,n,e=>e.url,(e,n)=>{uv(e,{get feed(){return N(n)},$$events:{clickPodcast(e){Ac.call(this,t,e)}}})}),B(e,r)},d=e=>{B(e,dv())};Ss(l,e=>{F(n()),P(()=>n().length>0)?e(u):e(d,-1)}),C(o),B(e,o),ut()}var hv=z(`<span></span>`);function gv(e,t){lt(t,!1);let n=V(t,`value`,8),i=V(t,`limits`,8),a=A(),o=Fc(),s=A(),c=V(t,`style`,24,()=>({})),l=null,u=!1;Mc(()=>{j(s,new r.SliderComponent(N(a))),l=e=>{if(u)return;let t=Number(e.target.value);o(`change`,{value:t})},N(s).sliderEl.addEventListener(`input`,l)}),Nc(()=>{N(s)?.sliderEl&&l&&N(s).sliderEl.removeEventListener(`input`,l)});function d(e,t,n,r){let i=typeof e.getValue==`function`?e.getValue():Number(e.sliderEl?.value);t!==void 0&&i!==t&&(u=!0,e.setValue(t),u=!1),n&&(n.length===2?e.setLimits(n[0],n[1],1):e.setLimits(n[0],n[1],n[2])),r&&e.sliderEl.setAttr(`style`,Bc(r))}Zi(()=>(N(s),F(n()),F(i()),F(c())),()=>{N(s)&&d(N(s),n(),i(),c())}),Qi(),Oc();var f=hv();Tc(f,e=>j(a,e),()=>N(a)),B(e,f),ut()}var _v=z(`<div class="la-line-scale svelte-k6ycv0"><div class="svelte-k6ycv0"></div> <div class="svelte-k6ycv0"></div> <div class="svelte-k6ycv0"></div> <div class="svelte-k6ycv0"></div> <div class="svelte-k6ycv0"></div></div>`),vv={hash:`svelte-k6ycv0`,code:`
|
|||
|
|
/*!
|
|||
|
|
* Load Awesome v1.1.0 (http://github.danielcardoso.net/load-awesome/)
|
|||
|
|
* Copyright 2015 Daniel Cardoso <@DanielCardoso>
|
|||
|
|
* Licensed under MIT
|
|||
|
|
*/.la-line-scale.svelte-k6ycv0,
|
|||
|
|
.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0) {position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;}.la-line-scale.svelte-k6ycv0 {display:block;font-size:0;color:#fff;}
|
|||
|
|
/* .la-line-scale.la-dark {
|
|||
|
|
color: #333;
|
|||
|
|
} */.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0) {display:inline-block;float:none;background-color:currentColor;border:0 solid currentColor;}.la-line-scale.svelte-k6ycv0 {width:40px;height:32px;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0) {width:4px;height:32px;margin:2px;margin-top:0;margin-bottom:0;border-radius:0;
|
|||
|
|
-webkit-animation: svelte-k6ycv0-line-scale 1.2s infinite ease;
|
|||
|
|
-moz-animation: svelte-k6ycv0-line-scale 1.2s infinite ease;
|
|||
|
|
-o-animation: svelte-k6ycv0-line-scale 1.2s infinite ease;
|
|||
|
|
animation: svelte-k6ycv0-line-scale 1.2s infinite ease;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0):nth-child(1) {-webkit-animation-delay:-1.2s;-moz-animation-delay:-1.2s;-o-animation-delay:-1.2s;animation-delay:-1.2s;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0):nth-child(2) {-webkit-animation-delay:-1.1s;-moz-animation-delay:-1.1s;-o-animation-delay:-1.1s;animation-delay:-1.1s;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0):nth-child(3) {-webkit-animation-delay:-1s;-moz-animation-delay:-1s;-o-animation-delay:-1s;animation-delay:-1s;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0):nth-child(4) {-webkit-animation-delay:-0.9s;-moz-animation-delay:-0.9s;-o-animation-delay:-0.9s;animation-delay:-0.9s;}.la-line-scale.svelte-k6ycv0 > div:where(.svelte-k6ycv0):nth-child(5) {-webkit-animation-delay:-0.8s;-moz-animation-delay:-0.8s;-o-animation-delay:-0.8s;animation-delay:-0.8s;}
|
|||
|
|
/* .la-line-scale.la-sm {
|
|||
|
|
width: 20px;
|
|||
|
|
height: 16px;
|
|||
|
|
}
|
|||
|
|
.la-line-scale.la-sm > div {
|
|||
|
|
width: 2px;
|
|||
|
|
height: 16px;
|
|||
|
|
margin: 1px;
|
|||
|
|
margin-top: 0;
|
|||
|
|
margin-bottom: 0;
|
|||
|
|
}
|
|||
|
|
.la-line-scale.la-2x {
|
|||
|
|
width: 80px;
|
|||
|
|
height: 64px;
|
|||
|
|
}
|
|||
|
|
.la-line-scale.la-2x > div {
|
|||
|
|
width: 8px;
|
|||
|
|
height: 64px;
|
|||
|
|
margin: 4px;
|
|||
|
|
margin-top: 0;
|
|||
|
|
margin-bottom: 0;
|
|||
|
|
}
|
|||
|
|
.la-line-scale.la-3x {
|
|||
|
|
width: 120px;
|
|||
|
|
height: 96px;
|
|||
|
|
}
|
|||
|
|
.la-line-scale.la-3x > div {
|
|||
|
|
width: 12px;
|
|||
|
|
height: 96px;
|
|||
|
|
margin: 6px;
|
|||
|
|
margin-top: 0;
|
|||
|
|
margin-bottom: 0;
|
|||
|
|
}*/
|
|||
|
|
/*
|
|||
|
|
* Animation
|
|||
|
|
*/
|
|||
|
|
@-webkit-keyframes svelte-k6ycv0-line-scale {
|
|||
|
|
0%,
|
|||
|
|
40%,
|
|||
|
|
100% {
|
|||
|
|
-webkit-transform: scaleY(0.4);
|
|||
|
|
transform: scaleY(0.4);
|
|||
|
|
}
|
|||
|
|
20% {
|
|||
|
|
-webkit-transform: scaleY(1);
|
|||
|
|
transform: scaleY(1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
@-moz-keyframes svelte-k6ycv0-line-scale {
|
|||
|
|
0%,
|
|||
|
|
40%,
|
|||
|
|
100% {
|
|||
|
|
-webkit-transform: scaleY(0.4);
|
|||
|
|
-moz-transform: scaleY(0.4);
|
|||
|
|
transform: scaleY(0.4);
|
|||
|
|
}
|
|||
|
|
20% {
|
|||
|
|
-webkit-transform: scaleY(1);
|
|||
|
|
-moz-transform: scaleY(1);
|
|||
|
|
transform: scaleY(1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
@-o-keyframes svelte-k6ycv0-line-scale {
|
|||
|
|
0%,
|
|||
|
|
40%,
|
|||
|
|
100% {
|
|||
|
|
-webkit-transform: scaleY(0.4);
|
|||
|
|
-o-transform: scaleY(0.4);
|
|||
|
|
transform: scaleY(0.4);
|
|||
|
|
}
|
|||
|
|
20% {
|
|||
|
|
-webkit-transform: scaleY(1);
|
|||
|
|
-o-transform: scaleY(1);
|
|||
|
|
transform: scaleY(1);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
@keyframes svelte-k6ycv0-line-scale {
|
|||
|
|
0%,
|
|||
|
|
40%,
|
|||
|
|
100% {
|
|||
|
|
-webkit-transform: scaleY(0.4);
|
|||
|
|
-moz-transform: scaleY(0.4);
|
|||
|
|
-o-transform: scaleY(0.4);
|
|||
|
|
transform: scaleY(0.4);
|
|||
|
|
}
|
|||
|
|
20% {
|
|||
|
|
-webkit-transform: scaleY(1);
|
|||
|
|
-moz-transform: scaleY(1);
|
|||
|
|
-o-transform: scaleY(1);
|
|||
|
|
transform: scaleY(1);
|
|||
|
|
}
|
|||
|
|
}`};function yv(e){Gs(e,vv),B(e,_v())}var bv=z(`<div class="image-loader svelte-jp8vu"><!></div>`),xv={hash:`svelte-jp8vu`,code:`.image-loader.svelte-jp8vu {position:relative;width:100%;}`};function Sv(e,t){lt(t,!1),Gs(e,xv);let n=A(),r=A(),i=A(),a=V(t,`src`,8),o=V(t,`alt`,8),s=V(t,`fadeIn`,8,!1),c=V(t,`interactive`,8,!1),l=V(t,`width`,8),u=V(t,`height`,8),d=V(t,`aspectRatio`,8,`1 / 1`),f=V(t,`loading`,8,`lazy`),p=V(t,`class`,8,``),m=Fc(),h=e=>typeof e==`number`?`${e}px`:e;Zi(()=>F(l()),()=>{j(n,h(l()))}),Zi(()=>F(u()),()=>{j(r,h(u()))}),Zi(()=>(N(r),F(d())),()=>{j(i,N(r)?void 0:d())}),Qi(),Oc();var g=bv();let _;cv(w(g),{get alt(){return o()},get src(){return a()},get fadeIn(){return s()},get interactive(){return c()},get loading(){return f()},get class(){return p()},$$events:{click:e=>m(`click`,{event:e})}}),C(g),ta(()=>_=nc(g,``,_,{width:N(n),height:N(r),"aspect-ratio":N(i)})),B(e,g),ut()}var Cv=z(`<div class="podcast-episode-thumbnail-container svelte-dmhmse"><!></div>`),wv=z(`<div class="podcast-episode-thumbnail-container svelte-dmhmse"></div>`),Tv=z(`<span class="episode-item-status svelte-dmhmse"> </span>`),Ev=z(`<div class="podcast-episode-row svelte-dmhmse"><button type="button" class="podcast-episode-item svelte-dmhmse"><!> <div class="podcast-episode-information svelte-dmhmse"><span class="episode-item-date svelte-dmhmse"> </span> <span> </span> <!></div></button> <div class="podcast-episode-overflow svelte-dmhmse"><!></div></div>`),Dv={hash:`svelte-dmhmse`,code:`.podcast-episode-row.svelte-dmhmse {position:relative;display:flex;align-items:stretch;border-bottom:1px solid var(--background-modifier-border);}.podcast-episode-row.svelte-dmhmse:last-child {border-bottom:none;}.podcast-episode-item.svelte-dmhmse {display:flex;flex-direction:row;justify-content:flex-start;align-items:center;padding:0.625rem 2.5rem 0.625rem 0.75rem;min-height:4.5rem;width:100%;border:none;gap:0.75rem;background:transparent;text-align:left;cursor:pointer;transition:background-color 120ms ease;}.podcast-episode-item.svelte-dmhmse:focus-visible {outline:2px solid var(--interactive-accent);outline-offset:-2px;border-radius:0.25rem;}.podcast-episode-item.svelte-dmhmse:hover {background-color:var(--background-secondary-alt);}.podcast-episode-item.svelte-dmhmse:active {background-color:var(--background-modifier-border);}.podcast-episode-overflow.svelte-dmhmse {position:absolute;top:50%;right:0.25rem;transform:translateY(-50%);display:flex;align-items:center;}.podcast-episode-overflow.svelte-dmhmse .icon-button {padding:0.35rem;border-radius:0.375rem;color:var(--text-muted);transition:background-color 120ms ease,
|
|||
|
|
color 120ms ease;}.podcast-episode-overflow.svelte-dmhmse .icon-button:hover {background-color:var(--background-modifier-hover);color:var(--text-normal);}.podcast-episode-overflow.svelte-dmhmse .icon-button:focus-visible {outline:2px solid var(--interactive-accent);outline-offset:-2px;}.strikeout.svelte-dmhmse {text-decoration:line-through;opacity:0.6;}.podcast-episode-item.svelte-dmhmse:has(.episode-item-status:where(.svelte-dmhmse)) {opacity:0.75;}.podcast-episode-information.svelte-dmhmse {display:flex;flex-direction:column;justify-content:center;align-items:flex-start;gap:0.25rem;flex:1 1 auto;min-width:0;}.episode-item-date.svelte-dmhmse {font-size:0.75rem;font-weight:500;letter-spacing:0.025em;color:var(--text-muted);}.episode-item-title.svelte-dmhmse {font-size:0.9rem;line-height:1.4;color:var(--text-normal);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;}.podcast-episode-thumbnail-container.svelte-dmhmse {flex:0 0 3.5rem;width:3.5rem;height:3.5rem;display:flex;align-items:center;justify-content:center;background:var(--background-secondary);border-radius:0.375rem;overflow:hidden;}
|
|||
|
|
|
|||
|
|
@media (min-width: 400px) {.podcast-episode-thumbnail-container.svelte-dmhmse {flex:0 0 4rem;width:4rem;height:4rem;}
|
|||
|
|
}.podcast-episode-thumbnail {width:100%;height:100%;object-fit:cover;border-radius:0.375rem;}.episode-item-status.svelte-dmhmse {font-size:0.75rem;color:var(--text-muted);}`};function Ov(e,t){lt(t,!1),Gs(e,Dv);let n=V(t,`episode`,8),r=V(t,`episodeFinished`,8,!1),i=V(t,`showEpisodeImage`,8,!1),a=V(t,`unavailableReason`,8,void 0),o=Fc(),s=new Intl.DateTimeFormat(`en-GB`,{day:`2-digit`,month:`long`,year:`numeric`}),c=new Map,l=A();function u(){o(`clickEpisode`,{episode:n()})}function d(e){o(`contextMenu`,{episode:n(),event:e})}function f(){if(!N(l))return;let e=N(l).getBoundingClientRect();o(`contextMenu`,{episode:n(),event:{x:e.left,y:e.bottom}})}function p(e){if(!e)return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t}function m(e,t){return`${e.url??e.streamUrl??e.title??`episode`}|${t.getTime()}`}function h(e){let t=p(e?.episodeDate);if(!t)return``;let n=m(e,t),r=c.get(n);if(r)return r;let i=s.format(t).toUpperCase();return c.set(n,i),i}let g=A(``);Zi(()=>F(n()),()=>{j(g,h(n()))}),Qi(),Oc();var _=Ev(),v=w(_),y=w(v),b=e=>{var t=Cv();Sv(w(t),{get src(){return F(n()),P(()=>n().artworkUrl)},get alt(){return F(n()),P(()=>n().title)},fadeIn:!0,width:`100%`,height:`100%`,class:`podcast-episode-thumbnail`}),C(t),B(e,t)},x=e=>{B(e,wv())};Ss(y,e=>{F(i()),F(n()),P(()=>i()&&n()?.artworkUrl)?e(b):i()&&e(x,1)});var S=T(y,2),ee=w(S),te=w(ee,!0);C(ee);var ne=T(ee,2),re=w(ne,!0);C(ne);var ie=T(ne,2),ae=e=>{var t=Tv(),n=w(t,!0);C(t),ta(()=>cs(n,a())),B(e,t)};Ss(ie,e=>{a()&&e(ae)}),C(S),C(v);var oe=T(v,2),se=w(oe);{let e=ar(()=>(F(n()),P(()=>`More options for ${n().title}`)));Wc(se,{icon:`more-vertical`,size:20,get label(){return N(e)},$$events:{click:f}})}C(oe),Tc(oe,e=>j(l,e),()=>N(l)),C(_),ta(()=>{oc(v,`title`,(F(a()),F(n()),P(()=>a()??n().title))),cs(te,N(g)),ec(ne,1,`episode-item-title ${r()&&`strikeout`}`,`svelte-dmhmse`),cs(re,(F(n()),P(()=>n().title)))}),R(`click`,v,u),R(`contextmenu`,v,d),B(e,_),ut()}function kv(e){return{episode:e,isAvailable:!0}}function Av(e){return e.map(kv)}function jv(e,t){let n=Pv(t.flat());return Ya(e).map(({key:e,episode:t})=>Mv(e,t,n)).sort(Iv)}function Mv(e,t,n){let r=Nv(e,t,n);return r?{episode:r,isAvailable:!0,playedEpisode:t,playedEpisodeKey:e}:{episode:Fv(t),isAvailable:!1,unavailableReason:`Unavailable in current feeds`,playedEpisode:t,playedEpisodeKey:e}}function Nv(e,t,n){let r=[e,qa(t),t.title];for(let e of r){let t=n.get(e);if(t)return t}}function Pv(e){let t=new Map;for(let n of e){let e=[Ha(n),n.podcastName?`${n.podcastName}::${n.title}`:``,n.title].filter(Boolean);for(let r of e)t.has(r)||t.set(r,n)}return t}function Fv(e){return{title:e.title,podcastName:e.podcastName,streamUrl:``,url:``,description:``,content:``}}function Iv(e,t){if(e.isAvailable!==t.isAvailable)return e.isAvailable?-1:1;let n=Lv(e.episode),r=Lv(t.episode);return n===r?e.episode.title.localeCompare(t.episode.title):r-n}function Lv(e){if(!e.episodeDate)return 0;let t=Number(new Date(e.episodeDate));return Number.isNaN(t)?0:t}var Rv=z(`<div class="episode-list-menu svelte-ozfrsd"><div class="episode-list-search svelte-ozfrsd"><!></div> <!> <!></div>`),zv=z(`<div class="episode-list-loading svelte-ozfrsd" role="status" aria-live="polite"><!> <span>Fetching episodes...</span></div>`),Bv=z(`<p class="svelte-ozfrsd">No episodes found.</p>`),Vv=z(`<div class="episode-list-view-container svelte-ozfrsd"><!> <!> <div class="podcast-episode-list svelte-ozfrsd"><!> <!> <!></div></div>`),Hv={hash:`svelte-ozfrsd`,code:`.episode-list-view-container.svelte-ozfrsd {display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:100%;height:100%;overflow:hidden;}.podcast-episode-list.svelte-ozfrsd {display:flex;flex-direction:column;align-items:stretch;justify-content:flex-start;width:100%;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;}.podcast-episode-list.svelte-ozfrsd p:where(.svelte-ozfrsd) {padding:1.5rem;text-align:center;color:var(--text-muted);}.episode-list-menu.svelte-ozfrsd {display:flex;flex-direction:row;justify-content:flex-end;align-items:center;gap:0.5rem;width:100%;padding:0.5rem
|
|||
|
|
.progress.svelte-aac6sw:focus-visible {height:0.625rem;}.progress.svelte-aac6sw:focus-visible {outline:2px solid var(--interactive-accent);outline-offset:2px;}.progress__bar.svelte-aac6sw {position:absolute;top:0;left:0;height:100%;background:var(--interactive-accent);border-radius:9999px;transition:width 50ms linear;}`};function Zv(e,t){lt(t,!1),Gs(e,Xv);let n=V(t,`max`,8),r=V(t,`value`,8),i=V(t,`ariaLabel`,8,`Seek`),a=V(t,`valueText`,8,void 0),o=!1,s=V(t,`style`,24,()=>({})),c=A(),l=A(),u=Fc();function d(e,t){u(`click`,{event:e,percent:t})}function f(){o=!0}function p(){o=!1}function m(e){o&&d(e)}function h(e){if(!N(c)||!n())return;let t=n()*.05,i=r();switch(e.key){case`ArrowRight`:case`ArrowUp`:i=Math.min(n(),r()+t);break;case`ArrowLeft`:case`ArrowDown`:i=Math.max(0,r()-t);break;case`Home`:i=0;break;case`End`:i=n();break;case`Enter`:case` `:i=r();break;default:return}e.preventDefault(),d(e,n()?i/n():0)}Zi(()=>F(s()),()=>{j(l,Bc(s()))}),Qi(),Oc();var g=Yv(),_=w(g);C(g),Tc(g,e=>j(c,e),()=>N(c)),ta(e=>{oc(g,`aria-label`,i()),oc(g,`aria-valuemax`,n()),oc(g,`aria-valuenow`,r()),oc(g,`aria-valuetext`,a()),nc(g,N(l)),nc(_,e)},[()=>(F(n()),F(r()),P(()=>`width: ${n()?Math.min(100,r()/n()*100):0}%;`))]),R(`click`,g,d),R(`mousedown`,g,f),R(`mouseup`,g,p),R(`mousemove`,g,m),R(`keydown`,g,h),B(e,g),ut()}function Qv(e,t,n){if(e!==I.Player)return[];let r=t.findIndex(e=>e.title===n.title);if(r===-1||t.length<=1)return[];let i=[],a=r===0,o=r===t.length-1;return a||(i.push({icon:`chevrons-up`,title:`Move to top of queue`,kind:`top`,index:r}),i.push({icon:`chevron-up`,title:`Move up in queue`,kind:`up`,index:r})),o||(i.push({icon:`chevron-down`,title:`Move down in queue`,kind:`down`,index:r}),i.push({icon:`chevrons-down`,title:`Move to bottom of queue`,kind:`bottom`,index:r})),i}function $v(e,t,n,i){let a=new r.Menu;if(n?.play||a.addItem(t=>t.setIcon(`play`).setTitle(`Play`).onClick(()=>{Co.set(e),Io.set(I.Player)})),!n?.markPlayed){let t=E(To),n=i?t[i]?.finished??Ka(e,t):Ka(e,t);a.addItem(t=>t.setIcon(n?`x`:`check`).setTitle(`Mark as ${n?`Unplayed`:`Played`}`).onClick(()=>{n?i?To.markKeyAsUnplayed(i):To.markAsUnplayed(e):To.markAsPlayed(e)}))}if(!n?.download){let t=ho.isEpisodeDownloaded(e);a.addItem(n=>n.setIcon(t?`cross`:`download`).setTitle(t?`Remove file`:`Download`).onClick(()=>{t?zm(e):Pm(e,E(L).settings.download.path).catch(e=>void 0)}))}if(!n?.createNote){let t=!!op(e);a.addItem(n=>n.setIcon(`pencil`).setTitle(`${t?`Open`:`Create`} Note`).onClick(async()=>{if(t)cp(e);else{let{path:t,template:n}=E(L).settings.note;if(!(t&&n)){new r.Notice(`Please set a note path and template in the settings.`);return}await rp(e)}}));let n=ey(e),i=!!Jp(n);a.addItem(e=>e.setIcon(`rss`).setTitle(`${i?`Open`:`Create`} feed note`).onClick(async()=>{if(i)Yp(n);else{let{path:e,template:t}=E(L).settings.feedNote;if(!e||!t){new r.Notice(`Please set a podcast feed note path and template in the settings.`);return}await Xp(n)}}))}if(!n?.favorite){let t=E(Ao).episodes.find(t=>Wa(t,e));a.addItem(n=>n.setIcon(`lucide-star`).setTitle(`${t?`Remove from`:`Add to`} Favorites`).onClick(()=>{t?Ao.update(t=>(t.episodes=t.episodes.filter(t=>!Wa(t,e)),t)):Ao.update(t=>(t.episodes=[...t.episodes,e],t))}))}if(!n?.queue){let t=E(ko).episodes.find(t=>t.title===e.title);a.addItem(n=>n.setIcon(`list-ordered`).setTitle(`${t?`Remove from`:`Add to`} Queue`).onClick(()=>{t?ko.remove(e):ko.add(e)}));let n=Qv(E(Io),E(ko).episodes,e);if(n.length>0){a.addSeparator();for(let t of n)a.addItem(n=>n.setIcon(t.icon).setTitle(t.title).onClick(()=>{let n=E(ko).episodes.findIndex(t=>t.title===e.title);if(n!==-1)switch(t.kind){case`top`:ko.moveToTop(n);break;case`up`:ko.moveUp(n);break;case`down`:ko.moveDown(n);break;case`bottom`:ko.moveToBottom(n)}}))}}if(!n?.playlists){let t=E(Po),n=Object.values(t);if(n.length>0){a.addSeparator();for(let t of n){let n=t.episodes.find(t=>Wa(t,e));a.addItem(r=>r.setIcon(t.icon).setTitle(`${n?`Remove from`:`Add to`} ${t.name}`).onClick(()=>{n?Po.update(n=>(n[t.name].episodes=n[t.name].episodes.filter(t=>!Wa(t,e)),n)):Po.update(n=>{let r=[...n[t.name].episo
|
|||
|
|
transform 200ms ease;}.hover-container.svelte-vlhi04:hover {box-shadow:0 6px 24px rgba(0, 0, 0, 0.25);}.hover-container.svelte-vlhi04:active {transform:scale(0.98);}.hover-container.svelte-vlhi04 .pn_image_container {position:absolute;inset:0;}.podcast-artwork {width:100%;height:100%;object-fit:cover;transition:opacity 200ms ease;}.podcast-artwork-placeholder {width:100%;height:100%;position:absolute;display:flex;align-items:center;justify-content:center;background:var(--background-secondary);transition:opacity 200ms ease;}.podcast-artwork-overlay.svelte-vlhi04 {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;background:rgba(0, 0, 0, 0.1);transition:opacity 200ms ease;}.podcast-video-overlay.svelte-vlhi04 {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;opacity:0;border:none;background:rgba(0, 0, 0, 0.1);color:var(--text-on-accent);cursor:pointer;transition:opacity 200ms ease;}.episode-video-container.svelte-vlhi04:hover .podcast-video-overlay:where(.svelte-vlhi04),
|
|||
|
|
.podcast-video-overlay.svelte-vlhi04:focus-visible,
|
|||
|
|
.podcast-artwork-overlay.visible.svelte-vlhi04,
|
|||
|
|
.podcast-video-overlay.visible.svelte-vlhi04 {opacity:1;}.podcast-video-overlay.svelte-vlhi04:focus-visible {outline:2px solid var(--background-modifier-border-focus);outline-offset:-4px;}.podcast-video-fullscreen.svelte-vlhi04 {position:absolute;right:0.5rem;bottom:0.5rem;display:flex;align-items:center;justify-content:center;padding:0.35rem;border:none;border-radius:0.375rem;background:rgba(0, 0, 0, 0.45);color:var(--text-on-accent);cursor:pointer;opacity:0;transition:opacity 200ms ease,
|
|||
|
|
background-color 120ms ease;}.episode-video-container.svelte-vlhi04:hover .podcast-video-fullscreen:where(.svelte-vlhi04),
|
|||
|
|
.podcast-video-fullscreen.svelte-vlhi04:focus-visible {opacity:1;}.podcast-video-fullscreen.svelte-vlhi04:hover {background:rgba(0, 0, 0, 0.65);}.podcast-video-fullscreen.svelte-vlhi04:focus-visible {outline:2px solid var(--background-modifier-border-focus);outline-offset:2px;}.podcast-artwork-load-error.svelte-vlhi04 {position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0.5rem;text-align:center;padding:0.5rem;background-color:rgba(0, 0, 0, 0.6);color:var(--text-error);font-size:0.85rem;}.podcast-artwork-isloading-overlay.svelte-vlhi04 {position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:rgba(0, 0, 0, 0.3);}.opacity-50 {opacity:0.5;}.podcast-title.svelte-vlhi04 {
|
|||
|
|
/*
|
|||
|
|
* Scale the title down as it gets longer (issue #81) so a long episode
|
|||
|
|
* title no longer renders at one large fixed size. Titles up to ~40
|
|||
|
|
* characters render at the 1rem base; beyond that the size eases down
|
|||
|
|
* (0.0025rem per extra character) toward a readable 0.875rem floor,
|
|||
|
|
* reached around ~90 characters. --title-char-count is an approximate
|
|||
|
|
* length signal (UTF-16 code units, set from the title in the markup), so
|
|||
|
|
* it only loosely tracks rendered width for non-Latin scripts;
|
|||
|
|
* word-break: break-word below is what actually keeps any title contained.
|
|||
|
|
*/font-size:clamp(
|
|||
|
|
0.875rem,
|
|||
|
|
calc(1rem - (var(--title-char-count, 0) - 40) * 0.0025rem),
|
|||
|
|
1rem
|
|||
|
|
);font-weight:600;line-height:1.4;margin:0 0 0.75rem;text-align:center;color:var(--text-normal);white-space:normal;word-break:break-word;}.status-container.svelte-vlhi04 {display:flex;align-items:center;gap:0.75rem;padding:0 0.25rem;}.status-container.svelte-vlhi04 span:where(.svelte-vlhi04) {font-size:0.8rem;font-variant-numeric:tabular-nums;color:var(--text-muted);min-width:4rem;text-align:center;}.status-container.svelte-vlhi04 span:where(.svelte-vlhi04):first-child {text-align:right;}.status-container.svelte-vlhi04 span:where(.svelte-vlhi04):last-child {text-align:left;}.episode-player .status-container .progress {height:var(--episode-player-progress-height, 0.5rem);flex:1 1 auto;}.controls-container.svelte-vlhi04 {display:flex;align-items:center;justify-content:center;gap:2rem;margin:1.25rem 0;}.player-control-button {margin:0;cursor:pointer;padding:0.5rem;border-radius:50%;transition:background-color 120ms ease;}.player-control-button:hover {background-color:var(--background-modifier-hover);}.slider-stack.svelte-vlhi04 {display:flex;flex-direction:column;gap:1rem;padding:1rem 0 0.75rem;border-top:1px solid var(--background-modifier-border);}.playbackrate-container.svelte-vlhi04,
|
|||
|
|
.volume-container.svelte-vlhi04 {display:flex;align-items:center;gap:1rem;padding:0 0.5rem;}.playbackrate-container.svelte-vlhi04 span:where(.svelte-vlhi04),
|
|||
|
|
.volume-container.svelte-vlhi04 span:where(.svelte-vlhi04) {font-size:0.8rem;color:var(--text-muted);min-width:5rem;}.episode-player h3 {font-size:0.875rem;font-weight:600;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.05em;margin:1rem 0 0.5rem;padding:0 0.5rem;}.episode-player .episode-list-view-container {height:auto;overflow:visible;}.episode-player .podcast-episode-list {flex:0 0 auto;overflow:visible;}.lists-container.svelte-vlhi04 {display:flex;flex-direction:column;gap:0.25rem;padding-bottom:0.5rem;}.lists-container .episode-list-view-container {height:auto;}`};function fy(e,t){lt(t,!1),Gs(e,dy);let n=()=>sn(L,`$plugin`,p),r=()=>sn(ko,`$queue`,p),i=()=>sn(Co,`$currentEpisode`,p),a=()=>sn(ho,`$downloadedEpisodes`,p),o=()=>sn(yo,`$duration`,p),s=()=>sn(vo,`$activePlaybackSegment`,p),c=()=>sn(go,`$currentTime`,p),l=()=>sn(To,`$playedEpisodes`,p),u=()=>sn(_o,`$requestedPlaybackTime`,p),d=()=>sn(bo,`$playbackRate`,p),f=()=>sn(wo,`$isPaused`,p),[p,m]=ln(),h=A(),g=A(),_=A(),v=A(),y=e=>Math.min(1,Math.max(0,e)),b=A(Ae(i())),x=A(!1),S=A(!0),ee=A(null),te=!1,ne=A(1),re=A(null),ie=!1,ae=A([]),oe,se=null;function ce(){wo.update(e=>!e)}function le({detail:{event:e,percent:t}}){if(typeof t==`number`){ge(t*o());return}if(e instanceof MouseEvent){let t=e.currentTarget;ge((t.offsetWidth?e.offsetX/t.offsetWidth:0)*o())}}function ue(){Po.update(e=>(Object.values(e).forEach(e=>{e.episodes=e.episodes.filter(e=>!Wa(e,i()))}),e)),ko.remove(i())}function de(){let e=s();if(e&&Ua(i(),e.episodeKey)){let t=Number.isFinite(o())&&o()>0?Math.min(e.endTime,o()):c();go.set(t),se=t,vo.set(null),wo.set(!0);return}To.markAsPlayed(i()),ue(),ko.playNext()}function fe(e){bo.set(Pa(e.detail.value))}function pe(e){let t=y(e.detail.value);xo.set(t)}function me(e){ge(e.detail.time)}function he(){let e=N(re)?.closest(`.episode-video-container`);if(e?.requestFullscreen){e.requestFullscreen();return}let t=N(re);t?.requestFullscreen?t.requestFullscreen():t?.webkitEnterFullscreen&&t.webkitEnterFullscreen()}function ge(e){vo.set(null),se=null,go.set(e)}function _e(){j(S,!1),j(ee,null),te=!0,ye()}function ve(){j(S,!1),j(ee,`Could not load this episode's media.`)}function ye(){let e=l(),t=i(),n=u();if(!t){go.set(0),wo.set(!1);return}if(n!==null){if(_o.set(null),vo.set(null),se=null,!Ua(t,n.episodeKey)){be(t,e);return}go.set(n.time),vo.set(n.endTime===void 0?null:{episodeKey:n.episodeKey,startTime:n.time,endTime:n.endTime}),wo.set(!1);return}vo.set(null),se=null,be(t,e)}function be(e,t){let n=Ha(e),r=t[e.title],i=!!r&&(!r.podcastName||!e.podcastName||r.podcastName===e.podcastName),a=n&&t[n]||(i?r:void 0);a?.time?go.set(a.time):go.set(0),wo.set(!1)}let xe=-1/0;function Se(){!te||!i()||we()||To.setEpisodeTime(i(),c(),o(),o()>0&&c()===o())}function Ce(e){if(Te(e))return;let t=Date.now();t-xe<5e3||(xe=t,Se())}function we(){let e=s();return e&&Ua(i(),e.episodeKey)?!0:se===null?!1:c()===se||(se=null,!1)}function Te(e){let t=s();if(!t)return!1;if(!Ua(i(),t.episodeKey))return vo.set(null),!1;if(c()<t.endTime)return!1;let n=e.currentTarget;return n&&(n.currentTime=t.endTime),go.set(t.endTime),se=t.endTime,vo.set(null),wo.set(!0),!0}function Ee(){Se()}Mc(()=>{let e=Co.subscribe(e=>{j(S,!0),j(ee,null),te=!1,xe=-1/0,se=null,ie&&(go.set(0),yo.set(0)),ie=!0;let t=e?.chaptersUrl;if(t&&t!==oe){oe=t,j(ae,[]);let e=t;Uf(e).then(t=>{e===oe&&j(ae,t)})}else t||(oe=void 0,j(ae,[]))}),t=xo.subscribe(e=>{j(ne,y(e))}),n=()=>{document.visibilityState===`hidden`&&Se()};return document.addEventListener(`visibilitychange`,n),()=>{e(),t(),document.removeEventListener(`visibilitychange`,n)}}),Nc(()=>{Se(),wo.set(!0)});function De({detail:{event:e,episode:t}}){$v(t,e)}function Oe(e){$v(i(),e,{play:!0,markPlayed:!0})}function ke(e){let{episode:t}=e.detail;Co.set(t),Io.set(I.Player)}function Ae(e,t={}){if(!e)return{src:``,mediaType:`audio`};let r=je(e,t);return Me(e,r)?{src:ty(n().app.vault,r.filePath),mediaType:Ne(e,r)}:{src:e.streamUrl,mediaType:_p(e)}}function je(e,t){return t[e.podcastName]?.find(t=>t.title===e.title)}function Me(e,t){if(!t?.filePath)return!1;let n=Ne(e,t);
|
|||
|
|
border-color 120ms ease,
|
|||
|
|
color 120ms ease;}.topbar-menu-button.svelte-1uvslqs:focus-visible {outline:2px solid var(--interactive-accent);outline-offset:1px;}.topbar-selectable.svelte-1uvslqs {cursor:pointer;color:var(--text-normal);}.topbar-selectable.svelte-1uvslqs:hover:not(.topbar-selected) {background:var(--background-modifier-hover);}.topbar-selectable.svelte-1uvslqs:active:not(.topbar-selected) {background:var(--background-modifier-border);}.topbar-selected.svelte-1uvslqs,
|
|||
|
|
.topbar-selected.svelte-1uvslqs:hover {color:var(--text-on-accent);background:var(--interactive-accent);}.topbar-disabled.svelte-1uvslqs,
|
|||
|
|
.topbar-menu-button.svelte-1uvslqs:disabled {cursor:not-allowed;color:var(--text-faint);opacity:0.5;}`};function hy(e,t){lt(t,!1),Gs(e,my);let n=A(),r=A(),i=V(t,`viewState`,28,()=>I.PodcastGrid),a=V(t,`canShowEpisodeList`,8,!1),o=V(t,`canShowPlayer`,8,!1);function s(e){i()!==e&&(e===I.EpisodeList&&!a()||e===I.Player&&!o()||i(e))}Zi(()=>F(a()),()=>{j(n,a()?`View episode list`:`Select a podcast or playlist to view its episodes.`)}),Zi(()=>F(o()),()=>{j(r,o()?`Open player`:`Start playing an episode to open the player.`)}),Qi(),Oc();var c=py(),l=w(c),u=ir(()=>s.bind(null,I.PodcastGrid));oc(l,`title`,`Browse podcast grid`),Wc(w(l),{icon:`grid`,size:20,clickable:!1}),C(l);var d=T(l,2),f=ir(()=>s.bind(null,I.EpisodeList));Wc(w(d),{icon:`list-minus`,size:20,clickable:!1}),C(d);var p=T(d,2),m=ir(()=>s.bind(null,I.Player));Wc(w(p),{icon:`play`,size:20,clickable:!1}),C(p),C(c),ta(()=>{ec(l,1,(F(i()),F(I),P(()=>`
|
|||
|
|
topbar-menu-button
|
|||
|
|
topbar-selectable
|
|||
|
|
${i()===I.PodcastGrid?`topbar-selected`:``}
|
|||
|
|
`)),`svelte-1uvslqs`),oc(l,`aria-pressed`,(F(i()),F(I),P(()=>i()===I.PodcastGrid))),ec(d,1,(F(i()),F(I),F(a()),P(()=>`
|
|||
|
|
topbar-menu-button
|
|||
|
|
${i()===I.EpisodeList?`topbar-selected`:``}
|
|||
|
|
${a()?`topbar-selectable`:`topbar-disabled`}
|
|||
|
|
`)),`svelte-1uvslqs`),oc(d,`aria-label`,a()?`Episode list`:`Episode list (select a podcast or playlist first)`),oc(d,`aria-pressed`,(F(i()),F(I),P(()=>i()===I.EpisodeList))),d.disabled=!a(),oc(d,`title`,N(n)),ec(p,1,(F(i()),F(I),F(o()),P(()=>`
|
|||
|
|
topbar-menu-button
|
|||
|
|
${i()===I.Player?`topbar-selected`:``}
|
|||
|
|
${o()?`topbar-selectable`:`topbar-disabled`}
|
|||
|
|
`)),`svelte-1uvslqs`),oc(p,`aria-label`,o()?`Player`:`Player (start playing an episode to open the player)`),oc(p,`aria-pressed`,(F(i()),F(I),P(()=>i()===I.Player))),p.disabled=!o(),oc(p,`title`,N(r))}),R(`click`,l,function(...e){N(u)?.apply(this,e)}),R(`click`,d,function(...e){N(f)?.apply(this,e)}),R(`click`,p,function(...e){N(m)?.apply(this,e)}),B(e,c),ut()}var gy=z(`<img id="podcast-artwork" class="svelte-4w31cc"/>`),_y=z(`<div class="podcast-header svelte-4w31cc"><!> <h2 class="podcast-heading svelte-4w31cc"> </h2></div>`),vy={hash:`svelte-4w31cc`,code:`.podcast-header.svelte-4w31cc {display:flex;flex-direction:column;justify-content:center;align-items:center;gap:0.75rem;padding:1rem;}#podcast-artwork.svelte-4w31cc {width:5rem;height:5rem;border-radius:0.5rem;object-fit:cover;box-shadow:0 2px 8px rgba(0, 0, 0, 0.15);}.podcast-heading.svelte-4w31cc {margin:0;font-size:1.125rem;font-weight:600;text-align:center;color:var(--text-normal);}`};function yy(e,t){Gs(e,vy);let n=V(t,`text`,8,``),r=V(t,`artworkUrl`,8,``);var i=_y(),a=w(i),o=e=>{var t=gy();ta(()=>{oc(t,`src`,r()),oc(t,`alt`,n())}),B(e,t)};Ss(a,e=>{r()&&e(o)});var s=T(a,2),c=w(s,!0);C(s),C(i),ta(()=>cs(c,n())),B(e,i)}var by={shouldSort:!0,findAllMatches:!0,threshold:.4,isCaseSensitive:!1,keys:[`title`]},xy=new WeakMap;function Sy(e){return JSON.stringify(e.map(e=>[e.title,e.streamUrl]))}function Cy(e){let t=Sy(e),n=xy.get(e);if(n&&n.signature===t)return n.fuse;let r=new wu(e,by);return xy.set(e,{fuse:r,signature:t}),r}function wy(e,t){return t.length===0?[]:e.trim().length===0?t:Cy(t).search(e).map(e=>e.item)}var Ty=z(`<span class="feed-loading-names svelte-14kt8yt"> </span>`),Ey=z(`<div class="feed-loading-banner svelte-14kt8yt"><div class="feed-loading-spinner svelte-14kt8yt"><!></div> <div class="feed-loading-text svelte-14kt8yt"><span> </span> <!></div></div>`),Dy=z(`<button type="button" class="go-back svelte-14kt8yt"><!> Latest Episodes</button> <!>`,1),Oy=z(`<button type="button" class="go-back svelte-14kt8yt"><!> Latest Episodes</button> <div class="playlist-header-icon svelte-14kt8yt"><!></div> <!>`,1),ky=z(`<!> <!>`,1),Ay=z(`<div class="podcast-view svelte-14kt8yt"><!> <!></div>`),jy={hash:`svelte-14kt8yt`,code:`.podcast-view.svelte-14kt8yt {display:flex;flex-direction:column;height:100%;overflow:hidden;}.feed-loading-banner.svelte-14kt8yt {display:flex;align-items:center;gap:0.625rem;width:100%;padding:0.625rem 0.75rem;background:var(--background-secondary);border-bottom:1px solid var(--background-modifier-border);box-sizing:border-box;}.feed-loading-spinner.svelte-14kt8yt {display:inline-flex;color:var(--interactive-accent);
|
|||
|
|
animation: svelte-14kt8yt-spin 1s linear infinite;}.feed-loading-text.svelte-14kt8yt {display:flex;flex-direction:column;gap:0.125rem;font-size:0.85rem;color:var(--text-normal);}.feed-loading-names.svelte-14kt8yt {font-size:0.75rem;color:var(--text-muted);}
|
|||
|
|
|
|||
|
|
@keyframes svelte-14kt8yt-spin {
|
|||
|
|
from {
|
|||
|
|
transform: rotate(0deg);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
to {
|
|||
|
|
transform: rotate(360deg);
|
|||
|
|
}
|
|||
|
|
}.go-back.svelte-14kt8yt {display:inline-flex;align-items:center;gap:0.375rem;padding:0.375rem 0.625rem;margin:0.5rem 0.5rem 0;font-size:0.85rem;color:var(--text-muted);cursor:pointer;background:none;border:none;border-radius:0.25rem;transition:color 120ms ease,
|
|||
|
|
background-color 120ms ease;}.go-back.svelte-14kt8yt:hover {color:var(--text-normal);background:var(--background-modifier-hover);}.go-back.svelte-14kt8yt:active {background:var(--background-modifier-border);}.playlist-header-icon.svelte-14kt8yt {display:flex;align-items:center;justify-content:center;padding:0.5rem;color:var(--text-muted);}`};function My(e,t){lt(t,!1),Gs(e,jy);let n=()=>sn(ko,`$queue`,s),i=()=>sn(Co,`$currentEpisode`,s),a=()=>sn(Fo,`$podcastView`,s),o=()=>sn(Io,`$viewState`,s),[s,c]=ln(),l=A(),u=A([]),d=A(null),f=A(null),p=A(!1),m=A([]),h=A(null),g=A([]),_=[],v=A(!1),y=A(new Set),b=``,x=A([]),S=A(``),ee=!0;Nc(()=>{ee=!1}),Mc(()=>{let e=()=>{let e=Object.values(E(Po)),t=E(ko),n=E(L)?.settings?.autoQueue!==!1||t.episodes.length>0;j(g,[...n?[t]:[],E(Ao),E(No),ce(),...e])},t=()=>{e(),me()},n=[Po.subscribe(t),ko.subscribe(e),Ao.subscribe(t),No.subscribe(t),L.subscribe(e),To.subscribe(()=>{e(),N(p)&&de()})],r=ro.subscribe(e=>{let t=Object.values(e),n=new Set(N(u).map(e=>e.title));j(u,t);let r=t.filter(e=>!n.has(e.title));r.length>0&&ve(r)}),i=E(Io),a=Io.subscribe(e=>{i=e}),o=mo.subscribe(e=>{_=e,i===I.EpisodeList&&!N(d)&&!N(f)&&!N(p)&&j(m,b?wy(b,e):e)});return()=>{o(),a(),r(),n.forEach(e=>e())}});function te(){let e=E(L)?.settings?.feedCache;return Math.max(1,e?.ttlHours??6)*60*60*1e3}function ne(){return E(L)?.settings?.feedCache?.enabled!==!1}function re(e,t){return e?.length?!t?.length||e.length>t.length:!1}async function ie(e,t=!0,n=!1){let i=ne(),a=te(),o=E(io)[e.title];if(t&&o&&o.length>0)return o;if(t&&i){let t=Ag(e,a);if(t?.length)return io.update(n=>({...n,[e.title]:t})),t}try{let t=Wp(e,E(L).feedUrls);if(t===null)return[];let n=await new Fp(e).getEpisodes(t);return io.update(t=>({...t,[e.title]:n})),i&&jg(e,n),n}catch{let s=E(ho);if(s[e.title]?.length)return s[e.title];if(!t){if(o?.length)return o;if(i){let t=Ag(e,a);if(t?.length)return io.update(n=>({...n,[e.title]:t})),t}}return n&&new r.Notice(`Could not load episodes for ${e.title}. Check your connection and try again.`),[]}}function ae(){let e=new Set(Ya(E(To)).map(({episode:e})=>e.podcastName));return N(u).filter(t=>e.has(t.title))}async function oe(e,t=!1){let n=ne()?Ag(e,te()):null,r=E(io)[e.title];return re(r,n)?r:ie(e,!1,t)}async function se(e,t=`cached`,n=!1){return t===`network`?ie(e,!1,n):t===`full`?oe(e,n):ie(e,!0,n)}function ce(){return{...Aa,episodes:Ya(E(To)).map(({episode:e})=>Fv(e)),isVirtual:!0}}function le(){let e=Object.values(E(io)),t=Object.values(E(ho)),n=Object.values(E(Po)).map(e=>e.episodes);return[...e,...t,E(ko).episodes,E(Ao).episodes,E(No).episodes,...n]}function ue(e,t){if(!t)return e;let n=new Map(e.map(e=>[e.episode,e]));return wy(t,e.map(e=>e.episode)).map(e=>n.get(e)).filter(e=>!!e)}function de(){let e=jv(E(To),le());j(h,ue(e,b)),j(m,N(h).map(e=>e.episode))}function fe(){return N(p)&&N(f)?.isVirtual&&N(f).name===Aa.name}function pe(){fe()&&de()}function me(){if(!N(f)||N(f).isVirtual)return;let e=N(f).name;if(e===E(ko).name)return;let t;if(e===E(Ao).name)t=E(Ao);else if(e===E(No).name)t=E(No);else if(t=E(Po)[e],!t){he();return}t&&(j(f,t),j(m,b?wy(b,t.episodes):t.episodes))}function he(){j(d,null),j(f,null),j(p,!1),j(h,null),j(m,b?wy(b,_):_),Io.set(I.EpisodeList)}function ge(e){if(`playedEpisodeKey`in e)return typeof e.playedEpisodeKey==`string`?e.playedEpisodeKey:void 0}function _e(e,t){if(!ee)return;let n=new Set(N(y));t?n.add(e):n.delete(e),j(y,n)}function ve(e,t=`cached`){return e.length?Promise.all(e.map(async e=>{_e(e.title,!0);try{await se(e,t)}finally{_e(e.title,!1)}})).then(()=>void 0):Promise.resolve()}async function ye(e){let{feed:t}=e.detail;j(d,t),j(f,null),j(p,!1),j(h,null),j(m,[]),Io.set(I.EpisodeList),_e(t.title,!0);try{let e=await oe(t,!0);j(m,b?wy(b,e):e)}finally{_e(t.title,!1)}}function be(e){let{episode:t,entry:n}=e.detail;if(!n.isAvailable){new r.Notice(`This played episode is no longer available in current feeds.`);return}Co.set(t),Io.set(I.Player)}function xe({detail:{event:e,episode:t,entry:n}}){$v(t,e,n.isAvailable?void 0:{play:!0,download:!0,createNote:!0,favorite:!0,queue:!0,playlists:!
|
|||
|
|
`):[]}},Ix=new WeakMap,Lx=new WeakMap,Rx.NEWLINE_CHARS=new Set([`
|
|||
|
|
`,`\r`]),Rx.NEWLINE_REGEXP=/\r\n|[\n\r]/g}));function Bx(){}function Vx(e,t,n){return!t||Ux[e]>Ux[n]?Bx:t[e].bind(t)}function Hx(e){let t=e.logger,n=e.logLevel??`off`;if(!t)return Gx;let r=Kx.get(t);if(r&&r[0]===n)return r[1];let i={error:Vx(`error`,t,n),warn:Vx(`warn`,t,n),info:Vx(`info`,t,n),debug:Vx(`debug`,t,n)};return Kx.set(t,[n,i]),i}var Ux,Wx,Gx,Kx,qx,Jx=t((()=>{Lb(),Ux={off:0,error:200,warn:300,info:400,debug:500},Wx=(e,t,n)=>{if(e){if(kb(Ux,e))return e;Hx(n).warn(`${t} was set to ${JSON.stringify(e)}, expected one of ${JSON.stringify(Object.keys(Ux))}`)}},Gx={error:Bx,warn:Bx,info:Bx,debug:Bx},Kx=new WeakMap,qx=e=>(e.options&&(e.options={...e.options},delete e.options.headers),e.headers&&(e.headers=Object.fromEntries((e.headers instanceof Headers?[...e.headers]:Object.entries(e.headers)).map(([e,t])=>[e,e.toLowerCase()===`authorization`||e.toLowerCase()===`api-key`||e.toLowerCase()===`x-api-key`||e.toLowerCase()===`x-amz-security-token`||e.toLowerCase()===`cookie`||e.toLowerCase()===`set-cookie`?`***`:t]))),`retryOfRequestLogID`in e&&(e.retryOfRequestLogID&&(e.retryOf=e.retryOfRequestLogID),delete e.retryOfRequestLogID),e)}));async function*Yx(e,t){if(!e.body)throw t.abort(),globalThis.navigator!==void 0&&globalThis.navigator.product===`ReactNative`?new K(`The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api`):new K(`Attempted to iterate over a response with no body`);let n=new eS,r=new Rx,i=ex(e.body);for await(let e of Xx(i))for(let t of r.decode(e)){let e=n.decode(t);e&&(yield e)}for(let e of r.flush()){let t=n.decode(e);t&&(yield t)}}async function*Xx(e){let t=new Uint8Array;for await(let n of e){if(n==null)continue;let e=n instanceof ArrayBuffer?new Uint8Array(n):typeof n==`string`?kx(n):n,r=new Uint8Array(t.length+e.length);r.set(t),r.set(e,t.length),t=r;let i;for(;(i=Fx(t))!==-1;)yield t.slice(0,i),t=t.slice(i)}t.length>0&&(yield t)}function Zx(e,t){let n=e.indexOf(t);return n===-1?[e,``,``]:[e.substring(0,n),t,e.substring(n+t.length)]}var Qx,$x,eS,tS=t((()=>{rb(),Eb(),nx(),zx(),cb(),Nx(),Jx(),$x=class e{constructor(e,t,n){this.iterator=e,Qx.set(this,void 0),this.controller=t,W(this,Qx,n,`f`)}static fromSSEResponse(t,n,r,i){let a=!1,o=r?Hx(r):console;async function*s(){if(a)throw new K("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");a=!0;let e=!1;try{for await(let r of Yx(t,n))if(!e){if(r.data.startsWith(`[DONE]`)){e=!0;continue}if(r.event===null||!r.event.startsWith(`thread.`)){let e;try{e=JSON.parse(r.data)}catch(e){throw o.error(`Could not parse message into JSON:`,r.data),o.error(`From chunk:`,r.raw),e}if(e&&e.error)throw new lb(void 0,e.error,void 0,t.headers);yield i?{event:r.event,data:e}:e}else{let e;try{e=JSON.parse(r.data)}catch(e){throw e}if(r.event==`error`)throw new lb(void 0,e.error,e.message,void 0);yield{event:r.event,data:e}}}e=!0}catch(e){if(ob(e))return;throw e}finally{e||n.abort()}}return new e(s,n,r)}static fromReadableStream(t,n,r){let i=!1;async function*a(){let e=new Rx,r=t.getReader(),i=!1,a,o=()=>{a??(a=r.cancel()),a.catch(()=>{})};n.signal.addEventListener(`abort`,o,{once:!0});try{if(n.signal.aborted){o();return}for(;;){let{value:t,done:a}=await r.read();if(a){i=!0;break}if(n.signal.aborted)return;for(let r of e.decode(t)){if(n.signal.aborted)return;yield r}}if(n.signal.aborted)return;for(let t of e.flush()){if(n.signal.aborted)return;yield t}}finally{n.signal.removeEventListener(`abort`,o),i||o(),r.releaseLock()}}async function*o(){if(i)throw new K("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");i=!0;let e=!1;try{for await(let t of a())e||t&&(yield JSON.parse(t));e=!0}catch(e){if(n.signal.aborted||ob(e))return;throw e}finally{e||n.abort()}}return new e(o,n,r)}[(Qx=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let t=[],n=[],r=this.iterator(),i=e=>({next:()=>{if(e.length===0){let e=r.next();t.push(e),n.push(e)}return e.shift()}});return[new e(()=>i(t),this.controller,G(this,Qx,`f`)),new e(()=>i(n),t
|
|||
|
|
`);e.enqueue(i)}catch(t){e.error(t)}},async cancel(){await t.return?.()}})}},eS=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith(`\r`)&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let e={event:this.event,data:this.data.join(`
|
|||
|
|
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],e}if(this.chunks.push(e),e.startsWith(`:`))return null;let[t,n,r]=Zx(e,`:`);return r.startsWith(` `)&&(r=r.substring(1)),t===`event`?this.event=r:t===`data`&&this.data.push(r),null}}}));async function nS(e,t){let{response:n,requestLogID:r,retryOfRequestLogID:i,startTime:a}=t,o=await(async()=>{if(t.options.stream)return Hx(e).debug(`response`,n.status,n.url,n.headers,n.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(n,t.controller,e,t.options.__synthesizeEventData):$x.fromSSEResponse(n,t.controller,e,t.options.__synthesizeEventData);if(n.status===204)return null;if(t.options.__binaryResponse)return n;let r=n.headers.get(`content-type`)?.split(`;`)[0]?.trim();return r?.includes(`application/json`)||r?.endsWith(`+json`)?n.headers.get(`content-length`)===`0`?void 0:rS(await n.json(),n):await n.text()})();return Hx(e).debug(`[${r}] response parsed`,qx({retryOfRequestLogID:i,url:n.url,status:n.status,body:o,durationMs:Date.now()-a})),o}function rS(e,t){return!e||typeof e!=`object`||Array.isArray(e)?e:Object.defineProperty(e,"_request_id",{value:t.headers.get(`x-request-id`),enumerable:!1})}var iS=t((()=>{tS(),Jx()})),aS,oS,sS=t((()=>{rb(),iS(),oS=class e extends Promise{constructor(e,t,n=nS){super(e=>{e(null)}),this.responsePromise=t,this.parseResponse=n,aS.set(this,void 0),W(this,aS,e,`f`)}_thenUnwrap(t){return new e(G(this,aS,`f`),this.responsePromise,async(e,n)=>rS(t(await this.parseResponse(e,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,t]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:t,request_id:t.headers.get(`x-request-id`)}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(G(this,aS,`f`),e))),this.parsedPromise}then(e,t){return this.parse().then(e,t)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}},aS=new WeakMap})),cS,lS,uS,dS,fS,pS,mS,q=t((()=>{rb(),Eb(),iS(),sS(),Lb(),lS=class{constructor(e,t,n,r){cS.set(this,void 0),W(this,cS,e,`f`),this.options=r,this.response=t,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new K("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await G(this,cS,`f`).requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(cS=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let t of e.getPaginatedItems())yield t}},uS=class extends oS{constructor(e,t,n){super(e,t,async(e,t)=>new n(e,t.response,await nS(e,t),t.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let t of e)yield t}},dS=class extends lS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},fS=class extends lS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more!==!1&&super.hasNextPage()}nextPageRequestOptions(){let e=this.getPaginatedItems(),t=e[e.length-1]?.id;return t?{...this.options,query:{...Db(this.options.query),after:t}}:null}},pS=class extends lS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.last_id=n.last_id||``}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more!==!1&&super.hasNextPage()}nextPageRequestOptions(){let e=this.last_id;return e?{...this.options,query:{...Db(this.options.query),after:e}}:null}},mS=class extends lS{constructor(e,t,n,r){super(e,t,n,r),this.data=n.data||[],this.has_more=n.has_more||!1,this.next=n.next||null}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more!==!1&&super.hasNextPage()}nextPageRequestOptions(){let e=this.next;return e?{...this.option
|
|||
|
|
`)}yield kx(`--${t}--\r\n`)}async function*OS(e){if(!(!e||typeof e!=`object`))for(let[t,n]of Object.entries(e))yield*kS(t,n)}async function*kS(e,t){if(t!==void 0){if(t==null)throw TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof t==`string`||typeof t==`number`||typeof t==`boolean`||GS(t))yield{key:e,value:t};else if(Array.isArray(t))for(let n of t)yield*kS(e+`[]`,n);else if(typeof t==`object`)for(let[n,r]of Object.entries(t))yield*kS(`${e}[${n}]`,r);else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${t} instead`)}}function AS(e){return WS(e)?e.name:TS(e)??`unknown_file`}function jS(e){return WS(e)?e.type||`application/octet-stream`:HS(e)&&e.type?e.type:e instanceof Response&&e.headers.get(`content-type`)||`application/octet-stream`}function MS(e){return WS(e)?e.data:e}async function*NS(e){if(typeof e==`string`)yield kx(e);else if(ArrayBuffer.isView(e))yield new Uint8Array(e.buffer,e.byteOffset,e.byteLength);else if(e instanceof ArrayBuffer)yield new Uint8Array(e);else if(e instanceof Response)e.body?yield*NS(e.body):yield*NS(await e.blob());else if(e instanceof Blob)typeof e.stream==`function`?yield*NS(e.stream()):yield new Uint8Array(await e.arrayBuffer());else if(US(e))for await(let t of ex(e))yield*NS(t);else if(LS(e))for await(let t of e)yield*NS(t);else throw TypeError(`Invalid streaming file chunk: ${String(e)}`)}function PS(e){return e.replace(/["\\\r\n]/g,e=>encodeURIComponent(e))}var FS,IS,LS,RS,zS,BS,VS,HS,US,WS,GS,KS,qS,JS,YS,XS=t((()=>{SS(),nx(),Nx(),FS=Symbol(`brand.privateStreamingFile`),IS=()=>{if(typeof File>`u`){let{process:e}=globalThis,t=typeof e?.versions?.node==`string`&&parseInt(e.versions.node.split(`.`))<20;throw Error("`File` is not defined as a global, which is required for file uploads."+(t?" Update to a supported Node.js LTS release, or set `globalThis.File` to `import('node:buffer').File`.":``))}},LS=e=>typeof e==`object`&&!!e&&typeof e[Symbol.asyncIterator]==`function`,RS=async(e,t)=>qS(e.body)?KS(e.body)?JS(e):{...e,body:await VS(e.body,t)}:e,zS=async(e,t)=>KS(e.body)?JS(e):{...e,body:await VS(e.body,t)},BS=new WeakMap,VS=async(e,t)=>{if(!await ES(t))throw TypeError(`The provided fetch function does not support file uploads with the current global FormData class.`);let n=new FormData;return await Promise.all(Object.entries(e||{}).map(([e,t])=>YS(n,e,t))),n},HS=e=>e instanceof Blob&&`name`in e,US=e=>typeof e==`object`&&!!e&&`getReader`in e&&typeof e.getReader==`function`,WS=e=>typeof e==`object`&&!!e&&FS in e,GS=e=>typeof e==`object`&&!!e&&(e instanceof Response||LS(e)||US(e)||WS(e)||HS(e)),KS=e=>{if(WS(e)||LS(e)||US(e))return!0;if(Array.isArray(e))return e.some(KS);if(e&&typeof e==`object`&&!HS(e)&&!(e instanceof Response)){for(let t in e)if(KS(e[t]))return!0}return!1},qS=e=>{if(GS(e))return!0;if(Array.isArray(e))return e.some(qS);if(e&&typeof e==`object`){for(let t in e)if(qS(e[t]))return!0}return!1},JS=e=>{let t=`openai-${Math.random().toString(36).slice(2)}`,n=$b(DS(e.body,t));return{...e,body:n,headers:J([{"content-type":`multipart/form-data; boundary=${t}`},e.headers])}},YS=async(e,t,n)=>{if(n!==void 0){if(n==null)throw TypeError(`Received null for "${t}"; to pass null in FormData, you must use the string 'null'`);if(typeof n==`string`||typeof n==`number`||typeof n==`boolean`)e.append(t,String(n));else if(n instanceof Response)e.append(t,wS([await n.blob()],TS(n)));else if(LS(n))e.append(t,wS([await new Response($b(n)).blob()],TS(n)));else if(HS(n))e.append(t,n,TS(n));else if(Array.isArray(n))await Promise.all(n.map(n=>YS(e,t+`[]`,n)));else if(typeof n==`object`)await Promise.all(Object.entries(n).map(([n,r])=>YS(e,`${t}[${n}]`,r)));else throw TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${n} instead`)}}}));async function ZS(e,t,n){if(IS(),e=await e,tC(e))return e instanceof File?e:wS([await e.arrayBuffer()],e.name);if(nC(e)){let r=await e.blob();return t||(t=new URL(e.url).pathname.split(/[
|
|||
|
|
`)}\n${a}\n${t}`)}return a},Z=sC(aC)})),cC,lC=t((()=>{X(),q(),Q(),cC=class extends Y{list(e,t={},n){return this._client.getAPIList(Z`/chat/completions/${e}/messages`,fS,{query:t,...n,__security:{bearerAuth:!0}})}}})),uC=t((()=>{Eb()}));function dC(e){return e!==void 0&&`function`in e&&e.function!==void 0}function fC(e){return e?.$brand===`auto-parseable-response-format`}function pC(e){return e?.$brand===`auto-parseable-tool`}function mC(e,t){return!t||!yC(t)?{...e,choices:e.choices.map(e=>(bC(e.message.tool_calls),{...e,message:{...e.message,parsed:null,...e.message.tool_calls?{tool_calls:e.message.tool_calls}:void 0}}))}:hC(e,t)}function hC(e,t){let n=e.choices.map(e=>{if(e.finish_reason===`length`)throw new xb;if(e.finish_reason===`content_filter`)throw new Sb;return bC(e.message.tool_calls),{...e,message:{...e.message,...e.message.tool_calls?{tool_calls:e.message.tool_calls?.map(e=>_C(t,e))??void 0}:void 0,parsed:e.message.content&&!e.message.refusal?gC(t,e.message.content):null}}});return{...e,choices:n}}function gC(e,t){return e.response_format?.type===`json_schema`&&e.response_format?.type===`json_schema`?`$parseRaw`in e.response_format?e.response_format.$parseRaw(t):JSON.parse(t):null}function _C(e,t){let n=e.tools?.find(e=>dC(e)&&e.function?.name===t.function.name);return{...t,function:{...t.function,parsed_arguments:pC(n)?n.$parseRaw(t.function.arguments):n?.function.strict?JSON.parse(t.function.arguments):null}}}function vC(e,t){if(!e||!(`tools`in e)||!e.tools)return!1;let n=e.tools?.find(e=>dC(e)&&e.function?.name===t.function.name);return dC(n)&&(pC(n)||n?.function.strict||!1)}function yC(e){return fC(e.response_format)?!0:e.tools?.some(e=>pC(e)||e.type===`function`&&e.function.strict===!0)??!1}function bC(e){for(let t of e||[])if(t.type!==`function`)throw new K(`Currently only \`function\` tool calls are supported; Received \`${t.type}\``)}function xC(e){for(let t of e??[]){if(t.type!==`function`)throw new K(`Currently only \`function\` tool types support auto-parsing; Received \`${t.type}\``);if(t.function.strict!==!0)throw new K(`The \`${t.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var SC=t((()=>{uC()})),CC,wC,TC=t((()=>{CC=e=>e?.role===`assistant`,wC=e=>e?.role===`tool`})),EC,DC,OC,kC,AC,jC,MC,NC,PC,FC,IC,LC,RC,zC,BC,VC,HC=t((()=>{rb(),uC(),VC=class{constructor(){EC.add(this),this.controller=new AbortController,DC.set(this,void 0),OC.set(this,()=>{}),kC.set(this,()=>{}),AC.set(this,void 0),jC.set(this,()=>{}),MC.set(this,()=>{}),NC.set(this,{}),PC.set(this,[]),FC.set(this,!1),IC.set(this,!1),LC.set(this,!1),RC.set(this,!1),W(this,DC,new Promise((e,t)=>{W(this,OC,e,`f`),W(this,kC,t,`f`)}),`f`),W(this,AC,new Promise((e,t)=>{W(this,jC,e,`f`),W(this,MC,t,`f`)}),`f`),G(this,DC,`f`).catch(()=>{}),G(this,AC,`f`).catch(()=>{})}_run(e){setTimeout(()=>{Promise.resolve().then(e).then(()=>{try{this._emitFinal()}catch(e){G(this,EC,`m`,BC).call(this,e);return}this._emit(`end`)},G(this,EC,`m`,BC).bind(this))},0)}_connected(){this.ended||(G(this,OC,`f`).call(this),this._emit(`connect`))}get ended(){return G(this,FC,`f`)}get errored(){return G(this,IC,`f`)}get aborted(){return G(this,LC,`f`)}abort(){this.controller.abort()}_listenForAbort(e){if(!e||this.ended)return;if(e.aborted){this.controller.abort();return}let t=()=>this.controller.abort();e.addEventListener(`abort`,t,{once:!0}),G(this,PC,`f`).push({signal:e,listener:t})}on(e,t){return(G(this,NC,`f`)[e]||(G(this,NC,`f`)[e]=[])).push({listener:t}),this}off(e,t){let n=G(this,NC,`f`)[e];if(!n)return this;let r=n.findIndex(e=>e.listener===t);return r>=0&&n.splice(r,1),this}once(e,t){return(G(this,NC,`f`)[e]||(G(this,NC,`f`)[e]=[])).push({listener:t,once:!0}),this}emitted(e){return new Promise((t,n)=>{W(this,RC,!0,`f`),e!==`error`&&this.once(`error`,n),this.once(e,t)})}events(e){let t=[],n=[],r=this.ended,i,a=!1,o=()=>({value:void 0,done:!0}),s=()=>{for(;n.length;)n.shift().resolve(o())},c=()=>{!i||a||!n.length||(a=!0,n.shift().reject(i))},l=()=>{this.off(e,u),this.off(`end`,f),e!==`error`&&this.off(`error`,
|
|||
|
|
\r `.includes(e[r]);)r++};return o()},dw=e=>ow(e,sw.ALL^sw.NUM)})),pw=t((()=>{tS()}));function mw(e,t,n){let r={type:`message`,message:t,...n?{tool_call_ids:n}:{}};return{id:e.id,choices:[],created:e.created,model:e.model,object:`${Nw}${JSON.stringify(r)}`}}function hw(e){return`type`in e&&e.type===`message`&&`message`in e||`object`in e&&typeof e.object==`string`&&e.object.startsWith(Nw)}function gw(e){return`type`in e?e:JSON.parse(e.object.slice(30))}function _w(e,t,n){let{id:r,choices:i,created:a,model:o,system_fingerprint:s,...c}=e;return mC({...c,id:r,choices:i.map(({message:t,finish_reason:r,index:i,logprobs:a,...o})=>{let{content:s=null,function_call:c,tool_calls:l,audio:u,...d}=t,f=r??(n.has(i)&&vw(u)?`stop`:null);if(!f)throw new K(`missing finish_reason for choice ${i}`);let p=u?{audio:u}:{},m=t.role;if(!m)throw new K(`missing role for choice ${i}`);if(c){let{arguments:e,name:n}=c;if(e==null)throw new K(`missing function_call.arguments for choice ${i}`);if(!n)throw new K(`missing function_call.name for choice ${i}`);return{...o,message:{...p,content:s,function_call:{arguments:e,name:n},role:m,refusal:t.refusal??null},finish_reason:f,index:i,logprobs:a}}return l?{...o,index:i,finish_reason:f,logprobs:a,message:{...d,...p,role:m,content:s,refusal:t.refusal??null,tool_calls:l.map((t,n)=>{let{function:r,type:a,id:o,...s}=t,{arguments:c,name:l,...u}=r||{};if(a==null)throw new K(`missing choices[${i}].tool_calls[${n}].type\n${yw(e)}`);if(l==null)throw new K(`missing choices[${i}].tool_calls[${n}].function.name\n${yw(e)}`);if(c==null)throw new K(`missing choices[${i}].tool_calls[${n}].function.arguments\n${yw(e)}`);return{...s,id:o||`call_${ib()}`,type:a,function:{...u,name:l,arguments:c}}})}}:{...o,message:{...d,...p,content:s,role:m,refusal:t.refusal??null},finish_reason:f,index:i,logprobs:a}}),created:a,model:o,object:`chat.completion`,...s?{system_fingerprint:s}:{}},t)}function vw(e){return e?.id!=null&&e.data!=null&&e.transcript!=null&&e.expires_at!=null}function yw(e){return JSON.stringify(e)}var bw,xw,Sw,Cw,ww,Tw,Ew,Dw,Ow,kw,Aw,jw,Mw,Nw,Pw,Fw=t((()=>{rb(),fw(),uC(),ab(),SC(),pw(),rw(),Nw=`chat.completion.chunk.message:`,Pw=class e extends nw{constructor(e){super(),bw.add(this),xw.set(this,void 0),Sw.set(this,void 0),Cw.set(this,void 0),ww.set(this,void 0),W(this,xw,e,`f`),W(this,Sw,new Set,`f`),W(this,Cw,[],`f`)}get currentChatCompletionSnapshot(){return G(this,ww,`f`)}static fromReadableStream(t){let n=new e(null);return n._run(()=>n._fromReadableStream(t)),n}static createChatCompletion(t,n,r){let i=new e(n);return i._run(()=>i._runChatCompletion(t,{...n,stream:!0},{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":`stream`}})),i}async _createChatCompletion(e,t,n){super._createChatCompletion,this._listenForAbort(n?.signal),G(this,bw,`m`,Tw).call(this);let r=await e.chat.completions.create({...t,stream:!0},{...n,signal:this.controller.signal});this._connected();for await(let e of r)G(this,bw,`m`,Dw).call(this,e);if(r.controller.signal?.aborted)throw new ub;return this._addChatCompletion(G(this,bw,`m`,Aw).call(this))}async _fromReadableStream(e,t){this._listenForAbort(t?.signal),G(this,bw,`m`,Tw).call(this),this._connected();let n=$x.fromReadableStream(e,this.controller),r;for await(let e of n){if(hw(e)){let t=gw(e);if(G(this,ww,`f`)){let e=G(this,ww,`f`).choices[0]?.message.tool_calls;for(let[n,r]of t.tool_call_ids?.entries()??[]){let t=e?.[n];t&&r&&(t.id=r)}this._addChatCompletion(G(this,bw,`m`,Aw).call(this)),r=void 0}this._addMessage(t.message);continue}let t=e;r&&t.id&&r!==t.id&&this._addChatCompletion(G(this,bw,`m`,Aw).call(this)),G(this,bw,`m`,Dw).call(this,t),t.id&&(r=t.id)}if(n.controller.signal?.aborted)throw new ub;if(G(this,ww,`f`))return this._addChatCompletion(G(this,bw,`m`,Aw).call(this));let i=this._chatCompletions[this._chatCompletions.length-1];if(i)return i;throw new K(`request ended without sending any chunks`)}[(xw=new WeakMap,Sw=new WeakMap,Cw=new WeakMap,ww=new WeakMap,bw=new WeakSet,Tw=function(){this.ended||(W(this,Sw,new Set,`f`),W(this,ww,void 0,`f`))},Ew=function(e){let t=G(this,
|
|||
|
|
|
|||
|
|
This is disabled by default, as it risks exposing your secret API credentials to attackers.
|
|||
|
|
If you understand the risks and have appropriate mitigations in place,
|
|||
|
|
you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g.,
|
|||
|
|
|
|||
|
|
new OpenAI({ apiKey, dangerouslyAllowBrowser: true });
|
|||
|
|
|
|||
|
|
https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety
|
|||
|
|
`);this.baseURL=d.baseURL,this.timeout=d.timeout??Ik.DEFAULT_TIMEOUT,this.logger=d.logger??console;let f=`warn`;this.logLevel=f,this.logLevel=Wx(d.logLevel,`ClientOptions.logLevel`,this)??Wx(LE(`OPENAI_LOG`),`process.env['OPENAI_LOG']`,this)??f,this.fetchOptions=d.fetchOptions,this.maxRetries=d.maxRetries??2,this.fetch=d.fetch??Zb(),W(this,Lk,rx,`f`);let p=t?void 0:LE(`OPENAI_CUSTOM_HEADERS`);if(p){let e={};for(let t of p.split(`
|
|||
|
|
`)){let n=t.indexOf(`:`);n>=0&&(e[t.substring(0,n).trim()]=t.substring(n+1).trim())}d.defaultHeaders=J([e,d.defaultHeaders])}this._options=d,this._provider=u,c&&(this._workloadIdentityAuth=new _S(c,this.fetch)),this.apiKey=typeof r==`string`?r:null,this.adminAPIKey=i,this.organization=a,this.project=o,this.webhookSecret=s}withOptions(e){let t=this._options.provider,n=e.provider??t,r={...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this._options.apiKey,adminAPIKey:this.adminAPIKey,workloadIdentity:this._options.workloadIdentity,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret};return n&&(delete r.apiKey,delete r.adminAPIKey,delete r.workloadIdentity,delete r.baseURL,n!==t&&(delete r.organization,delete r.project,delete r.defaultHeaders)),new this.constructor({...r,...e,provider:n})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:t},n={bearerAuth:!0,adminAPIKeyAuth:!0}){if(!(e.get(`authorization`)||e.get(`api-key`))&&!(t.has(`authorization`)||t.has(`api-key`))&&!(this._workloadIdentityAuth&&n.bearerAuth))throw Error(`Could not resolve authentication method. Expected either apiKey or adminAPIKey to be set. Or for one of the "Authorization" or "api-key" headers to be explicitly omitted`)}async authHeaders(e,t={bearerAuth:!0,adminAPIKeyAuth:!0}){return J([t.bearerAuth?await this.bearerAuth(e):null,t.adminAPIKeyAuth?await this.adminAPIKeyAuth(e):null])}async bearerAuth(e){if(this._workloadIdentityAuth)return J([{Authorization:`Bearer ${await this._workloadIdentityAuth.getToken()}`}]);if(this.apiKey!=null)return J([{Authorization:`Bearer ${this.apiKey}`}])}async adminAPIKeyAuth(e){if(this.adminAPIKey!=null)return J([{Authorization:`Bearer ${this.adminAPIKey}`}])}stringifyQuery(e){return Ex(e)}getUserAgent(){return`${this.constructor.name}/JS ${Bb}`}defaultIdempotencyKey(){return`stainless-node-retry-${ib()}`}makeStatusError(e,t,n,r){return lb.generate(e,t,n,r)}async _callApiKey(){if(this._provider)return!1;let e=this._options.apiKey;if(typeof e!=`function`)return!1;let t;try{t=await e()}catch(e){throw e instanceof K?e:new K(`Failed to get token from 'apiKey' function: ${e.message}`,{cause:e})}if(typeof t!=`string`||!t)throw new K(`Expected 'apiKey' function argument to return a string but it returned ${t}`);return this.apiKey=t,!0}buildURL(e,t,n){let r=!G(this,Fk,`m`,Rk).call(this)&&n||this.baseURL,i=Mb(e)?new URL(e):new URL(r+(r.endsWith(`/`)&&e.startsWith(`/`)?e.slice(1):e)),a=this.defaultQuery(),o=Object.fromEntries(i.searchParams);return(!Ob(a)||!Ob(o))&&(t={...o,...a,...t}),typeof t==`object`&&t&&!Array.isArray(t)&&(i.search=this.stringifyQuery(t)),i.toString()}async prepareOptions(e){this._provider||(e.__security??{bearerAuth:!0}).bearerAuth&&await this._callApiKey()}async prepareRequest(e,{url:t,options:n}){}get(e,t){return this.methodRequest(`get`,e,t)}post(e,t){return this.methodRequest(`post`,e,t)}patch(e,t){return this.methodRequest(`patch`,e,t)}put(e,t){return this.methodRequest(`put`,e,t)}delete(e,t){return this.methodRequest(`delete`,e,t)}methodRequest(e,t,n){return this.request(Promise.resolve(n).then(n=>({method:e,path:t,...n})))}request(e,t=null){return new oS(this,this.makeRequest(e,t,void 0))}async makeRequest(e,t,n){let r=await e,i=r.maxRetries??this.maxRetries;t??(t=i),await this.prepareOptions(r);let{req:a,url:o,timeout:s}=await this.buildRequest(r,{retryCount:i-t}),c=r.__metadata?.hasStreamingBody===!0;await this.prepareRequest(a,{url:o,options:r}),await this._provider?.prepareRequest?.(a,{url:o,options:r});let l=`log_`+(Math.random()*(1<<24)|0).toString(16).padStart(6,`0`),u=n===void 0?``:`, retryOf: ${n}`,d=Date.now();if(Hx(this).debug(`[${l}] sending request`,qx({retryOfRequestLogID:n,method:r.method,url:o,options:r,headers:a.headers})),r.signal?.aborted)throw new ub;let f=r.__security??{bearerAuth:!0},p=new AbortController,m=await this.fetchWithAuth(o,a,s,p,f).catch(sb),h=Date.now();if(m instanceof g
|
|||
|
|
|
|||
|
|
`),warning:a>0?`Transcription saved, but ${a} of ${r.length} chunk(s) failed - look for [Error transcribing chunk N] markers and re-run after deleting the note to retry.`:void 0}}async diarize(e,t,n){if(this.assertActive(),t===`deepgram`){let t=this.plugin.credentials.get(this.plugin.settings,`deepgram`);if(!t)throw Error(`Missing Deepgram API key on this device.`);let r=await this.waitForLifecycle(U_({audio:e,apiKey:t,onProgress:n,signal:this.lifetimeAbortController.signal}));return this.assertActive(),r}n(`Creating audio chunks...`);let r=await Yy(e);this.assertActive();let i=await F_({getClient:()=>this.getClient(),chunkFiles:r,maxRetries:this.MAX_RETRIES,onProgress:n,signal:this.lifetimeAbortController.signal});return this.assertActive(),i}async transcribeChunks(e,t){let n=await this.getClient();this.assertActive();let r=Array.from({length:e.length}),i=0,a=0,o=0,s=()=>{let n=(i/e.length*100).toFixed(1);t(`Transcribing... ${i}/${e.length} chunks completed (${n}%)`)};s();let c=async()=>{for(;;){this.assertActive();let t=o++;if(t>=e.length)return;let c=e[t],l=0;for(;l<this.MAX_RETRIES;){this.assertActive();try{let e=await n.audio.transcriptions.create({model:`whisper-1`,file:c},{signal:this.lifetimeAbortController.signal});this.assertActive(),r[t]=e.text,i++,s();break}catch{this.assertActive(),l++,l>=this.MAX_RETRIES?(r[t]=eA(t),a++,i++,s()):await this.waitForRetry(1e3*l)}}}},l=Math.min(this.MAX_CONCURRENT_CHUNK_TRANSCRIPTIONS,e.length),u=Array.from({length:l},()=>c());return await Promise.all(u),this.assertActive(),{text:r.join(` `),failedChunks:a}}waitForRetry(e){this.assertActive();let t=this.lifetimeAbortController.signal;return new Promise((n,r)=>{let i=window.setTimeout(()=>{t.removeEventListener(`abort`,a),n()},e),a=()=>{window.clearTimeout(i),t.removeEventListener(`abort`,a),r(this.getAbortReason())};t.addEventListener(`abort`,a,{once:!0}),t.aborted&&a()})}waitForLifecycle(e){this.assertActive();let t=this.lifetimeAbortController.signal;return new Promise((n,r)=>{let i=!1,a=()=>t.removeEventListener(`abort`,o),o=()=>{i||(i=!0,a(),r(this.getAbortReason()))};t.addEventListener(`abort`,o,{once:!0}),e.then(e=>{if(!i){if(t.aborted){o();return}i=!0,a(),n(e)}},e=>{if(!i){if(t.aborted){o();return}i=!0,a(),r(e)}}),t.aborted&&o()})}getTranscriptPath(e){return ch(e,this.plugin.settings.transcript.path)}async saveTranscription(e,t){this.assertActive();let n=this.getTranscriptPath(e),i=Hd(this.plugin.settings.transcript.template,e,t),a=this.plugin.app.vault;await sf(n.substring(0,n.lastIndexOf(`/`)),a,()=>this.assertActive()),this.assertActive();let o=a.getAbstractFileByPath(n);if(!o){this.assertActive();let e=await a.create(n,i);this.assertActive(),await this.plugin.app.workspace.getLeaf().openFile(e)}else if(o instanceof r.TFile)this.assertActive(),await this.plugin.app.workspace.getLeaf().openFile(o);else throw Error(`Expected a file but found a folder at transcript path.`)}async getClient(){this.assertActive();let e=this.plugin.credentials.get(this.plugin.settings,`openai`);if(!e)throw Error(`Missing OpenAI API key on this device`);if(this.client&&this.cachedApiKey===e)return this.client;let{OpenAI:t}=await this.loadOpenAI();return this.assertActive(),this.client=new t({apiKey:e,dangerouslyAllowBrowser:!0}),this.cachedApiKey=e,this.client}dispose(){if(!this.disposed){this.disposed=!0,this.lifetimeAbortController.abort(new DOMException(`PodNotes was unloaded during transcription.`,`AbortError`)),this.pendingEpisodes=[];for(let e of this.activeNotices)e.dispose();this.activeNotices.clear(),this.clearCredentialCache()}}clearCredentialCache(){this.client=null,this.cachedApiKey=null}assertActive(){if(this.disposed||this.lifetimeAbortController.signal.aborted)throw this.getAbortReason()}getAbortReason(){return this.lifetimeAbortController.signal.reason??new DOMException(`PodNotes was unloaded during transcription.`,`AbortError`)}},rA={openai:{baseId:`podnotes-openai-api-key`,settingsKey:`openAISecretId`},deepgram:{baseId:`podnotes-deepgram-api-key`,settingsKey:`deepgramSecretId`}},iA=class{constructor(e){this.storage=e}get(e,
|
|||
|
|
`)?e:`${e}\n`,n=op(this.api.podcast)??await ip(this.api.podcast),r=await this.app.vault.read(n),i=r.length>0&&!r.endsWith(`
|
|||
|
|
`)?`
|
|||
|
|
`:``;return await this.app.vault.modify(n,`${r}${i}${t}`),!0}catch{return new r.Notice(`Failed to capture timestamp into episode note`),!1}}async captureTimestampFromMediaSession(){return this.captureTimestampInActiveEditor()?!0:await this.appendTimestampToEpisodeNote()}registerMediaSessionHandlers(){this.registerMediaSessionAction(`previoustrack`,()=>{this.captureTimestampFromMediaSession()})}registerMediaSessionAction(e,t){let n=window.navigator?.mediaSession;if(n?.setActionHandler)try{n.setActionHandler(e,t),this.mediaSessionActions.push(e)}catch{}}clearMediaSessionHandlers(){let e=window.navigator?.mediaSession;if(e?.setActionHandler){for(let t of this.mediaSessionActions)try{e.setActionHandler(t,null)}catch{}this.mediaSessionActions=[]}}onunload(){this.isUnloaded=!0,this.clearLayoutReadyRetry(),this.clearMediaSessionHandlers();for(let e of this.storeUnsubscribers)e();this.storeUnsubscribers=[],this.volumeUnsubscribe?.(),this.localFilesMirrorUnsubscribe?.(),this.transcriptionService?.dispose(),this.transcriptionService=void 0,this.views.clear()}clearLayoutReadyRetry(){this.layoutReadyRetry&&(window.clearTimeout(this.layoutReadyRetry),this.layoutReadyRetry=null)}async loadSettings(){try{let e=c_(await this.loadData()),t=e.settings;if(this.credentials??(this.credentials=new iA(this.app.secretStorage)),e.sourceVersion<2||e.retiredPlaintextPresent){try{let n=e.sourceVersion<2?this.credentials.storeValues(e.legacySecrets):{};t={...t,...n},await this.saveData(l_(t,e.unknownFields))}catch(t){throw new cA(t,!!(e.legacySecrets.openAI||e.legacySecrets.deepgram))}let n=[e.legacySecrets.openAI?`OpenAI`:null,e.legacySecrets.deepgram?`Deepgram`:null].filter(e=>e!==null);n.length>0&&new r.Notice(`Moved your ${n.join(` and `)} API ${n.length===1?`key`:`keys`} into Obsidian SecretStorage.`)}this.feedUrls??(this.feedUrls=new sA(this.app.secretStorage));let n=Gp(t.savedFeeds,this.feedUrls);if(n.replacements.size>0){t=Kp({...t,savedFeeds:n.savedFeeds},n.replacements),Mg([...n.replacements.keys()]),await this.saveData(l_(t,e.unknownFields));let i=n.replacements.size;new r.Notice(`Moved ${i} private feed ${i===1?`URL`:`URLs`} into Obsidian SecretStorage.`)}n.failed.length>0&&new r.Notice(`PodNotes could not protect the private feed ${n.failed.length===1?`URL`:`URLs`} for ${n.failed.join(`, `)}; ${n.failed.length===1?`it stays`:`they stay`} in data.json for now. Restart PodNotes to retry.`,0),this.feedUrls.sweepOrphans(t.savedFeeds),this.settings=t,this.persistenceUnknownFields=e.unknownFields,e.warnings.length}catch(e){throw e instanceof s_?new r.Notice(e.message,0):e instanceof cA&&new r.Notice(e.includedCredentials?`PodNotes could not securely migrate its API keys. Your existing data was kept unchanged. Restart PodNotes to retry.`:`PodNotes could not upgrade its settings data. Your existing data was kept unchanged. Restart PodNotes to retry.`,0),e}}saveSettings(){return this.requestSettingsSave().catch(()=>void 0)}saveSettingsStrict(){return this.requestSettingsSave()}requestSettingsSave(){if(!this.isReady)return Promise.resolve();try{this.pendingSave=this.cloneSettings()}catch(e){let t=Promise.reject(e);return t.catch(()=>void 0),t}let e=new Promise((e,t)=>{this.pendingSaveWaiters.push({resolve:e,reject:t})});return e.catch(()=>void 0),this.saveScheduled||(this.saveScheduled=!0,this.saveChain=this.runSaveLoop()),e}async runSaveLoop(){try{for(;this.pendingSave;){let e=this.pendingSave,t=this.pendingSaveWaiters;this.pendingSave=null,this.pendingSaveWaiters=[];try{await this.saveData(l_(e,this.persistenceUnknownFields));for(let e of t)e.resolve()}catch(e){for(let n of t)n.reject(e)}}}finally{this.saveScheduled=!1}}cloneSettings(){return typeof structuredClone==`function`?structuredClone(this.settings):JSON.parse(JSON.stringify(this.settings))}};module.exports=lA;
|
|||
|
|
/* nosourcemap */
|