"use strict" ; var ht = ( e , l , t ) => { if ( ! l . has ( e ) ) throw TypeError ( "Cannot " + t ) } ; var Jt = ( e , l , t ) => ( ht ( e , l , "read from private field" ) , t ? t . call ( e ) : l . get ( e ) ) , St = ( e , l , t ) => { if ( l . has ( e ) ) throw TypeError ( "Cannot add the same private member more than once" ) ; l instanceof WeakSet ? l . add ( e ) : l . set ( e , t ) } , Ft = ( e , l , t , c ) => ( ht ( e , l , "write to private field" ) , c ? c . call ( e , t ) : l . set ( e , t ) , t ) ; / * !
THIS IS A GENERATED / BUNDLED FILE BY ESBUILD
if you want to view the source , please visit the github repository https : //github.com/mokeyish/obsidian-enhancing-export .
* / O b j e c t . d e f i n e P r o p e r t i e s ( e x p o r t s , { _ _ e s M o d u l e : { v a l u e : ! 0 } , [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; c o n s t b e = r e q u i r e ( " o b s i d i a n " ) , _ c = r e q u i r e ( " c h i l d _ p r o c e s s " ) , d c = r e q u i r e ( " p r o c e s s " ) , o c = r e q u i r e ( " e l e c t r o n " ) , a c = r e q u i r e ( " f s " ) , o e = r e q u i r e ( " p a t h " ) , e n = r e q u i r e ( " u t i l " ) ; f u n c t i o n Z t ( e ) { c o n s t l = O b j e c t . c r e a t e ( n u l l , { [ S y m b o l . t o S t r i n g T a g ] : { v a l u e : " M o d u l e " } } ) ; i f ( e ) { f o r ( c o n s t t i n e ) i f ( t ! = = " d e f a u l t " ) { c o n s t c = O b j e c t . g e t O w n P r o p e r t y D e s c r i p t o r ( e , t ) ; O b j e c t . d e f i n e P r o p e r t y ( l , t , c . g e t ? c : { e n u m e r a b l e : ! 0 , g e t : ( ) = > e [ t ] } ) } } r e t u r n l . d e f a u l t = e , O b j e c t . f r e e z e ( l ) } c o n s t l n = Z t ( b e ) , Q e = Z t ( o c ) , K l = Z t ( a c ) , G l = { M a r k d o w n : { n a m e : " M a r k d o w n " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , " M a r k d o w n ( H u g o ) " : { n a m e : " M a r k d o w n ( H u g o ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n + h u g o . l u a " - s - o " $ { o u t p u t P a t h } " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , H t m l : { n a m e : " H t m l " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a t h _ b l o c k . l u a " - - e m b e d - r e s o u r c e s - - s t a n d a l o n e - - m e t a d a t a t i t l e = " $ { c u r r e n t F i l e N a m e } " - s - o " $ { o u t p u t P a t h } " - t h t m l ' , c u s t o m A r g u m e n t s : ' - - m a t h j a x = " h t t p s : / / c d n . j s d e l i v r . n e t / n p m / m a t h j a x @ 3 / e s 5 / t e x - s v g - f u l l . j s " ' , e x t e n s i o n : " . h t m l " } , T e x t B u n d l e : { n a m e : " T e x t B u n d l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - V m e d i a _ d i r = " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / a s s e t s " - s - o " $ { o u t p u t D i r } / $ { o u t p u t F i l e N a m e } . t e x t b u n d l e / t e x t . m d " - t c o m m o n m a r k _ x - a t t r i b u t e s ' , e x t e n s i o n : " . m d " } , T y p s t : { n a m e : " T y p s t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / m a r k d o w n . l u a " - s - o " $ { o u t p u t P a t h } " - t t y p s t ' , e x t e n s i o n : " . t y p " } , P D F : { n a m e : " P D F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - - l u a - f i l t e r = " $ { l u a D i r } / p d f . l u a " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - - e m b e d - r e s o u r c e s - - s t a n d a l o n e - s - o " $ { o u t p u t P a t h } " - t p d f ' , c u s t o m A r g u m e n t s : " - - p d f - e n g i n e = p d f l a t e x " , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . p d f " } , " W o r d ( . d o c x ) " : { n a m e : " W o r d ( . d o c x ) " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t d o c x ' , e x t e n s i o n : " . d o c x " } , O p e n O f f i c e : { n a m e : " O p e n O f f i c e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t o d t ' , e x t e n s i o n : " . o d t " } , R T F : { n a m e : " R T F " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r t f ' , e x t e n s i o n : " . r t f " } , E p u b : { n a m e : " E p u b " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t e p u b ' , e x t e n s i o n : " . e p u b " } , L a t e x : { n a m e : " L a t e x " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " $ { o p t i o n s . t e x t e m p l a t e ? ` - - r e s o u r c e - p a t h = " $ { p l u g i n D i r } / t e x t e m p l a t e " - - t e m p l a t e = " $ { o p t i o n s . t e x t e m p l a t e } " ` : ` ` } - s - o " $ { o u t p u t P a t h } " - t l a t e x ' , o p t i o n s M e t a : { t e x t e m p l a t e : " p r e s e t : t e x t e m p l a t e " } , e x t e n s i o n : " . l a t e x " } , " M e d i a W i k i " : { n a m e : " M e d i a W i k i " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t m e d i a w i k i ' , e x t e n s i o n : " . m e d i a w i k i " } , r e S t r u c t u r e d T e x t : { n a m e : " r e S t r u c t u r e d T e x t " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } " - t r s t ' , e x t e n s i o n : " . r s t " } , T e x t i l e : { n a m e : " T e x t i l e " , t y p e : " p a n d o c " , a r g u m e n t s : ' - f m a r k d o w n - - r e s o u r c e - p a t h = " $ { c u r r e n t D i r } " - - r e s o u r c e - p a t h = " $ { a t t a c h m e n t F o l d e r P a t h } " - s - o " $ { o u t p u t P a t h } "
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
* /function tl(e){if(e!==e.toLowerCase()&&e!==e.toUpperCase()||(e=e.toLowerCase()),e.indexOf("-")===-1&&e.indexOf("_")===-1)return e;{let t="",c=!1;const n=e.match(/ ^ - + /);for(let I=n?n[0].length:0;I<e.length;I++){let i=e.charAt(I);c&&(c=!1,i=i.toUpperCase()),I!==0&&(i==="-"||i==="_")?c=!0:i!=="-"&&i!=="_"&&(t+=i)}return t}}function Nc(e,l){const t=e.toLowerCase();l=l||"-";let c="";for(let n=0;n<e.length;n++){const I=t.charAt(n),i=e.charAt(n);I!==i&&n>0?c+=`${l}${t.charAt(n)}`:c+=i}return c}function Yc(e){return e==null?!1:typeof e=="number"||/ ^ 0 x [ 0 - 9 a - f ] + $ / i . test ( e ) ? ! 0 : /^0[^.]/ . test ( e ) ? ! 1 : /^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/ . test ( e ) } / * *
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
* /function Qn(e){if(Array.isArray(e))return e.map(i=>typeof i!="string"?i+"":i);e=e.trim();let l=0,t=null,c=null,n=null;const I=[];for(let i=0;i<e.length;i++){if(t=c,c=e.charAt(i),c===" "&&!n){t!==" "&&l++;continue}c===n?n=null:(c==="'"||c==='"')&&!n&&(n=c),I[l]||(I[l]=""),I[l]+=c}return I}/ * *
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
* /var We;(function(e){e.BOOLEAN="boolean",e.STRING="string",e.NUMBER="number",e.ARRAY="array"})(We||(We={}));/ * *
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
* /let Fe;class En{constructor(l){Fe=l}parse(l,t){const c=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},t),n=Qn(l),I=typeof l=="string",i=Kn(Object.assign(Object.create(null),c.alias)),g=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},c.configuration),C=Object.assign(Object.create(null),c.default),a=c.configObjects||[],d=c.envPrefix,m=g["populate--"],N=m?"--":"_",A=Object.create(null),U=Object.create(null),w=c.__||Fe.format,s={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},z=/ ^ - ( [ 0 - 9 ] + ( \ . [ 0 - 9 ] + ) ? | \ . [ 0 - 9 ] + ) $ / , Q = new RegExp ( "^--" + g [ "negation-prefix" ] + "(.+)" ) ; [ ] . concat ( c . array || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { const o = typeof V == "object" ? V . key : V , R = Object . keys ( V ) . map ( function ( W ) { return { boolean : "bools" , string : "strings" , number : "numbers" } [ W ] } ) . filter ( Boolean ) . pop ( ) ; R && ( s [ R ] [ o ] = ! 0 ) , s . arrays [ o ] = ! 0 , s . keys . push ( o ) } ) , [ ] . concat ( c . boolean || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { s . bools [ V ] = ! 0 , s . keys . push ( V ) } ) , [ ] . concat ( c . string || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { s . strings [ V ] = ! 0 , s . keys . push ( V ) } ) , [ ] . concat ( c . number || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { s . numbers [ V ] = ! 0 , s . keys . push ( V ) } ) , [ ] . concat ( c . count || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { s . counts [ V ] = ! 0 , s . keys . push ( V ) } ) , [ ] . concat ( c . normalize || [ ] ) . filter ( Boolean ) . forEach ( function ( V ) { s . normalize [ V ] = ! 0 , s . keys . push ( V ) } ) , typeof c . narg == "object" && Object . entries ( c . narg ) . forEach ( ( [ V , o ] ) => { typeof o == "number" && ( s . nargs [ V ] = o , s . keys . push ( V ) ) } ) , typeof c . coerce == "object" && Object . entries ( c . coerce ) . forEach ( ( [ V , o ] ) => { typeof o == "function" && ( s . coercions [ V ] = o , s . keys . push ( V ) ) } ) , typeof c . config < "u" && ( Array . isArray ( c . config ) || typeof c . config == "string" ? [ ] . concat ( c . config ) . filter ( Boolean ) . forEach ( function ( V ) { s . configs [ V ] = ! 0 } ) : typeof c . config == "object" && Object . entries ( c . config ) . forEach ( ( [ V , o ] ) => { ( typeof o == "boolean" || typeof o == "function" ) && ( s . configs [ V ] = o ) } ) ) , q ( c . key , i , c . default , s . arrays ) , Object . keys ( C ) . forEach ( function ( V ) { ( s . aliases [ V ] || [ ] ) . forEach ( function ( o ) { C [ o ] = C [ V ] } ) } ) ; let E = null ; $c ( ) ; let v = [ ] ; const K = Object . assign ( Object . create ( null ) , { _ : [ ] } ) , Ce = { } ; for ( let V = 0 ; V < n . length ; V ++ ) { const o = n [ V ] , R = o . replace ( /^-{3,}/ , "---" ) ; let W , Z , Y , F , k , ee ; if ( o !== "--" && /^-/ . test ( o ) && Wl ( o ) ) J ( o ) ; else if ( R . match ( /^---+(=|$)/ ) ) { J ( o ) ; continue } else if ( o . match ( /^--.+=/ ) || ! g [ "short-option-groups" ] && o . match ( /^-.+=/ ) ) F = o . match ( /^--?([^=]+)=([\s\S]*)$/ ) , F !== null && Array . isArray ( F ) && F . length >= 3 && ( S ( F [ 1 ] , s . arrays ) ? V = b ( V , F [ 1 ] , n , F [ 2 ] ) : S ( F [ 1 ] , s . nargs ) !== ! 1 ? V = y ( V , F [ 1 ] , n , F [ 2 ] ) : G ( F [ 1 ] , F [ 2 ] , ! 0 ) ) ; else if ( o . match ( Q ) && g [ "boolean-negation" ] ) F = o . match ( Q ) , F !== null && Array . isArray ( F ) && F . length >= 2 && ( Z = F [ 1 ] , G ( Z , S ( Z , s . arrays ) ? [ ! 1 ] : ! 1 ) ) ; else if ( o . match ( /^--.+/ ) || ! g [ "short-option-groups" ] && o . match ( /^-[^-]+/ ) ) F = o . match ( /^--?(.+)/ ) , F !== null && Array . isArray ( F ) && F . length >= 2 && ( Z = F [ 1 ] , S ( Z , s . arrays ) ? V = b ( V , Z , n ) : S ( Z , s . nargs ) !== ! 1 ? V = y ( V , Z , n ) : ( k = n [ V + 1 ] , k !== void 0 && ( ! k . match ( /^-/ ) || k . match ( z ) ) && ! S ( Z , s . bools ) && ! S ( Z , s . counts ) || /^(true|false)$/ . test ( k ) ? ( G ( Z , k ) , V ++ ) : G ( Z , He ( Z ) ) ) ) ; else if ( o . match ( /^-.\..+=/ ) ) F = o . match ( /^-([^=]+)=([\s\S]*)$/ ) , F !== null && Array . isArray ( F ) && F . length >= 3 && G ( F [ 1 ] , F [ 2 ] ) ; else if ( o . match ( /^-.\..+/ ) && ! o . match ( z ) ) k = n [ V + 1 ] , F = o . match ( /^-(.\..+)/ ) , F !== null && Array . isArray ( F ) && F . length >= 2 && ( Z = F [ 1 ] , k !== void 0 && ! k . match ( /^-/ ) && ! S ( Z , s . bools ) && ! S ( Z , s . counts ) ? ( G ( Z , k ) , V ++ ) : G ( Z , He ( Z ) ) ) ; else if ( o . match ( /^-[^-]+/ ) && ! o . match ( z ) ) { Y = o . slice ( 1 , -
* @ fileoverview Main entrypoint for libraries using yargs - parser in Node . js
* CJS and ESM environments .
*
* @ license
* Copyright ( c ) 2016 , Contributors
* SPDX - License - Identifier : ISC
* /var zl,jl,wl;const yt=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,ft=(jl=(zl=process==null?void 0:process.versions)===null||zl===void 0?void 0:zl.node)!==null&&jl!==void 0?jl:(wl=process==null?void 0:process.version)===null||wl===void 0?void 0:wl.slice(1);if(ft&&Number(ft.match(/ ^ ( [ ^ . ] + ) / ) [ 1 ] ) < yt ) throw Error ( ` yargs parser supports a minimum Node.js version of ${ yt } . Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions ` ) ; const Mn = process ? process . env : { } , uc = new En ( { cwd : process . cwd , env : ( ) => Mn , format : en . format , normalize : oe . normalize , resolve : oe . resolve , require : e => { if ( typeof require < "u" ) return require ( e ) ; if ( e . match ( /\.json$/ ) ) return JSON . parse ( ac . readFileSync ( e , "utf8" ) ) ; throw Error ( "only .json config files are supported in ESM" ) } } ) , al = function ( l , t ) { return uc . parse ( l . slice ( ) , t ) . argv } ; al . detailed = function ( e , l ) { return uc . parse ( e . slice ( ) , l ) } ; al . camelCase = tl ; al . decamelize = Nc ; al . looksLikeNumber = Yc ; const zn = { exportToOo : "导出为......" , exportWithPrevious : "使用上一次设置导出" , exportSuccessNotice : P ` 导出文件 ${ 0 } 成功! ` , exportCommandOutputMessage : P ` 命令: ${ 0 } ` , exportErrorOutputMessage : P ` 命令 ${ 0 } ,错误: ${ 1 } ` , pleaseOpenFile : "请打开一个文件先。" , preparing : P ` 正在生成 " ${ 0 } " ...... ` , exportDialog : { fileName : "文件名" , type : "类型" , exportTo : "导出到" , title : P ` 导出为 ${ 0 } ` , export : "导出" , selectExportFolder : "请选择导出文件夹" , overwriteConfirmation : "覆盖提示" } , messageBox : { yes : "是" , no : "否" , ok : "确认" , cancel : "取消" } , overwriteConfirmationDialog : { replace : "替换" , title : P ` " ${ 0 } " 已经存在。您要替换它吗? ` , message : P ` " ${ 0 } " 文件夹中已有相同的文件或文件夹,若替换,则会覆盖其当前内容。 ` } , settingTab : { title : "导出设置" , general : "通用" , name : "名称" , customLocation : "自定义" , version : P ` 版本: ${ 0 } ` , pandocNotFound : "找不到 Pandoc, 请填写 Pandoc 文件路径,或者将其添加到系统环境变量中。" , pandocPath : "Pandoc 路径" , defaultFolderForExportedFile : "默认的导出文件夹" , openExportedFileLocation : "打开导出文件所在目录" , sameFolderWithCurrentFile : "与原文件同一目录下" , openExportedFile : "打开导出文件" , pandocPathPlaceholder : "(自动检测)" , editCommandTemplate : "编辑命令模板" , chooseCommandTemplate : "选择模板" , afterExport : "导出后" , command : "命令" , arguments : "参数" , auto : "自动" , reset : "重置" , add : "添加" , remove : "移除" , rename : "重命名" , targetFileExtensions : "目标文件扩展名" , targetFileExtensionsTip : "(用空格分开)" , showCommandOutput : "显示命令行输出" , runCommand : "运行自定义命令" , extraArguments : "自定义参数" , save : "保存" , new : "新建" , template : "模板" , advanced : "高级" , environmentVariables : "环境变量" , environmentVariablesDesc : "定义导出的环境变量." , ShowExportProgressBar : "显示导出进度条" } } , jn = { exportToOo : "Export to..." , exportSuccessNotice : P ` Export file ${ 0 } success! ` , exportCommandOutputMessage : P ` Command: ${ 0 } ` , exportErrorOutputMessage : P ` Command: ${ 0 } , Error:${ 1 } ` , exportWithPrevious : "Export with Previous" , pleaseOpenFile : "Please open a file first." , preparing : P ` generating " ${ 0 } "... ` , exportDialog : { exportTo : "Export to" , fileName : "File Name" , title : P ` Export to ${ 0 } ` , export : "Export" , selectExportFolder : "Please select an export folder." , overwriteConfirmation : "Overwrite confirmation" , type : "Type" } , messageBox : { yes : "Yes" , no : "No" , ok : "Ok" , cancel : "Cancel" } , overwriteConfirmationDialog : { replace : "Replace" , title : P ` " ${ 0 } " already exists. Do you want to replace it? ` , message : P ` A file or folder with the same name already exists in the folder " ${ 0 } ". Replacing it will overwrite its current contents. ` } , settingTab : { general : "General" , name : "Name" , title : "Export Settings" , version : P ` Version: ${ 0 } ` , pandocNotFound : "Pandoc not found, please fill in the Pandoc file path, or add it to the system environment variables." , defaultFolderForExportedFile : "Default Folder for Exported File" , openExportedFileLocation : "Open exported file location" , ShowExportProgressBar : " Show export progress b
` )).replace("pandoc.exe","").replace("pandoc","").trim();let c=[...t].filter(n=>n===".").length;for(;c>2;)t=t.substring(0,t.lastIndexOf(".")),c-=1;return WC.parse(t)}const Cc=Re('<div class="modal-button-container">'),XC=e=>{const{plugin:l,lang:t}=e,[c,n]=oI(l.settings),[I,i]=Ve(),g=te(()=>Object.entries(Object.assign({},ae(Cl),ae(c.env)??{})).map(([J,y])=> ` $ { J } = "${y}" ` ).join( `
` )),C=(...J)=>{n(...J),l.saveSettings()},a=J=>{try{const y={};for(let b of J.split( `
` )){b=b.trim();const G=b.indexOf("=");if(G>0){const Ge=b.substring(0,G);let D=b.substring(G+1).trim();D.startsWith('"')&&D.endsWith('"')&&(D=D.substring(1,D.length-1)),y[Ge]=D}}C("env",xe(c.env??{},y))}catch(y){alert(y)}},d=te(()=>c.items.find(J=>J.name===c.lastEditName)??c.items.first()),m=J=>{const y=d();return J===void 0||J===y.type?y:void 0},N=te(()=>ae(c.customDefaultExportDirectory)),A=J=>{const y=c.items.findIndex(b=>b.name===c.lastEditName);C("items",y===-1?0:y,aI(b=>(J(b),b)))},U=te(()=>{const J=I();return J?t.settingTab.version(J):t.settingTab.pandocNotFound}),[w,s]=Ve(),z=()=>{const[J,y]=Ve(Object.keys(Gl)[0]),[b,G]=Ve(),Ge=()=>{const D=JSON.parse(JSON.stringify(Gl[J()]));D.name=b(),hl(()=>{C("items",r=>[...r,D]),C("lastEditName",D.name)}),s(void 0)};return X(it,{app,get title(){return t.settingTab.new},onClose:()=>s(void 0),get children(){return[X(M,{get name(){return t.settingTab.template},get children(){return X(gl,{get options(){return Object.entries(Gl).map(([D,r])=>({name:r.name,value:D}))},get selected(){return b()??J()},onChange:D=>y(D)})}}),X(M,{get name(){return t.settingTab.name},get children(){return X(de,{get value(){return b()??""},onChange:D=>G(D)})}}),(()=>{const D=Cc();return Ze(D,X(Ct,{cta:!0,onClick:Ge,get children(){return t.settingTab.save}})),D})()]}})},Q=()=>{const[J,y]=Ve(m().name),b=()=>{hl(()=>{A(G=>G.name=J()),C("lastEditName",J())}),s(void 0)};return X(it,{app,get title(){return t.settingTab.rename},onClose:()=>s(void 0),get children(){return[X(M,{get name(){return t.settingTab.name},get children(){return X(de,{get value(){return J()??""},onChange:G=>y(G)})}}),(()=>{const G=Cc();return Ze(G,X(Ct,{cta:!0,onClick:b,get children(){return t.settingTab.add}})),G})()]}})},E=()=>{const J=()=>m("pandoc"),y=b=>{A(G=>G.type==="pandoc"?b(G):void 0)};return[X(M,{get name(){return t.settingTab.arguments},get children(){return X(de,{style:"width: 100%",get value(){return J().arguments??""},onChange:b=>y(G=>G.arguments=b)})}}),X(M,{get name(){return t.settingTab.extraArguments},get children(){return X(de,{style:"width: 100%",get value(){return J().customArguments??""},get title(){return J().customArguments},onChange:b=>y(G=>G.customArguments=b)})}}),X(M,{get name(){return t.settingTab.afterExport},heading:!0}),X(M,{get name(){return t.settingTab.openExportedFileLocation},get children(){return X(me,{get checked(){return J().openExportedFileLocation??!1},onChange:b=>y(G=>G.openExportedFileLocation=b)})}}),X(M,{get name(){return t.settingTab.openExportedFile},get children(){return X(me,{get checked(){return J().openExportedFile??!1},onChange:b=>y(G=>G.openExportedFile=b)})}}),X(M,{get name(){return t.settingTab.runCommand},get children(){return X(me,{get checked(){return J().runCommand},onChange:b=>y(G=>G.runCommand=b)})}}),X(Jl,{get when(){return J().runCommand},get children(){return X(M,{get children(){return X(de,{style:"width: 100%",get value(){return J().command??""},onChange:b=>y(G=>G.command=b)})}})}})]},v=()=>{const J=()=>m("custom"),y=b=>{A(G=>G.type==="custom"?b(G):void 0)};return[X(M,{get name(){return t.settingTab.command},get children(){return X(de,{style:"width: 100%",get value(){return J().command},onChange:b=>y(G=>G.command=b)})}}),X(M,{get name(){return t.settingTab.targetFileExtensions},get children(){return X(de,{get value(){return J().targetFileExtensions??""},onChange:b=>y(G=>G.targetFileExtensions=b)})}}),X(M,{get name(){return t.settingTab.afterExport},heading:!0}),X(M,{get name(){return t.settingTab.showCommandOutput},get children(){return X(me,{get checked(){return J().showCommandOutput??!1},onChange:b=>y(G=>G.showCommandOutput=b)})}}),X(M,{get name(){return t.settingTab.openExportedFileLocation},get children(){return X(me,{get checked(){return J().openExportedFileLocation??!1},onChange:b=>y(G=>G.openExportedFileLocation=b)})}}),X(M,{get name(){return t.settingTab.openExportedFile},get children(){return X(me,{get checked(){return J().openExportedFile??!1},onChange:b=>y(G=>G.openExportedFile=b)})}})]},K=async()=>{await l.resetSettings(),C(l.settings)},Ce=async()=>{const J=awa