+
   ;_zV                       ^ RI t ^ RIt^ RIt^ RIt^ RIHt ^ RIHtHt ^RI	H
t
 ^RIHtHt R tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R# )    N)find_library)PathPurePath)update_shell)Error__version__c                 P    \        \        \        4      P                  R4      4      # )z@Return the directory that contains the VapourSynth header files.includestrr   __file__	with_name     7/usr/lib/python3.14/site-packages/vapoursynth/_utils.pyget_includer          x!++I677r   c                 P    \        \        \        4      P                  R4      4      # )zCReturn the pkgconfig directory in which `vapoursynth.pc` is stored.	pkgconfigr   r   r   r   get_pkgconfig_dirr      s    x!++K899r   c                 P    \        \        \        4      P                  R4      4      # )z1Return the VapourSynth plugin directory location.pluginsr   r   r   r   get_plugin_dirr      r   r   c                 @   \         P                  R8X  d(   \        \        \        4      P                  R4      4      # \         P                  R8X  d(   \        \        \        4      P                  R4      4      # \        \        \        4      P                  R4      4      # )z,Return the location of the vsscript library.win32zvsscript.dlldarwinzlibvsscript.dylibzlibvsscript.so)sysplatformr   r   r   r   r   r   r   get_vsscriptr      sm    
||w8H%//?@@		!8H%//0CDEE8H%//0@ABBr   c                 n   V P                  4       P                  R ^4      p\        V4      ^8  d   VP                  R4       K#  \	        V^ ,          4      ^0,          \	        V^,          4      ^ ,          ,          \	        V^,          4      ^,          ,          \	        V^,          4      ^ ,          ,          # ).0)stripsplitlenappendint)version_stringversion_partss   & r   _version_string_to_numberr*   (   s    "((*00a8M
m
q
 S!	]1	"	$}Q B&	(}Q B&	( }Q A%	'r   c                    ^ RI HpHpHpHpHp \        P                  ! R4      pVP                  pW2W%.Vn	        Whn
        VP                  p	W3WT.V	n	        Win
        \        P                  ! ^'4      p
V! V ^ ^ V
4      ^ 8w  d   R# \        P                  P                  ^4      p\        P                  ! VP                  4      pV	! V
P                  RV\        P                  ! V4      4      pV^8X  db   VP                  ^,           Vn        \        P                  ! VP                  4      pV	! V
P                  RV\        P                  ! V4      4      pV^ 8w  d   R# \!        VP                  4      \!        V4      8  # )r   )DWORDLPCWSTRLPDWORDLPWSTRUINTzmsi.dllFVersionString)ctypes.wintypesr,   r-   r.   r/   r0   ctypesWinDLLMsiEnumRelatedProductsWargtypesrestypeMsiGetProductInfoWcreate_unicode_bufferwintypesvaluebyrefr*   )upgrade_codemin_versionr,   r-   r.   r/   r0   msir5   r8   product_code_bufversion_string_sizeversion_string_buferr_codes   &&            r   _is_msi_product_installedrD   4   sR   EE
--	
"C!99(/'F$&*#//#*V"E!%33B7|Q3CDI ////3556I6O6OP!1CV\\ReEfH 3$7$=$=$A!#99:M:S:ST%""O5GViIj
 1}$%7%=%=>B[\gBhhhr   c                      \         P                  R 8X  dC   \        RR4      '       g/   \        R4       \        R4       \        R4       \        R4       R# R# R# )r   z&{36F68A90-239C-34DF-B58C-64B30153CE35}z14.50.35719.0z_The Visual Studio 2015-2026 runtime which is required to run VapourSynth is missing or too old!z*The latest version can be downloaded from:z.    x64: https://aka.ms/vc14/vc_redist.x64.exez0  arm64: https://aka.ms/vc14/vc_redist.arm64.exeN)r   r   rD   printr   r   r   _check_visual_studio_runtimerG   W   sL    
||w()QSbccst>?BCDE	 d r   c                     \         P                  R 8X  d   ^ RIHp HpHpHp \        P                  ! R4      pVP                  pWV .Vn
        Wn        \        P                  ! V^,          ^,           4      pV! \        P                  P                  Wc^,          4      ^ 8X  d   R# VP                  #  ! R R\        P                   4      p\        P"                  ! \%        R4      4      p\        P&                  \        P(                  ! V4      .VP*                  n
        \        P,                  VP*                  n        V! 4       p	VP+                  \        P.                  ! \        P                  P0                  \        P&                  4      \        P2                  ! V	4      4      p
RpV
^ 8w  d2   \5        V	P6                  P9                  4       4      P;                  4       p\         P                  R8X  d   V# V'       d4    \        P"                  ! V4      pV'       d   VP0                  '       d   V# ^ RIH pH!p . pR	pV! R
4      pV'       d   VV9   d   VPE                  V4       V! R4      pV'       d,   \G        V4      PH                  V8X  d   VPE                  V4       V! R4      pV'       d,   \G        V4      PH                  V8X  d   VPE                  V4       V! RRR4      pV FD  pV F;  pV'       g   K  \5        V4      V,          pVPK                  4       '       g   K7  Vu u # 	  KF  	  R#   \<         d     ELi ; i)r   )r,   HMODULEr/   MAX_PATHzkernel32.dllNc                       ] tR t^ntR]P
                  3R]P                  3R]P
                  3R]P                  3.tRtR# ))_find_python_symbol_path.<locals>.Dl_info	dli_fname	dli_fbase	dli_sname	dli_saddrr   N)	__name__
