PageSourceSearch

https://www.natursidan.se/app/themes/hopp/assets/javascript/chunks/interactive-table-controller.33a056ff.js

js natursidan.se collected 2026-09-24 09:57:07 UTC 20,812 bytes, 1 lines download raw bytes

vendor: 12,654 bytes, line 1
1var yt=Object.defineProperty;var Mt=(s,t,e)=>t in s?yt(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var N=(s,t,e)=>Mt(s,typeof t!="symbol"?t+"":t,e);import{C as Et,d as q}from"../application.3a13dd1a.js";function I(s){return Array.isArray?Array.isArray(s):lt(s)==="[object Array]"}const _t=1/0;function It(s){if(typeof s=="string")return s;let t=s+"";return t=="0"&&1/s==-_t?"-0":t}function Tt(s){return s==null?"":It(s)}function E(s){return typeof s=="string"}function at(s){return typeof s=="number"}function xt(s){return s===!0||s===!1||At(s)&&lt(s)=="[object Boolean]"}function ht(s){return typeof s=="object"}function At(s){return ht(s)&&s!==null}function m(s){return s!=null}function D(s){return!s.trim().length}function lt(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const bt="Incorrect 'index' type",Ct=s=>`Invalid value for key ${s}`,Rt=s=>`Pattern length exceeds max of ${s}.`,wt=s=>`Missing ${s} property in key`,Ot=s=>`Property 'weight' in key '${s}' must be a positive integer`,tt=Object.prototype.hasOwnProperty;class Lt{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(r=>{let n=ut(r);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(r=>{r.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ut(s){let t=null,e=null,r=null,n=1,i=null;if(E(s)||I(s))r=s,t=et(s),e=U(s);else{if(!tt.call(s,"name"))throw new Error(wt("name"));const o=s.name;if(r=o,tt.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(Ot(o));t=et(o),e=U(o),i=s.getFn}return{path:t,id:e,weight:n,src:r,getFn:i}}function et(s){return I(s)?s:s.split(".")}function U(s){return I(s)?s.join("."):s}function Nt(s,t){let e=[],r=!1;const n=(i,o,c)=>{if(m(i))if(!o[c])e.push(i);else{let a=o[c];const h=i[a];if(!m(h))return;if(c===o.length-1&&(E(h)||at(h)||xt(h)))e.push(Tt(h));else if(I(h)){r=!0;for(let l=0,d=h.length;l<d;l+=1)n(h[l],o,c+1)}else o.length&&n(h,o,c+1)}};return n(s,E(t)?t.split("."):t,0),r?e:e[0]}const vt={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},kt={isCaseSensitive:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(s,t)=>s.score===t.score?s.idx<t.idx?-1:1:s.score<t.score?-1:1},Ft={location:0,threshold:.6,distance:100},$t={useExtendedSearch:!1,getFn:Nt,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var u={...kt,...vt,...Ft,...$t};const Bt=/[^ ]+/g;function Pt(s=1,t=3){const e=new Map,r=Math.pow(10,t);return{get(n){const i=n.match(Bt).length;if(e.has(i))return e.get(i);const o=1/Math.pow(i,.5*s),c=parseFloat(Math.round(o*r)/r);return e.set(i,c),c},clear(){e.clear()}}}class X{constructor({getFn:t=u.getFn,fieldNormWeight:e=u.fieldNormWeight}={}){this.norm=Pt(e,3),this.getFn=t,this.isCreated=!1,this.setIndexRecords()}setSources(t=[]){this.docs=t}setIndexRecords(t=[]){this.records=t}setKeys(t=[]){this.keys=t,this._keysMap={},t.forEach((e,r)=>{this._keysMap[e.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,E(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();E(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,r=this.size();e<r;e+=1)this.records[e].i-=1}getValueForItemAtKeyId(t,e){return t[this._keysMap[e]]}size(){return this.records.length}_addString(t,e){if(!m(t)||D(t))return;let r={v:t,i:e,n:this.norm.get(t)};this.records.push(r)}_addObject(t,e){let r={i:e,$:{}};this.keys.forEach((n,i)=>{let o=n.getFn?n.getFn(t):this.getFn(t,n.path);if(m(o)){if(I(o)){let c=[];const a=[{nestedArrIndex:-1,value:o}];for(;a.length;){const{nestedArrIndex:h,value:l}=a.pop();if(m(l))if(E(l)&&!D(l)){let d={v:l,i:h,n:this.norm.get(l)};c.push(d)}else I(l)&&l.forEach((d,f)=>{a.push({nestedArrIndex:f,value:d})})}r.$[i]=c}else if(E(o)&&!D(o)){let c={v:o,n:this.norm.get(o)};r.$[i]=c}}}),this.records.push(r)}toJSON(){return{keys:this.keys,records:this.records}}}function dt(s,t,{getFn:e=u.getFn,fieldNormWeight:r=u.fieldNormWeight}={}){const n=new X({getFn:e,fieldNormWeight:r});return n.setKeys(s.map(ut)),n.setSources(t),n.create(),n}function jt(s,{getFn:t=u.getFn,fieldNormWeight:e=u.fieldNormWeight}={}){const{keys:r,records:n}=s,i=new X({getFn:t,fieldNormWeight:e});return i.setKeys(r),i.setIndexRecords(n),i}function F(s,{errors:t=0,currentLocation:e=0,expectedLocation:r=0,distance:n=u.distance,ignoreLocation:i=u.ignoreLocation}={}){const o=t/s.length;if(i)return o;const c=Math.abs(r-e);return n?o+c/n:c?1:o}function Dt(s=[],t=u.minMatchCharLength){let e=[],r=-1,n=-1,i=0;for(let o=s.length;i<o;i+=1){let c=s[i];c&&r===-1?r=i:!c&&r!==-1&&(n=i-1,n-r+1>=t&&e.push([r,n]),r=-1)}return s[i-1]&&i-r>=t&&e.push([r,i-1]),e}const R=32;function Ht(s,t,e,{location:r=u.location,distance:n=u.distance,threshold:i=u.threshold,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,includeMatches:a=u.includeMatches,ignoreLocation:h=u.ignoreLocation}={}){if(t.length>R)throw new Error(Rt(R));const l=t.length,d=s.length,f=Math.max(0,Math.min(r,d));let g=i,p=f;const S=c>1||a,b=S?Array(d):[];let _;for(;(_=s.indexOf(t,p))>-1;){let y=F(t,{currentLocation:_,expectedLocation:f,distance:n,ignoreLocation:h});if(g=Math.min(y,g),p=_+l,S){let T=0;for(;T<l;)b[_+T]=1,T+=1}}p=-1;let w=[],C=1,v=l+d;const St=1<<l-1;for(let y=0;y<l;y+=1){let T=0,x=v;for(;T<x;)F(t,{errors:y,currentLocation:f+x,expectedLocation:f,distance:n,ignoreLocation:h})<=g?T=x:v=x,x=Math.floor((v-T)/2+T);v=x;let J=Math.max(1,f-x+1),j=o?d:Math.min(f+x,d)+l,O=Array(j+2);O[j+1]=(1<<y)-1;for(let M=j;M>=J;M-=1){let k=M-1,Z=e[s.charAt(k)];if(S&&(b[k]=+!!Z),O[M]=(O[M+1]<<1|1)&Z,y&&(O[M]|=(w[M+1]|w[M])<<1|1|w[M+1]),O[M]&St&&(C=F(t,{errors:y,currentLocation:k,expectedLocation:f,distance:n,ignoreLocation:h}),C<=g)){if(g=C,p=k,p<=f)break;J=Math.max(1,2*f-p)}}if(F(t,{errors:y+1,currentLocation:f,expectedLocation:f,distance:n,ignoreLocation:h})>g)break;w=O}const P={isMatch:p>=0,score:Math.max(.001,C)};if(S){const y=Dt(b,c);y.length?a&&(P.indices=y):P.isMatch=!1}return P}function Vt(s){let t={};for(let e=0,r=s.length;e<r;e+=1){const n=s.charAt(e);t[n]=(t[n]||0)|1<<r-e-1}return t}class ft{constructor(t,{location:e=u.location,threshold:r=u.threshold,distance:n=u.distance,includeMatches:i=u.includeMatches,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,isCaseSensitive:a=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){if(this.options={location:e,threshold:r,distance:n,includeMatches:i,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:a,ignoreLocation:h},this.pattern=a?t:t.toLowerCase(),this.chunks=[],!this.pattern.length)return;const l=(f,g)=>{this.chunks.push({pattern:f,alphabet:Vt(f),startIndex:g})},d=this.pattern.length;if(d>R){let f=0;const g=d%R,p=d-g;for(;f<p;)l(this.pattern.substr(f,R),f),f+=R;if(g){const S=d-R;l(this.pattern.substr(S),S)}}else l(this.pattern,0)}searchIn(t){const{isCaseSensitive:e,includeMatches:r}=this.options;if(e||(t=t.toLowerCase()),this.pattern===t){let p={isMatch:!0,score:0};return r&&(p.indices=[[0,t.length-1]]),p}const{location:n,distance:i,threshold:o,findAllMatches:c,minMatchCharLength:a,ignoreLocation:h}=this.options;let l=[],d=0,f=!1;this.chunks.forEach(({pattern:p,alphabet:S,startIndex:b})=>{const{isMatch:_,score:w,indices:C}=Ht(t,p,S,{location:n+b,distance:i,threshold:o,findAllMatches:c,minMatchCharLength:a,includeMatches:r,ignoreLocation:h});_&&(f=!0),d+=w,_&&C&&(l=[...l,...C])});let g={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(g.indices=l),g}}class A{constructor(t){this.pattern=t}static isMultiMatch(t){return st(t,this.multiRegex)}static isSingleMatch(t){return st(t,this.singleRegex)}search(){}}function st(s,t){const e=s.match(t);return e?e[1]:null}class Kt extends A{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class Ut extends A{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const r=t.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,t.length-1]}}}class Wt extends A{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class zt extends A{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class Gt extends A{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class Yt extends A{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class gt extends A{constructor(t,{location:e=u.location,threshold:r=u.threshold,distance:n=u.distance,includeMatches:i=u.includeMatches,findAllMatches:o=u.findAllMatches,minMatchCharLength:c=u.minMatchCharLength,isCaseSensitive:a=u.isCaseSensitive,ignoreLocation:h=u.ignoreLocation}={}){super(t),this._bitapSearch=new ft(t,{location:e,threshold:r,distance:n,includeMatches:i,findAllMatches:o,minMatchCharLength:c,isCaseSensitive:a,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class pt extends A{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,r;const n=[],i=this.pattern.length;for(;(r=t.indexOf(this.pattern,e))>-1;)e=r+i,n.push([r,e-1]);const o=!!n.length;return{isMatch:o,score:o?0:1,indices:n}}}const W=[Kt,pt,Wt,zt,Yt,Gt,Ut,gt],rt=W.length,Qt=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Xt="|";function Jt(s,t={}){return s.split(Xt).map(e=>{let r=e.trim().split(Qt).filter(i=>i&&!!i.trim()),n=[];for(let i=0,o=r.length;i<o;i+=1){const c=r[i];let a=!1,h=-1;for(;!a&&++h<rt;){const l=W[h];let d=l.isMultiMatch(c);d&&(n.push(new l(d,t)),a=!0)}if(!a)for(h=-1;++h<rt;){const l=W[h];let d=l.isSingleMatch(c);if(d){n.push(new l(d,t));break}}}return n})}const Zt=new Set([gt.type,pt.type]);class qt{constructor(t,{isCaseSensitive:e=u.isCaseSensitive,includeMatches:r=u.includeMatches,minMatchCharLength:n=u.minMatchCharLength,ignoreLocation:i=u.ignoreLocation,findAllMatches:o=u.findAllMatches,location:c=u.location,threshold:a=u.threshold,distance:h=u.distance}={}){this.query=null,this.options={isCaseSensitive:e,includeMatches:r,minMatchCharLength:n,findAllMatches:o,ignoreLocation:i,location:c,threshold:a,distance:h},this.pattern=e?t:t.toLowerCase(),this.query=Jt(this.pattern,this.options)}static condition(t,e){return e.useExtendedSearch}searchIn(t){const e=this.query;if(!e)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:n}=this.options;t=n?t:t.toLowerCase();let i=0,o=[],c=0;for(let a=0,h=e.length;a<h;a+=1){const l=e[a];o.length=0,i=0;for(let d=0,f=l.length;d<f;d+=1){const g=l[d],{isMatch:p,indices:S,score:b}=g.search(t);if(p){if(i+=1,c+=b,r){const _=g.constructor.type;Zt.has(_)?o=[...o,...S]:o.push(S)}}else{c=0,i=0,o.length=0;break}}if(i){let d={isMatch:!0,score:c/i};return r&&(d.indices=o),d}}return{isMatch:!1,score:1}}}const z=[];function te(...s){z.push(...s)}function G(s,t){for(let e=0,r=z.length;e<r;e+=1){let n=z[e];if(n.condition(s,t))return new n(s,t)}return new ft(s,t)}const B={AND:"$and",OR:"$or"},Y={PATH:"$path",PATTERN:"$val"},Q=s=>!!(s[B.AND]||s[B.OR]),ee=s=>!!s[Y.PATH],se=s=>!I(s)&&ht(s)&&!Q(s),nt=s=>({[B.AND]:Object.keys(s).map(t=>({[t]:s[t]}))});function mt(s,t,{auto:e=!0}={}){const r=n=>{let i=Object.keys(n);const o=ee(n);if(!o&&i.length>1&&!Q(n))return r(nt(n));if(se(n)){const a=o?n[Y.PATH]:i[0],h=o?n[Y.PATTERN]:n[a];if(!E(h))throw new Error(Ct(a));const l={keyId:U(a),pattern:h};return e&&(l.searcher=G(h,t)),l}let c={children:[],operator:i[0]};return i.forEach(a=>{const h=n[a];I(h)&&h.forEach(l=>
1{c.children.push(r(l))})}),c};return Q(s)||(s=nt(s)),r(s)}function re(s,{ignoreFieldNorm:t=u.ignoreFieldNorm}){s.forEach(e=>{let r=1;e.matches.forEach(({key:n,norm:i,score:o})=>{const c=n?n.weight:null;r*=Math.pow(o===0&&c?Number.EPSILON:o,(c||1)*(t?1:i))}),e.score=r})}function ne(s,t){const e=s.matches;t.matches=[],m(e)&&e.forEach(r=>{if(!m(r.indices)||!r.indices.length)return;const{indices:n,value:i}=r;let o={indices:n,value:i};r.key&&(o.key=r.key.src),r.idx>-1&&(o.refIndex=r.idx),t.matches.push(o)})}function ie(s,t){t.score=s.score}function oe(s,t,{includeMatches:e=u.includeMatches,includeScore:r=u.includeScore}={}){const n=[];return e&&n.push(ne),r&&n.push(ie),s.map(i=>{const{idx:o}=i,c={item:t[o],refIndex:o};return n.length&&n.forEach(a=>{a(i,c)}),c})}class L{constructor(t,e={},r){this.options={...u,...e},this.options.useExtendedSearch,this._keyStore=new Lt(this.options.keys),this.setCollection(t,r)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof X))throw new Error(bt);this._myIndex=e||dt(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){m(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let r=0,n=this._docs.length;r<n;r+=1){const i=this._docs[r];t(i,r)&&(this.removeAt(r),r-=1,n-=1,e.push(i))}return e}removeAt(t){this._docs.splice(t,1),this._myIndex.removeAt(t)}getIndex(){return this._myIndex}search(t,{limit:e=-1}={}){const{includeMatches:r,includeScore:n,shouldSort:i,sortFn:o,ignoreFieldNorm:c}=this.options;let a=E(t)?E(this._docs[0])?this._searchStringList(t):this._searchObjectList(t):this._searchLogical(t);return re(a,{ignoreFieldNorm:c}),i&&a.sort(o),at(e)&&e>-1&&(a=a.slice(0,e)),oe(a,this._docs,{includeMatches:r,includeScore:n})}_searchStringList(t){const e=G(t,this.options),{records:r}=this._myIndex,n=[];return r.forEach(({v:i,i:o,n:c})=>{if(!m(i))return;const{isMatch:a,score:h,indices:l}=e.searchIn(i);a&&n.push({item:i,idx:o,matches:[{score:h,value:i,norm:c,indices:l}]})}),n}_searchLogical(t){const e=mt(t,this.options),r=(c,a,h)=>{if(!c.children){const{keyId:d,searcher:f}=c,g=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(a,d),searcher:f});return g&&g.length?[{idx:h,item:a,matches:g}]:[]}const l=[];for(let d=0,f=c.children.length;d<f;d+=1){const g=c.children[d],p=r(g,a,h);if(p.length)l.push(...p);else if(c.operator===B.AND)return[]}return l},n=this._myIndex.records,i={},o=[];return n.forEach(({$:c,i:a})=>{if(m(c)){let h=r(e,c,a);h.length&&(i[a]||(i[a]={idx:a,item:c,matches:[]},o.push(i[a])),h.forEach(({matches:l})=>{i[a].matches.push(...l)}))}}),o}_searchObjectList(t){const e=G(t,this.options),{keys:r,records:n}=this._myIndex,i=[];return n.forEach(({$:o,i:c})=>{if(!m(o))return;let a=[];r.forEach((h,l)=>{a.push(...this._findMatches({key:h,value:o[l],searcher:e}))}),a.length&&i.push({idx:c,item:o,matches:a})}),i}_findMatches({key:t,value:e,searcher:r}){if(!m(e))return[];let n=[];if(I(e))e.forEach(({v:i,i:o,n:c})=>{if(!m(i))return;const{isMatch:a,score:h,indices:l}=r.searchIn(i);a&&n.push({score:h,key:t,value:i,idx:o,norm:c,indices:l})});else{const{v:i,n:o}=e,{isMatch:c,score:a,indices:h}=r.searchIn(i);c&&n.push({score:a,key:t,value:i,norm:o,indices:h})}return n}}L.version="7.0.0";L.createIndex=dt;L.parseIndex=jt;L.config=u;L.parseQuery=mt;te(qt);const $="asc",it="desc",ot=$,H="is-ascending",V="is-descending",K="aria-sort",ce="ascending",ae="descending";class ct extends Et{constructor(){super(...arguments);N(this,"state",{sortColumn:0,sortOrder:ot,search:"",searchResultCount:0});N(this,"rows",[])}initialize(){this.debouncedSearchInputHandler=q(this.searchInputHandler.bind(this),250),this.debouncedRenderSortColumnButtons=q(this.renderSortColumnButtons.bind(this),1)}connect(){this.setState({sortColumn:this.sortColumnValue,sortOrder:this.sortOrderValue},{quiet:!0}),this.hasSearchInputTarget&&this.setState({search:this.searchInputTarget.value},{quiet:!0}),this.indexRows(),this.setupFuse(),this.setupSortColumnButtons(),this.setupSearchInput(),this.renderTbody()}disconnect(){this.teardownFuse(),this.teardownSearchInput()}headerSortButtonTargetConnected(){this.debouncedRenderSortColumnButtons()}setState(e={},{quiet:r=!1}={}){const n=this.state,i={...n,...e};this.state=i,!r&&((i.sortColumn!==n.sortColumn||i.sortOrder!==n.sortOrder)&&(this.sortColumnValue=i.sortColumn,this.sortOrderValue=i.sortOrder,this.renderSortColumnButtons()),(i.sortColumn!==n.sortColumn||i.sortOrder!==n.sortOrder||i.search!==n.search)&&(this.dispatchTableUpdate(),this.renderTbody()),i.searchResultCount!==n.searchResultCount&&this.renderSearchResultSummary())}dispatchTableUpdate(){this.element.dispatchEvent(new Event("TOGGLE_REQUEST_EXPAND"),{bubbles:!1})}indexRows(){this.rows=Array.from(this.tbodyTarget.children).map(e=>{const r=Array.from(e.children).map(i=>i.textContent.trim()),n=r.map(i=>{let o=i;return o.match(/^\d+/)&&(o=Number.parseFloat(o.replace(/,+/g,".").replace(/[^\d.]/g,""),10)),o});return{row:e,columnContent:n,columnStringContent:r}})}setupFuse(){this.searchableValue&&(this.fuse=new L(this.rows,{threshold:.2,keys:["columnStringContent"]}))}setupSortColumnButtons(){if(!this.sortableValue||!this.hasHeaderSortButtonTemplateTarget)return;const e=this.theadTarget.querySelectorAll("th");if(e.length<=1){this.sortableValue=!1;return}for(const r of e){if(r.querySelector('[data-interactive-table-target~="headerSortButton"]'))return;const n=r.childNodes,i=this.headerSortButtonTemplateTarget.content.cloneNode(!0),o=i.querySelector('[data-interactive-table-target~="headerSortButtonText"]')||i.querySelector(":not(:has(*))");for(const c of n)o.append(c);r.append(i)}}setupSearchInput(){if(!this.searchableValue||!this.hasSearchInputTarget)return;const{searchInputTarget:e}=this;e.value=this.state.search,e.disabled=!1,e.addEventListener("input",this.debouncedSearchInputHandler)}teardownFuse(){this.fuse=null}teardownSearchInput(){this.hasSearchInputTarget&&(this.searchInputTarget.disabled=!0,this.searchInputTarget.removeEventListener("input",this.debouncedSearchInputHandler))}searchInputHandler(e){const{value:r}=e.target;this.setState({search:r})}sortColumn(e){const{target:r}=e,n=r.closest("th"),i=Array.from(n.parentNode.children).indexOf(n);let{sortOrder:o}=this.state;i===this.state.sortColumn&&(o=o===$?it:$),this.setState({sortColumn:i,sortOrder:o})}renderSortColumnButtons(){if(!this.hasHeaderSortButtonTarget)return;const{sortColumn:e,sortOrder:r}=this.state;
1this.headerSortButtonTargets.forEach((n,i)=>{const o=n.closest("th");i===e?r===$?(o.setAttribute(K,ce),n.classList.add(H),n.classList.remove(V)):(o.setAttribute(K,ae),n.classList.add(V),n.classList.remove(H)):(o.removeAttribute(K),n.classList.remove(H,V))})}renderTbody(){if(!this.hasTbodyTarget)return;const{sortColumn:e,sortOrder:r,search:n}=this.state,i=[...this.rows];let o=[];n&&(o=this.fuse.search(n).map(({item:c})=>c)),e!==null&&(i.map(h=>h.columnContent[e]).every(h=>!Number.isNaN(Number.parseFloat(h)))?i.sort((h,l)=>Number.parseFloat(h.columnContent[e])>Number.parseFloat(l.columnContent[e])?1:-1):i.sort((h,l)=>h.columnContent[e]>l.columnContent[e]?1:-1),r===it&&i.reverse());for(const c of i)c.row.hidden=n&&!o.includes(c);this.tbodyTarget.replaceChildren(),this.tbodyTarget.append(...i.map(c=>c.row)),this.setState({searchResultCount:i.length})}renderSearchResultSummary(){if(!this.hasSearchResultSummaryTarget||!this.hasSearchResultSummaryTemplateTarget)return;const e=this.searchResultSummaryTemplateTarget.content.textContent.trim();this.searchResultSummaryTarget.innerText=e.replace("{{count}}",this.state.searchResultCount)}get theadTarget(){return this.element.querySelector("thead")}get hasTheadTarget(){return!!this.theadTarget}get tbodyTarget(){return this.element.querySelector("tbody")}get hasTbodyTarget(){return!!this.tbodyTarget}}N(ct,"values",{sortable:{default:!1,type:Boolean},searchable:{default:!1,type:Boolean},sortColumn:{default:0,type:Number},sortOrder:{default:ot,type:String}}),N(ct,"targets",["headerSortButtonTemplate","searchResultSummaryTemplate","headerSortButton","searchInput","searchResultSummary","table"]);export{ct as default};

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.