PageSourceSearch

https://a.karkkilalainen.fi/styles/e5576057/includes/hyphenopoly/Hyphenopoly_Loader.js

js karkkilalainen.fi collected 2026-09-24 11:35:53 UTC 3,199 bytes, 9 lines download raw bytes

1/**
2 * @license Hyphenopoly_Loader 4.12.0 - client side hyphenation
3 * ©2021  Mathias Nater, Güttingen (mathiasnater at gmail dot com)
4 * https://github.com/mnater/Hyphenopoly
5 *
6 * Released under the MIT license
7 * http://mnater.github.io/Hyphenopoly/LICENSE
8 */
9((e,t,s,n)=>{"use strict";const mp=e=>new Map(e),setDefaults=(e,t)=>e?(n.entries(t).forEach((([t,s])=>{e[t]=e[t]||s})),e):t,o=sessionStorage,r="Hyphenopoly_Loader.js",l=mp(),a="appendChild",i="createElement",c="createTextNode";s.cacheFeatureTests&&o.getItem(r)?(s.cf=JSON.parse(o.getItem(r)),s.cf.langs=mp(s.cf.langs)):s.cf={langs:mp(),pf:!1},(()=>{const e=t.currentScript.src,n=e.slice(0,e.lastIndexOf("/")+1),o=n+"patterns/";s.paths=setDefaults(s.paths,{maindir:n,patterndir:o}),s.s=setDefaults(s.setup,{CORScredentials:"include",hide:"all",selectors:{".hyphenate":{}},timeout:1e3}),s.s.hide=["all","element","text"].indexOf(s.s.hide)})(),(()=>{const e=mp(n.entries(s.fallbacks||{}));n.entries(s.require).forEach((([t,s])=>{l.set(t.toLowerCase(),{fn:e.get(t)||t,wo:s})}))})();const defProm=()=>{let e=null,t=null;const s=new Promise(((s,n)=>{e=s,t=n}));return s.resolve=e,s.reject=t,s};let h=null;s.hide=(e,o)=>{if(0===e)h&&h.remove();else{const e="{visibility:hidden!important}";h=t[i]("style");let r="";0===o?r="html"+e:n.keys(s.s.selectors).forEach((t=>{r+=1===o?t+e:t+"{color:transparent!important}"})),h[a](t[c](r)),t.head[a](h)}};const d=(()=>{let e=null;return{ap:()=>e?(t.documentElement[a](e),e):null,cl:()=>{e&&e.remove()},cr:n=>{if(s.cf.langs.has(n))return;e=e||t[i]("body");const o=t[i]("div"),r="hyphens:auto";o.lang=n,o.style.cssText=`visibility:hidden;-webkit-${r};-ms-${r};${r};width:48px;font-size:12px;line-height:12px;border:none;padding:0;word-wrap:normal`,o[a](t[c](l.get(n).wo.toLowerCase())),e[a](o)}}})();s.res={he:mp()};const p=mp(),loadhyphenEngine=t=>{const n=l.get(t).fn+".wasm";if(s.cf.pf=!0,s.cf.langs.set(t,"H9Y"),p.has(n)){const e=s.res.he.get(p.get(n));e.c=!0,s.res.he.set(t,e)}else s.res.he.set(t,{w:e.fetch(s.paths.patterndir+n,{credentials:s.s.CORScredentials})}),p.set(n,t)};l.forEach(((e,t)=>{"FORCEHYPHENOPOLY"===e.wo||"H9Y"===s.cf.langs.get(t)?loadhyphenEngine(t):d.cr(t)}));const f=d.ap();f&&(f.querySelectorAll("div").forEach((e=>{var t;"auto"===((t=e.style).hyphens||t.webkitHyphens||t.msHyphens)&&e.offsetHeight>12?s.cf.langs.set(e.lang,"CSS"):loadhyphenEngine(e.lang)})),d.cl());const y=s.handleEvent;if(s.cf.pf){s.res.DOM=new Promise((e=>{"loading"===t.readyState?t.addEventListener("DOMContentLoaded",e,{once:!0,passive:!0}):e()}));const n=s.s.hide;0===n&&s.hide(1,0),-1!==n&&(s.timeOutHandler=e.setTimeout((()=>{s.hide(0,null),console.info(r+" timed out.")}),s.s.timeout)),s.res.DOM.then((()=>{n>0&&s.hide(1,n)}));const o=t[i]("script");o.src=s.paths.maindir+"Hyphenopoly.js",t.head[a](o),s.hy6ors=mp(),s.cf.langs.forEac
9h(((e,t)=>{"H9Y"===e&&s.hy6ors.set(t,defProm())})),s.hy6ors.set("HTML",defProm()),s.hyphenators=new Proxy(s.hy6ors,{get:(e,t)=>e.get(t),set:()=>!0}),y&&y.polyfill&&y.polyfill()}else y&&y.tearDown&&y.tearDown(),e.Hyphenopoly=null;s.cacheFeatureTests&&o.setItem(r,JSON.stringify({langs:[...s.cf.langs.entries()],pf:s.cf.pf}))})(window,document,Hyphenopoly,Object);

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.