__module____qualname____firstlineno__r3   c_char_pc_void_p_fields___static_attributes__r   r   r   Dl_inforL   n   s9    foo.foo.foo.foo.	Hr   rY   dlr   )get_config_varget_config_varsz.so
INSTSONAME	LDLIBRARYLIBRARYLIBPLsrcdirLIBDIR)&r   r   r2   r,   rI   r/   rJ   r3   r4   GetModuleFileNameWr6   r7   r9   	pythonapi_handler;   	StructureCDLLr   rV   POINTERdladdrc_intcastPy_GetVersionpointerr   rM   decoderesolve	Exception	sysconfigr[   r\   r&   r   suffixis_file)r,   rI   r/   rJ   kernel32rc   bufrY   libdldlinforetcodelibpathpylibr[   r\   libfilenamesrr   r]   r^   r_   libpathsfnpaths                          r   _find_python_symbol_pathr   `   so   
||wDD==0%88'.&>#%*"**8a<!+;<f..66\JaOyy	f&& 	 L./!'&..2I J%||,,v{{6+;+;+I+I6??[]c]k]klr]sta<6++2245==?G <<8#N G,U000"N
 	>#L1
&J.
+";/	),33v=	* +x(//69("7Hh?B 4 JOE}}$	 !  ;  s    L2 L2 0L2 2M Mc                     \         P                  R 8X  Ed   ^ RIp Rp V P                  V P                  R^ V P
                  V P                  ,          4      p V P                  VR4      ^ ,          pV P                  V4       T'       d;   \        \        4      P                  P                  T4      '       d   \        R4       M#T'       d   \        RT R24       M\        R4       Rp T P                  T P                  R^ T P
                  T P                  ,          4      p T P                  TR4      ^ ,          pT P                  T4       T'       dA   \        \        4      P                  R	4      P                  T4      '       d   \        R
4       R# T'       d   \        RT R24       R# \        R4       R# R#   T P                  T4       i ; i  \         d     EL`i ; i  T P                  T4       i ; i  \         d     Li ; i)r   NSOFTWARE\VapourSynthr   z#Registry entries: this installationz(Registry entries: (other installation) ""zRegistry entries: not setLSOFTWARE\Classes\CLSID\{58F74CA0-BD0E-4664-A49B-8D10E6F0C131}\InProcServer32	vsvfw.dllzVFW module: this installationz"VFW module: (other installation) "zVFW module: not set)r   r   winregOpenKeyHKEY_CURRENT_USERKEY_READKEY_WOW64_64KEYQueryValueExCloseKeyrp   r   r   parent
full_matchrF   r   )r   vapoursynth_pathkeyvfw_paths       r   _check_windows_envr      s   
||w		..((*A1fooX^XnXnFnC%#)#6#6sF#CA#F $  2 9 9 D DEU V V78<=M<NaPQ-.	..((_&"8"88	C%!..sD9!<$ *44[ALLXVV126xjBC'(Y  $ 		, $ 		sS   9G F> 1G *9G< $G& =G< >GG G#"G#&G99G< <H
	H
c                  J   \         P                  R 8X  d(   \        \        P                  ! R4      4      R,          p ML\        P                  ! R4      ;'       g    \        P
                  ! 4       R,          p\        V4      R,          p V P                  RRR7       V R,          # )r   APPDATAvapoursynthXDG_CONFIG_HOMEz.configT)parentsexist_okzvapoursynth.toml)r   r   r   osgetenvhomemkdir)config_pathconfig_homes     r   _get_vapoursynth_config_pathr      sv    
||w299Y/0=@ii 12MMdiikI6M;'-7dT2+++r   c                     \         P                  R 8X  dr   \        \        4      P                  P                  P                  P                  p V R,          pV R,          p V P                  4       ;'       d    VP                  4       # R# )r   zpython3.dllz
python.exeF)r   r   r   r   r   rs   )direct_python_exe_pathdirect_python_dll_paths     r   _has_implicit_configr      sj    
||w!%h!6!6!=!=!D!D!K!K!7-!G!7,!F%--/TT4J4R4R4TTr   c                 p    \         P                  R 8X  d   V P                  4       # V P                  RR4      # )r   z/lib64/z/lib/)r   r   lowerreplace)r~   s   &r   _mangle_vsscript_keyr      s+    
||wzz|||Iw//r   c                  b   \        4        \        P                  ! R 4      p \        4       pV'       gX   \	        4       p/ p \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       \        \        4       4      pYS9   pV'       g   \        R4       \        R\        \        4      P                   R24       V \        4       8X  d   \        R4       M#V '       d   \        RV  R24       M\        R4       \        4        R#   + '       g   i     L; i  \         d     Li ; i)	VSSCRIPT_PATHrbNz6VAPOURSYNTH IS NOT CONFIGURED! RUN VAPOURSYNTH CONFIG!zVapourSynth path: "r   z VSSCRIPT_PATH: this installationz%VSSCRIPT_PATH: (other installation) "zVSSCRIPT_PATH: not set)rG   r   r   r   r   opentomllibloadrp   r   r   rF   r   r   r   r   )vsscript_pathhas_valid_configr   contentsfvsscript_keys         r   vapoursynth_check_envr      s     "IIo.M+-24	k4((A"<<? )
 ,LN;'3FG	 2 9 9:!
<=&01	5m_AFG&'+ )( 		s0    D  D+D  D	D  D   D.-D.c                 T    R \        V 4      P                  RR4      ,           R ,           # )r   \z\\)r   r   )ss   &r   _escape_toml_stringr     s!    Qf--33r   c                     \        4        \        4       '       d   \        R 4       R# \        4       p  \	        V R4      ;_uu_ 4       pVP                  ^ 4       / p \        P                  ! V4      p\        4       pVe   VP                  ^ 4       \        \        4       4      p\        P                  V\        \         P"                  ! \        P                  4      P$                  4      .W$&   V Fz  pVP'                  \)        V4       R\)        W%,          ^ ,          4       R\)        W%,          ^,          4       R\)        W%,          ^,          4       R2P+                  R4      4       K|  	  \        RV  24       M\        R4       RRR4       R#   \         d     EL.i ; i  + '       g   i     R# ; i  \         d    \        R	T  24        R# i ; i)
zNo configuration needed!Nza+bz = [,z]
zutf-8z&Configuration successfully written to z&Failed to determine Python symbol pathz!Failed to write configuration to )rG   r   rF   r   r   seekr   r   rp   r   truncater   r   r   
executabler'   r   statst_mtimewriter   encode)r   r   r   py_symbol_pathr   r   s         r   vapoursynth_configr     s    "().0KA+u%%FF1IH"<<? 67N)

