<div class="vt" data-vt-cat="work-visas" data-vt-code="I"> <div class="vt-crumbs"><nav class="vt-wrap" aria-label="Breadcrumb"><a href="/">Home</a><span>›</span><a href="/work-visas">Work & business</a><span>›</span><span>I</span></nav></div> <section class="vt-dhead"><div class="vt-wrap"> <div class="vt-badges"><span>Nonimmigrant</span><span>Journalism</span><span>No petition</span><span>Reciprocity-based</span><span>Admitted for duration of employment</span></div> <h1><span>I</span> Representative of Foreign Media</h1> <p class="vt-lede">For journalists, film crews, editors and other representatives of foreign media organizations based abroad who come to the U.S. to gather and report news and other journalistic information.</p> <div class="vt-dmeta"><span>Last reviewed <strong>Oct 1, 2026</strong></span><span>Sources: Department of State · eCFR · U.S. District Court, D. Mass.</span><a href="/corrections?page=/visa/i">Report an error</a></div> </div></section> <section class="vt-dbody"> <nav class="vt-jump" aria-label="On this page"><a href="#overview">Overview</a><a href="#qualify">Who qualifies</a><a href="#duration">Duration</a><a href="#fees">Fees</a><a href="#processing">Processing</a><a href="#steps">Steps</a><a href="#documents">Documents</a><a href="#dependents">Dependents</a><a href="#greencard">Green card</a><a href="#related">Related</a><a href="#faq">FAQ</a><a href="#sources">Sources</a><a href="#changes">Changes</a></nav> <nav class="vt-toc" aria-label="On this page"><div class="h">On this page</div><ul><li><a href="#overview">Overview</a></li><li><a href="#qualify">Who qualifies</a></li><li><a href="#duration">Duration & extensions</a></li><li><a href="#fees">Fees</a></li><li><a href="#processing">Processing time</a></li><li><a href="#steps">Application steps</a></li><li><a href="#documents">Required documents</a></li><li><a href="#dependents">Dependents & family</a></li><li><a href="#greencard">Path to a green card</a></li><li><a href="#related">Related visas</a></li><li><a href="#faq">Common questions</a></li><li><a href="#sources">Official sources</a></li><li><a href="#changes">Recent changes</a></li></ul></nav> <article class="vt-art"> <div class="vt-glance"><h2>At a glance</h2><dl><div><dt>Who qualifies</dt><dd>Representatives of media organizations with a home office abroad</dd></div><div><dt>Admission</dt><dd>For the duration of employment (no fixed end date)</dd></div><div><dt>PRC passport holders</dt><dd>Until the assignment ends, up to the DHS maximum (1 year since 2022)</dd></div><div><dt>Petition</dt><dd>None; apply directly at a U.S. consulate</dd></div><div><dt>Visa fee</dt><dd>$185 + reciprocity fee where applicable</dd></div><div><dt>Dependents</dt><dd>Spouse and children; no work authorization</dd></div></dl></div> <div class="vt-callout"><strong>240-day rule postponed by court.</strong> A <a href="https://www.federalregister.gov/documents/2026/07/17/2026-14439/establishing-a-fixed-time-period-of-admission-and-an-extension-of-stay-procedure-for-nonimmigrant" target="_blank" rel="noopener">DHS final rule published July 17, 2026</a> would have replaced I admissions for the duration of employment with fixed periods of up to 240 days (90 days for PRC passport holders) starting September 15, 2026. On September 14, 2026, the U.S. District Court for the District of Massachusetts postponed the rule nationwide under 5 U.S.C. § 705 “pending final resolution of this matter on the merits” (<a href="https://www.govinfo.gov/app/details/USCOURTS-mad-1_26-cv-13799" target="_blank" rel="noopener">Presidents’ Alliance on Higher Education and Immigration v. DHS, No. 1:26-cv-13799</a>). The pre-rule regulations therefore still govern. The live eCFR already shows the postponed text, so this page cites the <a href="https://www.ecfr.gov/on/2026-09-01/title-8/section-214.2" target="_blank" rel="noopener">September 1, 2026 version</a>.</div> <h2 id="overview" class="s">Overview</h2> <p class="b">The I classification is for bona fide representatives of foreign press, radio, film, print and other information media who come to the U.S. to work in their profession. The organization they represent must regularly gather, produce or distribute journalistic information and have its home office outside the U.S. (<a href="https://fam.state.gov/fam/09FAM/09FAM040211.html" target="_blank" rel="noopener">9 FAM 402.11</a>). Reporters, producers, presenters, film crews, editors and similar staff qualify. Freelancers under contract to a qualifying foreign outlet, some bloggers who represent news organizations, and employees of foreign government tourist bureaus can also qualify.</p> <p class="b">Journalistic information means content that is mainly informational, such as news, investigative reporting or documentaries. Entertainment and scripted productions, most reality television, promotional or marketing material and personal travel content do not qualify; that work may require an O or P visa instead. Media workers cannot do qualifying work on the Visa Waiver Program or a B visa (<a href="https://travel.state.gov/content/travel/en/us-visas/employment/visas-members-foreign-media-press-radio.html" target="_blank" rel="noopener">State Department</a>).</p> <p class="b">No petition is filed. Applicants apply for an I visa at a U.S. consulate, and visa validity depends on reciprocity with their country. Under the regulations in force (<a href="https://www.ecfr.gov/on/2026-09-01/title-8/section-214.2" target="_blank" rel="noopener">8 CFR 214.2(i)</a>), I nonimmigrants are admitted for the duration of their employment, except holders of People’s Republic of China passports (other than Hong Kong and Macau passports), who are admitted only until their assignment ends, up to a maximum period set by DHS. Changing employer or information medium requires DHS permission first.</p> <h2 id="qualify" class="s">Who qualifies</h2> <h3 class="s">The applicant must</h3> <ul class="b"><li>Represent a foreign information media organization, as an employee or under contract, that regularly gathers, produces or distributes journalistic information</li><li>Show that the organization has a home office abroad that will keep operating while the applicant is in the U.S.</li><li>Provide a letter from the media organization (or, for freelancers, a valid contract for services) confirming the employment and the work</li><li>Come solely to do qualifying media work</li></ul> <h3 class="s">Generally not covered</h3> <ul class="b"><li>Entertainment, scripted or “reality” productions</li><li>Promotional, advertising or marketing content</li><li>Support roles not directly involved in journalism, such as proofreaders</li><li>Personal blogs about one’s own travel</li></ul> <h2 id="duration" class="s">Duration & extensions</h2> <table class="vt-kv"><tbody><tr><th scope="row">Admission (most applicants)</th><td>For the duration of employment (<a href="https://www.ecfr.gov/on/2026-09-01/title-8/section-214.2" target="_blank" rel="noopener">8 CFR 214.2(i)(1)(i)</a>)</td></tr><tr><th scope="row">PRC passport holders</th><td>Until the assignment is completed, up to the maximum period DHS sets, which cannot exceed 1 year; DHS set it at 1 year in <a href="https://www.federalregister.gov/documents/2022/10/13/2022-21898/period-of-admission-and-extensions-of-stay-for-representatives-of-foreign-information-media-seeking" target="_blank" rel="noopener">October 2022</a></td></tr><tr><th scope="row">Extensions (PRC passport holders)</th><td>Each up to the DHS maximum or until the assignment ends, whichever is earlier, through USCIS</td></tr><tr><th scope="row">Work while a PRC extension is pending</th><td>Up to 90 days with the same employer after status expires, if timely filed</td></tr><tr><th scope="row">Postponed 240-day rule</th><td>Fixed periods from the July 17, 2026 final rule are not in effect while the court’s September 14, 2026 postponement remains</td></tr></tbody></table> <h2 id="fees" class="s">Fees</h2> <p class="vt-feesintro">I visas are applied for directly at a consulate. USCIS fees apply only for extensions or changes in the U.S. USCIS amounts are from the <a href="https://www.uscis.gov/g-1055" target="_blank" rel="noopener">USCIS fee schedule (G-1055, edition 10/01/26)</a>.</p> <div class="vt-scroll"><table class="vt-fees"><thead><tr><th>Fee</th><th class="amt">Amount</th><th>Who pays</th><th>Notes</th></tr></thead><tbody> <tr><td>Visa application fee (I)</td><td class="amt"><a href="https://www.ecfr.gov/current/title-22/chapter-I/subchapter-C/part-22/section-22.1" target="_blank" rel="noopener">$185</a></td><td>Applicant</td><td>Non-petition-based category; charged per applicant, including dependents.</td></tr> <tr><td>Visa issuance (reciprocity) fee</td><td class="amt">Varies by nationality</td><td>Applicant</td><td>I visas are issued only on a reciprocal basis (<a href="https://fam.state.gov/fam/09FAM/09FAM040211.html" target="_blank" rel="noopener">9 FAM 402.11-7</a>).</td></tr> <tr><td>Extension or change of status (Form I-539)</td><td class="amt"><a href="https://www.uscis.gov/g-1055" target="_blank" rel="noopener">$470 paper / $420 online</a></td><td>Applicant</td><td>Filed on the form USCIS designates; biometrics may be required.</td></tr> </tbody></table></div> <p class="vt-foot">Public Law 119-21 (signed July 4, 2025), section 100007, requires a <a href="https://www.govinfo.gov/content/pkg/PLAW-119publ21/html/PLAW-119publ21.htm" target="_blank" rel="noopener">Visa Integrity Fee</a> of at least $250 when a nonimmigrant visa is issued. As of October 1, 2026, the State Department’s fee schedule (<a href="https://www.ecfr.gov/current/title-22/chapter-I/subchapter-C/part-22/section-22.1" target="_blank" rel="noopener">22 CFR 22.1</a>) lists no Visa Integrity Fee and no implementing notice has been published in the Federal Register, so the amount actually collected at visa issuance should be confirmed with the consulate.</p> <h2 id="processing" class="s">Processing time</h2> <dl class="vt-cards"><div><dt>Admission period</dt><dd>Duration of employment</dd><dd class="n">240-day limit <a href="https://www.govinfo.gov/app/details/USCOURTS-mad-1_26-cv-13799" target="_blank" rel="noopener">postponed by court order</a> on September 14, 2026.</dd></div></dl> <p class="b">Consular appointment wait times vary by post. USCIS processing times for extensions and changes of status vary; check <a href="https://egov.uscis.gov/processing-times/" target="_blank" rel="noopener">USCIS processing times</a>.</p> <h2 id="steps" class="s">Application steps</h2> <ol class="vt-steps"><li><span class="num">1</span><div><div class="tt">Confirm the work is journalistic</div><div class="tx">Check that the assignment is news-gathering or informational content for a media organization with a home office abroad.</div></div></li><li><span class="num">2</span><div><div class="tt">Get the employer letter or contract</div><div class="tx">Obtain a letter from the media organization, or a contract for freelancers, describing the assignment and the work.</div></div></li><li><span class="num">3</span><div><div class="tt">Apply for the visa</div><div class="tx">Complete Form DS-160, pay the $185 fee and attend the consular interview. Bring press credentials and the employer letter. Since October 1, 2026, applicants are told to set all social media profiles to public for the State Department’s <a href="https://travel.state.gov/content/travel/en/News/visas-news/announcement-of-expanded-screening-and-vetting-for-visa-applicants.html" target="_blank" rel="noopener">online presence review</a>.</div></div></li><li><span class="num">4</span><div><div class="tt">Enter the U.S.</div><div class="tx">CBP admits I nonimmigrants for the duration of employment. PRC passport holders are admitted until the assignment ends, up to the DHS maximum.</div></div></li><li><span class="num">5</span><div><div class="tt">Get permission before changes</div><div class="tx">Ask DHS before changing employer or information medium. PRC passport holders who need more time file an extension with USCIS before status expires.</div></div></li></ol> <h2 id="documents" class="s">Required documents</h2> <div class="vt-docs"><div><h3>Typical documents</h3><ul><li><span>Passport valid at least 6 months beyond the intended stay; DS-160 confirmation; fee receipt</span></li><li><span>Letter from the foreign media employer, or a freelance contract</span></li><li><span>Press credentials and evidence that the organization has a home office abroad</span></li></ul></div></div> <h2 id="dependents" class="s">Dependents & family</h2> <p class="b">The spouse and children accompanying or following to join a qualified I applicant may also receive I visas (<a href="https://fam.state.gov/fam/09FAM/09FAM040211.html" target="_blank" rel="noopener">9 FAM 402.11-8</a>).</p> <p class="b">Under <a href="https://www.ecfr.gov/on/2026-09-01/title-8/chapter-I/subchapter-B/part-274a/subpart-B/section-274a.12" target="_blank" rel="noopener">8 CFR 274a.12(b)(10)</a>, an I nonimmigrant may work only for the sponsoring foreign news agency or bureau, and employment authorization does not extend to dependents.</p> <h2 id="greencard" class="s">Path to a green card</h2> <p class="b">The I classification has no path to permanent residence of its own. No foreign residence is required, but the applicant must show they will engage only in permitted I activities (<a href="https://fam.state.gov/fam/09FAM/09FAM040211.html" target="_blank" rel="noopener">9 FAM 402.11-5</a>).</p> <div class="vt-gsteps"><div><div class="k">Step 1</div><div class="tt">Separate immigrant route</div><div class="tx">A green card would need a separate family-based or employment-based petition (for example EB-1 or EB-2).</div></div></div> <h2 id="related" class="s">Related visas</h2> <div class="vt-rel"><a href="/visa/o-1b"><div class="c">O-1B</div><div class="n">Extraordinary ability in arts/film</div><div class="tx">For entertainment productions outside the I definition.</div></a><a href="/visa/p-1b"><div class="c">P-1B</div><div class="n">Entertainment group</div><div class="tx">For performing groups, not news media.</div></a><a href="/visa/b-1"><div class="c">B-1</div><div class="n">Business visitor</div><div class="tx">Not usable for media work; covers meetings only.</div></a><a href="/visa/h-1b"><div class="c">H-1B</div><div class="n">Specialty occupation</div><div class="tx">For media work for a U.S.-based employer.</div></a><a href="/visa/e-2"><div class="c">E-2</div><div class="n">Treaty investor</div><div class="tx">Media representatives are classified as I even if they also qualify for E.</div></a></div> <h2 id="faq" class="s">Common questions</h2> <div class="vt-faq"><details><summary>How long can a journalist stay on an I visa?</summary><p>Under the regulations in force, I nonimmigrants are admitted for the duration of their employment. Holders of PRC passports (other than Hong Kong and Macau) are admitted until the assignment ends, up to a DHS-set maximum of 1 year.</p></details><details><summary>Is the 240-day limit in effect?</summary><p>No. The DHS final rule that would have set 240-day admissions from September 15, 2026 was postponed nationwide by a federal court on September 14, 2026, pending a final decision in the case.</p></details><details><summary>Can a freelancer get an I visa?</summary><p>Yes, if under contract to a foreign media organization with a home office abroad that regularly distributes journalistic information. A valid contract for services is required.</p></details><details><summary>Can journalists use ESTA or a B visa?</summary><p>Not to work as media in the U.S. Qualifying media work requires an I visa.</p></details><details><summary>Can I-visa dependents work?</summary><p>No. Employment authorization in I status does not extend to the spouse or children.</p></details></div> <h2 id="sources" class="s">Official sources</h2> <ul class="vt-src"><li><a href="https://travel.state.gov/content/travel/en/us-visas/employment/visas-members-foreign-media-press-radio.html" target="_blank" rel="noopener"><span><strong>Department of State</strong> · Visas for Members of the Foreign Media, Press, and Radio</span><span>travel.state.gov ↗</span></a></li><li><a href="https://fam.state.gov/fam/09FAM/09FAM040211.html" target="_blank" rel="noopener"><span><strong>Department of State</strong> · 9 FAM 402.11 — Information Media Representatives (I visas)</span><span>state.gov ↗</span></a></li><li><a href="https://www.ecfr.gov/on/2026-09-01/title-8/section-214.2" target="_blank" rel="noopener"><span><strong>eCFR</strong> · 8 CFR 214.2(i) as of Sept. 1, 2026 (pre-rule text in force)</span><span>ecfr.gov ↗</span></a></li><li><a href="https://www.govinfo.gov/app/details/USCOURTS-mad-1_26-cv-13799" target="_blank" rel="noopener"><span><strong>U.S. District Court, D. Mass.</strong> · Presidents’ Alliance on Higher Education and Immigration v. DHS, No. 1:26-cv-13799 (Sept. 14, 2026)</span><span>govinfo.gov ↗</span></a></li><li><a href="https://www.federalregister.gov/documents/2026/07/17/2026-14439/establishing-a-fixed-time-period-of-admission-and-an-extension-of-stay-procedure-for-nonimmigrant" target="_blank" rel="noopener"><span><strong>Federal Register</strong> · Fixed Time Period of Admission for F, J and I Nonimmigrants (final rule, July 17, 2026)</span><span>federalregister.gov ↗</span></a></li><li><a href="https://www.federalregister.gov/documents/2022/10/13/2022-21898/period-of-admission-and-extensions-of-stay-for-representatives-of-foreign-information-media-seeking" target="_blank" rel="noopener"><span><strong>Federal Register</strong> · Period of Admission and Extensions of Stay for Representatives of Foreign Information Media (Oct. 13, 2022)</span><span>federalregister.gov ↗</span></a></li><li><a href="https://www.uscis.gov/g-1055" target="_blank" rel="noopener"><span><strong>USCIS</strong> · Fee Schedule (G-1055)</span><span>uscis.gov ↗</span></a></li><li><a href="https://www.ecfr.gov/current/title-22/chapter-I/subchapter-C/part-22/section-22.1" target="_blank" rel="noopener"><span><strong>eCFR</strong> · 22 CFR 22.1 — Consular fee schedule</span><span>ecfr.gov ↗</span></a></li></ul> <h2 id="changes" class="s">Recent changes</h2> <ul class="vt-chg"><li><span class="d">Oct 1, 2026</span><div class="x"><strong>Online presence review extended to I applicants.</strong> From October 1, 2026, consular officers review the online presence of I (foreign media), TN and TD visa applicants, who are instructed to set the privacy settings on all social media profiles to public. <a href="https://travel.state.gov/content/travel/en/News/visas-news/announcement-of-expanded-screening-and-vetting-for-visa-applicants.html" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Sep 14, 2026</span><div class="x"><strong>Fixed-admission rule postponed nationwide.</strong> In Presidents’ Alliance on Higher Education and Immigration v. DHS, No. 1:26-cv-13799, the court postponed the effective date of the July 17, 2026 final rule under 5 U.S.C. § 705, pending final resolution on the merits. The order covers F, J and I nonimmigrants, so I admissions remain for the duration of employment. <a href="https://www.govinfo.gov/app/details/USCOURTS-mad-1_26-cv-13799" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Aug 24, 2026</span><div class="x"><strong>Court enjoins USCIS hold memos.</strong> In Red Eagle Law v. Edlow (N.D. Cal.), the court enjoined PM-602-0192 and PM-602-0194 and ordered USCIS to adjudicate applications in the normal course. USCIS said it will comply pending possible further review. <a href="https://www.uscis.gov/newsroom/alerts/recent-court-order-on-hold-policies" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Jul 17, 2026</span><div class="x"><strong>Final rule to replace duration of status with fixed admission periods (postponed).</strong> The final rule (91 FR 44976) was scheduled to take effect September 15, 2026. It would limit each I admission and extension to 240 days (90 days for PRC passport holders other than Hong Kong and Macau). It was postponed by court order on September 14, 2026 and has not taken effect. <a href="https://www.federalregister.gov/documents/2026/07/17/2026-14439/establishing-a-fixed-time-period-of-admission-and-an-extension-of-stay-procedure-for-nonimmigrant" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Jun 5, 2026</span><div class="x"><strong>Court vacates USCIS hold memos.</strong> In Dorcas v. USCIS (D.R.I.), the court vacated PM-602-0192, PM-602-0194 and PA-2025-26, with final judgment on June 11, 2026. <a href="https://www.uscis.gov/newsroom/alerts/court-order-on-hold-policies" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Jan 1, 2026</span><div class="x"><strong>Proclamation 10998 expands entry restrictions.</strong> Signed December 16, 2025 and effective January 1, 2026, it continues the June 2025 restrictions and adds more countries. Nationals of fully restricted countries are barred from entry on any visa unless an exception applies; for partially restricted countries, consular officers are told to shorten the validity of nonimmigrant visas other than B, F, M and J. <a href="https://www.federalregister.gov/documents/2025/12/19/2025-23570/restricting-and-limiting-the-entry-of-foreign-nationals-to-protect-the-security-of-the-united-states" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Jan 1, 2026</span><div class="x"><strong>USCIS hold on benefit requests expanded (PM-602-0194).</strong> Extends the December 2, 2025 hold (PM-602-0192) on final decisions for pending benefit requests, including extensions and changes of status, filed by nationals of countries named in the travel-restriction proclamations. The memo says the hold stays in place until the USCIS Director lifts or changes it. A federal court vacated this memo on June 5, 2026 (Dorcas v. USCIS, D.R.I.), and another court enjoined it on August 24, 2026 (Red Eagle Law v. Edlow, N.D. Cal.); USCIS says it is following both orders. <a href="https://www.uscis.gov/laws-and-policy/policy-memoranda" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Oct 1, 2025</span><div class="x"><strong>Narrower visa interview waivers.</strong> Since October 1, 2025, nearly all nonimmigrant visa applicants need an in-person interview. The exceptions are mainly diplomatic and official visa classes and certain B-1/B-2 and H-2A renewals. Consular officers can still require an interview in any case. <a href="https://travel.state.gov/content/travel/en/News/visas-news/interview-waiver-update-sept-18-2025.html" target="_blank" rel="noopener">Source ↗</a></div></li><li><span class="d">Jul 4, 2025</span><div class="x"><strong>Visa Integrity Fee enacted.</strong> Public Law 119-21 created a non-waivable Visa Integrity Fee of at least $250, due when a nonimmigrant visa is issued. As of October 1, 2026, the State Department’s fee schedule does not list it. <a href="https://www.govinfo.gov/content/pkg/PLAW-119publ21/html/PLAW-119publ21.htm" target="_blank" rel="noopener">Source ↗</a></div></li></ul> <div class="vt-disc">This page is general reference material compiled from the official sources above and is not legal advice. Eligibility depends on individual facts; rules and fees change, so confirm with the agency before you file. VisaTypes.com is not affiliated with USCIS, the Department of State or any government agency. Spotted an error? <a href="/corrections?page=/visa/i">Tell us</a>.</div> </article></section></div> <script type="application/ld+json">[{"\u0040context": "https://schema.org", "\u0040type": "BreadcrumbList", "itemListElement": [{"\u0040type": "ListItem", "position": 1, "name": "Home", "item": "https://visatypes.com/"}, {"\u0040type": "ListItem", "position": 2, "name": "Work & business", "item": "https://visatypes.com/work-visas"}, {"\u0040type": "ListItem", "position": 3, "name": "I", "item": "https://visatypes.com/visa/i"}]}, {"\u0040context": "https://schema.org", "\u0040type": "FAQPage", "mainEntity": [{"\u0040type": "Question", "name": "How long can a journalist stay on an I visa?", "acceptedAnswer": {"\u0040type": "Answer", "text": "Under the regulations in force, I nonimmigrants are admitted for the duration of their employment. Holders of PRC passports (other than Hong Kong and Macau) are admitted until the assignment ends, up to a DHS-set maximum of 1 year."}}, {"\u0040type": "Question", "name": "Is the 240-day limit in effect?", "acceptedAnswer": {"\u0040type": "Answer", "text": "No. The DHS final rule that would have set 240-day admissions from September 15, 2026 was postponed nationwide by a federal court on September 14, 2026, pending a final decision in the case."}}, {"\u0040type": "Question", "name": "Can a freelancer get an I visa?", "acceptedAnswer": {"\u0040type": "Answer", "text": "Yes, if under contract to a foreign media organization with a home office abroad that regularly distributes journalistic information. A valid contract for services is required."}}, {"\u0040type": "Question", "name": "Can journalists use ESTA or a B visa?", "acceptedAnswer": {"\u0040type": "Answer", "text": "Not to work as media in the U.S. Qualifying media work requires an I visa."}}, {"\u0040type": "Question", "name": "Can I-visa dependents work?", "acceptedAnswer": {"\u0040type": "Answer", "text": "No. Employment authorization in I status does not extend to the spouse or children."}}]}]</script> <script>(function(){var l=[].slice.call(document.querySelectorAll('.vt-toc a'));if(!l.length||!window.IntersectionObserver)return;var m={};l.forEach(function(a){m[a.getAttribute('href').slice(1)]=a});var cur=null;function on(id){if(cur)cur.classList.remove('on');cur=m[id];if(cur)cur.classList.add('on')}on(l[0].getAttribute('href').slice(1));var io=new IntersectionObserver(function(es){es.forEach(function(x){if(x.isIntersecting)on(x.target.id)})},{rootMargin:'0px 0px -70% 0px'});Object.keys(m).forEach(function(id){var el=document.getElementById(id);el&&io.observe(el)})})();</script>