/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.0-next.25 */
import{c as P,p as k,q as w,r as V,t as m,u as p,v as A,w as D,x as y}from"./R6GHAOGV.js";var b=(s,f,c)=>{let h=new Map;for(let e=f;e<=c;e++)h.set(s[e],e);return h},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let h;c===void 0?c=f:f!==void 0&&(h=f);let e=[],n=[],l=0;for(let a of s)e[l]=h?h(a,l):l,n[l]=c(a,l),l++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,h]){let e=D(s),{values:n,keys:l}=this.dt(f,c,h);if(!Array.isArray(e))return this.ut=l,n;let a=this.ut??=[],u=[],v,x,t=0,o=e.length-1,r=0,i=n.length-1;for(;t<=o&&r<=i;)if(e[t]===null)t++;else if(e[o]===null)o--;else if(a[t]===l[r])u[r]=p(e[t],n[r]),t++,r++;else if(a[o]===l[i])u[i]=p(e[o],n[i]),o--,i--;else if(a[t]===l[i])u[i]=p(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[o]===l[r])u[r]=p(e[o],n[r]),m(s,e[t],e[o]),o--,r++;else if(v===void 0&&(v=b(l,r,i),x=b(a,t,o)),v.has(a[t]))if(v.has(a[o])){let d=x.get(l[r]),g=d!==void 0?e[d]:null;if(g===null){let C=m(s,e[t]);p(C,n[r]),u[r]=C}else u[r]=p(g,n[r]),m(s,e[t],g),e[d]=null;r++}else y(e[o]),o--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);p(d,n[r]),u[r++]=d}for(;t<=o;){let d=e[t++];d!==null&&y(d)}return this.ut=l,A(s,u),P}});export{I as a};