1 4\^ D+.>>>3rwwWZWeWeOfOoOoKp*q'#CGG.s34D9LX][\M]9^8__`atu}  vC  DE  vF  bG  aH  HI  J]  ^f  ^k  lm  ^n  Jo  Ip  ps  t  {  {# $ >{mLM>?) &%
   &%%*  A1+?@AsT   F8 F$F2DF$F8 F!F$ F!!F$$F5	/F8 5F8 8GGc                    ^ RI pV  F  p VP                  VP                  VR,          ^ VP                  VP                  ,          4      p VP                  W2R,          ^ VP                  \        VR,          4      4       VP                  V4       K  	  R#   TP                  T4       i ; i  \         d&    \        RTR,           24       \        R4         R# \         d    h i ; i)	r   Nsubkey
value_name
value_datazPermission denied: z8Try running as administrator or don't run in global modeFT)r   CreateKeyExr   	KEY_WRITEr   
SetValueExREG_SZr   r   PermissionErrorrF   rp   )entriesr   entryr   s   &   r   _write_registry_entriesr   B  s    	$$((%/1f>N>NQWQgQg>gC%!!#\':Av}}cRWXdReNfg$ $  $ 	'h'89:LM 		s0   A B.5BB.B++B..+C)C)&C)c                  2   \         P                  R 8w  d   \        R4      hRRRRR\        /RRRRR\	        \
        4      P                  /RRRRR\        4       /RRRR	R\	        \
        4      P                  R
4      /RRRRR\        4       /RRRRR\	        \
        4      P                  R4      /RRRRR\	        \         P                  4      P                  /.p \        V 4      '       g$   \        R4       \         P                  ! ^4       R# \        R4       R# )r   %Command is only supported on Windows!r   r   r   Versionr   r   PluginsVapourSynthDLLzlibvapoursynth.dllVSScriptDLL	VSPipeEXEz
vspipe.exe
PythonPathCouldn't write to registry!z?Successfully wrote legacy installation information to registry!N)r   r   r   r   r   r   r   r   r   r   r   r   rF   exitr   s    r   register_legacy_installr   Z  s.   
||w;<< -)+	
 -&(8,33	
 -).*	
 -*(8,667KL	
 --,.	
 -+(8,66|D	
 -,(3>>299	
?$GL #7+++,OPr   c            	         \         P                  R 8X  d   RRRRR\        4       /.p \        V 4      '       g$   \	        R4       \         P
                  ! ^4       R# ^ RIHpHpH	p \        P                  ! R4      pVP                  pWV\        P                  W"\        P                  .Vn        \        P                  Vn        V! R	^^ R^R
^ 4       \	        R4       R# \#        \        4       4       R# )r   r   Environmentr   r   r   r   )HWNDr0   WPARAMz
user32.dlli  i  z'Successfully set environment variables!N)r   r   r   r   rF   r   r2   r   r0   r   r3   r4   SendMessageTimeoutW	c_wchar_prV   r6   r7   r   )r   r   r0   r   user32r   s         r   register_installr     s    
||w -oln
 'w///0HHQK::]]<0F"("<"<,0@P@PRV^d^m^m+n(*0//'=!T1M;<\^$r   c                     \         P                  R 8w  d   \        R4      hRRRRRR/RRRRR\        \        4      P                  R	4      /RRRR
RR/RRRRRR/RRRRRR/RRRRRR/RRRRRR/RRRRR\        \        4      P                  R	4       R2/RRRRRR/.	p \        V 4      '       g$   \        R4       \         P                  ! ^4       R# \        R4       R# )r   r   r   z=SOFTWARE\Classes\CLSID\{58F74CA0-BD0E-4664-A49B-8D10E6F0C131}r    r   VapourSynthr   r   ThreadingModel	Apartmentz+SOFTWARE\Classes\Media Type\Extensions\.vpyzSource Filterz&{D3588AB0-0781-11CE-B03A-0020AF0BA770}zSOFTWARE\Classes\.vpyvpyfilezSOFTWARE\Classes\vpyfilezVapourSynth Python Scriptz$SOFTWARE\Classes\vpyfile\DefaultIconz,0z'SOFTWARE\Classes\AVIFile\Extensions\VPYz&{58F74CA0-BD0E-4664-A49B-8D10E6F0C131}zCouldn't register VFW provider!z%VFW provider successfully registered!N)	r   r   r   r   r   r   r   rF   r   r   s    r   register_vfwr     sH   
||w;<<
 V"-	
 e"(8,66{C	
 e*+	
 D""	
 D/B	
 .")	
 1"5	
 ="Xh/99+FGrJ	
 @"B	
[2Gh #7++/056r   c                  .   ^ RI p \        \        4      pVP                  R4      p \        P
                  ! V P                  V.\        P                  R,          O4      P                  4       R#   \         d    \        P
                  ! ^ 4        R# i ; i)r   Nvspipe:   NN)

subprocessr   r   r   r   r   runargv
returncodeKeyboardInterrupt)r   vspipe_paths     r   r   r     si    8$K''1K <sxx| <=HHI s   AA/ /!BB)"r3   r   r   r   ctypes.utilr   pathlibr   r   _shellr   r   r   r   r   r   r   r   r*   rD   rG   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   <module>r      s     	 
  $ "   +8
:
8
C	 iFFIX-)`,0"J4 AF0.Qb%6<7~r   