@readium/shared
Version:
Shared models to be used across other Readium projects and implementations in Typescript
1 lines • 119 kB
JavaScript
(function(o,Z){typeof exports=="object"&&typeof module<"u"?Z(exports):typeof define=="function"&&define.amd?define(["exports"],Z):(o=typeof globalThis<"u"?globalThis:o||self,Z(o.shared={}))})(this,(function(o){"use strict";class Z{close(){}links(){return[]}get(t){throw Error("This is an empty fetcher")}}class ni{constructor(t,e){this.client=t||window.fetch.bind(window),this.baseUrl=e}links(){return[]}get(t){const e=t.toURL(this.baseUrl);if(e===void 0)throw Error(`Invalid HREF: ${t.href}`);return new ue(this.client,t,e)}close(){}}class ue{constructor(t,e,i){this.client=t||window.fetch.bind(window),this._link=e,this.url=i}async headResponse(){if(this._headResponse)return this._headResponse;const t=await this.client(this.url,{method:"HEAD"});if(!t.ok)throw new Error(`http HEAD request for ${this.url} failed with HTTP status code ${t.status}`);return this._headResponse=t,t}close(){}async link(){return this._link}async read(t){if(t)throw new Error("http read range not implemented!");const e=await this.client(this.url);if(!e.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${e.status}`);return new Uint8Array(await e.arrayBuffer())}async length(){const e=(await this.headResponse()).headers.get("content-length");if(e===null||e==="")throw new Error("length for resource unavailable");return parseInt(e)}async readAsJSON(){const t=await this.client(this.url);if(!t.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${t.status}`);return await t.json()}async readAsString(){const t=await this.client(this.url);if(!t.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${t.status}`);return await t.text()}async readAsXML(){const t=await this.client(this.url);if(!t.ok)throw new Error(`http GET request for ${this.url} failed with HTTP status code ${t.status}`);return new DOMParser().parseFromString(await t.text(),"application/xml")}}class ri{constructor(t,e){this.start=t,this.endInclusive=e}}class ai{readAsString(){return this.read().then(t=>t===void 0?t:new TextDecoder().decode(t))}readAsJSON(){return this.readAsString().then(t=>t===void 0?t:JSON.parse(t))}readAsXML(){return this.readAsString().then(t=>t===void 0?t:new DOMParser().parseFromString(t,"text/xml"))}}class F{constructor(t={}){this.conformsTo=t.conformsTo??[],this.certification=t.certification??null,this.summary=t.summary??null,this.accessMode=t.accessMode??[],this.accessModeSufficient=t.accessModeSufficient??[],this.feature=t.feature??[],this.hazard=t.hazard??[],this.exemption=t.exemption??[]}static deserialize(t){if(!t||typeof t!="object")return;const e=t;return new F({conformsTo:e.conformsTo?e.conformsTo.map(i=>vt.deserialize(i)).filter(i=>i!==void 0):void 0,certification:e.certification?At.deserialize(e.certification):void 0,summary:e.summary,accessMode:e.accessMode?e.accessMode.map(i=>z.deserialize(i)).filter(i=>i!==void 0):void 0,accessModeSufficient:e.accessModeSufficient?e.accessModeSufficient.map(i=>yt.deserialize(i)).filter(i=>i!==void 0):void 0,feature:e.feature?e.feature.map(i=>A.deserialize(i)).filter(i=>i!==void 0):void 0,hazard:e.hazard?e.hazard.map(i=>P.deserialize(i)).filter(i=>i!==void 0):void 0,exemption:e.exemption?e.exemption.map(i=>wt.deserialize(i)).filter(i=>i!==void 0):void 0})}serialize(){const t={};return this.conformsTo?.length>0&&(t.conformsTo=this.conformsTo.map(e=>e.serialize())),this.certification!==void 0&&this.certification!==null&&(t.certification=this.certification.serialize()),this.summary!==void 0&&this.summary!==null&&(t.summary=this.summary),this.accessMode?.length>0&&(t.accessMode=this.accessMode.map(e=>e.serialize())),this.accessModeSufficient?.length>0&&(t.accessModeSufficient=this.accessModeSufficient.map(e=>e.serialize())),this.feature?.length>0&&(t.feature=this.feature.map(e=>e.serialize())),this.hazard?.length>0&&(t.hazard=this.hazard.map(e=>e.serialize())),this.exemption?.length>0&&(t.exemption=this.exemption.map(e=>e.serialize())),t}}const v=class v{constructor(t){this.uri=t}static deserialize(t){if(!(!t||typeof t!="string"))return new v(t)}serialize(){return this.uri}get isWCAGLevelA(){return this===v.EPUB_A11Y_10_WCAG_20_A||this===v.EPUB_A11Y_11_WCAG_20_A||this===v.EPUB_A11Y_11_WCAG_21_A||this===v.EPUB_A11Y_11_WCAG_22_A}get isWCAGLevelAA(){return this===v.EPUB_A11Y_10_WCAG_20_AA||this===v.EPUB_A11Y_11_WCAG_20_AA||this===v.EPUB_A11Y_11_WCAG_21_AA||this===v.EPUB_A11Y_11_WCAG_22_AA}get isWCAGLevelAAA(){return this===v.EPUB_A11Y_10_WCAG_20_AAA||this===v.EPUB_A11Y_11_WCAG_20_AAA||this===v.EPUB_A11Y_11_WCAG_21_AAA||this===v.EPUB_A11Y_11_WCAG_22_AAA}};v.EPUB_A11Y_10_WCAG_20_A=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a"),v.EPUB_A11Y_10_WCAG_20_AA=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aa"),v.EPUB_A11Y_10_WCAG_20_AAA=new v("http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-aaa"),v.EPUB_A11Y_11_WCAG_20_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-a"),v.EPUB_A11Y_11_WCAG_20_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aa"),v.EPUB_A11Y_11_WCAG_20_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.0-aaa"),v.EPUB_A11Y_11_WCAG_21_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-a"),v.EPUB_A11Y_11_WCAG_21_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aa"),v.EPUB_A11Y_11_WCAG_21_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.1-aaa"),v.EPUB_A11Y_11_WCAG_22_A=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-a"),v.EPUB_A11Y_11_WCAG_22_AA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aa"),v.EPUB_A11Y_11_WCAG_22_AAA=new v("https://www.w3.org/TR/epub-a11y-11#wcag-2.2-aaa");let vt=v;class At{constructor(t=null,e=null,i=null){this.certifiedBy=t,this.credential=e,this.report=i}static deserialize(t){if(!(!t||typeof t!="object"))return new At(t.certifiedBy,t.credential,t.report)}serialize(){const t={};return this.certifiedBy&&(t.certifiedBy=this.certifiedBy),this.credential&&(t.credential=this.credential),this.report&&(t.report=this.report),t}}const w=class w{constructor(t){this.value=t}static deserialize(t){if(!(!t||typeof t!="string"))return new w(t)}serialize(){return this.value}};w.AUDITORY=new w("auditory"),w.CHART_ON_VISUAL=new w("chartOnVisual"),w.CHEM_ON_VISUAL=new w("chemOnVisual"),w.COLOR_DEPENDENT=new w("colorDependent"),w.DIAGRAM_ON_VISUAL=new w("diagramOnVisual"),w.MATH_ON_VISUAL=new w("mathOnVisual"),w.MUSIC_ON_VISUAL=new w("musicOnVisual"),w.TACTILE=new w("tactile"),w.TEXT_ON_VISUAL=new w("textOnVisual"),w.TEXTUAL=new w("textual"),w.VISUAL=new w("visual");let z=w;const R=class R{constructor(t){if(typeof t=="string"){if(!R.VALID_MODES.has(t.toLowerCase()))return;this.value=t.toLowerCase()}else{const e=t.filter(i=>R.VALID_MODES.has(i.toLowerCase()));if(e.length===0)return;this.value=Array.from(new Set(e))}}static deserialize(t){if(!t)return;if(typeof t=="string")return new R(t);if(!Array.isArray(t))return;const e=t.filter(i=>i?R.VALID_MODES.has(i.toLowerCase()):!1);if(e.length!==0)return new R(e)}serialize(){return this.value}};R.VALID_MODES=new Set(["auditory","tactile","textual","visual"]),R.AUDITORY=new R("auditory"),R.TACTILE=new R("tactile"),R.TEXTUAL=new R("textual"),R.VISUAL=new R("visual");let yt=R;const u=class u{constructor(t){this.value=t}static deserialize(t){if(!(!t||typeof t!="string"))return new u(t)}serialize(){return this.value}};u.NONE=new u("none"),u.ANNOTATIONS=new u("annotations"),u.ARIA=new u("ARIA"),u.INDEX=new u("index"),u.PAGE_BREAK_MARKERS=new u("pageBreakMarkers"),u.PAGE_NAVIGATION=new u("pageNavigation"),u.PRINT_PAGE_NUMBERS=new u("printPageNumbers"),u.READING_ORDER=new u("readingOrder"),u.STRUCTURAL_NAVIGATION=new u("structuralNavigation"),u.TABLE_OF_CONTENTS=new u("tableOfContents"),u.TAGGED_PDF=new u("taggedPDF"),u.ALTERNATIVE_TEXT=new u("alternativeText"),u.AUDIO_DESCRIPTION=new u("audioDescription"),u.CAPTIONS=new u("captions"),u.CLOSED_CAPTIONS=new u("closedCaptions"),u.DESCRIBED_MATH=new u("describedMath"),u.LONG_DESCRIPTION=new u("longDescription"),u.OPEN_CAPTIONS=new u("openCaptions"),u.SIGN_LANGUAGE=new u("signLanguage"),u.TRANSCRIPT=new u("transcript"),u.DISPLAY_TRANSFORMABILITY=new u("displayTransformability"),u.SYNCHRONIZED_AUDIO_TEXT=new u("synchronizedAudioText"),u.TIMING_CONTROL=new u("timingControl"),u.UNLOCKED=new u("unlocked"),u.CHEM_ML=new u("ChemML"),u.LATEX=new u("latex"),u.LATEX_CHEMISTRY=new u("latex-chemistry"),u.MATH_ML=new u("MathML"),u.MATH_ML_CHEMISTRY=new u("MathML-chemistry"),u.TTS_MARKUP=new u("ttsMarkup"),u.HIGH_CONTRAST_AUDIO=new u("highContrastAudio"),u.HIGH_CONTRAST_DISPLAY=new u("highContrastDisplay"),u.LARGE_PRINT=new u("largePrint"),u.BRAILLE=new u("braille"),u.TACTILE_GRAPHIC=new u("tactileGraphic"),u.TACTILE_OBJECT=new u("tactileObject"),u.FULL_RUBY_ANNOTATIONS=new u("fullRubyAnnotations"),u.HORIZONTAL_WRITING=new u("horizontalWriting"),u.RUBY_ANNOTATIONS=new u("rubyAnnotations"),u.VERTICAL_WRITING=new u("verticalWriting"),u.WITH_ADDITIONAL_WORD_SEGMENTATION=new u("withAdditionalWordSegmentation"),u.WITHOUT_ADDITIONAL_WORD_SEGMENTATION=new u("withoutAdditionalWordSegmentation");let A=u;const S=class S{constructor(t){this.value=t}static deserialize(t){if(!(!t||typeof t!="string"))return new S(t)}serialize(){return this.value}};S.FLASHING=new S("flashing"),S.NO_FLASHING_HAZARD=new S("noFlashingHazard"),S.UNKNOWN_FLASHING_HAZARD=new S("unknownFlashingHazard"),S.MOTION_SIMULATION=new S("motionSimulation"),S.NO_MOTION_SIMULATION_HAZARD=new S("noMotionSimulationHazard"),S.UNKNOWN_MOTION_SIMULATION_HAZARD=new S("unknownMotionSimulationHazard"),S.SOUND=new S("sound"),S.NO_SOUND_HAZARD=new S("noSoundHazard"),S.UNKNOWN_SOUND_HAZARD=new S("unknownSoundHazard"),S.UNKNOWN=new S("unknown"),S.NONE=new S("none");let P=S;const E=class E{constructor(t){this.value=t}static deserialize(t){if(!(!t||typeof t!="string"))return new E(t)}serialize(){return this.value}};E.NONE=new E("none"),E.DOCUMENTED=new E("documented"),E.LEGAL=new E("legal"),E.TEMPORARY=new E("temporary"),E.TECHNICAL=new E("technical"),E.EAA_DISPROPORTIONATE_BURDEN=new E("eaa-disproportionate-burden"),E.EAA_FUNDAMENTAL_ALTERATION=new E("eaa-fundamental-alteration"),E.EAA_MICROENTERPRISE=new E("eaa-microenterprise"),E.EAA_TECHNICAL_IMPOSSIBILITY=new E("eaa-technical-impossibility"),E.EAA_TEMPORARY=new E("eaa-temporary");let wt=E;const he={"ways-of-reading":{title:"Ways of reading","nonvisual-reading":{"alt-text":{compact:"Has alternative text",descriptive:"Has alternative text descriptions for images"},"no-metadata":"No information about nonvisual reading is available",none:{compact:"Not readable in read aloud or dynamic braille",descriptive:"The content is not readable as read aloud speech or dynamic braille"},"not-fully":{compact:"Not fully readable in read aloud or dynamic braille",descriptive:"Not all of the content will be readable as read aloud speech or dynamic braille"},readable:{compact:"Readable in read aloud or dynamic braille",descriptive:"All content can be read as read aloud speech or dynamic braille"}},"prerecorded-audio":{complementary:{compact:"Prerecorded audio clips",descriptive:"Prerecorded audio clips are embedded in the content"},"no-metadata":"No information about prerecorded audio is available",only:{compact:"Prerecorded audio only",descriptive:"Audiobook with no text alternative"},synchronized:{compact:"Prerecorded audio synchronized with text",descriptive:"All the content is available as prerecorded audio synchronized with text"}},"visual-adjustments":{modifiable:{compact:"Appearance can be modified",descriptive:"Appearance of the text and page layout can be modified according to the capabilities of the reading system (font family and font size, spaces between paragraphs, sentences, words, and letters, as well as color of background and text)"},unknown:"No information about appearance modifiability is available",unmodifiable:{compact:"Appearance cannot be modified",descriptive:"Text and page layout cannot be modified as the reading experience is close to a print version, but reading systems can still provide zooming options"}}},conformance:{title:"Conformance","details-title":"Detailed conformance information",a:{compact:"This publication meets minimum accessibility standards",descriptive:"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level A standard"},aa:{compact:"This publication meets accepted accessibility standards",descriptive:"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AA standard"},aaa:{compact:"This publication exceeds accepted accessibility standards",descriptive:"The publication contains a conformance statement that it meets the EPUB Accessibility and WCAG 2 Level AAA standard"},no:"No information is available","unknown-standard":"Conformance to accepted standards for accessibility of this publication cannot be determined",certifier:"The publication was certified by ","certifier-credentials":"The certifier's credential is ",details:{"certification-info":"The publication was certified on ","certifier-report":"For more information refer to the certifier's report",claim:"This publication claims to meet","epub-accessibility-1-0":"EPUB Accessibility 1.0","epub-accessibility-1-1":"EPUB Accessibility 1.1","level-a":"Level A","level-aa":"Level AA","level-aaa":"Level AAA","wcag-2-0":{compact:"WCAG 2.0",descriptive:"Web Content Accessibility Guidelines (WCAG) 2.0"},"wcag-2-1":{compact:"WCAG 2.1",descriptive:"Web Content Accessibility Guidelines (WCAG) 2.1"},"wcag-2-2":{compact:"WCAG 2.2",descriptive:"Web Content Accessibility Guidelines (WCAG) 2.2"}}},navigation:{title:"Navigation",index:{compact:"Index",descriptive:"Index with links to referenced entries"},"no-metadata":"No information is available","page-navigation":{compact:"Go to page",descriptive:"Page list to go to pages from the print source version"},structural:{compact:"Headings",descriptive:"Elements such as headings, tables, etc for structured navigation"},toc:{compact:"Table of contents",descriptive:"Table of contents to all chapters of the text via links"}},"rich-content":{title:"Rich content","accessible-chemistry-as-latex":{compact:"Chemical formulas in LaTeX",descriptive:"Chemical formulas in accessible format (LaTeX)"},"accessible-chemistry-as-mathml":{compact:"Chemical formulas in MathML",descriptive:"Chemical formulas in accessible format (MathML)"},"accessible-math-as-latex":{compact:"Math as LaTeX",descriptive:"Math formulas in accessible format (LaTeX)"},"math-as-mathml":{compact:"Math as MathML",descriptive:"Math formulas in accessible format (MathML)"},"accessible-math-described":"Text descriptions of math are provided","closed-captions":{compact:"Videos have closed captions",descriptive:"Videos included in publications have closed captions"},"extended-descriptions":"Information-rich images are described by extended descriptions","open-captions":{compact:"Videos have open captions",descriptive:"Videos included in publications have open captions"},transcript:"Transcript(s) provided",unknown:"No information is available"},hazards:{title:"Hazards",flashing:{compact:"Flashing content",descriptive:"The publication contains flashing content that can cause photosensitive seizures"},"flashing-none":{compact:"No flashing hazards",descriptive:"The publication does not contain flashing content that can cause photosensitive seizures"},"flashing-unknown":{compact:"Flashing hazards not known",descriptive:"The presence of flashing content that can cause photosensitive seizures could not be determined"},motion:{compact:"Motion simulation",descriptive:"The publication contains motion simulations that can cause motion sickness"},"motion-none":{compact:"No motion simulation hazards",descriptive:"The publication does not contain motion simulations that can cause motion sickness"},"motion-unknown":{compact:"Motion simulation hazards not known",descriptive:"The presence of motion simulations that can cause motion sickness could not be determined"},"no-metadata":"No information is available",none:{compact:"No hazards",descriptive:"The publication contains no hazards"},sound:{compact:"Sounds",descriptive:"The publication contains sounds that can cause sensitivity issues"},"sound-none":{compact:"No sound hazards",descriptive:"The publication does not contain sounds that can cause sensitivity issues"},"sound-unknown":{compact:"Sound hazards not known",descriptive:"The presence of sounds that can cause sensitivity issues could not be determined"},unknown:"The presence of hazards is unknown"},"accessibility-summary":{title:"Accessibility summary","no-metadata":"No information is available","publisher-contact":"For more information about the accessibility of this product, please contact the publisher: "},"legal-considerations":{title:"Legal considerations",exempt:{compact:"Claims an accessibility exemption in some jurisdictions",descriptive:"This publication claims an accessibility exemption in some jurisdictions"},"no-metadata":"No information is available"},"additional-accessibility-information":{title:"Additional accessibility information",aria:{compact:"ARIA roles included",descriptive:"Content is enhanced with ARIA roles to optimize organization and facilitate navigation"},"audio-descriptions":"Audio descriptions",braille:"Braille","color-not-sole-means-of-conveying-information":"Color is not the sole means of conveying information","dyslexia-readability":"Dyslexia readability","full-ruby-annotations":"Full ruby annotations","high-contrast-between-foreground-and-background-audio":"High contrast between foreground and background audio","high-contrast-between-text-and-background":"High contrast between foreground text and background","large-print":"Large print","page-breaks":{compact:"Page breaks included",descriptive:"Page breaks included from the original print source"},"ruby-annotations":"Some Ruby annotations","sign-language":"Sign language","tactile-graphics":{compact:"Tactile graphics included",descriptive:"Tactile graphics have been integrated to facilitate access to visual elements for blind people"},"tactile-objects":"Tactile 3D objects","text-to-speech-hinting":"Text-to-speech hinting provided","ultra-high-contrast-between-text-and-background":"Ultra high contrast between text and background","visible-page-numbering":"Visible page numbering","without-background-sounds":"Without background sounds"}},oi={"ways-of-reading":{title:"Lisibilité","nonvisual-reading":{"alt-text":{compact:"Images décrites",descriptive:"Les images sont décrites par un texte"},"no-metadata":"Aucune information pour la lecture en voix de synthèse ou en braille",none:{compact:"Non lisible en voix de synthèse ou en braille",descriptive:"Le contenu n'est pas lisible en voix de synthèse ou en braille"},"not-fully":{compact:"Pas entièrement lisible en voix de synthèse ou en braille",descriptive:"Tous les contenus ne pourront pas être lus à haute voix ou en braille"},readable:{compact:"Entièrement lisible en voix de synthèse ou en braille",descriptive:"Tous les contenus peuvent être lus en voix de synthèse ou en braille"}},"prerecorded-audio":{complementary:{compact:"Clips audio préenregistrés",descriptive:"Des clips audio préenregistrés sont intégrés au contenu"},"no-metadata":"Aucune information sur les enregistrements audio",only:{compact:"Audio préenregistré uniquement",descriptive:"Livre audio sans texte alternatif"},synchronized:{compact:"Audio préenregistré synchronisé avec du texte",descriptive:"Tous les contenus sont disponibles comme audio préenregistrés synchronisés avec le texte"}},"visual-adjustments":{modifiable:{compact:"L'affichage peut être adapté",descriptive:"L'apparence du texte et la mise en page peuvent être modifiées en fonction des capacités du système de lecture (famille et taille des polices, espaces entre les paragraphes, les phrases, les mots et les lettres, ainsi que la couleur de l'arrière-plan et du texte)"},unknown:"Aucune information sur les possibilités d'adaptation de l'affichage",unmodifiable:{compact:"L'affichage ne peut pas être adapté",descriptive:"Le texte et la mise en page ne peuvent pas être adaptés étant donné que l'expérience de lecture est proche de celle de la version imprimée, mais l'application de lecture peut tout de même proposer la capacité de zoomer"}}},conformance:{title:"Règles d'accessibilité","details-title":"Information détaillée",a:{compact:"Cette publication répond aux règles minimales d'accessibilité",descriptive:"La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau A"},aa:{compact:"Cette publication répond aux règles d'accessibilité reconnues",descriptive:"La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AA"},aaa:{compact:"Cette publication dépasse les règles d'accessibilité reconnues",descriptive:"La publication indique qu'elle respecte les règles d'accessibilité EPUB et WCAG 2 niveau AAA"},no:"Aucune information disponible","unknown-standard":"Aucune indication concernant les normes d'accessibilité",certifier:"Accessibilité évaluée par ","certifier-credentials":"L'évaluateur est accrédité par ",details:{"certification-info":"Cette publication a été certifié le","certifier-report":"Pour plus d'information, veuillez consulter le rapport de certification",claim:"Cette publication indique respecter","epub-accessibility-1-0":"EPUB Accessibilité 1.0","epub-accessibility-1-1":"EPUB Accessibilité 1.1","level-a":"Niveau A","level-aa":"Niveau AA","level-aaa":"Niveau AAA","wcag-2-0":{compact:"WCAG 2.0",descriptive:"Règles pour l’accessibilité des contenus Web (WCAG) 2.0"},"wcag-2-1":{compact:"WCAG 2.1",descriptive:"Règles pour l’accessibilité des contenus Web (WCAG) 2.1"},"wcag-2-2":{compact:"WCAG 2.2",descriptive:"Règles pour l’accessibilité des contenus Web (WCAG) 2.2"}}},navigation:{title:"Points de repère",index:{compact:"Index",descriptive:"Index comportant des liens vers les entrées référencées"},"no-metadata":"Aucune information disponible","page-navigation":{compact:"Aller à la page",descriptive:"Permet d'accéder aux pages de la version source imprimée"},structural:{compact:"Titres",descriptive:"Contient des titres pour une navigation structurée"},toc:{compact:"Table des matières",descriptive:"Table des matières"}},"rich-content":{title:"Contenus spécifiques","accessible-chemistry-as-latex":{compact:"Formules chimiques en LaTeX",descriptive:"Formules chimiques en format accessible (LaTeX)"},"accessible-chemistry-as-mathml":{compact:"Formules chimiques en MathML",descriptive:"Formules chimiques en format accessible (MathML)"},"accessible-math-as-latex":{compact:"Mathématiques en LaTeX",descriptive:"Formules mathématiques en format accessible (LaTeX)"},"math-as-mathml":{compact:"Mathématiques en MathML",descriptive:"Formules mathématiques en format accessible (MathML)"},"accessible-math-described":"Des descriptions textuelles des formules mathématiques sont fournies","closed-captions":{compact:"Sous-titres disponibles pour les vidéos",descriptive:"Des sous titres sont disponibles pour les vidéos"},"extended-descriptions":"Les images porteuses d'informations complexes sont décrites par des descriptions longues","open-captions":{compact:"Sous-titres incrustés",descriptive:"Des sous titres sont incrustés pour les vidéos"},transcript:"Transcriptions fournies",unknown:"Aucune information disponible"},hazards:{title:"Points d'attention",flashing:{compact:"Flashs lumineux",descriptive:"La publication contient des flashs lumineux qui peuvent provoquer des crises d’épilepsie"},"flashing-none":{compact:"Pas de flashs lumineux",descriptive:"La publication ne contient pas de flashs lumineux susceptibles de provoquer des crises d’épilepsie"},"flashing-unknown":{compact:"Pas d'information concernant la présence de flashs lumineux",descriptive:"La présence de flashs lumineux susceptibles de provoquer des crises d’épilepsie n'a pas pu être déterminée"},motion:{compact:"Sensations de mouvement",descriptive:"La publication contient des images en mouvement qui peuvent provoquer des nausées, des vertiges et des maux de tête"},"motion-none":{compact:"Pas de sensations de mouvement",descriptive:"La publication ne contient pas d'images en mouvement qui pourraient provoquer des nausées, des vertiges et des maux de tête"},"motion-unknown":{compact:"Pas d'information concernant la présence d'images en mouvement",descriptive:"La présence d'images en mouvement susceptibles de provoquer des nausées, des vertiges et des maux de tête n'a pas pu être déterminée"},"no-metadata":"Aucune information disponible",none:{compact:"Aucun points d'attention",descriptive:"La publication ne présente aucun risque lié à la présence de flashs lumineux, de sensations de mouvement ou de sons"},sound:{compact:"Sons",descriptive:"La publication contient des sons qui peuvent causer des troubles de la sensibilité"},"sound-none":{compact:"Pas de risques sonores",descriptive:"La publication ne contient pas de sons susceptibles de provoquer des troubles de la sensibilité"},"sound-unknown":{compact:"Pas d'information concernant la présence de sons",descriptive:"La présence de sons susceptibles de causer des troubles de sensibilité n'a pas pu être déterminée"},unknown:"La présence de risques est inconnue"},"accessibility-summary":{title:"Informations d'accessibilité supplémentaires fournies par l'éditeur","no-metadata":"Aucune information disponible","publisher-contact":"Pour plus d'information à propos de l'accessibilité de cette publication, veuillez contacter l'éditeur : "},"legal-considerations":{title:"Considérations légales",exempt:{compact:"Déclare être sous le coup d'une exemption dans certaines juridictions",descriptive:"Cette publication dééclare être sous le coup d'une exemption dans certaines juridictions"},"no-metadata":"Aucune information disponible"},"additional-accessibility-information":{title:"Informations complémentaires sur l'accessibilité",aria:{compact:"Information enrichie pour les technologies d'assistances",descriptive:"La structure est enrichi de rôles ARIA afin d'optimiser l'organisation et de faciliter la navigation via les technologies d'assistances"},"audio-descriptions":"Description audio",braille:"Braille","color-not-sole-means-of-conveying-information":"La couleur n'est pas la seule manière de communiquer de l'information","dyslexia-readability":"Lisibilité adapté aux publics dys","full-ruby-annotations":"Annotations complètes au format ruby (langues asiatiques)","high-contrast-between-foreground-and-background-audio":"Contraste sonore amélioré entre les différents plans","high-contrast-between-text-and-background":"Contraste élevé entre le texte et l'arrière-plan","large-print":"Grands caractères","page-breaks":{compact:"Pagination identique à l'imprimé",descriptive:"Contient une pagination identique à la version imprimée"},"ruby-annotations":"Annotations partielles au format ruby (langues asiatiques)","sign-language":"Langue des signes","tactile-graphics":{compact:"Graphiques tactiles",descriptive:"Des graphiques tactiles ont été intégrés pour faciliter l'accès des personnes aveugles aux éléments visuels"},"tactile-objects":"Objets 3D ou tactiles","text-to-speech-hinting":"Prononciation améliorée pour la synthèse vocale","ultra-high-contrast-between-text-and-background":"Contraste très élevé entre le texte et l'arrière-plan","visible-page-numbering":"Numérotation de page visible","without-background-sounds":"Aucun bruit de fond"}};class _{constructor(){this.currentLocaleCode="en",this.locale=he,this.availableLocales={en:he,fr:oi}}static getInstance(){return _.instance||(_.instance=new _),_.instance}registerLocale(t,e){if(!t||typeof t!="string")throw new Error("Locale code must be a non-empty string");this.availableLocales[t]=e}setLocale(t){return t in this.availableLocales?(this.locale=this.availableLocales[t],this.currentLocaleCode=t,!0):(console.warn(`Locale '${t}' is not available`),!1)}getCurrentLocale(){return this.currentLocaleCode}getAvailableLocales(){return Object.keys(this.availableLocales)}getNestedValue(t,e){const i=e.split(".");let n=t;for(const r of i){if(n==null)return;n=n[r]}return n}getString(t){let e=this.getNestedValue(this.locale,t);return e===void 0&&this.currentLocaleCode!=="en"&&(e=this.getNestedValue(this.availableLocales.en,t)),e!==void 0?typeof e=="string"?{compact:e,descriptive:e}:e:(console.warn(`Missing localization for key: ${t}`),{compact:"",descriptive:""})}}const f=_.getInstance();var q=(s=>(s.reflowable="reflowable",s.fixed="fixed",s.scrolled="scrolled",s))(q||{}),de=(s=>(s.Unknown="unknown",s.Modifiable="modifiable",s.Unmodifiable="unmodifiable",s))(de||{}),pe=(s=>(s.NoMetadata="noMetadata",s.Readable="readable",s.NotFully="notFully",s.Unreadable="unreadable",s))(pe||{}),fe=(s=>(s.NoMetadata="noMetadata",s.Synchronized="synchronized",s.AudioOnly="audioOnly",s.AudioComplementary="audioComplementary",s))(fe||{});class St{constructor(t="unknown",e="noMetadata",i=!1,n="noMetadata"){this.id="ways-of-reading.title",this.visualAdjustments=t,this.nonvisualReading=e,this.nonvisualReadingAltText=i,this.prerecordedAudio=n,this.shouldDisplay=!0;const r=f.getString(this.id);this.title=r.compact,this.statements=[];const a=t==="modifiable"?"ways-of-reading.visual-adjustments.modifiable":t==="unmodifiable"?"ways-of-reading.visual-adjustments.unmodifiable":"ways-of-reading.visual-adjustments.unknown",c=f.getString(a);this.statements.push({id:a,compactString:c.compact,descriptiveString:c.descriptive});let d="";e==="readable"?d="ways-of-reading.nonvisual-reading.readable":e==="notFully"?d="ways-of-reading.nonvisual-reading.not-fully":e==="unreadable"?d="ways-of-reading.nonvisual-reading.none":e==="noMetadata"&&(d="ways-of-reading.nonvisual-reading.no-metadata");const m=f.getString(d);if(this.statements.push({id:d,compactString:m.compact,descriptiveString:m.descriptive}),i){const b=f.getString("ways-of-reading.nonvisual-reading.alt-text");this.statements.push({id:"ways-of-reading.nonvisual-reading.alt-text",compactString:b.compact,descriptiveString:b.descriptive})}let g="";n==="synchronized"?g="ways-of-reading.prerecorded-audio.synchronized":n==="audioOnly"?g="ways-of-reading.prerecorded-audio.only":n==="audioComplementary"?g="ways-of-reading.prerecorded-audio.complementary":n==="noMetadata"&&(g="ways-of-reading.prerecorded-audio.no-metadata");const h=f.getString(g);this.statements.push({id:g,compactString:h.compact,descriptiveString:h.descriptive})}static fromPublication(t){const e=t.metadata.accessibility??new F,i=e.feature??[],n=t.metadata.layout===q.fixed,r=i.some(p=>p.value===A.DISPLAY_TRANSFORMABILITY.value)?"modifiable":n?"unmodifiable":"unknown",a=e.accessMode??[],c=e.accessModeSufficient??[],d=a.length>0&&a.every(p=>p.value===z.TEXTUAL.value)||c.some(p=>{const O=p.value;return Array.isArray(O)?O.every(H=>H===z.TEXTUAL.value):O===z.TEXTUAL.value}),m=a.some(p=>p.value===z.TEXTUAL.value)||c.some(p=>{const O=p.value;return Array.isArray(O)?O.some(H=>H===z.TEXTUAL.value):O===z.TEXTUAL.value}),g=!(a.length===0&&c.length===0)&&!a.some(p=>p.value===z.TEXTUAL.value)&&!c.some(p=>{const O=p.value;return Array.isArray(O)?O.some(H=>H===z.TEXTUAL.value):O===z.TEXTUAL.value}),h=i.some(p=>[A.LONG_DESCRIPTION.value,A.ALTERNATIVE_TEXT.value,A.DESCRIBED_MATH.value,A.TRANSCRIPT.value].includes(p.value)),b=d?"readable":m||h?"notFully":g?"unreadable":"noMetadata",y=h,U=i.some(p=>p.value===A.SYNCHRONIZED_AUDIO_TEXT.value)?"synchronized":c.some(p=>{const O=p.value;return Array.isArray(O)?O.some(H=>H===z.AUDITORY.value):O===z.AUDITORY.value})?"audioOnly":a.some(p=>p.value===z.AUDITORY.value)?"audioComplementary":"noMetadata";return new St(r,b,y,U)}}class Et{constructor(t=!1,e=!1,i=!1,n=!1){this.id="navigation.title",this.tableOfContents=t,this.index=e,this.headings=i,this.page=n,this.noMetadata=!t&&!e&&!i&&!n;const r=f.getString(this.id);if(this.title=r.compact,this.shouldDisplay=!this.noMetadata,this.statements=[],t){const a=f.getString("navigation.toc");this.statements.push({id:"navigation.toc",compactString:a.compact,descriptiveString:a.descriptive})}if(e){const a=f.getString("navigation.index");this.statements.push({id:"navigation.index",compactString:a.compact,descriptiveString:a.descriptive})}if(i){const a=f.getString("navigation.structural");this.statements.push({id:"navigation.structural",compactString:a.compact,descriptiveString:a.descriptive})}if(n){const a=f.getString("navigation.page-navigation");this.statements.push({id:"navigation.page-navigation",compactString:a.compact,descriptiveString:a.descriptive})}if(this.statements.length===0){const a=f.getString("navigation.no-metadata");this.statements.push({id:"navigation.no-metadata",compactString:a.compact,descriptiveString:a.descriptive})}}static fromPublication(t){const i=(t.metadata.accessibility??new F).feature??[];return new Et(i.some(n=>n.value===A.TABLE_OF_CONTENTS.value),i.some(n=>n.value===A.INDEX.value),i.some(n=>n.value===A.STRUCTURAL_NAVIGATION.value),i.some(n=>n.value===A.PAGE_NAVIGATION.value))}}var me=(s=>(s.Math="math",s.Chemistry="chemistry",s.Music="music",s.Diagram="diagram",s.Chart="chart",s.Graph="graph",s.Table="table",s.Image="image",s))(me||{});class Tt{constructor(t=!1,e=!1,i=!1,n=!1,r=!1,a=!1,c=!1,d=!1,m=!1){this.id="rich-content.title",this.extendedAltTextDescriptions=t,this.mathFormula=e,this.mathFormulaAsMathML=i,this.mathFormulaAsLaTeX=n,this.chemicalFormulaAsMathML=r,this.chemicalFormulaAsLaTeX=a,this.closedCaptions=c,this.openCaptions=d,this.transcript=m,this.noMetadata=!t&&!e&&!i&&!n&&!r&&!a&&!c&&!d&&!m,this.shouldDisplay=!this.noMetadata;const g=f.getString(this.id);if(this.title=g.compact,this.statements=[],t){const h=f.getString("rich-content.extended-descriptions");this.statements.push({id:"rich-content.extended-descriptions",compactString:h.compact,descriptiveString:h.descriptive})}if(e){const h=f.getString("rich-content.accessible-math-described");this.statements.push({id:"rich-content.accessible-math-described",compactString:h.compact,descriptiveString:h.descriptive})}if(i){const h=f.getString("rich-content.math-as-mathml");this.statements.push({id:"rich-content.math-as-mathml",compactString:h.compact,descriptiveString:h.descriptive})}if(n){const h=f.getString("rich-content.accessible-math-as-latex");this.statements.push({id:"rich-content.accessible-math-as-latex",compactString:h.compact,descriptiveString:h.descriptive})}if(r){const h=f.getString("rich-content.accessible-chemistry-as-mathml");this.statements.push({id:"rich-content.accessible-chemistry-as-mathml",compactString:h.compact,descriptiveString:h.descriptive})}if(a){const h=f.getString("rich-content.accessible-chemistry-as-latex");this.statements.push({id:"rich-content.accessible-chemistry-as-latex",compactString:h.compact,descriptiveString:h.descriptive})}if(c){const h=f.getString("rich-content.closed-captions");this.statements.push({id:"rich-content.closed-captions",compactString:h.compact,descriptiveString:h.descriptive})}if(d){const h=f.getString("rich-content.open-captions");this.statements.push({id:"rich-content.open-captions",compactString:h.compact,descriptiveString:h.descriptive})}if(m){const h=f.getString("rich-content.transcript");this.statements.push({id:"rich-content.transcript",compactString:h.compact,descriptiveString:h.descriptive})}if(this.statements.length===0){const h=f.getString("rich-content.unknown");this.statements.push({id:"rich-content.unknown",compactString:h.compact,descriptiveString:h.descriptive})}}static fromPublication(t){const i=(t.metadata.accessibility??new F).feature??[];return new Tt(i.some(n=>n.value===A.LONG_DESCRIPTION.value),i.some(n=>n.value===A.DESCRIBED_MATH.value),i.some(n=>n.value===A.MATH_ML.value),i.some(n=>n.value===A.LATEX.value),i.some(n=>n.value===A.MATH_ML_CHEMISTRY.value),i.some(n=>n.value===A.LATEX_CHEMISTRY.value),i.some(n=>n.value===A.CLOSED_CAPTIONS.value),i.some(n=>n.value===A.OPEN_CAPTIONS.value),i.some(n=>n.value===A.TRANSCRIPT.value))}}class It{constructor(t=!1,e=!1,i=!1,n=!1,r=!1,a=!1,c=!1,d=!1,m=!1,g=!1,h=!1,b=!1,y=!1){this.id="additional-accessibility-information.title",this.pageBreakMarkers=t,this.aria=e,this.audioDescriptions=i,this.braille=n,this.rubyAnnotations=r,this.fullRubyAnnotations=a,this.highAudioContrast=c,this.highDisplayContrast=d,this.largePrint=m,this.signLanguage=g,this.tactileGraphics=h,this.tactileObjects=b,this.textToSpeechHinting=y,this.noMetadata=!t&&!e&&!i&&!n&&!r&&!a&&!c&&!d&&!m&&!g&&!h&&!b&&!y,this.shouldDisplay=!this.noMetadata;const U=f.getString(this.id);if(this.title=U.compact,this.statements=[],t){const p=f.getString("additional-accessibility-information.page-breaks");this.statements.push({id:"additional-accessibility-information.page-breaks",compactString:p.compact,descriptiveString:p.descriptive})}if(e){const p=f.getString("additional-accessibility-information.aria");this.statements.push({id:"additional-accessibility-information.aria",compactString:p.compact,descriptiveString:p.descriptive})}if(i){const p=f.getString("additional-accessibility-information.audio-descriptions");this.statements.push({id:"additional-accessibility-information.audio-descriptions",compactString:p.compact,descriptiveString:p.descriptive})}if(n){const p=f.getString("additional-accessibility-information.braille");this.statements.push({id:"additional-accessibility-information.braille",compactString:p.compact,descriptiveString:p.descriptive})}if(r){const p=f.getString("additional-accessibility-information.ruby-annotations");this.statements.push({id:"additional-accessibility-information.ruby-annotations",compactString:p.compact,descriptiveString:p.descriptive})}if(a){const p=f.getString("additional-accessibility-information.full-ruby-annotations");this.statements.push({id:"additional-accessibility-information.full-ruby-annotations",compactString:p.compact,descriptiveString:p.descriptive})}if(c){const p=f.getString("additional-accessibility-information.high-contrast-between-foreground-and-background-audio");this.statements.push({id:"additional-accessibility-information.high-contrast-between-foreground-and-background-audio",compactString:p.compact,descriptiveString:p.descriptive})}if(d){const p=f.getString("additional-accessibility-information.high-contrast-between-text-and-background");this.statements.push({id:"additional-accessibility-information.high-contrast-between-text-and-background",compactString:p.compact,descriptiveString:p.descriptive})}if(m){const p=f.getString("additional-accessibility-information.large-print");this.statements.push({id:"additional-accessibility-information.large-print",compactString:p.compact,descriptiveString:p.descriptive})}if(g){const p=f.getString("additional-accessibility-information.sign-language");this.statements.push({id:"additional-accessibility-information.sign-language",compactString:p.compact,descriptiveString:p.descriptive})}if(h){const p=f.getString("additional-accessibility-information.tactile-graphics");this.statements.push({id:"additional-accessibility-information.tactile-graphics",compactString:p.compact,descriptiveString:p.descriptive})}if(b){const p=f.getString("additional-accessibility-information.tactile-objects");this.statements.push({id:"additional-accessibility-information.tactile-objects",compactString:p.compact,descriptiveString:p.descriptive})}if(y){const p=f.getString("additional-accessibility-information.text-to-speech-hinting");this.statements.push({id:"additional-accessibility-information.text-to-speech-hinting",compactString:p.compact,descriptiveString:p.descriptive})}}static fromPublication(t){const i=(t.metadata.accessibility??new F).feature??[];return new It(i.some(n=>n.value===A.PAGE_BREAK_MARKERS.value||n.value===A.PRINT_PAGE_NUMBERS.value),i.some(n=>n.value===A.ARIA.value),i.some(n=>n.value===A.AUDIO_DESCRIPTION.value),i.some(n=>n.value===A.BRAILLE.value),i.some(n=>n.value===A.RUBY_ANNOTATIONS.value),i.some(n=>n.value===A.FULL_RUBY_ANNOTATIONS.value),i.some(n=>n.value===A.HIGH_CONTRAST_AUDIO.value),i.some(n=>n.value===A.HIGH_CONTRAST_DISPLAY.value),i.some(n=>n.value===A.LARGE_PRINT.value),i.some(n=>n.value===A.SIGN_LANGUAGE.value),i.some(n=>n.value===A.TACTILE_GRAPHIC.value),i.some(n=>n.value===A.TACTILE_OBJECT.value),i.some(n=>n.value===A.TTS_MARKUP.value))}}var ge=(s=>(s.yes="yes",s.no="no",s.unknown="unknown",s.noMetadata="noMetadata",s))(ge||{});class Nt{constructor(t="unknown",e="unknown",i="unknown"){this.id="hazards.title",this.flashing=t,this.motion=e,this.sound=i;const n=f.getString(this.id);if(this.title=n.compact,this.noMetadata=t==="noMetadata"&&e==="noMetadata"&&i==="noMetadata",this.noHazards=t==="no"&&e==="no"&&i==="no",this.unknown=t==="unknown"&&e==="unknown"&&i==="unknown",this.shouldDisplay=!this.noMetadata,this.statements=[],this.noHazards){const r=f.getString("hazards.none");this.statements.push({id:"hazards.none",compactString:r.compact,descriptiveString:r.descriptive})}else if(this.unknown){const r=f.getString("hazards.unknown");this.statements.push({id:"hazards.unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(this.noMetadata){const r=f.getString("hazards.no-metadata");this.statements.push({id:"hazards.no-metadata",compactString:r.compact,descriptiveString:r.descriptive})}else{if(t==="yes"){const r=f.getString("hazards.flashing");this.statements.push({id:"hazards.flashing",compactString:r.compact,descriptiveString:r.descriptive})}else if(t==="unknown"){const r=f.getString("hazards.flashing-unknown");this.statements.push({id:"hazards.flashing-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(t==="no"){const r=f.getString("hazards.flashing-none");this.statements.push({id:"hazards.flashing-none",compactString:r.compact,descriptiveString:r.descriptive})}if(e==="yes"){const r=f.getString("hazards.motion");this.statements.push({id:"hazards.motion",compactString:r.compact,descriptiveString:r.descriptive})}else if(e==="unknown"){const r=f.getString("hazards.motion-unknown");this.statements.push({id:"hazards.motion-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(e==="no"){const r=f.getString("hazards.motion-none");this.statements.push({id:"hazards.motion-none",compactString:r.compact,descriptiveString:r.descriptive})}if(i==="yes"){const r=f.getString("hazards.sound");this.statements.push({id:"hazards.sound",compactString:r.compact,descriptiveString:r.descriptive})}else if(i==="unknown"){const r=f.getString("hazards.sound-unknown");this.statements.push({id:"hazards.sound-unknown",compactString:r.compact,descriptiveString:r.descriptive})}else if(i==="no"){const r=f.getString("hazards.sound-none");this.statements.push({id:"hazards.sound-none",compactString:r.compact,descriptiveString:r.descriptive})}}}static fromPublication(t){const e=t.metadata.accessibility?.hazard??[];let i;e.some(c=>c.value===P.NONE.value)?i="no":e.some(c=>c.value===P.UNKNOWN.value)?i="unknown":i="noMetadata";let n;e.some(c=>c.value===P.FLASHING.value)?n="yes":e.some(c=>c.value===P.NO_FLASHING_HAZARD.value)?n="no":e.some(c=>c.value===P.UNKNOWN_FLASHING_HAZARD.value)?n="unknown":n=i;let r;e.some(c=>c.value===P.MOTION_SIMULATION.value)?r="yes":e.some(c=>c.value===P.NO_MOTION_SIMULATION_HAZARD.value)?r="no":e.some(c=>c.value===P.UNKNOWN_MOTION_SIMULATION_HAZARD.value)?r="unknown":r=i;let a;return e.some(c=>c.value===P.SOUND.value)?a="yes":e.some(c=>c.value===P.NO_SOUND_HAZARD.value)?a="no":e.some(c=>c.value===P.UNKNOWN_SOUND_HAZARD.value)?a="unknown":a=i,new Nt(n,r,a)}}class Lt{constructor(t=[]){this.id="conformance.title",this.profiles=t,this.shouldDisplay=!0;const e=f.getString(this.id);if(this.title=e.compact,this.statements=[],t.length===0){const i=f.getString("conformance.no");this.statements.push({id:"conformance.no",compactString:i.compact,descriptiveString:i.descriptive});return}if(t.some(i=>i.isWCAGLevelAAA)){const i=f.getString("conformance.aaa");this.statements.push({id:"conformance.aaa",compactString:i.compact,descriptiveString:i.descriptive})}else if(t.some(i=>i.isWCAGLevelAA)){const i=f.getString("conformance.aa");this.statements.push({id:"conformance.aa",compactString:i.compact,descriptiveString:i.descriptive})}else if(t.some(i=>i.isWCAGLevelA)){const i=f.getString("conformance.a");this.statements.push({id:"conformance.a",compactString:i.compact,descriptiveString:i.descriptive})}else{const i=f.getString("conformance.unknown-standard");this.statements.push({id:"conformance.unknown-standard",compactString:i.compact,descriptiveString:i.descriptive})}}static fromPublication(t){const e=t.metadata.accessibility?.conformsTo??[];return new Lt(e)}}class xt{constructor(t=!1){this.id="legal-considerations.title",this.exemption=t,this.shouldDisplay=this.exemption;const e=f.getString(this.id);if(this.title=e.compact,this.statements=[],t){const i=f.getString("legal-considerations.exempt");this.statements.push({id:"legal-considerations.exempt",compactString:i.compact,descriptiveString:i.descriptive})}else{const i=f.getString("legal-considerations.no-metadata");this.statements.push({id:"legal-considerations.no-metadata",compactString:i.compact,descriptiveString:i.descriptive})}}static fromPublication(t){const i=(t.metadata.accessibility?.exemption??[]).length>0;return new xt(i)}}class Ot{constructor(t){this.id="accessibility-summary.title",this.shouldDisplay=!0;const e=f.getString(this.id);this.title=e.compact;const i=t.metadata.accessibility?.summary;if(this.statements=[],this.shouldDisplay&&i)this.statements.push({id:"accessibility-summary.summary",compactString:i,descriptiveString:i});else{const n=f.getString("accessibility-summary.no-metadata");this.statements.push({id:"accessibility-summary.no-metadata",compactString:n.compact,descriptiveString:n.descriptive})}}static fromPublication(t){return new Ot(t)}}class ci{constructor(t){this.waysOfReading=St.fromPublication(t),this.navigation=Et.fromPublication(t),this.richContent=Tt.fromPublication(t),this.additionalInformation=It.fromPublication(t),this.hazards=Nt.fromPublication(t),this.conformance=Lt.fromPublication(t),this.legal=xt.fromPublication(t),this.accessibilitySummary=Ot.fromPublication(t),this.fields=[this.waysOfReading,this.navigation,this.richContent,this.additionalInformation,this.hazards,this.conformance,this.legal,this.accessibilitySummary]}}class zt{constructor(t){this.algorithm=t.algorithm,this.compression=t.compression,this.originalLength=t.originalLength,this.profile=t.profile,this.scheme=t.scheme}static deserialize(t){if(t&&t.algorithm)return new zt({algorithm:t.algorithm,compression:t.compression,originalLength:t.originalLength,profile:t.profile,scheme:t.scheme})}serialize(){const t={algorithm:this.algorithm};return this.compression!==void 0&&(t.compression=this.compression),this.originalLength!==void 0&&(t.originalLength=this.originalLength),this.profile!==void 0&&(t.profile=this.profile),this.scheme!==void 0&&(t.scheme=this.scheme),t}}var Ct=(s=>(s.left="left",s.right="right",s.center="center",s))(Ct||{});class k{constructor(t){this.otherProperties=t}get page(){return this.otherProperties.page}static deserialize(t){if(t)return new k(t)}serialize(){return this.otherProperties}add(t){const e=Object.assign({},this.otherProperties);for(const i in t)e[i]=t[i];return new k(e)}}Object.defineProperty(k.prototype,"encryption",{get:function(){return zt.deserialize(this.otherProperties.encrypted)}});class Rt{constructor(t){this.activeClass=t.activeClass,this.playbackActiveClass=t.playbackActiveClass}static deserialize(t){if(t)return new Rt({activeClass:t.activeClass,playbackActiveClass:t.playbackActiveClass})}serialize(){const t={};return this.activeClass&&(t.activeClass=this.activeClass),this.playbackActiveClass&&(t.playbackActiveClass=this.playbackActiveClass),t}}function be(s){return s&&Array.isArray(s)?s:void 0}function V(s){return s&&typeof s=="string"?[s]:be(s)}function st(s){return typeof s=="string"?new Date(s):void 0}function X(s){return isNaN(s)?void 0:s}function N(s){return X(s)!==void 0&&Math.sign(s)>=0?s:void 0}function nt(s){const t=new Array;return s.forEach(e=>t.push(e)),t}class K{constructor(t){this.value=t.value,this.scheme=t.scheme}static deserialize(t){if(t){if(typeof t=="string")return new K({value:t});if(typeof t=="object"&&t.value)return new K({value:t.value,scheme:t.scheme})}}serialize(){return this.scheme?{value:this.value,scheme:this.scheme}:this.value}}class l{constructor(t){let e,i,n=t.mediaType.replace(/\s/g,"").split(";");const r=n[0].split("/");if(r.length===2){if(e=r[0].toLowerCase().trim(),i=r[1].toLowerCase().trim(),e.length===0||i.length===0)throw new Error("Invalid media type")}else throw new Error("Invalid media type");const a={};for(let b=1;b<n.length;b++){const y=n[b].split("=");if(y.length===2){const U=y[0].toLocaleLowerCase(),p=U==="charset"?y[1].toUpperCase():y[1];a[U]=p}}const c={},d=Object.keys(a);d.sort((b,y)=>b.localeCompare(y)),d.forEach(b=>c[b]=a[b]);let m="";for(const b in c){const y=c[b];m+=`;${b}=${y}`}const g=`${e}/${i}${m}`,h=c.encoding;this.string=g,this.type=e,this.subtype=i,this.parameters=c,this.encoding=h,this.name=t.name,this.fileExtension=t.fileExtension}static parse(t){return new l(t)}get structuredSyntaxSuffix(){const t=this.subtype.split("+");return t.length>1?`+${t[t.length-1]}`:void 0}get charset(){return this.parameters.charset}contains(t){const e=typeof t=="string"?l.parse({mediaType:t}):t;if(!((this.type==="*"||this.type===e.type)&&(this.subtype==="*"||this.subtype===e.subtype)))return!1;const i=new Set(Object.entries(this.parameters).map(([r,a])=>`${r}=${a}`)),n=new Set(Object.entries(e.parameters).map(([r,a])=>`${r}=${a}`));for(const r of Array.from(i.values()))if(!n.has(r))return!1;return!0}matches(t){const e=typeof t=="string"?l.parse({mediaType:t}):t;return this.contains(e)||e.contains(this)}matchesAny(...t){for(const e of t)if(this.matches(e))return!0;return!1}equals(t){return this.string===t.string}get isZIP(){return this.matchesAny(l.ZIP,l.LCP_PROTECTED_AUDIOBOOK,l.LCP_PROTECTED_PDF)|