PageSourceSearch

https://my-id.ca/_next/static/chunks/app/help/(docs)/ontario-form-guides/page-cbac1268f8bf58fe.js

js my-id.ca collected 2026-10-09 04:49:52 UTC 3,940 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2528,7173],{22907:(e,t,n)=>{Promise.resolve().then(n.bind(n,70028)),Promise.resolve().then(n.t.bind(n,549,23))},70028:(e,t,n)=>{"use strict";n.d(t,{OntarioGuideSearch:()=>d});var s=n(901),o=n(26209),c=n(549),r=n.n(c);function i(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"")}var a=n(76835),l=n(61766);function d(e){let{ministrySlug:t}=e;(0,l.Bd)();let[n,c]=(0,o.useState)(""),[d,u]=(0,o.useState)(null!=t?t:""),[h,g]=(0,o.useState)(null),[f,m]=(0,o.useState)("idle"),p=(0,o.useRef)(!1),_=(0,o.useCallback)(async()=>{if(!p.current){p.current=!0,m("loading");try{let e=await fetch("/help/ontario-form-guides/search-index.json");if(!e.ok)throw Error("HTTP ".concat(e.status));g(await e.json()),m("idle")}catch(e){p.current=!1,m("error")}}},[]);(0,o.useEffect)(()=>{n&&_()},[n,_]);let x=(0,o.useMemo)(()=>h?function(e,t,n){let s=t.trim();if(s.length<2)return[];let o=s.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);if(0===o.length)return[];let c=i(s),r=-1;if(n&&-1===(r=e.ministries.findIndex(e=>e.slug===n)))return[];let a=[];for(let t of e.guides){if(-1!==r&&t.m!==r)continue;let n=function(e,t,n,s){let o=e.toLowerCase(),c=i(t),r=i(e),a=0;for(let e of(s&&c.includes(s)&&(a+=50),s&&r.includes(s)&&(a+=30),n)){let t=o.indexOf(e),n=c.includes(e);if(-1===t&&!n)return 0;-1!==t&&(a+=0===t?12:8-Math.min(t/20,6)),n&&(a+=4)}return a}(t.t,t.s,o,c);if(n<=0)continue;let s=e.ministries[t.m];s&&a.push({href:"".concat("/help/ontario-form-guides","/").concat(s.slug,"/").concat(t.s),title:t.t,ministry:s.name,score:n})}return a.sort((e,t)=>t.score-e.score||e.title.localeCompare(t.title)),a.slice(0,40)}(h,n,d||void 0):[],[h,n,d]),j=n.trim().length>=2&&null!==h&&0===x.length,v=null==h?void 0:h.guides.length;return(0,s.jsxs)("div",{className:"docs-guide-search",children:[(0,s.jsxs)("div",{className:"docs-guide-search-row",children:[(0,s.jsxs)("label",{className:"docs-guide-search-field",children:[(0,s.jsx)("span",{className:"docs-guide-search-label",children:a.A.t("frontend.hardcoded.components_docs_ontarioguidesearch.1e803141")}),(0,s.jsx)("input",{type:"search",value:n,onFocus:()=>void _(),onChange:e=>c(e.target.value),placeholder:a.A.t("frontend.hardcoded.components_docs_ontarioguidesearch.c1458966"),className:"docs-guide-search-input",autoComplete:"off","aria-describedby":"docs-guide-search-status"})]}),!t&&h?(0,s.jsxs)("label",{className:"docs-guide-search-field docs-guide-search-field-narrow",children:[(0,s.jsx)("span",{className:"docs-guide-search-label",children:a.A.t("frontend.hardcoded.components_docs_ontarioguidesearch.9e4d9a77")}),(0,s.jsxs)("select",{value:d,onChange:e=>u(e.target.value),className:"docs-guide-search-input",children:[(0,s.jsx)("option",{value:"",children:a.A.t("frontend.hardcoded.components_docs_ontarioguidesearch.c01e19cb")}),h.ministries.map(e=>(0,s.jsx)("option",{value:e.slug,children:e.name},e.slug))]})]}):null]}),(0,s.jsx)("p",{className:"docs-guide-search-status",id:"docs-guide-search-status",role:"status",children:"loading"===f?a.A.t("frontend.content.conditional.components_docs_ontarioguidesearch.7f40395483"):"error"===f?a.A.t("frontend.content.conditional.components_docs_ontarioguidesearch.75105fe39c"):x.length>0?a.A.t(1===x.length?"frontend.content.docs.ontario.matching_guides_one":"frontend.content.docs.ontario.matching_guides",{count:x.length}):j?a.A.t("frontend.content.conditional.components_docs_ontarioguidesearch.3ea9700543"):v?a.A.t("frontend.content.docs.ontario.indexed_guides",{count:v.toLocaleString(a.A.language||"en-CA")}):""}),x.length>0?(0,s.jsx)("ul",{className:"docs-article-list docs-article-list-standalone docs-guide-search-results",children:x.map(e=>(0,s.jsxs)("li",{children:[(0,s.jsx)(r(),{href:e.href,children:e.title}),(0,s.jsx)("span",{className:"docs-article-desc",children:e.ministry})]},e.href))}):null]})}}},e=>{e.O(0,[2224,1766,549,6835,6606,1515,7358],()=>e(e.s=22907)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.