o
     Loj#                     @  s6   d dl mZ d dlmZ ddlmZmZ dd	d
ZdS )    )annotations)Path   )index_scriptload_index_payloadrootr   returntuple[Path, int]c                 C  s   | d }|d j dd}|d j dd}|d j dd}tt| }|dd| d	}|d
d}|dd| d}|dd| d}| d }|jjddd |j|dd |t|dfS )zEInline the app into one HTML file that runs from disk with no server.appz
index.htmlzutf-8)encodingz
styles.csszapp.jsz+<link rel="stylesheet" href="./styles.css">z<style>
z	
</style>z3<link rel="manifest" href="./manifest.webmanifest"> z'<script src="./data/index.js"></script>z	<script>
z	</script>z <script src="./app.js"></script>zdist/openrights-demo.htmlT)parentsexist_ok)		read_textr   r   replaceparentmkdir
write_textlenencode)r   r
   htmlstylesscriptdatatarget r   //root/openrights-assistant/openrights/bundle.pybuild   s   r   N)r   r   r   r	   )
__future__r   pathlibr   webr   r   r   r   r   r   r   <module>   s    