@supersoniks/concorde 5.1.2 → 5.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/concorde-docs/SKILL.md +1 -1
- package/README.md +1 -1
- package/ai/README.md +29 -41
- package/ai/skills/concorde/SKILL.md +54 -324
- package/ai/skills/concorde/rules/composition.md +32 -0
- package/ai/skills/concorde/rules/data.md +47 -0
- package/ai/skills/concorde/rules/http.md +25 -0
- package/ai/skills/concorde/rules/lists-forms.md +35 -0
- package/ai/skills/concorde/rules/styling.md +46 -0
- package/ai/skills/concorde/rules/troubleshooting.md +45 -0
- package/build-infos.json +1 -1
- package/concorde-core.bundle.js +21 -21
- package/concorde-core.es.js +977 -980
- package/custom-elements-manifest.public.config.mjs +8 -0
- package/{.tmp-cem/custom-elements.json → custom-elements.json} +11722 -8868
- package/dist/concorde-core.bundle.js +21 -21
- package/dist/concorde-core.es.js +977 -980
- package/dist/docs-mock-api-sw.js +58 -223
- package/dist/docs-mock-api-sw.js.map +4 -4
- package/dist/img/concorde/plane_01.jpg +0 -0
- package/dist/img/concorde/plane_02.jpg +0 -0
- package/dist/img/concorde/plane_03.jpg +0 -0
- package/dist/img/concorde/plane_04.jpg +0 -0
- package/dist/img/concorde/plane_05.jpg +0 -0
- package/dist/img/concorde/plane_06.jpg +0 -0
- package/dist/img/concorde/plane_07.jpg +0 -0
- package/dist/img/concorde/plane_08.jpg +0 -0
- package/dist/img/concorde/plane_09.jpg +0 -0
- package/dist/img/concorde/plane_10.jpg +0 -0
- package/dist/img/concorde/plane_11.jpg +0 -0
- package/dist/img/concorde/plane_12.jpg +0 -0
- package/dist/img/concorde/plane_13.jpg +0 -0
- package/dist/img/og-concorde.jpg +0 -0
- package/dist/robots.txt +11 -10
- package/docs/.htaccess +7 -0
- package/docs/about.html +111 -0
- package/docs/about.md +22 -0
- package/docs/assets/{index-BgG6FFPt.js → index-6sS76xWj.js} +482 -500
- package/docs/assets/{index-x89XINSG.css → index-DkdPbH0F.css} +1 -1
- package/docs/core/components/functional/date/date.md +1 -1
- package/docs/core/components/functional/list/list.html +7 -5
- package/docs/core/components/functional/list/list.md +6 -2
- package/docs/core/components/ui/card/card.html +1 -1
- package/docs/core/components/ui/card/card.md +1 -1
- package/docs/core/components/ui/image/image.html +17 -17
- package/docs/core/components/ui/image/image.md +17 -17
- package/docs/core/components/ui/modal/modal.html +2 -2
- package/docs/core/components/ui/modal/modal.md +2 -2
- package/docs/custom-elements.json +16559 -0
- package/docs/docs/decorators/bind.html +22 -21
- package/docs/docs/decorators/bind.md +23 -24
- package/docs/docs/getting-started/ai-agents.html +50 -94
- package/docs/docs/getting-started/ai-agents.md +29 -55
- package/docs/docs/getting-started/dataFlow.html +1 -1
- package/docs/docs/getting-started/dataFlow.md +1 -1
- package/docs/docs/index.html +1 -1
- package/docs/hubs/decorators.html +11 -16
- package/docs/hubs/remote-data.html +5 -9
- package/docs/img/og-concorde.jpg +0 -0
- package/docs/index.html +91 -2
- package/docs/index.md +2 -2
- package/docs/llms-full.txt +58 -74
- package/docs/llms.txt +6 -4
- package/docs/privacy.html +122 -0
- package/docs/privacy.md +32 -0
- package/docs/sitemap.xml +6 -0
- package/docs/src/core/components/functional/date/date.md +1 -1
- package/docs/src/core/components/functional/list/list.md +6 -2
- package/docs/src/core/components/functional/sdui/component-catalog.gaps.json +1 -1
- package/docs/src/core/components/functional/sdui/component-catalog.json +1 -1
- package/docs/src/core/components/ui/card/card.md +1 -1
- package/docs/src/core/components/ui/image/image.md +17 -17
- package/docs/src/core/components/ui/modal/modal.md +2 -2
- package/docs/src/docs/decorators/bind.md +23 -24
- package/docs/src/docs/getting-started/ai-agents.md +29 -55
- package/docs/src/docs/getting-started/dataFlow.md +1 -1
- package/docs/src/docs/search/docs-search.json +100 -55
- package/docs/src/tsconfig.json +11 -5
- package/index.html +89 -0
- package/package.json +8 -4
- package/public/img/og-concorde.jpg +0 -0
- package/scripts/ai-init.mjs +104 -379
- package/scripts/ai-init.test.mjs +81 -239
- package/scripts/docs-markdown-vite-plugin.ts +11 -5
- package/scripts/docs-public-url.mjs +6 -0
- package/scripts/docs.htaccess +7 -0
- package/scripts/generate-cem.mjs +244 -0
- package/scripts/generate-cem.test.mjs +122 -0
- package/scripts/generate-crawl-docs.mjs +29 -5
- package/scripts/generate-sdui-catalog.mjs +11 -10
- package/scripts/post-build-docs.js +3 -0
- package/scripts/pre-publish.mjs +2 -1
- package/scripts/site-pages.mjs +212 -0
- package/scripts/site-pages.test.mjs +116 -0
- package/site-pages/about.md +22 -0
- package/site-pages/privacy.md +32 -0
- package/src/core/components/functional/date/date.md +1 -1
- package/src/core/components/functional/list/list.md +6 -2
- package/src/core/components/functional/sdui/component-catalog.gaps.json +1 -1
- package/src/core/components/functional/sdui/component-catalog.json +1 -1
- package/src/core/components/ui/card/card.md +1 -1
- package/src/core/components/ui/image/image.md +17 -17
- package/src/core/components/ui/modal/modal.md +2 -2
- package/src/core/decorators/subscriber/bind.ts +9 -14
- package/src/docs/components/docs-demo-sources.ts +3 -3
- package/src/docs/decorators/bind.md +23 -24
- package/src/docs/docs-location.spec.ts +10 -0
- package/src/docs/docs-location.ts +10 -0
- package/src/docs/example/decorators-demo-bind-demos.ts +11 -28
- package/src/docs/example/docs-toggle-demos.ts +1 -1
- package/src/docs/getting-started/ai-agents.md +29 -55
- package/src/docs/getting-started/dataFlow.md +1 -1
- package/src/docs/home/home.ts +3 -1
- package/src/docs/navigation/navigation.ts +1 -1
- package/src/docs/search/docs-search.json +100 -55
- package/src/docs/search/markdown-renderer.ts +6 -1
- package/src/docs/tailwind/css/docs/content.css +4 -5
- package/src/tsconfig.json +11 -5
- package/src/tsconfig.tsbuildinfo +1 -1
- package/ai/AGENTS.md +0 -56
- package/ai/cursor/rules/concorde-menu.mdc +0 -15
- package/ai/cursor/rules/concorde-scope.mdc +0 -14
- package/ai/cursor/rules/concorde-theme.mdc +0 -13
- package/ai/cursor/rules/concorde.mdc +0 -66
- package/ai/jetbrains/rules/concorde.md +0 -53
- package/ai/skills/concorde-get-set-dp/SKILL.md +0 -194
- package/ai/skills/concorde-imports/SKILL.md +0 -78
- package/ai/skills/concorde-menu/SKILL.md +0 -74
- package/ai/skills/concorde-scope/SKILL.md +0 -70
- package/ai/skills/concorde-theme/SKILL.md +0 -57
package/concorde-core.bundle.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(Ue){typeof define=="function"&&define.amd?define(Ue):Ue()})((function(){"use strict";var Te,st;let Ue=class kt{static getLanguage(){const e=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||e}static getCookies(){return document.cookie.split(";").reduce((e,s)=>{const i=s.indexOf("=");return e[s.substring(0,i).trim()]=s.substring(i+1),e},{})}static nextComposedAncestor(e){return e instanceof Element&&e.assignedSlot?e.assignedSlot:e.parentNode||e.host||null}static everyAncestors(e,s){for(;e;){if(!s(e))return;e=e.parentNode||e.host}}static overflowMatches(e,s){return s.includes(e.overflowY)||s.includes(e.overflowX)}static findAncestorByOverflow(e,s){let i=e;for(;i;){if(i instanceof Element&&i.nodeType===1){const r=window.getComputedStyle(i);if(kt.overflowMatches(r,s))return i}i=kt.nextComposedAncestor(i)}return null}static getScrollableAncestor(e){return kt.findAncestorByOverflow(e,["auto","scroll","hidden","overlay"])}static getScrollingAncestor(e){return kt.findAncestorByOverflow(e,["auto","scroll","overlay"])}static scopeAttributeNames(e){const s=e.toLowerCase();return s===e?[e]:[e,s]}static readScopeAttributeOnElement(e,s){for(const i of kt.scopeAttributeNames(s))if(e.hasAttribute(i))return e.getAttribute(i)??"";return null}static getAncestorAttributeValue(e,s){if(!e)return null;let i=e;for(;i;){if(i instanceof HTMLElement){const n=kt.readScopeAttributeOnElement(i,s);if(n!=null)return n}const r=i.parentNode||i.host;if(!r)break;i=r}return null}static getApiConfiguration(e){const s=kt.getAncestorAttributeValue(e,"token"),i=kt.getAncestorAttributeValue(e,"addHTTPResponse")!=null,r=kt.getAncestorAttributeValue(e,"serviceURL");let n=null,o=null;const c=kt.getAncestorAttributeValue(e,"tokenProvider"),d=kt.getAncestorAttributeValue(e,"eventsApiToken");s||(n=kt.getAncestorAttributeValue(e,"userName"),o=kt.getAncestorAttributeValue(e,"password"));const g=kt.getAncestorAttributeValue(e,"credentials")||void 0,A=e.getAttribute("cache"),m=e.hasAttribute("blockUntilDone"),f=e.hasAttribute("keepAlive");return{serviceURL:r,token:s,userName:n,password:o,authToken:d,tokenProvider:c,addHTTPResponse:i,credentials:g,cache:A,blockUntilDone:m,keepAlive:f}}static getClosestElement(e,s){for(;!(e.nodeName&&e.nodeName.toLowerCase()===s)&&(e.parentNode||e.host);)e=e.parentNode||e.host;return e.nodeName?e:null}static getClosestForm(e){return kt.getClosestElement(e,"form")}static getAncestorsByTagNames(e,s){const i=new Set(s.map(o=>o.toLowerCase())),r=[];let n=e.parentNode||e.host;for(;n;)n instanceof Element&&i.has(n.tagName.toLowerCase())&&r.push(n),n=n.parentNode||n.host;return r}static getAncestorsBySelectors(e,s){const i=[];let r=e.parentNode||e.host;for(;r;){if(r instanceof Element)for(const n of s)try{if(r.matches(n)){i.push(r);break}}catch{}r=r.parentNode||r.host}return i}static async loadJS(e){return new Promise(async i=>{const r=document.createElement("script");r.src=e,r.onload=()=>i(!0),r.onerror=()=>i(!0),document.head.appendChild(r)})}static async loadCSS(e){return new Promise(async i=>{const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=()=>i(!0),r.onerror=()=>i(!0),document.head.appendChild(r)})}};const bn=t=>{const e=document.documentElement,s=new MutationObserver(r=>{for(let n of r)n.type==="attributes"&&n.attributeName==="lang"&&t()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(e,i)};let Fr=class{static ucFirst(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.substring(1)}static minutesDuration(e,s="",i="long"){s||(s=Ue.getLanguage());const r=(g,A)=>[Math.floor(g/A),g%A];function n(g,A,m){return new Intl.NumberFormat(g,{style:"unit",unit:A,unitDisplay:m}).format}const[o,c]=r(e,60),d=[];return o&&d.push(n(s,"hour",i)(o)),c&&d.push(n(s,"minute",i)(c)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(d)}static js(e){try{return Function("return "+e)()}catch{return""}}};class Oo{constructor(e){this.path=e}toString(){return this.path}}function To(t){return new Proxy(t,{get(e,s){if(s==="path")return e.path;if(s==="toString")return e.toString.bind(e);if(s===Symbol.toStringTag)return"DataProviderKey";if(typeof s=="symbol")return e[s];const i=e.path?`${e.path}.${String(s)}`:String(s);return To(new Oo(i))}})}const Yl=/\$\{|\{\$/;function Zl(t){return Yl.test(t)}function gi(t){const e=typeof t=="string"?t:t.path;if(Zl(e))throw new Error("Static publisher path required for get/set/dp. Use @subscribe, @publish, or @handle for dynamic DataProviderKey paths.");return e}const Cs=function(t){return this instanceof Cs?To(new Oo(t)):new Cs(t)};let ht=class As{static shallowEqual(e,s,i=!0){const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length&&i)return!1;for(const o of r){const c=e[o],d=s[o];if(i?c!==d:c!=d)return!1}return!0}static deepEqual(e,s,i=!0){const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length&&i)return!1;for(const o of r){const c=e[o],d=s[o],g=As.isObject(c)&&As.isObject(d),A=i?c!==d:c!=d;if(g&&!As.deepEqual(c,d)||!g&&A)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}static isUndefindOrNull(e){return e==null}static isEmpty(e){return As.isUndefindOrNull(e)?!0:Object.keys(e).length===0}static traverse(e,s,i=!1){for(const r of s){const n=e[r];if(n===void 0)return;i&&As.isObject(n)?e=Object.assign(Array.isArray(n)?[]:{},e,n):e=e[r]}return e}static traverseDotNotation(e,s,i=!1){return As.traverse(e,s.split("."),i)}static getURLSearchArray(e,s=""){let i=[];for(let r in e){const n=e[r];s&&(r=s+"["+r+"]"),As.isObject(n)?i=[...i,...this.getURLSearchArray(n,r)]:i.push(`${r}=${n}`)}return i}static getURLSearchString(e){return As.getURLSearchArray(e,"").join("&")}};const Bt=ht.traverseDotNotation;let Jl=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(s=>{setTimeout(s,e)})}},Lo="sonic";typeof __SONIC_PREFIX__<"u"&&(Lo=__SONIC_PREFIX__);let Io=Lo.replace(/-([a-z])/g,t=>t[1].toUpperCase());const bi=Io.charAt(0).toUpperCase()+Io.slice(1),Ql=new Set(["localStorageMode","expirationDelayMs","invalidateOnPageShow"]);function Mo(t){return t==null||typeof t!="object"||Array.isArray(t)?!1:Object.keys(t).some(e=>Ql.has(e))}function vi(t){return Object.prototype.hasOwnProperty.call(t,"__value")}function ks(t){return typeof t=="object"&&t!==null}let dr="sonic";typeof __SONIC_PREFIX__>"u"&&(dr="sonic");const vn=dr=="sonic"?"publisher-proxies-data":dr+"-publisher-proxies-data",qs=class qs{constructor(e,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const e in this._proxies_.keys())e!="_parent_"&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),qs.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!ve.changed){ve.changed=!0,ve.saveId++;const s=ve.saveId;setTimeout(()=>ve.getInstance().saveToLocalStorage(s),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(r=>{r(i)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,s){this._fillListeners_.forEach(i=>{i[e]!==s&&(i[e]=s)}),this._publishTemplateFilling_(e,s)}_publishTemplateFilling_(e,s){this._templateFillListeners_.forEach(i=>{const r=Object.getOwnPropertyDescriptor(i,e);r&&!r.set&&!r.writable||(i.propertyMap&&i.propertyMap[e]&&(e=i.propertyMap[e]),typeof i[e]<"u"&&i[e]!==s&&(i[e]=s))})}onAssign(e,s=!0){typeof e=="function"&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),s&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e=="function"&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e=="function"&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e=="function"&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e=="function"&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_=="object")for(const s in this._value_){let i=s;const r=this._value_[s];e.propertyMap&&e.propertyMap[s]&&(i=e.propertyMap[s]),typeof e[s]<"u"&&e[s]!==r&&(e[i]=r)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(const s in this._value_){const i=this._value_[s];e[s]!==i&&(e[s]=i)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,s=!1){if(this._value_===e||ks(this._value_)&&ks(e)&&e&&vi(this._value_)&&vi(e)&&this._value_.__value===e.__value||!ks(e)&&e===this._value_.__value)return!0;this._value_=ks(e)?e:{__value:e},this._cachedGet_=void 0;const i=vi(this._value_);if(this._parentKey_&&this.parent){const r=vi(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:r});else{const n=[];n[Number(this._parentKey_)]=r,this.parent.set(n)}else this.parent._value_[this._parentKey_]=r}if(i)return this._proxies_.forEach((r,n)=>{n!="_parent_"&&(r.set(null),this._publishDynamicFilling_(n,null))}),this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const r in this._value_)this._value_[r]===void 0&&delete this._value_[r];if(this._proxies_.forEach((r,n)=>{const o=this._value_[n];n!="_parent_"&&o===void 0&&o!==null&&isNaN(Number(n))&&(r.set(null),this._publishDynamicFilling_(n,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ks(this._value_))for(const r in this._value_){const n=e[r],c=ks(n)?n:{__value:n};if(!this._proxies_.has(r)){this._publishDynamicFilling_(r,n);continue}this._proxies_.get(r)?.set(c,!0),this._publishDynamicFilling_(r,n)}return!0}get(){if(Xl(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,"__value")){const e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(qs.instancesCounter++,this._instanceCounter_=qs.instancesCounter),qs.instances.set(this._instanceCounter_,this),"<"+dr+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+dr+"-publisher-proxy>"}};qs.instances=new Map,qs.instancesCounter=0;let Rr=qs;const yi=[];function Xl(t){yi.length>0&&yi[0].add(t)}function No(){yi.unshift(new Set)}function Fo(){return yi.shift()}const Ie=class Ie{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],Ie.instance!=null)throw"Singleton / use getInstance";Ie.instance=this,this.isLocalStrorageReady=this.cleanStorageData(),Ie.initPageShowHandler()}static initPageShowHandler(){Ie.pageShowHandlerInitialized||(Ie.pageShowHandlerInitialized=!0,window.addEventListener("pageshow",e=>{e.persisted&&Ie.getInstance().invalidateAll()}))}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let i=localStorage.getItem(vn),r=null;if(i&&(r=await this.decompress(i,"gzip")),r)try{this.localStorageData=JSON.parse(r)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(vn,i),this.localStorageData={};const n=1e3*60*60*12;for(const o in this.localStorageData){const c=this.localStorageData[o],d=new Date().getTime()-(c.expirationDelayMs||n);c.lastModifiationMS<d&&delete this.localStorageData[o]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(e){if(e){const s=Ie.instances.get(e);return s||(console.warn("No PublisherManager instance registered with id:",e,"creating new one"),new Ie)}return Ie.instance==null?new Ie:Ie.instance}static get(e,s){return Ie.getInstance().get(e,s)}async setLocalData(e,s){await this.isLocalStrorageReady,e.set(this.localStorageData[s+"¤lang_"+Ue.getLanguage()]?.data||e.get())}get(e,s){const i=s?.localStorageMode==="enabled",r=s?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){const c=yn({});this.set(e,c)}const n=this.publishers.get(e);return i&&this.initialisedData.indexOf(e)===-1&&(s?.expirationDelayMs&&(n._expiration_delay_=s.expirationDelayMs),n._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(n,e)),r&&(n._invalidate_on_page_show_=r),this.publishers.get(e)}set(e,s){this.publishers.set(e,s)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(e=0){if(!(e!==Ie.saveId&&e%10!=0))try{if(!Ie.changed||Ie.saving)return;Ie.saving=!0,Ie.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const r of s){const n=this.publishers.get(r);if(!n?._is_savable_)continue;const o=n?.get();o&&(this.localStorageData[r+"¤lang_"+Ue.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:n._expiration_delay_,data:o},i=!0)}if(i){const r=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(vn,r)}if(Ie.saving=!1,Ie.changed){Ie.saveId++;const r=Ie.saveId;setTimeout(()=>this.saveToLocalStorage(r),1e3)}}catch{Ie.saving=!1}}async compress(e,s){const i=new TextEncoder().encode(e),r=window,n=new r.CompressionStream(s),o=n.writable.getWriter();o.write(i),o.close();const c=await new Response(n.readable).arrayBuffer(),d=new Uint8Array(c);let g="";for(let A=0;A<d.length;A++)g+=String.fromCharCode(d[A]);return btoa(g)}async decompress(e,s){const i=atob(e),n=Uint8Array.from(i,A=>A.charCodeAt(0)).buffer,o=window,c=new o.DecompressionStream(s),d=c.writable.getWriter();d.write(n),d.close();const g=await new Response(c.readable).arrayBuffer();return new TextDecoder().decode(g)}};Ie.buildDate="Mon Oct 26 2026 09:58:41 GMT+0100 (Central European Standard Time)",Ie.changed=!1,Ie.saving=!1,Ie.saveId=0,Ie.instance=null,Ie.instances=new Map,Ie.pageShowHandlerInitialized=!1;let ve=Ie;if(typeof window<"u"){const t=window;t[bi+"PublisherManager"]=t[bi+"PublisherManager"]||ve}const ec=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_","_invalidate_on_page_show_"]);function tc(t,e){return{get:function(s,i){if(typeof i=="string"&&ec.has(i))return t[i];if(i==Symbol.toPrimitive)return()=>e().get();if(!t._proxies_.has(i)){const r=t._value_[i],n=yn(ks(r)?r:{__value:r},t,i);n._proxies_.set("_parent_",e()),t._proxies_.set(i,n)}return t._proxies_.get(i)},set:function(s,i,r){if(i=="_value_")return t._value_=r,!0;if(i=="_cachedGet_")return t._cachedGet_=r,!0;if(i=="_assignmentId_")return t._assignmentId_=r,!0;if(i=="_is_savable_")return t._is_savable_=r,!0;if(i=="_expiration_delay_")return t._expiration_delay_=r,!0;if(i=="_invalidate_on_page_show_")return t._invalidate_on_page_show_=r,!0;if(i=="_instanceCounter_")return t._instanceCounter_=r,!0;if(!t._proxies_.has(i)){const o=yn({},t,i);o._proxies_.set("_parent_",e()),t._proxies_.set(i,o)}return t._value_[i]!==r&&(t._value_[i]=r,t._publishDynamicFilling_(i,r),t._proxies_.get(i)?.set(ks(r)?r:{__value:r})),!0},deleteProperty:function(s,i){return t._publishDynamicFilling_(i,null),t._proxies_.get(i)?.set(null),delete t._value_[i]},has:function(s,i){return i in t._value_&&i!="_lockInternalMutationPublishing_"},defineProperty:function(s,i,r){return r&&"value"in r&&(t._value_[i]=r.value),!0},getOwnPropertyDescriptor:function(s,i){return{enumerable:!0,configurable:!0}},ownKeys:function(s){return t._value_.__value?Object.keys(t._value_.__value):Object.keys(t._value_)}}}function yn(t,e=null,s){const i=new Rr(t,e,s);let r=null;const n=tc(i,()=>r);return r=new Proxy(i,n),r}class sc extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute("publisher")||"",this.publisher=Rr.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}}try{customElements.define(dr+"-publisher-proxy",sc)}catch{}const wi=(t,e)=>{if(typeof t=="function"){const s=t;return No(),s(),Fo()}if(typeof t=="string"){const s=t.split("."),i=s.shift()||"";let r=ve.get(i,e);r=ht.traverse(r,s);const n=new Set;return n.add(r),n}return new Set([t])};function rc(t){const e=gi(t);return wi(e).values().next().value?.get()}function _i(t,e,s){const i=gi(t);return wi(i,s).values().next().value}function ic(t,e){return Mo(e)?_i(t,void 0,e):_i(t)}function Si(t,e){return Mo(e)?_i(t,void 0,e):_i(t)}function nc(t,e){const s=gi(t);wi(s).values().next().value?.set(e)}let Pi=(Te=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(Te.observedElements.keys()).forEach(e=>Te.unObserve(e)))}static observe(e){if(!e||!Te.enabled||Te.observedElements.has(e))return;const s=new MutationObserver(Te.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(e,i),e.querySelectorAll("[data-bind]").forEach(r=>Te.addPublisherListeners(r)),Te.observedElements.set(e,s)}static unObserve(e){if(!e)return;const s=this.observedElements.get(e);s&&(s.disconnect(),e.querySelectorAll("[data-bind]").forEach(i=>Te.removePublisherListeners(i)))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&Te.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(s=>Te.addPublisherListeners(s)):e.childNodes.forEach(s=>Te.onAdded(s))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&Te.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(s=>Te.removePublisherListeners(s)):e.childNodes.forEach(s=>Te.onRemoved(s))}static onMutation(e){for(const s of e)switch(s.type){case"attributes":Te.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{Te.onAdded(i)}),s.removedNodes.forEach(i=>{Te.onRemoved(i)});break}}static removePublisherListeners(e){const s=Te.publisherListeners.get(e);s&&(Te.publisherListeners.delete(e),s.forEach(i=>{i.publisher?.offAssign(i.onAssign)}))}static getVariablesDescriptor(e){let s=e.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[e],s=s.filter(i=>i.length>0),{expression:e.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(r=>r.replace("\\","")))}}static getDataBindItems(e){return"attributes"in e?Array.from(e.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,r=>r.substring(1).toUpperCase()),bindedVariablesDescriptor:Te.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(e,s){if(!s)return e;for(const i of s)if(i!="_self_"){if(!e)return null;e=e[i]}return e}static addPublisherListeners(e){Te.removePublisherListeners(e);const s=Ue.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!s)return;const i=ve.getInstance().get(s),r=Te.getDataBindItems(e),n=[];r.forEach(o=>{const c=o.bindedVariablesDescriptor,d=o.propertyToUpdate;for(const g of c.variables){const A=g;let m=i;m=Te.getSubPublisher(i,A);const f=e,C={publisher:m,onAssign:()=>{const E=c.variables.map(B=>Te.getSubPublisher(i,B)?.get());let O=c.expression,U=!1;if(E.length==1&&c.variables[0].join(".")==O.substring(1)){let B=E[0];B===null&&(B=""),f[d]=B;return}for(let B=0;B<E.length;B++){let S=E[B];const y=c.variables[B];S===null&&(U=!0,S=void 0),O=O.replace("$"+y.join("."),S)}if(O.indexOf("|")!=-1){const B=O.indexOf("|");if(B==0)O=Fr.js(O.substring(1));else{const S=O.substring(0,B),y=O.substring(B+1),M=Fr[S];O=U?"":M?M(y):O}}else O=U?"":O;f[d]=O}};m?.onAssign(C.onAssign),n.push(C)}}),Te.publisherListeners.set(e,n)}},Te.observedElements=new Map,Te.enabled=!0,Te.publisherListeners=new Map,Te);Pi.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=Pi);/**
|
|
1
|
+
(function(Ue){typeof define=="function"&&define.amd?define(Ue):Ue()})((function(){"use strict";var Te,st;let Ue=class kt{static getLanguage(){const e=document.documentElement.lang;return localStorage.getItem("SonicSelectedLanguage")||e}static getCookies(){return document.cookie.split(";").reduce((e,s)=>{const i=s.indexOf("=");return e[s.substring(0,i).trim()]=s.substring(i+1),e},{})}static nextComposedAncestor(e){return e instanceof Element&&e.assignedSlot?e.assignedSlot:e.parentNode||e.host||null}static everyAncestors(e,s){for(;e;){if(!s(e))return;e=e.parentNode||e.host}}static overflowMatches(e,s){return s.includes(e.overflowY)||s.includes(e.overflowX)}static findAncestorByOverflow(e,s){let i=e;for(;i;){if(i instanceof Element&&i.nodeType===1){const r=window.getComputedStyle(i);if(kt.overflowMatches(r,s))return i}i=kt.nextComposedAncestor(i)}return null}static getScrollableAncestor(e){return kt.findAncestorByOverflow(e,["auto","scroll","hidden","overlay"])}static getScrollingAncestor(e){return kt.findAncestorByOverflow(e,["auto","scroll","overlay"])}static scopeAttributeNames(e){const s=e.toLowerCase();return s===e?[e]:[e,s]}static readScopeAttributeOnElement(e,s){for(const i of kt.scopeAttributeNames(s))if(e.hasAttribute(i))return e.getAttribute(i)??"";return null}static getAncestorAttributeValue(e,s){if(!e)return null;let i=e;for(;i;){if(i instanceof HTMLElement){const n=kt.readScopeAttributeOnElement(i,s);if(n!=null)return n}const r=i.parentNode||i.host;if(!r)break;i=r}return null}static getApiConfiguration(e){const s=kt.getAncestorAttributeValue(e,"token"),i=kt.getAncestorAttributeValue(e,"addHTTPResponse")!=null,r=kt.getAncestorAttributeValue(e,"serviceURL");let n=null,o=null;const c=kt.getAncestorAttributeValue(e,"tokenProvider"),d=kt.getAncestorAttributeValue(e,"eventsApiToken");s||(n=kt.getAncestorAttributeValue(e,"userName"),o=kt.getAncestorAttributeValue(e,"password"));const b=kt.getAncestorAttributeValue(e,"credentials")||void 0,A=e.getAttribute("cache"),m=e.hasAttribute("blockUntilDone"),f=e.hasAttribute("keepAlive");return{serviceURL:r,token:s,userName:n,password:o,authToken:d,tokenProvider:c,addHTTPResponse:i,credentials:b,cache:A,blockUntilDone:m,keepAlive:f}}static getClosestElement(e,s){for(;!(e.nodeName&&e.nodeName.toLowerCase()===s)&&(e.parentNode||e.host);)e=e.parentNode||e.host;return e.nodeName?e:null}static getClosestForm(e){return kt.getClosestElement(e,"form")}static getAncestorsByTagNames(e,s){const i=new Set(s.map(o=>o.toLowerCase())),r=[];let n=e.parentNode||e.host;for(;n;)n instanceof Element&&i.has(n.tagName.toLowerCase())&&r.push(n),n=n.parentNode||n.host;return r}static getAncestorsBySelectors(e,s){const i=[];let r=e.parentNode||e.host;for(;r;){if(r instanceof Element)for(const n of s)try{if(r.matches(n)){i.push(r);break}}catch{}r=r.parentNode||r.host}return i}static async loadJS(e){return new Promise(async i=>{const r=document.createElement("script");r.src=e,r.onload=()=>i(!0),r.onerror=()=>i(!0),document.head.appendChild(r)})}static async loadCSS(e){return new Promise(async i=>{const r=document.createElement("link");r.type="text/css",r.rel="stylesheet",r.href=e,r.onload=()=>i(!0),r.onerror=()=>i(!0),document.head.appendChild(r)})}};const bn=t=>{const e=document.documentElement,s=new MutationObserver(r=>{for(let n of r)n.type==="attributes"&&n.attributeName==="lang"&&t()}),i={attributes:!0,attributeFilter:["lang"]};s.observe(e,i)};let Fr=class{static ucFirst(e){return typeof e!="string"?e:e.charAt(0).toUpperCase()+e.substring(1)}static minutesDuration(e,s="",i="long"){s||(s=Ue.getLanguage());const r=(b,A)=>[Math.floor(b/A),b%A];function n(b,A,m){return new Intl.NumberFormat(b,{style:"unit",unit:A,unitDisplay:m}).format}const[o,c]=r(e,60),d=[];return o&&d.push(n(s,"hour",i)(o)),c&&d.push(n(s,"minute",i)(c)),new Intl.ListFormat(s,{style:"long",type:"conjunction"}).format(d)}static js(e){try{return Function("return "+e)()}catch{return""}}};class Oo{constructor(e){this.path=e}toString(){return this.path}}function To(t){return new Proxy(t,{get(e,s){if(s==="path")return e.path;if(s==="toString")return e.toString.bind(e);if(s===Symbol.toStringTag)return"DataProviderKey";if(typeof s=="symbol")return e[s];const i=e.path?`${e.path}.${String(s)}`:String(s);return To(new Oo(i))}})}const Yl=/\$\{|\{\$/;function Zl(t){return Yl.test(t)}function gi(t){const e=typeof t=="string"?t:t.path;if(Zl(e))throw new Error("Static publisher path required for get/set/dp. Use @subscribe, @publish, or @handle for dynamic DataProviderKey paths.");return e}const Cs=function(t){return this instanceof Cs?To(new Oo(t)):new Cs(t)};let ht=class As{static shallowEqual(e,s,i=!0){const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length&&i)return!1;for(const o of r){const c=e[o],d=s[o];if(i?c!==d:c!=d)return!1}return!0}static deepEqual(e,s,i=!0){const r=Object.keys(e),n=Object.keys(s);if(r.length!==n.length&&i)return!1;for(const o of r){const c=e[o],d=s[o],b=As.isObject(c)&&As.isObject(d),A=i?c!==d:c!=d;if(b&&!As.deepEqual(c,d)||!b&&A)return!1}return!0}static isObject(e){return e!=null&&typeof e=="object"}static isUndefindOrNull(e){return e==null}static isEmpty(e){return As.isUndefindOrNull(e)?!0:Object.keys(e).length===0}static traverse(e,s,i=!1){for(const r of s){const n=e[r];if(n===void 0)return;i&&As.isObject(n)?e=Object.assign(Array.isArray(n)?[]:{},e,n):e=e[r]}return e}static traverseDotNotation(e,s,i=!1){return As.traverse(e,s.split("."),i)}static getURLSearchArray(e,s=""){let i=[];for(let r in e){const n=e[r];s&&(r=s+"["+r+"]"),As.isObject(n)?i=[...i,...this.getURLSearchArray(n,r)]:i.push(`${r}=${n}`)}return i}static getURLSearchString(e){return As.getURLSearchArray(e,"").join("&")}};const Bt=ht.traverseDotNotation;let Jl=class{static async queueTaskPromise(){return new Promise(e=>{window.queueMicrotask(()=>e(null))})}static async delayPromise(e){return new Promise(s=>{setTimeout(s,e)})}},Lo="sonic";typeof __SONIC_PREFIX__<"u"&&(Lo=__SONIC_PREFIX__);let Io=Lo.replace(/-([a-z])/g,t=>t[1].toUpperCase());const bi=Io.charAt(0).toUpperCase()+Io.slice(1),Ql=new Set(["localStorageMode","expirationDelayMs","invalidateOnPageShow"]);function Mo(t){return t==null||typeof t!="object"||Array.isArray(t)?!1:Object.keys(t).some(e=>Ql.has(e))}function vi(t){return Object.prototype.hasOwnProperty.call(t,"__value")}function ks(t){return typeof t=="object"&&t!==null}let dr="sonic";typeof __SONIC_PREFIX__>"u"&&(dr="sonic");const vn=dr=="sonic"?"publisher-proxies-data":dr+"-publisher-proxies-data",qs=class qs{constructor(e,s,i){for(this._proxies_=new Map,this._is_savable_=!1,this._expiration_delay_=1e3*60*60*12,this._invalidate_on_page_show_=!1,this._invalidateListeners_=new Set,this._formInvalidateListeners_=new Set,this._assignListeners_=new Set,this._mutationListeners_=new Set,this._fillListeners_=new Set,this._templateFillListeners_=new Set,this._lockInternalMutationPublishing_=!1,this._instanceCounter_=0,this._assignmentId_=0,this._value_=e,this.parent=s||null,this._parentKey_=i,this.root=this,this._instanceCounter_=0;this.root.parent;)this.root=this.root.parent}delete(){for(const e in this._proxies_.keys())e!="_parent_"&&this._proxies_.get(e)?.delete();this._invalidateListeners_.clear(),this._formInvalidateListeners_.clear(),this._assignListeners_.clear(),this._mutationListeners_.clear(),this._fillListeners_.clear(),this._templateFillListeners_.clear(),this._proxies_.clear(),qs.instances.delete(this._instanceCounter_)}hasListener(){return this._templateFillListeners_.size>0||this._assignListeners_.size>0||this._invalidateListeners_.size>0||this._formInvalidateListeners_.size>0||this._mutationListeners_.size>0||this._fillListeners_.size>0}_publishInternalMutation_(e=!1){if(this._mutationListeners_.forEach(s=>s()),this._is_savable_&&!ve.changed){ve.changed=!0,ve.saveId++;const s=ve.saveId;setTimeout(()=>ve.getInstance().saveToLocalStorage(s),1e3)}e||this.parent&&this.parent._publishInternalMutation_()}async _publishAssignement_(e=!1){if(this._assignmentId_++,this._assignmentId_!==this._assignmentId_)return;const i=this.get();this._assignListeners_.forEach(r=>{r(i)}),this._publishInternalMutation_(e)}_publishInvalidation_(){this._invalidateListeners_.forEach(e=>e())}_publishFormInvalidation_(){this._formInvalidateListeners_.forEach(e=>e())}_publishDynamicFilling_(e,s){this._fillListeners_.forEach(i=>{i[e]!==s&&(i[e]=s)}),this._publishTemplateFilling_(e,s)}_publishTemplateFilling_(e,s){this._templateFillListeners_.forEach(i=>{const r=Object.getOwnPropertyDescriptor(i,e);r&&!r.set&&!r.writable||(i.propertyMap&&i.propertyMap[e]&&(e=i.propertyMap[e]),typeof i[e]<"u"&&i[e]!==s&&(i[e]=s))})}onAssign(e,s=!0){typeof e=="function"&&(this._assignListeners_.has(e)||(this._assignListeners_.add(e),s&&e(this.get())))}offAssign(e){this._assignListeners_.delete(e)}onInvalidate(e){typeof e=="function"&&this._invalidateListeners_.add(e)}offInvalidate(e){typeof e=="function"&&this._invalidateListeners_.delete(e)}invalidate(){this._publishInvalidation_()}onFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.add(e)}offFormInvalidate(e){typeof e=="function"&&this._formInvalidateListeners_.delete(e)}invalidateForm(){this._publishFormInvalidation_()}onInternalMutation(e){typeof e=="function"&&(this._mutationListeners_.add(e),e())}offInternalMutation(e){typeof e=="function"&&this._mutationListeners_.delete(e)}startTemplateFilling(e){if(this._templateFillListeners_.add(e),typeof this._value_=="object")for(const s in this._value_){let i=s;const r=this._value_[s];e.propertyMap&&e.propertyMap[s]&&(i=e.propertyMap[s]),typeof e[s]<"u"&&e[s]!==r&&(e[i]=r)}}stopTemplateFilling(e){this._templateFillListeners_.delete(e)}startDynamicFilling(e){this._fillListeners_.add(e);for(const s in this._value_){const i=this._value_[s];e[s]!==i&&(e[s]=i)}}stopDynamicFilling(e){this._fillListeners_.delete(e)}set(e,s=!1){if(this._value_===e||ks(this._value_)&&ks(e)&&e&&vi(this._value_)&&vi(e)&&this._value_.__value===e.__value||!ks(e)&&e===this._value_.__value)return!0;this._value_=ks(e)?e:{__value:e},this._cachedGet_=void 0;const i=vi(this._value_);if(this._parentKey_&&this.parent){const r=vi(this._value_)?this._value_.__value:this._value_;if(this.parent?.get()==null&&this.parent?.get()==null)if(isNaN(Number(this._parentKey_)))this.parent.set({[this._parentKey_]:r});else{const n=[];n[Number(this._parentKey_)]=r,this.parent.set(n)}else this.parent._value_[this._parentKey_]=r}if(i)return this._proxies_.forEach((r,n)=>{n!="_parent_"&&(r.set(null),this._publishDynamicFilling_(n,null))}),this._publishAssignement_(s),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_.__value),!0;for(const r in this._value_)this._value_[r]===void 0&&delete this._value_[r];if(this._proxies_.forEach((r,n)=>{const o=this._value_[n];n!="_parent_"&&o===void 0&&o!==null&&isNaN(Number(n))&&(r.set(null),this._publishDynamicFilling_(n,null))}),this._publishAssignement_(),this.parent&&this._parentKey_&&this.parent._publishDynamicFilling_(this._parentKey_,this._value_),ks(this._value_))for(const r in this._value_){const n=e[r],c=ks(n)?n:{__value:n};if(!this._proxies_.has(r)){this._publishDynamicFilling_(r,n);continue}this._proxies_.get(r)?.set(c,!0),this._publishDynamicFilling_(r,n)}return!0}get(){if(Xl(this),this._cachedGet_!==void 0)return this._cachedGet_;if(Object.prototype.hasOwnProperty.call(this._value_,"__value")){const e=this._value_.__value;return this._cachedGet_=e??null}return this._cachedGet_=this._value_!=null?this._value_:null}get $tag(){return this._instanceCounter_||(qs.instancesCounter++,this._instanceCounter_=qs.instancesCounter),qs.instances.set(this._instanceCounter_,this),"<"+dr+'-publisher-proxy publisher="'+this._instanceCounter_+'"></'+dr+"-publisher-proxy>"}};qs.instances=new Map,qs.instancesCounter=0;let Rr=qs;const yi=[];function Xl(t){yi.length>0&&yi[0].add(t)}function No(){yi.unshift(new Set)}function Fo(){return yi.shift()}const Ie=class Ie{constructor(){if(this.enabledLocaStorageProxies=[],this.publishers=new Map,this.localStorageData={},this.isLocalStrorageReady=null,this.initialisedData=[],Ie.instance!=null)throw"Singleton / use getInstance";Ie.instance=this,this.isLocalStrorageReady=this.cleanStorageData(),Ie.initPageShowHandler()}static initPageShowHandler(){Ie.pageShowHandlerInitialized||(Ie.pageShowHandlerInitialized=!0,window.addEventListener("pageshow",e=>{e.persisted&&Ie.getInstance().invalidateAll()}))}invalidateAll(){this.publishers.forEach(e=>{e._invalidate_on_page_show_&&e.invalidate()})}async cleanStorageData(){return new Promise(e=>{(async()=>{try{let i=localStorage.getItem(vn),r=null;if(i&&(r=await this.decompress(i,"gzip")),r)try{this.localStorageData=JSON.parse(r)}catch{this.localStorageData={}}else i=await this.compress("{}","gzip"),localStorage.setItem(vn,i),this.localStorageData={};const n=1e3*60*60*12;for(const o in this.localStorageData){const c=this.localStorageData[o],d=new Date().getTime()-(c.expirationDelayMs||n);c.lastModifiationMS<d&&delete this.localStorageData[o]}e(!0)}catch{window.requestAnimationFrame(()=>{e(!1)}),console.warn("no publisher cache in this browser")}})()})}static getInstance(e){if(e){const s=Ie.instances.get(e);return s||(console.warn("No PublisherManager instance registered with id:",e,"creating new one"),new Ie)}return Ie.instance==null?new Ie:Ie.instance}static get(e,s){return Ie.getInstance().get(e,s)}async setLocalData(e,s){await this.isLocalStrorageReady,e.set(this.localStorageData[s+"¤lang_"+Ue.getLanguage()]?.data||e.get())}get(e,s){const i=s?.localStorageMode==="enabled",r=s?.invalidateOnPageShow===!0;if(!this.publishers.has(e)){const c=yn({});this.set(e,c)}const n=this.publishers.get(e);return i&&this.initialisedData.indexOf(e)===-1&&(s?.expirationDelayMs&&(n._expiration_delay_=s.expirationDelayMs),n._is_savable_=!0,this.initialisedData.push(e),this.setLocalData(n,e)),r&&(n._invalidate_on_page_show_=r),this.publishers.get(e)}set(e,s){this.publishers.set(e,s)}delete(e){return this.publishers.has(e)?(this.publishers.delete(e),!0):!1}async saveToLocalStorage(e=0){if(!(e!==Ie.saveId&&e%10!=0))try{if(!Ie.changed||Ie.saving)return;Ie.saving=!0,Ie.changed=!1;const s=Array.from(this.publishers.keys());let i=!1;for(const r of s){const n=this.publishers.get(r);if(!n?._is_savable_)continue;const o=n?.get();o&&(this.localStorageData[r+"¤lang_"+Ue.getLanguage()]={lastModifiationMS:new Date().getTime(),expirationDelayMs:n._expiration_delay_,data:o},i=!0)}if(i){const r=await this.compress(JSON.stringify(this.localStorageData),"gzip");localStorage.setItem(vn,r)}if(Ie.saving=!1,Ie.changed){Ie.saveId++;const r=Ie.saveId;setTimeout(()=>this.saveToLocalStorage(r),1e3)}}catch{Ie.saving=!1}}async compress(e,s){const i=new TextEncoder().encode(e),r=window,n=new r.CompressionStream(s),o=n.writable.getWriter();o.write(i),o.close();const c=await new Response(n.readable).arrayBuffer(),d=new Uint8Array(c);let b="";for(let A=0;A<d.length;A++)b+=String.fromCharCode(d[A]);return btoa(b)}async decompress(e,s){const i=atob(e),n=Uint8Array.from(i,A=>A.charCodeAt(0)).buffer,o=window,c=new o.DecompressionStream(s),d=c.writable.getWriter();d.write(n),d.close();const b=await new Response(c.readable).arrayBuffer();return new TextDecoder().decode(b)}};Ie.buildDate="Tue Oct 27 2026 10:09:17 GMT+0100 (Central European Standard Time)",Ie.changed=!1,Ie.saving=!1,Ie.saveId=0,Ie.instance=null,Ie.instances=new Map,Ie.pageShowHandlerInitialized=!1;let ve=Ie;if(typeof window<"u"){const t=window;t[bi+"PublisherManager"]=t[bi+"PublisherManager"]||ve}const ec=new Set(["invalidate","onInvalidate","offInvalidate","invalidateForm","onFormInvalidate","offFormInvalidate","onAssign","offAssign","startDynamicFilling","stopDynamicFilling","startTemplateFilling","stopTemplateFilling","onInternalMutation","offInternalMutation","set","get","$tag","_cachedGet_","_templateFillListeners_","_fillListeners_","_assignListeners_","_invalidateListeners_","_formInvalidateListeners_","_publishInternalMutation_","hasListener","delete","_mutationListeners_","_publishDynamicFilling_","_publishInvalidation_","_publishFormInvalidation_","_publishTemplateFilling_","_publishAssignement_","_proxies_","parent","_parentKey_","_value_","_is_savable_","_expiration_delay_","_lockInternalMutationPublishing_","_instanceCounter_","_assignmentId_","_invalidate_on_page_show_"]);function tc(t,e){return{get:function(s,i){if(typeof i=="string"&&ec.has(i))return t[i];if(i==Symbol.toPrimitive)return()=>e().get();if(!t._proxies_.has(i)){const r=t._value_[i],n=yn(ks(r)?r:{__value:r},t,i);n._proxies_.set("_parent_",e()),t._proxies_.set(i,n)}return t._proxies_.get(i)},set:function(s,i,r){if(i=="_value_")return t._value_=r,!0;if(i=="_cachedGet_")return t._cachedGet_=r,!0;if(i=="_assignmentId_")return t._assignmentId_=r,!0;if(i=="_is_savable_")return t._is_savable_=r,!0;if(i=="_expiration_delay_")return t._expiration_delay_=r,!0;if(i=="_invalidate_on_page_show_")return t._invalidate_on_page_show_=r,!0;if(i=="_instanceCounter_")return t._instanceCounter_=r,!0;if(!t._proxies_.has(i)){const o=yn({},t,i);o._proxies_.set("_parent_",e()),t._proxies_.set(i,o)}return t._value_[i]!==r&&(t._value_[i]=r,t._publishDynamicFilling_(i,r),t._proxies_.get(i)?.set(ks(r)?r:{__value:r})),!0},deleteProperty:function(s,i){return t._publishDynamicFilling_(i,null),t._proxies_.get(i)?.set(null),delete t._value_[i]},has:function(s,i){return i in t._value_&&i!="_lockInternalMutationPublishing_"},defineProperty:function(s,i,r){return r&&"value"in r&&(t._value_[i]=r.value),!0},getOwnPropertyDescriptor:function(s,i){return{enumerable:!0,configurable:!0}},ownKeys:function(s){return t._value_.__value?Object.keys(t._value_.__value):Object.keys(t._value_)}}}function yn(t,e=null,s){const i=new Rr(t,e,s);let r=null;const n=tc(i,()=>r);return r=new Proxy(i,n),r}class sc extends HTMLElement{constructor(){super(),this.publisherId="",this.onAssign=e=>{this.innerHTML=e.toString()}}connectedCallback(){this.publisherId=this.getAttribute("publisher")||"",this.publisher=Rr.instances.get(parseInt(this.publisherId)),this.publisher?.onAssign(this.onAssign)}disconnectedCallback(){this.publisher?.offAssign(this.onAssign)}}try{customElements.define(dr+"-publisher-proxy",sc)}catch{}const wi=(t,e)=>{if(typeof t=="function"){const s=t;return No(),s(),Fo()}if(typeof t=="string"){const s=t.split("."),i=s.shift()||"";let r=ve.get(i,e);r=ht.traverse(r,s);const n=new Set;return n.add(r),n}return new Set([t])};function rc(t){const e=gi(t);return wi(e).values().next().value?.get()}function _i(t,e,s){const i=gi(t);return wi(i,s).values().next().value}function ic(t,e){return Mo(e)?_i(t,void 0,e):_i(t)}function Si(t,e){return Mo(e)?_i(t,void 0,e):_i(t)}function nc(t,e){const s=gi(t);wi(s).values().next().value?.set(e)}let Pi=(Te=class{static disable(){this.enabled&&(this.enabled=!1,Array.from(Te.observedElements.keys()).forEach(e=>Te.unObserve(e)))}static observe(e){if(!e||!Te.enabled||Te.observedElements.has(e))return;const s=new MutationObserver(Te.onMutation),i={};i.childList=!0,i.subtree=!0,i.attributes=!0,i.attributeFilter=["data-bind"],s.observe(e,i),e.querySelectorAll("[data-bind]").forEach(r=>Te.addPublisherListeners(r)),Te.observedElements.set(e,s)}static unObserve(e){if(!e)return;const s=this.observedElements.get(e);s&&(s.disconnect(),e.querySelectorAll("[data-bind]").forEach(i=>Te.removePublisherListeners(i)))}static onAdded(e){e.hasAttribute&&e.hasAttribute("data-bind")&&Te.addPublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(s=>Te.addPublisherListeners(s)):e.childNodes.forEach(s=>Te.onAdded(s))}static onRemoved(e){e.hasAttribute&&e.hasAttribute("data-bind")&&Te.removePublisherListeners(e),e.querySelectorAll?e.querySelectorAll("[data-bind]").forEach(s=>Te.removePublisherListeners(s)):e.childNodes.forEach(s=>Te.onRemoved(s))}static onMutation(e){for(const s of e)switch(s.type){case"attributes":Te.addPublisherListeners(s.target);break;case"childList":s.addedNodes.forEach(i=>{Te.onAdded(i)}),s.removedNodes.forEach(i=>{Te.onRemoved(i)});break}}static removePublisherListeners(e){const s=Te.publisherListeners.get(e);s&&(Te.publisherListeners.delete(e),s.forEach(i=>{i.publisher?.offAssign(i.onAssign)}))}static getVariablesDescriptor(e){let s=e.match(/(\$(?:\w+\\?\.?)+)/g);return s?s=s.map(i=>i.replace("$","")):s=[e],s=s.filter(i=>i.length>0),{expression:e.replace("\\",""),variables:s.map(i=>i.split(/\b\.\b/).map(r=>r.replace("\\","")))}}static getDataBindItems(e){return"attributes"in e?Array.from(e.attributes).filter(s=>s.name.indexOf("::")==0).map(s=>({propertyToUpdate:s.name.substring(2).replace(/-((html)|\w)/g,r=>r.substring(1).toUpperCase()),bindedVariablesDescriptor:Te.getVariablesDescriptor(s.value)})):[]}static getSubPublisher(e,s){if(!s)return e;for(const i of s)if(i!="_self_"){if(!e)return null;e=e[i]}return e}static addPublisherListeners(e){Te.removePublisherListeners(e);const s=Ue.getAncestorAttributeValue(e.parentNode||e.host||e,"dataProvider");if(!s)return;const i=ve.getInstance().get(s),r=Te.getDataBindItems(e),n=[];r.forEach(o=>{const c=o.bindedVariablesDescriptor,d=o.propertyToUpdate;for(const b of c.variables){const A=b;let m=i;m=Te.getSubPublisher(i,A);const f=e,C={publisher:m,onAssign:()=>{const E=c.variables.map(B=>Te.getSubPublisher(i,B)?.get());let T=c.expression,U=!1;if(E.length==1&&c.variables[0].join(".")==T.substring(1)){let B=E[0];B===null&&(B=""),f[d]=B;return}for(let B=0;B<E.length;B++){let x=E[B];const y=c.variables[B];x===null&&(U=!0,x=void 0),T=T.replace("$"+y.join("."),x)}if(T.indexOf("|")!=-1){const B=T.indexOf("|");if(B==0)T=Fr.js(T.substring(1));else{const x=T.substring(0,B),y=T.substring(B+1),M=Fr[x];T=U?"":M?M(y):T}}else T=U?"":T;f[d]=T}};m?.onAssign(C.onAssign),n.push(C)}}),Te.publisherListeners.set(e,n)}},Te.observedElements=new Map,Te.enabled=!0,Te.publisherListeners=new Map,Te);Pi.observe(document.documentElement),window.SonicDataBindObserver||(window.SonicDataBindObserver=Pi);/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2017 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
41
|
*/const An=globalThis,ki=An.trustedTypes,qo=ki?ki.createPolicy("lit-html",{createHTML:t=>t}):void 0,Bo="$lit$",Ds=`lit$${Math.random().toFixed(9).slice(2)}$`,Ho="?"+Ds,vc=`<${Ho}>`,Vs=document,zr=()=>Vs.createComment(""),qr=t=>t===null||typeof t!="object"&&typeof t!="function",Cn=Array.isArray,yc=t=>Cn(t)||typeof t?.[Symbol.iterator]=="function",kn=`[
|
|
42
42
|
\f\r]`,Br=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vo=/-->/g,Wo=/>/g,Ws=RegExp(`>|${kn}(?:([^\\s"'>=/]+)(${kn}*=${kn}*(?:[^
|
|
43
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ko=/'/g,Go=/"/g,Yo=/^(?:script|style|textarea|title)$/i,wc=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=wc(1),jt=Symbol.for("lit-noChange"),ee=Symbol.for("lit-nothing"),Zo=new WeakMap,Ks=Vs.createTreeWalker(Vs,129);function Jo(t,e){if(!Cn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return qo!==void 0?qo.createHTML(e):e}const _c=(t,e)=>{const s=t.length-1,i=[];let r,n=e===2?"<svg>":e===3?"<math>":"",o=Br;for(let c=0;c<s;c++){const d=t[c];let
|
|
43
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ko=/'/g,Go=/"/g,Yo=/^(?:script|style|textarea|title)$/i,wc=t=>(e,...s)=>({_$litType$:t,strings:e,values:s}),R=wc(1),jt=Symbol.for("lit-noChange"),ee=Symbol.for("lit-nothing"),Zo=new WeakMap,Ks=Vs.createTreeWalker(Vs,129);function Jo(t,e){if(!Cn(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return qo!==void 0?qo.createHTML(e):e}const _c=(t,e)=>{const s=t.length-1,i=[];let r,n=e===2?"<svg>":e===3?"<math>":"",o=Br;for(let c=0;c<s;c++){const d=t[c];let b,A,m=-1,f=0;for(;f<d.length&&(o.lastIndex=f,A=o.exec(d),A!==null);)f=o.lastIndex,o===Br?A[1]==="!--"?o=Vo:A[1]!==void 0?o=Wo:A[2]!==void 0?(Yo.test(A[2])&&(r=RegExp("</"+A[2],"g")),o=Ws):A[3]!==void 0&&(o=Ws):o===Ws?A[0]===">"?(o=r??Br,m=-1):A[1]===void 0?m=-2:(m=o.lastIndex-A[2].length,b=A[1],o=A[3]===void 0?Ws:A[3]==='"'?Go:Ko):o===Go||o===Ko?o=Ws:o===Vo||o===Wo?o=Br:(o=Ws,r=void 0);const C=o===Ws&&t[c+1].startsWith("/>")?" ":"";n+=o===Br?d+vc:m>=0?(i.push(b),d.slice(0,m)+Bo+d.slice(m)+Ds+C):d+Ds+(m===-2?c:C)}return[Jo(t,n+(t[s]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),i]};let $n=class Gl{constructor({strings:e,_$litType$:s},i){let r;this.parts=[];let n=0,o=0;const c=e.length-1,d=this.parts,[b,A]=_c(e,s);if(this.el=Gl.createElement(b,i),Ks.currentNode=this.el.content,s===2||s===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(r=Ks.nextNode())!==null&&d.length<c;){if(r.nodeType===1){if(r.hasAttributes())for(const m of r.getAttributeNames())if(m.endsWith(Bo)){const f=A[o++],C=r.getAttribute(m).split(Ds),E=/([.?@])?(.*)/.exec(f);d.push({type:1,index:n,name:E[2],strings:C,ctor:E[1]==="."?Pc:E[1]==="?"?xc:E[1]==="@"?Ac:$i}),r.removeAttribute(m)}else m.startsWith(Ds)&&(d.push({type:6,index:n}),r.removeAttribute(m));if(Yo.test(r.tagName)){const m=r.textContent.split(Ds),f=m.length-1;if(f>0){r.textContent=ki?ki.emptyScript:"";for(let C=0;C<f;C++)r.append(m[C],zr()),Ks.nextNode(),d.push({type:2,index:++n});r.append(m[f],zr())}}}else if(r.nodeType===8)if(r.data===Ho)d.push({type:2,index:n});else{let m=-1;for(;(m=r.data.indexOf(Ds,m+1))!==-1;)d.push({type:7,index:n}),m+=Ds.length-1}n++}}static createElement(e,s){const i=Vs.createElement("template");return i.innerHTML=e,i}};function fr(t,e,s=t,i){if(e===jt)return e;let r=i!==void 0?s._$Co?.[i]:s._$Cl;const n=qr(e)?void 0:e._$litDirective$;return r?.constructor!==n&&(r?._$AO?.(!1),n===void 0?r=void 0:(r=new n(t),r._$AT(t,s,i)),i!==void 0?(s._$Co??=[])[i]=r:s._$Cl=r),r!==void 0&&(e=fr(t,r._$AS(t,e.values),r,i)),e}let Sc=class{constructor(e,s){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=s}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:s},parts:i}=this._$AD,r=(e?.creationScope??Vs).importNode(s,!0);Ks.currentNode=r;let n=Ks.nextNode(),o=0,c=0,d=i[0];for(;d!==void 0;){if(o===d.index){let b;d.type===2?b=new mr(n,n.nextSibling,this,e):d.type===1?b=new d.ctor(n,d.name,d.strings,this,e):d.type===6&&(b=new Cc(n,this,e)),this._$AV.push(b),d=i[++c]}o!==d?.index&&(n=Ks.nextNode(),o++)}return Ks.currentNode=Vs,r}p(e){let s=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,s),s+=i.strings.length-2):i._$AI(e[s])),s++}};class mr{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,s,i,r){this.type=2,this._$AH=ee,this._$AN=void 0,this._$AA=e,this._$AB=s,this._$AM=i,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const s=this._$AM;return s!==void 0&&e?.nodeType===11&&(e=s.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,s=this){e=fr(this,e,s),qr(e)?e===ee||e==null||e===""?(this._$AH!==ee&&this._$AR(),this._$AH=ee):e!==this._$AH&&e!==jt&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):yc(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ee&&qr(this._$AH)?this._$AA.nextSibling.data=e:this.T(Vs.createTextNode(e)),this._$AH=e}$(e){const{values:s,_$litType$:i}=e,r=typeof i=="number"?this._$AC(e):(i.el===void 0&&(i.el=$n.createElement(Jo(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===r)this._$AH.p(s);else{const n=new Sc(r,this),o=n.u(this.options);n.p(s),this.T(o),this._$AH=n}}_$AC(e){let s=Zo.get(e.strings);return s===void 0&&Zo.set(e.strings,s=new $n(e)),s}k(e){Cn(this._$AH)||(this._$AH=[],this._$AR());const s=this._$AH;let i,r=0;for(const n of e)r===s.length?s.push(i=new mr(this.O(zr()),this.O(zr()),this,this.options)):i=s[r],i._$AI(n),r++;r<s.length&&(this._$AR(i&&i._$AB.nextSibling,r),s.length=r)}_$AR(e=this._$AA.nextSibling,s){for(this._$AP?.(!1,!0,s);e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}}class $i{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,s,i,r,n){this.type=1,this._$AH=ee,this._$AN=void 0,this.element=e,this.name=s,this._$AM=r,this.options=n,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=ee}_$AI(e,s=this,i,r){const n=this.strings;let o=!1;if(n===void 0)e=fr(this,e,s,0),o=!qr(e)||e!==this._$AH&&e!==jt,o&&(this._$AH=e);else{const c=e;let d,b;for(e=n[0],d=0;d<n.length-1;d++)b=fr(this,c[i+d],s,d),b===jt&&(b=this._$AH[d]),o||=!qr(b)||b!==this._$AH[d],b===ee?e=ee:e!==ee&&(e+=(b??"")+n[d+1]),this._$AH[d]=b}o&&!r&&this.j(e)}j(e){e===ee?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Pc extends $i{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ee?void 0:e}}class xc extends $i{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ee)}}class Ac extends $i{constructor(e,s,i,r,n){super(e,s,i,r,n),this.type=5}_$AI(e,s=this){if((e=fr(this,e,s,0)??ee)===jt)return;const i=this._$AH,r=e===ee&&i!==ee||e.capture!==i.capture||e.once!==i.once||e.passive!==i.passive,n=e!==ee&&(i===ee||r);r&&this.element.removeEventListener(this.name,this,i),n&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class Cc{constructor(e,s,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=s,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){fr(this,e)}}const kc={I:mr},$c=An.litHtmlPolyfillSupport;$c?.($n,mr),(An.litHtmlVersions??=[]).push("3.3.1");const Dc=(t,e,s)=>{const i=s?.renderBefore??e;let r=i._$litPart$;if(r===void 0){const n=s?.renderBefore??null;i._$litPart$=r=new mr(e.insertBefore(zr(),n),n,void 0,s??{})}return r._$AI(t),r};/**
|
|
44
44
|
* @license
|
|
45
45
|
* Copyright 2020 Google LLC
|
|
46
46
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
-
*/const{I:Ec}=kc,Oc=t=>t.strings===void 0,Qo=()=>document.createComment(""),Hr=(t,e,s)=>{const i=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const n=i.insertBefore(Qo(),r),o=i.insertBefore(Qo(),r);s=new Ec(n,o,t,t.options)}else{const n=s._$AB.nextSibling,o=s._$AM,c=o!==t;if(c){let d;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(d=t._$AU)!==o._$AU&&s._$AP(d)}if(n!==r||c){let d=s._$AA;for(;d!==n;){const
|
|
47
|
+
*/const{I:Ec}=kc,Oc=t=>t.strings===void 0,Qo=()=>document.createComment(""),Hr=(t,e,s)=>{const i=t._$AA.parentNode,r=e===void 0?t._$AB:e._$AA;if(s===void 0){const n=i.insertBefore(Qo(),r),o=i.insertBefore(Qo(),r);s=new Ec(n,o,t,t.options)}else{const n=s._$AB.nextSibling,o=s._$AM,c=o!==t;if(c){let d;s._$AQ?.(t),s._$AM=t,s._$AP!==void 0&&(d=t._$AU)!==o._$AU&&s._$AP(d)}if(n!==r||c){let d=s._$AA;for(;d!==n;){const b=d.nextSibling;i.insertBefore(d,r),d=b}}}return s},Gs=(t,e,s=t)=>(t._$AI(e,s),t),Tc={},Lc=(t,e=Tc)=>t._$AH=e,Ic=t=>t._$AH,Dn=t=>{t._$AR(),t._$AA.remove()};/**
|
|
48
48
|
* @license
|
|
49
49
|
* Copyright 2017 Google LLC
|
|
50
50
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -56,23 +56,23 @@
|
|
|
56
56
|
* @license
|
|
57
57
|
* Copyright 2017 Google LLC
|
|
58
58
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
59
|
-
*/const On=globalThis;let Q=class extends pr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dc(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return jt}};Q._$litElement$=!0,Q.finalized=!0,On.litElementHydrateSupport?.({LitElement:Q});const Rc=On.litElementPolyfillSupport;Rc?.({LitElement:Q}),(On.litElementVersions??=[]).push("4.2.1");function ea(t){if(t==null||typeof t!="object"||Array.isArray(t))return t;const e={...t};return delete e._sonic_http_response_,e}const Re=class Re{constructor(e){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=e.serviceURL,this.blockUntilDone=e.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=e.userName,this.password=e.password,e.token&&(this.token=e.token),this.tokenProvider=e.tokenProvider,this.authToken=e.authToken,this.addHTTPResponse=e.addHTTPResponse||!1,this.credentials=e.credentials,this.cache=e.cache||"default",this.keepAlive=e.keepAlive||!1}set token(e){if(this._token=e,!e){Re.tokens.delete(this.serviceURL);return}Re.invalidTokens.includes(e)||Re.tokens.set(this.serviceURL,e)}get token(){return Re.invalidTokens.includes(this._token)?Re.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(Re.invalidTokens.includes(e)||(Re.invalidTokens.push(e),this.token=null))}async handleResult(e,s){Re.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=e;const i=e.headers.get("content-type")?.toLowerCase(),r=e.status;let n={};if(!i||i.indexOf("text/")==0)n={text:await e.text()};else try{n=await e.json()}catch{n={}}if(this.addHTTPResponse&&ht.isObject(n)&&(n._sonic_http_response_=e),r===498&&!Re.failledTokenUpdates.has(this.serviceURL))if(this.handleInvalidToken(this.token),s.apiMethod==="get"){const c=await this.get(s.path,s.additionalHeaders);if(c==null)throw new Error("GET retry failed after token refresh");n=c}else n=await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders);return Si("sonic-api").lastResponse.set({http:e,processed:n}),n}async auth(){if(this.token)return;if(Re.tokens.has(this.serviceURL)){this.token=Re.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let e={};this.userName&&this.password?e={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(e={Authorization:"Bearer "+this.authToken});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,r=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:e,credentials:this.credentials,keepalive:this.keepAlive});try{const n=await r.json();n.token?this.token=n.token:Re.failledTokenUpdates.set(this.serviceURL,!0)}catch{Re.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,s){const i=ve.get(e),r=new URLSearchParams(s.split("?")[1]||""),n=i.get();let o=[];Array.isArray(n)?o=n:o=[n];const c=[];let d=Number.POSITIVE_INFINITY,
|
|
59
|
+
*/const On=globalThis;let Q=class extends pr{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dc(s,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return jt}};Q._$litElement$=!0,Q.finalized=!0,On.litElementHydrateSupport?.({LitElement:Q});const Rc=On.litElementPolyfillSupport;Rc?.({LitElement:Q}),(On.litElementVersions??=[]).push("4.2.1");function ea(t){if(t==null||typeof t!="object"||Array.isArray(t))return t;const e={...t};return delete e._sonic_http_response_,e}const Re=class Re{constructor(e){this.addHTTPResponse=!1,this.cache="default",this.isServiceSimulated=!1,this.blockUntilDone=!1,this.keepAlive=!1,this.serviceURL=e.serviceURL,this.blockUntilDone=e.blockUntilDone||!1,this.serviceURL=="publisher://"&&(this.isServiceSimulated=!0),this.serviceURL||(this.serviceURL=document.location.origin),this.userName=e.userName,this.password=e.password,e.token&&(this.token=e.token),this.tokenProvider=e.tokenProvider,this.authToken=e.authToken,this.addHTTPResponse=e.addHTTPResponse||!1,this.credentials=e.credentials,this.cache=e.cache||"default",this.keepAlive=e.keepAlive||!1}set token(e){if(this._token=e,!e){Re.tokens.delete(this.serviceURL);return}Re.invalidTokens.includes(e)||Re.tokens.set(this.serviceURL,e)}get token(){return Re.invalidTokens.includes(this._token)?Re.tokens.get(this.serviceURL):this._token}handleInvalidToken(e){e&&(Re.invalidTokens.includes(e)||(Re.invalidTokens.push(e),this.token=null))}async handleResult(e,s){Re.firstCallDoneFlags.set(this.serviceURL,"done"),this.lastResult=e;const i=e.headers.get("content-type")?.toLowerCase(),r=e.status;let n={};if(!i||i.indexOf("text/")==0)n={text:await e.text()};else try{n=await e.json()}catch{n={}}if(this.addHTTPResponse&&ht.isObject(n)&&(n._sonic_http_response_=e),r===498&&!Re.failledTokenUpdates.has(this.serviceURL))if(this.handleInvalidToken(this.token),s.apiMethod==="get"){const c=await this.get(s.path,s.additionalHeaders);if(c==null)throw new Error("GET retry failed after token refresh");n=c}else n=await this[s.apiMethod](s.path,s.data,s.method,s.additionalHeaders);return Si("sonic-api").lastResponse.set({http:e,processed:n}),n}async auth(){if(this.token)return;if(Re.tokens.has(this.serviceURL)){this.token=Re.tokens.get(this.serviceURL);return}if(!this.tokenProvider)return;let e={};this.userName&&this.password?e={Authorization:"Basic "+window.btoa(unescape(encodeURIComponent(this.userName+":"+this.password)))}:this.authToken&&(e={Authorization:"Bearer "+this.authToken});const s=new URL(this.serviceURL),i=s.protocol+"//"+s.host,r=await fetch(this.computeURL(this.tokenProvider,{serviceHost:i}),{headers:e,credentials:this.credentials,keepalive:this.keepAlive});try{const n=await r.json();n.token?this.token=n.token:Re.failledTokenUpdates.set(this.serviceURL,!0)}catch{Re.failledTokenUpdates.set(this.serviceURL,!0)}}async localGet(e,s){const i=ve.get(e),r=new URLSearchParams(s.split("?")[1]||""),n=i.get();let o=[];Array.isArray(n)?o=n:o=[n];const c=[];let d=Number.POSITIVE_INFINITY,b=0,A=0;if(r.has("limit")&&(d=parseInt(r.get("limit")||"0"),A++),r.has("offset")&&(b=parseInt(r.get("offset")||"0"),A++),A>0&&(r.delete("limit"),r.delete("offset")),r.size===0)return o.slice(b,b+d);for(const[m,f]of r.entries()){const C=f.split(",").map(E=>E.trim());for(const E of C)for(const T of o)if(typeof T!="object")isNaN(+T)?T.toString().toLowerCase().includes(f.toLowerCase())&&c.push(T):T===f&&c.push(T);else{const U=T;if(!U[m])continue;isNaN(+U[m])?U[m]?.toString().toLowerCase().includes(E.toLowerCase())&&c.push(T):U[m]===E&&c.push(T)}}return c.slice(b,b+d)}firstCallDone(){return new Promise(e=>{if(!Re.firstCallDoneFlags.has(this.serviceURL))Re.firstCallDoneFlags.set(this.serviceURL,"loading"),e(!0);else{const s=()=>{[void 0,"loading"].includes(Re.firstCallDoneFlags.get(this.serviceURL))?window.requestAnimationFrame(s):e(!0)};s()}})}async get(e,s){const i=/dataProvider\((.*?)\)(.*?)$/;if(i.test(e)){this.blockUntilDone&&(await this.firstCallDone(),Re.firstCallDoneFlags.set(this.serviceURL,"loading"));const b=e.match(i);if(!b)throw new Error("dataProvider path is not valid");return await this.localGet(b[1],b[2])}const r={apiMethod:"get",path:e,additionalHeaders:s},n=await this.createHeaders(s),o=this.computeURL(e),c=JSON.stringify({url:o,headers:n,credentials:this.credentials,cache:this.cache,keepAlive:this.keepAlive});if(this.blockUntilDone&&(await this.firstCallDone(),Re.firstCallDoneFlags.set(this.serviceURL,"loading")),!Re.loadingGetPromises.has(c)){const b=new Promise(async A=>{try{const m=await fetch(o,{headers:n,credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),f=await this.handleResult(m,r);A({processed:f,response:this.lastResult})}catch{Re.firstCallDoneFlags.set(this.serviceURL,"error"),A(null)}});Re.loadingGetPromises.set(c,b)}const d=await Re.loadingGetPromises.get(c);return Re.loadingGetPromises.delete(c),d?(this.lastResult=d.response,d.processed):null}async getDetailed(e,s){const i=/dataProvider\((.*?)\)(.*?)$/.test(e),r=await this.get(e,s);if(r==null)return;const n=ea(r),o=this.computeURL(e);if(i)return{request:new Request(o,{method:"GET"}),result:n};const c=await this.createHeaders(s);return{request:new Request(o,{method:"GET",headers:new Headers(c),credentials:this.credentials,cache:this.cache,keepalive:this.keepAlive}),response:this.lastResult,result:n}}async sendDetailed(e,s,i,r){const n=await this.send(e,s,i,r);if(n==null)return;const o=ea(n),c=this.computeURL(e),d=await this.createHeaders({Accept:"application/json","Content-Type":"application/json",...r});return{request:new Request(c,{method:i,headers:new Headers(d),credentials:this.credentials,body:JSON.stringify(s),keepalive:this.keepAlive}),response:this.lastResult,result:o}}async postDetailed(e,s,i){return this.sendDetailed(e,s,"POST",i)}async putDetailed(e,s,i){return this.sendDetailed(e,s,"PUT",i)}async patchDetailed(e,s,i){return this.sendDetailed(e,s,"PATCH",i)}async createHeaders(e){await this.auth();const s={};return this.token&&(s.Authorization="Bearer "+this.token),s["Accept-Language"]=Ue.getLanguage(),e&&Object.assign(s,e),s}computeURL(e,s={}){let i="";e.startsWith("http")?i=e:i=this.serviceURL+"/"+e,i.startsWith("http")||(i=window.location.origin+i);const r=new URL(i);for(const n in s)r.searchParams.set(n,s[n]);return r.toString().replace(/([^(https?:)])\/{2,}/g,"$1/")}async send(e,s,i="POST",r){const n={apiMethod:"send",path:e,additionalHeaders:r,method:i,data:s},o=await this.createHeaders(r);o.Accept="application/json",o["Content-Type"]="application/json";const c=await fetch(this.computeURL(e),{headers:o,credentials:this.credentials,method:i,body:JSON.stringify(s),keepalive:this.keepAlive});return await this.handleResult(c,n)}async submitFormData(e,s,i="POST",r){const n={apiMethod:"submitFormData",path:e,additionalHeaders:r,method:i,data:s},o=await this.createHeaders(r);o.Accept="application/json";const c=new FormData,d=s;for(const A in d)c.set(A,d[A]);const b=await fetch(this.computeURL(e),{headers:o,credentials:this.credentials,method:i,body:c,keepalive:this.keepAlive});return await this.handleResult(b,n)}async put(e,s,i){return this.send(e,s,"PUT",i)}async post(e,s,i){return this.send(e,s,"POST",i)}async patch(e,s,i){return this.send(e,s,"PATCH",i)}async delete(e,s,i){return this.send(e,s,"delete",i)}};Re.loadingGetPromises=new Map,Re.tokens=new Map,Re.invalidTokens=[],Re.failledTokenUpdates=new Map,Re.firstCallDoneFlags=new Map;let Os=Re;Ue.getApiConfiguration(document.body||document.documentElement);const jc=async(t,e)=>{};/**
|
|
60
60
|
* @license
|
|
61
61
|
* Copyright 2017 Google LLC
|
|
62
62
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
-
*/let Tn=class extends gr{constructor(e){if(super(e),this.it=ee,e.type!==Ys.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ee||e==null)return this._t=void 0,this.it=e;if(e===jt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};Tn.directiveName="unsafeHTML",Tn.resultType=1;const He=Es(Tn),Ln=new Map,ta=t=>{if(!t)return null;const e=Ue.getApiConfiguration(t),s=Ue.getAncestorAttributeValue(t,"wordingProvider"),i=Ue.getAncestorAttributeValue(t,"wordingVersionProvider"),r={apiConfiguration:e,wordingProvider:s,wordingVersionProvider:i};let n=null;for(const[o,c]of Ln)if(ht.deepEqual(o,r)){n=c;break}return n||(n={api:new Os(e),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:s,callIndex:0,wordingVersionProvider:i,apiCallKey:r},Ln.set(r,n)),n},sa="",We=class We extends En{constructor(e){super(e),this.useUnsafeHTML=!1,this.onAssign=s=>{const i=this.useUnsafeHTML?He(s):s;this.setValue(i)},this.node=e.options.host}unsubscribe(){We.publisher["wording_"+this.key].offAssign(this.onAssign)}render(e,s=!1){return this.useUnsafeHTML=s,this.key!==e&&(this.key=e,this.isConnected&&this.subscribe(e)),jt}static async callApi(e,s,i=!0,r){if(await ve.getInstance().isLocalStrorageReady,We.firstCall){We.firstCall=!1,bn(We.reloadWordings);const A=Object.keys(We.publisher.get());for(const m of A)We.publisher.get()[m]===sa&&delete We.publisher[m]}if(e){const A=Ue.getAncestorAttributeValue(e,"wordingVersionProvider");A&&Si(A).onAssign(We.handleVersionProvider(e))}let n=We.publisher.get()["wording_"+s]!=null;const o=r||ta(e);if(!o)return;if(n&&s!==""){o.translatedKeys.add(s);return}o.callIndex++;const c=o.callIndex,d=o.wordingProvider??"";if(!d&&i){window.setTimeout(async()=>{We.callApi(null,s,!1,o)},1e3);return}const
|
|
63
|
+
*/let Tn=class extends gr{constructor(e){if(super(e),this.it=ee,e.type!==Ys.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ee||e==null)return this._t=void 0,this.it=e;if(e===jt)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const s=[e];return s.raw=s,this._t={_$litType$:this.constructor.resultType,strings:s,values:[]}}};Tn.directiveName="unsafeHTML",Tn.resultType=1;const He=Es(Tn),Ln=new Map,ta=t=>{if(!t)return null;const e=Ue.getApiConfiguration(t),s=Ue.getAncestorAttributeValue(t,"wordingProvider"),i=Ue.getAncestorAttributeValue(t,"wordingVersionProvider"),r={apiConfiguration:e,wordingProvider:s,wordingVersionProvider:i};let n=null;for(const[o,c]of Ln)if(ht.deepEqual(o,r)){n=c;break}return n||(n={api:new Os(e),keysToTranslate:new Set,translatedKeys:new Set,wordingProvider:s,callIndex:0,wordingVersionProvider:i,apiCallKey:r},Ln.set(r,n)),n},sa="",We=class We extends En{constructor(e){super(e),this.useUnsafeHTML=!1,this.onAssign=s=>{const i=this.useUnsafeHTML?He(s):s;this.setValue(i)},this.node=e.options.host}unsubscribe(){We.publisher["wording_"+this.key].offAssign(this.onAssign)}render(e,s=!1){return this.useUnsafeHTML=s,this.key!==e&&(this.key=e,this.isConnected&&this.subscribe(e)),jt}static async callApi(e,s,i=!0,r){if(await ve.getInstance().isLocalStrorageReady,We.firstCall){We.firstCall=!1,bn(We.reloadWordings);const A=Object.keys(We.publisher.get());for(const m of A)We.publisher.get()[m]===sa&&delete We.publisher[m]}if(e){const A=Ue.getAncestorAttributeValue(e,"wordingVersionProvider");A&&Si(A).onAssign(We.handleVersionProvider(e))}let n=We.publisher.get()["wording_"+s]!=null;const o=r||ta(e);if(!o)return;if(n&&s!==""){o.translatedKeys.add(s);return}o.callIndex++;const c=o.callIndex,d=o.wordingProvider??"";if(!d&&i){window.setTimeout(async()=>{We.callApi(null,s,!1,o)},1e3);return}const b=o.api;window.queueMicrotask(async()=>{if(n=We.publisher["wording_"+s].get()!=null,!n&&s!==""&&(o.keysToTranslate.add(s),We.publisher["wording_"+s].set(sa)),c!==o.callIndex)return;const A=Array.from(o.keysToTranslate);if(!A.length)return;const m=d.split("?"),f=m.shift(),C=(m.length>0?m.join("?")+"&":"")+"labels[]="+A.join("&labels[]="),E=f+"?"+C;o.translatedKeys=new Set([...o.translatedKeys,...o.keysToTranslate]),o.keysToTranslate.clear();const T=await b.get(E);for(const U in T)We.publisher["wording_"+U].set(T[U])})}static reloadWordings(){for(const e of Ln.values())e.keysToTranslate=new Set(e.translatedKeys),e.keysToTranslate.size>0&&We.callApi(null,"",!1,e)}static handleVersionProvider(e){const s=ta(e),i=n=>{};if(!s)return i;if(We.versionProviderHandlers.has(s))return We.versionProviderHandlers.get(s)||i;const r=function(n){if(!s.wordingVersionProvider)return;const c=We.publisher.get().__wording_versions__??[];if(n==null)return;const d=c.find(b=>b.serviceURL===s.api.serviceURL)||{serviceURL:s.api.serviceURL,version:0};c.includes(d)||c.push(d),n!==d.version&&(d.version=n,We.publisher.set({__wording_versions__:c}),We.reloadWordings())};return We.versionProviderHandlers.set(s,r),r}subscribe(e){this.unsubscribe(),We.publisher["wording_"+e].onAssign(this.onAssign),We.callApi(this.node,e)}disconnected(){this.unsubscribe()}reconnected(){this.key&&this.subscribe(this.key)}};We.publisher=ve.get("sonic-wording",{localStorageMode:"enabled"}),We.firstCall=!0,We.versionProviderHandlers=new Map;let br=We;const Uc=Es(br);var zc=Object.defineProperty,qc=Object.getOwnPropertyDescriptor,rs=(t,e,s,i)=>{for(var r=i>1?void 0:i?qc(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&zc(e,s,r),r};let Ei=!1,In=new Set;const Ot=(t,e)=>{var r;const s=(r=class extends t{constructor(...o){super(),this.collectDependenciesVersion=0,this.displayContents=!1,this.noAutoFill=!1,this.forceAutoFill=!1,this.renderOnPropsInternalChange=!1,this.noShadowDom=null,this.propertyMap=null,this.title="",this.dataProvider=null,this.bindPublisher=null,this._props=null,this.shouldRenderLazy=!0,this.defferedDebug=null,this.debug=null,this.onAssign=c=>{this.props=c}}hasAncestorAttribute(o){return this.getAncestorAttributeValue(o)!=null}getAncestorAttributeValue(o){return Ue.getAncestorAttributeValue(this,o)}get props(){return this._props!==null||!this.publisher?this._props:this.publisher.get()}set props(o){typeof o=="string"&&["{","["].includes(o.trim().charAt(0))&&(o=JSON.parse(o)),o!=this._props&&(this._props=o,this.publisher&&this.publisher.get()!=o&&this.publisher.set(o),this.requestUpdate())}updated(o){super.updated(o);const d=[...(this.shadowRoot||this).children].filter(A=>A.tagName!="STYLE"),b=this.displayContents?"contents":d.length==0?"none":null;b?this.style.display=b:this.style.removeProperty("display")}connectedCallback(){if(r.instanceCounter++,this.hasAttribute("lazyRendering")){const o={root:null,threshold:.9};let c=!0;const d=new IntersectionObserver(b=>{for(const A of b)if(c&&A.isIntersecting){c=!1,d.disconnect(),this.initWording(),this.shouldRenderLazy=!1,this.startPublisher();break}},o);d.observe(this)}else this.initWording(),this.shouldRenderLazy=!1;this.initPublisher(),this.addDebugger(),super.connectedCallback()}disconnectedCallback(){this.removeDebugger(),super.disconnectedCallback(),this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate)),br.publisher.stopTemplateFilling(this),this.onAssign&&this.publisher?.offAssign(this.onAssign)}addDebugger(){if(this.hasAttribute("debug")&&!this.defferedDebug){if(!this.debug){this.debug=document.createElement("div");const o=this.debug.style;o.position="fixed",o.top="0",o.right="0",o.margin="auto",o.borderRadius=".7rem",o.backgroundColor="#0f1729",o.color="#c5d4f9",o.padding="16px 16px",o.margin="16px 16px",o.boxShadow="0 10px 30px -18px rgba(0,0,0,.3)",o.overflowY="auto",o.zIndex="99999999",o.maxHeight="calc(100vh - 32px)",o.fontFamily="Consolas, monospace",o.maxWidth="min(50vw,25rem)",o.fontSize="12px",o.minWidth="300px",o.overflowWrap="break-word",o.resize="vertical"}this.addEventListener("click",o=>{o.ctrlKey&&(o.preventDefault(),Ei=!Ei)}),this.dataProvider&&(window[this.dataProvider]=this.publisher),this.addEventListener("mouseover",()=>{Ei||this.removeDebugger(),document.body.appendChild(this.debug),In.add(this.debug)}),this.addEventListener("mouseout",()=>{Ei||this.removeDebugger()}),this.publisher?.onInternalMutation(()=>{this.debug.innerHTML=`🤖 DataProvider : "<b style="font-weight:bold;color:#fff;">${this.dataProvider}</b>"<br>
|
|
64
64
|
<div style="font-size:10px;border-top:1px dashed;margin-top:5px;padding-left:23px;opacity:.6;padding-top:5px;">
|
|
65
65
|
Variable disponible dans la console<br>
|
|
66
66
|
ctrl + Clique : épingler / désépingler
|
|
67
67
|
</div>
|
|
68
|
-
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(this.publisher?.get(),null," ")}</pre>`})}}removeDebugger(){In.forEach(o=>{document.body.contains(o)&&document.body.removeChild(o)}),In=new Set}getApiConfiguration(){return Ue.getApiConfiguration(this)}async initWording(){const o=Object.getOwnPropertyNames(this.constructor.prototype);for(const c of o)c.indexOf("wording_")==0&&br.callApi(this,c.substring(8));br.publisher.startTemplateFilling(this)}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;const o=super.createRenderRoot();return Pi.observe(o),o}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const o=ve.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let c=this.dataProvider;if(!c&&this._props&&(this.dataProvider=c="__subscriber__"+r.instanceCounter),c){this.bindPublisher&&o.set(c,this.bindPublisher());let d=o.get(c,{localStorageMode:this.getAttribute("localStorage")||"disabled",invalidateOnPageShow:this.hasAttribute("invalidateOnPageShow")});if(this.dataProvider=c,this.hasAttribute("subDataProvider")){const g=this.getAttribute("subDataProvider");this.dataProvider=c+"/"+g,d=ht.traverse(d,g.split(".")),o.set(this.dataProvider,d),this.publisher=d}this.publisher=d}this.hasAttribute("lazyRendering")||this.startPublisher()}startPublisher(){this.publisher&&(this._props&&this.publisher.set(this._props),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this.publisher.onAssign(this.onAssign))}},r.instanceCounter=0,r);return rs([h({type:Number})],s.prototype,"collectDependenciesVersion",2),rs([h({type:Boolean})],s.prototype,"displayContents",2),rs([h({type:Boolean})],s.prototype,"noAutoFill",2),rs([h({type:Boolean})],s.prototype,"forceAutoFill",2),rs([h({type:Object})],s.prototype,"propertyMap",2),rs([h({type:String,attribute:"data-title"})],s.prototype,"title",2),rs([h({reflect:!0})],s.prototype,"dataProvider",2),rs([h()],s.prototype,"bindPublisher",2),rs([h()],s.prototype,"props",1),rs([xe()],s.prototype,"shouldRenderLazy",2),s};var Bc=Object.defineProperty,Hc=(t,e,s,i)=>{for(var r=void 0,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(e,s,r)||r);return r&&Bc(e,s,r),r};const Wr=t=>{class e extends t{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){const i=this.templates||[...this.querySelectorAll("template")];for(const r of i)r.hasAttribute(this.templateValueAttribute)&&(this.templateParts[r.getAttribute(this.templateValueAttribute)]=r,this.templatePartsList.push(r)),r.hasAttribute("skeleton")&&(this.templateParts.skeleton=r),r.hasAttribute("no-result")&&(this.templateParts["no-result"]=r),r.hasAttribute("no-item")&&(this.templateParts["no-item"]=r);this.templateList=i.filter(r=>!r.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=i),super.connectedCallback()}}return Hc([h({type:Array})],e.prototype,"templates"),e};var Vc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,Xe=(t,e,s,i)=>{for(var r=i>1?void 0:i?Wc(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Vc(e,s,r),r};const Kc="sonic-date";bn(()=>ze.updateComponentsLanguage());let ze=class extends Ot(Wr(Q)){constructor(){super(...arguments),this.pageLanguage="fr",this.duAu=[],this._wording_billet_periode_validite="",this.designMode=null,this.time_zone=null,this.date=null,this.date_string=null,this.start_date_string=null,this.end_date_string=null,this.start_date=0,this.computedStartDate=0,this.end_date=0,this.computedEndDate=0,this.hide_hours=!1,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.hour12=!1,this.minute="2-digit",this.language="",this.renderIf=!0,this.now=!1,this.startDateObject=new Date,this.endDateObject=new Date}static updateComponentsLanguage(){ze.dateCompnents.forEach(t=>t.pageLanguage=Ue.getLanguage())}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(t){t||(t="Du %s au %s"),this._wording_billet_periode_validite=t,this.duAu=this.wording_billet_periode_validite?.split("%s").map(e=>e.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.hasAttribute("wording_billet_periode_validite")||(this.wording_billet_periode_validite="Du %s au %s"),this.pageLanguage=Ue.getLanguage(),ze.dateCompnents.add(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),ze.dateCompnents.delete(this)}getDatesParts(t,e,s){const i=this.startDateObject;i.setTime(t*1e3);let r=[];if(e>0){const n=this.endDateObject;n.setTime(e*1e3);const o=i.toDateString()==n.toDateString();if((!o||this.hide_hours)&&(delete s.hour,delete s.minute),r=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatRangeToParts(i,n),!o){const d=r.find(g=>g.type=="literal"&&g.source=="shared"&&g.value.trim().length>0);d&&(d.value=" "+this.duAu[1]+" ",d.type="to"),this.designMode||r.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else r=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatToParts(i);return this.designMode&&r.forEach(n=>n.value=n.value.replace(/,/g," ")),r[0].value=Fr.ucFirst(r[0].value),r.filter(n=>n.hidden!==!0)}dateStringToSeconds(t){return new Date(t).getTime()/1e3}willUpdate(t){if(this.computedStartDate=0,this.computedEndDate=0,this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.computedStartDate=this.date),this.start_date_string&&(this.computedStartDate=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),this.start_date&&(this.computedStartDate=this.start_date),!(!this.computedStartDate&&!this.now&&!this.end_date)&&(this.computedStartDate||(this.computedStartDate=Date.now()/1e3),this.end_date&&(this.computedEndDate=this.end_date),this.computedEndDate>0&&this.computedEndDate<this.computedStartDate)){const e=this.computedStartDate;this.computedStartDate=this.computedEndDate,this.computedEndDate=e}}render(){if(!this.renderIf||!this.computedStartDate&&!this.now&&!this.computedEndDate)return ee;const t={year:this.year||"numeric",month:this.month||"short",day:this.day||"2-digit",hour12:this.hour12||!1};this.weekday!=="hidden"&&(t.weekday=this.weekday||"short"),this.hour!=="hidden"&&(t.hour=this.hour||"2-digit"),this.minute!=="hidden"&&(t.minute=this.minute||"2-digit"),this.era&&(t.era=this.era),this.time_zone&&(t.timeZone=this.time_zone);const e=this.getDatesParts(this.computedStartDate,this.computedEndDate,t);return He(`${e.map(s=>{const i=this.templateParts[s.type];if(i){const o=document.importNode(i.content,!0).children[0];return o.innerText.trim()==""&&(o.innerText=s.value),o.outerHTML}const r=document.createElement("span");return r.innerText=s.value,r.className=s.type,`<span class="${s.type}">${s.value}</span>`}).join("")}`)}};ze.dateCompnents=new Set,Xe([h()],ze.prototype,"wording_billet_periode_validite",1),Xe([h({type:Boolean})],ze.prototype,"designMode",2),Xe([h({type:String})],ze.prototype,"time_zone",2),Xe([h({type:Number})],ze.prototype,"date",2),Xe([h({type:String})],ze.prototype,"date_string",2),Xe([h({type:String})],ze.prototype,"start_date_string",2),Xe([h({type:String})],ze.prototype,"end_date_string",2),Xe([h({type:Number})],ze.prototype,"start_date",2),Xe([h({type:Number})],ze.prototype,"end_date",2),Xe([h({type:Boolean})],ze.prototype,"hide_hours",2),Xe([h({type:String})],ze.prototype,"era",2),Xe([h({type:String})],ze.prototype,"year",2),Xe([h({type:String})],ze.prototype,"month",2),Xe([h({type:String})],ze.prototype,"day",2),Xe([h({type:String})],ze.prototype,"weekday",2),Xe([h({type:String})],ze.prototype,"hour",2),Xe([h({type:Boolean})],ze.prototype,"hour12",2),Xe([h({type:String})],ze.prototype,"minute",2),Xe([h({type:String})],ze.prototype,"language",2),Xe([h({type:Boolean})],ze.prototype,"renderIf",2),Xe([h({type:Boolean})],ze.prototype,"now",2),ze=Xe([X(Kc)],ze);let dt=(st=class{static listen(){if(!st.listening)return;const e=document.location?.href.replace(document.location.origin,"");st.prevURL&&st.prevURL!=e&&(st.prevURL=e,st.listeners.forEach(s=>{s.location=e})),window.requestAnimationFrame(st.listen)}static offChange(e){const s=st.listeners.indexOf(e);s!=-1&&(st.listeners.splice(s,1),st.listeners.length==0&&(st.listening=!1))}static onChange(e){st.listening||(st.listening=!0,st.listen()),st.listeners.push(e),e.location=this.prevURL}static changeFromComponent(e){const s=e.goBack,i=document.referrer;if(s!=null){const g=document.location.origin,A=(s||g).toString(),f=i.indexOf("http")==0?new URL(i).origin!=g:!1,C=i=="",E=history.length<3,O=C&&E,U=A!=document.location.href;if(f&&U||O){const S=history.state||{};S.concorde=S.concorde||{},S.concorde.hasDoneHistoryBack=!0,history.pushState(S,document.title),history.back(),document.location.replace(A)}else history.back();return}let r=e.getAttribute("to")||"";if(r||(r=e.href?.toString()||""),!r)return;if(r.indexOf("#")==0){document.location.hash=r.substring(1);return}const n=new URL(r,document.location.href),o=n.pathname.split("/"),c=[];let d="";for(const g of o)g!=d&&c.push(g),d=g;r="/"+c.join("/")+n.search+(n.hash?n.hash:""),e.hasAttribute("pushState")?history.pushState(null,"",r):e.hasAttribute("replaceState")?history.replaceState(null,"",r):document.location.href=r}static updateComponentActiveState(e){if(e.autoActive=="disabled")return;const s=e.href?.toString()||"";if(e.href&&s.indexOf("http")!=0){const i=new URL(s,document.location.href),r=new URL(e.location||"",document.location.origin);let n=!1;e.autoActive=="strict"?n=i.pathname==r.pathname&&i.hash==r.hash&&i.search==r.search:e.autoActive=="strict-path-only"?n=i.pathname==r.pathname&&i.hash==r.hash:n=r.href.indexOf(i.href)==0,n?e.setAttribute("active","true"):e.removeAttribute("active")}}},st.listeners=[],st.listening=!1,st.prevURL=document.location?.href.replace(document.location.origin,""),st);/**
|
|
68
|
+
<pre style="margin-top:10px;background:transparent;padding:0;font-size:inherit;color:inherit;">${JSON.stringify(this.publisher?.get(),null," ")}</pre>`})}}removeDebugger(){In.forEach(o=>{document.body.contains(o)&&document.body.removeChild(o)}),In=new Set}getApiConfiguration(){return Ue.getApiConfiguration(this)}async initWording(){const o=Object.getOwnPropertyNames(this.constructor.prototype);for(const c of o)c.indexOf("wording_")==0&&br.callApi(this,c.substring(8));br.publisher.startTemplateFilling(this)}createRenderRoot(){if(this.noShadowDom===""||this.getAttribute("noShadowDom")==="")return this;const o=super.createRenderRoot();return Pi.observe(o),o}initPublisher(){if(!document)return;this.publisher&&(this.publisher.stopTemplateFilling(this),this.publisher.offInternalMutation(this.requestUpdate),this.onAssign&&this.publisher.offAssign(this.onAssign));const o=ve.getInstance();this.dataProvider||(this.dataProvider=this.getAncestorAttributeValue("dataProvider"));let c=this.dataProvider;if(!c&&this._props&&(this.dataProvider=c="__subscriber__"+r.instanceCounter),c){this.bindPublisher&&o.set(c,this.bindPublisher());let d=o.get(c,{localStorageMode:this.getAttribute("localStorage")||"disabled",invalidateOnPageShow:this.hasAttribute("invalidateOnPageShow")});if(this.dataProvider=c,this.hasAttribute("subDataProvider")){const b=this.getAttribute("subDataProvider");this.dataProvider=c+"/"+b,d=ht.traverse(d,b.split(".")),o.set(this.dataProvider,d),this.publisher=d}this.publisher=d}this.hasAttribute("lazyRendering")||this.startPublisher()}startPublisher(){this.publisher&&(this._props&&this.publisher.set(this._props),this.noAutoFill||this.publisher.startTemplateFilling(this),this.renderOnPropsInternalChange&&this.publisher.onInternalMutation(this.requestUpdate),this.publisher.onAssign(this.onAssign))}},r.instanceCounter=0,r);return rs([h({type:Number})],s.prototype,"collectDependenciesVersion",2),rs([h({type:Boolean})],s.prototype,"displayContents",2),rs([h({type:Boolean})],s.prototype,"noAutoFill",2),rs([h({type:Boolean})],s.prototype,"forceAutoFill",2),rs([h({type:Object})],s.prototype,"propertyMap",2),rs([h({type:String,attribute:"data-title"})],s.prototype,"title",2),rs([h({reflect:!0})],s.prototype,"dataProvider",2),rs([h()],s.prototype,"bindPublisher",2),rs([h()],s.prototype,"props",1),rs([xe()],s.prototype,"shouldRenderLazy",2),s};var Bc=Object.defineProperty,Hc=(t,e,s,i)=>{for(var r=void 0,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(e,s,r)||r);return r&&Bc(e,s,r),r};const Wr=t=>{class e extends t{constructor(){super(...arguments),this.templates=null,this.templateValueAttribute="data-value",this.templateList=[],this.templateParts={},this.templatePartsList=[]}connectedCallback(){const i=this.templates||[...this.querySelectorAll("template")];for(const r of i)r.hasAttribute(this.templateValueAttribute)&&(this.templateParts[r.getAttribute(this.templateValueAttribute)]=r,this.templatePartsList.push(r)),r.hasAttribute("skeleton")&&(this.templateParts.skeleton=r),r.hasAttribute("no-result")&&(this.templateParts["no-result"]=r),r.hasAttribute("no-item")&&(this.templateParts["no-item"]=r);this.templateList=i.filter(r=>!r.getAttribute("data-value")),this.templateList.length==0&&(this.templateList=i),super.connectedCallback()}}return Hc([h({type:Array})],e.prototype,"templates"),e};var Vc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,Xe=(t,e,s,i)=>{for(var r=i>1?void 0:i?Wc(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Vc(e,s,r),r};const Kc="sonic-date";bn(()=>ze.updateComponentsLanguage());let ze=class extends Ot(Wr(Q)){constructor(){super(...arguments),this.pageLanguage="fr",this.duAu=[],this._wording_billet_periode_validite="",this.designMode=null,this.time_zone=null,this.date=null,this.date_string=null,this.start_date_string=null,this.end_date_string=null,this.start_date=0,this.computedStartDate=0,this.end_date=0,this.computedEndDate=0,this.hide_hours=!1,this.era="",this.year="numeric",this.month="short",this.day="2-digit",this.weekday="short",this.hour="2-digit",this.hour12=!1,this.minute="2-digit",this.language="",this.renderIf=!0,this.now=!1,this.startDateObject=new Date,this.endDateObject=new Date}static updateComponentsLanguage(){ze.dateCompnents.forEach(t=>t.pageLanguage=Ue.getLanguage())}get wording_billet_periode_validite(){return this._wording_billet_periode_validite}set wording_billet_periode_validite(t){t||(t="Du %s au %s"),this._wording_billet_periode_validite=t,this.duAu=this.wording_billet_periode_validite?.split("%s").map(e=>e.trim()),this.duAu.pop(),this.requestUpdate()}connectedCallback(){this.hasAttribute("wording_billet_periode_validite")||(this.wording_billet_periode_validite="Du %s au %s"),this.pageLanguage=Ue.getLanguage(),ze.dateCompnents.add(this),super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),ze.dateCompnents.delete(this)}getDatesParts(t,e,s){const i=this.startDateObject;i.setTime(t*1e3);let r=[];if(e>0){const n=this.endDateObject;n.setTime(e*1e3);const o=i.toDateString()==n.toDateString();if((!o||this.hide_hours)&&(delete s.hour,delete s.minute),r=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatRangeToParts(i,n),!o){const d=r.find(b=>b.type=="literal"&&b.source=="shared"&&b.value.trim().length>0);d&&(d.value=" "+this.duAu[1]+" ",d.type="to"),this.designMode||r.unshift({type:"from",value:this.duAu[0]+" ",source:"shared"})}}else r=new Intl.DateTimeFormat(this.language||this.pageLanguage,s).formatToParts(i);return this.designMode&&r.forEach(n=>n.value=n.value.replace(/,/g," ")),r[0].value=Fr.ucFirst(r[0].value),r.filter(n=>n.hidden!==!0)}dateStringToSeconds(t){return new Date(t).getTime()/1e3}willUpdate(t){if(this.computedStartDate=0,this.computedEndDate=0,this.date_string&&(this.date=this.dateStringToSeconds(this.date_string)),this.date&&(this.computedStartDate=this.date),this.start_date_string&&(this.computedStartDate=this.dateStringToSeconds(this.start_date_string)),this.end_date_string&&(this.end_date=this.dateStringToSeconds(this.end_date_string)),this.start_date&&(this.computedStartDate=this.start_date),!(!this.computedStartDate&&!this.now&&!this.end_date)&&(this.computedStartDate||(this.computedStartDate=Date.now()/1e3),this.end_date&&(this.computedEndDate=this.end_date),this.computedEndDate>0&&this.computedEndDate<this.computedStartDate)){const e=this.computedStartDate;this.computedStartDate=this.computedEndDate,this.computedEndDate=e}}render(){if(!this.renderIf||!this.computedStartDate&&!this.now&&!this.computedEndDate)return ee;const t={year:this.year||"numeric",month:this.month||"short",day:this.day||"2-digit",hour12:this.hour12||!1};this.weekday!=="hidden"&&(t.weekday=this.weekday||"short"),this.hour!=="hidden"&&(t.hour=this.hour||"2-digit"),this.minute!=="hidden"&&(t.minute=this.minute||"2-digit"),this.era&&(t.era=this.era),this.time_zone&&(t.timeZone=this.time_zone);const e=this.getDatesParts(this.computedStartDate,this.computedEndDate,t);return He(`${e.map(s=>{const i=this.templateParts[s.type];if(i){const o=document.importNode(i.content,!0).children[0];return o.innerText.trim()==""&&(o.innerText=s.value),o.outerHTML}const r=document.createElement("span");return r.innerText=s.value,r.className=s.type,`<span class="${s.type}">${s.value}</span>`}).join("")}`)}};ze.dateCompnents=new Set,Xe([h()],ze.prototype,"wording_billet_periode_validite",1),Xe([h({type:Boolean})],ze.prototype,"designMode",2),Xe([h({type:String})],ze.prototype,"time_zone",2),Xe([h({type:Number})],ze.prototype,"date",2),Xe([h({type:String})],ze.prototype,"date_string",2),Xe([h({type:String})],ze.prototype,"start_date_string",2),Xe([h({type:String})],ze.prototype,"end_date_string",2),Xe([h({type:Number})],ze.prototype,"start_date",2),Xe([h({type:Number})],ze.prototype,"end_date",2),Xe([h({type:Boolean})],ze.prototype,"hide_hours",2),Xe([h({type:String})],ze.prototype,"era",2),Xe([h({type:String})],ze.prototype,"year",2),Xe([h({type:String})],ze.prototype,"month",2),Xe([h({type:String})],ze.prototype,"day",2),Xe([h({type:String})],ze.prototype,"weekday",2),Xe([h({type:String})],ze.prototype,"hour",2),Xe([h({type:Boolean})],ze.prototype,"hour12",2),Xe([h({type:String})],ze.prototype,"minute",2),Xe([h({type:String})],ze.prototype,"language",2),Xe([h({type:Boolean})],ze.prototype,"renderIf",2),Xe([h({type:Boolean})],ze.prototype,"now",2),ze=Xe([X(Kc)],ze);let dt=(st=class{static listen(){if(!st.listening)return;const e=document.location?.href.replace(document.location.origin,"");st.prevURL&&st.prevURL!=e&&(st.prevURL=e,st.listeners.forEach(s=>{s.location=e})),window.requestAnimationFrame(st.listen)}static offChange(e){const s=st.listeners.indexOf(e);s!=-1&&(st.listeners.splice(s,1),st.listeners.length==0&&(st.listening=!1))}static onChange(e){st.listening||(st.listening=!0,st.listen()),st.listeners.push(e),e.location=this.prevURL}static changeFromComponent(e){const s=e.goBack,i=document.referrer;if(s!=null){const c=document.location.origin,d=(s||c).toString(),A=i.indexOf("http")==0?new URL(i).origin!=c:!1,m=i=="",f=history.length<3,C=m&&f,E=d!=document.location.href;if(A&&E||C){const U=history.state||{};U.concorde=U.concorde||{},U.concorde.hasDoneHistoryBack=!0,history.pushState(U,document.title),history.back(),document.location.replace(d)}else history.back();return}let r=e.getAttribute("to")||"";if(r||(r=e.href?.toString()||""),!r)return;if(r.indexOf("#")==0){document.location.hash=r.substring(1);return}const n=new URL(r,document.location.href);r=`/${n.pathname.split("/").filter(Boolean).join("/")}${n.search}${n.hash||""}`,e.hasAttribute("pushState")?history.pushState(null,"",r):e.hasAttribute("replaceState")?history.replaceState(null,"",r):document.location.href=r}static updateComponentActiveState(e){if(e.autoActive=="disabled")return;const s=e.href?.toString()||"";if(e.href&&s.indexOf("http")!=0){const i=new URL(s,document.location.href),r=new URL(e.location||"",document.location.origin);let n=!1;e.autoActive=="strict"?n=i.pathname==r.pathname&&i.hash==r.hash&&i.search==r.search:e.autoActive=="strict-path-only"?n=i.pathname==r.pathname&&i.hash==r.hash:n=r.href.indexOf(i.href)==0,n?e.setAttribute("active","true"):e.removeAttribute("active")}}},st.listeners=[],st.listening=!1,st.prevURL=document.location?.href.replace(document.location.origin,""),st);/**
|
|
69
69
|
* @license
|
|
70
70
|
* Copyright 2018 Google LLC
|
|
71
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
72
|
-
*/const ra="important",Gc=" !"+ra,$t=Es(class extends gr{constructor(t){if(super(t),t.type!==Ys.ATTRIBUTE||t.name!=="style"||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return i==null?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ft.add(i);const n=typeof r=="string"&&r.endsWith(Gc);i.includes("-")||n?s.setProperty(i,n?r.slice(0,-11):r,n?ra:""):s[i]=r}}return jt}});var Yc=Object.defineProperty,Zc=Object.getOwnPropertyDescriptor,Jt=(t,e,s,i)=>{for(var r=i>1?void 0:i?Zc(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Yc(e,s,r),r};const Oi=new Map,vr=t=>{class e extends t{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=!1,this.ariaLabel=null,this.ariaLabelledby=null,this.formDataProvider="",this._name="",this._value="",this.onFormValueAssign=async r=>{this.setFormValueFromPublisher(r)},this.onFormDataInValidate=()=>{const r=this.getFormPublisher();r&&r.isFormValid.get()&&this.validateFormElement()}}hasAncestorAttribute(i){return Ue.getAncestorAttributeValue(this,i)!=null}getAncestorAttributeValue(i){return Ue.getAncestorAttributeValue(this,i)||""}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}unsetOnDisconnect(){return this.hasAttribute("unsetOnDisconnect")}updateDataValue(){this.getAttribute("name")&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")||""),this.formDataProvider?ve.get(this.formDataProvider):null}setFormPublisherValue(i){const r=this.getFormPublisher();r&&Bt(r,this.name).set(i)}getFormPublisherValue(){const i=this.getFormPublisher();return i?Bt(i,this.name).get():null}getValueForFormPublisher(){return this.value}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),ht.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initFormPublisher(){let i=this.getFormPublisher();const r=this.hasAncestorAttribute("initFromPublisher")&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute("value");this._name&&i&&Bt(i,this._name).offAssign(this.onFormValueAssign),this.name||(this._name=this.getAttribute("name")||""),this.value||(this._value=this.getAttribute("value")),i=this.getFormPublisher(),this._name&&i&&(Bt(i,this._name).onAssign(this.onFormValueAssign),i.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),r&&(this.value=r)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const r=new Event("change");this.dispatchEvent(r)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav")||"";if(!i)return;const r=i.split(" "),n=r[0];if(!n)return;for(const c of r){Oi.has(c)||Oi.set(c,[]);const d=Oi.get(c);d?.indexOf(this)==-1&&d.push(this)}const o=Oi.get(n);this.addEventListener("keydown",c=>{const d=c;if(!["ArrowDown","ArrowUp"].includes(d.key))return;const g="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",A=o?.filter(C=>{const E=C.shadowRoot?.querySelector(g);if(!E)return!1;const O=window.getComputedStyle(E);return O.display!=="none"&&O.display!==""&&O.pointerEvents!="none"&&O.visibility!=="hidden"&&E.getBoundingClientRect().width>0});let m=null;if(d.key=="ArrowDown"&&A){const C=A.indexOf(this);C==A.length-1?m=A[0]:m=A[C+1]}else if(d.key=="ArrowUp"&&A){const C=A.indexOf(this);C==0?m=A[A.length-1]:m=A[C-1]}const f=m?.shadowRoot?.querySelector(g);f&&f.focus&&(f.focus(),c.preventDefault(),c.stopPropagation())})}focus(){this.shadowRoot?.querySelector("[data-form-element], button")?.focus()}connectedCallback(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")||""),super.connectedCallback(),this.initFormPublisher(),this.addKeyboardNavigation()}unset(){this.value=null}disconnectedCallback(){this.unsetOnDisconnect()&&this.unset(),super.disconnectedCallback();const i=this.getFormPublisher();this._name&&i&&(Bt(i,this._name).offAssign(this.onFormValueAssign),i.offFormInvalidate(this.onFormDataInValidate))}}return Jt([h({type:Boolean,reflect:!0})],e.prototype,"touched",2),Jt([h({type:Boolean})],e.prototype,"error",2),Jt([h({type:Boolean})],e.prototype,"autofocus",2),Jt([h({type:Boolean})],e.prototype,"required",2),Jt([h({type:Boolean})],e.prototype,"forceAutoFill",2),Jt([h({type:Boolean,reflect:!0})],e.prototype,"disabled",2),Jt([h({type:String,attribute:"data-aria-label"})],e.prototype,"ariaLabel",2),Jt([h({type:String,attribute:"data-aria-labelledby"})],e.prototype,"ariaLabelledby",2),Jt([h({type:String})],e.prototype,"formDataProvider",2),Jt([h()],e.prototype,"name",1),Jt([h()],e.prototype,"value",1),e};let Jc=class ur{static areEqual(e,s){return e.length===s.length?e.every((i,r)=>i===s[r]):!1}static from2d(e){return{to1D:()=>{let s=[];return e.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(e){return{get:()=>e||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(e.length<1)return!0;const i=(e[0]||{})[s];return e.every(r=>(r||{})[s]==i)}})})}),value:()=>({forKey:s=>ur.from(e.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{e.forEach(r=>{r[i]=Array.isArray(r[s])?[...r[s]]:typeof r[s]=="object"&&r[s]!=null?{...r[s]}:r[s]})}})})}),map:s=>ur.from(e.map(s)),filter:s=>ur.from(e.filter(s)),find:s=>e.find(s),some:s=>e.some(s),every:s=>e.every(s),group:()=>({byKey:s=>{const i=[],r=new Map;for(const n of e){const o=n[s];if(!r.has(o)){const c=i.length;r.set(o,c);const d={items:[]};d[s]=o,i.push(d)}i[r.get(o)].items.push(n)}return ur.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(e.map(r=>r[s]))];return ur.from(i.map(r=>e.find(n=>n[s]==r)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const r=(n,o)=>c=>n[o]!=c[o];return ur.from(e.filter(n=>s.every(r(n,i))))}})})})}}};var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function na(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Kr={exports:{}},Qc=Kr.exports,oa;function Xc(){return oa||(oa=1,(function(t,e){var s=[].slice;(function(i,r){return e!==null?t.exports=r():i.UrlPattern=r()})(Qc,function(){var i,r,n,o,c,d,g,A,m,f,C,E,O,U,B;return m=function(S){return S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},g=function(S,y){var M,k,D;for(D=[],M=-1,k=S.length;++M<k;)D=D.concat(y(S[M]));return D},U=function(S,y){var M,k,D;for(D="",M=-1,k=S.length;++M<k;)D+=y(S[M]);return D},O=function(S){return new RegExp(S.toString()+"|").exec("").length-1},C=function(S,y){var M,k,D,Y,j;for(Y={},M=-1,D=S.length;++M<D;)k=S[M],j=y[M],j!=null&&(Y[k]!=null?(Array.isArray(Y[k])||(Y[k]=[Y[k]]),Y[k].push(j)):Y[k]=j);return Y},i={},i.Result=function(S,y){this.value=S,this.rest=y},i.Tagged=function(S,y){this.tag=S,this.value=y},i.tag=function(S,y){return function(M){var k,D;if(k=y(M),k!=null)return D=new i.Tagged(S,k.value),new i.Result(D,k.rest)}},i.regex=function(S){return function(y){var M,k;if(M=S.exec(y),M!=null)return k=M[0],new i.Result(k,y.slice(k.length))}},i.sequence=function(){var S;return S=1<=arguments.length?s.call(arguments,0):[],function(y){var M,k,D,Y,j,ne;for(M=-1,k=S.length,ne=[],Y=y;++M<k;){if(D=S[M],j=D(Y),j==null)return;ne.push(j.value),Y=j.rest}return new i.Result(ne,Y)}},i.pick=function(){var S,y;return S=arguments[0],y=2<=arguments.length?s.call(arguments,1):[],function(M){var k,D;if(D=i.sequence.apply(i,y)(M),D!=null)return k=D.value,D.value=k[S],D}},i.string=function(S){var y;return y=S.length,function(M){if(M.slice(0,y)===S)return new i.Result(S,M.slice(y))}},i.lazy=function(S){var y;return y=null,function(M){return y==null&&(y=S()),y(M)}},i.baseMany=function(S,y,M,k,D){var Y,j,ne,re;for(ne=D,re=M?"":[];!(y!=null&&(Y=y(ne),Y!=null)||(j=S(ne),j==null));)M?re+=j.value:re.push(j.value),ne=j.rest;if(!(k&&re.length===0))return new i.Result(re,ne)},i.many1=function(S){return function(y){return i.baseMany(S,null,!1,!0,y)}},i.concatMany1Till=function(S,y){return function(M){return i.baseMany(S,y,!0,!0,M)}},i.firstChoice=function(){var S;return S=1<=arguments.length?s.call(arguments,0):[],function(y){var M,k,D,Y;for(M=-1,k=S.length;++M<k;)if(D=S[M],Y=D(y),Y!=null)return Y}},E=function(S){var y;return y={},y.wildcard=i.tag("wildcard",i.string(S.wildcardChar)),y.optional=i.tag("optional",i.pick(1,i.string(S.optionalSegmentStartChar),i.lazy(function(){return y.pattern}),i.string(S.optionalSegmentEndChar))),y.name=i.regex(new RegExp("^["+S.segmentNameCharset+"]+")),y.named=i.tag("named",i.pick(1,i.string(S.segmentNameStartChar),i.lazy(function(){return y.name}))),y.escapedChar=i.pick(1,i.string(S.escapeChar),i.regex(/^./)),y.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return y.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(S.segmentNameStartChar),i.string(S.optionalSegmentStartChar),i.string(S.optionalSegmentEndChar),y.wildcard))),y.token=i.lazy(function(){return i.firstChoice(y.wildcard,y.optional,y.named,y.static)}),y.pattern=i.many1(i.lazy(function(){return y.token})),y},A={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},d=function(S,y){if(Array.isArray(S))return U(S,function(M){return d(M,y)});switch(S.tag){case"wildcard":return"(.*?)";case"named":return"(["+y+"]+)";case"static":return m(S.value);case"optional":return"(?:"+d(S.value,y)+")?"}},c=function(S,y){return y==null&&(y=A.segmentValueCharset),"^"+d(S,y)+"$"},o=function(S){if(Array.isArray(S))return g(S,o);switch(S.tag){case"wildcard":return["_"];case"named":return[S.value];case"static":return[];case"optional":return o(S.value)}},f=function(S,y,M,k){var D,Y,j,ne;if(k==null&&(k=!1),ne=S[y],ne==null){if(k)throw new Error("no values provided for key `"+y+"`");return}if(D=M[y]||0,Y=Array.isArray(ne)?ne.length-1:0,D>Y){if(k)throw new Error("too few values provided for key `"+y+"`");return}return j=Array.isArray(ne)?ne[D]:ne,k&&(M[y]=D+1),j},n=function(S,y,M){var k,D;if(Array.isArray(S)){for(k=-1,D=S.length;++k<D;)if(n(S[k],y,M))return!0;return!1}switch(S.tag){case"wildcard":return f(y,"_",M,!1)!=null;case"named":return f(y,S.value,M,!1)!=null;case"static":return!1;case"optional":return n(S.value,y,M)}},B=function(S,y,M){if(Array.isArray(S))return U(S,function(k){return B(k,y,M)});switch(S.tag){case"wildcard":return f(y,"_",M,!0);case"named":return f(y,S.value,M,!0);case"static":return S.value;case"optional":return n(S.value,y,M)?B(S.value,y,M):""}},r=function(S,y){var M,k,D,Y,j;if(S instanceof r){this.isRegex=S.isRegex,this.regex=S.regex,this.ast=S.ast,this.names=S.names;return}if(this.isRegex=S instanceof RegExp,!(typeof S=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=S,y!=null){if(!Array.isArray(y))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(M=O(this.regex),y.length!==M)throw new Error("regex contains "+M+" groups but array of group names contains "+y.length);this.names=y}return}if(S==="")throw new Error("argument must not be the empty string");if(j=S.replace(/\s+/g,""),j!==S)throw new Error("argument must not contain whitespace");if(k={escapeChar:y?.escapeChar||A.escapeChar,segmentNameStartChar:y?.segmentNameStartChar||A.segmentNameStartChar,segmentNameCharset:y?.segmentNameCharset||A.segmentNameCharset,segmentValueCharset:y?.segmentValueCharset||A.segmentValueCharset,optionalSegmentStartChar:y?.optionalSegmentStartChar||A.optionalSegmentStartChar,optionalSegmentEndChar:y?.optionalSegmentEndChar||A.optionalSegmentEndChar,wildcardChar:y?.wildcardChar||A.wildcardChar},Y=E(k),D=Y.pattern(S),D==null)throw new Error("couldn't parse pattern");if(D.rest!=="")throw new Error("could only partially parse pattern");this.ast=D.value,this.regex=new RegExp(c(this.ast,k.segmentValueCharset)),this.names=o(this.ast)},r.prototype.match=function(S){var y,M;return M=this.regex.exec(S),M==null?null:(y=M.slice(1),this.names?C(this.names,y):y)},r.prototype.stringify=function(S){if(S==null&&(S={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(S!==Object(S))throw new Error("argument must be an object or undefined");return B(this.ast,S,{})},r.escapeForRegex=m,r.concatMap=g,r.stringConcatMap=U,r.regexGroupCount=O,r.keysAndValuesToObject=C,r.P=i,r.newParser=E,r.defaultOptions=A,r.astNodeToRegexString=c,r.astNodeToNames=o,r.getParam=f,r.astNodeContainsSegmentsForProvidedParams=n,r.stringify=B,r})})(Kr,Kr.exports)),Kr.exports}var eh=Xc();const fs=na(eh);class Ti{constructor(e){this.path=Ti.normalizePath(e)}getDataProviderKey(){return new Cs(this.path)}static normalizePath(e){const s=String(e).trim();if(!s)throw new RangeError("Endpoint: path cannot be empty");if(/^https?:\/\//i.test(s)){let d;try{d=new URL(s)}catch{throw new RangeError("Endpoint: invalid absolute URL")}return d.pathname=d.pathname.replace(/\/+/g,"/"),d.href}const i=s.indexOf("?"),r=s.indexOf("#");let n=s.length;i>=0&&(n=Math.min(n,i)),r>=0&&(n=Math.min(n,r));let o=s.slice(0,n);const c=s.slice(n);if(o=o.replace(/^\/+/,""),o=o.replace(/\/+/g,"/"),!o&&c)throw new RangeError("Endpoint: path cannot be empty");return o+c}static isNonEmpty(e){return String(e).trim().length>0}static looksLikeDataProviderPath(e){return/^\s*dataProvider\s*\(/i.test(String(e))}toString(){return this.path}}const th=50,sh=1e4,rh=100,Mn=new Map;function Li(t){return gi(t)}function Gr(t){return t.split(".")[0]??t}function Ii(t){const e=t.split("."),s=e.shift();let i=ve.get(s);return e.length&&(i=ht.traverse(i,e)),i}function ih(t){return t==null?!0:Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:typeof t=="string"?t.length===0:!1}function nh(t){return Array.isArray(t)?t.length:0}function oh(t,e){for(const o of e)if(o===t||t.startsWith(o+".")||o.startsWith(t+"."))throw new Error(`[derive] Cycle détecté : la sortie "${t}" chevauche l'entrée "${o}".`);const s=Gr(t),i=new Map;for(const[o,c]of Mn)i.set(Gr(o),new Set(c));i.set(s,new Set(e.map(Gr)));const r=new Set,n=o=>{if(r.has(o))return!0;r.add(o);for(const c of i.get(o)??[])if(n(c))return!0;return r.delete(o),!1};if(n(s))throw new Error(`[derive] Cycle détecté (chaîne) : la sortie "${t}" dépend indirectement d'elle-même.`)}function ah(t,e){Mn.set(t,new Set(e.map(s=>Gr(s))))}function lh(t){Mn.delete(t)}function ch(t){return`${Gr(Li(t))}/_state_`}function Mi(t,e){const s=ch(t);ve.get(s).set(e)}function hh(t,e,s,i){const r=typeof t.compute=="function"?t:{inputs:t,compute:e,output:s,variables:i},n=r.debounceMs??th,o=r.maxInputItems??sh,c=r.isEmpty??ih,d=Li(r.output),g=Object.entries(r.inputs).map(([ie,z])=>({alias:ie,path:Li(z)})),A=g.map(ie=>ie.path),m=r.variables?Li(r.variables):null;oh(d,A),ah(d,A);const f=Ii(d);let C,E=!1,O=0,U=null,B=!1,S="";const y=ie=>{E=!0,C=ie,f.set(ie),E=!1},M=()=>{E||B||(typeof console<"u"&&console.warn&&console.warn(`[derive] Écriture ignorée sur la sortie readonly "${d}".`),C!==void 0&&(E=!0,f.set(C),E=!1))};f.onAssign(M,!1);const k=()=>{const ie={};for(const{alias:z,path:le}of g){const pe=Ii(le).get(),Be=nh(pe);Be>o&&typeof console<"u"&&console.warn&&console.warn(`[derive] Entrée "${le}" : ${Be} éléments (> ${o}). Agrégation lourde — envisager un plafond côté fetch.`),ie[z]=pe}return ie},D=()=>m?Ii(m).get()??{}:{},Y=async()=>{if(B)return;const ie=++O;Mi(d,{status:"loading",error:null});const z=k(),le=D(),pe=JSON.stringify({inputs:z,vars:le});if(pe===S&&C!==void 0){Mi(d,{status:c(C)?"empty":"ready",error:null});return}const Be=typeof performance<"u"?performance.now():Date.now();try{const he=await Promise.resolve(r.compute(z,le));if(B||ie!==O)return;const ge=(typeof performance<"u"?performance.now():Date.now())-Be;ge>rh&&typeof console<"u"&&console.warn&&console.warn(`[derive] Évaluation longue (${Math.round(ge)} ms) → "${d}".`),S=pe,y(he),Mi(d,{status:c(he)?"empty":"ready",error:null})}catch(he){if(B||ie!==O)return;const ge=he instanceof Error?he.message:String(he);typeof console<"u"&&console.error&&console.error(`[derive] Erreur sur "${d}" :`,ge),Mi(d,{status:"error",error:ge})}},j=()=>{B||(U&&clearTimeout(U),U=setTimeout(()=>{U=null,Y()},n))},ne=[],re=ie=>{const z=Ii(ie),le=()=>j();z.onInternalMutation(le),ne.push({pub:z,handler:le})};for(const{path:ie}of g)re(ie);return m&&re(m),j(),{stop(){if(!B){B=!0,U&&clearTimeout(U);for(const{pub:ie,handler:z}of ne)ie.offInternalMutation(z);f.offAssign(M),lh(d)}},recompute(){S="",Y()}}}function Ni(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Nn={exports:{}},aa;function uh(){return aa||(aa=1,(function(t,e){(function(s){t.exports=s()})(function(){return(function(){function s(i,r,n){function o(g,A){if(!r[g]){if(!i[g]){var m=typeof Ni=="function"&&Ni;if(!A&&m)return m(g,!0);if(c)return c(g,!0);var f=new Error("Cannot find module '"+g+"'");throw f.code="MODULE_NOT_FOUND",f}var C=r[g]={exports:{}};i[g][0].call(C.exports,function(E){var O=i[g][1][E];return o(O||E)},C,C.exports,s,i,r,n)}return r[g].exports}for(var c=typeof Ni=="function"&&Ni,d=0;d<n.length;d++)o(n[d]);return o}return s})()({1:[function(s,i,r){const n=s("./utils"),o=(function(){const c=n.stringToArray,d=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],g=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],A=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],m=["Thousand","Million","Billion","Trillion"];function f(T,I){var $=function(q,V,N){var G="";if(q<=19)G=(V?" and ":"")+(N?g[q]:d[q]);else if(q<100){const Ce=Math.floor(q/10),me=q%10;G=(V?" and ":"")+A[Ce-2],me>0?G+="-"+$(me,!1,N):N&&(G=G.substring(0,G.length-1)+"ieth")}else if(q<1e3){const Ce=Math.floor(q/100),me=q%100;G=(V?", ":"")+d[Ce]+" Hundred",me>0?G+=$(me,!0,N):N&&(G+="th")}else{var ae=Math.floor(Math.log10(q)/3);ae>m.length&&(ae=m.length);const Ce=Math.pow(10,ae*3),me=Math.floor(q/Ce),fe=q-me*Ce;G=(V?", ":"")+$(me,!1,!1)+" "+m[ae-1],fe>0?G+=$(fe,!0,N):N&&(G+="th")}return G},F=$(T,!1,I);return F}const C=Object.create(null);d.forEach(function(T,I){C[T.toLowerCase()]=I}),g.forEach(function(T,I){C[T.toLowerCase()]=I}),A.forEach(function(T,I){const $=T.toLowerCase();C[$]=(I+2)*10,C[$.substring(0,T.length-1)+"ieth"]=C[$]}),C.hundredth=100,m.forEach(function(T,I){const $=T.toLowerCase(),F=Math.pow(10,(I+1)*3);C[$]=F,C[$+"th"]=F});function E(T){const $=T.split(/,\s|\sand\s|[\s\\-]/).map(V=>C[V]);let F=[0];return $.forEach(V=>{if(V<100){let N=F.pop();N>=1e3&&(F.push(N),N=0),F.push(N+V)}else F.push(F.pop()*V)}),F.reduce((V,N)=>V+N,0)}const O=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],U={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function B(T){for(var I=0;I<O.length;I++){const $=O[I];if(T>=$[0])return $[1]+B(T-$[0])}return""}function S(T){for(var I=0,$=1,F=T.length-1;F>=0;F--){const q=T[F],V=U[q];V<$?I-=V:($=V,I+=V)}return I}function y(T,I){for(var $=[],F=I.charCodeAt(0);T>0;)$.unshift(String.fromCharCode((T-1)%26+F)),T=Math.floor((T-1)/26);return $.join("")}function M(T,I){for(var $=I.charCodeAt(0),F=0,q=0;q<T.length;q++)F+=(T.charCodeAt(T.length-q-1)-$+1)*Math.pow(26,q);return F}function k(T,I){if(typeof T>"u")return;T=Math.floor(T);const $=re(I);return j(T,$)}const D={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},Y={UPPER:"upper",LOWER:"lower",TITLE:"title"};function j(T,I){let $;const F=T<0;switch(T=Math.abs(T),I.primary){case D.LETTERS:$=y(T,I.case===Y.UPPER?"A":"a");break;case D.ROMAN:$=B(T),I.case===Y.UPPER&&($=$.toUpperCase());break;case D.WORDS:$=f(T,I.ordinal),I.case===Y.UPPER?$=$.toUpperCase():I.case===Y.LOWER&&($=$.toLowerCase());break;case D.DECIMAL:$=""+T;var q=I.mandatoryDigits-$.length;if(q>0){var V=new Array(q+1).join("0");$=V+$}if(I.zeroCode!==48&&($=c($).map(Ce=>String.fromCodePoint(Ce.codePointAt(0)+I.zeroCode-48)).join("")),I.regular){const Ce=Math.floor(($.length-1)/I.groupingSeparators.position);for(let me=Ce;me>0;me--){const fe=$.length-me*I.groupingSeparators.position;$=$.substr(0,fe)+I.groupingSeparators.character+$.substr(fe)}}else I.groupingSeparators.reverse().forEach(Ce=>{const me=$.length-Ce.position;$=$.substr(0,me)+Ce.character+$.substr(me)});if(I.ordinal){var N={1:"st",2:"nd",3:"rd"},G=$[$.length-1],ae=N[G];(!ae||$.length>1&&$[$.length-2]==="1")&&(ae="th"),$=$+ae}break;case D.SEQUENCE:throw{code:"D3130",value:I.token}}return F&&($="-"+$),$}const ne=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function re(T){const I={type:"integer",primary:D.DECIMAL,case:Y.LOWER,ordinal:!1};let $,F;const q=T.lastIndexOf(";");switch(q===-1?$=T:($=T.substring(0,q),F=T.substring(q+1),F[0]==="o"&&(I.ordinal=!0)),$){case"A":I.case=Y.UPPER;case"a":I.primary=D.LETTERS;break;case"I":I.case=Y.UPPER;case"i":I.primary=D.ROMAN;break;case"W":I.case=Y.UPPER,I.primary=D.WORDS;break;case"Ww":I.case=Y.TITLE,I.primary=D.WORDS;break;case"w":I.primary=D.WORDS;break;default:{let V=null,N=0,G=0,ae=[],Ce=0;if(c($).map(fe=>fe.codePointAt(0)).reverse().forEach(fe=>{let ue=!1;for(let De=0;De<ne.length;De++){const de=ne[De];if(fe>=de&&fe<=de+9){if(ue=!0,N++,Ce++,V===null)V=de;else if(de!==V)throw{code:"D3131"};break}}ue||(fe===35?(Ce++,G++):ae.push({position:Ce,character:String.fromCodePoint(fe)}))}),N>0){I.primary=D.DECIMAL,I.zeroCode=V,I.mandatoryDigits=N,I.optionalDigits=G;const ue=function(De){if(De.length===0)return 0;const de=De[0].character;for(let it=1;it<De.length;it++)if(De[it].character!==de)return 0;const mt=De.map(it=>it.position),Yt=function(it,Pt){return Pt===0?it:Yt(Pt,it%Pt)},St=mt.reduce(Yt);for(let it=1;it<=mt.length;it++)if(mt.indexOf(it*St)===-1)return 0;return St}(ae);ue>0?(I.regular=!0,I.groupingSeparators={position:ue,character:ae[0].character}):(I.regular=!1,I.groupingSeparators=ae)}else I.primary=D.SEQUENCE,I.token=$}}return I}const ie={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function z(T){var I=[];const $={type:"datetime",parts:I},F=function(ue,De){if(De>ue){let de=T.substring(ue,De);de=de.split("]]").join("]"),I.push({type:"literal",value:de})}};for(var q=0,V=0;V<T.length;){if(T.charAt(V)==="["){if(T.charAt(V+1)==="["){F(q,V),I.push({type:"literal",value:"["}),V+=2,q=V;continue}if(F(q,V),q=V,V=T.indexOf("]",q),V===-1)throw{code:"D3135"};let ue=T.substring(q+1,V);ue=ue.split(/\s+/).join("");var N={type:"marker",component:ue.charAt(0)},G=ue.lastIndexOf(","),ae;if(G!==-1){const De=ue.substring(G+1),de=De.indexOf("-");let mt,Yt;const St=function(Pt){if(!(typeof Pt>"u"||Pt==="*"))return parseInt(Pt)};de===-1?mt=De:(mt=De.substring(0,de),Yt=De.substring(de+1));const it={min:St(mt),max:St(Yt)};N.width=it,ae=ue.substring(1,G)}else ae=ue.substring(1);if(ae.length===1)N.presentation1=ae;else if(ae.length>1){var Ce=ae.charAt(ae.length-1);"atco".indexOf(Ce)!==-1?(N.presentation2=Ce,Ce==="o"&&(N.ordinal=!0),N.presentation1=ae.substring(0,ae.length-1)):N.presentation1=ae}else N.presentation1=ie[N.component];if(typeof N.presentation1>"u")throw{code:"D3132",value:N.component};if(N.presentation1[0]==="n")N.names=Y.LOWER;else if(N.presentation1[0]==="N")N.presentation1[1]==="n"?N.names=Y.TITLE:N.names=Y.UPPER;else if("YMDdFWwXxHhmsf".indexOf(N.component)!==-1){var me=N.presentation1;if(N.presentation2&&(me+=";"+N.presentation2),N.integerFormat=re(me),N.width&&N.width.min!==void 0&&N.integerFormat.mandatoryDigits<N.width.min&&(N.integerFormat.mandatoryDigits=N.width.min),N.component==="Y")if(N.n=-1,N.width&&N.width.max!==void 0)N.n=N.width.max,N.integerFormat.mandatoryDigits=N.n;else{var fe=N.integerFormat.mandatoryDigits+N.integerFormat.optionalDigits;fe>=2&&(N.n=fe)}const De=I[I.length-1];De&&De.integerFormat&&(De.integerFormat.parseWidth=De.integerFormat.mandatoryDigits)}(N.component==="Z"||N.component==="z")&&(N.integerFormat=re(N.presentation1)),I.push(N),q=V+1}V++}return F(q,V),$}const le=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],pe=["January","February","March","April","May","June","July","August","September","October","November","December"],Be=1e3*60*60*24,he=function(T){const I=Date.UTC(T.year,T.month);var $=new Date(I).getUTCDay();return $===0&&($=7),$>4?I+(8-$)*Be:I-($-1)*Be},ge=function(T,I){return{year:T,month:I,nextMonth:function(){return I===11?ge(T+1,0):ge(T,I+1)},previousMonth:function(){return I===0?ge(T-1,11):ge(T,I-1)},nextYear:function(){return ge(T+1,I)},previousYear:function(){return ge(T-1,I)}}},$e=function(T,I){return(I-T)/(Be*7)+1},ce=(T,I)=>{let $;switch(I){case"Y":$=T.getUTCFullYear();break;case"M":$=T.getUTCMonth()+1;break;case"D":$=T.getUTCDate();break;case"d":{const F=Date.UTC(T.getUTCFullYear(),T.getUTCMonth(),T.getUTCDate()),q=Date.UTC(T.getUTCFullYear(),0);$=(F-q)/Be+1;break}case"F":$=T.getUTCDay(),$===0&&($=7);break;case"W":{const F=ge(T.getUTCFullYear(),0),q=he(F),V=Date.UTC(F.year,T.getUTCMonth(),T.getUTCDate());let N=$e(q,V);if(N>52){const G=he(F.nextYear());V>=G&&(N=1)}else if(N<1){const G=he(F.previousYear());N=$e(G,V)}$=Math.floor(N);break}case"w":{const F=ge(T.getUTCFullYear(),T.getUTCMonth()),q=he(F),V=Date.UTC(F.year,F.month,T.getUTCDate());let N=$e(q,V);if(N>4){const G=he(F.nextMonth());V>=G&&(N=1)}else if(N<1){const G=he(F.previousMonth());N=$e(G,V)}$=Math.floor(N);break}case"X":{const F=ge(T.getUTCFullYear(),0),q=he(F),V=he(F.nextYear()),N=T.getTime();N<q?$=F.year-1:N>=V?$=F.year+1:$=F.year;break}case"x":{const F=ge(T.getUTCFullYear(),T.getUTCMonth()),q=he(F),V=F.nextMonth(),N=he(V),G=T.getTime();G<q?$=F.previousMonth().month+1:G>=N?$=V.month+1:$=F.month+1;break}case"H":$=T.getUTCHours();break;case"h":$=T.getUTCHours(),$=$%12,$===0&&($=12);break;case"P":$=T.getUTCHours()>=12?"pm":"am";break;case"m":$=T.getUTCMinutes();break;case"s":$=T.getUTCSeconds();break;case"f":$=T.getUTCMilliseconds();break;case"Z":case"z":break;case"C":$="ISO";break;case"E":$="ISO";break}return $};let W=null;function Ae(T,I,$){var F=0,q=0;if(typeof $<"u"){const me=parseInt($);F=Math.floor(me/100),q=me%100}var V=function(me,fe){var ue=ce(me,fe.component);if("YMDdFWwXxHhms".indexOf(fe.component)!==-1)if(fe.component==="Y"&&fe.n!==-1&&(ue=ue%Math.pow(10,fe.n)),fe.names){if(fe.component==="M"||fe.component==="x")ue=pe[ue-1];else if(fe.component==="F")ue=le[ue];else throw{code:"D3133",value:fe.component};fe.names===Y.UPPER?ue=ue.toUpperCase():fe.names===Y.LOWER&&(ue=ue.toLowerCase()),fe.width&&ue.length>fe.width.max&&(ue=ue.substring(0,fe.width.max))}else ue=j(ue,fe.integerFormat);else if(fe.component==="f")ue=j(ue,fe.integerFormat);else if(fe.component==="Z"||fe.component==="z"){const De=F*100+q;if(fe.integerFormat.regular)ue=j(De,fe.integerFormat);else{const de=fe.integerFormat.mandatoryDigits;if(de===1||de===2)ue=j(F,fe.integerFormat),q!==0&&(ue+=":"+k(q,"00"));else if(de===3||de===4)ue=j(De,fe.integerFormat);else throw{code:"D3134",value:de}}De>=0&&(ue="+"+ue),fe.component==="z"&&(ue="GMT"+ue),De===0&&fe.presentation2==="t"&&(ue="Z")}else fe.component==="P"&&fe.names===Y.UPPER&&(ue=ue.toUpperCase());return ue};let N;typeof I>"u"?(W===null&&(W=z("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),N=W):N=z(I);const G=(60*F+q)*60*1e3,ae=new Date(T+G);let Ce="";return N.parts.forEach(function(me){me.type==="literal"?Ce+=me.value:Ce+=V(ae,me)}),Ce}function b(T){var I=Object.create(null);if(T.type==="datetime")I.type="datetime",I.parts=T.parts.map(function($){var F=Object.create(null);if($.type==="literal")F.regex=$.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if($.component==="Z"||$.component==="z"){let V;Array.isArray($.integerFormat.groupingSeparators)||(V=$.integerFormat.groupingSeparators),F.regex="",$.component==="z"&&(F.regex="GMT"),F.regex+="[-+][0-9]+",V&&(F.regex+=V.character+"[0-9]+"),F.parse=function(N){$.component==="z"&&(N=N.substring(3));let G=0,ae=0;return V?(G=Number.parseInt(N.substring(0,N.indexOf(V.character))),ae=Number.parseInt(N.substring(N.indexOf(V.character)+1))):N.length-1<=2?G=Number.parseInt(N):(G=Number.parseInt(N.substring(0,3)),ae=Number.parseInt(N.substring(3))),G*60+ae}}else if($.component==="f")F.regex="[0-9]+",F.parse=function(V){return parseFloat("0."+V.substring(0,3))*1e3};else if($.integerFormat)F=b($.integerFormat);else{F.regex="[a-zA-Z]+";var q=Object.create(null);if($.component==="M"||$.component==="x")pe.forEach(function(V,N){$.width&&$.width.max?q[V.substring(0,$.width.max)]=N+1:q[V]=N+1});else if($.component==="F")le.forEach(function(V,N){N>0&&($.width&&$.width.max?q[V.substring(0,$.width.max)]=N:q[V]=N)});else if($.component==="P")q={am:0,AM:0,pm:1,PM:1};else throw{code:"D3133",value:$.component};F.parse=function(V){return q[V]}}return F.component=$.component,F});else{I.type="integer";const $=T.case===Y.UPPER;switch(T.primary){case D.LETTERS:I.regex=$?"[A-Z]+":"[a-z]+",I.parse=function(F){return M(F,$?"A":"a")};break;case D.ROMAN:I.regex=$?"[MDCLXVI]+":"[mdclxvi]+",I.parse=function(F){return S($?F:F.toUpperCase())};break;case D.WORDS:I.regex="(?:"+n.keys(C).concat("and","[\\-, ]").join("|")+")+",I.parse=function(F){return E(F.toLowerCase())};break;case D.DECIMAL:I.regex="[0-9]",T.parseWidth?I.regex+=`{${T.parseWidth}}`:I.regex+="+",T.ordinal&&(I.regex+="(?:th|st|nd|rd)"),I.parse=function(F){let q=F;return T.ordinal&&(q=F.substring(0,F.length-2)),T.regular?q=q.split(",").join(""):T.groupingSeparators.forEach(V=>{q=q.split(V.character).join("")}),T.zeroCode!==48&&(q=q.split("").map(V=>String.fromCodePoint(V.codePointAt(0)-T.zeroCode+48)).join("")),parseInt(q)};break;case D.SEQUENCE:throw{code:"D3130",value:T.token}}}return I}function _(T,I){if(typeof T>"u")return;const $=re(I);return b($).parse(T)}function te(T,I){const $=z(I),F=b($),q="^"+F.parts.map(ae=>"("+ae.regex+")").join("")+"$";var N=new RegExp(q,"i").exec(T);if(N!==null){const de=Object.create(null);for(let u=1;u<N.length;u++){const v=F.parts[u-1];v.parse&&(de[v.component]=v.parse(N[u]))}if(Object.getOwnPropertyNames(de).length===0)return;let mt=0;const Yt=u=>{mt<<=1,mt+=u?1:0},St=u=>!(~u&mt)&&!!(u&mt);"YXMxWwdD".split("").forEach(u=>Yt(de[u]));const Pt=!St(161)&&St(130),Ps=St(84),Lr=!Ps&&St(72);mt=0,"PHhmsf".split("").forEach(u=>Yt(de[u]));const J=!St(23)&&St(47),ts=(Pt?"YD":Ps?"XxwF":Lr?"XWF":"YMD")+(J?"Phmsf":"Hmsf"),di=this.environment.timestamp;let ds=!1,cr=!1;if(ts.split("").forEach(u=>{if(typeof de[u]>"u")ds?(de[u]="MDd".indexOf(u)!==-1?1:0,cr=!0):de[u]=ce(di,u);else if(ds=!0,cr)throw{code:"D3136"}}),de.M>0?de.M-=1:de.M=0,Pt){const u=Date.UTC(de.Y,0),v=(de.d-1)*1e3*60*60*24,w=new Date(u+v);de.M=w.getUTCMonth(),de.D=w.getUTCDate()}if(Ps)throw{code:"D3136"};if(Lr)throw{code:"D3136"};J&&(de.H=de.h===12?0:de.h,de.P===1&&(de.H+=12));var G=Date.UTC(de.Y,de.M,de.D,de.H,de.m,de.s,de.f);return(de.Z||de.z)&&(G-=(de.Z||de.z)*60*1e3),G}}var we=new RegExp("^\\d{4}(-[01]\\d)?(-[0-3]\\d)?(T[0-2]\\d:[0-5]\\d:[0-5]\\d)?(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function Pe(T,I){if(!(typeof T>"u"))if(typeof I>"u"){if(!we.test(T))throw{stack:new Error().stack,code:"D3110",value:T};return Date.parse(T)}else return te.call(this,T,I)}function Ee(T,I,$){if(!(typeof T>"u"))return Ae.call(this,T,I,$)}return{formatInteger:k,parseInteger:_,fromMillis:Ee,toMillis:Pe}})();i.exports=o},{"./utils":6}],2:[function(s,i,r){(function(n){(function(){var o=s("./utils");const c=(()=>{var d=o.isNumeric,g=o.isArrayOfStrings,A=o.isArrayOfNumbers,m=o.isSequence,f=o.isFunction,C=o.isLambda,E=o.isPromise,O=o.getFunctionArity,U=o.isDeepEqual,B=o.stringToArray;function S(a){if(!(typeof a>"u")){var l=0;return a.forEach(function(p){l+=p}),l}}function y(a){return typeof a>"u"?0:a.length}function M(a){if(!(typeof a>"u"||a.length===0))return Math.max.apply(Math,a)}function k(a){if(!(typeof a>"u"||a.length===0))return Math.min.apply(Math,a)}function D(a){if(!(typeof a>"u"||a.length===0)){var l=0;return a.forEach(function(p){l+=p}),l/a.length}}function Y(a,l=!1){if(!(typeof a>"u")){var p;if(typeof a=="string")p=a;else if(f(a))p="";else{if(typeof a=="number"&&!isFinite(a))throw{code:"D3001",value:a,stack:new Error().stack};var x=l?2:0;Array.isArray(a)&&a.outerWrapper&&(a=a[0]),p=JSON.stringify(a,function(P,L){return typeof L<"u"&&L!==null&&d(L)?L.toPrecision&&!Number.isInteger(L)?Number(L.toPrecision(15)):L:L&&f(L)?"":L},x)}return p}}function j(a,l,p){if(!(typeof a>"u")){var x=B(a),P=x.length;if(P+l<0&&(l=0),typeof p<"u"){if(p<=0)return"";var L=l>=0?l+p:P+l+p;return x.slice(l,L).join("")}return x.slice(l).join("")}}function ne(a,l){if(!(typeof a>"u")){var p=a.indexOf(l);return p>-1?a.substr(0,p):a}}function re(a,l){if(!(typeof a>"u")){var p=a.indexOf(l);return p>-1?a.substr(p+l.length):a}}function ie(a){if(!(typeof a>"u"))return a.toLowerCase()}function z(a){if(!(typeof a>"u"))return a.toUpperCase()}function le(a){if(!(typeof a>"u"))return B(a).length}function pe(a){if(!(typeof a>"u")){var l=a.replace(/[ \t\n\r]+/gm," ");return l.charAt(0)===" "&&(l=l.substring(1)),l.charAt(l.length-1)===" "&&(l=l.substring(0,l.length-1)),l}}function Be(a,l,p){if(!(typeof a>"u")){(typeof p>"u"||p.length===0)&&(p=" ");var x;l=Math.trunc(l);var P=Math.abs(l)-le(a);if(P>0){var L=new Array(P+1).join(p);p.length>1&&(L=j(L,0,P)),l>0?x=a+L:x=L+a}else x=a;return x}}async function he(a,l){var p=a.apply(this,[l]);if(E(p)&&(p=await p),p&&!(typeof p.start=="number"||p.end==="number"||Array.isArray(p.groups)||f(p.next)))throw{code:"T1010",stack:new Error().stack};return p}async function ge(a,l){if(!(typeof a>"u"||typeof l>"u")){var p;if(typeof l=="string")p=a.indexOf(l)!==-1;else{var x=await he(l,a);p=typeof x<"u"}return p}}async function $e(a,l,p){if(!(typeof a>"u")){if(p<0)throw{stack:new Error().stack,value:p,code:"D3040",index:3};var x=this.createSequence();if(typeof p>"u"||p>0){var P=0,L=await he(l,a);if(typeof L<"u")for(;typeof L<"u"&&(typeof p>"u"||P<p);)x.push({match:L.match,index:L.start,groups:L.groups}),L=await he(L.next),P++}return x}}async function ce(a,l,p,x){if(!(typeof a>"u")){var P=this;if(l==="")throw{code:"D3010",stack:new Error().stack,value:l,index:2};if(x<0)throw{code:"D3011",stack:new Error().stack,value:x,index:4};var L;typeof p=="string"?L=function(Ge){for(var nt="",Me=0,Qe=p.indexOf("$",Me);Qe!==-1&&Me<p.length;){nt+=p.substring(Me,Qe),Me=Qe+1;var Zt=p.charAt(Me);if(Zt==="$")nt+="$",Me++;else if(Zt==="0")nt+=Ge.match,Me++;else{var xt;if(Ge.groups.length===0?xt=1:xt=Math.floor(Math.log(Ge.groups.length)*Math.LOG10E)+1,Qe=parseInt(p.substring(Me,Me+xt),10),xt>1&&Qe>Ge.groups.length&&(Qe=parseInt(p.substring(Me,Me+xt-1),10)),isNaN(Qe))nt+="$";else{if(Ge.groups.length>0){var ps=Ge.groups[Qe-1];typeof ps<"u"&&(nt+=ps)}Me+=Qe.toString().length}}Qe=p.indexOf("$",Me)}return nt+=p.substring(Me),nt}:L=p;var H="",K=0;if(typeof x>"u"||x>0){var _e=0;if(typeof l=="string"){for(var oe=a.indexOf(l,K);oe!==-1&&(typeof x>"u"||_e<x);)H+=a.substring(K,oe),H+=p,K=oe+l.length,_e++,oe=a.indexOf(l,K);H+=a.substring(K)}else{var je=await he(l,a);if(typeof je<"u"){for(;typeof je<"u"&&(typeof x>"u"||_e<x);){H+=a.substring(K,je.start);var Ke=L.apply(P,[je]);if(E(Ke)&&(Ke=await Ke),typeof Ke=="string")H+=Ke;else throw{code:"D3012",stack:new Error().stack,value:Ke};K=je.start+je.match.length,_e++,je=await he(je.next)}H+=a.substring(K)}else H=a}}else H=a;return H}}function W(a){if(!(typeof a>"u")){var l=typeof window<"u"?window.btoa:function(p){return new n.Buffer.from(p,"binary").toString("base64")};return l(a)}}function Ae(a){if(!(typeof a>"u")){var l=typeof window<"u"?window.atob:function(p){return new n.Buffer.from(p,"base64").toString("binary")};return l(a)}}function b(a){if(!(typeof a>"u")){var l;try{l=encodeURIComponent(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"encodeUrlComponent"}}return l}}function _(a){if(!(typeof a>"u")){var l;try{l=encodeURI(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"encodeUrl"}}return l}}function te(a){if(!(typeof a>"u")){var l;try{l=decodeURIComponent(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"decodeUrlComponent"}}return l}}function we(a){if(!(typeof a>"u")){var l;try{l=decodeURI(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"decodeUrl"}}return l}}async function Pe(a,l,p){if(!(typeof a>"u")){if(p<0)throw{code:"D3020",stack:new Error().stack,value:p,index:3};var x=[];if(typeof p>"u"||p>0)if(typeof l=="string")x=a.split(l,p);else{var P=0,L=await he(l,a);if(typeof L<"u"){for(var H=0;typeof L<"u"&&(typeof p>"u"||P<p);)x.push(a.substring(H,L.start)),H=L.end,L=await he(L.next),P++;(typeof p>"u"||P<p)&&x.push(a.substring(H))}else x.push(a)}return x}}function Ee(a,l){if(!(typeof a>"u"))return typeof l>"u"&&(l=""),a.join(l)}function T(a,l,p){if(!(typeof a>"u")){var x={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"},P=x;typeof p<"u"&&o.keys(p).forEach(function(be){P[be]=p[be]});for(var L=[],H=P["zero-digit"].charCodeAt(0),K=H;K<H+10;K++)L.push(String.fromCharCode(K));var _e=L.concat([P["decimal-separator"],P["exponent-separator"],P["grouping-separator"],P.digit,P["pattern-separator"]]),oe=l.split(P["pattern-separator"]);if(oe.length>2)throw{code:"D3080",stack:new Error().stack};var je=function(be){var Ze=(function(){for(var ut,qt=0;qt<be.length;qt++)if(ut=be.charAt(qt),_e.indexOf(ut)!==-1&&ut!==P["exponent-separator"])return be.substring(0,qt);return""})(),Ct=(function(){for(var ut,qt=be.length-1;qt>=0;qt--)if(ut=be.charAt(qt),_e.indexOf(ut)!==-1&&ut!==P["exponent-separator"])return be.substring(qt+1);return""})(),Ye=be.substring(Ze.length,be.length-Ct.length),Ft,Hs,Rt,hr,zt=be.indexOf(P["exponent-separator"],Ze.length);zt===-1||zt>be.length-Ct.length?(Ft=Ye,Hs=void 0):(Ft=Ye.substring(0,zt),Hs=Ye.substring(zt+1));var ss=Ft.indexOf(P["decimal-separator"]);return ss===-1?(Rt=Ft,hr=Ct):(Rt=Ft.substring(0,ss),hr=Ft.substring(ss+1)),{prefix:Ze,suffix:Ct,activePart:Ye,mantissaPart:Ft,exponentPart:Hs,integerPart:Rt,fractionalPart:hr,subpicture:be}},Ke=function(be){var Ze,Ct,Ye=be.subpicture,Ft=Ye.indexOf(P["decimal-separator"]);Ft!==Ye.lastIndexOf(P["decimal-separator"])&&(Ze="D3081"),Ye.indexOf(P.percent)!==Ye.lastIndexOf(P.percent)&&(Ze="D3082"),Ye.indexOf(P["per-mille"])!==Ye.lastIndexOf(P["per-mille"])&&(Ze="D3083"),Ye.indexOf(P.percent)!==-1&&Ye.indexOf(P["per-mille"])!==-1&&(Ze="D3084");var Hs=!1;for(Ct=0;Ct<be.mantissaPart.length;Ct++){var Rt=be.mantissaPart.charAt(Ct);if(L.indexOf(Rt)!==-1||Rt===P.digit){Hs=!0;break}}Hs||(Ze="D3085");var hr=be.activePart.split("").map(function(ut){return _e.indexOf(ut)===-1?"p":"a"}).join("");hr.indexOf("p")!==-1&&(Ze="D3086"),Ft!==-1?(Ye.charAt(Ft-1)===P["grouping-separator"]||Ye.charAt(Ft+1)===P["grouping-separator"])&&(Ze="D3087"):be.integerPart.charAt(be.integerPart.length-1)===P["grouping-separator"]&&(Ze="D3088"),Ye.indexOf(P["grouping-separator"]+P["grouping-separator"])!==-1&&(Ze="D3089");var zt=be.integerPart.indexOf(P.digit);zt!==-1&&be.integerPart.substring(0,zt).split("").filter(function(ut){return L.indexOf(ut)>-1}).length>0&&(Ze="D3090"),zt=be.fractionalPart.lastIndexOf(P.digit),zt!==-1&&be.fractionalPart.substring(zt).split("").filter(function(ut){return L.indexOf(ut)>-1}).length>0&&(Ze="D3091");var ss=typeof be.exponentPart=="string";if(ss&&be.exponentPart.length>0&&(Ye.indexOf(P.percent)!==-1||Ye.indexOf(P["per-mille"])!==-1)&&(Ze="D3092"),ss&&(be.exponentPart.length===0||be.exponentPart.split("").filter(function(ut){return L.indexOf(ut)===-1}).length>0)&&(Ze="D3093"),Ze)throw{code:Ze,stack:new Error().stack}},Ge=function(be){var Ze=function(gt,mn){for(var mi=[],xs=gt.indexOf(P["grouping-separator"]);xs!==-1;){var gn=(mn?gt.substring(0,xs):gt.substring(xs)).split("").filter(function(Nr){return L.indexOf(Nr)!==-1||Nr===P.digit}).length;mi.push(gn),xs=be.integerPart.indexOf(P["grouping-separator"],xs+1)}return mi},Ct=Ze(be.integerPart),Ye=function(gt){if(gt.length===0)return 0;for(var mn=function(gn,Nr){return Nr===0?gn:mn(Nr,gn%Nr)},mi=gt.reduce(mn),xs=1;xs<=gt.length;xs++)if(gt.indexOf(xs*mi)===-1)return 0;return mi},Ft=Ye(Ct),Hs=Ze(be.fractionalPart,!0),Rt=be.integerPart.split("").filter(function(gt){return L.indexOf(gt)!==-1}).length,hr=Rt,zt=be.fractionalPart.split(""),ss=zt.filter(function(gt){return L.indexOf(gt)!==-1}).length,ut=zt.filter(function(gt){return L.indexOf(gt)!==-1||gt===P.digit}).length,qt=typeof be.exponentPart=="string";Rt===0&&ut===0&&(qt?(ss=1,ut=1):Rt=1),qt&&Rt===0&&be.integerPart.indexOf(P.digit)!==-1&&(Rt=1),Rt===0&&ss===0&&(ss=1);var Kl=0;return qt&&(Kl=be.exponentPart.split("").filter(function(gt){return L.indexOf(gt)!==-1}).length),{integerPartGroupingPositions:Ct,regularGrouping:Ft,minimumIntegerPartSize:Rt,scalingFactor:hr,prefix:be.prefix,fractionalPartGroupingPositions:Hs,minimumFactionalPartSize:ss,maximumFactionalPartSize:ut,minimumExponentSize:Kl,suffix:be.suffix,picture:be.subpicture}},nt=oe.map(je);nt.forEach(Ke);var Me=nt.map(Ge),Qe=P["minus-sign"],Zt=P["zero-digit"],xt=P["decimal-separator"],ps=P["grouping-separator"];Me.length===1&&(Me.push(JSON.parse(JSON.stringify(Me[0]))),Me[1].prefix=Qe+Me[1].prefix);var ot;a>=0?ot=Me[0]:ot=Me[1];var pi;ot.picture.indexOf(P.percent)!==-1?pi=a*100:ot.picture.indexOf(P["per-mille"])!==-1?pi=a*1e3:pi=a;var Bs,Mr;if(ot.minimumExponentSize===0)Bs=pi;else{var rg=Math.pow(10,ot.scalingFactor),ig=Math.pow(10,ot.scalingFactor-1);if(Bs=pi,Mr=0,Bs!==0){for(;Math.abs(Bs)<ig;)Bs*=10,Mr-=1;for(;Math.abs(Bs)>rg;)Bs/=10,Mr+=1}}var ng=N(Bs,ot.maximumFactionalPartSize),Vl=function(be,Ze){var Ct=Math.abs(be).toFixed(Ze);return Zt!=="0"&&(Ct=Ct.split("").map(function(Ye){return Ye>="0"&&Ye<="9"?L[Ye.charCodeAt(0)-48]:Ye}).join("")),Ct},ke=Vl(ng,ot.maximumFactionalPartSize),At=ke.indexOf(".");for(At===-1?ke=ke+xt:ke=ke.replace(".",xt);ke.charAt(0)===Zt;)ke=ke.substring(1);for(;ke.charAt(ke.length-1)===Zt;)ke=ke.substring(0,ke.length-1);At=ke.indexOf(xt);var fi=ot.minimumIntegerPartSize-At,Wl=ot.minimumFactionalPartSize-(ke.length-At-1);if(ke=(fi>0?new Array(fi+1).join(Zt):"")+ke,ke=ke+(Wl>0?new Array(Wl+1).join(Zt):""),At=ke.indexOf(xt),ot.regularGrouping>0)for(var og=Math.floor((At-1)/ot.regularGrouping),pn=1;pn<=og;pn++)ke=[ke.slice(0,At-pn*ot.regularGrouping),ps,ke.slice(At-pn*ot.regularGrouping)].join("");else ot.integerPartGroupingPositions.forEach(function(be){ke=[ke.slice(0,At-be),ps,ke.slice(At-be)].join(""),At++});if(At=ke.indexOf(xt),ot.fractionalPartGroupingPositions.forEach(function(be){ke=[ke.slice(0,be+At+1),ps,ke.slice(be+At+1)].join("")}),At=ke.indexOf(xt),(ot.picture.indexOf(xt)===-1||At===ke.length-1)&&(ke=ke.substring(0,ke.length-1)),typeof Mr<"u"){var fn=Vl(Mr,0);fi=ot.minimumExponentSize-fn.length,fi>0&&(fn=new Array(fi+1).join(Zt)+fn),ke=ke+P["exponent-separator"]+(Mr<0?Qe:"")+fn}return ke=ot.prefix+ke+ot.suffix,ke}}function I(a,l){if(!(typeof a>"u")){if(a=N(a),typeof l>"u"?l=10:l=N(l),l<2||l>36)throw{code:"D3100",stack:new Error().stack,value:l};var p=a.toString(l);return p}}function $(a){var l;if(!(typeof a>"u")){if(typeof a=="number")l=a;else if(typeof a=="string"&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(a)&&!isNaN(parseFloat(a))&&isFinite(a))l=parseFloat(a);else if(typeof a=="string"&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(a))l=Number(a);else if(a===!0)l=1;else if(a===!1)l=0;else throw{code:"D3030",value:a,stack:new Error().stack,index:1};return l}}function F(a){var l;if(!(typeof a>"u"))return l=Math.abs(a),l}function q(a){var l;if(!(typeof a>"u"))return l=Math.floor(a),l}function V(a){var l;if(!(typeof a>"u"))return l=Math.ceil(a),l}function N(a,l){var p;if(!(typeof a>"u")){if(l){var x=a.toString().split("e");a=+(x[0]+"e"+(x[1]?+x[1]+l:l))}p=Math.round(a);var P=p-a;return Math.abs(P)===.5&&Math.abs(p%2)===1&&(p=p-1),l&&(x=p.toString().split("e"),p=+(x[0]+"e"+(x[1]?+x[1]-l:-l))),Object.is(p,-0)&&(p=0),p}}function G(a){var l;if(!(typeof a>"u")){if(a<0)throw{stack:new Error().stack,code:"D3060",index:1,value:a};return l=Math.sqrt(a),l}}function ae(a,l){var p;if(!(typeof a>"u")){if(p=Math.pow(a,l),!isFinite(p))throw{stack:new Error().stack,code:"D3061",index:1,value:a,exp:l};return p}}function Ce(){return Math.random()}function me(a){if(!(typeof a>"u")){var l=!1;if(Array.isArray(a)){if(a.length===1)l=me(a[0]);else if(a.length>1){var p=a.filter(function(x){return me(x)});l=p.length>0}}else typeof a=="string"?a.length>0&&(l=!0):d(a)?a!==0&&(l=!0):a!==null&&typeof a=="object"&&!f(a)?o.keys(a).length>0&&(l=!0):typeof a=="boolean"&&a===!0&&(l=!0);return l}}function fe(a){if(!(typeof a>"u"))return!me(a)}function ue(a,l,p,x){var P=[l],L=O(a);return L>=2&&P.push(p),L>=3&&P.push(x),P}async function De(a,l){if(!(typeof a>"u")){for(var p=this.createSequence(),x=0;x<a.length;x++){var P=ue(l,a[x],x,a),L=await l.apply(this,P);typeof L<"u"&&p.push(L)}return p}}async function de(a,l){if(!(typeof a>"u")){for(var p=this.createSequence(),x=0;x<a.length;x++){var P=a[x],L=ue(l,P,x,a),H=await l.apply(this,L);me(H)&&p.push(P)}return p}}async function mt(a,l){if(!(typeof a>"u")){for(var p=!1,x,P=0;P<a.length;P++){var L=a[P],H=!0;if(typeof l<"u"){var K=ue(l,L,P,a),_e=await l.apply(this,K);H=me(_e)}if(H)if(!p)x=L,p=!0;else throw{stack:new Error().stack,code:"D3138",index:P}}if(!p)throw{stack:new Error().stack,code:"D3139"};return x}}function Yt(){for(var a=[],l=Array.prototype.slice.call(arguments),p=Math.min.apply(Math,l.map(function(L){return Array.isArray(L)?L.length:0})),x=0;x<p;x++){var P=l.map(L=>L[x]);a.push(P)}return a}async function St(a,l,p){if(!(typeof a>"u")){var x,P=O(l);if(P<2)throw{stack:new Error().stack,code:"D3050",index:1};var L;for(typeof p>"u"&&a.length>0?(x=a[0],L=1):(x=p,L=0);L<a.length;){var H=[x,a[L]];P>=3&&H.push(L),P>=4&&H.push(a),x=await l.apply(this,H),L++}return x}}function it(a){var l=this.createSequence();if(Array.isArray(a)){for(var p=Object.create(null),x=0;x<a.length;x++){var P=it.call(this,a[x]);P.forEach(function(L){p[L]=!0})}l=it.call(this,p)}else a!==null&&typeof a=="object"&&!f(a)&&o.keys(a).forEach(L=>l.push(L));return l}function Pt(a,l){var p;if(Array.isArray(a)){p=this.createSequence();for(var x=0;x<a.length;x++){var P=Pt.call(this,a[x],l);typeof P<"u"&&(Array.isArray(P)?P.forEach(L=>p.push(L)):p.push(P))}}else a!==null&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,l)&&!f(a)&&(p=a[l]);return p}function Ps(a,l){if(typeof a>"u")return l;if(typeof l>"u")return a;Array.isArray(a)||(a=this.createSequence(a)),Array.isArray(l)||(l=[l]);const p=a.length+l.length;if(this.options&&p>this.options.sequence)throw{code:"D2015",stack:new Error().stack,value:p};return a.concat(l)}function Lr(a){return!(typeof a>"u")}function Ir(a){var l=this.createSequence();if(Array.isArray(a))for(var p=0;p<a.length;p++)l=Ps.call(this,l,Ir.call(this,a[p]));else if(a!==null&&typeof a=="object"&&!C(a))for(const P of o.keys(a)){var x=Object.create(null);x[P]=a[P],l.push(x)}else l=a;return l}function J(a){if(!(typeof a>"u")){var l=Object.create(null);return a.forEach(function(p){for(const x of o.keys(p))l[x]=p[x]}),l}}function un(a){if(!(typeof a>"u")){if(a.length<=1)return a;for(var l=a.length,p=new Array(l),x=0;x<l;x++)p[l-x-1]=a[x];return p}}async function dn(a,l){var p=this.createSequence();for(const L of o.keys(a)){var x=ue(l,a[L],L,a),P=await l.apply(this,x);typeof P<"u"&&p.push(P)}return p}function ts(a){throw{code:"D3137",stack:new Error().stack,message:a||"$error() function evaluated"}}function di(a,l){if(!a)throw{code:"D3141",stack:new Error().stack,message:l||"$assert() statement failed"}}function ds(a){if(a!==void 0)return a===null?"null":d(a)?"number":typeof a=="string"?"string":typeof a=="boolean"?"boolean":Array.isArray(a)?"array":f(a)?"function":"object"}async function cr(a,l){if(!(typeof a>"u")){if(a.length<=1)return a;var p;if(typeof l>"u"){if(!A(a)&&!g(a))throw{stack:new Error().stack,code:"D3070",index:1};p=async function(H,K){return H>K}}else p=l;var x=async function(H,K){var _e=async function(je,Ke,Ge){Ke.length===0?Array.prototype.push.apply(je,Ge):Ge.length===0?Array.prototype.push.apply(je,Ke):await p(Ke[0],Ge[0])?(je.push(Ge[0]),await _e(je,Ke,Ge.slice(1))):(je.push(Ke[0]),await _e(je,Ke.slice(1),Ge))},oe=[];return await _e(oe,H,K),oe},P=async function(H){if(!Array.isArray(H)||H.length<=1)return H;var K=Math.floor(H.length/2),_e=H.slice(0,K),oe=H.slice(K);return _e=await P(_e),oe=await P(oe),await x(_e,oe)},L=await P(a);return L}}function u(a){if(!(typeof a>"u")){if(a.length<=1)return a;for(var l=new Array(a.length),p=0;p<a.length;p++){var x=Math.floor(Math.random()*(p+1));p!==x&&(l[p]=l[x]),l[x]=a[p]}return l}}function v(a){if(!(typeof a>"u")){if(!Array.isArray(a)||a.length<=1)return a;for(var l=m(a)?this.createSequence():[],p=0;p<a.length;p++){for(var x=a[p],P=!1,L=0;L<l.length;L++)if(U(x,l[L])){P=!0;break}P||l.push(x)}return l}}async function w(a,l){var p=Object.create(null);for(const H of o.keys(a)){var x=a[H],P=ue(l,x,H,a),L=await l.apply(this,P);me(L)&&(p[H]=x)}return o.keys(p).length===0&&(p=void 0),p}return{sum:S,count:y,max:M,min:k,average:D,string:Y,substring:j,substringBefore:ne,substringAfter:re,lowercase:ie,uppercase:z,length:le,trim:pe,pad:Be,match:$e,contains:ge,replace:ce,split:Pe,join:Ee,formatNumber:T,formatBase:I,number:$,floor:q,ceil:V,round:N,abs:F,sqrt:G,power:ae,random:Ce,boolean:me,not:fe,map:De,zip:Yt,filter:de,single:mt,foldLeft:St,sift:w,keys:it,lookup:Pt,append:Ps,exists:Lr,spread:Ir,merge:J,reverse:un,each:dn,error:ts,assert:di,type:ds,sort:cr,shuffle:u,distinct:v,base64encode:W,base64decode:Ae,encodeUrlComponent:b,encodeUrl:_,decodeUrlComponent:te,decodeUrl:we}})();i.exports=c}).call(this)}).call(this,typeof ia<"u"?ia:typeof self<"u"?self:typeof window<"u"?window:{})},{"./utils":6}],3:[function(s,i,r){var n=s("./datetime"),o=s("./functions"),c=s("./utils"),d=s("./parser"),g=s("./signature"),A=(function(){var m=c.isNumeric,f=c.isArrayOfStrings,C=c.isArrayOfNumbers,E=c.isSequence,O=c.isFunction,U=c.isLambda,B=c.isIterable,S=c.isPromise,y=c.getFunctionArity,M=c.isDeepEqual,k=ts(null);async function D(u,v,w){var a;w.base.depth++,w.base.guardrails();var l=w.lookup(Symbol.for("jsonata.__evaluate_entry"));switch(l&&await l(u,v,w),u.type){case"path":a=await Y(u,v,w);break;case"binary":a=await le(u,v,w);break;case"unary":a=await pe(u,v,w);break;case"name":a=Be(u,v,w);break;case"string":case"number":case"value":a=he(u);break;case"wildcard":a=ge(u,v,w);break;case"descendant":a=ce(u,v,w);break;case"parent":a=w.lookup(u.slot.label);break;case"condition":a=await q(u,v,w);break;case"block":a=await V(u,v,w);break;case"bind":a=await F(u,v,w);break;case"regex":a=N(u,v,w);break;case"function":a=await ue(u,v,w);break;case"variable":a=G(u,v,w);break;case"lambda":a=mt(u,v,w);break;case"partial":a=await Yt(u,v,w);break;case"apply":a=await fe(u,v,w);break;case"transform":a=Ce(u,v,w);break}if(Object.prototype.hasOwnProperty.call(u,"predicate"))for(var p=0;p<u.predicate.length;p++)a=await z(u.predicate[p].expr,a,w);u.type!=="path"&&Object.prototype.hasOwnProperty.call(u,"group")&&(a=await T(u.group,a,w));var x=w.lookup(Symbol.for("jsonata.__evaluate_exit"));return x&&await x(u,v,w,a),a&&E(a)&&!a.tupleStream&&(u.keepArray&&(a.keepSingleton=!0),a.length===0?a=void 0:a.length===1&&(a=a.keepSingleton?a:a[0])),w.base.depth--,a}async function Y(u,v,w){var a;Array.isArray(v)&&u.steps[0].type!=="variable"?a=v:a=w.base.createSequence(v);for(var l,p=!1,x=void 0,P=0;P<u.steps.length;P++){var L=u.steps[P];if(L.tuple&&(p=!0),P===0&&L.consarray?l=await D(L,a,w):p?x=await ie(L,a,x,w):l=await ne(L,a,w,P===u.steps.length-1),!p&&(typeof l>"u"||l.length===0))break;typeof L.focus>"u"&&(a=l)}if(p)if(u.tuple)l=x;else for(l=w.base.createSequence(),P=0;P<x.length;P++)l.push(x[P]["@"]);return u.keepSingletonArray&&(Array.isArray(l)&&l.cons&&!l.sequence&&(l=w.base.createSequence(l)),l.keepSingleton=!0),Object.prototype.hasOwnProperty.call(u,"group")&&(l=await T(u.group,p?x:l,w)),l}function j(u,v){var w=ts(u);for(const a of c.keys(v))w.bind(a,v[a]);return w}async function ne(u,v,w,a){var l;if(u.type==="sort")return l=await ae(u,v,w),u.stages&&(l=await re(u.stages,l,w)),l;l=w.base.createSequence();for(var p=0;p<v.length;p++){var x=await D(u,v[p],w);if(u.stages)for(var P=0;P<u.stages.length;P++)x=await z(u.stages[P].expr,x,w);typeof x<"u"&&l.push(x)}var L=w.base.createSequence();return a&&l.length===1&&Array.isArray(l[0])&&!E(l[0])?L=l[0]:Array.prototype.forEach.call(l,function(H){!Array.isArray(H)||H.cons?L.push(H):Array.prototype.forEach.call(H,K=>L.push(K))}),L}async function re(u,v,w){for(var a=v,l=0;l<u.length;l++){var p=u[l];switch(p.type){case"filter":a=await z(p.expr,a,w);break;case"index":for(var x=0;x<a.length;x++){var P=a[x];P[p.value]=x}break}}return a}async function ie(u,v,w,a){var l;if(u.type==="sort"){if(w)l=await ae(u,w,a);else{var p=await ae(u,v,a);l=a.base.createSequence(),l.tupleStream=!0;for(var x=0;x<p.length;x++){var P={"@":p[x]};P[u.index]=x,l.push(P)}}return u.stages&&(l=await re(u.stages,l,a)),l}l=a.base.createSequence(),l.tupleStream=!0;var L=a;w===void 0&&(w=v.map(oe=>({"@":oe})));for(var H=0;H<w.length;H++){L=j(a,w[H]);var K=await D(u,w[H]["@"],L);if(typeof K<"u"){Array.isArray(K)||(K=[K]);for(var _e=0;_e<K.length;_e++)P=Object.create(null),Object.assign(P,w[H]),K.tupleStream?Object.assign(P,K[_e]):(u.focus?(P[u.focus]=K[_e],P["@"]=w[H]["@"]):P["@"]=K[_e],u.index&&(P[u.index]=_e),u.ancestor&&(P[u.ancestor.label]=w[H]["@"])),l.push(P)}}return u.stages&&(l=await re(u.stages,l,a)),l}async function z(u,v,w){var a=w.base.createSequence();if(v&&v.tupleStream&&(a.tupleStream=!0),Array.isArray(v)||(v=w.base.createSequence(v)),u.type==="number"){var l=Math.floor(u.value);l<0&&(l=v.length+l);var p=await v[l];typeof p<"u"&&(Array.isArray(p)?a=p:a.push(p))}else for(l=0;l<v.length;l++){var p=v[l],x=p,P=w;v.tupleStream&&(x=p["@"],P=j(w,p));var L=await D(u,x,P);m(L)&&(L=[L]),C(L)?Array.prototype.forEach.call(L,function(K){var _e=Math.floor(K);_e<0&&(_e=v.length+_e),_e===l&&a.push(p)}):o.boolean(L)&&a.push(p)}return a}async function le(u,v,w){var a,l=await D(u.lhs,v,w),p=u.value,x=async()=>await D(u.rhs,v,w);if(p==="and"||p==="or")try{return await we(l,x,p)}catch(L){throw L.position=u.position,L.token=p,L}var P=await x();try{switch(p){case"+":case"-":case"*":case"/":case"%":a=Ae(l,P,p);break;case"=":case"!=":a=b(l,P,p);break;case"<":case"<=":case">":case">=":a=_(l,P,p);break;case"&":a=Ee(l,P);break;case"..":a=$(l,P,w);break;case"in":a=te(l,P);break}}catch(L){throw L.position=u.position,L.token=p,L}return a}async function pe(u,v,w){var a,l={options:w.base.options,createSequence:w.base.createSequence};switch(u.value){case"-":if(a=await D(u.expression,v,w),typeof a>"u")a=void 0;else if(m(a))a=-a;else throw{code:"D1002",stack:new Error().stack,position:u.position,token:u.value,value:a};break;case"[":a=[];let P=await Promise.all(u.expressions.map(async(L,H)=>(w.isParallelCall=H>0,[L,await D(L,v,w)])));for(let L of P){var[p,x]=L;typeof x<"u"&&(p.value==="["?a.push(x):a=o.append.call(l,a,x))}u.consarray&&Object.defineProperty(a,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":a=await T(u,v,w);break}return a}function Be(u,v,w){var a={createSequence:w.base.createSequence};return o.lookup.call(a,v,u.value)}function he(u){return u.value}function ge(u,v,w){var a={options:w.base.options,createSequence:w.base.createSequence},l=a.createSequence();return Array.isArray(v)&&v.outerWrapper&&v.length>0&&(v=v[0]),v!==null&&typeof v=="object"&&!O(v)&&c.keys(v).forEach(function(p){var x=v[p];Array.isArray(x)?(x=$e(x),l=o.append.call(a,l,x)):l.push(x)}),l}function $e(u,v){return typeof v>"u"&&(v=[]),Array.isArray(u)?Array.prototype.forEach.call(u,function(w){$e(w,v)}):v.push(u),v}function ce(u,v,w){var a,l=w.base.createSequence();return typeof v<"u"&&(W(v,l),l.length===1?a=l[0]:a=l),a}function W(u,v){Array.isArray(u)||v.push(u),Array.isArray(u)?Array.prototype.forEach.call(u,function(w){W(w,v)}):u!==null&&typeof u=="object"&&!O(u)&&c.keys(u).forEach(function(w){W(u[w],v)})}function Ae(u,v,w){var a;if(typeof u<"u"&&!m(u))throw{code:"T2001",stack:new Error().stack,value:u};if(typeof v<"u"&&!m(v))throw{code:"T2002",stack:new Error().stack,value:v};if(typeof u>"u"||typeof v>"u")return a;switch(w){case"+":a=u+v;break;case"-":a=u-v;break;case"*":a=u*v;break;case"/":a=u/v;break;case"%":a=u%v;break}return a}function b(u,v,w){var a,l=typeof u,p=typeof v;if(l==="undefined"||p==="undefined")return!1;switch(w){case"=":a=M(u,v);break;case"!=":a=!M(u,v);break}return a}function _(u,v,w){var a,l=typeof u,p=typeof v,x=l==="undefined"||l==="string"||l==="number",P=p==="undefined"||p==="string"||p==="number";if(!x||!P)throw{code:"T2010",stack:new Error().stack,value:l==="string"||l==="number"?v:u};if(!(l==="undefined"||p==="undefined")){if(l!==p)throw{code:"T2009",stack:new Error().stack,value:u,value2:v};switch(w){case"<":a=u<v;break;case"<=":a=u<=v;break;case">":a=u>v;break;case">=":a=u>=v;break}return a}}function te(u,v){var w=!1;if(typeof u>"u"||typeof v>"u")return!1;Array.isArray(v)||(v=[v]);for(var a=0;a<v.length;a++)if(v[a]===u){w=!0;break}return w}async function we(u,v,w){var a,l=Pe(u);switch(w){case"and":a=l&&Pe(await v());break;case"or":a=l||Pe(await v());break}return a}function Pe(u){var v=o.boolean(u);return typeof v>"u"?!1:v}function Ee(u,v){var w,a="",l="";return typeof u<"u"&&(a=o.string(u)),typeof v<"u"&&(l=o.string(v)),w=a.concat(l),w}async function T(u,v,w){var a=Object.create(null),l=Object.create(null),p=!!(v&&v.tupleStream),x={options:w.base.options,createSequence:w.base.createSequence};Array.isArray(v)||(w.base.options,v=x.createSequence(v)),v.length===0&&!p&&v.push(void 0);for(var P=0;P<v.length;P++)for(var L=v[P],H=p?j(w,L):w,K=0;K<u.lhs.length;K++){var _e=u.lhs[K],oe=await D(_e[0],p?L["@"]:L,H);if(typeof oe!="string"&&oe!==void 0)throw{code:"T1003",stack:new Error().stack,position:u.position,value:oe};if(oe!==void 0){if(oe==="_jsonata_lambda"||oe==="_jsonata_function")throw{code:"D1013",stack:new Error().stack,position:u.position,value:oe};var je={data:L,exprIndex:K};if(Object.prototype.hasOwnProperty.call(l,oe)){if(l[oe].exprIndex!==K)throw{code:"D1009",stack:new Error().stack,position:u.position,value:oe};l[oe].data=o.append.call(x,l[oe].data,L)}else l[oe]=je}}let Ke=await Promise.all(c.keys(l).map(async(nt,Me)=>{let Qe=l[nt];var Zt=Qe.data,xt=w;if(p){var ps=I(Qe.data,w);Zt=ps["@"],delete ps["@"],xt=j(w,ps)}return w.isParallelCall=Me>0,[nt,await D(u.lhs[Qe.exprIndex][1],Zt,xt)]}));for(let nt of Ke){var[oe,Ge]=await nt;typeof Ge<"u"&&(a[oe]=Ge)}return a}function I(u,v){if(!Array.isArray(u))return u;var w=Object.create(null),a={options:v.base.options,createSequence:v.base.createSequence};Object.assign(w,u[0]);for(var l=1;l<u.length;l++)for(const p of c.keys(u[l]))w[p]=o.append.call(a,w[p],u[l][p]);return w}function $(u,v,w){var a;if(typeof u<"u"&&!Number.isInteger(u))throw{code:"T2003",stack:new Error().stack,value:u};if(typeof v<"u"&&!Number.isInteger(v))throw{code:"T2004",stack:new Error().stack,value:v};if(typeof u>"u"||typeof v>"u"||u>v)return a;var l=v-u+1;if(l>1e7)throw{code:"D2014",stack:new Error().stack,value:l};if(w.base.options&&l>w.base.options.sequence)throw{code:"D2015",stack:new Error().stack,value:l};a=new Array(l);for(var p=u,x=0;p<=v;p++,x++)a[x]=p;return a.sequence=!0,a}async function F(u,v,w){var a=await D(u.rhs,v,w);return w.bind(u.lhs.value,a),a}async function q(u,v,w){var a,l=await D(u.condition,v,w);return o.boolean(l)?a=await D(u.then,v,w):typeof u.else<"u"&&(a=await D(u.else,v,w)),a}async function V(u,v,w){for(var a,l=ts(w),p=0;p<u.expressions.length;p++)a=await D(u.expressions[p],v,l);return a}function N(u,v,w){var a=new w.base.RegexEngine(u.value),l=function(p,x){var P;a.lastIndex=x||0;var L=a.exec(p);if(L!==null){if(P={match:L[0],start:L.index,end:L.index+L[0].length,groups:[]},L.length>1)for(var H=1;H<L.length;H++)P.groups.push(L[H]);P.next=function(){if(!(a.lastIndex>=p.length)){var K=l(p,a.lastIndex);if(K&&K.match==="")throw{code:"D1004",stack:new Error().stack,position:u.position,value:u.value.source};return K}}}return P};return l}function G(u,v,w){var a;return u.value===""?a=v&&v.outerWrapper?v[0]:v:a=w.lookup(u.value),a}async function ae(u,v,w){var a,l=v,p=!!v.tupleStream,x=async function(L,H){for(var K=0,_e=0;K===0&&_e<u.terms.length;_e++){var oe=u.terms[_e],je=L,Ke=w;p&&(je=L["@"],Ke=j(w,L));var Ge=await D(oe.expression,je,Ke);je=H,Ke=w,p&&(je=H["@"],Ke=j(w,H));var nt=await D(oe.expression,je,Ke),Me=typeof Ge,Qe=typeof nt;if(Me==="undefined"){K=Qe==="undefined"?0:1;continue}if(Qe==="undefined"){K=-1;continue}if(!(Me==="string"||Me==="number")||!(Qe==="string"||Qe==="number"))throw{code:"T2008",stack:new Error().stack,position:u.position,value:Me==="string"||Me==="number"?nt:Ge};if(Me!==Qe)throw{code:"T2007",stack:new Error().stack,position:u.position,value:Ge,value2:nt};Ge!==nt&&(Ge<nt?K=-1:K=1,oe.descending===!0&&(K=-K))}return K===1},P={environment:w,input:v};return a=await o.sort.apply(P,[l,x]),a}function Ce(u,v,w){var a=async function(l){if(!(typeof l>"u")){var p=w.lookup("clone");if(!O(p))throw{code:"T2013",stack:new Error().stack,position:u.position};var x=await De(p,[l],null,w),P=await D(u.pattern,x,w);if(typeof P<"u"){Array.isArray(P)||(P=[P]);for(var L=0;L<P.length;L++){var H=P[L],K=await D(u.update,H,w),_e=typeof K;if(_e!=="undefined"){if(_e!=="object"||K===null||Array.isArray(K))throw{code:"T2011",stack:new Error().stack,position:u.update.position,value:K};for(const Ge of c.keys(K))H[Ge]=K[Ge]}if(typeof u.delete<"u"){var oe=await D(u.delete,H,w);if(typeof oe<"u"){var je=oe;if(Array.isArray(oe)||(oe=[oe]),!f(oe))throw{code:"T2012",stack:new Error().stack,position:u.delete.position,value:je};for(var Ke=0;Ke<oe.length;Ke++)typeof H=="object"&&H!==null&&delete H[oe[Ke]]}}}}return x}};return J(a,"<(oa):o>")}var me=d("function($f, $g) { function($x){ $g($f($x)) } }");async function fe(u,v,w){var a,l=await D(u.lhs,v,w);if(u.rhs.type==="function")a=await ue(u.rhs,v,w,{context:l});else{var p=await D(u.rhs,v,w);if(!O(p))throw{code:"T2006",stack:new Error().stack,position:u.position,value:p};if(O(l)){var x=await D(me,null,w);a=await De(x,[l,p],null,w)}else a=await De(p,[l],null,w)}return a}async function ue(u,v,w,a){var l,p=await D(u.procedure,v,w);if(typeof p>"u"&&u.procedure.type==="path"&&w.lookup(u.procedure.steps[0].value))throw{code:"T1005",stack:new Error().stack,position:u.position,token:u.procedure.steps[0].value};var x=[];typeof a<"u"&&x.push(a.context);for(var P=0;P<u.arguments.length;P++){const H=await D(u.arguments[P],v,w);if(O(H)){const K=async function(..._e){return await De(H,_e,null,w)};K.arity=y(H),x.push(K)}else x.push(H)}var L=u.procedure.type==="path"?u.procedure.steps[0].value:u.procedure.value;try{typeof p=="object"&&(p.token=L,p.position=u.position),l=await De(p,x,v,w)}catch(H){throw H.position||(H.position=u.position),H.token||(H.token=L),H}return l}async function De(u,v,w,a){var l;for(l=await de(u,v,w,a);U(l)&&l.thunk===!0;){var p=await D(l.body.procedure,l.input,l.environment);l.body.procedure.type==="variable"&&(p.token=l.body.procedure.value),p.position=l.body.procedure.position;for(var x=[],P=0;P<l.body.arguments.length;P++)x.push(await D(l.body.arguments[P],l.input,l.environment));l=await de(p,x,w,a)}return l}async function de(u,v,w,a){var l;try{var p=v;if(u&&(p=St(u.signature,v,w)),U(u))l=await it(u,p);else if(u&&u._jsonata_function===!0){var x={environment:a,input:w,options:a.base.options,createSequence:a.base.createSequence};l=u.implementation.apply(x,p),B(l)&&(l=l.next().value),S(l)&&(l=await l)}else if(typeof u=="function")l=u.apply(w,p),S(l)&&(l=await l);else throw{code:"T1006",stack:new Error().stack}}catch(P){throw u&&(typeof P.token>"u"&&typeof u.token<"u"&&(P.token=u.token),P.position=u.position||P.position),P}return l}function mt(u,v,w){var a={_jsonata_lambda:!0,input:v,environment:w,arguments:u.arguments,signature:u.signature,body:u.body};return u.thunk===!0&&(a.thunk=!0),a.apply=async function(l,p){return await De(a,p,v,l?l.environment:w)},a}async function Yt(u,v,w){for(var a,l=[],p=0;p<u.arguments.length;p++){var x=u.arguments[p];x.type==="operator"&&x.value==="?"?l.push(x):l.push(await D(x,v,w))}var P=await D(u.procedure,v,w);if(typeof P>"u"&&u.procedure.type==="path"&&w.lookup(u.procedure.steps[0].value))throw{code:"T1007",stack:new Error().stack,position:u.position,token:u.procedure.steps[0].value};if(U(P))a=Pt(P,l,w);else if(P&&P._jsonata_function===!0)a=Ps(P.implementation,l,w);else if(typeof P=="function")a=Ps(P,l,w);else throw{code:"T1008",stack:new Error().stack,position:u.position,token:u.procedure.type==="path"?u.procedure.steps[0].value:u.procedure.value};return a}function St(u,v,w){if(typeof u>"u")return v;var a=u.validate(v,w);return a}async function it(u,v){var w,a=ts(u.environment);return Array.prototype.forEach.call(u.arguments,function(l,p){a.bind(l.value,v[p])}),typeof u.body=="function"?w=await Lr(u.body,a):w=await D(u.body,u.input,a),w}function Pt(u,v,w){var a=ts(u.environment||w),l=[];Array.prototype.forEach.call(u.arguments,function(x,P){var L=v[P];L&&L.type==="operator"&&L.value==="?"?l.push(x):a.bind(x.value,L)});var p={_jsonata_lambda:!0,input:u.input,environment:a,arguments:l,body:u.body};return p}function Ps(u,v,w){var a=Ir(u);a=a.map(function(P){return"$"+P.trim()});var l="function("+a.join(", ")+"){ _ }",p=d(l);p.body=u;var x=Pt(p,v,w);return x}async function Lr(u,v){var w=Ir(u),a=w.map(function(x){return v.lookup(x.trim())}),l={environment:v,createSequence:v.base.createSequence},p=u.apply(l,a);return S(p)&&(p=await p),p}function Ir(u){var v=u.toString(),w=/\(([^)]*)\)/.exec(v)[1],a=w.split(",");return a}function J(u,v){var w={_jsonata_function:!0,implementation:u};return typeof v<"u"&&(w.signature=g(v)),w}async function un(u,v){if(!(typeof u>"u")){var w=this.input;typeof v<"u"&&(w=v,Array.isArray(w)&&!E(w)&&(w=this.createSequence(w),w.outerWrapper=!0));try{var a=d(u,!1)}catch(p){throw ds(p),{stack:new Error().stack,code:"D3120",value:p.message,error:p}}try{var l=await D(a,w,this.environment)}catch(p){throw ds(p),{stack:new Error().stack,code:"D3121",value:p.message,error:p}}return l}}function dn(u){if(!(typeof u>"u"))return JSON.parse(o.string(u))}function ts(u){var v=Object.create(null);const w={bind:function(l,p){v[l]=p},lookup:function(l){var p;return Object.prototype.hasOwnProperty.call(v,l)?p=v[l]:u&&(p=u.lookup(l)),p},timestamp:u?u.timestamp:null,async:u?u.async:!1,isParallelCall:u?u.isParallelCall:!1,global:u?u.global:{ancestry:[null]}};if(u){var a=u.lookup(Symbol.for("jsonata.__createFrame_push"));a&&a(u,w),w.base=u.base}return w}k.bind("sum",J(o.sum,"<a<n>:n>")),k.bind("count",J(o.count,"<a:n>")),k.bind("max",J(o.max,"<a<n>:n>")),k.bind("min",J(o.min,"<a<n>:n>")),k.bind("average",J(o.average,"<a<n>:n>")),k.bind("string",J(o.string,"<x-b?:s>")),k.bind("substring",J(o.substring,"<s-nn?:s>")),k.bind("substringBefore",J(o.substringBefore,"<s-s:s>")),k.bind("substringAfter",J(o.substringAfter,"<s-s:s>")),k.bind("lowercase",J(o.lowercase,"<s-:s>")),k.bind("uppercase",J(o.uppercase,"<s-:s>")),k.bind("length",J(o.length,"<s-:n>")),k.bind("trim",J(o.trim,"<s-:s>")),k.bind("pad",J(o.pad,"<s-ns?:s>")),k.bind("match",J(o.match,"<s-f<s:o>n?:a<o>>")),k.bind("contains",J(o.contains,"<s-(sf):b>")),k.bind("replace",J(o.replace,"<s-(sf)(sf)n?:s>")),k.bind("split",J(o.split,"<s-(sf)n?:a<s>>")),k.bind("join",J(o.join,"<a<s>s?:s>")),k.bind("formatNumber",J(o.formatNumber,"<n-so?:s>")),k.bind("formatBase",J(o.formatBase,"<n-n?:s>")),k.bind("formatInteger",J(n.formatInteger,"<n-s:s>")),k.bind("parseInteger",J(n.parseInteger,"<s-s:n>")),k.bind("number",J(o.number,"<(nsb)-:n>")),k.bind("floor",J(o.floor,"<n-:n>")),k.bind("ceil",J(o.ceil,"<n-:n>")),k.bind("round",J(o.round,"<n-n?:n>")),k.bind("abs",J(o.abs,"<n-:n>")),k.bind("sqrt",J(o.sqrt,"<n-:n>")),k.bind("power",J(o.power,"<n-n:n>")),k.bind("random",J(o.random,"<:n>")),k.bind("boolean",J(o.boolean,"<x-:b>")),k.bind("not",J(o.not,"<x-:b>")),k.bind("map",J(o.map,"<af>")),k.bind("zip",J(o.zip,"<a+>")),k.bind("filter",J(o.filter,"<af>")),k.bind("single",J(o.single,"<af?>")),k.bind("reduce",J(o.foldLeft,"<afj?:j>")),k.bind("sift",J(o.sift,"<o-f?:o>")),k.bind("keys",J(o.keys,"<x-:a<s>>")),k.bind("lookup",J(o.lookup,"<x-s:x>")),k.bind("append",J(o.append,"<xx:a>")),k.bind("exists",J(o.exists,"<x:b>")),k.bind("spread",J(o.spread,"<x-:a<o>>")),k.bind("merge",J(o.merge,"<a<o>:o>")),k.bind("reverse",J(o.reverse,"<a:a>")),k.bind("each",J(o.each,"<o-f:a>")),k.bind("error",J(o.error,"<s?:x>")),k.bind("assert",J(o.assert,"<bs?:x>")),k.bind("type",J(o.type,"<x:s>")),k.bind("sort",J(o.sort,"<af?:a>")),k.bind("shuffle",J(o.shuffle,"<a:a>")),k.bind("distinct",J(o.distinct,"<x:x>")),k.bind("base64encode",J(o.base64encode,"<s-:s>")),k.bind("base64decode",J(o.base64decode,"<s-:s>")),k.bind("encodeUrlComponent",J(o.encodeUrlComponent,"<s-:s>")),k.bind("encodeUrl",J(o.encodeUrl,"<s-:s>")),k.bind("decodeUrlComponent",J(o.decodeUrlComponent,"<s-:s>")),k.bind("decodeUrl",J(o.decodeUrl,"<s-:s>")),k.bind("eval",J(un,"<sx?:x>")),k.bind("toMillis",J(n.toMillis,"<s-s?:n>")),k.bind("fromMillis",J(n.fromMillis,"<n-s?s?:s>")),k.bind("clone",J(dn,"<(oa)-:o>"));var di={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",D1011:"Stack overflow. Check for non-terminating recursive function. Consider rewriting as tail-recursive",D1012:"Evaluation timeout after {{value}} milliseconds. Check for infinite loop",D1013:"Object property names starting with _jsonata_ are reserved for internal use: {{value}}",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e7. Attempted to allocate {{value}}.",D2015:"The maximum sequence length of {{value}} was exceeded.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function ds(u){var v=di[u.code];if(typeof v<"u"){var w=v.replace(/\{\{\{([^}]+)}}}/g,function(){return u[arguments[1]]});w=w.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(u[arguments[1]])}),u.message=w}}function cr(u,v){var w,a;try{w=d(u,v&&v.recover),a=w.errors,delete w.errors}catch(x){throw ds(x),x}var l=ts(k),p=new Date;return l.bind("now",J(function(x,P){return n.fromMillis(p.getTime(),x,P)},"<s?s?:s>")),l.bind("millis",J(function(){return p.getTime()},"<:n>")),{evaluate:async function(x,P,L){if(typeof a<"u"){var H={code:"S0500",position:0};throw ds(H),H}const K=ts(l);for(const oe of c.keys(P))K.bind(oe,P[oe]);if(K.bind("$",x),p=new Date,K.timestamp=p,K.options=v,K.createSequence=function(){var oe=[];return v&&v.sequence&&(oe.push=function(...je){if(oe.length+je.length>v.sequence)throw{code:"D2015",stack:new Error().stack,value:v.sequence};return Array.prototype.push.apply(oe,je)}),oe.sequence=!0,arguments.length===1&&oe.push(arguments[0]),oe},Array.isArray(x)&&!E(x)&&(x=K.createSequence(x),x.outerWrapper=!0),v&&(v.timeout||v.stack)){const oe=Date.now();K.guardrails=function(){if(v.stack>0&&K.depth>v.stack)throw{code:"D1011",value:v.stack,stack:new Error().stack};if(v.timeout>0&&Date.now()-oe>v.timeout)throw{code:"D1012",value:v.timeout,stack:new Error().stack}}}else K.guardrails=function(){};K.base=K,K.depth=0,v&&v.RegexEngine?K.RegexEngine=v.RegexEngine:K.RegexEngine=RegExp;var _e;try{return _e=await D(w,x,K),typeof L=="function"&&L(null,_e),_e}catch(oe){throw ds(oe),oe}},assign:function(x,P){l.bind(x,P)},registerFunction:function(x,P,L){var H=J(P,L);l.bind(x,H)},ast:function(){return w},errors:function(){return a}}}return cr.parser=d,cr})();i.exports=A},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(s,i,r){var n=s("./signature");const o=(()=>{var c={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,"?:":40,"??":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
73
|
-
`,r:"\r",t:" "},
|
|
74
|
-
\r\v`.indexOf(
|
|
75
|
-
\r\v`.indexOf(pe)>-1||Object.prototype.hasOwnProperty.call(c,pe)){if(m.charAt(f)==="$")return ie=m.substring(f+1,le),f=le,E("variable",ie);switch(ie=m.substring(f,le),f=le,ie){case"or":case"in":case"and":return E("operator",ie);case"true":return E("value",!0);case"false":return E("value",!1);case"null":return E("value",null);default:return f===C&&ie===""?null:E("name",ie)}}else le++};return U},A=function(m,f){var C,E,O=Object.create(null),U=[],B=function(){var b=[];C.id!=="(end)"&&b.push({type:C.type,value:C.value,position:C.position});for(var _=E();_!==null;)b.push(_),_=E();return b},S={nud:function(){var b={code:"S0211",token:this.value,position:this.position};if(f)return b.remaining=B(),b.type="error",U.push(b),b;throw b.stack=new Error().stack,b}},y=function(b,_){var te=O[b];return _=_||0,te?_>=te.lbp&&(te.lbp=_):(te=Object.create(S),te.id=te.value=b,te.lbp=_,O[b]=te),te},M=function(b){if(f){b.remaining=B(),U.push(b);var _=O["(error)"];return C=Object.create(_),C.error=b,C.type="(error)",C}else throw b.stack=new Error().stack,b},k=function(b,_){if(b&&C.id!==b){var te;C.id==="(end)"?te="S0203":te="S0202";var we={code:te,position:C.position,token:C.value,value:b};return M(we)}var Pe=E(_);if(Pe===null)return C=O["(end)"],C.position=m.length,C;var Ee=Pe.value,T=Pe.type,I;switch(T){case"name":case"variable":I=O["(name)"];break;case"operator":if(I=O[Ee],!I)return M({code:"S0204",stack:new Error().stack,position:Pe.position,token:Ee});break;case"string":case"number":case"value":I=O["(literal)"];break;case"regex":T="regex",I=O["(regex)"];break;default:return M({code:"S0205",stack:new Error().stack,position:Pe.position,token:Ee})}return C=Object.create(I),C.value=Ee,C.type=T,C.position=Pe.position,C},D=function(b){var _,te=C;for(k(null,!0),_=te.nud();b<C.lbp;)te=C,k(),_=te.led(_);return _},Y=function(b){var _=y(b,0);_.nud=function(){return this}},j=function(b,_,te){var we=_||c[b],Pe=y(b,we);return Pe.led=te||function(Ee){return this.lhs=Ee,this.rhs=D(we),this.type="binary",this},Pe},ne=function(b,_,te){var we=y(b,_);return we.led=te,we},re=function(b,_){var te=y(b);return te.nud=_||function(){return this.expression=D(70),this.type="unary",this},te};Y("(end)"),Y("(name)"),Y("(literal)"),Y("(regex)"),y(":"),y(";"),y(","),y(")"),y("]"),y("}"),y(".."),j("."),j("+"),j("-"),j("*"),j("/"),j("%"),j("="),j("<"),j(">"),j("!="),j("<="),j(">="),j("&"),j("and"),j("or"),j("in"),Y("and"),Y("or"),Y("in"),re("-"),j("~>"),j("??",c["??"],function(b){return this.type="condition",this.condition={type:"function",value:"(",procedure:{type:"variable",value:"exists"},arguments:[JSON.parse(JSON.stringify(b))]},this.then=b,this.else=D(0),this}),ne("(error)",10,function(b){return this.lhs=b,this.error=C.error,this.remaining=B(),this.type="error",this}),re("*",function(){return this.type="wildcard",this}),re("**",function(){return this.type="descendant",this}),re("%",function(){return this.type="parent",this}),j("(",c["("],function(b){if(this.procedure=b,this.type="function",this.arguments=[],C.id!==")")for(;C.type==="operator"&&C.id==="?"?(this.type="partial",this.arguments.push(C),k("?")):this.arguments.push(D(0)),C.id===",";)k(",");if(k(")",!0),b.type==="name"&&(b.value==="function"||b.value==="λ")){if(this.arguments.forEach(function(Ee,T){if(Ee.type!=="variable")return M({code:"S0208",stack:new Error().stack,position:Ee.position,token:Ee.value,value:T+1})}),this.type="lambda",C.id==="<"){for(var _=C.position,te=1,we="<";te>0&&C.id!=="{"&&C.id!=="(end)";){var Pe=k();Pe.id===">"?te--:Pe.id==="<"&&te++,we+=Pe.value}k(">");try{this.signature=n(we)}catch(Ee){return Ee.position=_+Ee.offset,M(Ee)}}k("{"),this.body=D(0),k("}")}return this}),re("(",function(){for(var b=[];C.id!==")"&&(b.push(D(0)),C.id===";");)k(";");return k(")",!0),this.type="block",this.expressions=b,this}),re("[",function(){var b=[];if(C.id!=="]")for(;;){var _=D(0);if(C.id===".."){var te={type:"binary",value:"..",position:C.position,lhs:_};k(".."),te.rhs=D(0),_=te}if(b.push(_),C.id!==",")break;k(",")}return k("]",!0),this.expressions=b,this.type="unary",this}),j("[",c["["],function(b){if(C.id==="]"){for(var _=b;_&&_.type==="binary"&&_.value==="[";)_=_.lhs;return _.keepArray=!0,k("]"),b}else return this.lhs=b,this.rhs=D(c["]"]),this.type="binary",k("]",!0),this}),j("^",c["^"],function(b){k("(");for(var _=[];;){var te={descending:!1};if(C.id==="<"?k("<"):C.id===">"&&(te.descending=!0,k(">")),te.expression=D(0),_.push(te),C.id!==",")break;k(",")}return k(")"),this.lhs=b,this.rhs=_,this.type="binary",this});var ie=function(b){var _=[];if(C.id!=="}")for(;;){var te=D(0);k(":");var we=D(0);if(_.push([te,we]),C.id!==",")break;k(",")}return k("}",!0),typeof b>"u"?(this.lhs=_,this.type="unary"):(this.lhs=b,this.rhs=_,this.type="binary"),this};re("{",ie),j("{",c["{"],ie),ne(":=",c[":="],function(b){return b.type!=="variable"?M({code:"S0212",stack:new Error().stack,position:b.position,token:b.value}):(this.lhs=b,this.rhs=D(c[":="]-1),this.type="binary",this)}),j("@",c["@"],function(b){return this.lhs=b,this.rhs=D(c["@"]),this.rhs.type!=="variable"?M({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),j("#",c["#"],function(b){return this.lhs=b,this.rhs=D(c["#"]),this.rhs.type!=="variable"?M({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),j("?",c["?"],function(b){return this.type="condition",this.condition=b,this.then=D(0),C.id===":"&&(k(":"),this.else=D(0)),this}),j("?:",c["?:"],function(b){return this.type="condition",this.condition=JSON.parse(JSON.stringify(b)),this.then=b,this.else=D(0),this}),re("|",function(){return this.type="transform",this.pattern=D(0),k("|"),this.update=D(0),C.id===","&&(k(","),this.delete=D(0)),k("|"),this});var z=function(b){var _;if(b.type==="function"&&!b.predicate){var te={type:"lambda",thunk:!0,arguments:[],position:b.position};te.body=b,_=te}else if(b.type==="condition")b.then=z(b.then),typeof b.else<"u"&&(b.else=z(b.else)),_=b;else if(b.type==="block"){var we=b.expressions.length;we>0&&(b.expressions[we-1]=z(b.expressions[we-1])),_=b}else _=b;return _},le=0,pe=0,Be=[],he=function(b,_){switch(b.type){case"name":case"wildcard":_.level--,_.level===0&&(typeof b.ancestor>"u"||(Be[_.index].slot.label=b.ancestor.label),b.ancestor=_,b.tuple=!0);break;case"parent":_.level++;break;case"block":b.expressions.length>0&&(b.tuple=!0,_=he(b.expressions[b.expressions.length-1],_));break;case"path":b.tuple=!0;var te=b.steps.length-1;for(_=he(b.steps[te--],_);_.level>0&&te>=0;)_=he(b.steps[te--],_);break;default:throw{code:"S0217",token:b.type,position:b.position}}return _},ge=function(b,_){if(typeof _.seekingParent<"u"||_.type==="parent"){var te=typeof _.seekingParent<"u"?_.seekingParent:[];_.type==="parent"&&te.push(_.slot),typeof b.seekingParent>"u"?b.seekingParent=te:Array.prototype.push.apply(b.seekingParent,te)}},$e=function(b){var _=b.steps.length-1,te=b.steps[_],we=typeof te.seekingParent<"u"?te.seekingParent:[];te.type==="parent"&&we.push(te.slot);for(var Pe=0;Pe<we.length;Pe++){var Ee=we[Pe];for(_=b.steps.length-2;Ee.level>0;){if(_<0){typeof b.seekingParent>"u"?b.seekingParent=[Ee]:b.seekingParent.push(Ee);break}for(var T=b.steps[_--];_>=0&&T.focus&&b.steps[_].focus;)T=b.steps[_--];Ee=he(T,Ee)}}},ce=function(b){var _;switch(b.type){case"binary":switch(b.value){case".":var te=ce(b.lhs);te.type==="path"?_=te:_={type:"path",steps:[te]},te.type==="parent"&&(_.seekingParent=[te.slot]);var we=ce(b.rhs);we.type==="path"?Array.prototype.push.apply(_.steps,we.steps):(typeof we.predicate<"u"&&(we.stages=we.predicate,delete we.predicate),_.steps.push(we)),_.steps.filter(function(G){if(G.type==="number"||G.type==="value")throw{code:"S0213",stack:new Error().stack,position:G.position,value:G.value};return G.type==="string"}).forEach(function(G){G.type="name"}),_.steps.filter(function(G){return G.keepArray===!0}).length>0&&(_.keepSingletonArray=!0);var Pe=_.steps[0];Pe.type==="unary"&&Pe.value==="["&&(Pe.consarray=!0);var Ee=_.steps[_.steps.length-1];Ee.type==="unary"&&Ee.value==="["&&(Ee.consarray=!0),$e(_);break;case"[":_=ce(b.lhs);var T=_,I="predicate";if(_.type==="path"&&(T=_.steps[_.steps.length-1],I="stages"),typeof T.group<"u")throw{code:"S0209",stack:new Error().stack,position:b.position};typeof T[I]>"u"&&(T[I]=[]);var $=ce(b.rhs);typeof $.seekingParent<"u"&&($.seekingParent.forEach(G=>{G.level===1?he(T,G):G.level--}),ge(T,$)),T[I].push({type:"filter",expr:$,position:b.position});break;case"{":if(_=ce(b.lhs),typeof _.group<"u")throw{code:"S0210",stack:new Error().stack,position:b.position};_.group={lhs:b.rhs.map(function(G){return[ce(G[0]),ce(G[1])]}),position:b.position};break;case"^":_=ce(b.lhs),_.type!=="path"&&(_={type:"path",steps:[_]});var F={type:"sort",position:b.position};F.terms=b.rhs.map(function(G){var ae=ce(G.expression);return ge(F,ae),{descending:G.descending,expression:ae}}),_.steps.push(F),$e(_);break;case":=":_={type:"bind",value:b.value,position:b.position},_.lhs=ce(b.lhs),_.rhs=ce(b.rhs),ge(_,_.rhs);break;case"@":if(_=ce(b.lhs),T=_,_.type==="path"&&(T=_.steps[_.steps.length-1]),typeof T.stages<"u"||typeof T.predicate<"u")throw{code:"S0215",stack:new Error().stack,position:b.position};if(T.type==="sort")throw{code:"S0216",stack:new Error().stack,position:b.position};b.keepArray&&(T.keepArray=!0),T.focus=b.rhs.value,T.tuple=!0;break;case"#":_=ce(b.lhs),T=_,_.type==="path"?T=_.steps[_.steps.length-1]:(_={type:"path",steps:[_]},typeof T.predicate<"u"&&(T.stages=T.predicate,delete T.predicate)),typeof T.stages>"u"?T.index=b.rhs.value:T.stages.push({type:"index",value:b.rhs.value,position:b.position}),T.tuple=!0;break;case"~>":_={type:"apply",value:b.value,position:b.position},_.lhs=ce(b.lhs),_.rhs=ce(b.rhs),_.keepArray=_.lhs.keepArray||_.rhs.keepArray;break;default:_={type:b.type,value:b.value,position:b.position},_.lhs=ce(b.lhs),_.rhs=ce(b.rhs),ge(_,_.lhs),ge(_,_.rhs)}break;case"unary":_={type:b.type,value:b.value,position:b.position},b.value==="["?_.expressions=b.expressions.map(function(G){var ae=ce(G);return ge(_,ae),ae}):b.value==="{"?_.lhs=b.lhs.map(function(G){var ae=ce(G[0]);ge(_,ae);var Ce=ce(G[1]);return ge(_,Ce),[ae,Ce]}):(_.expression=ce(b.expression),b.value==="-"&&_.expression.type==="number"?(_=_.expression,_.value=-_.value):ge(_,_.expression));break;case"function":case"partial":_={type:b.type,name:b.name,value:b.value,position:b.position},_.arguments=b.arguments.map(function(G){var ae=ce(G);return ge(_,ae),ae}),_.procedure=ce(b.procedure);break;case"lambda":_={type:b.type,arguments:b.arguments,signature:b.signature,position:b.position};var q=ce(b.body);_.body=z(q);break;case"condition":_={type:b.type,position:b.position},_.condition=ce(b.condition),ge(_,_.condition),_.then=ce(b.then),ge(_,_.then),typeof b.else<"u"&&(_.else=ce(b.else),ge(_,_.else));break;case"transform":_={type:b.type,position:b.position},_.pattern=ce(b.pattern),_.update=ce(b.update),typeof b.delete<"u"&&(_.delete=ce(b.delete));break;case"block":_={type:b.type,position:b.position},_.expressions=b.expressions.map(function(G){var ae=ce(G);return ge(_,ae),(ae.consarray||ae.type==="path"&&ae.steps[0].consarray)&&(_.consarray=!0),ae});break;case"name":_={type:"path",steps:[b]},b.keepArray&&(_.keepSingletonArray=!0);break;case"parent":_={type:"parent",slot:{label:"!"+le++,level:1,index:pe++}},Be.push(_);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":_=b;break;case"operator":if(b.value==="and"||b.value==="or"||b.value==="in")b.type="name",_=ce(b);else if(b.value==="?")_=b;else throw{code:"S0201",stack:new Error().stack,position:b.position,token:b.value};break;case"error":_=b,b.lhs&&(_=ce(b.lhs));break;default:var V="S0206";b.id==="(end)"&&(V="S0207");var N={code:V,position:b.position,token:b.value};if(f)return U.push(N),{type:"error",error:N};throw N.stack=new Error().stack,N}return b.keepArray&&(_.keepArray=!0),_};E=g(m),k();var W=D(0);if(C.id!=="(end)"){var Ae={code:"S0201",position:C.position,token:C.value};M(Ae)}if(W=ce(W),W.type==="parent"||typeof W.seekingParent<"u")throw{code:"S0217",token:W.type,position:W.position};return U.length>0&&(W.errors=U),W};return A})();i.exports=o},{"./signature":5}],5:[function(s,i,r){var n=s("./utils");const o=(()=>{var c={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function d(g){for(var A=1,m=[],f=Object.create(null),C=f;A<g.length;){var E=g.charAt(A);if(E===":")break;var O=function(){m.push(f),C=f,f=Object.create(null)},U=function(j,ne,re,ie){for(var z=1,le=ne;le<j.length;)if(le++,E=j.charAt(le),E===ie){if(z--,z===0)break}else E===re&&z++;return le};switch(E){case"s":case"n":case"b":case"l":case"o":f.regex="["+E+"m]",f.type=E,O();break;case"a":f.regex="[asnblfom]",f.type=E,f.array=!0,O();break;case"f":f.regex="f",f.type=E,O();break;case"j":f.regex="[asnblom]",f.type=E,O();break;case"x":f.regex="[asnblfom]",f.type=E,O();break;case"-":C.context=!0,C.contextRegex=new RegExp(C.regex),C.regex+="?";break;case"?":case"+":C.regex+=E;break;case"(":var B=U(g,A,"(",")"),S=g.substring(A+1,B);if(S.indexOf("<")===-1)f.regex="["+S+"m]";else throw{code:"S0402",stack:new Error().stack,value:S,offset:A};f.type="("+S+")",A=B,O();break;case"<":if(C.type==="a"||C.type==="f"){var y=U(g,A,"<",">");C.subtype=g.substring(A+1,y),A=y}else throw{code:"S0401",stack:new Error().stack,value:C.type,offset:A};break}A++}var M="^"+m.map(function(j){return"("+j.regex+")"}).join("")+"$",k=new RegExp(M),D=function(j){var ne;if(n.isFunction(j))ne="f";else{var re=typeof j;switch(re){case"string":ne="s";break;case"number":ne="n";break;case"boolean":ne="b";break;case"object":j===null?ne="l":Array.isArray(j)?ne="a":ne="o";break;case"undefined":default:ne="m"}}return ne},Y=function(j,ne){for(var re="^",ie=0,z=0;z<m.length;z++){re+=m[z].regex;var le=ne.match(re);if(le===null)throw{code:"T0410",stack:new Error().stack,value:j[ie],index:ie+1};ie=le[0].length}throw{code:"T0410",stack:new Error().stack,value:j[ie],index:ie+1}};return{definition:g,validate:function(j,ne){var re="";j.forEach(function(pe){re+=D(pe)});var ie=k.exec(re);if(ie){var z=[],le=0;return m.forEach(function(pe,Be){var he=j[le],ge=ie[Be+1];if(ge==="")if(pe.context&&pe.contextRegex){var $e=D(ne);if(pe.contextRegex.test($e))z.push(ne);else throw{code:"T0411",stack:new Error().stack,value:ne,index:le+1}}else z.push(he),le++;else ge.split("").forEach(function(ce){if(he=j[le],pe.type==="a"){if(ce==="m")he=void 0;else{var W=!0;if(typeof pe.subtype<"u"){if(ce!=="a"&&ge!==pe.subtype)W=!1;else if(ce==="a"&&he.length>0){var Ae=D(he[0]);if(Ae!==pe.subtype.charAt(0))W=!1;else{var b=he.filter(function(_){return D(_)!==Ae});W=b.length===0}}}if(!W)throw{code:"T0412",stack:new Error().stack,value:he,index:le+1,type:c[pe.subtype]};ce!=="a"&&(he=[he])}z.push(he),le++}else z.push(he),le++})}),z}Y(j,re)}}}return d})();i.exports=o},{"./utils":6}],6:[function(s,i,r){const n=(()=>{function o(y){var M=!1;if(typeof y=="number"&&(M=!isNaN(y),M&&!isFinite(y)))throw{code:"D1001",value:y,stack:new Error().stack};return M}function c(y){var M=!1;return Array.isArray(y)&&(M=y.filter(function(k){return typeof k!="string"}).length===0),M}function d(y){var M=!1;return Array.isArray(y)&&(M=y.filter(function(k){return!o(k)}).length===0),M}function g(y){return y.sequence===!0&&Array.isArray(y)}function A(y){return y&&(y._jsonata_function===!0||y._jsonata_lambda===!0)||typeof y=="function"}function m(y){var M=typeof y.arity=="number"?y.arity:typeof y.implementation=="function"?y.implementation.length:typeof y.length=="number"?y.length:y.arguments.length;return M}function f(y){return y&&y._jsonata_lambda===!0}var C=(typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator";function E(y){return typeof y=="object"&&y!==null&&C in y&&"next"in y&&typeof y.next=="function"}function O(y,M){if(y===M)return!0;if(typeof y=="object"&&typeof M=="object"&&y!==null&&M!==null){if(Array.isArray(y)&&Array.isArray(M)){if(y.length!==M.length)return!1;for(var k=0;k<y.length;k++)if(!O(y[k],M[k]))return!1;return!0}var D=Object.getOwnPropertyNames(y),Y=Object.getOwnPropertyNames(M);if(D.length!==Y.length)return!1;for(D=D.sort(),Y=Y.sort(),k=0;k<D.length;k++)if(D[k]!==Y[k])return!1;for(k=0;k<D.length;k++){var j=D[k];if(!O(y[j],M[j]))return!1}return!0}return!1}function U(y){return typeof y=="object"&&y!==null&&"then"in y&&typeof y.then=="function"}function B(y){var M=[];for(let k of y)M.push(k);return M}function S(y){return typeof y=="object"&&y!==null?Object.keys(y):[]}return{isNumeric:o,isArrayOfStrings:c,isArrayOfNumbers:d,isSequence:g,isFunction:A,isLambda:f,isIterable:E,getFunctionArity:m,isDeepEqual:O,stringToArray:B,isPromise:U,keys:S}})();i.exports=n},{}]},{},[3])(3)})})(Nn)),Nn.exports}var dh=uh();const ph=na(dh);function fh(t){t.registerFunction("ucFirst",e=>Fr.ucFirst(String(e??""))),t.registerFunction("currency",(e,s="fr-FR",i="EUR")=>{const r=Number(e);return Number.isNaN(r)?String(e??""):new Intl.NumberFormat(String(s),{style:"currency",currency:String(i)}).format(r)}),t.registerFunction("percent",(e,s="fr-FR",i=0)=>{const r=Number(e);return Number.isNaN(r)?String(e??""):new Intl.NumberFormat(String(s),{style:"percent",maximumFractionDigits:Number(i)||0}).format(r)}),t.registerFunction("date",(e,s="fr-FR",i)=>{const r=e instanceof Date?e:new Date(String(e));if(Number.isNaN(r.getTime()))return String(e??"");let n={dateStyle:"medium"};if(i)try{n=JSON.parse(String(i))}catch{}return new Intl.DateTimeFormat(String(s),n).format(r)}),t.registerFunction("toChart",(e,s="label",i="value",r="")=>{const n=Array.isArray(e)?e:[],o=[],c=[];for(const d of n){if(!d||typeof d!="object")continue;const g=d;o.push(String(g[String(s)]??"")),c.push(Number(g[String(i)]??0))}return{labels:o,datasets:[{label:String(r||""),data:c}]}})}const la=new Map,ca=8e3;function mh(t){if(!t||!t.trim())throw new Error("[sonic-jsonata] expression vide.");if(t.length>ca)throw new Error(`[sonic-jsonata] expression trop longue (${t.length} > ${ca}).`);const e=la.get(t);if(e)return e;try{const s=ph(t);return fh(s),la.set(t,s),s}catch(s){const i=s instanceof Error?s.message:typeof s=="object"&&s&&"message"in s?String(s.message):String(s);throw new Error(`[sonic-jsonata] Syntaxe JSONata invalide : ${i}`)}}function gh(t,e){if(!e||typeof e!="object")return;const s=e.type;if(typeof s=="string"&&!(s==="array"&&Array.isArray(t)||s==="object"&&t!==null&&typeof t=="object"&&!Array.isArray(t)||s==="string"&&typeof t=="string"||s==="number"&&typeof t=="number"||s==="boolean"&&typeof t=="boolean"||s==="null"&&t===null))throw new Error(`[sonic-jsonata] outputSchema : type attendu "${s}", reçu ${bh(t)}.`);if(Array.isArray(e.required)&&t&&typeof t=="object"){const i=t;for(const r of e.required)if(typeof r=="string"&&!(r in i))throw new Error(`[sonic-jsonata] outputSchema : propriété requise manquante "${r}".`)}}function bh(t){return t===null?"null":Array.isArray(t)?"array":typeof t}const vh=150,ha=10,yh=200,wh=16,ua=new WeakMap;let da=!1;function ms(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yr(t){if(t===window)return{x:window.scrollX,y:window.scrollY};const e=t;return{x:e.scrollLeft,y:e.scrollTop}}function _h(t,e,s){if(t===window){window.scrollTo(e,s);return}const i=t;typeof i.scrollTo=="function"?i.scrollTo(e,s):(i.scrollLeft=e,i.scrollTop=s)}function Sh(t){if(t===window){const s=document.documentElement;return Math.max(0,s.scrollHeight-window.innerHeight)}const e=t;return Math.max(0,e.scrollHeight-e.clientHeight)}function Zs(t){let e=ua.get(t);if(!e){const s=yr(t);e={x:s.x,y:s.y,restoring:!1,watching:!1,userEngaged:!1,raf:0,stickyFrames:0},ua.set(t,e)}return e}function Fi(t){Zs(t).userEngaged=!0}function Ri(t){const e=Zs(t);clearTimeout(e.settleTimer),e.settleTimer=setTimeout(()=>{e.userEngaged=!1,e.settleTimer=void 0},vh)}function pa(t,e){return e-t>=yh}function wr(t){if(!ms())return;const e=Zs(t);if(e.restoring)return;const s=yr(t);if(pa(s.y,e.y)){Rn(t);return}e.x=s.x,e.y=s.y}function Fn(t){if(!ms())return;const e=Zs(t),s=Sh(t),i=e.x,r=s>0?Math.min(e.y,s):e.y,{x:n,y:o}=yr(t);if(!(Math.abs(i-n)<=ha&&Math.abs(r-o)<=ha)){e.restoring=!0;try{_h(t,i,r)}finally{requestAnimationFrame(()=>{e.restoring=!1})}}}function Ph(t,e={x:0,y:0}){if(!ms())return;const s=Zs(t);if(e==="current"){const i=yr(t);s.x=i.x,s.y=i.y;return}s.x=e.x??0,s.y=e.y??0}function Rn(t){const e=Zs(t);if(e.stickyFrames=wh,e.raf)return;const s=()=>{e.raf=0,Fn(t),e.stickyFrames>0&&(e.stickyFrames--,e.raf=requestAnimationFrame(s))};e.raf=requestAnimationFrame(s)}function jn(t){Rn(t)}function Js(t){if(!ms())return;const e=Zs(t);if(e.watching)return;e.watching=!0;const s=t===window?window:t,i=()=>{if(e.restoring)return;const{y:E}=yr(t);if(pa(E,e.y)){Rn(t);return}if(e.userEngaged){wr(t),Ri(t);return}wr(t)},r=E=>fa(E)===t,n=E=>{r(E)&&(wr(t),Fi(t))},o=E=>{r(E)&&Ri(t)},c=E=>{r(E)&&(wr(t),Fi(t),Ri(t))};s.addEventListener("scroll",i,{passive:!0}),s.addEventListener("touchstart",n,{passive:!0}),s.addEventListener("touchend",o,{passive:!0}),s.addEventListener("touchcancel",o,{passive:!0}),s.addEventListener("wheel",c,{passive:!0}),s.addEventListener("pointerdown",n,{passive:!0}),s.addEventListener("pointerup",o,{passive:!0}),s.addEventListener("pointercancel",o,{passive:!0});const d=yr(t);if(e.x=d.x,e.y=d.y,t===window){const E=new ResizeObserver(()=>jn(window));E.observe(document.documentElement),e.resizeObserver=E;return}const g=t,A=new ResizeObserver(()=>jn(g));A.observe(g);for(const E of Array.from(g.children))A.observe(E);e.resizeObserver=A;const m=()=>jn(g),f=new MutationObserver(E=>{for(const O of E)if(O.type==="childList")for(const U of Array.from(O.addedNodes))U instanceof Element&&A.observe(U);m()});f.observe(g,{childList:!0,subtree:!0,characterData:!0});const C=g.getRootNode();C instanceof ShadowRoot&&C.host&&f.observe(C.host,{childList:!0,subtree:!0,characterData:!0}),e.mutationObserver=f}function fa(t){for(const e of t.composedPath())if(!(e===window||e===document)&&e instanceof HTMLElement&&ma(e))return e;return window}function ma(t){if(!(t instanceof HTMLElement)||t===document.documentElement||t===document.body)return!1;const e=getComputedStyle(t).overflowY;return e==="auto"||e==="scroll"||e==="overlay"}function Un(t){for(const s of t.composedPath())s===window||s===document||s instanceof HTMLElement&&ma(s)&&Js(s);const e=fa(t);Js(e),t.type==="wheel"?(wr(e),Fi(e),Ri(e)):(t.type==="touchstart"||t.type==="pointerdown")&&(wr(e),Fi(e))}function ji(t){t instanceof Element&&t.classList?.contains("custom-scroll")&&Js(t),t.querySelectorAll?.(".custom-scroll").forEach(e=>{e instanceof HTMLElement&&Js(e)})}function zn(t){ji(t),new MutationObserver(s=>{for(const i of s)for(const r of Array.from(i.addedNodes))r instanceof Element&&ji(r)}).observe(t,{childList:!0,subtree:!0})}function qn(t){t.querySelectorAll?.("*").forEach(e=>{e.shadowRoot&&(zn(e.shadowRoot),qn(e.shadowRoot))})}function xh(){const t=Element.prototype;if(t.__safariScrollGuardPatched)return;t.__safariScrollGuardPatched=!0;const e=t.attachShadow;t.attachShadow=function(i){const r=e.call(this,i);return zn(r),r}}function ga(){if(typeof window>"u"||da||(da=!0,!ms()))return;Js(window),xh();const t={capture:!0,passive:!0};window.addEventListener("wheel",Un,t),window.addEventListener("touchstart",Un,t),window.addEventListener("pointerdown",Un,t);const e=()=>{ji(document),qn(document)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e(),new MutationObserver(i=>{for(const r of i)for(const n of Array.from(r.addedNodes))n instanceof Element&&(ji(n),n.shadowRoot&&zn(n.shadowRoot),qn(n))}).observe(document.documentElement,{childList:!0,subtree:!0})}const Ah=Jl,Ch=Jc,kh=Pi,$h=Fr,gs=Ue,Dh=dt,Yr=ht,Eh=Os,Oh=fs;ga(),window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Ah,Arrays:Ch,DataBindObserver:kh,Format:$h,HTML:gs,LocationHandler:Dh,Objects:Yr,PublisherManager:ve,api:Eh,URLPattern:Oh,Endpoint:Ti,DataProviderKey:Cs};var Th=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Zr=(t,e,s,i)=>{for(var r=i>1?void 0:i?Lh(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Th(e,s,r),r};const Bn=t=>{class e extends t{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),r=this.getCheckAllPublisher(),n=this.getFormPublisher();if(r?.hasCheckAll.get()&&!this.checksAll()&&r&&n&&i){if(this.getFormPublisherValue()?.length)(this.checked===null||r.checkMode.get()=="noneChecked"||r.checkMode.get()==null)&&r.checkMode.set("someUnchecked");else{r.checkMode.set("noneChecked");return}const o=this.getFormPublisherValue(),c=r.values.get();if(c&&c.length){let d=c.length;for(const g of c)o.indexOf(g)==-1&&(d-=1);d==c.length&&r.checkMode.set("allChecked"),d==0&&r.checkMode.set("noneChecked")}c.indexOf(this.value)==-1&&this.unsetOnDisconnect()&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;if(this.getFormPublisher()&&this.name){let n=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=n==i?!0:null),Array.isArray(n)||(n=[]),n.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const r=this.getCheckAllPublisher();r&&(this.checked===!0?r.checkMode.set("allChecked"):this.checked===null&&(r.checkMode.set("noneChecked"),this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){const i=this.shadowRoot?.querySelector("input");if(!i||i.checkValidity())return;const r=this.getFormPublisher();if(r){const n=this.getFormPublisherValue();if((this.unique||this.radio)&&n!==null&&n!==void 0&&n.toString().length>0)return;r.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const r=new Event("change");this.dispatchEvent(r)}getValueForFormPublisher(){let i=this.getFormPublisherValue();if(this.radio)return this.checked===!0&&this.value!=null?this.value:i;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(i)||(i=[]);const r=i.slice(0),n=r.indexOf(this.value);return this.checked===!0&&n===-1&&!this.checksAll()&&r.push(this.value),this.checked===null&&n!==-1&&r.splice(n,1),r}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,r=this.getAttribute("name");return!i||!r?null:ve.get(i+"/"+r+"/_available_values_")}unset(){this.checked=null}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const r=i.values.get().slice(0),n=r.indexOf(this.value);n!=-1&&(r.splice(n,1),i.values.set(r))}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){const n=this.getFormPublisherValue();n&&Array.isArray(n)&&n.indexOf(this.value)!==-1&&(this.checked=!0)}const r=this.getCheckAllPublisher();r&&(r.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&r.hasCheckAll.set(!0),r.values.get()||r.values.set([]),this.checksAll()||r.values.set([...r.values.get(),this.value])),this.hasAttribute("checked")&&setTimeout(()=>this.checked=!0,1)}}return Zr([h()],e.prototype,"value",1),Zr([h()],e.prototype,"forceAutoFill",2),Zr([h({type:Boolean})],e.prototype,"unique",2),Zr([h({type:Boolean})],e.prototype,"radio",2),Zr([h()],e.prototype,"checked",1),e};/**
|
|
72
|
+
*/const ra="important",Gc=" !"+ra,$t=Es(class extends gr{constructor(t){if(super(t),t.type!==Ys.ATTRIBUTE||t.name!=="style"||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce(((e,s)=>{const i=t[s];return i==null?e:e+`${s=s.includes("-")?s:s.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`}),"")}update(t,[e]){const{style:s}=t.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)e[i]==null&&(this.ft.delete(i),i.includes("-")?s.removeProperty(i):s[i]=null);for(const i in e){const r=e[i];if(r!=null){this.ft.add(i);const n=typeof r=="string"&&r.endsWith(Gc);i.includes("-")||n?s.setProperty(i,n?r.slice(0,-11):r,n?ra:""):s[i]=r}}return jt}});var Yc=Object.defineProperty,Zc=Object.getOwnPropertyDescriptor,Jt=(t,e,s,i)=>{for(var r=i>1?void 0:i?Zc(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Yc(e,s,r),r};const Oi=new Map,vr=t=>{class e extends t{constructor(...i){super(),this.touched=!1,this.error=!1,this.autofocus=!1,this.required=!1,this.forceAutoFill=!1,this.disabled=!1,this.ariaLabel=null,this.ariaLabelledby=null,this.formDataProvider="",this._name="",this._value="",this.onFormValueAssign=async r=>{this.setFormValueFromPublisher(r)},this.onFormDataInValidate=()=>{const r=this.getFormPublisher();r&&r.isFormValid.get()&&this.validateFormElement()}}hasAncestorAttribute(i){return Ue.getAncestorAttributeValue(this,i)!=null}getAncestorAttributeValue(i){return Ue.getAncestorAttributeValue(this,i)||""}get name(){return this._name}set name(i){this.hasAttribute("name")&&!this.forceAutoFill&&(i=this.getAttribute("name")),this._name=i,this.requestUpdate()}validateFormElement(){}unsetOnDisconnect(){return this.hasAttribute("unsetOnDisconnect")}updateDataValue(){this.getAttribute("name")&&this.getFormPublisher()&&(this.setFormPublisherValue(this.getValueForFormPublisher()),this.setFormValueFromPublisher(this.getFormPublisherValue()))}getFormPublisher(){return this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")||""),this.formDataProvider?ve.get(this.formDataProvider):null}setFormPublisherValue(i){const r=this.getFormPublisher();r&&Bt(r,this.name).set(i)}getFormPublisherValue(){const i=this.getFormPublisher();return i?Bt(i,this.name).get():null}getValueForFormPublisher(){return this.value}setFormValueFromPublisher(i){this.value=i}get value(){return this._value}set value(i){i==null&&(i=""),ht.isObject(i)&&Object.prototype.hasOwnProperty.call(i,"__value")&&i._value==null&&(i=""),this._value!=i&&(this._value=i,this.updateDataValue(),this.requestUpdate())}initFormPublisher(){let i=this.getFormPublisher();const r=this.hasAncestorAttribute("initFromPublisher")&&this._name&&this.getFormPublisherValue()?this.getFormPublisherValue():this.getAttribute("value");this._name&&i&&Bt(i,this._name).offAssign(this.onFormValueAssign),this.name||(this._name=this.getAttribute("name")||""),this.value||(this._value=this.getAttribute("value")),i=this.getFormPublisher(),this._name&&i&&(Bt(i,this._name).onAssign(this.onFormValueAssign),i.onFormInvalidate(this.onFormDataInValidate)),this.updateDataValue(),r&&(this.value=r)}handleBlur(){this.touched=!0}handleChange(i){this.value=i.target.value;const r=new Event("change");this.dispatchEvent(r)}addKeyboardNavigation(){const i=this.getAncestorAttributeValue("data-keyboard-nav")||"";if(!i)return;const r=i.split(" "),n=r[0];if(!n)return;for(const c of r){Oi.has(c)||Oi.set(c,[]);const d=Oi.get(c);d?.indexOf(this)==-1&&d.push(this)}const o=Oi.get(n);this.addEventListener("keydown",c=>{const d=c;if(!["ArrowDown","ArrowUp"].includes(d.key))return;const b="input:not([disabled]), button:not([disabled]), select:not([disabled]), textarea:not([disabled])",A=o?.filter(C=>{const E=C.shadowRoot?.querySelector(b);if(!E)return!1;const T=window.getComputedStyle(E);return T.display!=="none"&&T.display!==""&&T.pointerEvents!="none"&&T.visibility!=="hidden"&&E.getBoundingClientRect().width>0});let m=null;if(d.key=="ArrowDown"&&A){const C=A.indexOf(this);C==A.length-1?m=A[0]:m=A[C+1]}else if(d.key=="ArrowUp"&&A){const C=A.indexOf(this);C==0?m=A[A.length-1]:m=A[C-1]}const f=m?.shadowRoot?.querySelector(b);f&&f.focus&&(f.focus(),c.preventDefault(),c.stopPropagation())})}focus(){this.shadowRoot?.querySelector("[data-form-element], button")?.focus()}connectedCallback(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider")||""),super.connectedCallback(),this.initFormPublisher(),this.addKeyboardNavigation()}unset(){this.value=null}disconnectedCallback(){this.unsetOnDisconnect()&&this.unset(),super.disconnectedCallback();const i=this.getFormPublisher();this._name&&i&&(Bt(i,this._name).offAssign(this.onFormValueAssign),i.offFormInvalidate(this.onFormDataInValidate))}}return Jt([h({type:Boolean,reflect:!0})],e.prototype,"touched",2),Jt([h({type:Boolean})],e.prototype,"error",2),Jt([h({type:Boolean})],e.prototype,"autofocus",2),Jt([h({type:Boolean})],e.prototype,"required",2),Jt([h({type:Boolean})],e.prototype,"forceAutoFill",2),Jt([h({type:Boolean,reflect:!0})],e.prototype,"disabled",2),Jt([h({type:String,attribute:"data-aria-label"})],e.prototype,"ariaLabel",2),Jt([h({type:String,attribute:"data-aria-labelledby"})],e.prototype,"ariaLabelledby",2),Jt([h({type:String})],e.prototype,"formDataProvider",2),Jt([h()],e.prototype,"name",1),Jt([h()],e.prototype,"value",1),e};let Jc=class ur{static areEqual(e,s){return e.length===s.length?e.every((i,r)=>i===s[r]):!1}static from2d(e){return{to1D:()=>{let s=[];return e.forEach(i=>s=s.concat(i)),this.from(s)}}}static from(e){return{get:()=>e||[],everyItem:()=>({has:()=>({same:()=>({value:()=>({forKey:s=>{if(e.length<1)return!0;const i=(e[0]||{})[s];return e.every(r=>(r||{})[s]==i)}})})}),value:()=>({forKey:s=>ur.from(e.map(i=>i[s]))}),copy:()=>({fromKey:s=>({toKey:i=>{e.forEach(r=>{r[i]=Array.isArray(r[s])?[...r[s]]:typeof r[s]=="object"&&r[s]!=null?{...r[s]}:r[s]})}})})}),map:s=>ur.from(e.map(s)),filter:s=>ur.from(e.filter(s)),find:s=>e.find(s),some:s=>e.some(s),every:s=>e.every(s),group:()=>({byKey:s=>{const i=[],r=new Map;for(const n of e){const o=n[s];if(!r.has(o)){const c=i.length;r.set(o,c);const d={items:[]};d[s]=o,i.push(d)}i[r.get(o)].items.push(n)}return ur.from(i)}}),without:()=>({duplicates:()=>({forKey:s=>{const i=[...new Set(e.map(r=>r[s]))];return ur.from(i.map(r=>e.find(n=>n[s]==r)))}}),itemsIn:s=>({havingSameValue:()=>({forKey:i=>{const r=(n,o)=>c=>n[o]!=c[o];return ur.from(e.filter(n=>s.every(r(n,i))))}})})})}}};var ia=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function na(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Kr={exports:{}},Qc=Kr.exports,oa;function Xc(){return oa||(oa=1,(function(t,e){var s=[].slice;(function(i,r){return e!==null?t.exports=r():i.UrlPattern=r()})(Qc,function(){var i,r,n,o,c,d,b,A,m,f,C,E,T,U,B;return m=function(x){return x.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")},b=function(x,y){var M,k,D;for(D=[],M=-1,k=x.length;++M<k;)D=D.concat(y(x[M]));return D},U=function(x,y){var M,k,D;for(D="",M=-1,k=x.length;++M<k;)D+=y(x[M]);return D},T=function(x){return new RegExp(x.toString()+"|").exec("").length-1},C=function(x,y){var M,k,D,Y,j;for(Y={},M=-1,D=x.length;++M<D;)k=x[M],j=y[M],j!=null&&(Y[k]!=null?(Array.isArray(Y[k])||(Y[k]=[Y[k]]),Y[k].push(j)):Y[k]=j);return Y},i={},i.Result=function(x,y){this.value=x,this.rest=y},i.Tagged=function(x,y){this.tag=x,this.value=y},i.tag=function(x,y){return function(M){var k,D;if(k=y(M),k!=null)return D=new i.Tagged(x,k.value),new i.Result(D,k.rest)}},i.regex=function(x){return function(y){var M,k;if(M=x.exec(y),M!=null)return k=M[0],new i.Result(k,y.slice(k.length))}},i.sequence=function(){var x;return x=1<=arguments.length?s.call(arguments,0):[],function(y){var M,k,D,Y,j,ne;for(M=-1,k=x.length,ne=[],Y=y;++M<k;){if(D=x[M],j=D(Y),j==null)return;ne.push(j.value),Y=j.rest}return new i.Result(ne,Y)}},i.pick=function(){var x,y;return x=arguments[0],y=2<=arguments.length?s.call(arguments,1):[],function(M){var k,D;if(D=i.sequence.apply(i,y)(M),D!=null)return k=D.value,D.value=k[x],D}},i.string=function(x){var y;return y=x.length,function(M){if(M.slice(0,y)===x)return new i.Result(x,M.slice(y))}},i.lazy=function(x){var y;return y=null,function(M){return y==null&&(y=x()),y(M)}},i.baseMany=function(x,y,M,k,D){var Y,j,ne,re;for(ne=D,re=M?"":[];!(y!=null&&(Y=y(ne),Y!=null)||(j=x(ne),j==null));)M?re+=j.value:re.push(j.value),ne=j.rest;if(!(k&&re.length===0))return new i.Result(re,ne)},i.many1=function(x){return function(y){return i.baseMany(x,null,!1,!0,y)}},i.concatMany1Till=function(x,y){return function(M){return i.baseMany(x,y,!0,!0,M)}},i.firstChoice=function(){var x;return x=1<=arguments.length?s.call(arguments,0):[],function(y){var M,k,D,Y;for(M=-1,k=x.length;++M<k;)if(D=x[M],Y=D(y),Y!=null)return Y}},E=function(x){var y;return y={},y.wildcard=i.tag("wildcard",i.string(x.wildcardChar)),y.optional=i.tag("optional",i.pick(1,i.string(x.optionalSegmentStartChar),i.lazy(function(){return y.pattern}),i.string(x.optionalSegmentEndChar))),y.name=i.regex(new RegExp("^["+x.segmentNameCharset+"]+")),y.named=i.tag("named",i.pick(1,i.string(x.segmentNameStartChar),i.lazy(function(){return y.name}))),y.escapedChar=i.pick(1,i.string(x.escapeChar),i.regex(/^./)),y.static=i.tag("static",i.concatMany1Till(i.firstChoice(i.lazy(function(){return y.escapedChar}),i.regex(/^./)),i.firstChoice(i.string(x.segmentNameStartChar),i.string(x.optionalSegmentStartChar),i.string(x.optionalSegmentEndChar),y.wildcard))),y.token=i.lazy(function(){return i.firstChoice(y.wildcard,y.optional,y.named,y.static)}),y.pattern=i.many1(i.lazy(function(){return y.token})),y},A={escapeChar:"\\",segmentNameStartChar:":",segmentValueCharset:"a-zA-Z0-9-_~ %",segmentNameCharset:"a-zA-Z0-9",optionalSegmentStartChar:"(",optionalSegmentEndChar:")",wildcardChar:"*"},d=function(x,y){if(Array.isArray(x))return U(x,function(M){return d(M,y)});switch(x.tag){case"wildcard":return"(.*?)";case"named":return"(["+y+"]+)";case"static":return m(x.value);case"optional":return"(?:"+d(x.value,y)+")?"}},c=function(x,y){return y==null&&(y=A.segmentValueCharset),"^"+d(x,y)+"$"},o=function(x){if(Array.isArray(x))return b(x,o);switch(x.tag){case"wildcard":return["_"];case"named":return[x.value];case"static":return[];case"optional":return o(x.value)}},f=function(x,y,M,k){var D,Y,j,ne;if(k==null&&(k=!1),ne=x[y],ne==null){if(k)throw new Error("no values provided for key `"+y+"`");return}if(D=M[y]||0,Y=Array.isArray(ne)?ne.length-1:0,D>Y){if(k)throw new Error("too few values provided for key `"+y+"`");return}return j=Array.isArray(ne)?ne[D]:ne,k&&(M[y]=D+1),j},n=function(x,y,M){var k,D;if(Array.isArray(x)){for(k=-1,D=x.length;++k<D;)if(n(x[k],y,M))return!0;return!1}switch(x.tag){case"wildcard":return f(y,"_",M,!1)!=null;case"named":return f(y,x.value,M,!1)!=null;case"static":return!1;case"optional":return n(x.value,y,M)}},B=function(x,y,M){if(Array.isArray(x))return U(x,function(k){return B(k,y,M)});switch(x.tag){case"wildcard":return f(y,"_",M,!0);case"named":return f(y,x.value,M,!0);case"static":return x.value;case"optional":return n(x.value,y,M)?B(x.value,y,M):""}},r=function(x,y){var M,k,D,Y,j;if(x instanceof r){this.isRegex=x.isRegex,this.regex=x.regex,this.ast=x.ast,this.names=x.names;return}if(this.isRegex=x instanceof RegExp,!(typeof x=="string"||this.isRegex))throw new TypeError("argument must be a regex or a string");if(this.isRegex){if(this.regex=x,y!=null){if(!Array.isArray(y))throw new Error("if first argument is a regex the second argument may be an array of group names but you provided something else");if(M=T(this.regex),y.length!==M)throw new Error("regex contains "+M+" groups but array of group names contains "+y.length);this.names=y}return}if(x==="")throw new Error("argument must not be the empty string");if(j=x.replace(/\s+/g,""),j!==x)throw new Error("argument must not contain whitespace");if(k={escapeChar:y?.escapeChar||A.escapeChar,segmentNameStartChar:y?.segmentNameStartChar||A.segmentNameStartChar,segmentNameCharset:y?.segmentNameCharset||A.segmentNameCharset,segmentValueCharset:y?.segmentValueCharset||A.segmentValueCharset,optionalSegmentStartChar:y?.optionalSegmentStartChar||A.optionalSegmentStartChar,optionalSegmentEndChar:y?.optionalSegmentEndChar||A.optionalSegmentEndChar,wildcardChar:y?.wildcardChar||A.wildcardChar},Y=E(k),D=Y.pattern(x),D==null)throw new Error("couldn't parse pattern");if(D.rest!=="")throw new Error("could only partially parse pattern");this.ast=D.value,this.regex=new RegExp(c(this.ast,k.segmentValueCharset)),this.names=o(this.ast)},r.prototype.match=function(x){var y,M;return M=this.regex.exec(x),M==null?null:(y=M.slice(1),this.names?C(this.names,y):y)},r.prototype.stringify=function(x){if(x==null&&(x={}),this.isRegex)throw new Error("can't stringify patterns generated from a regex");if(x!==Object(x))throw new Error("argument must be an object or undefined");return B(this.ast,x,{})},r.escapeForRegex=m,r.concatMap=b,r.stringConcatMap=U,r.regexGroupCount=T,r.keysAndValuesToObject=C,r.P=i,r.newParser=E,r.defaultOptions=A,r.astNodeToRegexString=c,r.astNodeToNames=o,r.getParam=f,r.astNodeContainsSegmentsForProvidedParams=n,r.stringify=B,r})})(Kr,Kr.exports)),Kr.exports}var eh=Xc();const fs=na(eh);class Ti{constructor(e){this.path=Ti.normalizePath(e)}getDataProviderKey(){return new Cs(this.path)}static normalizePath(e){const s=String(e).trim();if(!s)throw new RangeError("Endpoint: path cannot be empty");if(/^https?:\/\//i.test(s)){let d;try{d=new URL(s)}catch{throw new RangeError("Endpoint: invalid absolute URL")}return d.pathname=d.pathname.replace(/\/+/g,"/"),d.href}const i=s.indexOf("?"),r=s.indexOf("#");let n=s.length;i>=0&&(n=Math.min(n,i)),r>=0&&(n=Math.min(n,r));let o=s.slice(0,n);const c=s.slice(n);if(o=o.replace(/^\/+/,""),o=o.replace(/\/+/g,"/"),!o&&c)throw new RangeError("Endpoint: path cannot be empty");return o+c}static isNonEmpty(e){return String(e).trim().length>0}static looksLikeDataProviderPath(e){return/^\s*dataProvider\s*\(/i.test(String(e))}toString(){return this.path}}const th=50,sh=1e4,rh=100,Mn=new Map;function Li(t){return gi(t)}function Gr(t){return t.split(".")[0]??t}function Ii(t){const e=t.split("."),s=e.shift();let i=ve.get(s);return e.length&&(i=ht.traverse(i,e)),i}function ih(t){return t==null?!0:Array.isArray(t)?t.length===0:typeof t=="object"?Object.keys(t).length===0:typeof t=="string"?t.length===0:!1}function nh(t){return Array.isArray(t)?t.length:0}function oh(t,e){for(const o of e)if(o===t||t.startsWith(o+".")||o.startsWith(t+"."))throw new Error(`[derive] Cycle détecté : la sortie "${t}" chevauche l'entrée "${o}".`);const s=Gr(t),i=new Map;for(const[o,c]of Mn)i.set(Gr(o),new Set(c));i.set(s,new Set(e.map(Gr)));const r=new Set,n=o=>{if(r.has(o))return!0;r.add(o);for(const c of i.get(o)??[])if(n(c))return!0;return r.delete(o),!1};if(n(s))throw new Error(`[derive] Cycle détecté (chaîne) : la sortie "${t}" dépend indirectement d'elle-même.`)}function ah(t,e){Mn.set(t,new Set(e.map(s=>Gr(s))))}function lh(t){Mn.delete(t)}function ch(t){return`${Gr(Li(t))}/_state_`}function Mi(t,e){const s=ch(t);ve.get(s).set(e)}function hh(t,e,s,i){const r=typeof t.compute=="function"?t:{inputs:t,compute:e,output:s,variables:i},n=r.debounceMs??th,o=r.maxInputItems??sh,c=r.isEmpty??ih,d=Li(r.output),b=Object.entries(r.inputs).map(([ie,z])=>({alias:ie,path:Li(z)})),A=b.map(ie=>ie.path),m=r.variables?Li(r.variables):null;oh(d,A),ah(d,A);const f=Ii(d);let C,E=!1,T=0,U=null,B=!1,x="";const y=ie=>{E=!0,C=ie,f.set(ie),E=!1},M=()=>{E||B||(typeof console<"u"&&console.warn&&console.warn(`[derive] Écriture ignorée sur la sortie readonly "${d}".`),C!==void 0&&(E=!0,f.set(C),E=!1))};f.onAssign(M,!1);const k=()=>{const ie={};for(const{alias:z,path:le}of b){const pe=Ii(le).get(),Be=nh(pe);Be>o&&typeof console<"u"&&console.warn&&console.warn(`[derive] Entrée "${le}" : ${Be} éléments (> ${o}). Agrégation lourde — envisager un plafond côté fetch.`),ie[z]=pe}return ie},D=()=>m?Ii(m).get()??{}:{},Y=async()=>{if(B)return;const ie=++T;Mi(d,{status:"loading",error:null});const z=k(),le=D(),pe=JSON.stringify({inputs:z,vars:le});if(pe===x&&C!==void 0){Mi(d,{status:c(C)?"empty":"ready",error:null});return}const Be=typeof performance<"u"?performance.now():Date.now();try{const he=await Promise.resolve(r.compute(z,le));if(B||ie!==T)return;const ge=(typeof performance<"u"?performance.now():Date.now())-Be;ge>rh&&typeof console<"u"&&console.warn&&console.warn(`[derive] Évaluation longue (${Math.round(ge)} ms) → "${d}".`),x=pe,y(he),Mi(d,{status:c(he)?"empty":"ready",error:null})}catch(he){if(B||ie!==T)return;const ge=he instanceof Error?he.message:String(he);typeof console<"u"&&console.error&&console.error(`[derive] Erreur sur "${d}" :`,ge),Mi(d,{status:"error",error:ge})}},j=()=>{B||(U&&clearTimeout(U),U=setTimeout(()=>{U=null,Y()},n))},ne=[],re=ie=>{const z=Ii(ie),le=()=>j();z.onInternalMutation(le),ne.push({pub:z,handler:le})};for(const{path:ie}of b)re(ie);return m&&re(m),j(),{stop(){if(!B){B=!0,U&&clearTimeout(U);for(const{pub:ie,handler:z}of ne)ie.offInternalMutation(z);f.offAssign(M),lh(d)}},recompute(){x="",Y()}}}function Ni(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Nn={exports:{}},aa;function uh(){return aa||(aa=1,(function(t,e){(function(s){t.exports=s()})(function(){return(function(){function s(i,r,n){function o(b,A){if(!r[b]){if(!i[b]){var m=typeof Ni=="function"&&Ni;if(!A&&m)return m(b,!0);if(c)return c(b,!0);var f=new Error("Cannot find module '"+b+"'");throw f.code="MODULE_NOT_FOUND",f}var C=r[b]={exports:{}};i[b][0].call(C.exports,function(E){var T=i[b][1][E];return o(T||E)},C,C.exports,s,i,r,n)}return r[b].exports}for(var c=typeof Ni=="function"&&Ni,d=0;d<n.length;d++)o(n[d]);return o}return s})()({1:[function(s,i,r){const n=s("./utils"),o=(function(){const c=n.stringToArray,d=["Zero","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],b=["Zeroth","First","Second","Third","Fourth","Fifth","Sixth","Seventh","Eighth","Ninth","Tenth","Eleventh","Twelfth","Thirteenth","Fourteenth","Fifteenth","Sixteenth","Seventeenth","Eighteenth","Nineteenth"],A=["Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety","Hundred"],m=["Thousand","Million","Billion","Trillion"];function f(O,I){var $=function(q,V,N){var G="";if(q<=19)G=(V?" and ":"")+(N?b[q]:d[q]);else if(q<100){const Ce=Math.floor(q/10),me=q%10;G=(V?" and ":"")+A[Ce-2],me>0?G+="-"+$(me,!1,N):N&&(G=G.substring(0,G.length-1)+"ieth")}else if(q<1e3){const Ce=Math.floor(q/100),me=q%100;G=(V?", ":"")+d[Ce]+" Hundred",me>0?G+=$(me,!0,N):N&&(G+="th")}else{var ae=Math.floor(Math.log10(q)/3);ae>m.length&&(ae=m.length);const Ce=Math.pow(10,ae*3),me=Math.floor(q/Ce),fe=q-me*Ce;G=(V?", ":"")+$(me,!1,!1)+" "+m[ae-1],fe>0?G+=$(fe,!0,N):N&&(G+="th")}return G},F=$(O,!1,I);return F}const C=Object.create(null);d.forEach(function(O,I){C[O.toLowerCase()]=I}),b.forEach(function(O,I){C[O.toLowerCase()]=I}),A.forEach(function(O,I){const $=O.toLowerCase();C[$]=(I+2)*10,C[$.substring(0,O.length-1)+"ieth"]=C[$]}),C.hundredth=100,m.forEach(function(O,I){const $=O.toLowerCase(),F=Math.pow(10,(I+1)*3);C[$]=F,C[$+"th"]=F});function E(O){const $=O.split(/,\s|\sand\s|[\s\\-]/).map(V=>C[V]);let F=[0];return $.forEach(V=>{if(V<100){let N=F.pop();N>=1e3&&(F.push(N),N=0),F.push(N+V)}else F.push(F.pop()*V)}),F.reduce((V,N)=>V+N,0)}const T=[[1e3,"m"],[900,"cm"],[500,"d"],[400,"cd"],[100,"c"],[90,"xc"],[50,"l"],[40,"xl"],[10,"x"],[9,"ix"],[5,"v"],[4,"iv"],[1,"i"]],U={M:1e3,D:500,C:100,L:50,X:10,V:5,I:1};function B(O){for(var I=0;I<T.length;I++){const $=T[I];if(O>=$[0])return $[1]+B(O-$[0])}return""}function x(O){for(var I=0,$=1,F=O.length-1;F>=0;F--){const q=O[F],V=U[q];V<$?I-=V:($=V,I+=V)}return I}function y(O,I){for(var $=[],F=I.charCodeAt(0);O>0;)$.unshift(String.fromCharCode((O-1)%26+F)),O=Math.floor((O-1)/26);return $.join("")}function M(O,I){for(var $=I.charCodeAt(0),F=0,q=0;q<O.length;q++)F+=(O.charCodeAt(O.length-q-1)-$+1)*Math.pow(26,q);return F}function k(O,I){if(typeof O>"u")return;O=Math.floor(O);const $=re(I);return j(O,$)}const D={DECIMAL:"decimal",LETTERS:"letters",ROMAN:"roman",WORDS:"words",SEQUENCE:"sequence"},Y={UPPER:"upper",LOWER:"lower",TITLE:"title"};function j(O,I){let $;const F=O<0;switch(O=Math.abs(O),I.primary){case D.LETTERS:$=y(O,I.case===Y.UPPER?"A":"a");break;case D.ROMAN:$=B(O),I.case===Y.UPPER&&($=$.toUpperCase());break;case D.WORDS:$=f(O,I.ordinal),I.case===Y.UPPER?$=$.toUpperCase():I.case===Y.LOWER&&($=$.toLowerCase());break;case D.DECIMAL:$=""+O;var q=I.mandatoryDigits-$.length;if(q>0){var V=new Array(q+1).join("0");$=V+$}if(I.zeroCode!==48&&($=c($).map(Ce=>String.fromCodePoint(Ce.codePointAt(0)+I.zeroCode-48)).join("")),I.regular){const Ce=Math.floor(($.length-1)/I.groupingSeparators.position);for(let me=Ce;me>0;me--){const fe=$.length-me*I.groupingSeparators.position;$=$.substr(0,fe)+I.groupingSeparators.character+$.substr(fe)}}else I.groupingSeparators.reverse().forEach(Ce=>{const me=$.length-Ce.position;$=$.substr(0,me)+Ce.character+$.substr(me)});if(I.ordinal){var N={1:"st",2:"nd",3:"rd"},G=$[$.length-1],ae=N[G];(!ae||$.length>1&&$[$.length-2]==="1")&&(ae="th"),$=$+ae}break;case D.SEQUENCE:throw{code:"D3130",value:I.token}}return F&&($="-"+$),$}const ne=[48,1632,1776,1984,2406,2534,2662,2790,2918,3046,3174,3302,3430,3558,3664,3792,3872,4160,4240,6112,6160,6470,6608,6784,6800,6992,7088,7232,7248,42528,43216,43264,43472,43504,43600,44016,65296];function re(O){const I={type:"integer",primary:D.DECIMAL,case:Y.LOWER,ordinal:!1};let $,F;const q=O.lastIndexOf(";");switch(q===-1?$=O:($=O.substring(0,q),F=O.substring(q+1),F[0]==="o"&&(I.ordinal=!0)),$){case"A":I.case=Y.UPPER;case"a":I.primary=D.LETTERS;break;case"I":I.case=Y.UPPER;case"i":I.primary=D.ROMAN;break;case"W":I.case=Y.UPPER,I.primary=D.WORDS;break;case"Ww":I.case=Y.TITLE,I.primary=D.WORDS;break;case"w":I.primary=D.WORDS;break;default:{let V=null,N=0,G=0,ae=[],Ce=0;if(c($).map(fe=>fe.codePointAt(0)).reverse().forEach(fe=>{let ue=!1;for(let De=0;De<ne.length;De++){const de=ne[De];if(fe>=de&&fe<=de+9){if(ue=!0,N++,Ce++,V===null)V=de;else if(de!==V)throw{code:"D3131"};break}}ue||(fe===35?(Ce++,G++):ae.push({position:Ce,character:String.fromCodePoint(fe)}))}),N>0){I.primary=D.DECIMAL,I.zeroCode=V,I.mandatoryDigits=N,I.optionalDigits=G;const ue=function(De){if(De.length===0)return 0;const de=De[0].character;for(let it=1;it<De.length;it++)if(De[it].character!==de)return 0;const mt=De.map(it=>it.position),Yt=function(it,Pt){return Pt===0?it:Yt(Pt,it%Pt)},St=mt.reduce(Yt);for(let it=1;it<=mt.length;it++)if(mt.indexOf(it*St)===-1)return 0;return St}(ae);ue>0?(I.regular=!0,I.groupingSeparators={position:ue,character:ae[0].character}):(I.regular=!1,I.groupingSeparators=ae)}else I.primary=D.SEQUENCE,I.token=$}}return I}const ie={Y:"1",M:"1",D:"1",d:"1",F:"n",W:"1",w:"1",X:"1",x:"1",H:"1",h:"1",P:"n",m:"01",s:"01",f:"1",Z:"01:01",z:"01:01",C:"n",E:"n"};function z(O){var I=[];const $={type:"datetime",parts:I},F=function(ue,De){if(De>ue){let de=O.substring(ue,De);de=de.split("]]").join("]"),I.push({type:"literal",value:de})}};for(var q=0,V=0;V<O.length;){if(O.charAt(V)==="["){if(O.charAt(V+1)==="["){F(q,V),I.push({type:"literal",value:"["}),V+=2,q=V;continue}if(F(q,V),q=V,V=O.indexOf("]",q),V===-1)throw{code:"D3135"};let ue=O.substring(q+1,V);ue=ue.split(/\s+/).join("");var N={type:"marker",component:ue.charAt(0)},G=ue.lastIndexOf(","),ae;if(G!==-1){const De=ue.substring(G+1),de=De.indexOf("-");let mt,Yt;const St=function(Pt){if(!(typeof Pt>"u"||Pt==="*"))return parseInt(Pt)};de===-1?mt=De:(mt=De.substring(0,de),Yt=De.substring(de+1));const it={min:St(mt),max:St(Yt)};N.width=it,ae=ue.substring(1,G)}else ae=ue.substring(1);if(ae.length===1)N.presentation1=ae;else if(ae.length>1){var Ce=ae.charAt(ae.length-1);"atco".indexOf(Ce)!==-1?(N.presentation2=Ce,Ce==="o"&&(N.ordinal=!0),N.presentation1=ae.substring(0,ae.length-1)):N.presentation1=ae}else N.presentation1=ie[N.component];if(typeof N.presentation1>"u")throw{code:"D3132",value:N.component};if(N.presentation1[0]==="n")N.names=Y.LOWER;else if(N.presentation1[0]==="N")N.presentation1[1]==="n"?N.names=Y.TITLE:N.names=Y.UPPER;else if("YMDdFWwXxHhmsf".indexOf(N.component)!==-1){var me=N.presentation1;if(N.presentation2&&(me+=";"+N.presentation2),N.integerFormat=re(me),N.width&&N.width.min!==void 0&&N.integerFormat.mandatoryDigits<N.width.min&&(N.integerFormat.mandatoryDigits=N.width.min),N.component==="Y")if(N.n=-1,N.width&&N.width.max!==void 0)N.n=N.width.max,N.integerFormat.mandatoryDigits=N.n;else{var fe=N.integerFormat.mandatoryDigits+N.integerFormat.optionalDigits;fe>=2&&(N.n=fe)}const De=I[I.length-1];De&&De.integerFormat&&(De.integerFormat.parseWidth=De.integerFormat.mandatoryDigits)}(N.component==="Z"||N.component==="z")&&(N.integerFormat=re(N.presentation1)),I.push(N),q=V+1}V++}return F(q,V),$}const le=["","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],pe=["January","February","March","April","May","June","July","August","September","October","November","December"],Be=1e3*60*60*24,he=function(O){const I=Date.UTC(O.year,O.month);var $=new Date(I).getUTCDay();return $===0&&($=7),$>4?I+(8-$)*Be:I-($-1)*Be},ge=function(O,I){return{year:O,month:I,nextMonth:function(){return I===11?ge(O+1,0):ge(O,I+1)},previousMonth:function(){return I===0?ge(O-1,11):ge(O,I-1)},nextYear:function(){return ge(O+1,I)},previousYear:function(){return ge(O-1,I)}}},$e=function(O,I){return(I-O)/(Be*7)+1},ce=(O,I)=>{let $;switch(I){case"Y":$=O.getUTCFullYear();break;case"M":$=O.getUTCMonth()+1;break;case"D":$=O.getUTCDate();break;case"d":{const F=Date.UTC(O.getUTCFullYear(),O.getUTCMonth(),O.getUTCDate()),q=Date.UTC(O.getUTCFullYear(),0);$=(F-q)/Be+1;break}case"F":$=O.getUTCDay(),$===0&&($=7);break;case"W":{const F=ge(O.getUTCFullYear(),0),q=he(F),V=Date.UTC(F.year,O.getUTCMonth(),O.getUTCDate());let N=$e(q,V);if(N>52){const G=he(F.nextYear());V>=G&&(N=1)}else if(N<1){const G=he(F.previousYear());N=$e(G,V)}$=Math.floor(N);break}case"w":{const F=ge(O.getUTCFullYear(),O.getUTCMonth()),q=he(F),V=Date.UTC(F.year,F.month,O.getUTCDate());let N=$e(q,V);if(N>4){const G=he(F.nextMonth());V>=G&&(N=1)}else if(N<1){const G=he(F.previousMonth());N=$e(G,V)}$=Math.floor(N);break}case"X":{const F=ge(O.getUTCFullYear(),0),q=he(F),V=he(F.nextYear()),N=O.getTime();N<q?$=F.year-1:N>=V?$=F.year+1:$=F.year;break}case"x":{const F=ge(O.getUTCFullYear(),O.getUTCMonth()),q=he(F),V=F.nextMonth(),N=he(V),G=O.getTime();G<q?$=F.previousMonth().month+1:G>=N?$=V.month+1:$=F.month+1;break}case"H":$=O.getUTCHours();break;case"h":$=O.getUTCHours(),$=$%12,$===0&&($=12);break;case"P":$=O.getUTCHours()>=12?"pm":"am";break;case"m":$=O.getUTCMinutes();break;case"s":$=O.getUTCSeconds();break;case"f":$=O.getUTCMilliseconds();break;case"Z":case"z":break;case"C":$="ISO";break;case"E":$="ISO";break}return $};let W=null;function Ae(O,I,$){var F=0,q=0;if(typeof $<"u"){const me=parseInt($);F=Math.floor(me/100),q=me%100}var V=function(me,fe){var ue=ce(me,fe.component);if("YMDdFWwXxHhms".indexOf(fe.component)!==-1)if(fe.component==="Y"&&fe.n!==-1&&(ue=ue%Math.pow(10,fe.n)),fe.names){if(fe.component==="M"||fe.component==="x")ue=pe[ue-1];else if(fe.component==="F")ue=le[ue];else throw{code:"D3133",value:fe.component};fe.names===Y.UPPER?ue=ue.toUpperCase():fe.names===Y.LOWER&&(ue=ue.toLowerCase()),fe.width&&ue.length>fe.width.max&&(ue=ue.substring(0,fe.width.max))}else ue=j(ue,fe.integerFormat);else if(fe.component==="f")ue=j(ue,fe.integerFormat);else if(fe.component==="Z"||fe.component==="z"){const De=F*100+q;if(fe.integerFormat.regular)ue=j(De,fe.integerFormat);else{const de=fe.integerFormat.mandatoryDigits;if(de===1||de===2)ue=j(F,fe.integerFormat),q!==0&&(ue+=":"+k(q,"00"));else if(de===3||de===4)ue=j(De,fe.integerFormat);else throw{code:"D3134",value:de}}De>=0&&(ue="+"+ue),fe.component==="z"&&(ue="GMT"+ue),De===0&&fe.presentation2==="t"&&(ue="Z")}else fe.component==="P"&&fe.names===Y.UPPER&&(ue=ue.toUpperCase());return ue};let N;typeof I>"u"?(W===null&&(W=z("[Y0001]-[M01]-[D01]T[H01]:[m01]:[s01].[f001][Z01:01t]")),N=W):N=z(I);const G=(60*F+q)*60*1e3,ae=new Date(O+G);let Ce="";return N.parts.forEach(function(me){me.type==="literal"?Ce+=me.value:Ce+=V(ae,me)}),Ce}function g(O){var I=Object.create(null);if(O.type==="datetime")I.type="datetime",I.parts=O.parts.map(function($){var F=Object.create(null);if($.type==="literal")F.regex=$.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");else if($.component==="Z"||$.component==="z"){let V;Array.isArray($.integerFormat.groupingSeparators)||(V=$.integerFormat.groupingSeparators),F.regex="",$.component==="z"&&(F.regex="GMT"),F.regex+="[-+][0-9]+",V&&(F.regex+=V.character+"[0-9]+"),F.parse=function(N){$.component==="z"&&(N=N.substring(3));let G=0,ae=0;return V?(G=Number.parseInt(N.substring(0,N.indexOf(V.character))),ae=Number.parseInt(N.substring(N.indexOf(V.character)+1))):N.length-1<=2?G=Number.parseInt(N):(G=Number.parseInt(N.substring(0,3)),ae=Number.parseInt(N.substring(3))),G*60+ae}}else if($.component==="f")F.regex="[0-9]+",F.parse=function(V){return parseFloat("0."+V.substring(0,3))*1e3};else if($.integerFormat)F=g($.integerFormat);else{F.regex="[a-zA-Z]+";var q=Object.create(null);if($.component==="M"||$.component==="x")pe.forEach(function(V,N){$.width&&$.width.max?q[V.substring(0,$.width.max)]=N+1:q[V]=N+1});else if($.component==="F")le.forEach(function(V,N){N>0&&($.width&&$.width.max?q[V.substring(0,$.width.max)]=N:q[V]=N)});else if($.component==="P")q={am:0,AM:0,pm:1,PM:1};else throw{code:"D3133",value:$.component};F.parse=function(V){return q[V]}}return F.component=$.component,F});else{I.type="integer";const $=O.case===Y.UPPER;switch(O.primary){case D.LETTERS:I.regex=$?"[A-Z]+":"[a-z]+",I.parse=function(F){return M(F,$?"A":"a")};break;case D.ROMAN:I.regex=$?"[MDCLXVI]+":"[mdclxvi]+",I.parse=function(F){return x($?F:F.toUpperCase())};break;case D.WORDS:I.regex="(?:"+n.keys(C).concat("and","[\\-, ]").join("|")+")+",I.parse=function(F){return E(F.toLowerCase())};break;case D.DECIMAL:I.regex="[0-9]",O.parseWidth?I.regex+=`{${O.parseWidth}}`:I.regex+="+",O.ordinal&&(I.regex+="(?:th|st|nd|rd)"),I.parse=function(F){let q=F;return O.ordinal&&(q=F.substring(0,F.length-2)),O.regular?q=q.split(",").join(""):O.groupingSeparators.forEach(V=>{q=q.split(V.character).join("")}),O.zeroCode!==48&&(q=q.split("").map(V=>String.fromCodePoint(V.codePointAt(0)-O.zeroCode+48)).join("")),parseInt(q)};break;case D.SEQUENCE:throw{code:"D3130",value:O.token}}}return I}function _(O,I){if(typeof O>"u")return;const $=re(I);return g($).parse(O)}function te(O,I){const $=z(I),F=g($),q="^"+F.parts.map(ae=>"("+ae.regex+")").join("")+"$";var N=new RegExp(q,"i").exec(O);if(N!==null){const de=Object.create(null);for(let u=1;u<N.length;u++){const v=F.parts[u-1];v.parse&&(de[v.component]=v.parse(N[u]))}if(Object.getOwnPropertyNames(de).length===0)return;let mt=0;const Yt=u=>{mt<<=1,mt+=u?1:0},St=u=>!(~u&mt)&&!!(u&mt);"YXMxWwdD".split("").forEach(u=>Yt(de[u]));const Pt=!St(161)&&St(130),Ps=St(84),Lr=!Ps&&St(72);mt=0,"PHhmsf".split("").forEach(u=>Yt(de[u]));const J=!St(23)&&St(47),ts=(Pt?"YD":Ps?"XxwF":Lr?"XWF":"YMD")+(J?"Phmsf":"Hmsf"),di=this.environment.timestamp;let ds=!1,cr=!1;if(ts.split("").forEach(u=>{if(typeof de[u]>"u")ds?(de[u]="MDd".indexOf(u)!==-1?1:0,cr=!0):de[u]=ce(di,u);else if(ds=!0,cr)throw{code:"D3136"}}),de.M>0?de.M-=1:de.M=0,Pt){const u=Date.UTC(de.Y,0),v=(de.d-1)*1e3*60*60*24,w=new Date(u+v);de.M=w.getUTCMonth(),de.D=w.getUTCDate()}if(Ps)throw{code:"D3136"};if(Lr)throw{code:"D3136"};J&&(de.H=de.h===12?0:de.h,de.P===1&&(de.H+=12));var G=Date.UTC(de.Y,de.M,de.D,de.H,de.m,de.s,de.f);return(de.Z||de.z)&&(G-=(de.Z||de.z)*60*1e3),G}}var we=new RegExp("^\\d{4}(-[01]\\d)?(-[0-3]\\d)?(T[0-2]\\d:[0-5]\\d:[0-5]\\d)?(\\.\\d+)?([+-][0-2]\\d:?[0-5]\\d|Z)?$");function Pe(O,I){if(!(typeof O>"u"))if(typeof I>"u"){if(!we.test(O))throw{stack:new Error().stack,code:"D3110",value:O};return Date.parse(O)}else return te.call(this,O,I)}function Ee(O,I,$){if(!(typeof O>"u"))return Ae.call(this,O,I,$)}return{formatInteger:k,parseInteger:_,fromMillis:Ee,toMillis:Pe}})();i.exports=o},{"./utils":6}],2:[function(s,i,r){(function(n){(function(){var o=s("./utils");const c=(()=>{var d=o.isNumeric,b=o.isArrayOfStrings,A=o.isArrayOfNumbers,m=o.isSequence,f=o.isFunction,C=o.isLambda,E=o.isPromise,T=o.getFunctionArity,U=o.isDeepEqual,B=o.stringToArray;function x(a){if(!(typeof a>"u")){var l=0;return a.forEach(function(p){l+=p}),l}}function y(a){return typeof a>"u"?0:a.length}function M(a){if(!(typeof a>"u"||a.length===0))return Math.max.apply(Math,a)}function k(a){if(!(typeof a>"u"||a.length===0))return Math.min.apply(Math,a)}function D(a){if(!(typeof a>"u"||a.length===0)){var l=0;return a.forEach(function(p){l+=p}),l/a.length}}function Y(a,l=!1){if(!(typeof a>"u")){var p;if(typeof a=="string")p=a;else if(f(a))p="";else{if(typeof a=="number"&&!isFinite(a))throw{code:"D3001",value:a,stack:new Error().stack};var P=l?2:0;Array.isArray(a)&&a.outerWrapper&&(a=a[0]),p=JSON.stringify(a,function(S,L){return typeof L<"u"&&L!==null&&d(L)?L.toPrecision&&!Number.isInteger(L)?Number(L.toPrecision(15)):L:L&&f(L)?"":L},P)}return p}}function j(a,l,p){if(!(typeof a>"u")){var P=B(a),S=P.length;if(S+l<0&&(l=0),typeof p<"u"){if(p<=0)return"";var L=l>=0?l+p:S+l+p;return P.slice(l,L).join("")}return P.slice(l).join("")}}function ne(a,l){if(!(typeof a>"u")){var p=a.indexOf(l);return p>-1?a.substr(0,p):a}}function re(a,l){if(!(typeof a>"u")){var p=a.indexOf(l);return p>-1?a.substr(p+l.length):a}}function ie(a){if(!(typeof a>"u"))return a.toLowerCase()}function z(a){if(!(typeof a>"u"))return a.toUpperCase()}function le(a){if(!(typeof a>"u"))return B(a).length}function pe(a){if(!(typeof a>"u")){var l=a.replace(/[ \t\n\r]+/gm," ");return l.charAt(0)===" "&&(l=l.substring(1)),l.charAt(l.length-1)===" "&&(l=l.substring(0,l.length-1)),l}}function Be(a,l,p){if(!(typeof a>"u")){(typeof p>"u"||p.length===0)&&(p=" ");var P;l=Math.trunc(l);var S=Math.abs(l)-le(a);if(S>0){var L=new Array(S+1).join(p);p.length>1&&(L=j(L,0,S)),l>0?P=a+L:P=L+a}else P=a;return P}}async function he(a,l){var p=a.apply(this,[l]);if(E(p)&&(p=await p),p&&!(typeof p.start=="number"||p.end==="number"||Array.isArray(p.groups)||f(p.next)))throw{code:"T1010",stack:new Error().stack};return p}async function ge(a,l){if(!(typeof a>"u"||typeof l>"u")){var p;if(typeof l=="string")p=a.indexOf(l)!==-1;else{var P=await he(l,a);p=typeof P<"u"}return p}}async function $e(a,l,p){if(!(typeof a>"u")){if(p<0)throw{stack:new Error().stack,value:p,code:"D3040",index:3};var P=this.createSequence();if(typeof p>"u"||p>0){var S=0,L=await he(l,a);if(typeof L<"u")for(;typeof L<"u"&&(typeof p>"u"||S<p);)P.push({match:L.match,index:L.start,groups:L.groups}),L=await he(L.next),S++}return P}}async function ce(a,l,p,P){if(!(typeof a>"u")){var S=this;if(l==="")throw{code:"D3010",stack:new Error().stack,value:l,index:2};if(P<0)throw{code:"D3011",stack:new Error().stack,value:P,index:4};var L;typeof p=="string"?L=function(Ge){for(var nt="",Me=0,Qe=p.indexOf("$",Me);Qe!==-1&&Me<p.length;){nt+=p.substring(Me,Qe),Me=Qe+1;var Zt=p.charAt(Me);if(Zt==="$")nt+="$",Me++;else if(Zt==="0")nt+=Ge.match,Me++;else{var xt;if(Ge.groups.length===0?xt=1:xt=Math.floor(Math.log(Ge.groups.length)*Math.LOG10E)+1,Qe=parseInt(p.substring(Me,Me+xt),10),xt>1&&Qe>Ge.groups.length&&(Qe=parseInt(p.substring(Me,Me+xt-1),10)),isNaN(Qe))nt+="$";else{if(Ge.groups.length>0){var ps=Ge.groups[Qe-1];typeof ps<"u"&&(nt+=ps)}Me+=Qe.toString().length}}Qe=p.indexOf("$",Me)}return nt+=p.substring(Me),nt}:L=p;var H="",K=0;if(typeof P>"u"||P>0){var _e=0;if(typeof l=="string"){for(var oe=a.indexOf(l,K);oe!==-1&&(typeof P>"u"||_e<P);)H+=a.substring(K,oe),H+=p,K=oe+l.length,_e++,oe=a.indexOf(l,K);H+=a.substring(K)}else{var je=await he(l,a);if(typeof je<"u"){for(;typeof je<"u"&&(typeof P>"u"||_e<P);){H+=a.substring(K,je.start);var Ke=L.apply(S,[je]);if(E(Ke)&&(Ke=await Ke),typeof Ke=="string")H+=Ke;else throw{code:"D3012",stack:new Error().stack,value:Ke};K=je.start+je.match.length,_e++,je=await he(je.next)}H+=a.substring(K)}else H=a}}else H=a;return H}}function W(a){if(!(typeof a>"u")){var l=typeof window<"u"?window.btoa:function(p){return new n.Buffer.from(p,"binary").toString("base64")};return l(a)}}function Ae(a){if(!(typeof a>"u")){var l=typeof window<"u"?window.atob:function(p){return new n.Buffer.from(p,"base64").toString("binary")};return l(a)}}function g(a){if(!(typeof a>"u")){var l;try{l=encodeURIComponent(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"encodeUrlComponent"}}return l}}function _(a){if(!(typeof a>"u")){var l;try{l=encodeURI(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"encodeUrl"}}return l}}function te(a){if(!(typeof a>"u")){var l;try{l=decodeURIComponent(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"decodeUrlComponent"}}return l}}function we(a){if(!(typeof a>"u")){var l;try{l=decodeURI(a)}catch{throw{code:"D3140",stack:new Error().stack,value:a,functionName:"decodeUrl"}}return l}}async function Pe(a,l,p){if(!(typeof a>"u")){if(p<0)throw{code:"D3020",stack:new Error().stack,value:p,index:3};var P=[];if(typeof p>"u"||p>0)if(typeof l=="string")P=a.split(l,p);else{var S=0,L=await he(l,a);if(typeof L<"u"){for(var H=0;typeof L<"u"&&(typeof p>"u"||S<p);)P.push(a.substring(H,L.start)),H=L.end,L=await he(L.next),S++;(typeof p>"u"||S<p)&&P.push(a.substring(H))}else P.push(a)}return P}}function Ee(a,l){if(!(typeof a>"u"))return typeof l>"u"&&(l=""),a.join(l)}function O(a,l,p){if(!(typeof a>"u")){var P={"decimal-separator":".","grouping-separator":",","exponent-separator":"e",infinity:"Infinity","minus-sign":"-",NaN:"NaN",percent:"%","per-mille":"‰","zero-digit":"0",digit:"#","pattern-separator":";"},S=P;typeof p<"u"&&o.keys(p).forEach(function(be){S[be]=p[be]});for(var L=[],H=S["zero-digit"].charCodeAt(0),K=H;K<H+10;K++)L.push(String.fromCharCode(K));var _e=L.concat([S["decimal-separator"],S["exponent-separator"],S["grouping-separator"],S.digit,S["pattern-separator"]]),oe=l.split(S["pattern-separator"]);if(oe.length>2)throw{code:"D3080",stack:new Error().stack};var je=function(be){var Ze=(function(){for(var ut,qt=0;qt<be.length;qt++)if(ut=be.charAt(qt),_e.indexOf(ut)!==-1&&ut!==S["exponent-separator"])return be.substring(0,qt);return""})(),Ct=(function(){for(var ut,qt=be.length-1;qt>=0;qt--)if(ut=be.charAt(qt),_e.indexOf(ut)!==-1&&ut!==S["exponent-separator"])return be.substring(qt+1);return""})(),Ye=be.substring(Ze.length,be.length-Ct.length),Ft,Hs,Rt,hr,zt=be.indexOf(S["exponent-separator"],Ze.length);zt===-1||zt>be.length-Ct.length?(Ft=Ye,Hs=void 0):(Ft=Ye.substring(0,zt),Hs=Ye.substring(zt+1));var ss=Ft.indexOf(S["decimal-separator"]);return ss===-1?(Rt=Ft,hr=Ct):(Rt=Ft.substring(0,ss),hr=Ft.substring(ss+1)),{prefix:Ze,suffix:Ct,activePart:Ye,mantissaPart:Ft,exponentPart:Hs,integerPart:Rt,fractionalPart:hr,subpicture:be}},Ke=function(be){var Ze,Ct,Ye=be.subpicture,Ft=Ye.indexOf(S["decimal-separator"]);Ft!==Ye.lastIndexOf(S["decimal-separator"])&&(Ze="D3081"),Ye.indexOf(S.percent)!==Ye.lastIndexOf(S.percent)&&(Ze="D3082"),Ye.indexOf(S["per-mille"])!==Ye.lastIndexOf(S["per-mille"])&&(Ze="D3083"),Ye.indexOf(S.percent)!==-1&&Ye.indexOf(S["per-mille"])!==-1&&(Ze="D3084");var Hs=!1;for(Ct=0;Ct<be.mantissaPart.length;Ct++){var Rt=be.mantissaPart.charAt(Ct);if(L.indexOf(Rt)!==-1||Rt===S.digit){Hs=!0;break}}Hs||(Ze="D3085");var hr=be.activePart.split("").map(function(ut){return _e.indexOf(ut)===-1?"p":"a"}).join("");hr.indexOf("p")!==-1&&(Ze="D3086"),Ft!==-1?(Ye.charAt(Ft-1)===S["grouping-separator"]||Ye.charAt(Ft+1)===S["grouping-separator"])&&(Ze="D3087"):be.integerPart.charAt(be.integerPart.length-1)===S["grouping-separator"]&&(Ze="D3088"),Ye.indexOf(S["grouping-separator"]+S["grouping-separator"])!==-1&&(Ze="D3089");var zt=be.integerPart.indexOf(S.digit);zt!==-1&&be.integerPart.substring(0,zt).split("").filter(function(ut){return L.indexOf(ut)>-1}).length>0&&(Ze="D3090"),zt=be.fractionalPart.lastIndexOf(S.digit),zt!==-1&&be.fractionalPart.substring(zt).split("").filter(function(ut){return L.indexOf(ut)>-1}).length>0&&(Ze="D3091");var ss=typeof be.exponentPart=="string";if(ss&&be.exponentPart.length>0&&(Ye.indexOf(S.percent)!==-1||Ye.indexOf(S["per-mille"])!==-1)&&(Ze="D3092"),ss&&(be.exponentPart.length===0||be.exponentPart.split("").filter(function(ut){return L.indexOf(ut)===-1}).length>0)&&(Ze="D3093"),Ze)throw{code:Ze,stack:new Error().stack}},Ge=function(be){var Ze=function(gt,mn){for(var mi=[],xs=gt.indexOf(S["grouping-separator"]);xs!==-1;){var gn=(mn?gt.substring(0,xs):gt.substring(xs)).split("").filter(function(Nr){return L.indexOf(Nr)!==-1||Nr===S.digit}).length;mi.push(gn),xs=be.integerPart.indexOf(S["grouping-separator"],xs+1)}return mi},Ct=Ze(be.integerPart),Ye=function(gt){if(gt.length===0)return 0;for(var mn=function(gn,Nr){return Nr===0?gn:mn(Nr,gn%Nr)},mi=gt.reduce(mn),xs=1;xs<=gt.length;xs++)if(gt.indexOf(xs*mi)===-1)return 0;return mi},Ft=Ye(Ct),Hs=Ze(be.fractionalPart,!0),Rt=be.integerPart.split("").filter(function(gt){return L.indexOf(gt)!==-1}).length,hr=Rt,zt=be.fractionalPart.split(""),ss=zt.filter(function(gt){return L.indexOf(gt)!==-1}).length,ut=zt.filter(function(gt){return L.indexOf(gt)!==-1||gt===S.digit}).length,qt=typeof be.exponentPart=="string";Rt===0&&ut===0&&(qt?(ss=1,ut=1):Rt=1),qt&&Rt===0&&be.integerPart.indexOf(S.digit)!==-1&&(Rt=1),Rt===0&&ss===0&&(ss=1);var Kl=0;return qt&&(Kl=be.exponentPart.split("").filter(function(gt){return L.indexOf(gt)!==-1}).length),{integerPartGroupingPositions:Ct,regularGrouping:Ft,minimumIntegerPartSize:Rt,scalingFactor:hr,prefix:be.prefix,fractionalPartGroupingPositions:Hs,minimumFactionalPartSize:ss,maximumFactionalPartSize:ut,minimumExponentSize:Kl,suffix:be.suffix,picture:be.subpicture}},nt=oe.map(je);nt.forEach(Ke);var Me=nt.map(Ge),Qe=S["minus-sign"],Zt=S["zero-digit"],xt=S["decimal-separator"],ps=S["grouping-separator"];Me.length===1&&(Me.push(JSON.parse(JSON.stringify(Me[0]))),Me[1].prefix=Qe+Me[1].prefix);var ot;a>=0?ot=Me[0]:ot=Me[1];var pi;ot.picture.indexOf(S.percent)!==-1?pi=a*100:ot.picture.indexOf(S["per-mille"])!==-1?pi=a*1e3:pi=a;var Bs,Mr;if(ot.minimumExponentSize===0)Bs=pi;else{var rg=Math.pow(10,ot.scalingFactor),ig=Math.pow(10,ot.scalingFactor-1);if(Bs=pi,Mr=0,Bs!==0){for(;Math.abs(Bs)<ig;)Bs*=10,Mr-=1;for(;Math.abs(Bs)>rg;)Bs/=10,Mr+=1}}var ng=N(Bs,ot.maximumFactionalPartSize),Vl=function(be,Ze){var Ct=Math.abs(be).toFixed(Ze);return Zt!=="0"&&(Ct=Ct.split("").map(function(Ye){return Ye>="0"&&Ye<="9"?L[Ye.charCodeAt(0)-48]:Ye}).join("")),Ct},ke=Vl(ng,ot.maximumFactionalPartSize),At=ke.indexOf(".");for(At===-1?ke=ke+xt:ke=ke.replace(".",xt);ke.charAt(0)===Zt;)ke=ke.substring(1);for(;ke.charAt(ke.length-1)===Zt;)ke=ke.substring(0,ke.length-1);At=ke.indexOf(xt);var fi=ot.minimumIntegerPartSize-At,Wl=ot.minimumFactionalPartSize-(ke.length-At-1);if(ke=(fi>0?new Array(fi+1).join(Zt):"")+ke,ke=ke+(Wl>0?new Array(Wl+1).join(Zt):""),At=ke.indexOf(xt),ot.regularGrouping>0)for(var og=Math.floor((At-1)/ot.regularGrouping),pn=1;pn<=og;pn++)ke=[ke.slice(0,At-pn*ot.regularGrouping),ps,ke.slice(At-pn*ot.regularGrouping)].join("");else ot.integerPartGroupingPositions.forEach(function(be){ke=[ke.slice(0,At-be),ps,ke.slice(At-be)].join(""),At++});if(At=ke.indexOf(xt),ot.fractionalPartGroupingPositions.forEach(function(be){ke=[ke.slice(0,be+At+1),ps,ke.slice(be+At+1)].join("")}),At=ke.indexOf(xt),(ot.picture.indexOf(xt)===-1||At===ke.length-1)&&(ke=ke.substring(0,ke.length-1)),typeof Mr<"u"){var fn=Vl(Mr,0);fi=ot.minimumExponentSize-fn.length,fi>0&&(fn=new Array(fi+1).join(Zt)+fn),ke=ke+S["exponent-separator"]+(Mr<0?Qe:"")+fn}return ke=ot.prefix+ke+ot.suffix,ke}}function I(a,l){if(!(typeof a>"u")){if(a=N(a),typeof l>"u"?l=10:l=N(l),l<2||l>36)throw{code:"D3100",stack:new Error().stack,value:l};var p=a.toString(l);return p}}function $(a){var l;if(!(typeof a>"u")){if(typeof a=="number")l=a;else if(typeof a=="string"&&/^-?[0-9]+(\.[0-9]+)?([Ee][-+]?[0-9]+)?$/.test(a)&&!isNaN(parseFloat(a))&&isFinite(a))l=parseFloat(a);else if(typeof a=="string"&&/^(0[xX][0-9A-Fa-f]+)|(0[oO][0-7]+)|(0[bB][0-1]+)$/.test(a))l=Number(a);else if(a===!0)l=1;else if(a===!1)l=0;else throw{code:"D3030",value:a,stack:new Error().stack,index:1};return l}}function F(a){var l;if(!(typeof a>"u"))return l=Math.abs(a),l}function q(a){var l;if(!(typeof a>"u"))return l=Math.floor(a),l}function V(a){var l;if(!(typeof a>"u"))return l=Math.ceil(a),l}function N(a,l){var p;if(!(typeof a>"u")){if(l){var P=a.toString().split("e");a=+(P[0]+"e"+(P[1]?+P[1]+l:l))}p=Math.round(a);var S=p-a;return Math.abs(S)===.5&&Math.abs(p%2)===1&&(p=p-1),l&&(P=p.toString().split("e"),p=+(P[0]+"e"+(P[1]?+P[1]-l:-l))),Object.is(p,-0)&&(p=0),p}}function G(a){var l;if(!(typeof a>"u")){if(a<0)throw{stack:new Error().stack,code:"D3060",index:1,value:a};return l=Math.sqrt(a),l}}function ae(a,l){var p;if(!(typeof a>"u")){if(p=Math.pow(a,l),!isFinite(p))throw{stack:new Error().stack,code:"D3061",index:1,value:a,exp:l};return p}}function Ce(){return Math.random()}function me(a){if(!(typeof a>"u")){var l=!1;if(Array.isArray(a)){if(a.length===1)l=me(a[0]);else if(a.length>1){var p=a.filter(function(P){return me(P)});l=p.length>0}}else typeof a=="string"?a.length>0&&(l=!0):d(a)?a!==0&&(l=!0):a!==null&&typeof a=="object"&&!f(a)?o.keys(a).length>0&&(l=!0):typeof a=="boolean"&&a===!0&&(l=!0);return l}}function fe(a){if(!(typeof a>"u"))return!me(a)}function ue(a,l,p,P){var S=[l],L=T(a);return L>=2&&S.push(p),L>=3&&S.push(P),S}async function De(a,l){if(!(typeof a>"u")){for(var p=this.createSequence(),P=0;P<a.length;P++){var S=ue(l,a[P],P,a),L=await l.apply(this,S);typeof L<"u"&&p.push(L)}return p}}async function de(a,l){if(!(typeof a>"u")){for(var p=this.createSequence(),P=0;P<a.length;P++){var S=a[P],L=ue(l,S,P,a),H=await l.apply(this,L);me(H)&&p.push(S)}return p}}async function mt(a,l){if(!(typeof a>"u")){for(var p=!1,P,S=0;S<a.length;S++){var L=a[S],H=!0;if(typeof l<"u"){var K=ue(l,L,S,a),_e=await l.apply(this,K);H=me(_e)}if(H)if(!p)P=L,p=!0;else throw{stack:new Error().stack,code:"D3138",index:S}}if(!p)throw{stack:new Error().stack,code:"D3139"};return P}}function Yt(){for(var a=[],l=Array.prototype.slice.call(arguments),p=Math.min.apply(Math,l.map(function(L){return Array.isArray(L)?L.length:0})),P=0;P<p;P++){var S=l.map(L=>L[P]);a.push(S)}return a}async function St(a,l,p){if(!(typeof a>"u")){var P,S=T(l);if(S<2)throw{stack:new Error().stack,code:"D3050",index:1};var L;for(typeof p>"u"&&a.length>0?(P=a[0],L=1):(P=p,L=0);L<a.length;){var H=[P,a[L]];S>=3&&H.push(L),S>=4&&H.push(a),P=await l.apply(this,H),L++}return P}}function it(a){var l=this.createSequence();if(Array.isArray(a)){for(var p=Object.create(null),P=0;P<a.length;P++){var S=it.call(this,a[P]);S.forEach(function(L){p[L]=!0})}l=it.call(this,p)}else a!==null&&typeof a=="object"&&!f(a)&&o.keys(a).forEach(L=>l.push(L));return l}function Pt(a,l){var p;if(Array.isArray(a)){p=this.createSequence();for(var P=0;P<a.length;P++){var S=Pt.call(this,a[P],l);typeof S<"u"&&(Array.isArray(S)?S.forEach(L=>p.push(L)):p.push(S))}}else a!==null&&typeof a=="object"&&Object.prototype.hasOwnProperty.call(a,l)&&!f(a)&&(p=a[l]);return p}function Ps(a,l){if(typeof a>"u")return l;if(typeof l>"u")return a;Array.isArray(a)||(a=this.createSequence(a)),Array.isArray(l)||(l=[l]);const p=a.length+l.length;if(this.options&&p>this.options.sequence)throw{code:"D2015",stack:new Error().stack,value:p};return a.concat(l)}function Lr(a){return!(typeof a>"u")}function Ir(a){var l=this.createSequence();if(Array.isArray(a))for(var p=0;p<a.length;p++)l=Ps.call(this,l,Ir.call(this,a[p]));else if(a!==null&&typeof a=="object"&&!C(a))for(const S of o.keys(a)){var P=Object.create(null);P[S]=a[S],l.push(P)}else l=a;return l}function J(a){if(!(typeof a>"u")){var l=Object.create(null);return a.forEach(function(p){for(const P of o.keys(p))l[P]=p[P]}),l}}function un(a){if(!(typeof a>"u")){if(a.length<=1)return a;for(var l=a.length,p=new Array(l),P=0;P<l;P++)p[l-P-1]=a[P];return p}}async function dn(a,l){var p=this.createSequence();for(const L of o.keys(a)){var P=ue(l,a[L],L,a),S=await l.apply(this,P);typeof S<"u"&&p.push(S)}return p}function ts(a){throw{code:"D3137",stack:new Error().stack,message:a||"$error() function evaluated"}}function di(a,l){if(!a)throw{code:"D3141",stack:new Error().stack,message:l||"$assert() statement failed"}}function ds(a){if(a!==void 0)return a===null?"null":d(a)?"number":typeof a=="string"?"string":typeof a=="boolean"?"boolean":Array.isArray(a)?"array":f(a)?"function":"object"}async function cr(a,l){if(!(typeof a>"u")){if(a.length<=1)return a;var p;if(typeof l>"u"){if(!A(a)&&!b(a))throw{stack:new Error().stack,code:"D3070",index:1};p=async function(H,K){return H>K}}else p=l;var P=async function(H,K){var _e=async function(je,Ke,Ge){Ke.length===0?Array.prototype.push.apply(je,Ge):Ge.length===0?Array.prototype.push.apply(je,Ke):await p(Ke[0],Ge[0])?(je.push(Ge[0]),await _e(je,Ke,Ge.slice(1))):(je.push(Ke[0]),await _e(je,Ke.slice(1),Ge))},oe=[];return await _e(oe,H,K),oe},S=async function(H){if(!Array.isArray(H)||H.length<=1)return H;var K=Math.floor(H.length/2),_e=H.slice(0,K),oe=H.slice(K);return _e=await S(_e),oe=await S(oe),await P(_e,oe)},L=await S(a);return L}}function u(a){if(!(typeof a>"u")){if(a.length<=1)return a;for(var l=new Array(a.length),p=0;p<a.length;p++){var P=Math.floor(Math.random()*(p+1));p!==P&&(l[p]=l[P]),l[P]=a[p]}return l}}function v(a){if(!(typeof a>"u")){if(!Array.isArray(a)||a.length<=1)return a;for(var l=m(a)?this.createSequence():[],p=0;p<a.length;p++){for(var P=a[p],S=!1,L=0;L<l.length;L++)if(U(P,l[L])){S=!0;break}S||l.push(P)}return l}}async function w(a,l){var p=Object.create(null);for(const H of o.keys(a)){var P=a[H],S=ue(l,P,H,a),L=await l.apply(this,S);me(L)&&(p[H]=P)}return o.keys(p).length===0&&(p=void 0),p}return{sum:x,count:y,max:M,min:k,average:D,string:Y,substring:j,substringBefore:ne,substringAfter:re,lowercase:ie,uppercase:z,length:le,trim:pe,pad:Be,match:$e,contains:ge,replace:ce,split:Pe,join:Ee,formatNumber:O,formatBase:I,number:$,floor:q,ceil:V,round:N,abs:F,sqrt:G,power:ae,random:Ce,boolean:me,not:fe,map:De,zip:Yt,filter:de,single:mt,foldLeft:St,sift:w,keys:it,lookup:Pt,append:Ps,exists:Lr,spread:Ir,merge:J,reverse:un,each:dn,error:ts,assert:di,type:ds,sort:cr,shuffle:u,distinct:v,base64encode:W,base64decode:Ae,encodeUrlComponent:g,encodeUrl:_,decodeUrlComponent:te,decodeUrl:we}})();i.exports=c}).call(this)}).call(this,typeof ia<"u"?ia:typeof self<"u"?self:typeof window<"u"?window:{})},{"./utils":6}],3:[function(s,i,r){var n=s("./datetime"),o=s("./functions"),c=s("./utils"),d=s("./parser"),b=s("./signature"),A=(function(){var m=c.isNumeric,f=c.isArrayOfStrings,C=c.isArrayOfNumbers,E=c.isSequence,T=c.isFunction,U=c.isLambda,B=c.isIterable,x=c.isPromise,y=c.getFunctionArity,M=c.isDeepEqual,k=ts(null);async function D(u,v,w){var a;w.base.depth++,w.base.guardrails();var l=w.lookup(Symbol.for("jsonata.__evaluate_entry"));switch(l&&await l(u,v,w),u.type){case"path":a=await Y(u,v,w);break;case"binary":a=await le(u,v,w);break;case"unary":a=await pe(u,v,w);break;case"name":a=Be(u,v,w);break;case"string":case"number":case"value":a=he(u);break;case"wildcard":a=ge(u,v,w);break;case"descendant":a=ce(u,v,w);break;case"parent":a=w.lookup(u.slot.label);break;case"condition":a=await q(u,v,w);break;case"block":a=await V(u,v,w);break;case"bind":a=await F(u,v,w);break;case"regex":a=N(u,v,w);break;case"function":a=await ue(u,v,w);break;case"variable":a=G(u,v,w);break;case"lambda":a=mt(u,v,w);break;case"partial":a=await Yt(u,v,w);break;case"apply":a=await fe(u,v,w);break;case"transform":a=Ce(u,v,w);break}if(Object.prototype.hasOwnProperty.call(u,"predicate"))for(var p=0;p<u.predicate.length;p++)a=await z(u.predicate[p].expr,a,w);u.type!=="path"&&Object.prototype.hasOwnProperty.call(u,"group")&&(a=await O(u.group,a,w));var P=w.lookup(Symbol.for("jsonata.__evaluate_exit"));return P&&await P(u,v,w,a),a&&E(a)&&!a.tupleStream&&(u.keepArray&&(a.keepSingleton=!0),a.length===0?a=void 0:a.length===1&&(a=a.keepSingleton?a:a[0])),w.base.depth--,a}async function Y(u,v,w){var a;Array.isArray(v)&&u.steps[0].type!=="variable"?a=v:a=w.base.createSequence(v);for(var l,p=!1,P=void 0,S=0;S<u.steps.length;S++){var L=u.steps[S];if(L.tuple&&(p=!0),S===0&&L.consarray?l=await D(L,a,w):p?P=await ie(L,a,P,w):l=await ne(L,a,w,S===u.steps.length-1),!p&&(typeof l>"u"||l.length===0))break;typeof L.focus>"u"&&(a=l)}if(p)if(u.tuple)l=P;else for(l=w.base.createSequence(),S=0;S<P.length;S++)l.push(P[S]["@"]);return u.keepSingletonArray&&(Array.isArray(l)&&l.cons&&!l.sequence&&(l=w.base.createSequence(l)),l.keepSingleton=!0),Object.prototype.hasOwnProperty.call(u,"group")&&(l=await O(u.group,p?P:l,w)),l}function j(u,v){var w=ts(u);for(const a of c.keys(v))w.bind(a,v[a]);return w}async function ne(u,v,w,a){var l;if(u.type==="sort")return l=await ae(u,v,w),u.stages&&(l=await re(u.stages,l,w)),l;l=w.base.createSequence();for(var p=0;p<v.length;p++){var P=await D(u,v[p],w);if(u.stages)for(var S=0;S<u.stages.length;S++)P=await z(u.stages[S].expr,P,w);typeof P<"u"&&l.push(P)}var L=w.base.createSequence();return a&&l.length===1&&Array.isArray(l[0])&&!E(l[0])?L=l[0]:Array.prototype.forEach.call(l,function(H){!Array.isArray(H)||H.cons?L.push(H):Array.prototype.forEach.call(H,K=>L.push(K))}),L}async function re(u,v,w){for(var a=v,l=0;l<u.length;l++){var p=u[l];switch(p.type){case"filter":a=await z(p.expr,a,w);break;case"index":for(var P=0;P<a.length;P++){var S=a[P];S[p.value]=P}break}}return a}async function ie(u,v,w,a){var l;if(u.type==="sort"){if(w)l=await ae(u,w,a);else{var p=await ae(u,v,a);l=a.base.createSequence(),l.tupleStream=!0;for(var P=0;P<p.length;P++){var S={"@":p[P]};S[u.index]=P,l.push(S)}}return u.stages&&(l=await re(u.stages,l,a)),l}l=a.base.createSequence(),l.tupleStream=!0;var L=a;w===void 0&&(w=v.map(oe=>({"@":oe})));for(var H=0;H<w.length;H++){L=j(a,w[H]);var K=await D(u,w[H]["@"],L);if(typeof K<"u"){Array.isArray(K)||(K=[K]);for(var _e=0;_e<K.length;_e++)S=Object.create(null),Object.assign(S,w[H]),K.tupleStream?Object.assign(S,K[_e]):(u.focus?(S[u.focus]=K[_e],S["@"]=w[H]["@"]):S["@"]=K[_e],u.index&&(S[u.index]=_e),u.ancestor&&(S[u.ancestor.label]=w[H]["@"])),l.push(S)}}return u.stages&&(l=await re(u.stages,l,a)),l}async function z(u,v,w){var a=w.base.createSequence();if(v&&v.tupleStream&&(a.tupleStream=!0),Array.isArray(v)||(v=w.base.createSequence(v)),u.type==="number"){var l=Math.floor(u.value);l<0&&(l=v.length+l);var p=await v[l];typeof p<"u"&&(Array.isArray(p)?a=p:a.push(p))}else for(l=0;l<v.length;l++){var p=v[l],P=p,S=w;v.tupleStream&&(P=p["@"],S=j(w,p));var L=await D(u,P,S);m(L)&&(L=[L]),C(L)?Array.prototype.forEach.call(L,function(K){var _e=Math.floor(K);_e<0&&(_e=v.length+_e),_e===l&&a.push(p)}):o.boolean(L)&&a.push(p)}return a}async function le(u,v,w){var a,l=await D(u.lhs,v,w),p=u.value,P=async()=>await D(u.rhs,v,w);if(p==="and"||p==="or")try{return await we(l,P,p)}catch(L){throw L.position=u.position,L.token=p,L}var S=await P();try{switch(p){case"+":case"-":case"*":case"/":case"%":a=Ae(l,S,p);break;case"=":case"!=":a=g(l,S,p);break;case"<":case"<=":case">":case">=":a=_(l,S,p);break;case"&":a=Ee(l,S);break;case"..":a=$(l,S,w);break;case"in":a=te(l,S);break}}catch(L){throw L.position=u.position,L.token=p,L}return a}async function pe(u,v,w){var a,l={options:w.base.options,createSequence:w.base.createSequence};switch(u.value){case"-":if(a=await D(u.expression,v,w),typeof a>"u")a=void 0;else if(m(a))a=-a;else throw{code:"D1002",stack:new Error().stack,position:u.position,token:u.value,value:a};break;case"[":a=[];let S=await Promise.all(u.expressions.map(async(L,H)=>(w.isParallelCall=H>0,[L,await D(L,v,w)])));for(let L of S){var[p,P]=L;typeof P<"u"&&(p.value==="["?a.push(P):a=o.append.call(l,a,P))}u.consarray&&Object.defineProperty(a,"cons",{enumerable:!1,configurable:!1,value:!0});break;case"{":a=await O(u,v,w);break}return a}function Be(u,v,w){var a={createSequence:w.base.createSequence};return o.lookup.call(a,v,u.value)}function he(u){return u.value}function ge(u,v,w){var a={options:w.base.options,createSequence:w.base.createSequence},l=a.createSequence();return Array.isArray(v)&&v.outerWrapper&&v.length>0&&(v=v[0]),v!==null&&typeof v=="object"&&!T(v)&&c.keys(v).forEach(function(p){var P=v[p];Array.isArray(P)?(P=$e(P),l=o.append.call(a,l,P)):l.push(P)}),l}function $e(u,v){return typeof v>"u"&&(v=[]),Array.isArray(u)?Array.prototype.forEach.call(u,function(w){$e(w,v)}):v.push(u),v}function ce(u,v,w){var a,l=w.base.createSequence();return typeof v<"u"&&(W(v,l),l.length===1?a=l[0]:a=l),a}function W(u,v){Array.isArray(u)||v.push(u),Array.isArray(u)?Array.prototype.forEach.call(u,function(w){W(w,v)}):u!==null&&typeof u=="object"&&!T(u)&&c.keys(u).forEach(function(w){W(u[w],v)})}function Ae(u,v,w){var a;if(typeof u<"u"&&!m(u))throw{code:"T2001",stack:new Error().stack,value:u};if(typeof v<"u"&&!m(v))throw{code:"T2002",stack:new Error().stack,value:v};if(typeof u>"u"||typeof v>"u")return a;switch(w){case"+":a=u+v;break;case"-":a=u-v;break;case"*":a=u*v;break;case"/":a=u/v;break;case"%":a=u%v;break}return a}function g(u,v,w){var a,l=typeof u,p=typeof v;if(l==="undefined"||p==="undefined")return!1;switch(w){case"=":a=M(u,v);break;case"!=":a=!M(u,v);break}return a}function _(u,v,w){var a,l=typeof u,p=typeof v,P=l==="undefined"||l==="string"||l==="number",S=p==="undefined"||p==="string"||p==="number";if(!P||!S)throw{code:"T2010",stack:new Error().stack,value:l==="string"||l==="number"?v:u};if(!(l==="undefined"||p==="undefined")){if(l!==p)throw{code:"T2009",stack:new Error().stack,value:u,value2:v};switch(w){case"<":a=u<v;break;case"<=":a=u<=v;break;case">":a=u>v;break;case">=":a=u>=v;break}return a}}function te(u,v){var w=!1;if(typeof u>"u"||typeof v>"u")return!1;Array.isArray(v)||(v=[v]);for(var a=0;a<v.length;a++)if(v[a]===u){w=!0;break}return w}async function we(u,v,w){var a,l=Pe(u);switch(w){case"and":a=l&&Pe(await v());break;case"or":a=l||Pe(await v());break}return a}function Pe(u){var v=o.boolean(u);return typeof v>"u"?!1:v}function Ee(u,v){var w,a="",l="";return typeof u<"u"&&(a=o.string(u)),typeof v<"u"&&(l=o.string(v)),w=a.concat(l),w}async function O(u,v,w){var a=Object.create(null),l=Object.create(null),p=!!(v&&v.tupleStream),P={options:w.base.options,createSequence:w.base.createSequence};Array.isArray(v)||(w.base.options,v=P.createSequence(v)),v.length===0&&!p&&v.push(void 0);for(var S=0;S<v.length;S++)for(var L=v[S],H=p?j(w,L):w,K=0;K<u.lhs.length;K++){var _e=u.lhs[K],oe=await D(_e[0],p?L["@"]:L,H);if(typeof oe!="string"&&oe!==void 0)throw{code:"T1003",stack:new Error().stack,position:u.position,value:oe};if(oe!==void 0){if(oe==="_jsonata_lambda"||oe==="_jsonata_function")throw{code:"D1013",stack:new Error().stack,position:u.position,value:oe};var je={data:L,exprIndex:K};if(Object.prototype.hasOwnProperty.call(l,oe)){if(l[oe].exprIndex!==K)throw{code:"D1009",stack:new Error().stack,position:u.position,value:oe};l[oe].data=o.append.call(P,l[oe].data,L)}else l[oe]=je}}let Ke=await Promise.all(c.keys(l).map(async(nt,Me)=>{let Qe=l[nt];var Zt=Qe.data,xt=w;if(p){var ps=I(Qe.data,w);Zt=ps["@"],delete ps["@"],xt=j(w,ps)}return w.isParallelCall=Me>0,[nt,await D(u.lhs[Qe.exprIndex][1],Zt,xt)]}));for(let nt of Ke){var[oe,Ge]=await nt;typeof Ge<"u"&&(a[oe]=Ge)}return a}function I(u,v){if(!Array.isArray(u))return u;var w=Object.create(null),a={options:v.base.options,createSequence:v.base.createSequence};Object.assign(w,u[0]);for(var l=1;l<u.length;l++)for(const p of c.keys(u[l]))w[p]=o.append.call(a,w[p],u[l][p]);return w}function $(u,v,w){var a;if(typeof u<"u"&&!Number.isInteger(u))throw{code:"T2003",stack:new Error().stack,value:u};if(typeof v<"u"&&!Number.isInteger(v))throw{code:"T2004",stack:new Error().stack,value:v};if(typeof u>"u"||typeof v>"u"||u>v)return a;var l=v-u+1;if(l>1e7)throw{code:"D2014",stack:new Error().stack,value:l};if(w.base.options&&l>w.base.options.sequence)throw{code:"D2015",stack:new Error().stack,value:l};a=new Array(l);for(var p=u,P=0;p<=v;p++,P++)a[P]=p;return a.sequence=!0,a}async function F(u,v,w){var a=await D(u.rhs,v,w);return w.bind(u.lhs.value,a),a}async function q(u,v,w){var a,l=await D(u.condition,v,w);return o.boolean(l)?a=await D(u.then,v,w):typeof u.else<"u"&&(a=await D(u.else,v,w)),a}async function V(u,v,w){for(var a,l=ts(w),p=0;p<u.expressions.length;p++)a=await D(u.expressions[p],v,l);return a}function N(u,v,w){var a=new w.base.RegexEngine(u.value),l=function(p,P){var S;a.lastIndex=P||0;var L=a.exec(p);if(L!==null){if(S={match:L[0],start:L.index,end:L.index+L[0].length,groups:[]},L.length>1)for(var H=1;H<L.length;H++)S.groups.push(L[H]);S.next=function(){if(!(a.lastIndex>=p.length)){var K=l(p,a.lastIndex);if(K&&K.match==="")throw{code:"D1004",stack:new Error().stack,position:u.position,value:u.value.source};return K}}}return S};return l}function G(u,v,w){var a;return u.value===""?a=v&&v.outerWrapper?v[0]:v:a=w.lookup(u.value),a}async function ae(u,v,w){var a,l=v,p=!!v.tupleStream,P=async function(L,H){for(var K=0,_e=0;K===0&&_e<u.terms.length;_e++){var oe=u.terms[_e],je=L,Ke=w;p&&(je=L["@"],Ke=j(w,L));var Ge=await D(oe.expression,je,Ke);je=H,Ke=w,p&&(je=H["@"],Ke=j(w,H));var nt=await D(oe.expression,je,Ke),Me=typeof Ge,Qe=typeof nt;if(Me==="undefined"){K=Qe==="undefined"?0:1;continue}if(Qe==="undefined"){K=-1;continue}if(!(Me==="string"||Me==="number")||!(Qe==="string"||Qe==="number"))throw{code:"T2008",stack:new Error().stack,position:u.position,value:Me==="string"||Me==="number"?nt:Ge};if(Me!==Qe)throw{code:"T2007",stack:new Error().stack,position:u.position,value:Ge,value2:nt};Ge!==nt&&(Ge<nt?K=-1:K=1,oe.descending===!0&&(K=-K))}return K===1},S={environment:w,input:v};return a=await o.sort.apply(S,[l,P]),a}function Ce(u,v,w){var a=async function(l){if(!(typeof l>"u")){var p=w.lookup("clone");if(!T(p))throw{code:"T2013",stack:new Error().stack,position:u.position};var P=await De(p,[l],null,w),S=await D(u.pattern,P,w);if(typeof S<"u"){Array.isArray(S)||(S=[S]);for(var L=0;L<S.length;L++){var H=S[L],K=await D(u.update,H,w),_e=typeof K;if(_e!=="undefined"){if(_e!=="object"||K===null||Array.isArray(K))throw{code:"T2011",stack:new Error().stack,position:u.update.position,value:K};for(const Ge of c.keys(K))H[Ge]=K[Ge]}if(typeof u.delete<"u"){var oe=await D(u.delete,H,w);if(typeof oe<"u"){var je=oe;if(Array.isArray(oe)||(oe=[oe]),!f(oe))throw{code:"T2012",stack:new Error().stack,position:u.delete.position,value:je};for(var Ke=0;Ke<oe.length;Ke++)typeof H=="object"&&H!==null&&delete H[oe[Ke]]}}}}return P}};return J(a,"<(oa):o>")}var me=d("function($f, $g) { function($x){ $g($f($x)) } }");async function fe(u,v,w){var a,l=await D(u.lhs,v,w);if(u.rhs.type==="function")a=await ue(u.rhs,v,w,{context:l});else{var p=await D(u.rhs,v,w);if(!T(p))throw{code:"T2006",stack:new Error().stack,position:u.position,value:p};if(T(l)){var P=await D(me,null,w);a=await De(P,[l,p],null,w)}else a=await De(p,[l],null,w)}return a}async function ue(u,v,w,a){var l,p=await D(u.procedure,v,w);if(typeof p>"u"&&u.procedure.type==="path"&&w.lookup(u.procedure.steps[0].value))throw{code:"T1005",stack:new Error().stack,position:u.position,token:u.procedure.steps[0].value};var P=[];typeof a<"u"&&P.push(a.context);for(var S=0;S<u.arguments.length;S++){const H=await D(u.arguments[S],v,w);if(T(H)){const K=async function(..._e){return await De(H,_e,null,w)};K.arity=y(H),P.push(K)}else P.push(H)}var L=u.procedure.type==="path"?u.procedure.steps[0].value:u.procedure.value;try{typeof p=="object"&&(p.token=L,p.position=u.position),l=await De(p,P,v,w)}catch(H){throw H.position||(H.position=u.position),H.token||(H.token=L),H}return l}async function De(u,v,w,a){var l;for(l=await de(u,v,w,a);U(l)&&l.thunk===!0;){var p=await D(l.body.procedure,l.input,l.environment);l.body.procedure.type==="variable"&&(p.token=l.body.procedure.value),p.position=l.body.procedure.position;for(var P=[],S=0;S<l.body.arguments.length;S++)P.push(await D(l.body.arguments[S],l.input,l.environment));l=await de(p,P,w,a)}return l}async function de(u,v,w,a){var l;try{var p=v;if(u&&(p=St(u.signature,v,w)),U(u))l=await it(u,p);else if(u&&u._jsonata_function===!0){var P={environment:a,input:w,options:a.base.options,createSequence:a.base.createSequence};l=u.implementation.apply(P,p),B(l)&&(l=l.next().value),x(l)&&(l=await l)}else if(typeof u=="function")l=u.apply(w,p),x(l)&&(l=await l);else throw{code:"T1006",stack:new Error().stack}}catch(S){throw u&&(typeof S.token>"u"&&typeof u.token<"u"&&(S.token=u.token),S.position=u.position||S.position),S}return l}function mt(u,v,w){var a={_jsonata_lambda:!0,input:v,environment:w,arguments:u.arguments,signature:u.signature,body:u.body};return u.thunk===!0&&(a.thunk=!0),a.apply=async function(l,p){return await De(a,p,v,l?l.environment:w)},a}async function Yt(u,v,w){for(var a,l=[],p=0;p<u.arguments.length;p++){var P=u.arguments[p];P.type==="operator"&&P.value==="?"?l.push(P):l.push(await D(P,v,w))}var S=await D(u.procedure,v,w);if(typeof S>"u"&&u.procedure.type==="path"&&w.lookup(u.procedure.steps[0].value))throw{code:"T1007",stack:new Error().stack,position:u.position,token:u.procedure.steps[0].value};if(U(S))a=Pt(S,l,w);else if(S&&S._jsonata_function===!0)a=Ps(S.implementation,l,w);else if(typeof S=="function")a=Ps(S,l,w);else throw{code:"T1008",stack:new Error().stack,position:u.position,token:u.procedure.type==="path"?u.procedure.steps[0].value:u.procedure.value};return a}function St(u,v,w){if(typeof u>"u")return v;var a=u.validate(v,w);return a}async function it(u,v){var w,a=ts(u.environment);return Array.prototype.forEach.call(u.arguments,function(l,p){a.bind(l.value,v[p])}),typeof u.body=="function"?w=await Lr(u.body,a):w=await D(u.body,u.input,a),w}function Pt(u,v,w){var a=ts(u.environment||w),l=[];Array.prototype.forEach.call(u.arguments,function(P,S){var L=v[S];L&&L.type==="operator"&&L.value==="?"?l.push(P):a.bind(P.value,L)});var p={_jsonata_lambda:!0,input:u.input,environment:a,arguments:l,body:u.body};return p}function Ps(u,v,w){var a=Ir(u);a=a.map(function(S){return"$"+S.trim()});var l="function("+a.join(", ")+"){ _ }",p=d(l);p.body=u;var P=Pt(p,v,w);return P}async function Lr(u,v){var w=Ir(u),a=w.map(function(P){return v.lookup(P.trim())}),l={environment:v,createSequence:v.base.createSequence},p=u.apply(l,a);return x(p)&&(p=await p),p}function Ir(u){var v=u.toString(),w=/\(([^)]*)\)/.exec(v)[1],a=w.split(",");return a}function J(u,v){var w={_jsonata_function:!0,implementation:u};return typeof v<"u"&&(w.signature=b(v)),w}async function un(u,v){if(!(typeof u>"u")){var w=this.input;typeof v<"u"&&(w=v,Array.isArray(w)&&!E(w)&&(w=this.createSequence(w),w.outerWrapper=!0));try{var a=d(u,!1)}catch(p){throw ds(p),{stack:new Error().stack,code:"D3120",value:p.message,error:p}}try{var l=await D(a,w,this.environment)}catch(p){throw ds(p),{stack:new Error().stack,code:"D3121",value:p.message,error:p}}return l}}function dn(u){if(!(typeof u>"u"))return JSON.parse(o.string(u))}function ts(u){var v=Object.create(null);const w={bind:function(l,p){v[l]=p},lookup:function(l){var p;return Object.prototype.hasOwnProperty.call(v,l)?p=v[l]:u&&(p=u.lookup(l)),p},timestamp:u?u.timestamp:null,async:u?u.async:!1,isParallelCall:u?u.isParallelCall:!1,global:u?u.global:{ancestry:[null]}};if(u){var a=u.lookup(Symbol.for("jsonata.__createFrame_push"));a&&a(u,w),w.base=u.base}return w}k.bind("sum",J(o.sum,"<a<n>:n>")),k.bind("count",J(o.count,"<a:n>")),k.bind("max",J(o.max,"<a<n>:n>")),k.bind("min",J(o.min,"<a<n>:n>")),k.bind("average",J(o.average,"<a<n>:n>")),k.bind("string",J(o.string,"<x-b?:s>")),k.bind("substring",J(o.substring,"<s-nn?:s>")),k.bind("substringBefore",J(o.substringBefore,"<s-s:s>")),k.bind("substringAfter",J(o.substringAfter,"<s-s:s>")),k.bind("lowercase",J(o.lowercase,"<s-:s>")),k.bind("uppercase",J(o.uppercase,"<s-:s>")),k.bind("length",J(o.length,"<s-:n>")),k.bind("trim",J(o.trim,"<s-:s>")),k.bind("pad",J(o.pad,"<s-ns?:s>")),k.bind("match",J(o.match,"<s-f<s:o>n?:a<o>>")),k.bind("contains",J(o.contains,"<s-(sf):b>")),k.bind("replace",J(o.replace,"<s-(sf)(sf)n?:s>")),k.bind("split",J(o.split,"<s-(sf)n?:a<s>>")),k.bind("join",J(o.join,"<a<s>s?:s>")),k.bind("formatNumber",J(o.formatNumber,"<n-so?:s>")),k.bind("formatBase",J(o.formatBase,"<n-n?:s>")),k.bind("formatInteger",J(n.formatInteger,"<n-s:s>")),k.bind("parseInteger",J(n.parseInteger,"<s-s:n>")),k.bind("number",J(o.number,"<(nsb)-:n>")),k.bind("floor",J(o.floor,"<n-:n>")),k.bind("ceil",J(o.ceil,"<n-:n>")),k.bind("round",J(o.round,"<n-n?:n>")),k.bind("abs",J(o.abs,"<n-:n>")),k.bind("sqrt",J(o.sqrt,"<n-:n>")),k.bind("power",J(o.power,"<n-n:n>")),k.bind("random",J(o.random,"<:n>")),k.bind("boolean",J(o.boolean,"<x-:b>")),k.bind("not",J(o.not,"<x-:b>")),k.bind("map",J(o.map,"<af>")),k.bind("zip",J(o.zip,"<a+>")),k.bind("filter",J(o.filter,"<af>")),k.bind("single",J(o.single,"<af?>")),k.bind("reduce",J(o.foldLeft,"<afj?:j>")),k.bind("sift",J(o.sift,"<o-f?:o>")),k.bind("keys",J(o.keys,"<x-:a<s>>")),k.bind("lookup",J(o.lookup,"<x-s:x>")),k.bind("append",J(o.append,"<xx:a>")),k.bind("exists",J(o.exists,"<x:b>")),k.bind("spread",J(o.spread,"<x-:a<o>>")),k.bind("merge",J(o.merge,"<a<o>:o>")),k.bind("reverse",J(o.reverse,"<a:a>")),k.bind("each",J(o.each,"<o-f:a>")),k.bind("error",J(o.error,"<s?:x>")),k.bind("assert",J(o.assert,"<bs?:x>")),k.bind("type",J(o.type,"<x:s>")),k.bind("sort",J(o.sort,"<af?:a>")),k.bind("shuffle",J(o.shuffle,"<a:a>")),k.bind("distinct",J(o.distinct,"<x:x>")),k.bind("base64encode",J(o.base64encode,"<s-:s>")),k.bind("base64decode",J(o.base64decode,"<s-:s>")),k.bind("encodeUrlComponent",J(o.encodeUrlComponent,"<s-:s>")),k.bind("encodeUrl",J(o.encodeUrl,"<s-:s>")),k.bind("decodeUrlComponent",J(o.decodeUrlComponent,"<s-:s>")),k.bind("decodeUrl",J(o.decodeUrl,"<s-:s>")),k.bind("eval",J(un,"<sx?:x>")),k.bind("toMillis",J(n.toMillis,"<s-s?:n>")),k.bind("fromMillis",J(n.fromMillis,"<n-s?s?:s>")),k.bind("clone",J(dn,"<(oa)-:o>"));var di={S0101:"String literal must be terminated by a matching quote",S0102:"Number out of range: {{token}}",S0103:"Unsupported escape sequence: \\{{token}}",S0104:"The escape sequence \\u must be followed by 4 hex digits",S0105:"Quoted property name must be terminated with a backquote (`)",S0106:"Comment has no closing tag",S0201:"Syntax error: {{token}}",S0202:"Expected {{value}}, got {{token}}",S0203:"Expected {{value}} before end of expression",S0204:"Unknown operator: {{token}}",S0205:"Unexpected token: {{token}}",S0206:"Unknown expression type: {{token}}",S0207:"Unexpected end of expression",S0208:"Parameter {{value}} of function definition must be a variable name (start with $)",S0209:"A predicate cannot follow a grouping expression in a step",S0210:"Each step can only have one grouping expression",S0211:"The symbol {{token}} cannot be used as a unary operator",S0212:"The left side of := must be a variable name (start with $)",S0213:"The literal value {{value}} cannot be used as a step within a path expression",S0214:"The right side of {{token}} must be a variable name (start with $)",S0215:"A context variable binding must precede any predicates on a step",S0216:"A context variable binding must precede the 'order-by' clause on a step",S0217:"The object representing the 'parent' cannot be derived from this expression",S0301:"Empty regular expressions are not allowed",S0302:"No terminating / in regular expression",S0402:"Choice groups containing parameterized types are not supported",S0401:"Type parameters can only be applied to functions and arrays",S0500:"Attempted to evaluate an expression containing syntax error(s)",T0410:"Argument {{index}} of function {{token}} does not match function signature",T0411:"Context value is not a compatible type with argument {{index}} of function {{token}}",T0412:"Argument {{index}} of function {{token}} must be an array of {{type}}",D1001:"Number out of range: {{value}}",D1002:"Cannot negate a non-numeric value: {{value}}",T1003:"Key in object structure must evaluate to a string; got: {{value}}",D1004:"Regular expression matches zero length string",T1005:"Attempted to invoke a non-function. Did you mean ${{{token}}}?",T1006:"Attempted to invoke a non-function",T1007:"Attempted to partially apply a non-function. Did you mean ${{{token}}}?",T1008:"Attempted to partially apply a non-function",D1009:"Multiple key definitions evaluate to same key: {{value}}",T1010:"The matcher function argument passed to function {{token}} does not return the correct object structure",D1011:"Stack overflow. Check for non-terminating recursive function. Consider rewriting as tail-recursive",D1012:"Evaluation timeout after {{value}} milliseconds. Check for infinite loop",D1013:"Object property names starting with _jsonata_ are reserved for internal use: {{value}}",T2001:"The left side of the {{token}} operator must evaluate to a number",T2002:"The right side of the {{token}} operator must evaluate to a number",T2003:"The left side of the range operator (..) must evaluate to an integer",T2004:"The right side of the range operator (..) must evaluate to an integer",D2005:"The left side of := must be a variable name (start with $)",T2006:"The right side of the function application operator ~> must be a function",T2007:"Type mismatch when comparing values {{value}} and {{value2}} in order-by clause",T2008:"The expressions within an order-by clause must evaluate to numeric or string values",T2009:"The values {{value}} and {{value2}} either side of operator {{token}} must be of the same data type",T2010:"The expressions either side of operator {{token}} must evaluate to numeric or string values",T2011:"The insert/update clause of the transform expression must evaluate to an object: {{value}}",T2012:"The delete clause of the transform expression must evaluate to a string or array of strings: {{value}}",T2013:"The transform expression clones the input object using the $clone() function. This has been overridden in the current scope by a non-function.",D2014:"The size of the sequence allocated by the range operator (..) must not exceed 1e7. Attempted to allocate {{value}}.",D2015:"The maximum sequence length of {{value}} was exceeded.",D3001:"Attempting to invoke string function on Infinity or NaN",D3010:"Second argument of replace function cannot be an empty string",D3011:"Fourth argument of replace function must evaluate to a positive number",D3012:"Attempted to replace a matched string with a non-string value",D3020:"Third argument of split function must evaluate to a positive number",D3030:"Unable to cast value to a number: {{value}}",D3040:"Third argument of match function must evaluate to a positive number",D3050:"The second argument of reduce function must be a function with at least two arguments",D3060:"The sqrt function cannot be applied to a negative number: {{value}}",D3061:"The power function has resulted in a value that cannot be represented as a JSON number: base={{value}}, exponent={{exp}}",D3070:"The single argument form of the sort function can only be applied to an array of strings or an array of numbers. Use the second argument to specify a comparison function",D3080:"The picture string must only contain a maximum of two sub-pictures",D3081:"The sub-picture must not contain more than one instance of the 'decimal-separator' character",D3082:"The sub-picture must not contain more than one instance of the 'percent' character",D3083:"The sub-picture must not contain more than one instance of the 'per-mille' character",D3084:"The sub-picture must not contain both a 'percent' and a 'per-mille' character",D3085:"The mantissa part of a sub-picture must contain at least one character that is either an 'optional digit character' or a member of the 'decimal digit family'",D3086:"The sub-picture must not contain a passive character that is preceded by an active character and that is followed by another active character",D3087:"The sub-picture must not contain a 'grouping-separator' character that appears adjacent to a 'decimal-separator' character",D3088:"The sub-picture must not contain a 'grouping-separator' at the end of the integer part",D3089:"The sub-picture must not contain two adjacent instances of the 'grouping-separator' character",D3090:"The integer part of the sub-picture must not contain a member of the 'decimal digit family' that is followed by an instance of the 'optional digit character'",D3091:"The fractional part of the sub-picture must not contain an instance of the 'optional digit character' that is followed by a member of the 'decimal digit family'",D3092:"A sub-picture that contains a 'percent' or 'per-mille' character must not contain a character treated as an 'exponent-separator'",D3093:"The exponent part of the sub-picture must comprise only of one or more characters that are members of the 'decimal digit family'",D3100:"The radix of the formatBase function must be between 2 and 36. It was given {{value}}",D3110:"The argument of the toMillis function must be an ISO 8601 formatted timestamp. Given {{value}}",D3120:"Syntax error in expression passed to function eval: {{value}}",D3121:"Dynamic error evaluating the expression passed to function eval: {{value}}",D3130:"Formatting or parsing an integer as a sequence starting with {{value}} is not supported by this implementation",D3131:"In a decimal digit pattern, all digits must be from the same decimal group",D3132:"Unknown component specifier {{value}} in date/time picture string",D3133:"The 'name' modifier can only be applied to months and days in the date/time picture string, not {{value}}",D3134:"The timezone integer format specifier cannot have more than four digits",D3135:"No matching closing bracket ']' in date/time picture string",D3136:"The date/time picture string is missing specifiers required to parse the timestamp",D3137:"{{{message}}}",D3138:"The $single() function expected exactly 1 matching result. Instead it matched more.",D3139:"The $single() function expected exactly 1 matching result. Instead it matched 0.",D3140:"Malformed URL passed to ${{{functionName}}}(): {{value}}",D3141:"{{{message}}}"};function ds(u){var v=di[u.code];if(typeof v<"u"){var w=v.replace(/\{\{\{([^}]+)}}}/g,function(){return u[arguments[1]]});w=w.replace(/\{\{([^}]+)}}/g,function(){return JSON.stringify(u[arguments[1]])}),u.message=w}}function cr(u,v){var w,a;try{w=d(u,v&&v.recover),a=w.errors,delete w.errors}catch(P){throw ds(P),P}var l=ts(k),p=new Date;return l.bind("now",J(function(P,S){return n.fromMillis(p.getTime(),P,S)},"<s?s?:s>")),l.bind("millis",J(function(){return p.getTime()},"<:n>")),{evaluate:async function(P,S,L){if(typeof a<"u"){var H={code:"S0500",position:0};throw ds(H),H}const K=ts(l);for(const oe of c.keys(S))K.bind(oe,S[oe]);if(K.bind("$",P),p=new Date,K.timestamp=p,K.options=v,K.createSequence=function(){var oe=[];return v&&v.sequence&&(oe.push=function(...je){if(oe.length+je.length>v.sequence)throw{code:"D2015",stack:new Error().stack,value:v.sequence};return Array.prototype.push.apply(oe,je)}),oe.sequence=!0,arguments.length===1&&oe.push(arguments[0]),oe},Array.isArray(P)&&!E(P)&&(P=K.createSequence(P),P.outerWrapper=!0),v&&(v.timeout||v.stack)){const oe=Date.now();K.guardrails=function(){if(v.stack>0&&K.depth>v.stack)throw{code:"D1011",value:v.stack,stack:new Error().stack};if(v.timeout>0&&Date.now()-oe>v.timeout)throw{code:"D1012",value:v.timeout,stack:new Error().stack}}}else K.guardrails=function(){};K.base=K,K.depth=0,v&&v.RegexEngine?K.RegexEngine=v.RegexEngine:K.RegexEngine=RegExp;var _e;try{return _e=await D(w,P,K),typeof L=="function"&&L(null,_e),_e}catch(oe){throw ds(oe),oe}},assign:function(P,S){l.bind(P,S)},registerFunction:function(P,S,L){var H=J(S,L);l.bind(P,H)},ast:function(){return w},errors:function(){return a}}}return cr.parser=d,cr})();i.exports=A},{"./datetime":1,"./functions":2,"./parser":4,"./signature":5,"./utils":6}],4:[function(s,i,r){var n=s("./signature");const o=(()=>{var c={".":75,"[":80,"]":0,"{":70,"}":0,"(":80,")":0,",":0,"@":80,"#":80,";":80,":":80,"?":20,"+":50,"-":50,"*":60,"/":60,"%":60,"|":20,"=":40,"<":40,">":40,"^":40,"**":60,"..":20,":=":10,"!=":40,"<=":40,">=":40,"~>":40,"?:":40,"??":40,and:30,or:25,in:40,"&":50,"!":0,"~":0},d={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
|
|
73
|
+
`,r:"\r",t:" "},b=function(m){var f=0,C=m.length,E=function(B,x){var y={type:B,value:x,position:f};return y},T=function(){for(var B=f,x=0,y,M,k=function(Y){if(m.charAt(Y)==="/"&&x===0){for(var j=0;m.charAt(Y-(j+1))==="\\";)j++;if(j%2===0)return!0}return!1};f<C;){var D=m.charAt(f);if(k(f)){if(y=m.substring(B,f),y==="")throw{code:"S0301",stack:new Error().stack,position:f};for(f++,D=m.charAt(f),B=f;D==="i"||D==="m";)f++,D=m.charAt(f);return M=m.substring(B,f)+"g",new RegExp(y,M)}(D==="("||D==="["||D==="{")&&m.charAt(f-1)!=="\\"&&x++,(D===")"||D==="]"||D==="}")&&m.charAt(f-1)!=="\\"&&x--,f++}throw{code:"S0302",stack:new Error().stack,position:f}},U=function(B){if(f>=C)return null;for(var x=m.charAt(f);f<C&&`
|
|
74
|
+
\r\v`.indexOf(x)>-1;)f++,x=m.charAt(f);if(x==="/"&&m.charAt(f+1)==="*"){var y=f;for(f+=2,x=m.charAt(f);!(x==="*"&&m.charAt(f+1)==="/");)if(x=m.charAt(++f),f>=C)throw{code:"S0106",stack:new Error().stack,position:y};return f+=2,x=m.charAt(f),U(B)}if(B!==!0&&x==="/")return f++,E("regex",T());if(x==="."&&m.charAt(f+1)===".")return f+=2,E("operator","..");if(x===":"&&m.charAt(f+1)==="=")return f+=2,E("operator",":=");if(x==="!"&&m.charAt(f+1)==="=")return f+=2,E("operator","!=");if(x===">"&&m.charAt(f+1)==="=")return f+=2,E("operator",">=");if(x==="<"&&m.charAt(f+1)==="=")return f+=2,E("operator","<=");if(x==="*"&&m.charAt(f+1)==="*")return f+=2,E("operator","**");if(x==="~"&&m.charAt(f+1)===">")return f+=2,E("operator","~>");if(x==="?"&&m.charAt(f+1)===":")return f+=2,E("operator","?:");if(x==="?"&&m.charAt(f+1)==="?")return f+=2,E("operator","??");if(Object.prototype.hasOwnProperty.call(c,x))return f++,E("operator",x);if(x==='"'||x==="'"){var M=x;f++;for(var k="";f<C;){if(x=m.charAt(f),x==="\\")if(f++,x=m.charAt(f),Object.prototype.hasOwnProperty.call(d,x))k+=d[x];else if(x==="u"){var D=m.substr(f+1,4);if(/^[0-9a-fA-F]+$/.test(D)){var Y=parseInt(D,16);k+=String.fromCharCode(Y),f+=4}else throw{code:"S0104",stack:new Error().stack,position:f}}else throw{code:"S0103",stack:new Error().stack,position:f,token:x};else{if(x===M)return f++,E("string",k);k+=x}f++}throw{code:"S0101",stack:new Error().stack,position:f}}var j=/^-?(0|([1-9][0-9]*))(\.[0-9]+)?([Ee][-+]?[0-9]+)?/,ne=j.exec(m.substring(f));if(ne!==null){var re=parseFloat(ne[0]);if(!isNaN(re)&&isFinite(re))return f+=ne[0].length,E("number",re);throw{code:"S0102",stack:new Error().stack,position:f,token:ne[0]}}var ie;if(x==="`"){f++;var z=m.indexOf("`",f);if(z!==-1)return ie=m.substring(f,z),f=z+1,E("name",ie);throw f=C,{code:"S0105",stack:new Error().stack,position:f}}for(var le=f,pe;;)if(pe=m.charAt(le),le===C||`
|
|
75
|
+
\r\v`.indexOf(pe)>-1||Object.prototype.hasOwnProperty.call(c,pe)){if(m.charAt(f)==="$")return ie=m.substring(f+1,le),f=le,E("variable",ie);switch(ie=m.substring(f,le),f=le,ie){case"or":case"in":case"and":return E("operator",ie);case"true":return E("value",!0);case"false":return E("value",!1);case"null":return E("value",null);default:return f===C&&ie===""?null:E("name",ie)}}else le++};return U},A=function(m,f){var C,E,T=Object.create(null),U=[],B=function(){var g=[];C.id!=="(end)"&&g.push({type:C.type,value:C.value,position:C.position});for(var _=E();_!==null;)g.push(_),_=E();return g},x={nud:function(){var g={code:"S0211",token:this.value,position:this.position};if(f)return g.remaining=B(),g.type="error",U.push(g),g;throw g.stack=new Error().stack,g}},y=function(g,_){var te=T[g];return _=_||0,te?_>=te.lbp&&(te.lbp=_):(te=Object.create(x),te.id=te.value=g,te.lbp=_,T[g]=te),te},M=function(g){if(f){g.remaining=B(),U.push(g);var _=T["(error)"];return C=Object.create(_),C.error=g,C.type="(error)",C}else throw g.stack=new Error().stack,g},k=function(g,_){if(g&&C.id!==g){var te;C.id==="(end)"?te="S0203":te="S0202";var we={code:te,position:C.position,token:C.value,value:g};return M(we)}var Pe=E(_);if(Pe===null)return C=T["(end)"],C.position=m.length,C;var Ee=Pe.value,O=Pe.type,I;switch(O){case"name":case"variable":I=T["(name)"];break;case"operator":if(I=T[Ee],!I)return M({code:"S0204",stack:new Error().stack,position:Pe.position,token:Ee});break;case"string":case"number":case"value":I=T["(literal)"];break;case"regex":O="regex",I=T["(regex)"];break;default:return M({code:"S0205",stack:new Error().stack,position:Pe.position,token:Ee})}return C=Object.create(I),C.value=Ee,C.type=O,C.position=Pe.position,C},D=function(g){var _,te=C;for(k(null,!0),_=te.nud();g<C.lbp;)te=C,k(),_=te.led(_);return _},Y=function(g){var _=y(g,0);_.nud=function(){return this}},j=function(g,_,te){var we=_||c[g],Pe=y(g,we);return Pe.led=te||function(Ee){return this.lhs=Ee,this.rhs=D(we),this.type="binary",this},Pe},ne=function(g,_,te){var we=y(g,_);return we.led=te,we},re=function(g,_){var te=y(g);return te.nud=_||function(){return this.expression=D(70),this.type="unary",this},te};Y("(end)"),Y("(name)"),Y("(literal)"),Y("(regex)"),y(":"),y(";"),y(","),y(")"),y("]"),y("}"),y(".."),j("."),j("+"),j("-"),j("*"),j("/"),j("%"),j("="),j("<"),j(">"),j("!="),j("<="),j(">="),j("&"),j("and"),j("or"),j("in"),Y("and"),Y("or"),Y("in"),re("-"),j("~>"),j("??",c["??"],function(g){return this.type="condition",this.condition={type:"function",value:"(",procedure:{type:"variable",value:"exists"},arguments:[JSON.parse(JSON.stringify(g))]},this.then=g,this.else=D(0),this}),ne("(error)",10,function(g){return this.lhs=g,this.error=C.error,this.remaining=B(),this.type="error",this}),re("*",function(){return this.type="wildcard",this}),re("**",function(){return this.type="descendant",this}),re("%",function(){return this.type="parent",this}),j("(",c["("],function(g){if(this.procedure=g,this.type="function",this.arguments=[],C.id!==")")for(;C.type==="operator"&&C.id==="?"?(this.type="partial",this.arguments.push(C),k("?")):this.arguments.push(D(0)),C.id===",";)k(",");if(k(")",!0),g.type==="name"&&(g.value==="function"||g.value==="λ")){if(this.arguments.forEach(function(Ee,O){if(Ee.type!=="variable")return M({code:"S0208",stack:new Error().stack,position:Ee.position,token:Ee.value,value:O+1})}),this.type="lambda",C.id==="<"){for(var _=C.position,te=1,we="<";te>0&&C.id!=="{"&&C.id!=="(end)";){var Pe=k();Pe.id===">"?te--:Pe.id==="<"&&te++,we+=Pe.value}k(">");try{this.signature=n(we)}catch(Ee){return Ee.position=_+Ee.offset,M(Ee)}}k("{"),this.body=D(0),k("}")}return this}),re("(",function(){for(var g=[];C.id!==")"&&(g.push(D(0)),C.id===";");)k(";");return k(")",!0),this.type="block",this.expressions=g,this}),re("[",function(){var g=[];if(C.id!=="]")for(;;){var _=D(0);if(C.id===".."){var te={type:"binary",value:"..",position:C.position,lhs:_};k(".."),te.rhs=D(0),_=te}if(g.push(_),C.id!==",")break;k(",")}return k("]",!0),this.expressions=g,this.type="unary",this}),j("[",c["["],function(g){if(C.id==="]"){for(var _=g;_&&_.type==="binary"&&_.value==="[";)_=_.lhs;return _.keepArray=!0,k("]"),g}else return this.lhs=g,this.rhs=D(c["]"]),this.type="binary",k("]",!0),this}),j("^",c["^"],function(g){k("(");for(var _=[];;){var te={descending:!1};if(C.id==="<"?k("<"):C.id===">"&&(te.descending=!0,k(">")),te.expression=D(0),_.push(te),C.id!==",")break;k(",")}return k(")"),this.lhs=g,this.rhs=_,this.type="binary",this});var ie=function(g){var _=[];if(C.id!=="}")for(;;){var te=D(0);k(":");var we=D(0);if(_.push([te,we]),C.id!==",")break;k(",")}return k("}",!0),typeof g>"u"?(this.lhs=_,this.type="unary"):(this.lhs=g,this.rhs=_,this.type="binary"),this};re("{",ie),j("{",c["{"],ie),ne(":=",c[":="],function(g){return g.type!=="variable"?M({code:"S0212",stack:new Error().stack,position:g.position,token:g.value}):(this.lhs=g,this.rhs=D(c[":="]-1),this.type="binary",this)}),j("@",c["@"],function(g){return this.lhs=g,this.rhs=D(c["@"]),this.rhs.type!=="variable"?M({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"@"}):(this.type="binary",this)}),j("#",c["#"],function(g){return this.lhs=g,this.rhs=D(c["#"]),this.rhs.type!=="variable"?M({code:"S0214",stack:new Error().stack,position:this.rhs.position,token:"#"}):(this.type="binary",this)}),j("?",c["?"],function(g){return this.type="condition",this.condition=g,this.then=D(0),C.id===":"&&(k(":"),this.else=D(0)),this}),j("?:",c["?:"],function(g){return this.type="condition",this.condition=JSON.parse(JSON.stringify(g)),this.then=g,this.else=D(0),this}),re("|",function(){return this.type="transform",this.pattern=D(0),k("|"),this.update=D(0),C.id===","&&(k(","),this.delete=D(0)),k("|"),this});var z=function(g){var _;if(g.type==="function"&&!g.predicate){var te={type:"lambda",thunk:!0,arguments:[],position:g.position};te.body=g,_=te}else if(g.type==="condition")g.then=z(g.then),typeof g.else<"u"&&(g.else=z(g.else)),_=g;else if(g.type==="block"){var we=g.expressions.length;we>0&&(g.expressions[we-1]=z(g.expressions[we-1])),_=g}else _=g;return _},le=0,pe=0,Be=[],he=function(g,_){switch(g.type){case"name":case"wildcard":_.level--,_.level===0&&(typeof g.ancestor>"u"||(Be[_.index].slot.label=g.ancestor.label),g.ancestor=_,g.tuple=!0);break;case"parent":_.level++;break;case"block":g.expressions.length>0&&(g.tuple=!0,_=he(g.expressions[g.expressions.length-1],_));break;case"path":g.tuple=!0;var te=g.steps.length-1;for(_=he(g.steps[te--],_);_.level>0&&te>=0;)_=he(g.steps[te--],_);break;default:throw{code:"S0217",token:g.type,position:g.position}}return _},ge=function(g,_){if(typeof _.seekingParent<"u"||_.type==="parent"){var te=typeof _.seekingParent<"u"?_.seekingParent:[];_.type==="parent"&&te.push(_.slot),typeof g.seekingParent>"u"?g.seekingParent=te:Array.prototype.push.apply(g.seekingParent,te)}},$e=function(g){var _=g.steps.length-1,te=g.steps[_],we=typeof te.seekingParent<"u"?te.seekingParent:[];te.type==="parent"&&we.push(te.slot);for(var Pe=0;Pe<we.length;Pe++){var Ee=we[Pe];for(_=g.steps.length-2;Ee.level>0;){if(_<0){typeof g.seekingParent>"u"?g.seekingParent=[Ee]:g.seekingParent.push(Ee);break}for(var O=g.steps[_--];_>=0&&O.focus&&g.steps[_].focus;)O=g.steps[_--];Ee=he(O,Ee)}}},ce=function(g){var _;switch(g.type){case"binary":switch(g.value){case".":var te=ce(g.lhs);te.type==="path"?_=te:_={type:"path",steps:[te]},te.type==="parent"&&(_.seekingParent=[te.slot]);var we=ce(g.rhs);we.type==="path"?Array.prototype.push.apply(_.steps,we.steps):(typeof we.predicate<"u"&&(we.stages=we.predicate,delete we.predicate),_.steps.push(we)),_.steps.filter(function(G){if(G.type==="number"||G.type==="value")throw{code:"S0213",stack:new Error().stack,position:G.position,value:G.value};return G.type==="string"}).forEach(function(G){G.type="name"}),_.steps.filter(function(G){return G.keepArray===!0}).length>0&&(_.keepSingletonArray=!0);var Pe=_.steps[0];Pe.type==="unary"&&Pe.value==="["&&(Pe.consarray=!0);var Ee=_.steps[_.steps.length-1];Ee.type==="unary"&&Ee.value==="["&&(Ee.consarray=!0),$e(_);break;case"[":_=ce(g.lhs);var O=_,I="predicate";if(_.type==="path"&&(O=_.steps[_.steps.length-1],I="stages"),typeof O.group<"u")throw{code:"S0209",stack:new Error().stack,position:g.position};typeof O[I]>"u"&&(O[I]=[]);var $=ce(g.rhs);typeof $.seekingParent<"u"&&($.seekingParent.forEach(G=>{G.level===1?he(O,G):G.level--}),ge(O,$)),O[I].push({type:"filter",expr:$,position:g.position});break;case"{":if(_=ce(g.lhs),typeof _.group<"u")throw{code:"S0210",stack:new Error().stack,position:g.position};_.group={lhs:g.rhs.map(function(G){return[ce(G[0]),ce(G[1])]}),position:g.position};break;case"^":_=ce(g.lhs),_.type!=="path"&&(_={type:"path",steps:[_]});var F={type:"sort",position:g.position};F.terms=g.rhs.map(function(G){var ae=ce(G.expression);return ge(F,ae),{descending:G.descending,expression:ae}}),_.steps.push(F),$e(_);break;case":=":_={type:"bind",value:g.value,position:g.position},_.lhs=ce(g.lhs),_.rhs=ce(g.rhs),ge(_,_.rhs);break;case"@":if(_=ce(g.lhs),O=_,_.type==="path"&&(O=_.steps[_.steps.length-1]),typeof O.stages<"u"||typeof O.predicate<"u")throw{code:"S0215",stack:new Error().stack,position:g.position};if(O.type==="sort")throw{code:"S0216",stack:new Error().stack,position:g.position};g.keepArray&&(O.keepArray=!0),O.focus=g.rhs.value,O.tuple=!0;break;case"#":_=ce(g.lhs),O=_,_.type==="path"?O=_.steps[_.steps.length-1]:(_={type:"path",steps:[_]},typeof O.predicate<"u"&&(O.stages=O.predicate,delete O.predicate)),typeof O.stages>"u"?O.index=g.rhs.value:O.stages.push({type:"index",value:g.rhs.value,position:g.position}),O.tuple=!0;break;case"~>":_={type:"apply",value:g.value,position:g.position},_.lhs=ce(g.lhs),_.rhs=ce(g.rhs),_.keepArray=_.lhs.keepArray||_.rhs.keepArray;break;default:_={type:g.type,value:g.value,position:g.position},_.lhs=ce(g.lhs),_.rhs=ce(g.rhs),ge(_,_.lhs),ge(_,_.rhs)}break;case"unary":_={type:g.type,value:g.value,position:g.position},g.value==="["?_.expressions=g.expressions.map(function(G){var ae=ce(G);return ge(_,ae),ae}):g.value==="{"?_.lhs=g.lhs.map(function(G){var ae=ce(G[0]);ge(_,ae);var Ce=ce(G[1]);return ge(_,Ce),[ae,Ce]}):(_.expression=ce(g.expression),g.value==="-"&&_.expression.type==="number"?(_=_.expression,_.value=-_.value):ge(_,_.expression));break;case"function":case"partial":_={type:g.type,name:g.name,value:g.value,position:g.position},_.arguments=g.arguments.map(function(G){var ae=ce(G);return ge(_,ae),ae}),_.procedure=ce(g.procedure);break;case"lambda":_={type:g.type,arguments:g.arguments,signature:g.signature,position:g.position};var q=ce(g.body);_.body=z(q);break;case"condition":_={type:g.type,position:g.position},_.condition=ce(g.condition),ge(_,_.condition),_.then=ce(g.then),ge(_,_.then),typeof g.else<"u"&&(_.else=ce(g.else),ge(_,_.else));break;case"transform":_={type:g.type,position:g.position},_.pattern=ce(g.pattern),_.update=ce(g.update),typeof g.delete<"u"&&(_.delete=ce(g.delete));break;case"block":_={type:g.type,position:g.position},_.expressions=g.expressions.map(function(G){var ae=ce(G);return ge(_,ae),(ae.consarray||ae.type==="path"&&ae.steps[0].consarray)&&(_.consarray=!0),ae});break;case"name":_={type:"path",steps:[g]},g.keepArray&&(_.keepSingletonArray=!0);break;case"parent":_={type:"parent",slot:{label:"!"+le++,level:1,index:pe++}},Be.push(_);break;case"string":case"number":case"value":case"wildcard":case"descendant":case"variable":case"regex":_=g;break;case"operator":if(g.value==="and"||g.value==="or"||g.value==="in")g.type="name",_=ce(g);else if(g.value==="?")_=g;else throw{code:"S0201",stack:new Error().stack,position:g.position,token:g.value};break;case"error":_=g,g.lhs&&(_=ce(g.lhs));break;default:var V="S0206";g.id==="(end)"&&(V="S0207");var N={code:V,position:g.position,token:g.value};if(f)return U.push(N),{type:"error",error:N};throw N.stack=new Error().stack,N}return g.keepArray&&(_.keepArray=!0),_};E=b(m),k();var W=D(0);if(C.id!=="(end)"){var Ae={code:"S0201",position:C.position,token:C.value};M(Ae)}if(W=ce(W),W.type==="parent"||typeof W.seekingParent<"u")throw{code:"S0217",token:W.type,position:W.position};return U.length>0&&(W.errors=U),W};return A})();i.exports=o},{"./signature":5}],5:[function(s,i,r){var n=s("./utils");const o=(()=>{var c={a:"arrays",b:"booleans",f:"functions",n:"numbers",o:"objects",s:"strings"};function d(b){for(var A=1,m=[],f=Object.create(null),C=f;A<b.length;){var E=b.charAt(A);if(E===":")break;var T=function(){m.push(f),C=f,f=Object.create(null)},U=function(j,ne,re,ie){for(var z=1,le=ne;le<j.length;)if(le++,E=j.charAt(le),E===ie){if(z--,z===0)break}else E===re&&z++;return le};switch(E){case"s":case"n":case"b":case"l":case"o":f.regex="["+E+"m]",f.type=E,T();break;case"a":f.regex="[asnblfom]",f.type=E,f.array=!0,T();break;case"f":f.regex="f",f.type=E,T();break;case"j":f.regex="[asnblom]",f.type=E,T();break;case"x":f.regex="[asnblfom]",f.type=E,T();break;case"-":C.context=!0,C.contextRegex=new RegExp(C.regex),C.regex+="?";break;case"?":case"+":C.regex+=E;break;case"(":var B=U(b,A,"(",")"),x=b.substring(A+1,B);if(x.indexOf("<")===-1)f.regex="["+x+"m]";else throw{code:"S0402",stack:new Error().stack,value:x,offset:A};f.type="("+x+")",A=B,T();break;case"<":if(C.type==="a"||C.type==="f"){var y=U(b,A,"<",">");C.subtype=b.substring(A+1,y),A=y}else throw{code:"S0401",stack:new Error().stack,value:C.type,offset:A};break}A++}var M="^"+m.map(function(j){return"("+j.regex+")"}).join("")+"$",k=new RegExp(M),D=function(j){var ne;if(n.isFunction(j))ne="f";else{var re=typeof j;switch(re){case"string":ne="s";break;case"number":ne="n";break;case"boolean":ne="b";break;case"object":j===null?ne="l":Array.isArray(j)?ne="a":ne="o";break;case"undefined":default:ne="m"}}return ne},Y=function(j,ne){for(var re="^",ie=0,z=0;z<m.length;z++){re+=m[z].regex;var le=ne.match(re);if(le===null)throw{code:"T0410",stack:new Error().stack,value:j[ie],index:ie+1};ie=le[0].length}throw{code:"T0410",stack:new Error().stack,value:j[ie],index:ie+1}};return{definition:b,validate:function(j,ne){var re="";j.forEach(function(pe){re+=D(pe)});var ie=k.exec(re);if(ie){var z=[],le=0;return m.forEach(function(pe,Be){var he=j[le],ge=ie[Be+1];if(ge==="")if(pe.context&&pe.contextRegex){var $e=D(ne);if(pe.contextRegex.test($e))z.push(ne);else throw{code:"T0411",stack:new Error().stack,value:ne,index:le+1}}else z.push(he),le++;else ge.split("").forEach(function(ce){if(he=j[le],pe.type==="a"){if(ce==="m")he=void 0;else{var W=!0;if(typeof pe.subtype<"u"){if(ce!=="a"&&ge!==pe.subtype)W=!1;else if(ce==="a"&&he.length>0){var Ae=D(he[0]);if(Ae!==pe.subtype.charAt(0))W=!1;else{var g=he.filter(function(_){return D(_)!==Ae});W=g.length===0}}}if(!W)throw{code:"T0412",stack:new Error().stack,value:he,index:le+1,type:c[pe.subtype]};ce!=="a"&&(he=[he])}z.push(he),le++}else z.push(he),le++})}),z}Y(j,re)}}}return d})();i.exports=o},{"./utils":6}],6:[function(s,i,r){const n=(()=>{function o(y){var M=!1;if(typeof y=="number"&&(M=!isNaN(y),M&&!isFinite(y)))throw{code:"D1001",value:y,stack:new Error().stack};return M}function c(y){var M=!1;return Array.isArray(y)&&(M=y.filter(function(k){return typeof k!="string"}).length===0),M}function d(y){var M=!1;return Array.isArray(y)&&(M=y.filter(function(k){return!o(k)}).length===0),M}function b(y){return y.sequence===!0&&Array.isArray(y)}function A(y){return y&&(y._jsonata_function===!0||y._jsonata_lambda===!0)||typeof y=="function"}function m(y){var M=typeof y.arity=="number"?y.arity:typeof y.implementation=="function"?y.implementation.length:typeof y.length=="number"?y.length:y.arguments.length;return M}function f(y){return y&&y._jsonata_lambda===!0}var C=(typeof Symbol=="function"?Symbol:{}).iterator||"@@iterator";function E(y){return typeof y=="object"&&y!==null&&C in y&&"next"in y&&typeof y.next=="function"}function T(y,M){if(y===M)return!0;if(typeof y=="object"&&typeof M=="object"&&y!==null&&M!==null){if(Array.isArray(y)&&Array.isArray(M)){if(y.length!==M.length)return!1;for(var k=0;k<y.length;k++)if(!T(y[k],M[k]))return!1;return!0}var D=Object.getOwnPropertyNames(y),Y=Object.getOwnPropertyNames(M);if(D.length!==Y.length)return!1;for(D=D.sort(),Y=Y.sort(),k=0;k<D.length;k++)if(D[k]!==Y[k])return!1;for(k=0;k<D.length;k++){var j=D[k];if(!T(y[j],M[j]))return!1}return!0}return!1}function U(y){return typeof y=="object"&&y!==null&&"then"in y&&typeof y.then=="function"}function B(y){var M=[];for(let k of y)M.push(k);return M}function x(y){return typeof y=="object"&&y!==null?Object.keys(y):[]}return{isNumeric:o,isArrayOfStrings:c,isArrayOfNumbers:d,isSequence:b,isFunction:A,isLambda:f,isIterable:E,getFunctionArity:m,isDeepEqual:T,stringToArray:B,isPromise:U,keys:x}})();i.exports=n},{}]},{},[3])(3)})})(Nn)),Nn.exports}var dh=uh();const ph=na(dh);function fh(t){t.registerFunction("ucFirst",e=>Fr.ucFirst(String(e??""))),t.registerFunction("currency",(e,s="fr-FR",i="EUR")=>{const r=Number(e);return Number.isNaN(r)?String(e??""):new Intl.NumberFormat(String(s),{style:"currency",currency:String(i)}).format(r)}),t.registerFunction("percent",(e,s="fr-FR",i=0)=>{const r=Number(e);return Number.isNaN(r)?String(e??""):new Intl.NumberFormat(String(s),{style:"percent",maximumFractionDigits:Number(i)||0}).format(r)}),t.registerFunction("date",(e,s="fr-FR",i)=>{const r=e instanceof Date?e:new Date(String(e));if(Number.isNaN(r.getTime()))return String(e??"");let n={dateStyle:"medium"};if(i)try{n=JSON.parse(String(i))}catch{}return new Intl.DateTimeFormat(String(s),n).format(r)}),t.registerFunction("toChart",(e,s="label",i="value",r="")=>{const n=Array.isArray(e)?e:[],o=[],c=[];for(const d of n){if(!d||typeof d!="object")continue;const b=d;o.push(String(b[String(s)]??"")),c.push(Number(b[String(i)]??0))}return{labels:o,datasets:[{label:String(r||""),data:c}]}})}const la=new Map,ca=8e3;function mh(t){if(!t||!t.trim())throw new Error("[sonic-jsonata] expression vide.");if(t.length>ca)throw new Error(`[sonic-jsonata] expression trop longue (${t.length} > ${ca}).`);const e=la.get(t);if(e)return e;try{const s=ph(t);return fh(s),la.set(t,s),s}catch(s){const i=s instanceof Error?s.message:typeof s=="object"&&s&&"message"in s?String(s.message):String(s);throw new Error(`[sonic-jsonata] Syntaxe JSONata invalide : ${i}`)}}function gh(t,e){if(!e||typeof e!="object")return;const s=e.type;if(typeof s=="string"&&!(s==="array"&&Array.isArray(t)||s==="object"&&t!==null&&typeof t=="object"&&!Array.isArray(t)||s==="string"&&typeof t=="string"||s==="number"&&typeof t=="number"||s==="boolean"&&typeof t=="boolean"||s==="null"&&t===null))throw new Error(`[sonic-jsonata] outputSchema : type attendu "${s}", reçu ${bh(t)}.`);if(Array.isArray(e.required)&&t&&typeof t=="object"){const i=t;for(const r of e.required)if(typeof r=="string"&&!(r in i))throw new Error(`[sonic-jsonata] outputSchema : propriété requise manquante "${r}".`)}}function bh(t){return t===null?"null":Array.isArray(t)?"array":typeof t}const vh=150,ha=10,yh=200,wh=16,ua=new WeakMap;let da=!1;function ms(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function yr(t){if(t===window)return{x:window.scrollX,y:window.scrollY};const e=t;return{x:e.scrollLeft,y:e.scrollTop}}function _h(t,e,s){if(t===window){window.scrollTo(e,s);return}const i=t;typeof i.scrollTo=="function"?i.scrollTo(e,s):(i.scrollLeft=e,i.scrollTop=s)}function Sh(t){if(t===window){const s=document.documentElement;return Math.max(0,s.scrollHeight-window.innerHeight)}const e=t;return Math.max(0,e.scrollHeight-e.clientHeight)}function Zs(t){let e=ua.get(t);if(!e){const s=yr(t);e={x:s.x,y:s.y,restoring:!1,watching:!1,userEngaged:!1,raf:0,stickyFrames:0},ua.set(t,e)}return e}function Fi(t){Zs(t).userEngaged=!0}function Ri(t){const e=Zs(t);clearTimeout(e.settleTimer),e.settleTimer=setTimeout(()=>{e.userEngaged=!1,e.settleTimer=void 0},vh)}function pa(t,e){return e-t>=yh}function wr(t){if(!ms())return;const e=Zs(t);if(e.restoring)return;const s=yr(t);if(pa(s.y,e.y)){Rn(t);return}e.x=s.x,e.y=s.y}function Fn(t){if(!ms())return;const e=Zs(t),s=Sh(t),i=e.x,r=s>0?Math.min(e.y,s):e.y,{x:n,y:o}=yr(t);if(!(Math.abs(i-n)<=ha&&Math.abs(r-o)<=ha)){e.restoring=!0;try{_h(t,i,r)}finally{requestAnimationFrame(()=>{e.restoring=!1})}}}function Ph(t,e={x:0,y:0}){if(!ms())return;const s=Zs(t);if(e==="current"){const i=yr(t);s.x=i.x,s.y=i.y;return}s.x=e.x??0,s.y=e.y??0}function Rn(t){const e=Zs(t);if(e.stickyFrames=wh,e.raf)return;const s=()=>{e.raf=0,Fn(t),e.stickyFrames>0&&(e.stickyFrames--,e.raf=requestAnimationFrame(s))};e.raf=requestAnimationFrame(s)}function jn(t){Rn(t)}function Js(t){if(!ms())return;const e=Zs(t);if(e.watching)return;e.watching=!0;const s=t===window?window:t,i=()=>{if(e.restoring)return;const{y:E}=yr(t);if(pa(E,e.y)){Rn(t);return}if(e.userEngaged){wr(t),Ri(t);return}wr(t)},r=E=>fa(E)===t,n=E=>{r(E)&&(wr(t),Fi(t))},o=E=>{r(E)&&Ri(t)},c=E=>{r(E)&&(wr(t),Fi(t),Ri(t))};s.addEventListener("scroll",i,{passive:!0}),s.addEventListener("touchstart",n,{passive:!0}),s.addEventListener("touchend",o,{passive:!0}),s.addEventListener("touchcancel",o,{passive:!0}),s.addEventListener("wheel",c,{passive:!0}),s.addEventListener("pointerdown",n,{passive:!0}),s.addEventListener("pointerup",o,{passive:!0}),s.addEventListener("pointercancel",o,{passive:!0});const d=yr(t);if(e.x=d.x,e.y=d.y,t===window){const E=new ResizeObserver(()=>jn(window));E.observe(document.documentElement),e.resizeObserver=E;return}const b=t,A=new ResizeObserver(()=>jn(b));A.observe(b);for(const E of Array.from(b.children))A.observe(E);e.resizeObserver=A;const m=()=>jn(b),f=new MutationObserver(E=>{for(const T of E)if(T.type==="childList")for(const U of Array.from(T.addedNodes))U instanceof Element&&A.observe(U);m()});f.observe(b,{childList:!0,subtree:!0,characterData:!0});const C=b.getRootNode();C instanceof ShadowRoot&&C.host&&f.observe(C.host,{childList:!0,subtree:!0,characterData:!0}),e.mutationObserver=f}function fa(t){for(const e of t.composedPath())if(!(e===window||e===document)&&e instanceof HTMLElement&&ma(e))return e;return window}function ma(t){if(!(t instanceof HTMLElement)||t===document.documentElement||t===document.body)return!1;const e=getComputedStyle(t).overflowY;return e==="auto"||e==="scroll"||e==="overlay"}function Un(t){for(const s of t.composedPath())s===window||s===document||s instanceof HTMLElement&&ma(s)&&Js(s);const e=fa(t);Js(e),t.type==="wheel"?(wr(e),Fi(e),Ri(e)):(t.type==="touchstart"||t.type==="pointerdown")&&(wr(e),Fi(e))}function ji(t){t instanceof Element&&t.classList?.contains("custom-scroll")&&Js(t),t.querySelectorAll?.(".custom-scroll").forEach(e=>{e instanceof HTMLElement&&Js(e)})}function zn(t){ji(t),new MutationObserver(s=>{for(const i of s)for(const r of Array.from(i.addedNodes))r instanceof Element&&ji(r)}).observe(t,{childList:!0,subtree:!0})}function qn(t){t.querySelectorAll?.("*").forEach(e=>{e.shadowRoot&&(zn(e.shadowRoot),qn(e.shadowRoot))})}function xh(){const t=Element.prototype;if(t.__safariScrollGuardPatched)return;t.__safariScrollGuardPatched=!0;const e=t.attachShadow;t.attachShadow=function(i){const r=e.call(this,i);return zn(r),r}}function ga(){if(typeof window>"u"||da||(da=!0,!ms()))return;Js(window),xh();const t={capture:!0,passive:!0};window.addEventListener("wheel",Un,t),window.addEventListener("touchstart",Un,t),window.addEventListener("pointerdown",Un,t);const e=()=>{ji(document),qn(document)};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",e,{once:!0}):e(),new MutationObserver(i=>{for(const r of i)for(const n of Array.from(r.addedNodes))n instanceof Element&&(ji(n),n.shadowRoot&&zn(n.shadowRoot),qn(n))}).observe(document.documentElement,{childList:!0,subtree:!0})}const Ah=Jl,Ch=Jc,kh=Pi,$h=Fr,gs=Ue,Dh=dt,Yr=ht,Eh=Os,Oh=fs;ga(),window["concorde-utils"]=window["concorde-utils"]||{},window["concorde-utils"]={Utils:Ah,Arrays:Ch,DataBindObserver:kh,Format:$h,HTML:gs,LocationHandler:Dh,Objects:Yr,PublisherManager:ve,api:Eh,URLPattern:Oh,Endpoint:Ti,DataProviderKey:Cs};var Th=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Zr=(t,e,s,i)=>{for(var r=i>1?void 0:i?Lh(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Th(e,s,r),r};const Bn=t=>{class e extends t{constructor(){super(...arguments),this._value="",this.forceAutoFill=!1,this.unique=null,this.radio=null,this._checked=null,this.updateAllChecked=()=>{const i=this.getAttribute("name"),r=this.getCheckAllPublisher(),n=this.getFormPublisher();if(r?.hasCheckAll.get()&&!this.checksAll()&&r&&n&&i){if(this.getFormPublisherValue()?.length)(this.checked===null||r.checkMode.get()=="noneChecked"||r.checkMode.get()==null)&&r.checkMode.set("someUnchecked");else{r.checkMode.set("noneChecked");return}const o=this.getFormPublisherValue(),c=r.values.get();if(c&&c.length){let d=c.length;for(const b of c)o.indexOf(b)==-1&&(d-=1);d==c.length&&r.checkMode.set("allChecked"),d==0&&r.checkMode.set("noneChecked")}c.indexOf(this.value)==-1&&this.unsetOnDisconnect()&&(this.checked=null)}},this.onChecksAllRequest=i=>{this.removeAttribute("allChecked"),this.removeAttribute("indeterminate"),i=="allChecked"&&(this.checked=!0,this.setAttribute("allChecked","")),i=="noneChecked"&&(this.checked=null),i=="someUnchecked"&&(this.checksAll()&&(this.checked="indeterminate"),this.setAttribute("indeterminate",""))}}get value(){return this._value}set value(i){if(this.value==i||(this.hasAttribute("value")&&!this.forceAutoFill&&(i=this.getAttribute("value")),this._value==i)||i==null||(this._value=i,!this.value))return;if(this.getFormPublisher()&&this.name){let n=this.getFormPublisherValue();(this.radio||this.unique)&&(this.checked=n==i?!0:null),Array.isArray(n)||(n=[]),n.indexOf(i)!=-1&&(this.checked=!0)}this.checked==!0&&this.updateDataValue(),this.requestUpdate()}get checked(){return this._checked}set checked(i){if(this.setCheckedValue(i),this.checksAll()){const r=this.getCheckAllPublisher();r&&(this.checked===!0?r.checkMode.set("allChecked"):this.checked===null&&(r.checkMode.set("noneChecked"),this.getFormPublisher()&&this.setFormPublisherValue([])))}this.requestUpdate()}validateFormElement(){const i=this.shadowRoot?.querySelector("input");if(!i||i.checkValidity())return;const r=this.getFormPublisher();if(r){const n=this.getFormPublisherValue();if((this.unique||this.radio)&&n!==null&&n!==void 0&&n.toString().length>0)return;r.isFormValid=!1,i.reportValidity()}}checksAll(){return this.hasAttribute("checksAll")}setCheckedValue(i){this._checked!=i&&(this._checked=i,this.updateDataValue(),this.requestUpdate(),setTimeout(()=>this.updateAllChecked(),1))}handleChange(){const i=this.checked===!0?this.radio?!0:null:!0;this.checked=i;const r=new Event("change");this.dispatchEvent(r)}getValueForFormPublisher(){let i=this.getFormPublisherValue();if(this.radio)return this.checked===!0&&this.value!=null?this.value:i;if(this.unique)return this.checked===!0&&this.value!=null?this.value:null;Array.isArray(i)||(i=[]);const r=i.slice(0),n=r.indexOf(this.value);return this.checked===!0&&n===-1&&!this.checksAll()&&r.push(this.value),this.checked===null&&n!==-1&&r.splice(n,1),r}setFormValueFromPublisher(i){if(this.unique||this.radio){this.checked=this.value==i?!0:null;return}Array.isArray(i)||(i=[]),!this.checksAll()&&(this.checked=i.indexOf(this.value)!==-1?!0:null)}getCheckAllPublisher(){this.formDataProvider||(this.formDataProvider=this.getAncestorAttributeValue("formDataProvider"));const i=this.formDataProvider,r=this.getAttribute("name");return!i||!r?null:ve.get(i+"/"+r+"/_available_values_")}unset(){this.checked=null}disconnectedCallback(){super.disconnectedCallback();const i=this.getCheckAllPublisher();if(i&&(i.checkMode.offAssign(this.onChecksAllRequest),!this.checksAll())){const r=i.values.get().slice(0),n=r.indexOf(this.value);n!=-1&&(r.splice(n,1),i.values.set(r))}setTimeout(()=>this.updateAllChecked(),1)}connectedCallback(){if(super.connectedCallback(),this.getFormPublisher()&&this.name){const n=this.getFormPublisherValue();n&&Array.isArray(n)&&n.indexOf(this.value)!==-1&&(this.checked=!0)}const r=this.getCheckAllPublisher();r&&(r.checkMode.onAssign(this.onChecksAllRequest),this.checksAll()&&r.hasCheckAll.set(!0),r.values.get()||r.values.set([]),this.checksAll()||r.values.set([...r.values.get(),this.value])),this.hasAttribute("checked")&&setTimeout(()=>this.checked=!0,1)}}return Zr([h()],e.prototype,"value",1),Zr([h()],e.prototype,"forceAutoFill",2),Zr([h({type:Boolean})],e.prototype,"unique",2),Zr([h({type:Boolean})],e.prototype,"radio",2),Zr([h()],e.prototype,"checked",1),e};/**
|
|
76
76
|
* @license
|
|
77
77
|
* Copyright 2018 Google LLC
|
|
78
78
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -507,7 +507,7 @@
|
|
|
507
507
|
* @license
|
|
508
508
|
* Copyright 2017 Google LLC
|
|
509
509
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
510
|
-
*/const ba=(t,e,s)=>{const i=new Map;for(let r=e;r<=s;r++)i.set(t[r],r);return i},Ui=Es(class extends gr{constructor(t){if(super(t),t.type!==Ys.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let i;s===void 0?s=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const c of t)r[o]=i?i(c,o):o,n[o]=s(c,o),o++;return{values:n,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,i]){const r=Ic(t),{values:n,keys:o}=this.dt(e,s,i);if(!Array.isArray(r))return this.ut=o,n;const c=this.ut??=[],d=[];let
|
|
510
|
+
*/const ba=(t,e,s)=>{const i=new Map;for(let r=e;r<=s;r++)i.set(t[r],r);return i},Ui=Es(class extends gr{constructor(t){if(super(t),t.type!==Ys.CHILD)throw Error("repeat() can only be used in text expressions")}dt(t,e,s){let i;s===void 0?s=e:e!==void 0&&(i=e);const r=[],n=[];let o=0;for(const c of t)r[o]=i?i(c,o):o,n[o]=s(c,o),o++;return{values:n,keys:r}}render(t,e,s){return this.dt(t,e,s).values}update(t,[e,s,i]){const r=Ic(t),{values:n,keys:o}=this.dt(e,s,i);if(!Array.isArray(r))return this.ut=o,n;const c=this.ut??=[],d=[];let b,A,m=0,f=r.length-1,C=0,E=n.length-1;for(;m<=f&&C<=E;)if(r[m]===null)m++;else if(r[f]===null)f--;else if(c[m]===o[C])d[C]=Gs(r[m],n[C]),m++,C++;else if(c[f]===o[E])d[E]=Gs(r[f],n[E]),f--,E--;else if(c[m]===o[E])d[E]=Gs(r[m],n[E]),Hr(t,d[E+1],r[m]),m++,E--;else if(c[f]===o[C])d[C]=Gs(r[f],n[C]),Hr(t,r[m],r[f]),f--,C++;else if(b===void 0&&(b=ba(o,C,E),A=ba(c,m,f)),b.has(c[m]))if(b.has(c[f])){const T=A.get(o[C]),U=T!==void 0?r[T]:null;if(U===null){const B=Hr(t,r[m]);Gs(B,n[C]),d[C]=B}else d[C]=Gs(U,n[C]),Hr(t,r[m],U),r[T]=null;C++}else Dn(r[f]),f--;else Dn(r[m]),m++;for(;C<=E;){const T=Hr(t,d[E+1]);Gs(T,n[C]),d[C++]=T}for(;m<=f;){const T=r[m++];T!==null&&Dn(T)}return this.ut=o,Lc(t,d),jt}}),Fh=new WeakMap;let va=0;const Hn=new Map,ya=new WeakSet,wa=()=>new Promise((t=>requestAnimationFrame(t))),_a=(t,e)=>{const s=t-e;return s===0?void 0:s},Sa=(t,e)=>{const s=t/e;return s===1?void 0:s},Vn={left:(t,e)=>{const s=_a(t,e);return{value:s,transform:s==null||isNaN(s)?void 0:`translateX(${s}px)`}},top:(t,e)=>{const s=_a(t,e);return{value:s,transform:s==null||isNaN(s)?void 0:`translateY(${s}px)`}},width:(t,e)=>{let s;e===0&&(e=1,s={width:"1px"});const i=Sa(t,e);return{value:i,overrideFrom:s,transform:i==null||isNaN(i)?void 0:`scaleX(${i})`}},height:(t,e)=>{let s;e===0&&(e=1,s={height:"1px"});const i=Sa(t,e);return{value:i,overrideFrom:s,transform:i==null||isNaN(i)?void 0:`scaleY(${i})`}}},Rh={duration:333,easing:"ease-in-out"},jh=["left","top","width","height","opacity","color","background"],Pa=new WeakMap;class Uh extends En{constructor(e){if(super(e),this.t=!1,this.i=null,this.o=null,this.h=!0,this.shouldLog=!1,e.type===Ys.CHILD)throw Error("The `animate` directive must be used in attribute position.");this.createFinished()}createFinished(){this.resolveFinished?.(),this.finished=new Promise((e=>{this.l=e}))}async resolveFinished(){this.l?.(),this.l=void 0}render(e){return ee}getController(){return Fh.get(this.u)}isDisabled(){return this.options.disabled||this.getController()?.disabled}update(e,[s]){const i=this.u===void 0;return i&&(this.u=e.options?.host,this.u.addController(this),this.u.updateComplete.then((r=>this.t=!0)),this.element=e.element,Pa.set(this.element,this)),this.optionsOrCallback=s,(i||typeof s!="function")&&this.p(s),this.render(s)}p(e){e=e??{};const s=this.getController();s!==void 0&&((e={...s.defaultOptions,...e}).keyframeOptions={...s.defaultOptions.keyframeOptions,...e.keyframeOptions}),e.properties??=jh,this.options=e}m(){const e={},s=this.element.getBoundingClientRect(),i=getComputedStyle(this.element);return this.options.properties.forEach((r=>{const n=s[r]??(Vn[r]?void 0:i[r]),o=Number(n);e[r]=isNaN(o)?n+"":o})),e}v(){let e,s=!0;return this.options.guard&&(e=this.options.guard(),s=((i,r)=>{if(Array.isArray(i)){if(Array.isArray(r)&&r.length===i.length&&i.every(((n,o)=>n===r[o])))return!1}else if(r===i)return!1;return!0})(e,this._)),this.h=this.t&&!this.isDisabled()&&!this.isAnimating()&&s&&this.element.isConnected,this.h&&(this._=Array.isArray(e)?Array.from(e):e),this.h}hostUpdate(){typeof this.optionsOrCallback=="function"&&this.p(this.optionsOrCallback()),this.v()&&(this.A=this.m(),this.i=this.i??this.element.parentNode,this.o=this.element.nextSibling)}async hostUpdated(){if(!this.h||!this.element.isConnected||this.options.skipInitial&&!this.isHostRendered)return;let e;this.prepare(),await wa;const s=this.O(),i=this.j(this.options.keyframeOptions,s),r=this.m();if(this.A!==void 0){const{from:n,to:o}=this.N(this.A,r,s);this.log("measured",[this.A,r,n,o]),e=this.calculateKeyframes(n,o)}else{const n=Hn.get(this.options.inId);if(n){Hn.delete(this.options.inId);const{from:o,to:c}=this.N(n,r,s);e=this.calculateKeyframes(o,c),e=this.options.in?[{...this.options.in[0],...e[0]},...this.options.in.slice(1),e[1]]:e,va++,e.forEach((d=>d.zIndex=va))}else this.options.in&&(e=[...this.options.in,{}])}this.animate(e,i)}resetStyles(){this.P!==void 0&&(this.element.setAttribute("style",this.P??""),this.P=void 0)}commitStyles(){this.P=this.element.getAttribute("style"),this.webAnimation?.commitStyles(),this.webAnimation?.cancel()}reconnected(){}async disconnected(){if(!this.h||(this.options.id!==void 0&&Hn.set(this.options.id,this.A),this.options.out===void 0))return;if(this.prepare(),await wa(),this.i?.isConnected){const s=this.o&&this.o.parentNode===this.i?this.o:null;if(this.i.insertBefore(this.element,s),this.options.stabilizeOut){const i=this.m();this.log("stabilizing out");const r=this.A.left-i.left,n=this.A.top-i.top;getComputedStyle(this.element).position!=="static"||r===0&&n===0||(this.element.style.position="relative"),r!==0&&(this.element.style.left=r+"px"),n!==0&&(this.element.style.top=n+"px")}}const e=this.j(this.options.keyframeOptions);await this.animate(this.options.out,e),this.element.remove()}prepare(){this.createFinished()}start(){this.options.onStart?.(this)}didFinish(e){e&&this.options.onComplete?.(this),this.A=void 0,this.animatingProperties=void 0,this.frames=void 0,this.resolveFinished()}O(){const e=[];for(let s=this.element.parentNode;s;s=s?.parentNode){const i=Pa.get(s);i&&!i.isDisabled()&&i&&e.push(i)}return e}get isHostRendered(){const e=ya.has(this.u);return e||this.u.updateComplete.then((()=>{ya.add(this.u)})),e}j(e,s=this.O()){const i={...Rh};return s.forEach((r=>Object.assign(i,r.options.keyframeOptions))),Object.assign(i,e),i}N(e,s,i){e={...e},s={...s};const r=i.map((c=>c.animatingProperties)).filter((c=>c!==void 0));let n=1,o=1;return r.length>0&&(r.forEach((c=>{c.width&&(n/=c.width),c.height&&(o/=c.height)})),e.left!==void 0&&s.left!==void 0&&(e.left=n*e.left,s.left=n*s.left),e.top!==void 0&&s.top!==void 0&&(e.top=o*e.top,s.top=o*s.top)),{from:e,to:s}}calculateKeyframes(e,s,i=!1){const r={},n={};let o=!1;const c={};for(const d in s){const b=e[d],A=s[d];if(d in Vn){const m=Vn[d];if(b===void 0||A===void 0)continue;const f=m(b,A);f.transform!==void 0&&(c[d]=f.value,o=!0,r.transform=`${r.transform??""} ${f.transform}`,f.overrideFrom!==void 0&&Object.assign(r,f.overrideFrom))}else b!==A&&b!==void 0&&A!==void 0&&(o=!0,r[d]=b,n[d]=A)}return r.transformOrigin=n.transformOrigin=i?"center center":"top left",this.animatingProperties=c,o?[r,n]:void 0}async animate(e,s=this.options.keyframeOptions){this.start(),this.frames=e;let i=!1;if(!this.isAnimating()&&!this.isDisabled()&&(this.options.onFrames&&(this.frames=e=this.options.onFrames(this),this.log("modified frames",e)),e!==void 0)){this.log("animate",[e,s]),i=!0,this.webAnimation=this.element.animate(e,s);const r=this.getController();r?.add(this);try{await this.webAnimation.finished}catch{}r?.remove(this)}return this.didFinish(i),i}isAnimating(){return this.webAnimation?.playState==="running"||this.webAnimation?.pending}log(e,s){this.shouldLog&&!this.isDisabled()&&console.log(e,this.options.id,s)}}const zh=Es(Uh),qh={core:{cancel:`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
511
511
|
<path d="M6.75827 17.2426L12.0009 12M17.2435 6.75736L12.0009 12M12.0009 12L6.75827 6.75736M12.0009 12L17.2435 17.2426" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
512
512
|
</svg>
|
|
513
513
|
`,"check-circled-outline":`<svg width="24" height="24" stroke-width="1.5" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -543,7 +543,7 @@
|
|
|
543
543
|
<path d="M12 17.01L12.01 16.9989" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
544
544
|
<path d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>
|
|
545
545
|
</svg>
|
|
546
|
-
`}},zi=new Map,xa={heroicons:{url:"https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg",defaultPrefix:"outline"},iconoir:{url:"https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg"},feathers:{url:"https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg"},lucide:{url:"https://cdn.jsdelivr.net/npm/lucide-static@0.16.29/icons/$name.svg"},material:{url:"https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",defaultPrefix:"regular"},fontAwesome:{url:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",defaultPrefix:"regular"},custom:{url:"",defaultPrefix:""}};function Bh(t){let e=t.customLibraryPath,s=t.customLibraryDefaultPrefix;if(e==null){const i=document.querySelector("[customIconLibraryPath]");e=i?.getAttribute("customIconLibraryPath")??"",s==null&&(s=i?.getAttribute("customIconDefaultPrefix")??document.querySelector("[customIconDefaultPrefix]")?.getAttribute("customIconDefaultPrefix")??"")}return{url:e||"",defaultPrefix:s||""}}function Hh(t,e){return t in xa?t!=="custom"?xa[t]:Bh(e):null}const Aa=sessionStorage.getItem("sonicIconsCache"),bs=Aa?JSON.parse(Aa):{icons:{},names:[]},Vh=100,Eo=class Eo{};Eo.default={get:async e=>{const s=e.library;if(!e.name)return"";const i=e.name,r=qh;if(!s)return He(r.core[e.name]||"");const n=Hh(s,e);if(n){if(s==="custom"&&!n.url)return"";const o=e.prefix||n.defaultPrefix||"",c=r[s]||{};r[s]=c;const d=s==="custom"?`${n.url}|${o}-${i}`:`${o}-${i}`;if(c[d])return He(c[d]);const g=(n.url||"").replace("$prefix",o).replace("$name",i);if(bs.icons[g]){const m=bs.icons[g];if(/^\s*<svg[\s>]/i.test(m||""))return c[d]=m,He(m);delete bs.icons[g]}if(!zi.has(g)){const m=new Promise(async f=>{try{const C=await fetch(g);if(!C.ok){f("");return}try{const E=C.headers.get("content-type")||"";if(!E.includes("image/svg+xml")&&!E.includes("svg")){f("");return}const O=await C.text(),U=/^\s*<svg[\s>]/i.test(O);f(U?O:"")}catch{f("")}}catch{jc(),f("")}});zi.set(g,m)}const A=await zi.get(g);if(zi.delete(g),c[d]=A||"",A&&/^\s*<svg[\s>]/i.test(A)&&(bs.icons[g]=A,bs.names.push(g)),bs.names.length>Vh){const m=bs.names.shift();delete bs.icons[m]}return sessionStorage.setItem("sonicIconsCache",JSON.stringify(bs)),A?He(A):""}return He(r.core[e.name]||"")}};let Wn=Eo;function Wh(t){this.__beforeConnectedCallbackCalls__||(this.__beforeConnectedCallbackCalls__=new Set),this.__beforeConnectedCallbackCalls__.add(t)}function Kh(t){this.__connectedCallbackCalls__||(this.__connectedCallbackCalls__=new Set),this.__connectedCallbackCalls__.add(t)}function Gh(t){this.__disconnectedCallbackCalls__||(this.__disconnectedCallbackCalls__=new Set),this.__disconnectedCallbackCalls__.add(t)}function Qs(t){if(t.__is__setSubscribable__)return;t.__is__setSubscribable__=!0,t.__onBeforeConnected__=Wh,t.__onConnected__=Kh,t.__onDisconnected__=Gh;const e=t.connectedCallback;t.connectedCallback=function(){this.__beforeConnectedCallbackCalls__&&this.__beforeConnectedCallbackCalls__.forEach(i=>i(this)),e?.call(this),this.__connectedCallbackCalls__&&this.__connectedCallbackCalls__.forEach(i=>i(this))};const s=t.disconnectedCallback;t.disconnectedCallback=function(){s?.call(this),this.__disconnectedCallbackCalls__&&this.__disconnectedCallbackCalls__.forEach(i=>i(this))}}function Yh(t){return t.trim().replace(/^this\./,"")}function Kn(t,e){if(!e)return;const s=e.split(".").filter(Boolean);if(s.length===0)return;let i=t;for(const r of s){if(i==null||typeof i!="object")return;i=i[r]}return i}function Zh(t,e){return!!(t==null||e?.skipEmptyPlaceholder&&t==="")}function Tt(t,e,s){let i=!1;const r=(c,d)=>{const g=Yh(d),A=Kn(t,g);return Zh(A,s)?(i=!0,""):`${A}`},n=e.replace(/\$\{([^}]+)\}/g,r).replace(/\{\$([^}]+)\}/g,r).trim();if(i||!n.length)return{ready:!1,path:null};const o=n.split(".").filter(Boolean);return o.length===0||!o[0]?{ready:!1,path:null}:{ready:!0,path:n}}function Ht(t){const e=[/\$\{([^}]+)\}/g,/\{\$([^}]+)\}/g],s=new Set;for(const i of e){let r;for(;(r=i.exec(t))!==null;){const n=(r[1]||"").trim().replace(/^this\./,"");if(!n)continue;const[o]=n.split(".");o&&s.add(o)}}return Array.from(s)}function Ca(t){return typeof t=="object"&&t!==null&&"path"in t&&typeof t.path=="string"}const Jr=new WeakMap,Qr=new Set;let _r=null;const Jh=8;function Qh(t){let e=Jr.get(t);return e||(e=new Map,Jr.set(t,e)),e}function Xh(t,e){const s=new Set;for(const[i,r]of e){const n=Kn(t,i);Object.is(r.lastValue,n)||(r.lastValue=n,r.onChangeHandlers.forEach(o=>s.add(o)))}return s}function eu(){_r=null;let t=0,e=!0;for(;e&&t<Jh;){e=!1,t+=1;for(const s of Qr){const i=Jr.get(s);if(!i||i.size===0)continue;const r=Xh(s,i);r.size!==0&&(e=!0,r.forEach(n=>n()))}}e&&console.warn("[concorde] dynamic property watch: limite de passes atteinte, boucle infinie probable"),Qr.size>0&&ka()}function ka(){_r===null&&(_r=requestAnimationFrame(eu))}function tu(){Qr.size===0&&_r!==null&&(cancelAnimationFrame(_r),_r=null)}function Ts(t,e,s,i,r){const n=String(i),o=Qh(s);let c=o.get(n);return c||(c={lastValue:Kn(s,n),onChangeHandlers:new Set},o.set(n,c)),c.onChangeHandlers.add(r),Qr.add(s),ka(),()=>{const d=Jr.get(s);if(!d)return;const g=d.get(n);g&&(g.onChangeHandlers.delete(r),g.onChangeHandlers.size===0&&d.delete(n),d.size===0&&(Jr.delete(s),Qr.delete(s),tu()))}}const qi={watcherStore:Symbol("__bindDynamicWatcherStore__"),hooked:Symbol("__bindDynamicWillUpdateHooked__")},$a={watcherStore:"__publishDynamicWatcherStore__",hooked:"__publishDynamicWillUpdateHooked__"},Ls={watcherStore:"__getDynamicWatcherStore__",hooked:"__getDynamicWillUpdateHooked__"},Da={watcherStore:Symbol("__onAssignDynamicWatcherStore__"),hooked:Symbol("__onAssignDynamicWillUpdateHooked__")};function Lt(t){const e=t.split(".").filter(r=>r.length>0);if(e.length===0)return null;const s=e.shift()||"";if(!s)return null;let i=ve.get(s);return i?(i=Yr.traverse(i,e),i):null}function su(t,e){const s=e?.reflect??!1,i={skipEmptyPlaceholder:e?.skipEmptyPlaceholder},r=Ht(t),n=r.length>0;return function(o,c){if(!o)return;Qs(o);const d=`__bind_state_${c}`,g=`__bind_${c}_publisher__`,A=s?`__bind_${c}_updating_from_publisher__`:null;if(s){const m=Object.getOwnPropertyDescriptor(o,c),f=`__bind_${c}_value__`,C=`__bind_${c}_updating_from_publisher__`,E=m&&!m.get&&!m.set?m.value:void 0;Object.defineProperty(o,c,{get(){return m?.get?m.get.call(this):(!Object.prototype.hasOwnProperty.call(this,f)&&E!==void 0&&(this[f]=E),this[f])},set(O){m?.set?m.set.call(this,O):this[f]=O,!this[C]&&this[g]&&this[g].set(O)},enumerable:m?.enumerable??!0,configurable:m?.configurable??!0})}o.__onConnected__(m=>{const f=m[d]||(m[d]={cleanupWatchers:[],unsubscribePublisher:null,currentPath:null});f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.cleanupWatchers.forEach(O=>O()),f.cleanupWatchers=[],f.currentPath=null;const C=O=>{if(!O){f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.currentPath=null,m[g]=null;return}if(O===f.currentPath)return;f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null);const U=Lt(O);if(!U){f.currentPath=null,m[g]=null;return}const B=S=>{s&&A&&(m[A]=!0),m[c]=S,s&&A&&(m[A]=!1)};U.onAssign(B),f.unsubscribePublisher=()=>{U.offAssign(B),m[g]===U&&(m[g]=null)},f.currentPath=O,m[g]=U},E=()=>{if(n){const O=Tt(m,t,i);if(!O.ready){C(null);return}C(O.path);return}C(t)};if(n)for(const O of r){const U=Ts(qi.watcherStore,qi.hooked,m,O,()=>E());f.cleanupWatchers.push(U)}E()}),o.__onDisconnected__(m=>{const f=m[d];f&&(f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.cleanupWatchers.forEach(C=>C()),f.cleanupWatchers=[],f.currentPath=null,m[g]=null)})}}function Ea(t,e){const s=Ca(t)?t.path:t;return su(s,e)}function Oa(t,e){const s=t.path,i={skipEmptyPlaceholder:e?.skipEmptyPlaceholder},r=Ht(s);return function(n,o){Qs(n);const c=`__publish_${o}_publisher__`,d=`__publish_${o}_value__`,g=Object.getOwnPropertyDescriptor(n,o),A=g&&!g.get&&!g.set?g.value:void 0;Object.defineProperty(n,o,{get(){return g?.get?g.get.call(this):(!Object.prototype.hasOwnProperty.call(this,d)&&A!==void 0&&(this[d]=A),this[d])},set(m){g?.set?g.set.call(this,m):this[d]=m;const f=this[c];f&&f.set(m)},enumerable:g?.enumerable??!0,configurable:g?.configurable??!0}),n.__onConnected__(m=>{const f=m,C=`__publish_state_${o}`,E=f[C]||(f[C]={cleanupWatchers:[]}),O=()=>{let U;if(r.length){const S=Tt(m,s,i);U=S.ready?S.path:null}else U=s;const B=U?Lt(U):void 0;if(f[c]=B??null,B&&o in m){const S=f[o];S!==void 0&&B.set(S)}};if(E.cleanupWatchers.forEach(U=>U()),E.cleanupWatchers=[],r.length)for(const U of r)E.cleanupWatchers.push(Ts($a.watcherStore,$a.hooked,f,U,O));O()}),n.__onDisconnected__(m=>{const f=m,C=`__publish_state_${o}`,E=f[C];E?.cleanupWatchers&&E.cleanupWatchers.forEach(O=>O()),f[c]=void 0})}}function Ta(t){return Ea(t)}const ru={nullish:t=>t==null,emptyString:t=>t==="",emptyObject:t=>typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length===0,emptyArray:t=>Array.isArray(t)&&t.length===0};function iu(t,e){return e.some(s=>ru[s](t))}function nu(t,e,s){if(!s.dispatchWhenUndefined&&t.slice(0,e).filter(r=>r!=null).length!==e)return!1;if(s.skip&&s.skip.length>0){for(let i=0;i<e;i++)if(iu(t[i],s.skip))return!1}return!0}function ou(...t){return La({},t)}function La(t,e){const s=e.map(r=>{const n=Ht(r);return{originalPath:r,dynamicDependencies:n,isDynamic:n.length>0}}),i={skipEmptyPlaceholder:t.skipEmptyPlaceholder};return function(r,n,o){Qs(r);const c=`__onAssign_state_${n}__`;let d;r.__onConnected__(g=>{const A=g[c]||(g[c]={cleanupWatchers:[],configurations:[]});A.cleanupWatchers.forEach(O=>O()),A.cleanupWatchers=[],A.configurations.forEach(O=>{O.unsubscribePublisher&&O.unsubscribePublisher()}),A.configurations=[];const m=[],f=[];for(let O=0;O<e.length;O++){const U=s[O],B=new Set,S=y=>{m[O]=y,nu(m,e.length,t)&&B.forEach(M=>M(...m))};f.push({publisher:null,onAssign:S,callbacks:B,unsubscribePublisher:null,pathConfig:U,index:O})}const C=(O,U)=>{if(O.unsubscribePublisher&&(O.unsubscribePublisher(),O.unsubscribePublisher=null),m[O.index]=null,O.publisher=null,!U)return;const B=Lt(U);B&&(B.onAssign(O.onAssign),O.unsubscribePublisher=()=>{B.offAssign(O.onAssign),O.publisher===B&&(O.publisher=null)},O.publisher=B)},E=()=>{for(const O of f)if(O.pathConfig.isDynamic){const U=Tt(g,O.pathConfig.originalPath,i);if(!U.ready){C(O,null);continue}C(O,U.path)}else C(O,O.pathConfig.originalPath)};for(const O of f)if(O.pathConfig.isDynamic)for(const U of O.pathConfig.dynamicDependencies){const B=Ts(Da.watcherStore,Da.hooked,g,U,()=>E());A.cleanupWatchers.push(B)}d=o.value.bind(g);for(const O of f)O.callbacks.add(d);E(),A.configurations=f}),r.__onDisconnected__(g=>{const A=g[c];A&&(A.cleanupWatchers.forEach(m=>m()),A.cleanupWatchers=[],A.configurations.forEach(m=>{m.unsubscribePublisher&&m.unsubscribePublisher(),m.callbacks.delete(d)}),A.configurations=[])})}}function au(t){return Object.prototype.toString.call(t)==="[object DataProviderKey]"}function lu(...t){const e=t[t.length-1],s=e!==void 0&&!au(e),i=s?e:{},n=(s?t.slice(0,-1):t).map(o=>o.path);return La({dispatchWhenUndefined:!i.waitForAllDefined,skip:i.skip,skipEmptyPlaceholder:i.skipEmptyPlaceholder},n)}function cu(){return function(t,e,s){let i=0;const r=s.value,n=t.constructor.prototype.disconnectedCallback;t.constructor.prototype.disconnectedCallback=function(){n?.apply(this),this.__removeAutoSubscribe__()};const o=t.connectedCallback;t.connectedCallback=function(){o?.call(this),this[e]()},s.value=function(...c){let d=new Set;const g=()=>{i++;const m=i;window.queueMicrotask(()=>{m===i&&this[e]()})};d.forEach(m=>{m.offAssign(g)}),No();const A=r.apply(this,c);return d=Fo()||new Set,d.forEach(m=>{m.onAssign(g,!1)}),this.__removeAutoSubscribe__=()=>{d.forEach(m=>{m.offAssign(g)})},A}}}function hu(t){return function(e){Qs(e);for(const s of t){const i=s.split(".");if(i.length===0)continue;const r=i.shift()||"";let n=ve.get(r);n=Yr.traverse(n,i),e.__onConnected__(o=>{n.startTemplateFilling(o)}),e.__onDisconnected__(()=>{})}}}function uu(t){const e=[];let s=t;for(;s;)s instanceof Element&&e.push(s),s=s.parentNode||(s.host??null);return e}function du(t){const e=t.parentNode||(t.getRootNode()?.host??null);return e instanceof Element?e:null}function Ia(t,e,s,i){const r=t,n=Ue.getAncestorAttributeValue(t,e);!i.assignNull&&n===null||Object.is(r[s],n)||(r[s]=n)}const ye=class ye{static subscribe(e,s,i,r={assignNull:!0}){const n={component:e,attributeName:s,propertyKey:i,syncOptions:r,watchedAncestors:[],parentForReparent:null};return ye.subscriptions.add(n),ye.bindSubscription(n),()=>{ye.unsubscribe(n)}}static bindSubscription(e){ye.unbindWatchers(e);const s=uu(e.component);e.watchedAncestors=s;for(const r of s)ye.addAttrSlot(r,e.attributeName,e);const i=du(e.component);e.parentForReparent=i,i&&ye.addParentSlot(i,e),ye.pendingRefresh.add(e),ye.scheduleRefresh()}static unbindWatchers(e){for(const s of e.watchedAncestors)ye.removeAttrSlot(s,e.attributeName,e);e.watchedAncestors=[],e.parentForReparent&&(ye.removeParentSlot(e.parentForReparent,e),e.parentForReparent=null)}static addAttrSlot(e,s,i){let r=ye.attrSlots.get(e);r||(r=new Map,ye.attrSlots.set(e,r));let n=r.get(s);if(!n){const o=Ue.scopeAttributeNames(s),c=new Set,d=new MutationObserver(()=>{for(const g of c)ye.subscriptions.has(g)&&ye.pendingRefresh.add(g);ye.scheduleRefresh()});d.observe(e,{attributes:!0,attributeFilter:o}),n={observer:d,subscriptions:c},r.set(s,n)}n.subscriptions.add(i)}static removeAttrSlot(e,s,i){const r=ye.attrSlots.get(e);if(!r)return;const n=r.get(s);n&&(n.subscriptions.delete(i),!(n.subscriptions.size>0)&&(n.observer.disconnect(),r.delete(s)))}static addParentSlot(e,s){let i=ye.parentSlots.get(e);if(!i){const n=new Map,o=new MutationObserver(c=>{const d=new Set;for(const g of c)g.removedNodes.forEach(A=>{A instanceof Element&&d.add(A)}),g.addedNodes.forEach(A=>{A instanceof Element&&d.add(A)});for(const g of d){const A=n.get(g);if(A)for(const m of[...A])ye.subscriptions.has(m)&&ye.bindSubscription(m)}});o.observe(e,{childList:!0}),i={observer:o,byComponent:n},ye.parentSlots.set(e,i)}let r=i.byComponent.get(s.component);r||(r=new Set,i.byComponent.set(s.component,r)),r.add(s)}static removeParentSlot(e,s){const i=ye.parentSlots.get(e);if(!i)return;const r=i.byComponent.get(s.component);r&&(r.delete(s),r.size===0&&i.byComponent.delete(s.component)),!(i.byComponent.size>0)&&(i.observer.disconnect(),ye.parentSlots.delete(e))}static unsubscribe(e){ye.subscriptions.has(e)&&(ye.unbindWatchers(e),ye.subscriptions.delete(e),ye.pendingRefresh.delete(e),ye.subscriptions.size===0&&ye.cancelScheduledRefresh())}static scheduleRefresh(){ye.pendingRefresh.size!==0&&ye.animationFrameId===null&&(ye.animationFrameId=requestAnimationFrame(()=>{ye.flushRefresh()}))}static cancelScheduledRefresh(){ye.animationFrameId!==null&&(cancelAnimationFrame(ye.animationFrameId),ye.animationFrameId=null),ye.pendingRefresh.clear()}static flushRefresh(){ye.animationFrameId=null;const e=Array.from(ye.pendingRefresh);ye.pendingRefresh.clear();for(const s of e)ye.subscriptions.has(s)&&Ia(s.component,s.attributeName,s.propertyKey,s.syncOptions)}};ye.subscriptions=new Set,ye.pendingRefresh=new Set,ye.animationFrameId=null,ye.attrSlots=new WeakMap,ye.parentSlots=new WeakMap;let Gn=ye;function Yn(t,e){const s=e?.dynamic??!1,i=s;return function(r,n){if(!r||(Qs(r),r.__onBeforeConnected__(c=>{Ia(c,t,n,{assignNull:i})}),!s))return;let o=null;r.__onConnected__(c=>{o=Gn.subscribe(c,t,n,{assignNull:!0})}),r.__onDisconnected__(()=>{o?.(),o=null})}}var pu=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,Xs=(t,e,s,i)=>{for(var r=i>1?void 0:i?fu(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&pu(e,s,r),r};const Zn=t=>h(t),mu="sonic-icon";let vs=class extends Q{constructor(){super(...arguments),this.iconText="",this.name="",this.prefix="",this.library="",this.customIconLibraryPath=null,this.customIconDefaultPrefix=null}async updateIcon(){this.iconText=await Wn.default.get({name:this.name,prefix:this.prefix,library:this.library,customLibraryPath:this.customIconLibraryPath,customLibraryDefaultPrefix:this.customIconDefaultPrefix})}connectedCallback(){this.setAttribute("aria-hidden","true"),super.connectedCallback()}willUpdate(t){(t.has("name")||t.has("prefix")||t.has("library")||this.library==="custom"&&(t.has("customIconLibraryPath")||t.has("customIconDefaultPrefix")))&&this.updateIcon(),super.willUpdate(t)}render(){return this.iconText?this.iconText:ee}};vs.styles=Z`
|
|
546
|
+
`}},zi=new Map,xa={heroicons:{url:"https://cdn.jsdelivr.net/npm/heroicons@2.0.4/24/$prefix/$name.svg",defaultPrefix:"outline"},iconoir:{url:"https://cdnjs.cloudflare.com/ajax/libs/iconoir/5.1.4/icons/$name.svg"},feathers:{url:"https://cdn.jsdelivr.net/npm/feather-icons@4.29.0/dist/icons/$name.svg"},lucide:{url:"https://cdn.jsdelivr.net/npm/lucide-static@0.16.29/icons/$name.svg"},material:{url:"https://cdn.jsdelivr.net/npm/@material-icons/svg@1.0.5/svg/$name/$prefix.svg",defaultPrefix:"regular"},fontAwesome:{url:"https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.15.1/svgs/$prefix/$name.svg",defaultPrefix:"regular"},custom:{url:"",defaultPrefix:""}};function Bh(t){let e=t.customLibraryPath,s=t.customLibraryDefaultPrefix;if(e==null){const i=document.querySelector("[customIconLibraryPath]");e=i?.getAttribute("customIconLibraryPath")??"",s==null&&(s=i?.getAttribute("customIconDefaultPrefix")??document.querySelector("[customIconDefaultPrefix]")?.getAttribute("customIconDefaultPrefix")??"")}return{url:e||"",defaultPrefix:s||""}}function Hh(t,e){return t in xa?t!=="custom"?xa[t]:Bh(e):null}const Aa=sessionStorage.getItem("sonicIconsCache"),bs=Aa?JSON.parse(Aa):{icons:{},names:[]},Vh=100,Eo=class Eo{};Eo.default={get:async e=>{const s=e.library;if(!e.name)return"";const i=e.name,r=qh;if(!s)return He(r.core[e.name]||"");const n=Hh(s,e);if(n){if(s==="custom"&&!n.url)return"";const o=e.prefix||n.defaultPrefix||"",c=r[s]||{};r[s]=c;const d=s==="custom"?`${n.url}|${o}-${i}`:`${o}-${i}`;if(c[d])return He(c[d]);const b=(n.url||"").replace("$prefix",o).replace("$name",i);if(bs.icons[b]){const m=bs.icons[b];if(/^\s*<svg[\s>]/i.test(m||""))return c[d]=m,He(m);delete bs.icons[b]}if(!zi.has(b)){const m=new Promise(async f=>{try{const C=await fetch(b);if(!C.ok){f("");return}try{const E=C.headers.get("content-type")||"";if(!E.includes("image/svg+xml")&&!E.includes("svg")){f("");return}const T=await C.text(),U=/^\s*<svg[\s>]/i.test(T);f(U?T:"")}catch{f("")}}catch{jc(),f("")}});zi.set(b,m)}const A=await zi.get(b);if(zi.delete(b),c[d]=A||"",A&&/^\s*<svg[\s>]/i.test(A)&&(bs.icons[b]=A,bs.names.push(b)),bs.names.length>Vh){const m=bs.names.shift();delete bs.icons[m]}return sessionStorage.setItem("sonicIconsCache",JSON.stringify(bs)),A?He(A):""}return He(r.core[e.name]||"")}};let Wn=Eo;function Wh(t){this.__beforeConnectedCallbackCalls__||(this.__beforeConnectedCallbackCalls__=new Set),this.__beforeConnectedCallbackCalls__.add(t)}function Kh(t){this.__connectedCallbackCalls__||(this.__connectedCallbackCalls__=new Set),this.__connectedCallbackCalls__.add(t)}function Gh(t){this.__disconnectedCallbackCalls__||(this.__disconnectedCallbackCalls__=new Set),this.__disconnectedCallbackCalls__.add(t)}function Qs(t){if(t.__is__setSubscribable__)return;t.__is__setSubscribable__=!0,t.__onBeforeConnected__=Wh,t.__onConnected__=Kh,t.__onDisconnected__=Gh;const e=t.connectedCallback;t.connectedCallback=function(){this.__beforeConnectedCallbackCalls__&&this.__beforeConnectedCallbackCalls__.forEach(i=>i(this)),e?.call(this),this.__connectedCallbackCalls__&&this.__connectedCallbackCalls__.forEach(i=>i(this))};const s=t.disconnectedCallback;t.disconnectedCallback=function(){s?.call(this),this.__disconnectedCallbackCalls__&&this.__disconnectedCallbackCalls__.forEach(i=>i(this))}}function Yh(t){return t.trim().replace(/^this\./,"")}function Kn(t,e){if(!e)return;const s=e.split(".").filter(Boolean);if(s.length===0)return;let i=t;for(const r of s){if(i==null||typeof i!="object")return;i=i[r]}return i}function Zh(t,e){return!!(t==null||e?.skipEmptyPlaceholder&&t==="")}function Tt(t,e,s){let i=!1;const r=(c,d)=>{const b=Yh(d),A=Kn(t,b);return Zh(A,s)?(i=!0,""):`${A}`},n=e.replace(/\$\{([^}]+)\}/g,r).replace(/\{\$([^}]+)\}/g,r).trim();if(i||!n.length)return{ready:!1,path:null};const o=n.split(".").filter(Boolean);return o.length===0||!o[0]?{ready:!1,path:null}:{ready:!0,path:n}}function Ht(t){const e=[/\$\{([^}]+)\}/g,/\{\$([^}]+)\}/g],s=new Set;for(const i of e){let r;for(;(r=i.exec(t))!==null;){const n=(r[1]||"").trim().replace(/^this\./,"");if(!n)continue;const[o]=n.split(".");o&&s.add(o)}}return Array.from(s)}function Ca(t){return typeof t=="object"&&t!==null&&"path"in t&&typeof t.path=="string"}const Jr=new WeakMap,Qr=new Set;let _r=null;const Jh=8;function Qh(t){let e=Jr.get(t);return e||(e=new Map,Jr.set(t,e)),e}function Xh(t,e){const s=new Set;for(const[i,r]of e){const n=Kn(t,i);Object.is(r.lastValue,n)||(r.lastValue=n,r.onChangeHandlers.forEach(o=>s.add(o)))}return s}function eu(){_r=null;let t=0,e=!0;for(;e&&t<Jh;){e=!1,t+=1;for(const s of Qr){const i=Jr.get(s);if(!i||i.size===0)continue;const r=Xh(s,i);r.size!==0&&(e=!0,r.forEach(n=>n()))}}e&&console.warn("[concorde] dynamic property watch: limite de passes atteinte, boucle infinie probable"),Qr.size>0&&ka()}function ka(){_r===null&&(_r=requestAnimationFrame(eu))}function tu(){Qr.size===0&&_r!==null&&(cancelAnimationFrame(_r),_r=null)}function Ts(t,e,s,i,r){const n=String(i),o=Qh(s);let c=o.get(n);return c||(c={lastValue:Kn(s,n),onChangeHandlers:new Set},o.set(n,c)),c.onChangeHandlers.add(r),Qr.add(s),ka(),()=>{const d=Jr.get(s);if(!d)return;const b=d.get(n);b&&(b.onChangeHandlers.delete(r),b.onChangeHandlers.size===0&&d.delete(n),d.size===0&&(Jr.delete(s),Qr.delete(s),tu()))}}const qi={watcherStore:Symbol("__bindDynamicWatcherStore__"),hooked:Symbol("__bindDynamicWillUpdateHooked__")},$a={watcherStore:"__publishDynamicWatcherStore__",hooked:"__publishDynamicWillUpdateHooked__"},Ls={watcherStore:"__getDynamicWatcherStore__",hooked:"__getDynamicWillUpdateHooked__"},Da={watcherStore:Symbol("__onAssignDynamicWatcherStore__"),hooked:Symbol("__onAssignDynamicWillUpdateHooked__")};function Lt(t){const e=t.split(".").filter(r=>r.length>0);if(e.length===0)return null;const s=e.shift()||"";if(!s)return null;let i=ve.get(s);return i?(i=Yr.traverse(i,e),i):null}function su(t,e){const s=e?.reflect??!1,i={skipEmptyPlaceholder:e?.skipEmptyPlaceholder},r=Ht(t),n=r.length>0;return function(o,c){if(!o)return;Qs(o);const d=`__bind_state_${c}`,b=`__bind_${c}_publisher__`,A=s?`__bind_${c}_updating_from_publisher__`:null;if(s){const m=Object.getOwnPropertyDescriptor(o,c),f=`__bind_${c}_value__`,C=`__bind_${c}_updating_from_publisher__`,E=m&&!m.get&&!m.set?m.value:void 0;Object.defineProperty(o,c,{get(){return m?.get?m.get.call(this):(!Object.prototype.hasOwnProperty.call(this,f)&&E!==void 0&&(this[f]=E),this[f])},set(T){m?.set?m.set.call(this,T):this[f]=T,!this[C]&&this[b]&&this[b].set(T)},enumerable:m?.enumerable??!0,configurable:m?.configurable??!0})}o.__onConnected__(m=>{const f=m[d]||(m[d]={cleanupWatchers:[],unsubscribePublisher:null,currentPath:null});f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.cleanupWatchers.forEach(T=>T()),f.cleanupWatchers=[],f.currentPath=null;const C=T=>{if(!T){f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.currentPath=null,m[b]=null;return}if(T===f.currentPath)return;f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null);const U=Lt(T);if(!U){f.currentPath=null,m[b]=null;return}const B=x=>{s&&A&&(m[A]=!0),m[c]=x,s&&A&&(m[A]=!1)};U.onAssign(B),f.unsubscribePublisher=()=>{U.offAssign(B),m[b]===U&&(m[b]=null)},f.currentPath=T,m[b]=U},E=()=>{if(n){const T=Tt(m,t,i);if(!T.ready){C(null);return}C(T.path);return}C(t)};if(n)for(const T of r){const U=Ts(qi.watcherStore,qi.hooked,m,T,()=>E());f.cleanupWatchers.push(U)}E()}),o.__onDisconnected__(m=>{const f=m[d];f&&(f.unsubscribePublisher&&(f.unsubscribePublisher(),f.unsubscribePublisher=null),f.cleanupWatchers.forEach(C=>C()),f.cleanupWatchers=[],f.currentPath=null,m[b]=null)})}}function Ea(t,e){const s=Ca(t)?t.path:t;return su(s,e)}function Oa(t,e){const s=t.path,i={skipEmptyPlaceholder:e?.skipEmptyPlaceholder},r=Ht(s);return function(n,o){Qs(n);const c=`__publish_${o}_publisher__`,d=`__publish_${o}_value__`,b=Object.getOwnPropertyDescriptor(n,o),A=b&&!b.get&&!b.set?b.value:void 0;Object.defineProperty(n,o,{get(){return b?.get?b.get.call(this):(!Object.prototype.hasOwnProperty.call(this,d)&&A!==void 0&&(this[d]=A),this[d])},set(m){b?.set?b.set.call(this,m):this[d]=m;const f=this[c];f&&f.set(m)},enumerable:b?.enumerable??!0,configurable:b?.configurable??!0}),n.__onConnected__(m=>{const f=m,C=`__publish_state_${o}`,E=f[C]||(f[C]={cleanupWatchers:[]}),T=()=>{let U;if(r.length){const x=Tt(m,s,i);U=x.ready?x.path:null}else U=s;const B=U?Lt(U):void 0;if(f[c]=B??null,B&&o in m){const x=f[o];x!==void 0&&B.set(x)}};if(E.cleanupWatchers.forEach(U=>U()),E.cleanupWatchers=[],r.length)for(const U of r)E.cleanupWatchers.push(Ts($a.watcherStore,$a.hooked,f,U,T));T()}),n.__onDisconnected__(m=>{const f=m,C=`__publish_state_${o}`,E=f[C];E?.cleanupWatchers&&E.cleanupWatchers.forEach(T=>T()),f[c]=void 0})}}function Ta(t){return Ea(t)}const ru={nullish:t=>t==null,emptyString:t=>t==="",emptyObject:t=>typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.keys(t).length===0,emptyArray:t=>Array.isArray(t)&&t.length===0};function iu(t,e){return e.some(s=>ru[s](t))}function nu(t,e,s){if(!s.dispatchWhenUndefined&&t.slice(0,e).filter(r=>r!=null).length!==e)return!1;if(s.skip&&s.skip.length>0){for(let i=0;i<e;i++)if(iu(t[i],s.skip))return!1}return!0}function ou(...t){return La({},t)}function La(t,e){const s=e.map(r=>{const n=Ht(r);return{originalPath:r,dynamicDependencies:n,isDynamic:n.length>0}}),i={skipEmptyPlaceholder:t.skipEmptyPlaceholder};return function(r,n,o){Qs(r);const c=`__onAssign_state_${n}__`;let d;r.__onConnected__(b=>{const A=b[c]||(b[c]={cleanupWatchers:[],configurations:[]});A.cleanupWatchers.forEach(T=>T()),A.cleanupWatchers=[],A.configurations.forEach(T=>{T.unsubscribePublisher&&T.unsubscribePublisher()}),A.configurations=[];const m=[],f=[];for(let T=0;T<e.length;T++){const U=s[T],B=new Set,x=y=>{m[T]=y,nu(m,e.length,t)&&B.forEach(M=>M(...m))};f.push({publisher:null,onAssign:x,callbacks:B,unsubscribePublisher:null,pathConfig:U,index:T})}const C=(T,U)=>{if(T.unsubscribePublisher&&(T.unsubscribePublisher(),T.unsubscribePublisher=null),m[T.index]=null,T.publisher=null,!U)return;const B=Lt(U);B&&(B.onAssign(T.onAssign),T.unsubscribePublisher=()=>{B.offAssign(T.onAssign),T.publisher===B&&(T.publisher=null)},T.publisher=B)},E=()=>{for(const T of f)if(T.pathConfig.isDynamic){const U=Tt(b,T.pathConfig.originalPath,i);if(!U.ready){C(T,null);continue}C(T,U.path)}else C(T,T.pathConfig.originalPath)};for(const T of f)if(T.pathConfig.isDynamic)for(const U of T.pathConfig.dynamicDependencies){const B=Ts(Da.watcherStore,Da.hooked,b,U,()=>E());A.cleanupWatchers.push(B)}d=o.value.bind(b);for(const T of f)T.callbacks.add(d);E(),A.configurations=f}),r.__onDisconnected__(b=>{const A=b[c];A&&(A.cleanupWatchers.forEach(m=>m()),A.cleanupWatchers=[],A.configurations.forEach(m=>{m.unsubscribePublisher&&m.unsubscribePublisher(),m.callbacks.delete(d)}),A.configurations=[])})}}function au(t){return Object.prototype.toString.call(t)==="[object DataProviderKey]"}function lu(...t){const e=t[t.length-1],s=e!==void 0&&!au(e),i=s?e:{},n=(s?t.slice(0,-1):t).map(o=>o.path);return La({dispatchWhenUndefined:!i.waitForAllDefined,skip:i.skip,skipEmptyPlaceholder:i.skipEmptyPlaceholder},n)}function cu(){return function(t,e,s){let i=0;const r=s.value,n=t.constructor.prototype.disconnectedCallback;t.constructor.prototype.disconnectedCallback=function(){n?.apply(this),this.__removeAutoSubscribe__()};const o=t.connectedCallback;t.connectedCallback=function(){o?.call(this),this[e]()},s.value=function(...c){let d=new Set;const b=()=>{i++;const m=i;window.queueMicrotask(()=>{m===i&&this[e]()})};d.forEach(m=>{m.offAssign(b)}),No();const A=r.apply(this,c);return d=Fo()||new Set,d.forEach(m=>{m.onAssign(b,!1)}),this.__removeAutoSubscribe__=()=>{d.forEach(m=>{m.offAssign(b)})},A}}}function hu(t){return function(e){Qs(e);for(const s of t){const i=s.split(".");if(i.length===0)continue;const r=i.shift()||"";let n=ve.get(r);n=Yr.traverse(n,i),e.__onConnected__(o=>{n.startTemplateFilling(o)}),e.__onDisconnected__(()=>{})}}}function uu(t){const e=[];let s=t;for(;s;)s instanceof Element&&e.push(s),s=s.parentNode||(s.host??null);return e}function du(t){const e=t.parentNode||(t.getRootNode()?.host??null);return e instanceof Element?e:null}function Ia(t,e,s,i){const r=t,n=Ue.getAncestorAttributeValue(t,e);!i.assignNull&&n===null||Object.is(r[s],n)||(r[s]=n)}const ye=class ye{static subscribe(e,s,i,r={assignNull:!0}){const n={component:e,attributeName:s,propertyKey:i,syncOptions:r,watchedAncestors:[],parentForReparent:null};return ye.subscriptions.add(n),ye.bindSubscription(n),()=>{ye.unsubscribe(n)}}static bindSubscription(e){ye.unbindWatchers(e);const s=uu(e.component);e.watchedAncestors=s;for(const r of s)ye.addAttrSlot(r,e.attributeName,e);const i=du(e.component);e.parentForReparent=i,i&&ye.addParentSlot(i,e),ye.pendingRefresh.add(e),ye.scheduleRefresh()}static unbindWatchers(e){for(const s of e.watchedAncestors)ye.removeAttrSlot(s,e.attributeName,e);e.watchedAncestors=[],e.parentForReparent&&(ye.removeParentSlot(e.parentForReparent,e),e.parentForReparent=null)}static addAttrSlot(e,s,i){let r=ye.attrSlots.get(e);r||(r=new Map,ye.attrSlots.set(e,r));let n=r.get(s);if(!n){const o=Ue.scopeAttributeNames(s),c=new Set,d=new MutationObserver(()=>{for(const b of c)ye.subscriptions.has(b)&&ye.pendingRefresh.add(b);ye.scheduleRefresh()});d.observe(e,{attributes:!0,attributeFilter:o}),n={observer:d,subscriptions:c},r.set(s,n)}n.subscriptions.add(i)}static removeAttrSlot(e,s,i){const r=ye.attrSlots.get(e);if(!r)return;const n=r.get(s);n&&(n.subscriptions.delete(i),!(n.subscriptions.size>0)&&(n.observer.disconnect(),r.delete(s)))}static addParentSlot(e,s){let i=ye.parentSlots.get(e);if(!i){const n=new Map,o=new MutationObserver(c=>{const d=new Set;for(const b of c)b.removedNodes.forEach(A=>{A instanceof Element&&d.add(A)}),b.addedNodes.forEach(A=>{A instanceof Element&&d.add(A)});for(const b of d){const A=n.get(b);if(A)for(const m of[...A])ye.subscriptions.has(m)&&ye.bindSubscription(m)}});o.observe(e,{childList:!0}),i={observer:o,byComponent:n},ye.parentSlots.set(e,i)}let r=i.byComponent.get(s.component);r||(r=new Set,i.byComponent.set(s.component,r)),r.add(s)}static removeParentSlot(e,s){const i=ye.parentSlots.get(e);if(!i)return;const r=i.byComponent.get(s.component);r&&(r.delete(s),r.size===0&&i.byComponent.delete(s.component)),!(i.byComponent.size>0)&&(i.observer.disconnect(),ye.parentSlots.delete(e))}static unsubscribe(e){ye.subscriptions.has(e)&&(ye.unbindWatchers(e),ye.subscriptions.delete(e),ye.pendingRefresh.delete(e),ye.subscriptions.size===0&&ye.cancelScheduledRefresh())}static scheduleRefresh(){ye.pendingRefresh.size!==0&&ye.animationFrameId===null&&(ye.animationFrameId=requestAnimationFrame(()=>{ye.flushRefresh()}))}static cancelScheduledRefresh(){ye.animationFrameId!==null&&(cancelAnimationFrame(ye.animationFrameId),ye.animationFrameId=null),ye.pendingRefresh.clear()}static flushRefresh(){ye.animationFrameId=null;const e=Array.from(ye.pendingRefresh);ye.pendingRefresh.clear();for(const s of e)ye.subscriptions.has(s)&&Ia(s.component,s.attributeName,s.propertyKey,s.syncOptions)}};ye.subscriptions=new Set,ye.pendingRefresh=new Set,ye.animationFrameId=null,ye.attrSlots=new WeakMap,ye.parentSlots=new WeakMap;let Gn=ye;function Yn(t,e){const s=e?.dynamic??!1,i=s;return function(r,n){if(!r||(Qs(r),r.__onBeforeConnected__(c=>{Ia(c,t,n,{assignNull:i})}),!s))return;let o=null;r.__onConnected__(c=>{o=Gn.subscribe(c,t,n,{assignNull:!0})}),r.__onDisconnected__(()=>{o?.(),o=null})}}var pu=Object.defineProperty,fu=Object.getOwnPropertyDescriptor,Xs=(t,e,s,i)=>{for(var r=i>1?void 0:i?fu(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&pu(e,s,r),r};const Zn=t=>h(t),mu="sonic-icon";let vs=class extends Q{constructor(){super(...arguments),this.iconText="",this.name="",this.prefix="",this.library="",this.customIconLibraryPath=null,this.customIconDefaultPrefix=null}async updateIcon(){this.iconText=await Wn.default.get({name:this.name,prefix:this.prefix,library:this.library,customLibraryPath:this.customIconLibraryPath,customLibraryDefaultPrefix:this.customIconDefaultPrefix})}connectedCallback(){this.setAttribute("aria-hidden","true"),super.connectedCallback()}willUpdate(t){(t.has("name")||t.has("prefix")||t.has("library")||this.library==="custom"&&(t.has("customIconLibraryPath")||t.has("customIconDefaultPrefix")))&&this.updateIcon(),super.willUpdate(t)}render(){return this.iconText?this.iconText:ee}};vs.styles=Z`
|
|
547
547
|
:host {
|
|
548
548
|
line-height: 0.1em;
|
|
549
549
|
width: fit-content;
|
|
@@ -1138,7 +1138,7 @@
|
|
|
1138
1138
|
${i.useSlot?Jn(i.text):ee}
|
|
1139
1139
|
</sonic-toast-item>
|
|
1140
1140
|
`)}
|
|
1141
|
-
</div>`:ee}static removeAll(){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeAllToasts"},"*");return}const e=Se.getInstance();e&&(e.toasts=e.toasts.filter(s=>s.ghost))}static removeItemsByStatus(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeItemsByStatus",status:e},"*");return}const s=Se.getInstance();s&&(s.toasts=s.toasts.filter(i=>i.status!==e))}static removeItemById(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeItemById",id:e},"*");return}const s=Se.getInstance();s&&(s.toasts=s.toasts.filter(i=>i.id!==e))}static removeTemporaryItems(){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeTemporaryItems"},"*");return}const e=Se.getInstance();e&&(e.toasts=e.toasts.filter(s=>s.preserve))}static getInstance(){return Se.instance||(Se.instance=document.createElement("sonic-toast"),at.getPopContainer().prepend(Se.instance)),Se.instance}static add(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"addToast",toast:e},"*");return}const s=Se.getInstance(),i=e.id??new Date().valueOf(),r=new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>"),n=typeof e.text=="string"&&r.test(e.text),o={id:i,text:e.text,label:Qa(e),status:e.status,preserve:n?!0:e.preserve,ghost:e.ghost,dismissForever:e.dismissForever,styleSheet:e.styleSheet,useSlot:e.useSlot};if(e.dismissForever&&e.id&&Ua(e.id))return null;if(s?.toasts.length){const c={...o};for(const d of s.toasts){const
|
|
1141
|
+
</div>`:ee}static removeAll(){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeAllToasts"},"*");return}const e=Se.getInstance();e&&(e.toasts=e.toasts.filter(s=>s.ghost))}static removeItemsByStatus(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeItemsByStatus",status:e},"*");return}const s=Se.getInstance();s&&(s.toasts=s.toasts.filter(i=>i.status!==e))}static removeItemById(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeItemById",id:e},"*");return}const s=Se.getInstance();s&&(s.toasts=s.toasts.filter(i=>i.id!==e))}static removeTemporaryItems(){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeTemporaryItems"},"*");return}const e=Se.getInstance();e&&(e.toasts=e.toasts.filter(s=>s.preserve))}static getInstance(){return Se.instance||(Se.instance=document.createElement("sonic-toast"),at.getPopContainer().prepend(Se.instance)),Se.instance}static add(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"addToast",toast:e},"*");return}const s=Se.getInstance(),i=e.id??new Date().valueOf(),r=new RegExp("</a>|</.*?button>|</.*?input>|</.*?textarea>|</.*?select>"),n=typeof e.text=="string"&&r.test(e.text),o={id:i,text:e.text,label:Qa(e),status:e.status,preserve:n?!0:e.preserve,ghost:e.ghost,dismissForever:e.dismissForever,styleSheet:e.styleSheet,useSlot:e.useSlot};if(e.dismissForever&&e.id&&Ua(e.id))return null;if(s?.toasts.length){const c={...o};for(const d of s.toasts){const b={...d};if(c.id=b.id=0,ht.shallowEqual(c,b))return null}}return s&&(s.toasts=[...s.toasts,o]),o}static handleExistingToastDelegation(){if(!this.delegateToasts)return;const e=Se.getInstance();window.parent.postMessage({type:"addToasts",toasts:e.toasts},"*"),e.toasts=[]}static removeItem(e){if(Se.delegateToasts){Se.handleExistingToastDelegation(),window.parent.postMessage({type:"removeToast",toast:e},"*");return}const s=Se.getInstance();s&&s.removeItem(e)}removeItem(e){e&&(this.toasts=this.toasts.filter(s=>(s={...s},delete s.id,!ht.shallowEqual(s,e,!1))))}};Se.delegateToasts=!1,Za([h({type:Array})],Se.prototype,"toasts",2),Se=Za([X(Lu)],Se),typeof window<"u"&&(window[bi+"Toast"]=window[bi+"Toast"]||Se);function Iu(){const t=s=>{s.data.type=="querySonicToastAvailability"&&s.source.postMessage({type:"sonicToastAvailable"},"*"),s.data.type=="removeItemsByStatus"&&Se.removeItemsByStatus(s.data.status),s.data.type=="removeItemById"&&Se.removeItemById(s.data.id),s.data.type=="removeTemporaryItems"&&Se.removeTemporaryItems(),s.data.type=="sonicToastAvailable"&&(Se.delegateToasts=!0,Se.handleExistingToastDelegation()),s.data.type=="addToasts"&&(Se.getInstance().toasts=[...Se.getInstance().toasts,...s.data.toasts]),s.data.type=="removeAllToasts"&&Se.removeAll(),s.data.type=="removeToast"&&Se.removeItem(s.data.toast),s.data.type=="addToast"&&Se.add(s.data.toast)},e=window.parent!=window;if(window.addEventListener("message",t,!1),e&&window.parent.postMessage({type:"querySonicToastAvailability"},"*"),!e)for(const s of document.querySelectorAll("iframe"))s.contentWindow?.postMessage({type:"sonicToastAvailable"},"*")}Iu();var Mu=Object.defineProperty,Nu=Object.getOwnPropertyDescriptor,ti=(t,e,s,i)=>{for(var r=i>1?void 0:i?Nu(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Mu(e,s,r),r};const Fu=new Set,Ru=new Set,ju=t=>{for(const e of Ru)e(t)},eo=new Set;let to=0;bn(async()=>{to++;const t=to,e=Array.from(eo);for(;e.length>0;){if(t!=to)return;const s=e.splice(0,4);await Promise.all(s.map(i=>i.refetch()))}});const so=(t,e)=>{class s extends t{constructor(...r){super(),this.api=null,this.key="",this.isFirstLoad=!0,this.isLoading=!1,this.iObserver=null,this.isFetchEnabled=!0,this.fetchedData=null,this._endPoint="",this.noErrorsRecordings=!1,this.requestId=0,this.refetchEveryMs=0,this._isFetching=!1,this._mustRefetch=!1,this.dataProvider=""}get props(){return super.props}set props(r){super.props=r}set endPoint(r){this._endPoint=r,this.isConnected&&this._fetchData()}get endPoint(){return this._endPoint}handleStartFetching(){return this._isFetching?(this._mustRefetch=!0,"fetching"):(this._isFetching=!0,"okToFetch")}handleEndFetching(){this._isFetching=!1,this._mustRefetch&&(this._mustRefetch=!1,this._fetchData())}refetch(){return this._fetchData()}async _fetchData(){if(this.requestUpdate(),!this.isFetchEnabled||(this.api=new Os(this.getApiConfiguration()),!this.api)||(this.dispatchEvent(new CustomEvent("loading",{detail:this})),this.getAttribute("localStorage")==="enabled"&&await ve.getInstance().isLocalStrorageReady,!this.isConnected))return;const r=ve.getInstance().get(this.getAncestorAttributeValue("headersDataProvider")).get();if(this.isLoading=!0,ht.isObject(this.props)&&Object.keys(this.props||{}).length>0&&this.isFirstLoad&&window.requestAnimationFrame(()=>{this.dispatchEvent(new CustomEvent("load",{detail:this})),this.isFirstLoad=!1,this.isLoading=!1}),this.handleStartFetching()==="fetching")return;let o=null;try{o=await this.api.get(this.endPoint||this.dataProvider||"",r)}catch{}if(this.handleEndFetching(),this.fetchedData=o,this.api.lastResult&&!this.api.lastResult.ok&&(this.noErrorsRecordings||Fu.add(this),ju(this.api.lastResult)),!!this.isConnected){if(o)o._sonic_http_response_&&!o._sonic_http_response_.ok&&Object.keys(o).length===1&&Se.add({text:"Network Error",status:"error"});else{this.isLoading=!1,this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout(()=>this._fetchData(),this.refetchEveryMs));return}if(this.key){const c=o._sonic_http_response_,d=this.key.split(".");o=ht.traverse(o,d,this.hasAttribute("preserveOtherKeys")),o&&ht.isObject(o)&&c&&(o._sonic_http_response_=c)}this.props=o,this.dispatchEvent(new CustomEvent("load",{detail:this})),this.isFirstLoad=!1,this.isLoading=!1,this.refetchEveryMs&&this.isConnected&&(this.refetchTimeOutId=setTimeout(()=>this._fetchData(),this.refetchEveryMs))}}disconnectedCallback(){super.disconnectedCallback(),eo.delete(this),this.publisher?.offInvalidate(this.onInvalidate),clearTimeout(this.refetchTimeOutId),this.isFirstLoad=!1}connectedCallback(){this.lazyLoad=this.lazyLoad!==void 0?this.lazyLoad:this.hasAttribute("lazyload"),eo.add(this),super.connectedCallback(),this.isFetchEnabled&&(this.key=this.key!=""?this.key:this.getAttribute("key"),this.props&&this.publisher.set(this.props),this.onInvalidate=()=>this._fetchData(),this.publisher?.onInvalidate(this.onInvalidate),this.lazyLoad?this.handleLazyLoad():this._fetchData())}handleLazyLoad(){if(!this.lazyLoad)return;const r=parseFloat(this.getAttribute("lazyBoundsRatio")||"1"),n={root:null,rootMargin:Math.max(window.innerWidth*r,window.innerHeight*r)+"px",threshold:.9};this.iObserver=new IntersectionObserver(d=>this.onIntersection(d),n);let c=[...(this.shadowRoot?this.shadowRoot:this).children].filter(d=>d.nodeName.toLowerCase()!="style")[0];if(c?.nodeName.toLocaleLowerCase()=="slot"&&(c=[...c.children].filter(d=>d.nodeName.toLowerCase()!="style")[0]),!c||c.nodeName.toLocaleLowerCase()=="template"){c=document.createElement("div");const d=c.style;d.pointerEvents="none",d.width="1px",d.height="1px",this.lazyLoadPlaceHolder=c,this.appendChild(c)}c?this.iObserver.observe(c):this.isFirstLoad&&this._fetchData()}onIntersection(r){for(const n of r)if(n.isIntersecting&&this.isFirstLoad){this._fetchData(),this.lazyLoadPlaceHolder?.remove(),this.lazyLoadPlaceHolder=void 0,this.iObserver?.disconnect();break}}}return ti([h()],s.prototype,"noErrorsRecordings",2),ti([h()],s.prototype,"props",1),ti([h({type:String})],s.prototype,"endPoint",1),ti([h()],s.prototype,"requestId",2),ti([h({type:Number})],s.prototype,"refetchEveryMs",2),s};var Uu=Object.defineProperty,zu=Object.getOwnPropertyDescriptor,er=(t,e,s,i)=>{for(var r=i>1?void 0:i?zu(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Uu(e,s,r),r};const Wi=t=>{class e extends t{constructor(...i){super(),this.forceAutoFill=!1,this._type="text",this.status="default"}validateFormElement(){const i=this.shadowRoot?.querySelector("input");if(!i||i.checkValidity())return;const r=this.getFormPublisher();r&&(r.isFormValid=!1),i.reportValidity()}set type(i){this.hasAttribute("type")&&!this.forceAutoFill&&(i=this.getAttribute("type")),this._type=i,this.requestUpdate()}get type(){return this._type}get description(){return this._description}set description(i){this.hasAttribute("description")&&!this.forceAutoFill&&(i=this.getAttribute("description")),this._description=i,this.requestUpdate()}get label(){return this._label}set label(i){this.hasAttribute("label")&&!this.forceAutoFill&&(i=this.getAttribute("label")),this._label=i,this.requestUpdate()}}return er([h()],e.prototype,"forceAutoFill",2),er([h({type:String})],e.prototype,"type",1),er([h()],e.prototype,"description",1),er([h()],e.prototype,"label",1),er([h({type:String,reflect:!0})],e.prototype,"status",2),er([h({type:Number})],e.prototype,"tabindex",2),er([h({type:String})],e.prototype,"autocomplete",2),e},Xa=so,qu=Bn,el=vr,tl=Wi,tr=Ot,ro=Wr;window["concorde-mixins"]=window["concorde-mixins"]||{},window["concorde-mixins"]={Fetcher:Xa,FormCheckable:qu,FormElement:el,FormInput:tl,Subscriber:tr,TemplatesContainer:ro};/**
|
|
1142
1142
|
* @license
|
|
1143
1143
|
* Copyright 2020 Google LLC
|
|
1144
1144
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
@@ -1328,8 +1328,8 @@
|
|
|
1328
1328
|
dataProvider="${this.dataProvider}/list-item/${s}"
|
|
1329
1329
|
>
|
|
1330
1330
|
${this.items(t,e)}
|
|
1331
|
-
</sonic-subscriber>`:null}renderContent(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props=="string")return this.renderNoResultState();if(!ht.isObject(this.props))return R`<div></div>`;const i=this.formatProps();if((i?.length||0)==0){if(this.noItems)return this.noItems();if(this.templateParts["no-items"]=this.templateParts["no-items"]||this.templateParts["no-item"],this.templateParts["no-items"])return ns(this.templateParts["no-items"])}const r=this.templateList.length;let n=-1;const o=this.hasAttribute("extractValues"),c=this.renderSeparator(),d=i?.length||0,
|
|
1332
|
-
${
|
|
1331
|
+
</sonic-subscriber>`:null}renderContent(){if(this.isLoading&&!Array.isArray(this.props))return this.renderLoadingState();if(typeof this.props=="string")return this.renderNoResultState();if(!ht.isObject(this.props))return R`<div></div>`;const i=this.formatProps();if((i?.length||0)==0){if(this.noItems)return this.noItems();if(this.templateParts["no-items"]=this.templateParts["no-items"]||this.templateParts["no-item"],this.templateParts["no-items"])return ns(this.templateParts["no-items"])}const r=this.templateList.length;let n=-1;const o=this.hasAttribute("extractValues"),c=this.renderSeparator(),d=i?.length||0,b=i?.slice(this.offset,this.offset+this.limit);return R`
|
|
1332
|
+
${b?.map((A,m)=>{if(A==null)return ee;let f=m,C=null;if(typeof A=="object"&&!Array.isArray(A)){o&&(f=A?.key);const y=A[this.templateKey];y&&typeof y=="string"&&(C=this.templateParts[y])}if(f=="_sonic_http_response_"||typeof f!="string"&&typeof f!="number")return ee;const E=m>=d-1,T=m%2,U=this.publisher[f],B={key:f,even:T==0,odd:T==1,onlyChild:d==1,firstChild:m==0,lastChild:E};U._key_=f+"",U._metadata_={...U._metadata_.get(),...B};const x=this.handleProgrammaticTemplates(A,B,f);return x?R`${x}${E?ee:c}`:(n++,C&&(n=-1),R`
|
|
1333
1333
|
<sonic-subscriber
|
|
1334
1334
|
?debug=${this.defferedDebug===!0}
|
|
1335
1335
|
.bindPublisher=${function(){return U}}
|
|
@@ -1344,7 +1344,7 @@
|
|
|
1344
1344
|
* @license
|
|
1345
1345
|
* Copyright 2021 Google LLC
|
|
1346
1346
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1347
|
-
*/function*ol(t,e){if(t!==void 0){let s=0;for(const i of t)yield e(i,s++)}}var nd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,pt=(t,e,s,i)=>{for(var r=i>1?void 0:i?od(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&nd(e,s,r),r};const ad="sonic-queue";let rt=class extends Ot(Q){constructor(){super(...arguments),this.templates=null,this.items=null,this.noItems=null,this.skeleton=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.cache="default",this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader="inline",this.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{const e=this.dataProviderExpression.split("?");e.shift();const s=new URLSearchParams(e.join("?")),i=this.filterPublisher?.get(),r=this.filteredFields.split(" ");for(const o in i){let c=i[o];Array.isArray(c)&&(c=c.filter(d=>d!==null)),!(this.filteredFields&&r.includes(o)||c==null||c.toString()==="")&&s.set(o,i[o].toString())}const n=s.toString();if(!(n==this.searchHash&&!this.isFirstRequest)){this.searchHash=n,Ph(this.resolveScrollRoot(),{x:0,y:0});for(const o of this.listDataProviders)ve.getInstance().delete(o);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{const o=this.resultCount;this.props=null,this.requestId++,this.resultCount=o,await ve.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.scrollRoot=null,this.scrollSyncActive=!1,this.mutationObserver=null,this.restoreGeneration=0,this.dataProviderExpression="",this.invalidateOnPageShow=!1,this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1}disconnectedCallback(){for(const t of this.listDataProviders)ve.getInstance().delete(t),this.listDataProviders=[];this.filterPublisher?.offInternalMutation(this.updateFilteredContent),this.props=null,this.limit=5,this.offset=0,this.resultCount=0,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.nextHadEvent=!1,this.teardownScrollSync(),this.publisher.set({}),super.disconnectedCallback()}async connectedCallback(){this.instanceId=rt.instanceCounter++,this.localStorage=this.getAttribute("localStorage")||this.localStorage,this.filterTimeoutMs=parseInt(this.getAttribute("filterTimeoutMs")||"400"),this.removeAttribute("localStorage"),this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider=this.dataProviderExpression||"sonic-queue-"+this.instanceId+"-"+Math.random().toString(36).substring(7)),this.dataProviderExpression||(this.dataProviderExpression=gs.getAncestorAttributeValue(this.parentElement,"dataProvider")||""),this.ensureScrollSync(),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute("key"),await ve.getInstance().isLocalStrorageReady,this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.configFilter()}configFilter(){const t=this.getAncestorAttributeValue("dataFilterProvider");if(!t){this.next();return}this.filterPublisher=ve.getInstance().get(t),this.filterPublisher?.onInternalMutation(this.updateFilteredContent)}resolveScrollRoot(){const t=gs.getScrollingAncestor(this);return!t||t===document.documentElement||t===document.body?window:t}isSafari(){return ms()}ensureScrollSync(){if(!ms()||!this.isConnected)return;const t=this.resolveScrollRoot();this.scrollRoot=t,Js(t),!this.scrollSyncActive&&(this.scrollSyncActive=!0,this.mutationObserver=new MutationObserver(()=>{this.scheduleRestoreAfterChildren()}),this.mutationObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}teardownScrollSync(){this.restoreGeneration++,this.mutationObserver?.disconnect(),this.mutationObserver=null,this.scrollSyncActive=!1,this.scrollRoot=null}scheduleRestoreAfterChildren(){if(!ms()||!this.isConnected)return;const t=++this.restoreGeneration;(async()=>{if(await this.updateComplete,t!==this.restoreGeneration||!this.isConnected)return;const e=Array.from(this.querySelectorAll("sonic-list"));if(e.length&&await Promise.all(e.map(i=>i.updateComplete)),t!==this.restoreGeneration||!this.isConnected||(await new Promise(i=>requestAnimationFrame(()=>i())),await new Promise(i=>requestAnimationFrame(()=>i())),t!==this.restoreGeneration||!this.isConnected))return;const s=this.scrollRoot??this.resolveScrollRoot();Js(s),Fn(s)})()}updated(t){if(ms()){this.ensureScrollSync();const e=this.scrollRoot??this.resolveScrollRoot();Fn(e),this.scheduleRestoreAfterChildren()}super.updated(t)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(t){let e=this.offset;const i=new Date().getTime()-this.lastRequestTime;if(!this.nextHadEvent&&t&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!t,t){if(this.publisher.lastFetchedData=t.detail.fetchedData,t.detail.requestId<this.requestId)return;if(this.resultCount+=t.detail.props?.length||0,!t.detail.isFirstLoad||!t.detail.props?.length||this.dataProviderExpression.indexOf("$offset")==-1){this.publisher.resultCount=this.resultCount;return}}if(Array.isArray(this.props)){const m=this.props,f=m[m.length-1];e=parseInt(f.offset.toString())+parseInt(f.limit.toString())}else{const m=[];m.resultCount=this.resultCount,m.lastFetchedData=t?.detail.fetchedData||{},this.props=m}i>0&&t&&!this.localStorage&&(this.limit=Math.round(this.limit/i*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let r=this.dataProviderExpression.replace("$offset",e+"").replace("$limit",this.limit+"");const n=r.split("?");let o=n.shift();const c=new URLSearchParams(n.join("?")),d=this.filterPublisher?.get(),
|
|
1347
|
+
*/function*ol(t,e){if(t!==void 0){let s=0;for(const i of t)yield e(i,s++)}}var nd=Object.defineProperty,od=Object.getOwnPropertyDescriptor,pt=(t,e,s,i)=>{for(var r=i>1?void 0:i?od(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&nd(e,s,r),r};const ad="sonic-queue";let rt=class extends Ot(Q){constructor(){super(...arguments),this.templates=null,this.items=null,this.noItems=null,this.skeleton=null,this.lastRequestTime=0,this.key="",this.itemPropertyMap=null,this.cache="default",this.targetRequestDuration=500,this.limit=5,this.lazyBoundsRatio=1,this.offset=0,this.resultCount=0,this.noLazyload=!1,this.loader="inline",this.filteredFields="",this.instanceId=0,this.localStorage="disabled",this.filterPublisher=null,this.filterTimeoutMs=400,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.updateFilteredContent=()=>{const e=this.dataProviderExpression.split("?");e.shift();const s=new URLSearchParams(e.join("?")),i=this.filterPublisher?.get(),r=this.filteredFields.split(" ");for(const o in i){let c=i[o];Array.isArray(c)&&(c=c.filter(d=>d!==null)),!(this.filteredFields&&r.includes(o)||c==null||c.toString()==="")&&s.set(o,i[o].toString())}const n=s.toString();if(!(n==this.searchHash&&!this.isFirstRequest)){this.searchHash=n,Ph(this.resolveScrollRoot(),{x:0,y:0});for(const o of this.listDataProviders)ve.getInstance().delete(o);this.listDataProviders=[],clearTimeout(this.filterTimeoutId),this.filterTimeoutId=setTimeout(async()=>{const o=this.resultCount;this.props=null,this.requestId++,this.resultCount=o,await ve.getInstance().isLocalStrorageReady,window.requestAnimationFrame(()=>this.next())},this.isFirstRequest?0:this.filterTimeoutMs),this.isFirstRequest=!1}},this.scrollRoot=null,this.scrollSyncActive=!1,this.mutationObserver=null,this.restoreGeneration=0,this.dataProviderExpression="",this.invalidateOnPageShow=!1,this.idKey="id",this.listDataProviders=[],this.nextHadEvent=!1}disconnectedCallback(){for(const t of this.listDataProviders)ve.getInstance().delete(t),this.listDataProviders=[];this.filterPublisher?.offInternalMutation(this.updateFilteredContent),this.props=null,this.limit=5,this.offset=0,this.resultCount=0,this.searchHash="",this.requestId=0,this.isFirstRequest=!0,this.nextHadEvent=!1,this.teardownScrollSync(),this.publisher.set({}),super.disconnectedCallback()}async connectedCallback(){this.instanceId=rt.instanceCounter++,this.localStorage=this.getAttribute("localStorage")||this.localStorage,this.filterTimeoutMs=parseInt(this.getAttribute("filterTimeoutMs")||"400"),this.removeAttribute("localStorage"),this.noShadowDom="",this.defferedDebug=this.hasAttribute("debug")||null,this.dataProvider||(this.dataProvider=this.dataProviderExpression||"sonic-queue-"+this.instanceId+"-"+Math.random().toString(36).substring(7)),this.dataProviderExpression||(this.dataProviderExpression=gs.getAncestorAttributeValue(this.parentElement,"dataProvider")||""),this.ensureScrollSync(),super.connectedCallback(),this.publisher.set({}),this.key=this.getAttribute("key"),await ve.getInstance().isLocalStrorageReady,this.templates||(this.templates=Array.from(this.querySelectorAll("template"))),this.lastRequestTime=new Date().getTime(),this.configFilter()}configFilter(){const t=this.getAncestorAttributeValue("dataFilterProvider");if(!t){this.next();return}this.filterPublisher=ve.getInstance().get(t),this.filterPublisher?.onInternalMutation(this.updateFilteredContent)}resolveScrollRoot(){const t=gs.getScrollingAncestor(this);return!t||t===document.documentElement||t===document.body?window:t}isSafari(){return ms()}ensureScrollSync(){if(!ms()||!this.isConnected)return;const t=this.resolveScrollRoot();this.scrollRoot=t,Js(t),!this.scrollSyncActive&&(this.scrollSyncActive=!0,this.mutationObserver=new MutationObserver(()=>{this.scheduleRestoreAfterChildren()}),this.mutationObserver.observe(this,{childList:!0,subtree:!0,characterData:!0}))}teardownScrollSync(){this.restoreGeneration++,this.mutationObserver?.disconnect(),this.mutationObserver=null,this.scrollSyncActive=!1,this.scrollRoot=null}scheduleRestoreAfterChildren(){if(!ms()||!this.isConnected)return;const t=++this.restoreGeneration;(async()=>{if(await this.updateComplete,t!==this.restoreGeneration||!this.isConnected)return;const e=Array.from(this.querySelectorAll("sonic-list"));if(e.length&&await Promise.all(e.map(i=>i.updateComplete)),t!==this.restoreGeneration||!this.isConnected||(await new Promise(i=>requestAnimationFrame(()=>i())),await new Promise(i=>requestAnimationFrame(()=>i())),t!==this.restoreGeneration||!this.isConnected))return;const s=this.scrollRoot??this.resolveScrollRoot();Js(s),Fn(s)})()}updated(t){if(ms()){this.ensureScrollSync();const e=this.scrollRoot??this.resolveScrollRoot();Fn(e),this.scheduleRestoreAfterChildren()}super.updated(t)}resetDuration(){this.lastRequestTime=new Date().getTime()}next(t){let e=this.offset;const i=new Date().getTime()-this.lastRequestTime;if(!this.nextHadEvent&&t&&(this.publisher.resultCount=0,this.resultCount=0),this.nextHadEvent=!!t,t){if(this.publisher.lastFetchedData=t.detail.fetchedData,t.detail.requestId<this.requestId)return;if(this.resultCount+=t.detail.props?.length||0,!t.detail.isFirstLoad||!t.detail.props?.length||this.dataProviderExpression.indexOf("$offset")==-1){this.publisher.resultCount=this.resultCount;return}}if(Array.isArray(this.props)){const m=this.props,f=m[m.length-1];e=parseInt(f.offset.toString())+parseInt(f.limit.toString())}else{const m=[];m.resultCount=this.resultCount,m.lastFetchedData=t?.detail.fetchedData||{},this.props=m}i>0&&t&&!this.localStorage&&(this.limit=Math.round(this.limit/i*this.targetRequestDuration)),this.limit<1&&(this.limit=1),this.limit>15&&(this.limit=15);let r=this.dataProviderExpression.replace("$offset",e+"").replace("$limit",this.limit+"");const n=r.split("?");let o=n.shift();const c=new URLSearchParams(n.join("?")),d=this.filterPublisher?.get(),b=this.filteredFields.split(" ");for(const m in d)this.filteredFields&&b.includes(m)||d[m]==null||d[m]==""||c.set(m,d[m]);this.searchHash||(this.searchHash=c.toString()),o=o+"?"+c.toString(),r=r+"_item_from_queue_"+this.instanceId,this.listDataProviders.push(r);const A=[...this.props,{id:c.toString()+"/"+this.props.length,dataProvider:r,endPoint:o,offset:e,limit:this.limit}];A.resultCount=this.resultCount,A.lastFetchedData=t?.detail.fetchedData||{},this.props=A,this.lastRequestTime=new Date().getTime()}render(){if(this.isSafari()&&(this.scrollRoot=this.resolveScrollRoot(),this.ensureScrollSync()),!Array.isArray(this.props))return ee;let t=!this.noLazyload;return this.props.length==1&&(t=!1),this.style.display="block",R`
|
|
1348
1348
|
${ol(this.props,(e,s)=>{const i=s==0?this.templates:this.templates?.filter(r=>r.getAttribute("data-value")!="no-item");return R`
|
|
1349
1349
|
<sonic-list
|
|
1350
1350
|
fetch
|
|
@@ -1371,7 +1371,7 @@
|
|
|
1371
1371
|
>
|
|
1372
1372
|
</sonic-list>
|
|
1373
1373
|
`})}
|
|
1374
|
-
`}};rt.instanceCounter=0,pt([h({type:Array})],rt.prototype,"templates",2),pt([h({type:Function,attribute:!1})],rt.prototype,"items",2),pt([h({type:Function,attribute:!1})],rt.prototype,"noItems",2),pt([h({type:Function,attribute:!1})],rt.prototype,"skeleton",2),pt([h({type:Object})],rt.prototype,"itemPropertyMap",2),pt([h()],rt.prototype,"cache",2),pt([h()],rt.prototype,"targetRequestDuration",2),pt([h()],rt.prototype,"limit",2),pt([h()],rt.prototype,"lazyBoundsRatio",2),pt([h()],rt.prototype,"offset",2),pt([h()],rt.prototype,"resultCount",2),pt([h({type:Boolean})],rt.prototype,"noLazyload",2),pt([h({type:String})],rt.prototype,"loader",2),pt([h()],rt.prototype,"filteredFields",2),pt([h({type:String})],rt.prototype,"dataProviderExpression",2),pt([h({type:Boolean})],rt.prototype,"invalidateOnPageShow",2),pt([h({type:String})],rt.prototype,"idKey",2),rt=pt([X(ad)],rt);var ld=Object.defineProperty,cd=Object.getOwnPropertyDescriptor,Sr=(t,e,s,i)=>{for(var r=i>1?void 0:i?cd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&ld(e,s,r),r};const hd="sonic-submit";let Is=class extends Ot(Q){constructor(){super(...arguments),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.name="",this.value="",this.api=null,this.clickTimeStamp=0,this.submit=async t=>{if(this.disabled||t instanceof KeyboardEvent&&t.key!=="Enter")return;t instanceof MouseEvent&&t.stopPropagation();const e=ve.getInstance().get(this.getAncestorAttributeValue("formDataProvider"));if(e.isFormValid.set(!0),e.invalidateForm(),!e.isFormValid.get())return;if(this.disabled=!0,lt.show(),e.isFormValid,this.hasAttribute("native")){this.submitNativeForm(),lt.hide(),this.disabled=!1;return}const i=this.getAttribute("method")?.toLocaleLowerCase()||"post",r=this.hasAttribute("sendAsFormData"),n=e.get();delete n.isFormValid;const o=this.getAncestorAttributeValue("headersDataProvider"),c=o?ve.getInstance().get(o):null;let d={};c&&(d=c.get());let
|
|
1374
|
+
`}};rt.instanceCounter=0,pt([h({type:Array})],rt.prototype,"templates",2),pt([h({type:Function,attribute:!1})],rt.prototype,"items",2),pt([h({type:Function,attribute:!1})],rt.prototype,"noItems",2),pt([h({type:Function,attribute:!1})],rt.prototype,"skeleton",2),pt([h({type:Object})],rt.prototype,"itemPropertyMap",2),pt([h()],rt.prototype,"cache",2),pt([h()],rt.prototype,"targetRequestDuration",2),pt([h()],rt.prototype,"limit",2),pt([h()],rt.prototype,"lazyBoundsRatio",2),pt([h()],rt.prototype,"offset",2),pt([h()],rt.prototype,"resultCount",2),pt([h({type:Boolean})],rt.prototype,"noLazyload",2),pt([h({type:String})],rt.prototype,"loader",2),pt([h()],rt.prototype,"filteredFields",2),pt([h({type:String})],rt.prototype,"dataProviderExpression",2),pt([h({type:Boolean})],rt.prototype,"invalidateOnPageShow",2),pt([h({type:String})],rt.prototype,"idKey",2),rt=pt([X(ad)],rt);var ld=Object.defineProperty,cd=Object.getOwnPropertyDescriptor,Sr=(t,e,s,i)=>{for(var r=i>1?void 0:i?cd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&ld(e,s,r),r};const hd="sonic-submit";let Is=class extends Ot(Q){constructor(){super(...arguments),this.submitResultKey=null,this.disabled=!1,this.endPoint=null,this.name="",this.value="",this.api=null,this.clickTimeStamp=0,this.submit=async t=>{if(this.disabled||t instanceof KeyboardEvent&&t.key!=="Enter")return;t instanceof MouseEvent&&t.stopPropagation();const e=ve.getInstance().get(this.getAncestorAttributeValue("formDataProvider"));if(e.isFormValid.set(!0),e.invalidateForm(),!e.isFormValid.get())return;if(this.disabled=!0,lt.show(),e.isFormValid,this.hasAttribute("native")){this.submitNativeForm(),lt.hide(),this.disabled=!1;return}const i=this.getAttribute("method")?.toLocaleLowerCase()||"post",r=this.hasAttribute("sendAsFormData"),n=e.get();delete n.isFormValid;const o=this.getAncestorAttributeValue("headersDataProvider"),c=o?ve.getInstance().get(o):null;let d={};c&&(d=c.get());let b=null;const A=this.getAncestorAttributeValue("dataProvider"),m=this.endPoint||A,f=async()=>{const E={...n};if(delete E.needsCaptchaValidation,delete d.needsCaptchaValidation,r)b=await this.api?.submitFormData(m,E,i,d);else switch(i){case"put":b=await this.api?.put(m,E,d);break;case"patch":b=await this.api?.patch(m,E,d);break;case"delete":b=await this.api?.delete(m,E,d);break;case"get":const y=new URLSearchParams;if(E)for(const k in E)y.append(k,E[k]);const M="?"+y.toString();b=await this.api?.get(m+M,d);break;default:b=await this.api?.post(m,E,d);break}lt.hide(),b?b._sonic_http_response_&&!b._sonic_http_response_.ok&&Object.keys(b).length===1&&(b.messages=[{content:"Network Error",status:"error"}]):b={messages:[{content:"Network Error",status:"error"}]};const T=this.getAncestorAttributeValue("clearedDataOnSuccess");T&&T.split(" ").forEach(y=>ve.get(y).set({}));const U=this.hasAttribute("usernameKey")?this.getAttribute("usernameKey"):"username",B=this.hasAttribute("passwordKey")?this.getAttribute("passwordKey"):"password";this.api?.lastResult?.ok&&E[U]&&E[B]&&this.saveCredentials(E[U],E[B]),this.submitResultKey&&(b=ht.traverse(b,this.submitResultKey.split("."),!0));const x=this.getAncestorAttributeValue("submitResultDataProvider");x&&ve.get(x).set(b),this.disabled=!1,this.dispatchEvent(new CustomEvent("submit",{detail:b,bubbles:!0,composed:!0}))},C=c?.needsCaptchaValidation.get()?c:e.needsCaptchaValidation.get()?e:null;if(C){C.captchaToken.set("request_token");const E=T=>{T!="request_token"?(f(),C.captchaToken.offAssign(E)):(lt.hide(),this.disabled=!1)};C.captchaToken.onAssign(E)}else f()}}connectedCallback(){this.hasAttribute("onClick")&&this.addEventListener("click",this.submit),this.hasAttribute("onEnterKey")&&this.addEventListener("keydown",this.submit),super.connectedCallback(),this.api=new Os(this.getApiConfiguration())}submitNativeForm(){const t=gs.getClosestForm(this);if(!t)return;const e=this.getAncestorAttributeValue("formDataProvider"),s={...ve.get(e).get()};delete s.needsCaptchaValidation;for(const r in s){if(r=="isFormValid")continue;let n=t.querySelector('input[name="'+r+'"], select[name="'+r+'"], textarea[name="'+r+'"]');n||(n=document.createElement("input"),n.type="hidden",n.name=r,t.appendChild(n));let o=s[r];Array.isArray(o)&&(o=o.join(",")),n.type==="checkbox"||n.type==="radio"?o&&(n.checked=!0):n.value=o}const i=document.createElement("input");i.name=this.name,i.style.display="none",i.value=this.value,i.type="submit",t.appendChild(i),i&&i.click()}async saveCredentials(t,e){if("PasswordCredential"in window){const s=new window.PasswordCredential({id:t,password:e});await navigator.credentials.store(s)}}render(){return R`<div ?data-disabled=${this.disabled}><slot></slot></div>`}};Is.styles=Z`
|
|
1375
1375
|
[data-disabled] {
|
|
1376
1376
|
opacity: 0.3;
|
|
1377
1377
|
pointer-events: none;
|
|
@@ -1382,16 +1382,16 @@
|
|
|
1382
1382
|
dataProvider="${i}"
|
|
1383
1383
|
>
|
|
1384
1384
|
${ns(s)}
|
|
1385
|
-
</div>`}return ns(s)})}`}};si([h({type:String})],Pr.prototype,"fallBackRoute",2),si([h({type:Object,attribute:!1})],Pr.prototype,"routes",2),si([h({type:String})],Pr.prototype,"basePath",2),si([h()],Pr.prototype,"location",1),Pr=si([X(pd)],Pr);var fd=Object.getOwnPropertyDescriptor,md=(t,e,s,i)=>{for(var r=i>1?void 0:i?fd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r};const gd="sonic-redirect";let al=class extends Ot(Q){connectedCallback(){this.noShadowDom="",this.style.display="none",super.connectedCallback(),this.udpateCallBack=()=>this.update(),this.publisher&&this.publisher.onInternalMutation(this.udpateCallBack)}disconnectedCallback(){this.publisher&&this.publisher.offInternalMutation(this.udpateCallBack),super.disconnectedCallback()}update(){if(this.hasAttribute("onAdded")){dt.changeFromComponent(this);return}if(!this.props)return;const t=this.getAttribute("onData").split("."),e=ht.traverse(this.props,t);e&&!(ht.isObject(e)&&e)&&dt.changeFromComponent(this)}};al=md([X(gd)],al);var bd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,Ji=(t,e,s,i)=>{for(var r=i>1?void 0:i?vd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&bd(e,s,r),r};const yd="sonic-states";let ri=class extends Ot(Wr(Q)){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onStateAssign=t=>{this.state=t,this.requestUpdate()}}connectedCallback(){if(this.noShadowDom="",super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;const t=this.statePath.split(".");for(const e of t)this.statePublisher=this.statePublisher[e];this.statePublisher.onAssign(this.onStateAssign)}}disconnectedCallback(){this.statePath&&this.statePublisher?.offAssign(this.onStateAssign),super.disconnectedCallback()}handleStates(t){if(!this.states)return[];const e=[];for(const[s,i]of Object.entries(this.states)){if(s==="fallback"||!i)continue;const r=new RegExp(s);if(r.test(t)){const n=r.exec(t)||[s];n.shift(),e.push(i([...n]))}else try{const n=new fs("(/)*"+s+"*");if(n.match(t)){const o=n.match(t)||{};e.push(i(o))}}catch{t.indexOf(s.replace(document.location.origin,""))!=-1&&e.push(i({}))}}return e.length==0&&this.states?.fallback&&this.isConnected&&e.push(this.states.fallback()),e}render(){let t=this.state;(!Array.isArray(t)&&ht.isObject(t)||t
|
|
1385
|
+
</div>`}return ns(s)})}`}};si([h({type:String})],Pr.prototype,"fallBackRoute",2),si([h({type:Object,attribute:!1})],Pr.prototype,"routes",2),si([h({type:String})],Pr.prototype,"basePath",2),si([h()],Pr.prototype,"location",1),Pr=si([X(pd)],Pr);var fd=Object.getOwnPropertyDescriptor,md=(t,e,s,i)=>{for(var r=i>1?void 0:i?fd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r};const gd="sonic-redirect";let al=class extends Ot(Q){connectedCallback(){this.noShadowDom="",this.style.display="none",super.connectedCallback(),this.udpateCallBack=()=>this.update(),this.publisher&&this.publisher.onInternalMutation(this.udpateCallBack)}disconnectedCallback(){this.publisher&&this.publisher.offInternalMutation(this.udpateCallBack),super.disconnectedCallback()}update(){if(this.hasAttribute("onAdded")){dt.changeFromComponent(this);return}if(!this.props)return;const t=this.getAttribute("onData").split("."),e=ht.traverse(this.props,t);e&&!(ht.isObject(e)&&e)&&dt.changeFromComponent(this)}};al=md([X(gd)],al);var bd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,Ji=(t,e,s,i)=>{for(var r=i>1?void 0:i?vd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&bd(e,s,r),r};const yd="sonic-states";let ri=class extends Ot(Wr(Q)){constructor(){super(...arguments),this.state="",this.inverted=!1,this.statePath="",this.onStateAssign=t=>{this.state=t,this.requestUpdate()}}connectedCallback(){if(this.noShadowDom="",super.connectedCallback(),this.hasAttribute("data-path")&&(this.statePath=this.getAttribute("data-path")),this.statePath){this.statePublisher=this.publisher;const t=this.statePath.split(".");for(const e of t)this.statePublisher=this.statePublisher[e];this.statePublisher.onAssign(this.onStateAssign)}}disconnectedCallback(){this.statePath&&this.statePublisher?.offAssign(this.onStateAssign),super.disconnectedCallback()}handleStates(t){if(!this.states)return[];const e=[];for(const[s,i]of Object.entries(this.states)){if(s==="fallback"||!i)continue;const r=new RegExp(s);if(r.test(t)){const n=r.exec(t)||[s];n.shift(),e.push(i([...n]))}else try{const n=new fs("(/)*"+s+"*");if(n.match(t)){const o=n.match(t)||{};e.push(i(o))}}catch{t.indexOf(s.replace(document.location.origin,""))!=-1&&e.push(i({}))}}return e.length==0&&this.states?.fallback&&this.isConnected&&e.push(this.states.fallback()),e}render(){let t=this.state;(!Array.isArray(t)&&ht.isObject(t)||t==null)&&(t="");const e=this.handleStates(t);if(e.length>0)return R`${e}`;const s=[];for(const i of this.templatePartsList){let r=i.getAttribute(this.templateValueAttribute),n=t;if(this.inverted&&(n=r,r=t),r==""&&(r=this.inverted?".*?":"^$"),new RegExp(r).test(n+""))s.push(i),i.removeAttribute("mode");else{const c=new fs(r);c.names.length>0&&c.match(n)&&(i.setAttribute("mode","patternMatching"),s.push(i))}}return R`${Ui(s,(i,r)=>r+new Date().getTime(),i=>{if(i?.hasAttribute("dataProviderExpression")){const r=i.getAttribute("dataProviderExpression");let n="",o=t,c=i.getAttribute(this.templateValueAttribute);if(this.inverted&&(o=c,c=t),c==""&&(c=this.inverted?"*":"^$"),i.getAttribute("mode")=="patternMatching"){const d=new fs(c);n=new fs(r).stringify(d.match(o))}else{const d=new RegExp(c),b=(o+"").match(d);b&&(n=b.shift()?.replace(d,r))}return R`<div
|
|
1386
1386
|
style="display:contents"
|
|
1387
1387
|
dataProvider="${n}"
|
|
1388
1388
|
>
|
|
1389
1389
|
${ns(i)}
|
|
1390
|
-
</div>`}return ns(i)})}`}};Ji([h()],ri.prototype,"state",2),Ji([h({type:Boolean,reflect:!0})],ri.prototype,"inverted",2),Ji([h({type:Object})],ri.prototype,"states",2),ri=Ji([X(yd)],ri);var wd=Object.getOwnPropertyDescriptor,_d=(t,e,s,i)=>{for(var r=i>1?void 0:i?wd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r};const Sd="sonic-scope";let ll=class extends Q{createRenderRoot(){return this}render(){return R`<slot></slot>`}};ll=_d([X(Sd)],ll);function cl(t){return t instanceof HTMLElement||t instanceof ShadowRoot?t:null}function hl(t){if(!t||typeof t.get!="function")return null;const e=t.get();return!e||typeof e!="object"||!("serviceURL"in e)?null:e}function io(t){const e=cl(t);return e?Ue.getApiConfiguration(e):null}function no(t){return typeof t?.serviceURL=="string"&&t.serviceURL.length>0}const Pd=["serviceURL","serviceurl","token","credentials","tokenProvider","tokenprovider","userName","username","password","eventsApiToken","eventsapitoken"];function xd(t){return t instanceof HTMLElement&&typeof t.updateComplete<"u"}function ul(t){let e=null,s=[];return()=>{const i=new Promise((r,n)=>{s.push({resolve:r,reject:n})});return e!==null||(e=requestAnimationFrame(()=>{e=null;const r=s;s=[],t().then(n=>r.forEach(({resolve:o})=>o(n)),n=>r.forEach(({reject:o})=>o(n)))})),i}}function dl(t,e){if(xd(t)){let s=!1;return t.updateComplete.then(()=>{s||e()}),()=>{s=!0}}return e(),()=>{}}function pl(t,e){const s=cl(t);if(!s)return()=>{};let i=!1;const r=()=>{i||no(io(t))&&(i=!0,e())};if(r(),i)return()=>{};const n=[],o=requestAnimationFrame(()=>r());n.push(()=>cancelAnimationFrame(o)),queueMicrotask(()=>r());const c=new MutationObserver(()=>r());let d=s;for(;d;)d instanceof Element&&c.observe(d,{attributes:!0,attributeFilter:[...Pd]}),d=d.parentNode||d.host;return n.push(()=>c.disconnect()),()=>{i=!0,n.forEach(g=>g())}}class fl{constructor(){this.bindings=new WeakMap}bind(e,s){const i={run:s};let r=this.bindings.get(e);return r||(r=new Set,this.bindings.set(e,r)),r.add(i),()=>{const n=this.bindings.get(e);n&&(n.delete(i),n.size===0&&this.bindings.delete(e))}}run(e){const s=[...this.bindings.get(e)??[]].map(({run:i})=>i());return s.length===0?Promise.resolve(void 0):s.length===1?s[0]:Promise.all(s).then(()=>{})}}let ml=0;function Ad(t){return t!==null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function gl(t,e){const s=e?.when??"after";return(i,r,n)=>{const o=n.value;if(!o)return;const c=function(...d){if(s==="before")return t(this).then(()=>o.apply(this,d));const g=o.apply(this,d);return Ad(g)?g.then(A=>t(this).then(()=>A)):t(this).then(()=>g)};n.value=c}}function Cd(t,e){return gl(s=>t.refetch(s),e)}function kd(t,e){return gl(s=>t.send(s),e)}function Qi(t){t.configPublisher&&t.configMutationHandler&&t.configPublisher.offInternalMutation(t.configMutationHandler),t.configPublisher=null,t.configMutationHandler=null}function bl(t,e,s){const i=t.path,r=vl(e)?void 0:e,n=vl(e)?e:s,o={skipEmptyPlaceholder:n?.skipEmptyPlaceholder},c=r?.path,d=n?.triggerKey?.path,g=Ht(i),A=c?Ht(c):[],m=d?Ht(d):[],f=[...new Set([...g,...A,...m])],C=g.length>0,E=!!c,O=n?.refetchEveryMs??0,U=new fl,B=new WeakMap,S=new WeakSet,y=new WeakMap;let M;const k=function(D,Y,j){if(j){const re=j.value;if(!re)return;k.registerResultHandler(D,(ie,z)=>re.call(ie,z));return}if(!D)return;if(S.has(D)){y.get(D)?.add(Y);return}S.add(D),y.set(D,new Set([Y])),Qs(D);const ne=`__get_state_${Y}`;D.__onConnected__(re=>{const ie=re;let z=ie[ne];z||(z={cleanupWatchers:[],cleanupOperation:null,requestGeneration:0,configPublisher:null,configMutationHandler:null,scopeWatchCleanup:null,triggerPublisher:null,triggerInvalidateHandler:null,refetchTimeoutId:null,refetchEveryMs:O},ie[ne]=z),z.cleanupOperation?.(),z.cleanupOperation=null,z.cleanupWatchers.forEach(Ae=>Ae()),z.cleanupWatchers=[],z.requestGeneration++,z.refetchEveryMs=O,xr(z);const le=()=>{xr(z),!(!z.refetchEveryMs||z.refetchEveryMs<=0)&&(z.refetchTimeoutId=setTimeout(()=>{z.refetchTimeoutId=null,Be().catch(()=>{})},z.refetchEveryMs))},pe=Ae=>{y.get(D)?.forEach(b=>{ie[b]=Ae})},Be=async()=>{const Ae=C?Tt(re,i,o):{ready:!0,path:i};if(!Ae.ready||!Ae.path){pe(void 0),le();return}let b=null;if(E&&c){const Pe=Tt(re,c,o);if(!Pe.ready||!Pe.path){pe(void 0),le();return}const Ee=Lt(Pe.path);b=hl(Ee)}else b=io(re);if(!no(b)){if(!E&&!z.scopeWatchCleanup){const Pe=pl(re,ge);z.scopeWatchCleanup=Pe,z.cleanupWatchers.push(()=>{Pe(),z.scopeWatchCleanup=null})}le();return}const _=++z.requestGeneration,we=await new Os(b).getDetailed(Ae.path);return _!==z.requestGeneration||(y.get(D)?.forEach(Pe=>{ie[Pe]=we}),le(),B.get(D)?.forEach(Pe=>Pe(re,we))),we},he=ul(Be),ge=()=>{he().catch(()=>{})};z.cleanupOperation=U.bind(re,he);const $e=()=>{if(Xi(z),!d)return;const Ae=Tt(re,d,o);if(!Ae.ready||!Ae.path)return;const b=Lt(Ae.path);if(!b)return;const _=ge;b.onInvalidate(_),z.triggerPublisher=b,z.triggerInvalidateHandler=_},ce=()=>{if(!E||!c)return;Qi(z);const Ae=Tt(re,c,o);if(!Ae.ready||!Ae.path){pe(void 0);return}const b=Lt(Ae.path);if(!b){pe(void 0);return}const _=ge;b.onInternalMutation(_),z.configPublisher=b,z.configMutationHandler=_},W=()=>{$e(),ce(),E||ge()};if(E||m.length){for(const Ae of f){const b=Ts(Ls.watcherStore,Ls.hooked,re,Ae,()=>W());z.cleanupWatchers.push(b)}W()}else{const Ae=()=>{if(C)for(const b of g){const _=Ts(Ls.watcherStore,Ls.hooked,re,b,ge);z.cleanupWatchers.push(_)}$e(),Be().catch(()=>{})};z.cleanupWatchers.push(dl(re,Ae))}}),D.__onDisconnected__(re=>{const ie=re,z=ie[ne];z&&(z.cleanupOperation?.(),z.cleanupOperation=null,Qi(z),Xi(z),xr(z),z.cleanupWatchers.forEach(le=>le()),z.cleanupWatchers=[],z.requestGeneration++,y.get(D)?.forEach(le=>{ie[le]=void 0}))})};return k.refetch=D=>U.run(D),k.registerResultHandler=(D,Y)=>{let j=B.get(D);j||(j=new Set,B.set(D,j)),j.add(Y),S.has(D)||(M??=`__get_handler_${ml++}`,k(D,M))},k}function vl(t){return!t||typeof t!="object"?!1:"skipEmptyPlaceholder"in t||"refetchEveryMs"in t||"triggerKey"in t}function yl(t){return!t||typeof t!="object"?!1:"refetchEveryMs"in t||"skipIfBodyMissing"in t||"autoPostOnBodyMutation"in t||"skipEmptyPlaceholder"in t||"triggerKey"in t}function wl(t){t.bodyPublisher&&t.bodyMutationHandler&&t.bodyPublisher.offInternalMutation(t.bodyMutationHandler),t.bodyPublisher=null,t.bodyMutationHandler=null}function Xi(t){t.triggerPublisher&&t.triggerInvalidateHandler&&t.triggerPublisher.offInvalidate(t.triggerInvalidateHandler),t.triggerPublisher=null,t.triggerInvalidateHandler=null}function xr(t){t.refetchTimeoutId&&(clearTimeout(t.refetchTimeoutId),t.refetchTimeoutId=null)}function $d(t){if(!(!t||typeof t.get!="function"))return t.get()}function oo(t,e){return function(s,i,r,n){const o=s.path,c=i.path,d=yl(r)?void 0:r,g=yl(r)?r:n,A=d?.path,m=g?.triggerKey?.path,f=Ht(o),C=Ht(c),E=A?Ht(A):[],O=m?Ht(m):[],U=[...new Set([...f,...C,...E,...O])],B=f.length>0,S=!!A,y=g?.refetchEveryMs??0,M=g?.skipIfBodyMissing??!0,k=g?.autoPostOnBodyMutation??!0,D={skipEmptyPlaceholder:g?.skipEmptyPlaceholder},Y=`__${t.toLowerCase()}_state_`,j=new fl,ne=new WeakMap,re=new WeakSet,ie=new WeakMap;let z;const le=function(pe,Be,he){if(he){const $e=he.value;if(!$e)return;le.registerResultHandler(pe,(ce,W)=>$e.call(ce,W));return}if(!pe)return;if(re.has(pe)){ie.get(pe)?.add(Be);return}re.add(pe),ie.set(pe,new Set([Be])),Qs(pe);const ge=`${Y}${Be}`;pe.__onConnected__($e=>{const ce=$e;let W=ce[ge];W||(W={cleanupWatchers:[],cleanupOperation:null,requestGeneration:0,configPublisher:null,configMutationHandler:null,scopeWatchCleanup:null,bodyPublisher:null,bodyMutationHandler:null,triggerPublisher:null,triggerInvalidateHandler:null,refetchTimeoutId:null,refetchEveryMs:y,skipIfBodyMissing:M,autoPostOnBodyMutation:k},ce[ge]=W),W.cleanupOperation?.(),W.cleanupOperation=null,W.cleanupWatchers.forEach($=>$()),W.cleanupWatchers=[],W.requestGeneration++,W.refetchEveryMs=y,W.skipIfBodyMissing=M,W.autoPostOnBodyMutation=k,xr(W);const Ae=()=>{xr(W),!(!W.refetchEveryMs||W.refetchEveryMs<=0)&&(W.refetchTimeoutId=setTimeout(()=>{W.refetchTimeoutId=null,_().catch(()=>{})},W.refetchEveryMs))},b=$=>{ie.get(pe)?.forEach(F=>{ce[F]=$})},_=async()=>{const $=B?Tt($e,o,D):{ready:!0,path:o};if(!$.ready||!$.path){b(void 0),Ae();return}const F=Tt($e,c,D);if(!F.ready||!F.path){b(void 0),Ae();return}const q=Lt(F.path),V=$d(q);if(W.skipIfBodyMissing&&V==null){Ae();return}let N=null;if(S&&A){const me=Tt($e,A,D);if(!me.ready||!me.path){b(void 0),Ae();return}const fe=Lt(me.path);N=hl(fe)}else N=io($e);if(!no(N)){if(!S&&!W.scopeWatchCleanup){const me=pl($e,we);W.scopeWatchCleanup=me,W.cleanupWatchers.push(()=>{me(),W.scopeWatchCleanup=null})}Ae();return}const G=++W.requestGeneration,ae=new Os(N);let Ce;try{Ce=await e(ae,$.path,V)}catch(me){throw G===W.requestGeneration&&ne.get(pe)?.forEach(fe=>fe($e,void 0)),me}return G!==W.requestGeneration||(b(Ce),Ae(),ne.get(pe)?.forEach(me=>me($e,Ce))),Ce},te=ul(_),we=()=>{te().catch(()=>{})};W.cleanupOperation=j.bind($e,te);const Pe=()=>{if(wl(W),!W.autoPostOnBodyMutation)return;const $=Tt($e,c,D);if(!$.ready||!$.path)return;const F=Lt($.path);if(!F)return;const q=we;F.onInternalMutation(q),W.bodyPublisher=F,W.bodyMutationHandler=q},Ee=()=>{if(Xi(W),!m)return;const $=Tt($e,m,D);if(!$.ready||!$.path)return;const F=Lt($.path);if(!F)return;const q=we;F.onInvalidate(q),W.triggerPublisher=F,W.triggerInvalidateHandler=q},T=()=>{if(!S||!A)return;Qi(W);const $=Tt($e,A,D);if(!$.ready||!$.path){b(void 0);return}const F=Lt($.path);if(!F){b(void 0);return}const q=we;F.onInternalMutation(q),W.configPublisher=F,W.configMutationHandler=q},I=()=>{Pe(),Ee(),T(),W.autoPostOnBodyMutation&&we()};if(S||C.length||O.length){for(const $ of U){const F=Ts(Ls.watcherStore,Ls.hooked,$e,$,()=>I());W.cleanupWatchers.push(F)}I()}else{const $=()=>{if(B)for(const F of f){const q=Ts(Ls.watcherStore,Ls.hooked,$e,F,we);W.cleanupWatchers.push(q)}Pe(),Ee(),W.autoPostOnBodyMutation&&we()};W.cleanupWatchers.push(dl($e,$))}}),pe.__onDisconnected__($e=>{const ce=$e,W=ce[ge];W&&(W.cleanupOperation?.(),W.cleanupOperation=null,Qi(W),wl(W),Xi(W),xr(W),W.cleanupWatchers.forEach(Ae=>Ae()),W.cleanupWatchers=[],W.requestGeneration++,ie.get(pe)?.forEach(Ae=>{ce[Ae]=void 0}))})};return le.send=pe=>j.run(pe),le.registerResultHandler=(pe,Be)=>{let he=ne.get(pe);he||(he=new Set,ne.set(pe,he)),he.add(Be),re.has(pe)||(z??=`__${t.toLowerCase()}_handler_${ml++}`,le(pe,z))},le}}function Dd(t,e,s,i){return oo("POST",(r,n,o)=>r.postDetailed(n,o))(t,e,s,i)}function Ed(t,e,s,i){return oo("PUT",(r,n,o)=>r.putDetailed(n,o))(t,e,s,i)}function Od(t,e,s,i){return oo("PATCH",(r,n,o)=>r.patchDetailed(n,o))(t,e,s,i)}const Td=Oa,Ld=Ta,Id=bl;window["concorde-decorator-subscriber"]=window["concorde-decorator-subscriber"]||{},window["concorde-decorator-subscriber"]={bind:Ea,publish:Oa,subscribe:Ta,onAssing:ou,handle:lu,ancestorAttribute:Yn,autoSubscribe:cu,autoFill:hu,get:bl,post:Dd,put:Ed,patch:Od,refetch:Cd,send:kd};var Md=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,en=(t,e,s,i)=>{for(var r=i>1?void 0:i?Nd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Md(e,s,r),r};const _l=new Ti("communes?limit=$limit&fields=nom,code"),Sl=new Cs(_l.path),Fd="sonic-example";let ii=class extends Q{constructor(){super(...arguments),this.limit=5}render(){return R` <span part="api-get-demo">
|
|
1390
|
+
</div>`}return ns(i)})}`}};Ji([h()],ri.prototype,"state",2),Ji([h({type:Boolean,reflect:!0})],ri.prototype,"inverted",2),Ji([h({type:Object})],ri.prototype,"states",2),ri=Ji([X(yd)],ri);var wd=Object.getOwnPropertyDescriptor,_d=(t,e,s,i)=>{for(var r=i>1?void 0:i?wd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=o(r)||r);return r};const Sd="sonic-scope";let ll=class extends Q{createRenderRoot(){return this}render(){return R`<slot></slot>`}};ll=_d([X(Sd)],ll);function cl(t){return t instanceof HTMLElement||t instanceof ShadowRoot?t:null}function hl(t){if(!t||typeof t.get!="function")return null;const e=t.get();return!e||typeof e!="object"||!("serviceURL"in e)?null:e}function io(t){const e=cl(t);return e?Ue.getApiConfiguration(e):null}function no(t){return typeof t?.serviceURL=="string"&&t.serviceURL.length>0}const Pd=["serviceURL","serviceurl","token","credentials","tokenProvider","tokenprovider","userName","username","password","eventsApiToken","eventsapitoken"];function xd(t){return t instanceof HTMLElement&&typeof t.updateComplete<"u"}function ul(t){let e=null,s=[];return()=>{const i=new Promise((r,n)=>{s.push({resolve:r,reject:n})});return e!==null||(e=requestAnimationFrame(()=>{e=null;const r=s;s=[],t().then(n=>r.forEach(({resolve:o})=>o(n)),n=>r.forEach(({reject:o})=>o(n)))})),i}}function dl(t,e){if(xd(t)){let s=!1;return t.updateComplete.then(()=>{s||e()}),()=>{s=!0}}return e(),()=>{}}function pl(t,e){const s=cl(t);if(!s)return()=>{};let i=!1;const r=()=>{i||no(io(t))&&(i=!0,e())};if(r(),i)return()=>{};const n=[],o=requestAnimationFrame(()=>r());n.push(()=>cancelAnimationFrame(o)),queueMicrotask(()=>r());const c=new MutationObserver(()=>r());let d=s;for(;d;)d instanceof Element&&c.observe(d,{attributes:!0,attributeFilter:[...Pd]}),d=d.parentNode||d.host;return n.push(()=>c.disconnect()),()=>{i=!0,n.forEach(b=>b())}}class fl{constructor(){this.bindings=new WeakMap}bind(e,s){const i={run:s};let r=this.bindings.get(e);return r||(r=new Set,this.bindings.set(e,r)),r.add(i),()=>{const n=this.bindings.get(e);n&&(n.delete(i),n.size===0&&this.bindings.delete(e))}}run(e){const s=[...this.bindings.get(e)??[]].map(({run:i})=>i());return s.length===0?Promise.resolve(void 0):s.length===1?s[0]:Promise.all(s).then(()=>{})}}let ml=0;function Ad(t){return t!==null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"}function gl(t,e){const s=e?.when??"after";return(i,r,n)=>{const o=n.value;if(!o)return;const c=function(...d){if(s==="before")return t(this).then(()=>o.apply(this,d));const b=o.apply(this,d);return Ad(b)?b.then(A=>t(this).then(()=>A)):t(this).then(()=>b)};n.value=c}}function Cd(t,e){return gl(s=>t.refetch(s),e)}function kd(t,e){return gl(s=>t.send(s),e)}function Qi(t){t.configPublisher&&t.configMutationHandler&&t.configPublisher.offInternalMutation(t.configMutationHandler),t.configPublisher=null,t.configMutationHandler=null}function bl(t,e,s){const i=t.path,r=vl(e)?void 0:e,n=vl(e)?e:s,o={skipEmptyPlaceholder:n?.skipEmptyPlaceholder},c=r?.path,d=n?.triggerKey?.path,b=Ht(i),A=c?Ht(c):[],m=d?Ht(d):[],f=[...new Set([...b,...A,...m])],C=b.length>0,E=!!c,T=n?.refetchEveryMs??0,U=new fl,B=new WeakMap,x=new WeakSet,y=new WeakMap;let M;const k=function(D,Y,j){if(j){const re=j.value;if(!re)return;k.registerResultHandler(D,(ie,z)=>re.call(ie,z));return}if(!D)return;if(x.has(D)){y.get(D)?.add(Y);return}x.add(D),y.set(D,new Set([Y])),Qs(D);const ne=`__get_state_${Y}`;D.__onConnected__(re=>{const ie=re;let z=ie[ne];z||(z={cleanupWatchers:[],cleanupOperation:null,requestGeneration:0,configPublisher:null,configMutationHandler:null,scopeWatchCleanup:null,triggerPublisher:null,triggerInvalidateHandler:null,refetchTimeoutId:null,refetchEveryMs:T},ie[ne]=z),z.cleanupOperation?.(),z.cleanupOperation=null,z.cleanupWatchers.forEach(Ae=>Ae()),z.cleanupWatchers=[],z.requestGeneration++,z.refetchEveryMs=T,xr(z);const le=()=>{xr(z),!(!z.refetchEveryMs||z.refetchEveryMs<=0)&&(z.refetchTimeoutId=setTimeout(()=>{z.refetchTimeoutId=null,Be().catch(()=>{})},z.refetchEveryMs))},pe=Ae=>{y.get(D)?.forEach(g=>{ie[g]=Ae})},Be=async()=>{const Ae=C?Tt(re,i,o):{ready:!0,path:i};if(!Ae.ready||!Ae.path){pe(void 0),le();return}let g=null;if(E&&c){const Pe=Tt(re,c,o);if(!Pe.ready||!Pe.path){pe(void 0),le();return}const Ee=Lt(Pe.path);g=hl(Ee)}else g=io(re);if(!no(g)){if(!E&&!z.scopeWatchCleanup){const Pe=pl(re,ge);z.scopeWatchCleanup=Pe,z.cleanupWatchers.push(()=>{Pe(),z.scopeWatchCleanup=null})}le();return}const _=++z.requestGeneration,we=await new Os(g).getDetailed(Ae.path);return _!==z.requestGeneration||(y.get(D)?.forEach(Pe=>{ie[Pe]=we}),le(),B.get(D)?.forEach(Pe=>Pe(re,we))),we},he=ul(Be),ge=()=>{he().catch(()=>{})};z.cleanupOperation=U.bind(re,he);const $e=()=>{if(Xi(z),!d)return;const Ae=Tt(re,d,o);if(!Ae.ready||!Ae.path)return;const g=Lt(Ae.path);if(!g)return;const _=ge;g.onInvalidate(_),z.triggerPublisher=g,z.triggerInvalidateHandler=_},ce=()=>{if(!E||!c)return;Qi(z);const Ae=Tt(re,c,o);if(!Ae.ready||!Ae.path){pe(void 0);return}const g=Lt(Ae.path);if(!g){pe(void 0);return}const _=ge;g.onInternalMutation(_),z.configPublisher=g,z.configMutationHandler=_},W=()=>{$e(),ce(),E||ge()};if(E||m.length){for(const Ae of f){const g=Ts(Ls.watcherStore,Ls.hooked,re,Ae,()=>W());z.cleanupWatchers.push(g)}W()}else{const Ae=()=>{if(C)for(const g of b){const _=Ts(Ls.watcherStore,Ls.hooked,re,g,ge);z.cleanupWatchers.push(_)}$e(),Be().catch(()=>{})};z.cleanupWatchers.push(dl(re,Ae))}}),D.__onDisconnected__(re=>{const ie=re,z=ie[ne];z&&(z.cleanupOperation?.(),z.cleanupOperation=null,Qi(z),Xi(z),xr(z),z.cleanupWatchers.forEach(le=>le()),z.cleanupWatchers=[],z.requestGeneration++,y.get(D)?.forEach(le=>{ie[le]=void 0}))})};return k.refetch=D=>U.run(D),k.registerResultHandler=(D,Y)=>{let j=B.get(D);j||(j=new Set,B.set(D,j)),j.add(Y),x.has(D)||(M??=`__get_handler_${ml++}`,k(D,M))},k}function vl(t){return!t||typeof t!="object"?!1:"skipEmptyPlaceholder"in t||"refetchEveryMs"in t||"triggerKey"in t}function yl(t){return!t||typeof t!="object"?!1:"refetchEveryMs"in t||"skipIfBodyMissing"in t||"autoPostOnBodyMutation"in t||"skipEmptyPlaceholder"in t||"triggerKey"in t}function wl(t){t.bodyPublisher&&t.bodyMutationHandler&&t.bodyPublisher.offInternalMutation(t.bodyMutationHandler),t.bodyPublisher=null,t.bodyMutationHandler=null}function Xi(t){t.triggerPublisher&&t.triggerInvalidateHandler&&t.triggerPublisher.offInvalidate(t.triggerInvalidateHandler),t.triggerPublisher=null,t.triggerInvalidateHandler=null}function xr(t){t.refetchTimeoutId&&(clearTimeout(t.refetchTimeoutId),t.refetchTimeoutId=null)}function $d(t){if(!(!t||typeof t.get!="function"))return t.get()}function oo(t,e){return function(s,i,r,n){const o=s.path,c=i.path,d=yl(r)?void 0:r,b=yl(r)?r:n,A=d?.path,m=b?.triggerKey?.path,f=Ht(o),C=Ht(c),E=A?Ht(A):[],T=m?Ht(m):[],U=[...new Set([...f,...C,...E,...T])],B=f.length>0,x=!!A,y=b?.refetchEveryMs??0,M=b?.skipIfBodyMissing??!0,k=b?.autoPostOnBodyMutation??!0,D={skipEmptyPlaceholder:b?.skipEmptyPlaceholder},Y=`__${t.toLowerCase()}_state_`,j=new fl,ne=new WeakMap,re=new WeakSet,ie=new WeakMap;let z;const le=function(pe,Be,he){if(he){const $e=he.value;if(!$e)return;le.registerResultHandler(pe,(ce,W)=>$e.call(ce,W));return}if(!pe)return;if(re.has(pe)){ie.get(pe)?.add(Be);return}re.add(pe),ie.set(pe,new Set([Be])),Qs(pe);const ge=`${Y}${Be}`;pe.__onConnected__($e=>{const ce=$e;let W=ce[ge];W||(W={cleanupWatchers:[],cleanupOperation:null,requestGeneration:0,configPublisher:null,configMutationHandler:null,scopeWatchCleanup:null,bodyPublisher:null,bodyMutationHandler:null,triggerPublisher:null,triggerInvalidateHandler:null,refetchTimeoutId:null,refetchEveryMs:y,skipIfBodyMissing:M,autoPostOnBodyMutation:k},ce[ge]=W),W.cleanupOperation?.(),W.cleanupOperation=null,W.cleanupWatchers.forEach($=>$()),W.cleanupWatchers=[],W.requestGeneration++,W.refetchEveryMs=y,W.skipIfBodyMissing=M,W.autoPostOnBodyMutation=k,xr(W);const Ae=()=>{xr(W),!(!W.refetchEveryMs||W.refetchEveryMs<=0)&&(W.refetchTimeoutId=setTimeout(()=>{W.refetchTimeoutId=null,_().catch(()=>{})},W.refetchEveryMs))},g=$=>{ie.get(pe)?.forEach(F=>{ce[F]=$})},_=async()=>{const $=B?Tt($e,o,D):{ready:!0,path:o};if(!$.ready||!$.path){g(void 0),Ae();return}const F=Tt($e,c,D);if(!F.ready||!F.path){g(void 0),Ae();return}const q=Lt(F.path),V=$d(q);if(W.skipIfBodyMissing&&V==null){Ae();return}let N=null;if(x&&A){const me=Tt($e,A,D);if(!me.ready||!me.path){g(void 0),Ae();return}const fe=Lt(me.path);N=hl(fe)}else N=io($e);if(!no(N)){if(!x&&!W.scopeWatchCleanup){const me=pl($e,we);W.scopeWatchCleanup=me,W.cleanupWatchers.push(()=>{me(),W.scopeWatchCleanup=null})}Ae();return}const G=++W.requestGeneration,ae=new Os(N);let Ce;try{Ce=await e(ae,$.path,V)}catch(me){throw G===W.requestGeneration&&ne.get(pe)?.forEach(fe=>fe($e,void 0)),me}return G!==W.requestGeneration||(g(Ce),Ae(),ne.get(pe)?.forEach(me=>me($e,Ce))),Ce},te=ul(_),we=()=>{te().catch(()=>{})};W.cleanupOperation=j.bind($e,te);const Pe=()=>{if(wl(W),!W.autoPostOnBodyMutation)return;const $=Tt($e,c,D);if(!$.ready||!$.path)return;const F=Lt($.path);if(!F)return;const q=we;F.onInternalMutation(q),W.bodyPublisher=F,W.bodyMutationHandler=q},Ee=()=>{if(Xi(W),!m)return;const $=Tt($e,m,D);if(!$.ready||!$.path)return;const F=Lt($.path);if(!F)return;const q=we;F.onInvalidate(q),W.triggerPublisher=F,W.triggerInvalidateHandler=q},O=()=>{if(!x||!A)return;Qi(W);const $=Tt($e,A,D);if(!$.ready||!$.path){g(void 0);return}const F=Lt($.path);if(!F){g(void 0);return}const q=we;F.onInternalMutation(q),W.configPublisher=F,W.configMutationHandler=q},I=()=>{Pe(),Ee(),O(),W.autoPostOnBodyMutation&&we()};if(x||C.length||T.length){for(const $ of U){const F=Ts(Ls.watcherStore,Ls.hooked,$e,$,()=>I());W.cleanupWatchers.push(F)}I()}else{const $=()=>{if(B)for(const F of f){const q=Ts(Ls.watcherStore,Ls.hooked,$e,F,we);W.cleanupWatchers.push(q)}Pe(),Ee(),W.autoPostOnBodyMutation&&we()};W.cleanupWatchers.push(dl($e,$))}}),pe.__onDisconnected__($e=>{const ce=$e,W=ce[ge];W&&(W.cleanupOperation?.(),W.cleanupOperation=null,Qi(W),wl(W),Xi(W),xr(W),W.cleanupWatchers.forEach(Ae=>Ae()),W.cleanupWatchers=[],W.requestGeneration++,ie.get(pe)?.forEach(Ae=>{ce[Ae]=void 0}))})};return le.send=pe=>j.run(pe),le.registerResultHandler=(pe,Be)=>{let he=ne.get(pe);he||(he=new Set,ne.set(pe,he)),he.add(Be),re.has(pe)||(z??=`__${t.toLowerCase()}_handler_${ml++}`,le(pe,z))},le}}function Dd(t,e,s,i){return oo("POST",(r,n,o)=>r.postDetailed(n,o))(t,e,s,i)}function Ed(t,e,s,i){return oo("PUT",(r,n,o)=>r.putDetailed(n,o))(t,e,s,i)}function Od(t,e,s,i){return oo("PATCH",(r,n,o)=>r.patchDetailed(n,o))(t,e,s,i)}const Td=Oa,Ld=Ta,Id=bl;window["concorde-decorator-subscriber"]=window["concorde-decorator-subscriber"]||{},window["concorde-decorator-subscriber"]={bind:Ea,publish:Oa,subscribe:Ta,onAssing:ou,handle:lu,ancestorAttribute:Yn,autoSubscribe:cu,autoFill:hu,get:bl,post:Dd,put:Ed,patch:Od,refetch:Cd,send:kd};var Md=Object.defineProperty,Nd=Object.getOwnPropertyDescriptor,en=(t,e,s,i)=>{for(var r=i>1?void 0:i?Nd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Md(e,s,r),r};const _l=new Ti("communes?limit=$limit&fields=nom,code"),Sl=new Cs(_l.path),Fd="sonic-example";let ii=class extends Q{constructor(){super(...arguments),this.limit=5}render(){return R` <span part="api-get-demo">
|
|
1391
1391
|
· get: ${JSON.stringify(this.geoCommunesPayload?.result??null)} · HTTP
|
|
1392
1392
|
${this.geoCommunesPayload?.response?.status??"—"} · subscribe:
|
|
1393
1393
|
${JSON.stringify(this.geoCommunesResult??null)}</span
|
|
1394
|
-
>`}};en([h({type:Number})],ii.prototype,"limit",2),en([Id(_l),Td(Sl)],ii.prototype,"geoCommunesPayload",2),en([xe(),Ld(Sl.result)],ii.prototype,"geoCommunesResult",2),ii=en([X(Fd)],ii);const Pl={checkbox:{tagName:"sonic-checkbox"},date:{tagName:"sonic-input",attributes:{type:"date"}},fieldset:{tagName:"sonic-fieldset",nodes:[{libraryKey:"formLayout"}],contentElementSelector:"sonic-form-layout"},managed_file:{tagName:"sonic-input",attributes:{variant:"ghost",type:"file"}},password:{tagName:"sonic-input",attributes:{type:"password"}},radio:{tagName:"sonic-radio"},select:{tagName:"sonic-select"},textarea:{tagName:"sonic-textarea"},textfield:{tagName:"sonic-input",attributes:{type:"text"}},hidden:{tagName:"sonic-input",attributes:{type:"hidden"}},button:{tagName:"sonic-button"},form:{tagName:"sonic-submit",attributes:{onEnterKey:!0}},submit:{tagName:"sonic-submit",attributes:{onClick:!0},contentElementSelector:"sonic-button",nodes:[{libraryKey:"button",attributes:{type:"success"},nodes:[{tagName:"sonic-icon",attributes:{name:"check",slot:"prefix"}}]}]},email:{tagName:"sonic-input",attributes:{type:"email"}},formItemContainer:{tagName:"div",attributes:{class:"form-item-container"}},formLayout:{tagName:"sonic-form-layout"},formActions:{tagName:"sonic-form-actions"},passwordHelper:{tagName:"sonic-password-helper"},sameValueHelper:{tagName:"sonic-same-value-helper"},divider:{tagName:"sonic-divider"}};class Rd{async transform(e,s){if(this.sduiDescriptor=e,this.sduiDescriptor.library)for(const i in s.library)this.sduiDescriptor.library[i]=s.library[i];for(const i of s.transforms)this.transformAction(i)}transformAction(e){const s=this.getNodesMatchingPatterns(e.patterns,this.sduiDescriptor);this[e.action](e,s)}getNodesMatchingPatterns(e,s){if(!e)return[];if(!s)return[];const i=s.nodes;if(!i)return[];let r=[],n=0;for(const o of e)for(const c of i)this.nodeMatchesPattern(o,c)&&r.push({parent:s,child:c,index:n}),r=r.concat(this.getNodesMatchingPatterns([o],c)),n++;return r}stringMatchesExpression(e,s){return!s||e&&e.match(s)}nodeMatchesPattern(e,s){const i=e,r=s,n=["libraryKey","innerHTML","prefix","suffix","markup","textContent"];for(const d of n)if(!this.stringMatchesExpression(r[d],i[d]))return!1;const o=e.attributes,c=s.attributes;if(o&&!c)return!1;if(o){for(const d in o)if(!c||!this.stringMatchesExpression(c[d],o[d]))return!1}return!0}unwrap(e,s){for(const i of s)i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1),i.child.nodes&&i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),0,...i.child.nodes)}wrap(e,s){const i={...e.ui};i.nodes||(i.nodes=[]);let r=0;for(const o of s)i.nodes?.push(o.child),r>0&&o.parent.nodes?.splice(o.parent.nodes.indexOf(o.child),1),r++;const n=s[0]?.parent.nodes?.indexOf(s[0].child);n!=null&&n>=0&&(s[0].parent.nodes?.splice(n,1),s[0].parent.nodes?.splice(n,0,i))}move(e,s){for(const i of s){i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1);let r=[];e.after&&(r=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor)),e.before&&(r=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor));const n=r[0];n&&n.parent.nodes?.splice(n.parent.nodes.indexOf(n.child)+(e.after?1:0),0,i.child)}}remap(e,s){for(const i of s){const r={...e.ui};r.attributes||(r.attributes={});const n=i.child.attributes;if(n)for(const m in n)Object.prototype.hasOwnProperty.call(r.attributes,m)||(r.attributes[m]=n[m]);const o=["libraryKey","innerHTML","prefix","suffix","markup","textContent"],c=i.child,d=r;for(const m of o)!Object.prototype.hasOwnProperty.call(r,m)&&c[m]&&(d[m]=c[m]);r.nodes||(r.nodes=[]);const g=i.child.nodes;if(g)for(const m of g)r.nodes.push(m);const A=i.parent.nodes?.indexOf(i.child)??-1;A!=-1&&(i.parent.nodes?.splice(A,1),i.parent.nodes?.splice(A,0,r))}}delete(e,s){for(const i of s)i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1)}insert(e,s){const i=e.after?"after":e.before?"before":"in";s=[],e.after?s=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor):e.before?s=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor):e.in&&(s=this.getNodesMatchingPatterns([e.in],this.sduiDescriptor));const r=s[0];r&&(i=="in"?(r.child.nodes||(r.child.nodes=[]),r.child.nodes.push({...e.ui})):r.parent.nodes?.splice(r.parent.nodes.indexOf(r.child)+(i=="after"?1:0),0,{...e.ui}))}}const jd="data-sdui-placeholder",ao="data-sdui-node-id";function xl(t){const e=document.createElement("div");return e.setAttribute(jd,""),e.setAttribute("data-node-id",t),e.setAttribute(ao,t),e.setAttribute("aria-hidden","true"),e.style.display="contents",e}const Ud=["markup","innerHTML","prefix","suffix"];function Al(t){const e=[];for(const s of Ud){const i=t[s];i!=null&&i!==""&&e.push(s)}return e}function zd(t){return Al(t).length>0}function qd(t,e){const s=Al(e);return`sonic-sdui (profile="safe") : nœud ignoré (${t}) — champs refusés : ${s.join(", ")}`}function Bd(t){return`sonic-sdui (profile="safe") : chargement js ignoré (${t.length} URL) — ${t.join(", ")}`}var Hd=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,Ar=(t,e,s,i)=>{for(var r=i>1?void 0:i?Vd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Hd(e,s,r),r};const Wd="sonic-sdui";let sr=class extends Xa(tr(Q)){constructor(){super(...arguments),this.partial=!1,this.sduiDescriptor={},this.nodeIndex=new Map,this.renderingStack=new Set,this.incrementalPartial=!1,this.incrementalActive=!1}connectedCallback(){this.noShadowDom="",this.displayContents=!0,this.isFetchEnabled=this.hasAttribute("fetch"),super.connectedCallback(),this.opsDataProvider&&this.bindOpsDataProvider()}get isSafeProfile(){return this.profile==="safe"}get isPartialMode(){return this.partial||this.incrementalPartial}willUpdate(t){if(t.has("opsDataProvider")&&this.bindOpsDataProvider(),this.incrementalActive){super.willUpdate(t);return}this.props==null&&(this.sduiDescriptor={});{const e=this.sduiKey?this.props[this.sduiKey]:this.props,s=t.has("profile"),i=t.has("partial");if(this.sduiDescriptor==e&&!s&&!i)return;this.sduiDescriptor=e,this.updateContents()}super.willUpdate(t)}disconnectedCallback(){this.opsUnsub?.(),this.opsUnsub=void 0,super.disconnectedCallback()}async updateContents(){if(!this.sduiDescriptor)return;const t={};Object.assign(t,Pl,this.sduiDescriptor.library),this.sduiDescriptor.library=t,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.rebuildNodeIndex(),this.parseRootNodes()}rebuildNodeIndex(){this.nodeIndex.clear();const t=e=>{e.nodeId&&this.nodeIndex.set(e.nodeId,e),e.nodes?.forEach(t)};if(this.sduiDescriptor.nodeById)for(const e of Object.keys(this.sduiDescriptor.nodeById)){const s=this.sduiDescriptor.nodeById[e];s.nodeId||(s.nodeId=e),this.nodeIndex.set(e,s),t(s)}if(this.sduiDescriptor.nodes?.forEach(t),this.sduiDescriptor.library)for(const e of Object.keys(this.sduiDescriptor.library))t(this.sduiDescriptor.library[e])}removeChildren(){for(;[...this.children].filter(t=>t.nodeName!="SLOT").length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js?.length)if(this.isSafeProfile)console.warn(Bd(this.sduiDescriptor.js));else for(const t of this.sduiDescriptor.js)gs.loadJS(t);if(this.sduiDescriptor.css)for(const t of this.sduiDescriptor.css)gs.loadCSS(t)}}async transformSDUIDescriptor(){if(!this.hasAttribute("transformation"))return;const e=await(await fetch(this.getAttribute("transformation"))).json();await new Rd().transform(this.sduiDescriptor,e)}async loadLibrary(){if(!this.hasAttribute("library"))return;const e=await(await fetch(this.getAttribute("library"))).json();this.sduiDescriptor.library=e}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let t=this.sduiDescriptor.nodes;t||(t=[]);const e={tagName:"sonic-toast-message-subscriber",attributes:{}};this.messagesKey&&(e.attributes={subDataProvider:this.messagesKey}),t.push(e),t.forEach((s,i)=>{const r=this.parseChild(s,`nodes[${i}]`);r&&this.appendChild(r)})}parseChild(t,e="node"){if(this.isSafeProfile&&zd(t))return console.warn(qd(e,t)),null;if(t.nodeId&&this.renderingStack.has(t.nodeId))return console.warn(`sonic-sdui : cycle détecté sur nodeId="${t.nodeId}" (${e})`),this.isPartialMode?xl(t.nodeId):null;t.nodeId&&this.renderingStack.add(t.nodeId);try{const s=t.tagName||"div";let{element:i,contentElement:r}=this.handleLibrary(t,s,e);if(!i)return null;this.handleAttributes(t,i),i=this.handleMarkup(t,i),r||(r=i),this.handleChildNodes(t,r,i,e),this.handleTextContent(t,r),this.handleInnerHTML(t,r);let n=i;return(t.prefix||t.suffix)&&(n=this.handlePrefixSuffix(t,i)),this.bindAction(t,n),t.nodeId&&n.setAttribute(ao,t.nodeId),n}finally{t.nodeId&&this.renderingStack.delete(t.nodeId)}}handlePrefixSuffix(t,e){const s=document.createElement("div");return s.innerHTML=(t.prefix||"")+e.outerHTML+(t.suffix||""),s.style.display="contents",s}bindAction(t,e){const s=t.action;s?.name&&e.addEventListener("click",()=>{const i={name:s.name,context:s.context??{},sourceNodeId:t.nodeId};this.dispatchEvent(new CustomEvent("sdui-action",{detail:i,bubbles:!0,composed:!0}))})}handleChildNodes(t,e,s,i){if(t.nodes){const r=t.nodes;for(let n=0;n<r.length;n++){const o=r[n],c=this.parseChild(o,`${i}.nodes[${n}]`);c&&this.appendChildElement(o,c,e,s)}}if(t.childNodeIds?.length)for(const r of t.childNodeIds){const n=this.nodeIndex.get(r);if(n){const o=this.parseChild(n,`${i}.childNodeIds[${r}]`);o&&this.appendChildElement(n,o,e,s);continue}this.isPartialMode?this.appendToTarget(e,xl(r)):console.warn(`sonic-sdui : childNodeId "${r}" introuvable (${i}) — ignoré (activez partial pour un placeholder)`)}}appendChildElement(t,e,s,i){let r=s;t.parentElementSelector&&(r=i.querySelector(t.parentElementSelector)||s),this.appendToTarget(r,e)}appendToTarget(t,e){t.shadowRoot?t.shadowRoot.appendChild(e):t.tagName.toLocaleLowerCase()=="template"?t.content.appendChild(e):t.appendChild(e)}handleLibrary(t,e,s){let i,r;if(t.libraryKey&&this.sduiDescriptor.library){const n=`library.${t.libraryKey}`;if(i=this.parseChild(this.sduiDescriptor.library[t.libraryKey]||{tagName:"div"},n),!i)return console.warn(`sonic-sdui (profile="safe") : nœud ignoré (${s}) — modèle libraryKey="${t.libraryKey}" refusé`),{element:null,contentElement:void 0};const o=(this.sduiDescriptor.library[t.libraryKey]||{}).contentElementSelector;o&&(r=i.querySelector(o))}else i=document.createElement(e);return{element:i,contentElement:r}}handleAttributes(t,e){const s=t.attributes;for(const i in s){const r=s[i],n=Yr.isObject(r)?JSON.stringify(r):r;e.setAttribute(i,n)}}handleMarkup(t,e){return t.markup&&(e=document.createElement("div"),e.style.display="contents",e.innerHTML=t.markup),e}handleTextContent(t,e){t.textContent==null||!e||t.nodes?.length||t.childNodeIds?.length||(e.textContent=t.textContent)}handleInnerHTML(t,e){if(t.innerHTML)if(t.innerHTML.indexOf("wording_")!=-1){const s=this.getAncestorAttributeValue("wordingProvider");this.api?.post(s,{labels:[t.innerHTML.substring(8)]}).then(i=>{e&&(e.innerHTML+=i)})}else e&&(e.innerHTML+=t.innerHTML)}upsertNode(t,e,s){if(!t.nodeId){console.warn('sonic-sdui.upsertNode : "nodeId" est requis');return}this.beginIncremental();const i=t.nodeId;if(this.sduiDescriptor.nodeById||(this.sduiDescriptor.nodeById={}),this.sduiDescriptor.nodeById[i]=t,this.nodeIndex.set(i,t),e){let r=this.nodeIndex.get(e)||this.sduiDescriptor.nodeById[e];r||(r={nodeId:e,tagName:"div",childNodeIds:[]},this.sduiDescriptor.nodeById[e]=r,this.nodeIndex.set(e,r),this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]),this.sduiDescriptor.nodes.some(c=>c.nodeId===e)||this.sduiDescriptor.nodes.push(r)),r.childNodeIds||(r.childNodeIds=[]);const n=r.childNodeIds.indexOf(i);n>=0&&r.childNodeIds.splice(n,1);const o=s!=null?Math.max(0,Math.min(s,r.childNodeIds.length)):r.childNodeIds.length;r.childNodeIds.splice(o,0,i)}else{this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]);const r=this.sduiDescriptor.nodes,n=r.findIndex(o=>o.nodeId===i);n>=0?r[n]=t:s!=null?r.splice(Math.max(0,Math.min(s,r.length)),0,t):r.push(t)}this.rebuildNodeIndex(),this.domUpsertNode(t,e,s)}removeNode(t){if(this.beginIncremental(),delete this.sduiDescriptor.nodeById?.[t],this.nodeIndex.delete(t),this.sduiDescriptor.nodes&&(this.sduiDescriptor.nodes=this.sduiDescriptor.nodes.filter(e=>e.nodeId!==t)),this.sduiDescriptor.nodeById)for(const e of Object.values(this.sduiDescriptor.nodeById))e.childNodeIds&&(e.childNodeIds=e.childNodeIds.filter(s=>s!==t));this.findDomNode(t)?.remove()}setData(t,e){const s=Lt(t);if(s){s.set(e);return}if(this.dataProvider){const i=Lt(`${this.dataProvider}.${t}`);if(i){i.set(e);return}}console.warn(`sonic-sdui.setData : chemin introuvable "${t}"`)}applyOp(t){switch(t.op){case"upsertNode":this.upsertNode(t.node,t.parentId,t.index);break;case"removeNode":this.removeNode(t.nodeId);break;case"setData":this.setData(t.path,t.value);break;default:console.warn("sonic-sdui.applyOp : op inconnue",t)}}endIncremental(){this.incrementalActive=!1,this.incrementalPartial=!1}beginIncremental(){if(!this.incrementalActive){if(this.sduiDescriptor=structuredClone(this.sduiDescriptor||{}),this.sduiDescriptor.nodeById||(this.sduiDescriptor.nodeById={}),this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]),!this.sduiDescriptor.library){const t={};Object.assign(t,Pl),this.sduiDescriptor.library=t}this.incrementalActive=!0,this.incrementalPartial=!0,this.rebuildNodeIndex()}}findDomNode(t){const e=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/"/g,'\\"');return this.querySelector(`[${ao}="${e}"]`)}domUpsertNode(t,e,s){const i=this.parseChild(t,`upsert:${t.nodeId}`);if(!i)return;const r=this.findDomNode(t.nodeId);if(r&&r!==i){r.replaceWith(i);return}if(r===i)return;if(e){const o=this.findDomNode(e);if(o){const c=Array.from(o.children);s!=null&&s<c.length?o.insertBefore(i,c[s]):o.appendChild(i);return}}const n=this.querySelector("sonic-toast-message-subscriber");n?this.insertBefore(i,n):this.appendChild(i)}bindOpsDataProvider(){this.opsUnsub?.(),this.opsUnsub=void 0;const t=this.opsDataProvider;if(!t)return;const e=Lt(t);if(!e)return;const s=r=>{if(r==null)return;const n=Array.isArray(r)?r:[r];for(const o of n)o&&typeof o=="object"&&"op"in o&&this.applyOp(o)};e.onAssign(s),this.opsUnsub=()=>e.offAssign(s);const i=e.get();i!=null&&s(i)}};Ar([h()],sr.prototype,"sduiKey",2),Ar([h()],sr.prototype,"messagesKey",2),Ar([h({type:String,reflect:!0})],sr.prototype,"profile",2),Ar([h({type:Boolean,reflect:!0})],sr.prototype,"partial",2),Ar([h({type:String})],sr.prototype,"opsDataProvider",2),sr=Ar([X(Wd)],sr);var Kd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Cl=(t,e,s,i)=>{for(var r=i>1?void 0:i?Gd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Kd(e,s,r),r};let tn=class extends tr(Q){constructor(){super(...arguments),this._composition={},this.listeners=[]}get composition(){return this._composition}set composition(t){this._composition=t,this.updateComposition()}connectedCallback(){super.connectedCallback(),this.updateComposition()}disconnectedCallback(){this.removePublisherListeners(),super.disconnectedCallback()}updateComposition(){this.removePublisherListeners(),this.publisher&&(this.publisher.set({}),this.parseComposition(this.composition,this.publisher))}removePublisherListeners(){const t=this.listeners;this.listeners=[],t.forEach(e=>{this.publisher.offAssign(e.subscriber)})}parseComposition(t,e){if(t)for(const s in t){const i=t[s];if(typeof i=="string"){const r=i.split("."),n=r.shift();if(!n)continue;let o=ve.get(n);o=Yr.traverse(o,r);const c={publisher:o,subscriber:d=>{e[s]=d}};this.listeners.push(c),o.onAssign(c.subscriber),e._proxies_.set(s,o)}else{this.publisher[s]={};const r=new Rr({},e);e._proxies_.set(s,r);const n={publisher:r,subscriber:o=>{e[s]=o}};this.listeners.push(n),r.onAssign(n.subscriber),this.parseComposition(i,r)}}}render(){return R`<slot></slot>`}};tn.styles=[Z`
|
|
1394
|
+
>`}};en([h({type:Number})],ii.prototype,"limit",2),en([Id(_l),Td(Sl)],ii.prototype,"geoCommunesPayload",2),en([xe(),Ld(Sl.result)],ii.prototype,"geoCommunesResult",2),ii=en([X(Fd)],ii);const Pl={checkbox:{tagName:"sonic-checkbox"},date:{tagName:"sonic-input",attributes:{type:"date"}},fieldset:{tagName:"sonic-fieldset",nodes:[{libraryKey:"formLayout"}],contentElementSelector:"sonic-form-layout"},managed_file:{tagName:"sonic-input",attributes:{variant:"ghost",type:"file"}},password:{tagName:"sonic-input",attributes:{type:"password"}},radio:{tagName:"sonic-radio"},select:{tagName:"sonic-select"},textarea:{tagName:"sonic-textarea"},textfield:{tagName:"sonic-input",attributes:{type:"text"}},hidden:{tagName:"sonic-input",attributes:{type:"hidden"}},button:{tagName:"sonic-button"},form:{tagName:"sonic-submit",attributes:{onEnterKey:!0}},submit:{tagName:"sonic-submit",attributes:{onClick:!0},contentElementSelector:"sonic-button",nodes:[{libraryKey:"button",attributes:{type:"success"},nodes:[{tagName:"sonic-icon",attributes:{name:"check",slot:"prefix"}}]}]},email:{tagName:"sonic-input",attributes:{type:"email"}},formItemContainer:{tagName:"div",attributes:{class:"form-item-container"}},formLayout:{tagName:"sonic-form-layout"},formActions:{tagName:"sonic-form-actions"},passwordHelper:{tagName:"sonic-password-helper"},sameValueHelper:{tagName:"sonic-same-value-helper"},divider:{tagName:"sonic-divider"}};class Rd{async transform(e,s){if(this.sduiDescriptor=e,this.sduiDescriptor.library)for(const i in s.library)this.sduiDescriptor.library[i]=s.library[i];for(const i of s.transforms)this.transformAction(i)}transformAction(e){const s=this.getNodesMatchingPatterns(e.patterns,this.sduiDescriptor);this[e.action](e,s)}getNodesMatchingPatterns(e,s){if(!e)return[];if(!s)return[];const i=s.nodes;if(!i)return[];let r=[],n=0;for(const o of e)for(const c of i)this.nodeMatchesPattern(o,c)&&r.push({parent:s,child:c,index:n}),r=r.concat(this.getNodesMatchingPatterns([o],c)),n++;return r}stringMatchesExpression(e,s){return!s||e&&e.match(s)}nodeMatchesPattern(e,s){const i=e,r=s,n=["libraryKey","innerHTML","prefix","suffix","markup","textContent"];for(const d of n)if(!this.stringMatchesExpression(r[d],i[d]))return!1;const o=e.attributes,c=s.attributes;if(o&&!c)return!1;if(o){for(const d in o)if(!c||!this.stringMatchesExpression(c[d],o[d]))return!1}return!0}unwrap(e,s){for(const i of s)i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1),i.child.nodes&&i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),0,...i.child.nodes)}wrap(e,s){const i={...e.ui};i.nodes||(i.nodes=[]);let r=0;for(const o of s)i.nodes?.push(o.child),r>0&&o.parent.nodes?.splice(o.parent.nodes.indexOf(o.child),1),r++;const n=s[0]?.parent.nodes?.indexOf(s[0].child);n!=null&&n>=0&&(s[0].parent.nodes?.splice(n,1),s[0].parent.nodes?.splice(n,0,i))}move(e,s){for(const i of s){i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1);let r=[];e.after&&(r=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor)),e.before&&(r=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor));const n=r[0];n&&n.parent.nodes?.splice(n.parent.nodes.indexOf(n.child)+(e.after?1:0),0,i.child)}}remap(e,s){for(const i of s){const r={...e.ui};r.attributes||(r.attributes={});const n=i.child.attributes;if(n)for(const m in n)Object.prototype.hasOwnProperty.call(r.attributes,m)||(r.attributes[m]=n[m]);const o=["libraryKey","innerHTML","prefix","suffix","markup","textContent"],c=i.child,d=r;for(const m of o)!Object.prototype.hasOwnProperty.call(r,m)&&c[m]&&(d[m]=c[m]);r.nodes||(r.nodes=[]);const b=i.child.nodes;if(b)for(const m of b)r.nodes.push(m);const A=i.parent.nodes?.indexOf(i.child)??-1;A!=-1&&(i.parent.nodes?.splice(A,1),i.parent.nodes?.splice(A,0,r))}}delete(e,s){for(const i of s)i.parent.nodes?.splice(i.parent.nodes.indexOf(i.child),1)}insert(e,s){const i=e.after?"after":e.before?"before":"in";s=[],e.after?s=this.getNodesMatchingPatterns([e.after],this.sduiDescriptor):e.before?s=this.getNodesMatchingPatterns([e.before],this.sduiDescriptor):e.in&&(s=this.getNodesMatchingPatterns([e.in],this.sduiDescriptor));const r=s[0];r&&(i=="in"?(r.child.nodes||(r.child.nodes=[]),r.child.nodes.push({...e.ui})):r.parent.nodes?.splice(r.parent.nodes.indexOf(r.child)+(i=="after"?1:0),0,{...e.ui}))}}const jd="data-sdui-placeholder",ao="data-sdui-node-id";function xl(t){const e=document.createElement("div");return e.setAttribute(jd,""),e.setAttribute("data-node-id",t),e.setAttribute(ao,t),e.setAttribute("aria-hidden","true"),e.style.display="contents",e}const Ud=["markup","innerHTML","prefix","suffix"];function Al(t){const e=[];for(const s of Ud){const i=t[s];i!=null&&i!==""&&e.push(s)}return e}function zd(t){return Al(t).length>0}function qd(t,e){const s=Al(e);return`sonic-sdui (profile="safe") : nœud ignoré (${t}) — champs refusés : ${s.join(", ")}`}function Bd(t){return`sonic-sdui (profile="safe") : chargement js ignoré (${t.length} URL) — ${t.join(", ")}`}var Hd=Object.defineProperty,Vd=Object.getOwnPropertyDescriptor,Ar=(t,e,s,i)=>{for(var r=i>1?void 0:i?Vd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Hd(e,s,r),r};const Wd="sonic-sdui";let sr=class extends Xa(tr(Q)){constructor(){super(...arguments),this.partial=!1,this.sduiDescriptor={},this.nodeIndex=new Map,this.renderingStack=new Set,this.incrementalPartial=!1,this.incrementalActive=!1}connectedCallback(){this.noShadowDom="",this.displayContents=!0,this.isFetchEnabled=this.hasAttribute("fetch"),super.connectedCallback(),this.opsDataProvider&&this.bindOpsDataProvider()}get isSafeProfile(){return this.profile==="safe"}get isPartialMode(){return this.partial||this.incrementalPartial}willUpdate(t){if(t.has("opsDataProvider")&&this.bindOpsDataProvider(),this.incrementalActive){super.willUpdate(t);return}this.props==null&&(this.sduiDescriptor={});{const e=this.sduiKey?this.props[this.sduiKey]:this.props,s=t.has("profile"),i=t.has("partial");if(this.sduiDescriptor==e&&!s&&!i)return;this.sduiDescriptor=e,this.updateContents()}super.willUpdate(t)}disconnectedCallback(){this.opsUnsub?.(),this.opsUnsub=void 0,super.disconnectedCallback()}async updateContents(){if(!this.sduiDescriptor)return;const t={};Object.assign(t,Pl,this.sduiDescriptor.library),this.sduiDescriptor.library=t,this.loadAssets(),await this.loadLibrary(),await this.transformSDUIDescriptor(),this.rebuildNodeIndex(),this.parseRootNodes()}rebuildNodeIndex(){this.nodeIndex.clear();const t=e=>{e.nodeId&&this.nodeIndex.set(e.nodeId,e),e.nodes?.forEach(t)};if(this.sduiDescriptor.nodeById)for(const e of Object.keys(this.sduiDescriptor.nodeById)){const s=this.sduiDescriptor.nodeById[e];s.nodeId||(s.nodeId=e),this.nodeIndex.set(e,s),t(s)}if(this.sduiDescriptor.nodes?.forEach(t),this.sduiDescriptor.library)for(const e of Object.keys(this.sduiDescriptor.library))t(this.sduiDescriptor.library[e])}removeChildren(){for(;[...this.children].filter(t=>t.nodeName!="SLOT").length>0;)this.removeChild(this.children[0])}loadAssets(){if(this.sduiDescriptor){if(this.sduiDescriptor.js?.length)if(this.isSafeProfile)console.warn(Bd(this.sduiDescriptor.js));else for(const t of this.sduiDescriptor.js)gs.loadJS(t);if(this.sduiDescriptor.css)for(const t of this.sduiDescriptor.css)gs.loadCSS(t)}}async transformSDUIDescriptor(){if(!this.hasAttribute("transformation"))return;const e=await(await fetch(this.getAttribute("transformation"))).json();await new Rd().transform(this.sduiDescriptor,e)}async loadLibrary(){if(!this.hasAttribute("library"))return;const e=await(await fetch(this.getAttribute("library"))).json();this.sduiDescriptor.library=e}parseRootNodes(){if(this.removeChildren(),!this.sduiDescriptor)return;let t=this.sduiDescriptor.nodes;t||(t=[]);const e={tagName:"sonic-toast-message-subscriber",attributes:{}};this.messagesKey&&(e.attributes={subDataProvider:this.messagesKey}),t.push(e),t.forEach((s,i)=>{const r=this.parseChild(s,`nodes[${i}]`);r&&this.appendChild(r)})}parseChild(t,e="node"){if(this.isSafeProfile&&zd(t))return console.warn(qd(e,t)),null;if(t.nodeId&&this.renderingStack.has(t.nodeId))return console.warn(`sonic-sdui : cycle détecté sur nodeId="${t.nodeId}" (${e})`),this.isPartialMode?xl(t.nodeId):null;t.nodeId&&this.renderingStack.add(t.nodeId);try{const s=t.tagName||"div";let{element:i,contentElement:r}=this.handleLibrary(t,s,e);if(!i)return null;this.handleAttributes(t,i),i=this.handleMarkup(t,i),r||(r=i),this.handleChildNodes(t,r,i,e),this.handleTextContent(t,r),this.handleInnerHTML(t,r);let n=i;return(t.prefix||t.suffix)&&(n=this.handlePrefixSuffix(t,i)),this.bindAction(t,n),t.nodeId&&n.setAttribute(ao,t.nodeId),n}finally{t.nodeId&&this.renderingStack.delete(t.nodeId)}}handlePrefixSuffix(t,e){const s=document.createElement("div");return s.innerHTML=(t.prefix||"")+e.outerHTML+(t.suffix||""),s.style.display="contents",s}bindAction(t,e){const s=t.action;s?.name&&e.addEventListener("click",()=>{const i={name:s.name,context:s.context??{},sourceNodeId:t.nodeId};this.dispatchEvent(new CustomEvent("sdui-action",{detail:i,bubbles:!0,composed:!0}))})}handleChildNodes(t,e,s,i){if(t.nodes){const r=t.nodes;for(let n=0;n<r.length;n++){const o=r[n],c=this.parseChild(o,`${i}.nodes[${n}]`);c&&this.appendChildElement(o,c,e,s)}}if(t.childNodeIds?.length)for(const r of t.childNodeIds){const n=this.nodeIndex.get(r);if(n){const o=this.parseChild(n,`${i}.childNodeIds[${r}]`);o&&this.appendChildElement(n,o,e,s);continue}this.isPartialMode?this.appendToTarget(e,xl(r)):console.warn(`sonic-sdui : childNodeId "${r}" introuvable (${i}) — ignoré (activez partial pour un placeholder)`)}}appendChildElement(t,e,s,i){let r=s;t.parentElementSelector&&(r=i.querySelector(t.parentElementSelector)||s),this.appendToTarget(r,e)}appendToTarget(t,e){t.shadowRoot?t.shadowRoot.appendChild(e):t.tagName.toLocaleLowerCase()=="template"?t.content.appendChild(e):t.appendChild(e)}handleLibrary(t,e,s){let i,r;if(t.libraryKey&&this.sduiDescriptor.library){const n=`library.${t.libraryKey}`;if(i=this.parseChild(this.sduiDescriptor.library[t.libraryKey]||{tagName:"div"},n),!i)return console.warn(`sonic-sdui (profile="safe") : nœud ignoré (${s}) — modèle libraryKey="${t.libraryKey}" refusé`),{element:null,contentElement:void 0};const o=(this.sduiDescriptor.library[t.libraryKey]||{}).contentElementSelector;o&&(r=i.querySelector(o))}else i=document.createElement(e);return{element:i,contentElement:r}}handleAttributes(t,e){const s=t.attributes;for(const i in s){const r=s[i],n=Yr.isObject(r)?JSON.stringify(r):r;e.setAttribute(i,n)}}handleMarkup(t,e){return t.markup&&(e=document.createElement("div"),e.style.display="contents",e.innerHTML=t.markup),e}handleTextContent(t,e){t.textContent==null||!e||t.nodes?.length||t.childNodeIds?.length||(e.textContent=t.textContent)}handleInnerHTML(t,e){if(t.innerHTML)if(t.innerHTML.indexOf("wording_")!=-1){const s=this.getAncestorAttributeValue("wordingProvider");this.api?.post(s,{labels:[t.innerHTML.substring(8)]}).then(i=>{e&&(e.innerHTML+=i)})}else e&&(e.innerHTML+=t.innerHTML)}upsertNode(t,e,s){if(!t.nodeId){console.warn('sonic-sdui.upsertNode : "nodeId" est requis');return}this.beginIncremental();const i=t.nodeId;if(this.sduiDescriptor.nodeById||(this.sduiDescriptor.nodeById={}),this.sduiDescriptor.nodeById[i]=t,this.nodeIndex.set(i,t),e){let r=this.nodeIndex.get(e)||this.sduiDescriptor.nodeById[e];r||(r={nodeId:e,tagName:"div",childNodeIds:[]},this.sduiDescriptor.nodeById[e]=r,this.nodeIndex.set(e,r),this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]),this.sduiDescriptor.nodes.some(c=>c.nodeId===e)||this.sduiDescriptor.nodes.push(r)),r.childNodeIds||(r.childNodeIds=[]);const n=r.childNodeIds.indexOf(i);n>=0&&r.childNodeIds.splice(n,1);const o=s!=null?Math.max(0,Math.min(s,r.childNodeIds.length)):r.childNodeIds.length;r.childNodeIds.splice(o,0,i)}else{this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]);const r=this.sduiDescriptor.nodes,n=r.findIndex(o=>o.nodeId===i);n>=0?r[n]=t:s!=null?r.splice(Math.max(0,Math.min(s,r.length)),0,t):r.push(t)}this.rebuildNodeIndex(),this.domUpsertNode(t,e,s)}removeNode(t){if(this.beginIncremental(),delete this.sduiDescriptor.nodeById?.[t],this.nodeIndex.delete(t),this.sduiDescriptor.nodes&&(this.sduiDescriptor.nodes=this.sduiDescriptor.nodes.filter(e=>e.nodeId!==t)),this.sduiDescriptor.nodeById)for(const e of Object.values(this.sduiDescriptor.nodeById))e.childNodeIds&&(e.childNodeIds=e.childNodeIds.filter(s=>s!==t));this.findDomNode(t)?.remove()}setData(t,e){const s=Lt(t);if(s){s.set(e);return}if(this.dataProvider){const i=Lt(`${this.dataProvider}.${t}`);if(i){i.set(e);return}}console.warn(`sonic-sdui.setData : chemin introuvable "${t}"`)}applyOp(t){switch(t.op){case"upsertNode":this.upsertNode(t.node,t.parentId,t.index);break;case"removeNode":this.removeNode(t.nodeId);break;case"setData":this.setData(t.path,t.value);break;default:console.warn("sonic-sdui.applyOp : op inconnue",t)}}endIncremental(){this.incrementalActive=!1,this.incrementalPartial=!1}beginIncremental(){if(!this.incrementalActive){if(this.sduiDescriptor=structuredClone(this.sduiDescriptor||{}),this.sduiDescriptor.nodeById||(this.sduiDescriptor.nodeById={}),this.sduiDescriptor.nodes||(this.sduiDescriptor.nodes=[]),!this.sduiDescriptor.library){const t={};Object.assign(t,Pl),this.sduiDescriptor.library=t}this.incrementalActive=!0,this.incrementalPartial=!0,this.rebuildNodeIndex()}}findDomNode(t){const e=typeof CSS<"u"&&CSS.escape?CSS.escape(t):t.replace(/"/g,'\\"');return this.querySelector(`[${ao}="${e}"]`)}domUpsertNode(t,e,s){const i=this.parseChild(t,`upsert:${t.nodeId}`);if(!i)return;const r=this.findDomNode(t.nodeId);if(r&&r!==i){r.replaceWith(i);return}if(r===i)return;if(e){const o=this.findDomNode(e);if(o){const c=Array.from(o.children);s!=null&&s<c.length?o.insertBefore(i,c[s]):o.appendChild(i);return}}const n=this.querySelector("sonic-toast-message-subscriber");n?this.insertBefore(i,n):this.appendChild(i)}bindOpsDataProvider(){this.opsUnsub?.(),this.opsUnsub=void 0;const t=this.opsDataProvider;if(!t)return;const e=Lt(t);if(!e)return;const s=r=>{if(r==null)return;const n=Array.isArray(r)?r:[r];for(const o of n)o&&typeof o=="object"&&"op"in o&&this.applyOp(o)};e.onAssign(s),this.opsUnsub=()=>e.offAssign(s);const i=e.get();i!=null&&s(i)}};Ar([h()],sr.prototype,"sduiKey",2),Ar([h()],sr.prototype,"messagesKey",2),Ar([h({type:String,reflect:!0})],sr.prototype,"profile",2),Ar([h({type:Boolean,reflect:!0})],sr.prototype,"partial",2),Ar([h({type:String})],sr.prototype,"opsDataProvider",2),sr=Ar([X(Wd)],sr);var Kd=Object.defineProperty,Gd=Object.getOwnPropertyDescriptor,Cl=(t,e,s,i)=>{for(var r=i>1?void 0:i?Gd(e,s):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(r=(i?o(e,s,r):o(r))||r);return i&&r&&Kd(e,s,r),r};let tn=class extends tr(Q){constructor(){super(...arguments),this._composition={},this.listeners=[]}get composition(){return this._composition}set composition(t){this._composition=t,this.updateComposition()}connectedCallback(){super.connectedCallback(),this.updateComposition()}disconnectedCallback(){this.removePublisherListeners(),super.disconnectedCallback()}updateComposition(){this.removePublisherListeners(),this.publisher&&(this.publisher.set({}),this.parseComposition(this.composition,this.publisher))}removePublisherListeners(){const t=this.listeners;this.listeners=[],t.forEach(e=>{this.publisher.offAssign(e.subscriber)})}parseComposition(t,e){if(t)for(const s in t){const i=t[s];if(typeof i=="string"){const r=i.split("."),n=r.shift();if(!n)continue;let o=ve.get(n);o=Yr.traverse(o,r);const c={publisher:o,subscriber:d=>{e[s]=d}};this.listeners.push(c),o.onAssign(c.subscriber),e._proxies_.set(s,o)}else{this.publisher[s]={};const r=new Rr({},e);e._proxies_.set(s,r);const n={publisher:r,subscriber:o=>{e[s]=o}};this.listeners.push(n),r.onAssign(n.subscriber),this.parseComposition(i,r)}}}render(){return R`<slot></slot>`}};tn.styles=[Z`
|
|
1395
1395
|
:host {
|
|
1396
1396
|
display: contents;
|
|
1397
1397
|
}
|
|
@@ -3199,7 +3199,7 @@ ${this.value}</textarea
|
|
|
3199
3199
|
<slot></slot>
|
|
3200
3200
|
</div>`:ee}
|
|
3201
3201
|
</dialog>
|
|
3202
|
-
`}syncAdoptedStyleSheets(){if(!(this.renderRoot instanceof ShadowRoot))return;const t=Qn(this.styleSheet),e=this.renderRoot.adoptedStyleSheets.filter(s=>!this._adoptedStyleSheets.includes(s));this.renderRoot.adoptedStyleSheets=[...e,...t],this._adoptedStyleSheets=t}modalFragment(t){const e=this.options?.[t];if(!e)return ee;let s;switch(e instanceof Object?s=e:s=He(e),t){case"title":return R`<sonic-modal-title>${s}</sonic-modal-title>`;case"subtitle":return R`<sonic-modal-subtitle>${s}</sonic-modal-subtitle>`;case"content":return R`<sonic-modal-content>${s}</sonic-modal-content>`;case"actions":return R`<sonic-modal-actions>${s}</sonic-modal-actions>`;default:return ee}}async show(){this._modalElement.show(),this._animationState="in",await this.animation("in"),this._animationState="visible",this.visible=!0,this.dispatchEvent(new CustomEvent("show")),this._modalElement.focus()}async hide(){this._animationState="out",this.dispatchEvent(new CustomEvent("hide")),await this.animation("out"),this._modalElement.close(),this._animationState="hidden",this.visible=!1,this.hasAttribute("resetDataProviderOnHide")&&ve.get(this.getAttribute("resetDataProviderOnHide")).set({}),this.removeHashOnHide&&window.history.replaceState({},"",window.location.pathname),this.removeOnHide&&this.remove(),this.dispatchEvent(new CustomEvent("hidden"))}async dispose(){await this.hide(),this.remove()}static disposeAll(){Oe.modals.forEach(t=>{t.dispose()})}handleEscape(t){if(t.key==="Escape"){t.preventDefault();const e=Oe.modals.filter(s=>s._animationState!=="hidden"&&!s.forceAction);e.length>0&&e[e.length-1].hide()}}animation(t){return new Promise(e=>{const{quartOut:s,linear:i,translateY:r,durationIn:n,durationOut:o,quadOut:c}=this._animationConfig,d=this._modalElement;if(!d)return e();const
|
|
3202
|
+
`}syncAdoptedStyleSheets(){if(!(this.renderRoot instanceof ShadowRoot))return;const t=Qn(this.styleSheet),e=this.renderRoot.adoptedStyleSheets.filter(s=>!this._adoptedStyleSheets.includes(s));this.renderRoot.adoptedStyleSheets=[...e,...t],this._adoptedStyleSheets=t}modalFragment(t){const e=this.options?.[t];if(!e)return ee;let s;switch(e instanceof Object?s=e:s=He(e),t){case"title":return R`<sonic-modal-title>${s}</sonic-modal-title>`;case"subtitle":return R`<sonic-modal-subtitle>${s}</sonic-modal-subtitle>`;case"content":return R`<sonic-modal-content>${s}</sonic-modal-content>`;case"actions":return R`<sonic-modal-actions>${s}</sonic-modal-actions>`;default:return ee}}async show(){this._modalElement.show(),this._animationState="in",await this.animation("in"),this._animationState="visible",this.visible=!0,this.dispatchEvent(new CustomEvent("show")),this._modalElement.focus()}async hide(){this._animationState="out",this.dispatchEvent(new CustomEvent("hide")),await this.animation("out"),this._modalElement.close(),this._animationState="hidden",this.visible=!1,this.hasAttribute("resetDataProviderOnHide")&&ve.get(this.getAttribute("resetDataProviderOnHide")).set({}),this.removeHashOnHide&&window.history.replaceState({},"",window.location.pathname),this.removeOnHide&&this.remove(),this.dispatchEvent(new CustomEvent("hidden"))}async dispose(){await this.hide(),this.remove()}static disposeAll(){Oe.modals.forEach(t=>{t.dispose()})}handleEscape(t){if(t.key==="Escape"){t.preventDefault();const e=Oe.modals.filter(s=>s._animationState!=="hidden"&&!s.forceAction);e.length>0&&e[e.length-1].hide()}}animation(t){return new Promise(e=>{const{quartOut:s,linear:i,translateY:r,durationIn:n,durationOut:o,quadOut:c}=this._animationConfig,d=this._modalElement;if(!d)return e();const b=t==="in",A=b?n:o,m=!this.fullScreen&&b?100:0;this.fullScreen||(b?this.style.setProperty("--sc-_backdrop-opacity","0.8"):setTimeout(()=>{this.style.setProperty("--sc-_backdrop-opacity","0")},150));const f=[];this.effect==="slide"&&f.push(d.animate([{transform:b?r:"translateY(0)"},{transform:b?"translateY(0)":r}],{duration:A,easing:b?s:c,fill:"both",delay:m}));const C=this.effect==="none";f.push(d.animate([{opacity:b?0:1},{opacity:b?1:0}],{duration:C?0:A,easing:i,fill:"both",delay:C?0:m})),Promise.all(f.map(E=>E.finished)).then(()=>e())})}};Oe.styles=[Xr,Z`
|
|
3203
3203
|
:host {
|
|
3204
3204
|
--sc-modal-py: 2.5rem;
|
|
3205
3205
|
--sc-modal-px: 1.5rem;
|