@genesislcap/foundation-rapid-cdn 15.72.0 → 15.73.0-FUI-2628.4
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.
|
@@ -243,7 +243,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
243
243
|
/*! js-cookie v3.0.7 | MIT */
|
|
244
244
|
function wv(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)r!==`__proto__`&&(e[r]=n[r])}return e}var Tv={read:function(e){return e[0]===`"`&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Ev(e,t){function n(n,r,i){if(typeof document<`u`){i=wv({},t,i),typeof i.expires==`number`&&(i.expires=new Date(Date.now()+i.expires*864e5)),i.expires&&(i.expires=i.expires.toUTCString()),n=encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a=``;for(var o in i)i[o]&&(a+=`; `+o,i[o]!==!0&&(a+=`=`+i[o].split(`;`)[0]));return document.cookie=n+`=`+e.write(r,n)+a}}function r(t){if(!(typeof document>`u`||arguments.length&&!t)){for(var n=document.cookie?document.cookie.split(`; `):[],r={},i=0;i<n.length;i++){var a=n[i].split(`=`),o=a.slice(1).join(`=`);try{var s=decodeURIComponent(a[0]);if(s in r||(r[s]=e.read(o,s)),t===s)break}catch{}}return t?r[t]:r}}return Object.create({set:n,get:r,remove:function(e,t){n(e,``,wv({},t,{expires:-1}))},withAttributes:function(e){return Ev(this.converter,wv({},this.attributes,e))},withConverter:function(e){return Ev(wv({},this.converter,e),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var Dv=Ev(Tv,{path:`/`});let Ov=N.createInterface();function kv(){return navigator!=null&&navigator.credentials?`PasswordCredential`in window||(Y.warn(`PasswordCredential not available in this browser.`),!1):(Y.warn(`CredentialsContainer not available in this browser.`),!1)}function Av(e=``,t=`:`,n){return e.split(t,n).map(e=>e.trim()).filter(e=>e!==``)}function jv(e,t=`:`){let n=typeof e==`string`&&e.trim();return n?n.includes(t):!1}function Mv(e,t=`:`){return typeof e==`string`&&e.trim()?(e.match(new RegExp(t,`g`))||[]).length:0}function Nv(e,t=`:`){for(let n of e)if(jv(n,t))return n;return e.find(e=>typeof e==`string`&&e.trim()!==``)}function Pv(e,t,n){let r=typeof e==`string`&&e.trim();return!r||n&&!r.includes(n)||Mv(r)>1?n&&t&&n!==t?`${t}:${n}`:t||n:r}function Fv(e=`credential`){Y.warn(`Unable to migrate legacy ${e} to latest format. Please remove from your browser.`)}let Iv={password:!0,mediation:`optional`},Lv={cookie:{path:`/`,name:`credentials`,expires:7300,storePasswords:!1}},Rv=class{constructor(e,t=Lv){this.session=e,this.config=t}createBasicCredentials(e){return{type:Pg.BASIC,username:e.username,password:e.password,mfaToken:this.getMFAToken()}}createRefreshCredentials(e){return{type:Pg.REFRESH,username:e?.username??this.getUsername(),refreshToken:e?.refreshToken??this.getRefreshToken(),mfaToken:e?.mfaToken??this.getMFAToken()}}createSSOCredentials(e){return{type:Pg.SSO,ssoToken:e?.ssoToken??this.getSSOToken()}}validateBasicCredentials(e){return e&&!!e.username&&!!e.password}validateRefreshCredentials(e){return e&&!!e.refreshToken&&!!e.username}validateSSOCredentials(e){return e&&!!e.ssoToken}validateUserCredentialData(e,t){let n=e&&!!e.id&&!!e.name&&!e.name.includes(`:`)&&Mv(e.id)<=1;return t?n&&!!e.password:n}normaliseLegacyCredentialData(e,t){if(this.validateUserCredentialData(e,!0))return[e,!0];if(this.validateUserCredentialData(t))return[t,!1];if(e)try{let t=e,[n]=Av(t.name||t.id),[r,i]=Av(Nv([t.id,t.name]));return[{id:Pv(t.id||t.name,n,i),name:n,password:t.password||``},!0]}catch{Fv(`PasswordCredential`)}if(t)try{let e=t,[n]=Av(e.name||e.username||e.organisation),[r,i]=Av(Nv([e.organisation||e.username||e.name]));return[{id:Pv(e.id||e.username||e.name,n,i),name:n,password:e.password||``},!1]}catch{Fv(`cookie`)}return[void 0,!1]}storeCredentialsInContainer(e){return J(this,void 0,void 0,function*(){if(!kv())return;let t=new PasswordCredential(e);return Y.debug(`Storing credentials in CredentialsContainer`),navigator.credentials.store(t)})}getCredentialsFromContainer(){return J(this,arguments,void 0,function*(e=Iv){if(kv())return Y.debug(`Getting credentials from CredentialsContainer`),yield navigator.credentials.get(e)})}storeCredentialsInCookie(e){let{password:t}=e,n=dd(e,[`password`]),r=this.config.cookie.storePasswords?e:n;return Y.debug(`Storing credentials in cookie`),!!Dv.set(this.config.cookie.name,JSON.stringify(r),{expires:this.config.cookie.expires,domain:location.hostname,path:this.config.cookie.path,secure:!0})}getCredentialsFromCookie(){Y.debug(`Getting credentials from cookie`);let e=Dv.get(this.config.cookie.name);return e?JSON.parse(e):void 0}storeCredentials(e){return J(this,void 0,void 0,function*(){if(kv()){let t=yield this.storeCredentialsInContainer(e);return Promise.resolve(!!t)}return Promise.resolve(this.storeCredentialsInCookie(e))})}getCredentials(e){return J(this,void 0,void 0,function*(){return kv()?this.getCredentialsFromContainer(e):Promise.resolve(this.getCredentialsFromCookie())})}getSSOToken(){return this.session.getSessionStorageItem(`ssoToken`)}getUsername(){return this.session.getSessionStorageItem(`username`)||this.session.getLocalStorageItem(`username`)}getRefreshToken(){return this.session.getSessionStorageItem(`refreshToken`)||this.session.getLocalStorageItem(`refreshToken`)}getMFAToken(){return this.session.getSessionStorageItem(`mfaToken`)}removeCookie(){Dv.remove(this.config.cookie.name,{domain:location.hostname,path:this.config.cookie.path})}removeSSOToken(){this.session.removeSessionStorageItem(`ssoToken`)}removeUsername(){this.session.removeSessionStorageItem(`username`),this.session.removeLocalStorageItem(`username`)}removeRefreshToken(){this.session.removeSessionStorageItem(`refreshToken`),this.session.removeLocalStorageItem(`refreshToken`)}removeMFAToken(){this.session.removeSessionStorageItem(`mfaToken`)}removeAll(){this.removeCookie(),this.removeSSOToken(),this.removeUsername(),this.removeRefreshToken(),this.removeMFAToken()}preventSilentAccess(){return kv()&&navigator.credentials.preventSilentAccess()}};Rv=q([fd(0,jg),fd(1,Lt(Ov))],Rv);let zv=N.createInterface(e=>e.singleton(Rv)),Bv=e=>e?{date:e.DATE}:null,Vv=e=>e?e.map(e=>({name:e.NAME,version:e.VERSION})):[],Hv=e=>Array.isArray(e)?e.map(e=>e??``):[],Uv=e=>{try{if(e?.MESSAGE_TYPE===`EVENT_LOGIN_AUTH_ACK`){let{DETAILS:t}=e,n=e.UPDATE_QUEUE_DETAILS;return{messageType:e.MESSAGE_TYPE,sourceRef:e.SOURCE_REF,userName:e.USER_NAME,updateQueue:n?.UPDATE_QUEUE,zeroMqProxyModeEnabled:n?.ZERO_MQ_PROXY_MODE_ENABLED,zeroMqProxyInboundPort:n?.ZERO_MQ_PROXY_INBOUND_PORT,zeroMqProxyOutboundPort:n?.ZERO_MQ_PROXY_OUTBOUND_PORT,userKVs:e.USER,details:t?{system:Bv(t.SYSTEM),heartbeatIntervalSecs:t.HEARTBEAT_INTERVAL_SECONDS,failedLoginAttempts:t.FAILED_LOGIN_ATTEMPTS,rejectedLoginAttempts:t.REJECTED_LOGIN_ATTEMPTS,lastLoginDatetime:t.LAST_LOGIN_DATE_TIME,daysToPasswordExpiry:t.DAYS_TO_PASSWORD_EXPIRY,product:Vv(t.PRODUCT)}:null,permission:Hv(e.PERMISSION),profile:Hv(e.PROFILE)}}throw Error(`No Entity mapping implementation for provided DTO`)}catch(e){throw Y.error(e),e}},Wv=class{loggedUserResultChanged(){var e;(e=this.isLoggedInSubject)==null||e.next(this.isLoggedIn)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}get isLoggedIn(){return this.currentUser.isAuthenticated}constructor(e,t,n,r,i){this.session=e,this.connect=t,this.messageBuilder=n,this.credentialManager=r,this.currentUser=i,this.isWorking=!1,this.isLoggedInSubject=new Xm(this.isLoggedIn),this.currentUser.addAuthenticationChangeListener(e=>{var t;(t=this.isLoggedInSubject)==null||t.next(e.detail)})}login(e){return J(this,void 0,void 0,function*(){this.isWorking=!0;try{let t=this.messageBuilder.createLoginMessage(e),n=yield this.connect.send(t);if(!n||n.ERROR||n.DETAILS?.ERROR)throw new Fg(t,n);this.applyAuthResults({authToken:n.SESSION_AUTH_TOKEN,refreshToken:n.REFRESH_AUTH_TOKEN,profiles:n.PROFILE,username:n.USER_NAME,permissions:n.PERMISSION,sessionId:n.SESSION_ID}),this.currentUser.set(Uv(n)),this.session.setAuthResult(n),Y.debug(`Login Authentication Result:`,n)}catch(e){if(Y.error(Tg(`Login Authentication Error:`,e?.received),e),e instanceof Fg&&e.isIgnorableError())Y.warn(`Ignoring authentication error as it is a known edge case.`);else throw this.removeAuthResults(),this.currentUser.unset(),e}finally{this.isWorking=!1}return this.loggedUserResult})}logout(){return J(this,void 0,void 0,function*(){this.isWorking=!0;let e={success:!1};try{let t=this.messageBuilder.createLogoutMessage(this.loggedUserResult);this.session.deleteUserFromSessionStorage();let{CODE:n,DETAILS:r,ERROR:i,MESSAGE_TYPE:a,OIDC_LOGOUT_URL:o}=yield this.connect.send(t),s=r?.ERROR??i,c=a===Ig.LOGOUT_NACK;c&&Y.warn(`Unexpected Logout NACK received during logout.`,s),e={success:a===Ig.LOGOUT_ACK||n===Rg.SESSION_NOT_FOUND||!c,error:s},o&&window.open(o,`_self`)}catch(t){let n=new Fg(t.sentMessage,t.receivedMessage);if(Y.error(Tg(`Logout Authentication Error:`,n.received),n),n.isIgnorableError())Y.warn(`Ignoring authentication error as it is a known edge case.`),e.success=!0;else throw t}finally{this.removeAuthResults(),this.currentUser.unset(),this.isWorking=!1}return e})}reAuthFromSession(){return J(this,void 0,void 0,function*(){let e=yield this.ensureConnection(),t=this.credentialManager.createRefreshCredentials();if(e&&this.credentialManager.validateRefreshCredentials(t)){let e=this.messageBuilder.createRefreshTokenMessage(),t=yield this.connect.send(e);if(t?.MESSAGE_TYPE===Lg.EVENT_LOGIN_AUTH_ACK)return this.session.setAuthResult(t),this.currentUser.set(Uv(t)),this.applyAuthResults(this.getLoggedUserFromMessage(t)),!0}return this.session.deleteUserFromSessionStorage(),this.currentUser.unset(),!1})}ensureConnection(){return J(this,void 0,void 0,function*(){if(this.connect.isConnected)return!0;let e=this.session.getSessionStorageItem(`hostUrl`);return e?this.connect.connect(e):!1})}getLoggedUserFromMessage(e){let t=e.USER_NAME,n=e.SESSION_AUTH_TOKEN,r=e.REFRESH_AUTH_TOKEN;return!t||!n||!r?null:{username:t,authToken:n,refreshToken:r,profiles:e.PROFILE,permissions:e.PERMISSION,sessionId:e.SESSION_ID}}applyAuthResults(e){if(!e){this.removeAuthResults();return}this.loggedUserResult={authToken:e.authToken,refreshToken:e.refreshToken,profiles:e.profiles,username:e.username,permissions:e.permissions,sessionId:e.sessionId}}removeAuthResults(){this.loggedUserResult=null}};q([C],Wv.prototype,`isWorking`,void 0),q([C],Wv.prototype,`loggedUserResult`,void 0),Wv=q([fd(0,jg),fd(1,xv),fd(2,Ug),fd(3,zv),fd(4,vg)],Wv);let Gv=N.createInterface(e=>e.singleton(Wv));function Kv(e,t){let n=new Date(e),r=n.getUTCFullYear(),i=String(n.getUTCMonth()+1).padStart(2,`0`),a=String(n.getUTCDate()).padStart(2,`0`);return t?`${r}${i}${a}`:`${r}${i}${a}-${String(n.getUTCHours()).padStart(2,`0`)}:${String(n.getUTCMinutes()).padStart(2,`0`)}`}let qv={n:`
|
|
245
245
|
`,r:`\r`,t:` `,b:`\b`,f:`\f`};function Jv(e){let t=e.trim(),n=/^(['"])([\s\S]*)\1$/.exec(t);return n?n[2].replace(/\\([\s\S])/g,(e,t)=>qv[t]??t):t}function Yv(e,t){let n=e.match(/Expr\.(\w+)\(/);if(n)switch(n[1]){case`dateIsToday`:{let n=e.match(/Expr\.dateIsToday\((\w+)\)/);if(n){let[,e]=n,r=/* @__PURE__ */ new Date;t[`${e}_FROM`]=`${r.toISOString().replace(/-/g,``).split(`T`)[0]}-00:00`,r.setDate(r.getDate()+1),t[`${e}_TO`]=`${r.toISOString().replace(/-/g,``).split(`T`)[0]}-00:00`}break}case`dateTimeIsGreaterEqual`:{let n=e.match(/Expr\.dateTimeIsGreaterEqual\((\w+), ?(['"].+['"])\)/);if(n){let[,e,r]=n;t[`${e}_FROM`]=Jv(r)}break}case`dateTimeIsLessEqual`:{let n=e.match(/Expr\.dateTimeIsLessEqual\((\w+), ?(['"].+['"])\)/);if(n){let[,e,r]=n;t[`${e}_TO`]=Jv(r)}break}case`dateIsGreaterEqual`:{let n=e.match(/Expr\.dateIsGreaterEqual\((\w+), ?(['"].+['"])\)/);if(n){let[,e,r]=n;t[`${e}_FROM`]=Jv(r)}break}case`dateIsLessEqual`:{let n=e.match(/Expr\.dateIsLessEqual\((\w+), ?(['"].+['"])\)/);if(n){let[,e,r]=n;t[`${e}_TO`]=Jv(r)}break}case`containsIgnoreCase`:{let n=e.match(/Expr\.containsIgnoreCase\((\w+), ?(['"].+['"])\)/);if(n){let[,e,r]=n;t[e]=`*${Jv(r)}*`}break}}}function Xv(e,t){let n=e.indexOf(`=`),r=e.substr(0,n).trim().replace(/["']/g,``);t[r]=Jv(e.slice(n).replace(/^==?/,``))}function Zv(e){if(!e)return{};let t=e.split(`&&`).map(e=>e.trim()),n={};return t.forEach(e=>{if(e){if(e.startsWith(`Expr`))Yv(e,n);else if(/[A-Z_]+\s*(>=|<=)\s*\d+/.test(e)){let t=e.match(/([A-Z_]+)\s*>=\s*(\d+)/);if(t){let[,e,r]=t,i=parseInt(r,10),a=e.toUpperCase(),o=a.includes(`DATE`)&&!a.includes(`DATETIME`);n[`${e}_FROM`]=Kv(i,o)}let r=e.match(/([A-Z_]+)\s*<=\s*(\d+)/);if(r){let[,e,t]=r,i=parseInt(t,10),a=e.toUpperCase(),o=a.includes(`DATE`)&&!a.includes(`DATETIME`);n[`${e}_TO`]=Kv(i,o)}}else Xv(e,n)}}),n}function Qv(e,t=`ROW_REF`){let n=e=>{let n=e.DETAILS[t]??e[t],r=Object.assign(Object.assign({},e),{[t]:n});return delete r.DETAILS,r},r=[],i=[],a=[];for(let t of e.ROW)if(t.DETAILS)switch(t.DETAILS.OPERATION){case`INSERT`:r.push(n(t));break;case`MODIFY`:a.push(n(t));break;case`DELETE`:i.push(n(t));break;default:Y.error(`Unsupported operation type: '${t.DETAILS.OPERATION}'`)}return{inserts:r,deletes:i,updates:a,SOURCE_REF:e.SOURCE_REF}}var $v=class{};$v.MAX_ROWS_250=250,$v.MAX_VIEW_1000=1e3,$v.REQ_REP_POLLING_INTERVAL_MS=1e4,$v.DATASERVER_ROW_ID=`ROW_REF`,$v.REQUEST_SERVER_ROW_ID=`RECORD_ID`,$v.DEFAULT_PAGINATION_PAGE_SIZE=25,$v.DEFAULT_REQ_REP_OFFSET=0;let ey={options:{criteria:``,isSnapshot:!1,maxRows:$v.MAX_ROWS_250,maxView:$v.MAX_VIEW_1000,pollingInterval:$v.REQ_REP_POLLING_INTERVAL_MS,movingView:!1,orderBy:``,resourceName:``,reverse:!1,pollTriggerEvents:[]},criteriaToFields:Zv,dataServerResultFilter:Qv},ty=N.createInterface(e=>e.instance(ey));function ny(e){let t=e==null?NaN:Number(e);return Number.isFinite(t)?t===0?1/0:t:$v.MAX_VIEW_1000}function ry(e){return e.moreRows===!1?`end`:e.rowsHeld>=ny(e.maxView)?e.movingView?`more`:`view-full`:e.emptyReply?`stalled`:`more`}function iy(e){let t=ny(e.maxView),n=ay(e.maxView)?`${t}, the server default`:`${t}`,r=e.totalRows;if(e.status===`stalled`)return`${e.resourceName} stopped at ${e.rowsHeld} rows: the server answered MORE_ROWS with an empty page while still reporting more rows, with room left in the view (MAX_VIEW ${n}). This is not the MAX_VIEW cap; check the data server log for "Problem building client message".`;if(!e.emptyReply&&r!==void 0&&r<=e.rowsHeld)return;let i=r!==void 0&&r>e.rowsHeld,a=i?` of ${r}`:``,o=e.emptyReply||i?` and the server holds more rows past it`:`, so any rows past it are not loaded`;return`${e.resourceName} stopped at ${e.rowsHeld}${a} rows: the DATASERVER view is full at MAX_VIEW (${n})${o}. Raise ${e.attribute} past the row count to reach the rest.`}function ay(e){return e==null||!Number.isFinite(Number(e))}let oy=e=>{class t extends e{constructor(){super(),this.hasOwnProperty(`onDatasourceStatusChanged`)||(this.onDatasourceStatusChanged=e=>{let t=this.data!==void 0;!this.resourceName&&!t&&Y.warn(`Target classes must have a resourceName or data property to use the DatasourceEventHandler mixin.`);let n=e.detail;if(n.name===this.resourceName){let e=this.datasourceStatus??{isInitialized:!1,hasMetadata:!1};(e.isInitialized!==n.isInitialized||n.metadataRequired&&e.hasMetadata!==n.hasMetadata)&&(this.datasourceStatus=n)}})}datasourceStatusChanged(e,t){Y.debug(`Target classes should override the datasourceStatusChanged method of the DatasourceEventHandler mixin to respond to changes in the target datasource.`)}connectedCallback(){super.connectedCallback(),document.addEventListener(Sg,this.onDatasourceStatusChanged,{passive:!0,capture:!0})}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(Sg,this.onDatasourceStatusChanged,{capture:!0})}}return q([C],t.prototype,`datasourceStatus`,void 0),t},sy={throwWhenUnavailable:!0,throwWhenUnknown:!1},cy=N.createInterface(e=>e.instance(sy)),ly=Qd(`genesis-resources`);function uy(){return N.getOrCreateDOMContainer().get(ly)}let dy=class{constructor(e,t){this.connect=e,this.config=t}isValidResource(e){return J(this,void 0,void 0,function*(){return e=e?.trim(),e?(yield this.fetchResources(),!!this.resources.find(t=>t.RESOURCE_NAME===e)):!1})}getResourceTypeFor(e){return J(this,void 0,void 0,function*(){yield this.fetchResources();let t=this.resources.find(t=>t.RESOURCE_NAME===e);if(t)return t.RESOURCE_TYPE;let n=`${e} resource does not exist.`;if(Y.error(n),this.config.throwWhenUnknown)throw Error(n)})}getAllResources(){return J(this,void 0,void 0,function*(){return this.resources||(yield this.fetchResources()),this.resources})}destroy(){this.resources=void 0,this.resourcesPromise=void 0}fetchResources(){return J(this,void 0,void 0,function*(){if(this.resources)return Promise.resolve();if(this.resourcesPromise)yield this.resourcesPromise;else{this.resourcesPromise=this.connect.getAvailableResources();let e=yield this.resourcesPromise;if(this.resources=e?.RESOURCES,!this.resources?.length){let e=`Genesis resources unavailable.`;if(Y.error(e),this.config.throwWhenUnavailable)throw Error(e)}this.postLoadedMessage(),this.resourcesPromise=void 0}})}postLoadedMessage(){let e=uy();e.postMessage(`resources-loaded`,this.resources),e.close()}};dy=q([fd(0,xv),fd(1,cy)],dy);let fy=N.createInterface(e=>e.singleton(dy)),py=class{get initialized(){return!!this.status?.isInitialized}constructor(e,t,n,r,i){this.connect=e,this.auth=t,this.resources=n,this.config=r,this.connectEvents=i,this.fetchMetadataRequired=!0,this.startStreamRequired=!0,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.readOnly=!0,this._allParams=null,this.pollTrigger$=new Jm}triggerPoll(){this.pollTrigger$.next()}validResourceName(e){return Y.deprecated(`Datasource.validResourceName`,"Use `GenesisResources.isValidResource` instead."),!(!e||!e.trim().length)}init(e){return J(this,arguments,void 0,function*(e,t=this.fetchMetadataRequired,n=this.startStreamRequired){this.fetchMetadataRequired=t,this.options=Object.assign(Object.assign({},this.config.options),e),this.invalidateCache();let r=this.options.resourceName;return this.connect.isConnected||(yield this.connect.connect())?(yield this.resources.isValidResource(r))?(this.resourceType=yield this.resources.getResourceTypeFor(r),this.resourceType?(this.fetchMetadataRequired&&(yield this.fetchAndApplyMetadata(this.options.resourceName),this._allParams=null),Y.debug(`Initializing ${r} datasource from ${this.connect.host}`),!this.options.isSnapshot&&n&&(this.pollTrigger$=new Jm,this.stream=yield this.createStream()),Y.debug(`${r} datasource initialization ${this.initialized?`was successful.`:`has failed.`}`),this.reportStatus(),this.initialized):(Y.error(`Unable to get the resource type for ${r} datasource from ${this.connect.host}`),this.reportStatus(),!1)):(Y.error(`${r} datasource does not exist on ${this.connect.host}`),this.reportStatus(),!1):(Y.error(`Unable to connect to ${this.connect.host} to get ${r} datasource`),this.reportStatus(),!1)})}startStream(){return J(this,void 0,void 0,function*(){!this.options.isSnapshot&&this.stream===void 0&&(this.stream=yield this.createStream())})}destroy(){var e;Y.debug(`Datasource.destroy`,this.options?.resourceName),this.commitResponseUnsubscribe&&(this.commitResponseUnsubscribe(),this.commitResponseUnsubscribe=void 0),(e=this.pollTrigger$)==null||e.complete(),this.status=void 0,this.fetchMetadataRequired=!0,this.options={},this.resourceType=void 0,this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.criteriaOnlyRequest=!1,this.loadMoreCount=0,this.stream=void 0}get allResourceParams(){if(this._allParams)return this._allParams;let e;if(this.options.orderBy){if(this.criteriaOnlyRequest||this.availableIndexes?.findIndex(e=>e.NAME===this.options.orderBy)>-1)e=this.options.orderBy;else{let e=this.availableIndexes.map(e=>e.NAME);Y.warn(`Specified [orderBy] index is not valid and will not be used. See https://learn.genesis.global/docs/database/data-types/index-entities/ - Available indexes:`,e)}}return this._allParams={CRITERIA_MATCH:this.options.criteria,MAX_ROWS:this.options.maxRows,ORDER_BY:e,VIEW_NUMBER:this.options.viewNumber,FIELDS:this.options.fields,MAX_VIEW:this.options.maxView,MOVING_VIEW:this.options.movingView,REVERSE:this.options.reverse,DISABLE_POLLING:this.options.disablePolling,OFFSET:this.options.offset,POLLING_INTERVAL:this.options.pollingInterval,REQUEST:this.options.request},Y.debug(`Getting configured params:`,this._allParams),this._allParams}get dataserverOnlyParams(){return{CRITERIA_MATCH:this.allResourceParams.CRITERIA_MATCH,MAX_ROWS:this.allResourceParams.MAX_ROWS,VIEW_NUMBER:this.allResourceParams.VIEW_NUMBER,FIELDS:this.allResourceParams.FIELDS,MAX_VIEW:this.allResourceParams.MAX_VIEW,MOVING_VIEW:this.allResourceParams.MOVING_VIEW,ORDER_BY:this.allResourceParams.ORDER_BY,REVERSE:this.allResourceParams.REVERSE}}get requestOnlyParams(){let e=this.allResourceParams,{REQUEST:t}=e,n=dd(e,[`REQUEST`]);return{DETAILS:{CRITERIA_MATCH:this.options.requestAutoSetup?void 0:n.CRITERIA_MATCH,MAX_ROWS:n.MAX_ROWS,OFFSET:n.OFFSET,ORDER_BY:n.ORDER_BY,VIEW_NUMBER:n.VIEW_NUMBER},REQUEST:this.criteriaOnlyRequest?{}:t??this.buildRequestFields()}}buildRequestFields(){if(!this.options.requestAutoSetup)return{};let e=Object.fromEntries(this.requestFields.map(e=>[e.NAME,`*`])),t=this.options.criteria?this.config.criteriaToFields(this.options.criteria):{};return Object.assign(Object.assign({},e),t)}updateLoadMoreCount(e){this.loadMoreCount=e}snapshot(e){return J(this,void 0,void 0,function*(){switch(Y.debug(`Requesting snapshot for ${this.options.resourceName} (${this.resourceType}).`),this.resourceType){case xg.DATASERVER:return this.connect.snapshot(this.options.resourceName,Object.assign(Object.assign({},this.dataserverOnlyParams),e));case xg.REQUEST_SERVER:return this.connect.request(this.options.resourceName,Object.assign(Object.assign({},this.requestOnlyParams),e));default:throw Error(`Snapshot not supported for selected resource type: ${this.resourceType}`)}})}snapshotFiltered(){return J(this,arguments,void 0,function*(e=`ROW_REF`){let t=yield this.snapshot();if(Array.isArray(t))return t;if(t.REPLY)return t.REPLY;if(t.ROW)return this.config.dataServerResultFilter(t,e).inserts})}createStream(){return J(this,void 0,void 0,function*(){if(![xg.DATASERVER,xg.REQUEST_SERVER].includes(this.resourceType))throw Error(`Streaming not supported for selected resource type: ${this.resourceType}`);return this.resourceType===xg.DATASERVER?this.createDataserverStream():(Y.debug(`Creating fake stream by polling ${this.options.resourceName} REQUEST_SERVER`),this.createReqRepStream())})}createDataserverStream(){return J(this,void 0,void 0,function*(){return this.connect.stream(this.options.resourceName,e=>{},e=>Y.error(Tg(`${this.options.resourceName} stream failed`,e),e),this.dataserverOnlyParams)})}createReqRepStream(){this.commitResponseUnsubscribe=this.connectEvents.addCommitResponseListener(e=>{let{eventName:t,response:n}=e.detail;this.options.pollTriggerEvents&&this.options.pollTriggerEvents.includes(t)&&n.MESSAGE_TYPE?.endsWith(`_ACK`)&&(Y.debug(`Received commit response for ${t}, triggering poll.`),this.triggerPoll())});let e=this.allResourceParams.DISABLE_POLLING?void 0:this.allResourceParams.POLLING_INTERVAL,t=()=>{let e=this.requestOnlyParams;if(this.resourceType===xg.REQUEST_SERVER&&this.loadMoreCount>0){let t=(this.options.maxRows||25)*(this.loadMoreCount+1);e.DETAILS.MAX_ROWS=t}return cie([this.connect.isConnected$,this.auth.isLoggedIn$]).pipe(Vh(()=>this.connect.isConnected&&this.auth.isLoggedIn),Bh(()=>Dh(this.snapshot(e))))};return e?this.pollTrigger$.pipe(zh(0),Bh(()=>Fh(0,e).pipe(Bh(t)))):this.pollTrigger$.pipe(zh(0),Bh(t))}fetchAndApplyMetadata(e){return J(this,void 0,void 0,function*(){try{Y.debug(`Requesting metadata for ${this.options.resourceName} Datasource`);let e=yield this.connect.getMetadata(this.options.resourceName);e&&(this.availableIndexes=e.INDEXES??[],this.availableSortableFields=e.SORTABLE_FIELDS??[],this.availableCriteriaFields=e.CRITERIA_FIELDS??[],this.originalFieldDef=wg(e),this.fieldMetadata=Cg(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.criteriaOnlyRequest=e.CRITERIA_ONLY_REQUEST||!1,this.fetchMetadataRequired=!1),this.status=this.normaliseStatus({isInitialized:!0,metadataRequired:!0,hasMetadata:this.fieldMetadata?.length>0})}catch(t){Y.error(Tg(`Metadata Fetch failed for ${e}:`,t),t),this.status=this.normaliseStatus({isInitialized:!1,metadataRequired:!0,hasMetadata:!1})}})}reportStatus(e={}){let t=this.config.eventEmitter??document;this.status=this.normaliseStatus(e),Y.debug(`Dispatching '${Sg}'`,this.status),t?.dispatchEvent(new CustomEvent(`datasource-status-changed`,{detail:this.status,bubbles:t!==document,composed:!0}))}normaliseStatus(e){let t=e.isInitialized??this.initialized,n=e.metadataRequired??this.fetchMetadataRequired,r=e.hasMetadata??this.fieldMetadata?.length>0;return{name:this.options?.resourceName,type:this.resourceType,isInitialized:t,metadataRequired:n,hasMetadata:r}}invalidateCache(){this._allParams=null}};q([C],py.prototype,`status`,void 0),q([C],py.prototype,`fetchMetadataRequired`,void 0),q([C],py.prototype,`startStreamRequired`,void 0),q([C],py.prototype,`originalFieldDef`,void 0),q([C],py.prototype,`fieldMetadata`,void 0),q([C],py.prototype,`requestFields`,void 0),q([C],py.prototype,`customRequestFields`,void 0),q([C],py.prototype,`availableIndexes`,void 0),q([C],py.prototype,`availableSortableFields`,void 0),q([C],py.prototype,`availableCriteriaFields`,void 0),q([C],py.prototype,`criteriaOnlyRequest`,void 0),q([C],py.prototype,`loadMoreCount`,void 0),q([C],py.prototype,`readOnly`,void 0),q([C],py.prototype,`stream`,void 0),py=q([fd(0,xv),fd(1,Gv),fd(2,fy),fd(3,ty),fd(4,Eg)],py);let my=N.createInterface(e=>e.transient(py));var hy=class extends py{constructor(){super(...arguments),this.entityCache=[],this.entityMap=/* @__PURE__ */ new Map,this.rowId=`ROW_REF`,this.initialize=e=>J(this,void 0,void 0,function*(){return this.disconnect(),this.options=Object.assign({},e.options),this.mapper=e.mapper,this.initialized=yield this.init(this.options,e.fetchMeta),this.initialized?(this.subscription=this.stream.subscribe(e=>{this.sourceRef=e.SOURCE_REF,this.subscriptionLoggedOff=e.MESSAGE_TYPE===Ig.LOGOFF_ACK;let t=e.ROW;!this.subscriptionLoggedOff&&t&&this.updateCache(this.config.dataServerResultFilter(e,this.rowId))}),!0):(Y.debug(`EntityDatasource init failed for ${this.options.resourceName}`),!1)}),this.disconnect=()=>{var e;(e=this.subscription)==null||e.unsubscribe(),this.entityCache=[]}}get initialized(){return this._initialized}set initialized(e){this._initialized=e}get cache(){if(!this.initialized)throw Error(`Please initialize EntityDatasource before querying.`);return this.entityCache}get isEmpty(){return this.entityCache.length===0}updateCache(e){var t;this.isEmpty,(t=e.deletes)==null||t.forEach(e=>{let t=e[this.rowId];this.entityMap.delete(t)}),this.processRowDataUpdate(e.inserts,!0),this.processRowDataUpdate(e.updates);let n=[{}];this.entityCache=n.map(e=>this.mapper.fromDTO(e))}processRowDataUpdate(e,t=!1){e.forEach(e=>{let n=e[this.rowId],r=this.entityMap.get(n);if(r&&t)throw Error(`Existing entity found in map while inserting.`);let i=this.mapper.fromDTO(e),a=r?Object.assign(Object.assign({},r),i):i;this.entityMap.set(n,a)})}};N.createInterface(e=>e.transient(hy));function gy(e,t=`;`){return e&&e.split(t).map(e=>e.trim()).sort((e,t)=>e.localeCompare(t)).join(t)}let _y=`system-health-changed`,vy={windowEvents:[`online`,`offline`,`pageshow`],documentEvents:[`visibilitychange`],genesisConnectEvents:[`stream`,`commit`],ignoredGenesisResources:[],startDelay:5e3,checkInterval:1e4,checkTimeout:3e3,resourceChecks:e=>J(void 0,void 0,void 0,function*(){let t=yield Sv().getMoreColumns(e),n=Date.now(),r=t;return{isConnected:t.MESSAGE_TYPE===Ig.MORE_COLUMNS_ACK,lastUpdated:n,lastMessage:r}}),resourceDataLogon:({message:e,functions:t})=>{let{onMessage:n,onError:r}=t;_v().sendForStream(e,n,r)}},yy=N.createInterface(e=>e.instance(vy));var by=/* @__PURE__ */ s(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define([],r):typeof e==`object`?e.bowser=r():n.bowser=r()})(e,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){typeof Symbol<`u`&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:`Module`}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t||4&t&&typeof e==`object`&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&typeof e!=`string`)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,`a`,t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p=``,n(n.s=90)}({17:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=n(18);t.default=function(){function e(){}return e.getFirstMatch=function(e,t){var n=t.match(e);return n&&n.length>0&&n[1]||``},e.getSecondMatch=function(e,t){var n=t.match(e);return n&&n.length>1&&n[2]||``},e.matchAndReturnConst=function(e,t,n){if(e.test(t))return n},e.getWindowsVersionName=function(e){switch(e){case`NT`:return`NT`;case`XP`:return`XP`;case`NT 5.0`:return`2000`;case`NT 5.1`:return`XP`;case`NT 5.2`:return`2003`;case`NT 6.0`:return`Vista`;case`NT 6.1`:return`7`;case`NT 6.2`:return`8`;case`NT 6.3`:return`8.1`;case`NT 10.0`:return`10`;default:return}},e.getMacOSVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));t.push(0);var n=t[0],r=t[1];if(n===10)switch(r){case 5:return`Leopard`;case 6:return`Snow Leopard`;case 7:return`Lion`;case 8:return`Mountain Lion`;case 9:return`Mavericks`;case 10:return`Yosemite`;case 11:return`El Capitan`;case 12:return`Sierra`;case 13:return`High Sierra`;case 14:return`Mojave`;case 15:return`Catalina`;default:return}switch(n){case 11:return`Big Sur`;case 12:return`Monterey`;case 13:return`Ventura`;case 14:return`Sonoma`;case 15:return`Sequoia`;default:return}},e.getAndroidVersionName=function(e){var t=e.split(`.`).splice(0,2).map((function(e){return parseInt(e,10)||0}));if(t.push(0),!(t[0]===1&&t[1]<5))return t[0]===1&&t[1]<6?`Cupcake`:t[0]===1&&t[1]>=6?`Donut`:t[0]===2&&t[1]<2?`Eclair`:t[0]===2&&t[1]===2?`Froyo`:t[0]===2&&t[1]>2?`Gingerbread`:t[0]===3?`Honeycomb`:t[0]===4&&t[1]<1?`Ice Cream Sandwich`:t[0]===4&&t[1]<4?`Jelly Bean`:t[0]===4&&t[1]>=4?`KitKat`:t[0]===5?`Lollipop`:t[0]===6?`Marshmallow`:t[0]===7?`Nougat`:t[0]===8?`Oreo`:t[0]===9?`Pie`:void 0},e.getVersionPrecision=function(e){return e.split(`.`).length},e.compareVersions=function(t,n,r){r===void 0&&(r=!1);var i=e.getVersionPrecision(t),a=e.getVersionPrecision(n),o=Math.max(i,a),s=0,c=e.map([t,n],(function(t){var n=o-e.getVersionPrecision(t),r=t+Array(n+1).join(`.0`);return e.map(r.split(`.`),(function(e){return Array(20-e.length).join(`0`)+e})).reverse()}));for(r&&(s=o-Math.min(i,a)),--o;o>=s;){if(c[0][o]>c[1][o])return 1;if(c[0][o]===c[1][o]){if(o===s)return 0;--o}else if(c[0][o]<c[1][o])return-1}},e.map=function(e,t){var n,r=[];if(Array.prototype.map)return Array.prototype.map.call(e,t);for(n=0;n<e.length;n+=1)r.push(t(e[n]));return r},e.find=function(e,t){var n,r;if(Array.prototype.find)return Array.prototype.find.call(e,t);for(n=0,r=e.length;n<r;n+=1){var i=e[n];if(t(i,n))return i}},e.assign=function(e){for(var t,n,r=e,i=arguments.length,a=Array(i>1?i-1:0),o=1;o<i;o++)a[o-1]=arguments[o];if(Object.assign)return Object.assign.apply(Object,[e].concat(a));var s=function(){var e=a[t];typeof e==`object`&&e&&Object.keys(e).forEach((function(t){r[t]=e[t]}))};for(t=0,n=a.length;t<n;t+=1)s();return e},e.getBrowserAlias=function(e){return r.BROWSER_ALIASES_MAP[e]},e.getBrowserTypeByAlias=function(e){return r.BROWSER_MAP[e]||``},e}(),e.exports=t.default},18:function(e,t,n){"use strict";t.__esModule=!0,t.ENGINE_MAP=t.OS_MAP=t.PLATFORMS_MAP=t.BROWSER_MAP=t.BROWSER_ALIASES_MAP=void 0,t.BROWSER_ALIASES_MAP={AmazonBot:`amazonbot`,"Amazon Silk":`amazon_silk`,"Android Browser":`android`,BaiduSpider:`baiduspider`,Bada:`bada`,BingCrawler:`bingcrawler`,Brave:`brave`,BlackBerry:`blackberry`,"ChatGPT-User":`chatgpt_user`,Chrome:`chrome`,ClaudeBot:`claudebot`,Chromium:`chromium`,Diffbot:`diffbot`,DuckDuckBot:`duckduckbot`,DuckDuckGo:`duckduckgo`,Electron:`electron`,Epiphany:`epiphany`,FacebookExternalHit:`facebookexternalhit`,Firefox:`firefox`,Focus:`focus`,Generic:`generic`,"Google Search":`google_search`,Googlebot:`googlebot`,GPTBot:`gptbot`,"Internet Explorer":`ie`,InternetArchiveCrawler:`internetarchivecrawler`,"K-Meleon":`k_meleon`,LibreWolf:`librewolf`,Linespider:`linespider`,Maxthon:`maxthon`,"Meta-ExternalAds":`meta_externalads`,"Meta-ExternalAgent":`meta_externalagent`,"Meta-ExternalFetcher":`meta_externalfetcher`,"Meta-WebIndexer":`meta_webindexer`,"Microsoft Edge":`edge`,"MZ Browser":`mz`,"NAVER Whale Browser":`naver`,"OAI-SearchBot":`oai_searchbot`,Omgilibot:`omgilibot`,Opera:`opera`,"Opera Coast":`opera_coast`,"Pale Moon":`pale_moon`,PerplexityBot:`perplexitybot`,"Perplexity-User":`perplexity_user`,PhantomJS:`phantomjs`,PingdomBot:`pingdombot`,Puffin:`puffin`,QQ:`qq`,QQLite:`qqlite`,QupZilla:`qupzilla`,Roku:`roku`,Safari:`safari`,Sailfish:`sailfish`,"Samsung Internet for Android":`samsung_internet`,SlackBot:`slackbot`,SeaMonkey:`seamonkey`,Sleipnir:`sleipnir`,"Sogou Browser":`sogou`,Swing:`swing`,Tizen:`tizen`,"UC Browser":`uc`,Vivaldi:`vivaldi`,"WebOS Browser":`webos`,WeChat:`wechat`,YahooSlurp:`yahooslurp`,"Yandex Browser":`yandex`,YandexBot:`yandexbot`,YouBot:`youbot`},t.BROWSER_MAP={amazonbot:`AmazonBot`,amazon_silk:`Amazon Silk`,android:`Android Browser`,baiduspider:`BaiduSpider`,bada:`Bada`,bingcrawler:`BingCrawler`,blackberry:`BlackBerry`,brave:`Brave`,chatgpt_user:`ChatGPT-User`,chrome:`Chrome`,claudebot:`ClaudeBot`,chromium:`Chromium`,diffbot:`Diffbot`,duckduckbot:`DuckDuckBot`,duckduckgo:`DuckDuckGo`,edge:`Microsoft Edge`,electron:`Electron`,epiphany:`Epiphany`,facebookexternalhit:`FacebookExternalHit`,firefox:`Firefox`,focus:`Focus`,generic:`Generic`,google_search:`Google Search`,googlebot:`Googlebot`,gptbot:`GPTBot`,ie:`Internet Explorer`,internetarchivecrawler:`InternetArchiveCrawler`,k_meleon:`K-Meleon`,librewolf:`LibreWolf`,linespider:`Linespider`,maxthon:`Maxthon`,meta_externalads:`Meta-ExternalAds`,meta_externalagent:`Meta-ExternalAgent`,meta_externalfetcher:`Meta-ExternalFetcher`,meta_webindexer:`Meta-WebIndexer`,mz:`MZ Browser`,naver:`NAVER Whale Browser`,oai_searchbot:`OAI-SearchBot`,omgilibot:`Omgilibot`,opera:`Opera`,opera_coast:`Opera Coast`,pale_moon:`Pale Moon`,perplexitybot:`PerplexityBot`,perplexity_user:`Perplexity-User`,phantomjs:`PhantomJS`,pingdombot:`PingdomBot`,puffin:`Puffin`,qq:`QQ Browser`,qqlite:`QQ Browser Lite`,qupzilla:`QupZilla`,roku:`Roku`,safari:`Safari`,sailfish:`Sailfish`,samsung_internet:`Samsung Internet for Android`,seamonkey:`SeaMonkey`,slackbot:`SlackBot`,sleipnir:`Sleipnir`,sogou:`Sogou Browser`,swing:`Swing`,tizen:`Tizen`,uc:`UC Browser`,vivaldi:`Vivaldi`,webos:`WebOS Browser`,wechat:`WeChat`,yahooslurp:`YahooSlurp`,yandex:`Yandex Browser`,yandexbot:`YandexBot`,youbot:`YouBot`},t.PLATFORMS_MAP={bot:`bot`,desktop:`desktop`,mobile:`mobile`,tablet:`tablet`,tv:`tv`},t.OS_MAP={Android:`Android`,Bada:`Bada`,BlackBerry:`BlackBerry`,ChromeOS:`Chrome OS`,HarmonyOS:`HarmonyOS`,iOS:`iOS`,Linux:`Linux`,MacOS:`macOS`,PlayStation4:`PlayStation 4`,Roku:`Roku`,Tizen:`Tizen`,WebOS:`WebOS`,Windows:`Windows`,WindowsPhone:`Windows Phone`},t.ENGINE_MAP={Blink:`Blink`,EdgeHTML:`EdgeHTML`,Gecko:`Gecko`,Presto:`Presto`,Trident:`Trident`,WebKit:`WebKit`}},90:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(91))&&r.__esModule?r:{default:r},a=n(18);function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}t.default=function(){function e(){}var t,n,r;return e.getParser=function(e,t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),typeof e!=`string`)throw Error(`UserAgent should be a string`);return new i.default(e,t,n)},e.parse=function(e,t){return t===void 0&&(t=null),new i.default(e,t).getResult()},t=e,r=[{key:`BROWSER_MAP`,get:function(){return a.BROWSER_MAP}},{key:`ENGINE_MAP`,get:function(){return a.ENGINE_MAP}},{key:`OS_MAP`,get:function(){return a.OS_MAP}},{key:`PLATFORMS_MAP`,get:function(){return a.PLATFORMS_MAP}}],(n=null)&&o(t.prototype,n),r&&o(t,r),e}(),e.exports=t.default},91:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r=c(n(92)),i=c(n(93)),a=c(n(94)),o=c(n(95)),s=c(n(17));function c(e){return e&&e.__esModule?e:{default:e}}t.default=function(){function e(e,t,n){if(t===void 0&&(t=!1),n===void 0&&(n=null),e==null||e===``)throw Error(`UserAgent parameter can't be empty`);this._ua=e;var r=!1;typeof t==`boolean`?(r=t,this._hints=n):this._hints=typeof t==`object`&&t?t:null,this.parsedResult={},!0!==r&&this.parse()}var t=e.prototype;return t.getHints=function(){return this._hints},t.hasBrand=function(e){if(!this._hints||!Array.isArray(this._hints.brands))return!1;var t=e.toLowerCase();return this._hints.brands.some((function(e){return e.brand&&e.brand.toLowerCase()===t}))},t.getBrandVersion=function(e){if(this._hints&&Array.isArray(this._hints.brands)){var t=e.toLowerCase(),n=this._hints.brands.find((function(e){return e.brand&&e.brand.toLowerCase()===t}));return n?n.version:void 0}},t.getUA=function(){return this._ua},t.test=function(e){return e.test(this._ua)},t.parseBrowser=function(){var e=this;this.parsedResult.browser={};var t=s.default.find(r.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.browser=t.describe(this.getUA(),this)),this.parsedResult.browser},t.getBrowser=function(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()},t.getBrowserName=function(e){return e?String(this.getBrowser().name).toLowerCase()||``:this.getBrowser().name||``},t.getBrowserVersion=function(){return this.getBrowser().version},t.getOS=function(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()},t.parseOS=function(){var e=this;this.parsedResult.os={};var t=s.default.find(i.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.os=t.describe(this.getUA())),this.parsedResult.os},t.getOSName=function(e){var t=this.getOS().name;return e?String(t).toLowerCase()||``:t||``},t.getOSVersion=function(){return this.getOS().version},t.getPlatform=function(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()},t.getPlatformType=function(e){e===void 0&&(e=!1);var t=this.getPlatform().type;return e?String(t).toLowerCase()||``:t||``},t.parsePlatform=function(){var e=this;this.parsedResult.platform={};var t=s.default.find(a.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.platform=t.describe(this.getUA())),this.parsedResult.platform},t.getEngine=function(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()},t.getEngineName=function(e){return e?String(this.getEngine().name).toLowerCase()||``:this.getEngine().name||``},t.parseEngine=function(){var e=this;this.parsedResult.engine={};var t=s.default.find(o.default,(function(t){if(typeof t.test==`function`)return t.test(e);if(Array.isArray(t.test))return t.test.some((function(t){return e.test(t)}));throw Error(`Browser's test function is not valid`)}));return t&&(this.parsedResult.engine=t.describe(this.getUA())),this.parsedResult.engine},t.parse=function(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this},t.getResult=function(){return s.default.assign({},this.parsedResult)},t.satisfies=function(e){var t=this,n={},r=0,i={},a=0;if(Object.keys(e).forEach((function(t){var o=e[t];typeof o==`string`?(i[t]=o,a+=1):typeof o==`object`&&(n[t]=o,r+=1)})),r>0){var o=Object.keys(n),c=s.default.find(o,(function(e){return t.isOS(e)}));if(c){var l=this.satisfies(n[c]);if(l!==void 0)return l}var u=s.default.find(o,(function(e){return t.isPlatform(e)}));if(u){var d=this.satisfies(n[u]);if(d!==void 0)return d}}if(a>0){var f=Object.keys(i),p=s.default.find(f,(function(e){return t.isBrowser(e,!0)}));if(p!==void 0)return this.compareVersion(i[p])}},t.isBrowser=function(e,t){t===void 0&&(t=!1);var n=this.getBrowserName().toLowerCase(),r=e.toLowerCase(),i=s.default.getBrowserTypeByAlias(r);return t&&i&&(r=i.toLowerCase()),r===n},t.compareVersion=function(e){var t=[0],n=e,r=!1,i=this.getBrowserVersion();if(typeof i==`string`)return e[0]===`>`||e[0]===`<`?(n=e.substr(1),e[1]===`=`?(r=!0,n=e.substr(2)):t=[],e[0]===`>`?t.push(1):t.push(-1)):e[0]===`=`?n=e.substr(1):e[0]===`~`&&(r=!0,n=e.substr(1)),t.indexOf(s.default.compareVersions(i,n,r))>-1},t.isOS=function(e){return this.getOSName(!0)===String(e).toLowerCase()},t.isPlatform=function(e){return this.getPlatformType(!0)===String(e).toLowerCase()},t.isEngine=function(e){return this.getEngineName(!0)===String(e).toLowerCase()},t.is=function(e,t){return t===void 0&&(t=!1),this.isBrowser(e,t)||this.isOS(e)||this.isPlatform(e)},t.some=function(e){var t=this;return e===void 0&&(e=[]),e.some((function(e){return t.is(e)}))},e}(),e.exports=t.default},92:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=/version\/(\d+(\.?_?\d+)+)/i;t.default=[{test:[/gptbot/i],describe:function(e){var t={name:`GPTBot`},n=i.default.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chatgpt-user/i],describe:function(e){var t={name:`ChatGPT-User`},n=i.default.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/oai-searchbot/i],describe:function(e){var t={name:`OAI-SearchBot`},n=i.default.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(e){var t={name:`ClaudeBot`},n=i.default.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(e){var t={name:`Omgilibot`},n=i.default.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/diffbot/i],describe:function(e){var t={name:`Diffbot`},n=i.default.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/perplexitybot/i],describe:function(e){var t={name:`PerplexityBot`},n=i.default.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/perplexity-user/i],describe:function(e){var t={name:`Perplexity-User`},n=i.default.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/youbot/i],describe:function(e){var t={name:`YouBot`},n=i.default.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/meta-webindexer/i],describe:function(e){var t={name:`Meta-WebIndexer`},n=i.default.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/meta-externalads/i],describe:function(e){var t={name:`Meta-ExternalAds`},n=i.default.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/meta-externalagent/i],describe:function(e){var t={name:`Meta-ExternalAgent`},n=i.default.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/meta-externalfetcher/i],describe:function(e){var t={name:`Meta-ExternalFetcher`},n=i.default.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/googlebot/i],describe:function(e){var t={name:`Googlebot`},n=i.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/linespider/i],describe:function(e){var t={name:`Linespider`},n=i.default.getFirstMatch(/(?:linespider)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/amazonbot/i],describe:function(e){var t={name:`AmazonBot`},n=i.default.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/bingbot/i],describe:function(e){var t={name:`BingCrawler`},n=i.default.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/baiduspider/i],describe:function(e){var t={name:`BaiduSpider`},n=i.default.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/duckduckbot/i],describe:function(e){var t={name:`DuckDuckBot`},n=i.default.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ia_archiver/i],describe:function(e){var t={name:`InternetArchiveCrawler`},n=i.default.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{name:`FacebookExternalHit`}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(e){var t={name:`SlackBot`},n=i.default.getFirstMatch(/(?:slackbot|slack-imgproxy)(?:-[-\w]+)?[\s/](\d+(\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yahoo!?[\s/]*slurp/i],describe:function(){return{name:`YahooSlurp`}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{name:`YandexBot`}}},{test:[/pingdom/i],describe:function(){return{name:`PingdomBot`}}},{test:[/opera/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opr\/|opios/i],describe:function(e){var t={name:`Opera`},n=i.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/SamsungBrowser/i],describe:function(e){var t={name:`Samsung Internet for Android`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Whale/i],describe:function(e){var t={name:`NAVER Whale Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/PaleMoon/i],describe:function(e){var t={name:`Pale Moon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/MZBrowser/i],describe:function(e){var t={name:`MZ Browser`},n=i.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/focus/i],describe:function(e){var t={name:`Focus`},n=i.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/swing/i],describe:function(e){var t={name:`Swing`},n=i.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/coast/i],describe:function(e){var t={name:`Opera Coast`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(e){var t={name:`Opera Touch`},n=i.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/yabrowser/i],describe:function(e){var t={name:`Yandex Browser`},n=i.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/ucbrowser/i],describe:function(e){var t={name:`UC Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/Maxthon|mxios/i],describe:function(e){var t={name:`Maxthon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/epiphany/i],describe:function(e){var t={name:`Epiphany`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/puffin/i],describe:function(e){var t={name:`Puffin`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sleipnir/i],describe:function(e){var t={name:`Sleipnir`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/k-meleon/i],describe:function(e){var t={name:`K-Meleon`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/micromessenger/i],describe:function(e){var t={name:`WeChat`},n=i.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qqbrowser/i],describe:function(e){var t={name:/qqbrowserlite/i.test(e)?`QQ Browser Lite`:`QQ Browser`},n=i.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/msie|trident/i],describe:function(e){var t={name:`Internet Explorer`},n=i.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/\sedg\//i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/edg([ea]|ios)/i],describe:function(e){var t={name:`Microsoft Edge`},n=i.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/vivaldi/i],describe:function(e){var t={name:`Vivaldi`},n=i.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/seamonkey/i],describe:function(e){var t={name:`SeaMonkey`},n=i.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sailfish/i],describe:function(e){var t={name:`Sailfish`},n=i.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,e);return n&&(t.version=n),t}},{test:[/silk/i],describe:function(e){var t={name:`Amazon Silk`},n=i.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/phantom/i],describe:function(e){var t={name:`PhantomJS`},n=i.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/slimerjs/i],describe:function(e){var t={name:`SlimerJS`},n=i.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t={name:`BlackBerry`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t={name:`WebOS Browser`},n=i.default.getFirstMatch(a,e)||i.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/bada/i],describe:function(e){var t={name:`Bada`},n=i.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/tizen/i],describe:function(e){var t={name:`Tizen`},n=i.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/qupzilla/i],describe:function(e){var t={name:`QupZilla`},n=i.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/librewolf/i],describe:function(e){var t={name:`LibreWolf`},n=i.default.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/firefox|iceweasel|fxios/i],describe:function(e){var t={name:`Firefox`},n=i.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/electron/i],describe:function(e){var t={name:`Electron`},n=i.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe:function(e){var t={name:`Sogou Browser`},n=i.default.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,e),r=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e),a=i.default.getFirstMatch(/se ([\d.]+)x/i,e),o=n||r||a;return o&&(t.version=o),t}},{test:[/MiuiBrowser/i],describe:function(e){var t={name:`Miui`},n=i.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return!!e.hasBrand(`DuckDuckGo`)||e.test(/\sDdg\/[\d.]+$/i)},describe:function(e,t){var n={name:`DuckDuckGo`};if(t){var r=t.getBrandVersion(`DuckDuckGo`);if(r)return n.version=r,n}var a=i.default.getFirstMatch(/\sDdg\/([\d.]+)$/i,e);return a&&(n.version=a),n}},{test:function(e){return e.hasBrand(`Brave`)},describe:function(e,t){var n={name:`Brave`};if(t){var r=t.getBrandVersion(`Brave`);if(r)return n.version=r,n}return n}},{test:[/chromium/i],describe:function(e){var t={name:`Chromium`},n=i.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,e)||i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/chrome|crios|crmo/i],describe:function(e){var t={name:`Chrome`},n=i.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/GSA/i],describe:function(e){var t={name:`Google Search`},n=i.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t={name:`Android Browser`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/playstation 4/i],describe:function(e){var t={name:`PlayStation 4`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/safari|applewebkit/i],describe:function(e){var t={name:`Safari`},n=i.default.getFirstMatch(a,e);return n&&(t.version=n),t}},{test:[/.*/i],describe:function(e){var t=e.search(`\\(`)===-1?/^(.*)\/(.*) /:/^(.*)\/(.*)[ \t]\((.*)/;return{name:i.default.getFirstMatch(t,e),version:i.default.getSecondMatch(t,e)}}}],e.exports=t.default},93:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/Roku\/DVP/],describe:function(e){var t=i.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,e);return{name:a.OS_MAP.Roku,version:t}}},{test:[/windows phone/i],describe:function(e){var t=i.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.WindowsPhone,version:t}}},{test:[/windows /i],describe:function(e){var t=i.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,e),n=i.default.getWindowsVersionName(t);return{name:a.OS_MAP.Windows,version:t,versionName:n}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(e){var t={name:a.OS_MAP.iOS},n=i.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,e);return n&&(t.version=n),t}},{test:[/macintosh/i],describe:function(e){var t=i.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,e).replace(/[_\s]/g,`.`),n=i.default.getMacOSVersionName(t),r={name:a.OS_MAP.MacOS,version:t};return n&&(r.versionName=n),r}},{test:[/(ipod|iphone|ipad)/i],describe:function(e){var t=i.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,e).replace(/[_\s]/g,`.`);return{name:a.OS_MAP.iOS,version:t}}},{test:[/OpenHarmony/i],describe:function(e){var t=i.default.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.HarmonyOS,version:t}}},{test:function(e){var t=!e.test(/like android/i),n=e.test(/android/i);return t&&n},describe:function(e){var t=i.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,e),n=i.default.getAndroidVersionName(t),r={name:a.OS_MAP.Android,version:t};return n&&(r.versionName=n),r}},{test:[/(web|hpw)[o0]s/i],describe:function(e){var t=i.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,e),n={name:a.OS_MAP.WebOS};return t&&t.length&&(n.version=t),n}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(e){var t=i.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,e)||i.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,e)||i.default.getFirstMatch(/\bbb(\d+)/i,e);return{name:a.OS_MAP.BlackBerry,version:t}}},{test:[/bada/i],describe:function(e){var t=i.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Bada,version:t}}},{test:[/tizen/i],describe:function(e){var t=i.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.Tizen,version:t}}},{test:[/linux/i],describe:function(){return{name:a.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:a.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(e){var t=i.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,e);return{name:a.OS_MAP.PlayStation4,version:t}}}],e.exports=t.default},94:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:[/googlebot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Google`}}},{test:[/linespider/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Line`}}},{test:[/amazonbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Amazon`}}},{test:[/gptbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`OpenAI`}}},{test:[/chatgpt-user/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`OpenAI`}}},{test:[/oai-searchbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`OpenAI`}}},{test:[/baiduspider/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Baidu`}}},{test:[/bingbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Bing`}}},{test:[/duckduckbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`DuckDuckGo`}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Anthropic`}}},{test:[/omgilibot/i,/webzio-extended/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Webz.io`}}},{test:[/diffbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Diffbot`}}},{test:[/perplexitybot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Perplexity AI`}}},{test:[/perplexity-user/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Perplexity AI`}}},{test:[/youbot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`You.com`}}},{test:[/ia_archiver/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Internet Archive`}}},{test:[/meta-webindexer/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Meta`}}},{test:[/meta-externalads/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Meta`}}},{test:[/meta-externalagent/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Meta`}}},{test:[/meta-externalfetcher/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Meta`}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Meta`}}},{test:[/slackbot/i,/slack-imgProxy/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Slack`}}},{test:[/yahoo/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Yahoo`}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Yandex`}}},{test:[/pingdom/i],describe:function(){return{type:a.PLATFORMS_MAP.bot,vendor:`Pingdom`}}},{test:[/huawei/i],describe:function(e){var t=i.default.getFirstMatch(/(can-l01)/i,e)&&`Nova`,n={type:a.PLATFORMS_MAP.mobile,vendor:`Huawei`};return t&&(n.model=t),n}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Nexus`}}},{test:[/ipad/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Apple`,model:`iPad`}}},{test:[/kftt build/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`,model:`Kindle Fire HD 7`}}},{test:[/silk/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet,vendor:`Amazon`}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){var t=e.test(/ipod|iphone/i),n=e.test(/like (ipod|iphone)/i);return t&&!n},describe:function(e){var t=i.default.getFirstMatch(/(ipod|iphone)/i,e);return{type:a.PLATFORMS_MAP.mobile,vendor:`Apple`,model:t}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Nexus`}}},{test:[/Nokia/i],describe:function(e){var t=i.default.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,e),n={type:a.PLATFORMS_MAP.mobile,vendor:`Nokia`};return t&&(n.model=t),n}},{test:[/[^-]mobi/i],describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName(!0)===`blackberry`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`BlackBerry`}}},{test:function(e){return e.getBrowserName(!0)===`bada`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:function(e){return e.getBrowserName()===`windows phone`},describe:function(){return{type:a.PLATFORMS_MAP.mobile,vendor:`Microsoft`}}},{test:function(e){var t=Number(String(e.getOSVersion()).split(`.`)[0]);return e.getOSName(!0)===`android`&&t>=3},describe:function(){return{type:a.PLATFORMS_MAP.tablet}}},{test:function(e){return e.getOSName(!0)===`android`},describe:function(){return{type:a.PLATFORMS_MAP.mobile}}},{test:[/smart-?tv|smarttv/i],describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:[/netcast/i],describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`macos`},describe:function(){return{type:a.PLATFORMS_MAP.desktop,vendor:`Apple`}}},{test:function(e){return e.getOSName(!0)===`windows`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`linux`},describe:function(){return{type:a.PLATFORMS_MAP.desktop}}},{test:function(e){return e.getOSName(!0)===`playstation 4`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}},{test:function(e){return e.getOSName(!0)===`roku`},describe:function(){return{type:a.PLATFORMS_MAP.tv}}}],e.exports=t.default},95:function(e,t,n){"use strict";t.__esModule=!0,t.default=void 0;var r,i=(r=n(17))&&r.__esModule?r:{default:r},a=n(18);t.default=[{test:function(e){return e.getBrowserName(!0)===`microsoft edge`},describe:function(e){if(/\sedg\//i.test(e))return{name:a.ENGINE_MAP.Blink};var t=i.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,e);return{name:a.ENGINE_MAP.EdgeHTML,version:t}}},{test:[/trident/i],describe:function(e){var t={name:a.ENGINE_MAP.Trident},n=i.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){return e.test(/presto/i)},describe:function(e){var t={name:a.ENGINE_MAP.Presto},n=i.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:function(e){var t=e.test(/gecko/i),n=e.test(/like gecko/i);return t&&!n},describe:function(e){var t={name:a.ENGINE_MAP.Gecko},n=i.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:a.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(e){var t={name:a.ENGINE_MAP.WebKit},n=i.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,e);return n&&(t.version=n),t}}],e.exports=t.default}})}))})),xy=/* @__PURE__ */ s(((e,t)=>{t.exports=s,s.default=s,s.stable=d,s.stableStringify=d;var n=`[...]`,r=`[Circular]`,i=[],a=[];function o(){return{depthLimit:2**53-1,edgesLimit:2**53-1}}function s(e,t,n,r){r===void 0&&(r=o()),l(e,``,0,[],void 0,0,r);var s;try{s=a.length===0?JSON.stringify(e,t,n):JSON.stringify(e,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var c=i.pop();c.length===4?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}}return s}function c(e,t,n,r){var o=Object.getOwnPropertyDescriptor(r,n);o.get===void 0?(r[n]=e,i.push([r,n,t])):o.configurable?(Object.defineProperty(r,n,{value:e}),i.push([r,n,t,o])):a.push([t,n,e])}function l(e,t,i,a,o,s,u){s+=1;var d;if(typeof e==`object`&&e){for(d=0;d<a.length;d++)if(a[d]===e){c(r,e,t,o);return}if(u.depthLimit!==void 0&&s>u.depthLimit){c(n,e,t,o);return}if(u.edgesLimit!==void 0&&i+1>u.edgesLimit){c(n,e,t,o);return}if(a.push(e),Array.isArray(e))for(d=0;d<e.length;d++)l(e[d],d,d,a,e,s,u);else{var f=Object.keys(e);for(d=0;d<f.length;d++){var p=f[d];l(e[p],p,d,a,e,s,u)}}a.pop()}}function u(e,t){return e<t?-1:+(e>t)}function d(e,t,n,r){r===void 0&&(r=o());var s=f(e,``,0,[],void 0,0,r)||e,c;try{c=a.length===0?JSON.stringify(s,t,n):JSON.stringify(s,p(t),n)}catch{return JSON.stringify(`[unable to serialize, circular reference is too complex to analyze]`)}finally{for(;i.length!==0;){var l=i.pop();l.length===4?Object.defineProperty(l[0],l[1],l[3]):l[0][l[1]]=l[2]}}return c}function f(e,t,a,o,s,l,d){l+=1;var p;if(typeof e==`object`&&e){for(p=0;p<o.length;p++)if(o[p]===e){c(r,e,t,s);return}try{if(typeof e.toJSON==`function`)return}catch{return}if(d.depthLimit!==void 0&&l>d.depthLimit){c(n,e,t,s);return}if(d.edgesLimit!==void 0&&a+1>d.edgesLimit){c(n,e,t,s);return}if(o.push(e),Array.isArray(e))for(p=0;p<e.length;p++)f(e[p],p,p,o,e,l,d);else{var m={},h=Object.keys(e).sort(u);for(p=0;p<h.length;p++){var g=h[p];f(e[g],g,p,o,e,l,d),m[g]=e[g]}if(s!==void 0)i.push([s,t,e]),s[t]=m;else return m}o.pop()}}function p(e){return e=e===void 0?function(e,t){return t}:e,function(t,n){if(a.length>0)for(var r=0;r<a.length;r++){var i=a[r];if(i[1]===t&&i[0]===n){n=i[2],a.splice(r,1);break}}return e.call(this,t,n)}}})),Sy=/* @__PURE__ */ u(by()),Cy=/* @__PURE__ */ u(xy());let wy=Kd(`network-monitor`,{level:Ed.info}),Ty=Date.now(),Ey=window.navigator?.userAgent?Sy.default.parse(window.navigator.userAgent):void 0,Dy=(e,t={depthLimit:10,edgesLimit:10})=>e instanceof Event?`'${e.type}' Event`:typeof e==`string`?e:(0,Cy.default)(e,void 0,2,t);var Oy=class{constructor(){this.unsubscribableObservers=[],this.runAllChecks=(e,t)=>J(this,void 0,void 0,function*(){if(!this.isReady||this.isRunningChecks&&!t)return;wy.info(`Run health checks, triggered by`,Dy(e),`| Active resources`,this.resources.size),this.isRunningChecks=!0,this.synchroniseCheckInterval();let n=this.getFormattedTimestamp(this.getNowTimestamp()),r=yield this.isOnlineCheck();r?wy.debug(`Network connected at ${n}`):wy.warn(`Network disconnected at ${n}`);let i=this.normaliseSerializedSocketStatus(this.socketStatus.serialize(),r),a=this.preFlightSocketChecks(i);if(a||wy.debug(`Socket pre-flight checks failed`),!r||!a){wy.debug(`Aborting remaining health checks`);let e=[...this.resources].reduce((e,[t,n])=>{let i=e[n.resourceName];return i?(i.sourceRef=[...i.sourceRef,n.message.SOURCE_REF],e):Object.assign(Object.assign({},e),{[n.resourceName]:this.normaliseResourceHealth({name:n.resourceName,sourceRef:[n.message.SOURCE_REF],isConnected:n.isConnected,lastUpdated:n.lastUpdated},r)})},{});this.reportSystemHealth({isAuthenticated:this.user.isAuthenticated,isOnline:r,resources:e,resourcesAllConnected:!1,socket:i}),this.isRunningChecks=!1;return}let o=!0,s=[];this.resources.forEach((e,t)=>{let{resourceName:r,message:i,functions:a}=e,{resourceChecks:c=this.config.resourceChecks,resourceDataLogon:l=this.config.resourceDataLogon}=a,{SOURCE_REF:u}=i,d=!1,f,p,m,h,g;s.push(J(this,void 0,void 0,function*(){try{wy.debug(`Running health check against ${r}`);let e=yield Promise.race([c(u,t),lp(this.config.checkTimeout,()=>({isConnected:!1,lastUpdated:this.getNowTimestamp(),timeout:!0}))]);d=e.isConnected,f=e.lastUpdated,p=e.lastMessage,h=e.timeout}catch(e){d=!1,f=this.getNowTimestamp(),m=e,p=e?.receivedMessage??e}return g=p?.MESSAGE_TYPE===Ig.MSG_NACK||Vg(p,Og.NOT_FOUND),n=this.getFormattedTimestamp(f??this.getNowTimestamp()),d?wy.debug(`${r} is healthy at ${n}`):wy.warn(`${r} is not healthy at ${n}`),p&&wy.debug(`${r} messaged at ${n}`,Dy(p)),m&&wy.error(`${r} errored at ${n}`,Dy(m)),h&&wy.warn(`${r} timed out at ${n}`),g&&(wy.error(`${r} issue, re-attempting data logon at ${n}`),l(e)),o&&(o=d),{name:r,sourceRef:[u],isConnected:d,lastUpdated:f,lastError:m}}))});let c=(yield Promise.allSettled(s)).reduce((e,t)=>{if(t.status===`fulfilled`){let n=e[t.value.name];return n?(n.sourceRef=[...n.sourceRef,...t.value.sourceRef],e):Object.assign(Object.assign({},e),{[t.value.name]:this.normaliseResourceHealth(t.value)})}return wy.warn(`Unexpected promise rejection occurred. Please check any custom resourceChecks return MonitoredResourceChecksResult.`),e},{});wy.debug(`Health checks complete`),this.reportSystemHealth({isAuthenticated:this.user.isAuthenticated,isOnline:r,resources:c,resourcesAllConnected:o,socket:i}),this.isRunningChecks=!1}),this.config.logLevel!==void 0&&(wy.level=this.config.logLevel)}create(){if(this.resources){wy.warn(`NetworkMonitor already created. If this is intentional, please call NetworkMonitor.destroy first.`);return}this.addListeners(),this.resources=/* @__PURE__ */ new Map,setTimeout(()=>{this.isReady=!0,this.synchroniseCheckInterval(),this.runAllChecks(`NetworkMonitor.create()`)},this.config.startDelay)}destroy(){this.removeListeners(),clearInterval(this.internalId),this.resources.clear(),this.resources=void 0,this.status=void 0,this.isReady=void 0}isOnlineCheck(){return Promise.resolve(navigator.onLine)}addResource(e,t){this.resources||this.create(),this.resources.set(e,t)}removeResource(e){this.resources.delete(e)}addListeners(){var e,t;(e=this.config.windowEvents)==null||e.forEach(e=>window.addEventListener(e,this.runAllChecks)),(t=this.config.documentEvents)==null||t.forEach(e=>document.addEventListener(e,this.runAllChecks)),this.config.genesisConnectEvents.includes(`stream`)&&this.unsubscribableObservers.push(this.connectEvents.addStreamListener(({detail:e})=>{let{functions:t,message:n,resourceName:r,stream:i}=e;this.config.ignoredGenesisResources.includes(r)||this.addResource(i,{functions:t,message:n,resourceName:r})},({detail:e})=>{let{resourceName:t,stream:n}=e;this.config.ignoredGenesisResources.includes(t)||this.removeResource(n)},({detail:e})=>{let{resourceName:t,stream:n,error:r}=e,i=r.receivedMessage??r,a=``;Vg(i,Og.NOT_FOUND)?a=`Please check the resource is running.`:Vg(i,Og.FORBIDDEN)&&(a=`You are not authorised to access this resource, removing it from monitoring.`,this.removeResource(n)),wy.error(`${t} errored at ${this.getFormattedTimestamp(this.getNowTimestamp())}.`,a,r)})),this.config.genesisConnectEvents.includes(`commit`)&&this.unsubscribableObservers.push(this.connectEvents.addCommitListener(e=>{this.config.ignoredGenesisResources.includes(e.detail.eventName)||this.runAllChecks(e)})),this.unsubscribableObservers.push(this.connectEvents.addMetadataListener(({detail:e})=>{let{resourceName:t,error:n}=e;if(n){wy.error(`${t} had an unrecoverable error at ${this.getFormattedTimestamp(this.getNowTimestamp())}.`,`Please check the resource is running.`,n);return}}))}removeListeners(){var e,t;(e=this.config.windowEvents)==null||e.forEach(e=>window.removeEventListener(e,this.runAllChecks)),(t=this.config.documentEvents)==null||t.forEach(e=>document.removeEventListener(e,this.runAllChecks)),this.unsubscribableObservers.forEach(e=>e()),this.unsubscribableObservers.length=0}reportSystemHealth(e){let t=this.config.eventEmitter??document;this.status=this.normaliseEventDetail(e),(this.status.isHealthy?wy.debug:wy.warn)(`Emitting 'system-health-changed' event`,Dy(this.status)),t?.dispatchEvent(new CustomEvent(`system-health-changed`,{detail:this.status,bubbles:t!==document,composed:!0})),this.status.socket.reconnectionLimitReached&&(wy.debug(`Network monitoring no longer required. Please check your network and reload your application.`),this.destroy())}reportStabilityToGenesis(e){return J(this,void 0,void 0,function*(){return wy.debug(`User requested report stability to Genesis.`),wy.info(`Please attach this data to your Genesis Support request:
|
|
246
|
-
`,JSON.stringify(e,null,2)),!0})}normaliseResourceHealth(e,t=!0){let n=t?e.isConnected:!1,r=e.lastUpdated??this.getNowTimestamp();return Object.assign(Object.assign({},e),{isConnected:n,lastUpdated:r})}normaliseSerializedSocketStatus(e,t=!0){let n=t?e.isConnected:!1,r=!n;return Object.assign(Object.assign({},e),{isConnected:n,isDisconnected:r})}normaliseEventDetail(e){let t=!!(e.socket?.isConfigured?e.isOnline&&e.socket?.isConnected&&e.resourcesAllConnected:e.isOnline),n=e.lastUpdated??this.getNowTimestamp(),r=e.nextUpdate??this.getNextTimestamp(),i=e.isAuthenticated&&this.user?this.user.username:void 0,a=Object.assign(Object.assign({},e),{browserInformation:Ey,username:i,isHealthy:t,lastUpdated:n,nextUpdate:r,firstUpdated:Ty,runAllChecks:()=>{wy.debug(`User activated run checks command starting.`),this.runAllChecks(`user requested`)},reportStabilityToGenesis:()=>this.reportStabilityToGenesis(a)});return a}preFlightSocketChecks(e){if(!e.isConfigured)return wy.debug(`Socket not configured`),!1;if(e.isReconnecting)return wy.debug(`Socket reconnecting`),!1;if(e.isConnecting)return wy.debug(`Socket connecting`),!1;if(e.isDisconnected){let t=e.isDisconnectedByServer?`by the server, code: ${e.closedCode}, reason: ${e.closedReason}`:``;return wy.debug(`Socket disconnected ${t}`),e.reconnectionLimitReached&&wy.debug(`Socket reconnection limit reached`),!1}let t=this.user.isAuthenticated?`with`:`without`;return wy.debug(`Socket connected ${t} valid session`),!0}getFormattedTimestamp(e){return $f(e)}getNowTimestamp(){return Date.now()}getNextTimestamp(){return new Date(Date.now()+this.config.checkInterval).getTime()}synchroniseCheckInterval(){clearInterval(this.internalId),this.internalId=setInterval(()=>this.runAllChecks(`check interval`),this.config.checkInterval)}};q([yy],Oy.prototype,`config`,void 0),q([uv],Oy.prototype,`socketStatus`,void 0),q([Eg],Oy.prototype,`connectEvents`,void 0),q([vg],Oy.prototype,`user`,void 0),q([C],Oy.prototype,`status`,void 0);let ky=N.createInterface(e=>e.singleton(Oy)),Ay={account:`genesis`,namespace:`default`,authKey:`kv-default`,authEmail:void 0},jy=N.createInterface();var My;(function(e){e.REQ_KEY_VALUE_LIST=`REQ_KEY_VALUE_LIST`,e.REQ_KEY_VALUE_READ=`REQ_KEY_VALUE_READ`})(My||(My={}));var Ny;(function(e){e.EVENT_KEY_VALUE_PUT=`EVENT_KEY_VALUE_PUT`,e.EVENT_KEY_VALUE_DELETE=`EVENT_KEY_VALUE_DELETE`})(Ny||(Ny={}));let Py=class{constructor(e,t,n=Ay){this.connect=e,this.user=t,this.kvStorageConfig=n}delete(e){return J(this,void 0,void 0,function*(){let t={DETAILS:{KEYS:e}},n=yield this.connect.commitEvent(Ny.EVENT_KEY_VALUE_DELETE,t);return n&&n.MESSAGE_TYPE===`EVENT_ACK`?!0:{ERROR:n.ERROR,WARNING:n.WARNING}})}get(e){return J(this,void 0,void 0,function*(){let t={REQUEST:{USER_NAME:this.kvStorageConfig.authEmail??this.user.userName,KEY:e}},n=yield this.connect.request(My.REQ_KEY_VALUE_READ,t);if(n&&n.REPLY&&n.REPLY.length>0){let t=n.REPLY.map(e=>{let t=this.getDecodedValue(e.VALUE);return{kv:{key:e.KEY,value:t}}});return e?t[0]:t}return e?void 0:[]})}getDecodedValue(e){!e.startsWith(`str:`)&&!e.startsWith(`bin:`)&&(e=`str:${e}`);let t=Lf(e);return typeof t==`string`&&t.startsWith(`str:`)&&(t=Lf(t)),typeof t==`string`&&t.startsWith(`bin:`)&&(t=Lf(t)),t}list(){return J(this,void 0,void 0,function*(){let e={REQUEST:{USER_NAME:this.kvStorageConfig.authEmail??this.user.userName}},t=yield this.connect.request(My.REQ_KEY_VALUE_LIST,e);return t&&t.REPLY&&t.REPLY.length>0?t.REPLY.map(e=>e.KEY):[]})}put(e){return J(this,void 0,void 0,function*(){let t={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?zf(e.value):e.value}))}},n=yield this.connect.commitEvent(Ny.EVENT_KEY_VALUE_PUT,t);return n&&n.MESSAGE_TYPE===`EVENT_ACK`?!0:{ERROR:n.ERROR,WARNING:n.WARNING}})}};Py=q([fd(0,xv),fd(1,vg),fd(2,Lt(jy))],Py),N.createInterface(e=>e.singleton(Py));var Fy=class{constructor(){this.isWorking=!1,this.loggedUserResult=null,this.currentUser=null,this.isLoggedIn=!1,this.isLoggedInSubject=new Xm(!1)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}login(e){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextLoginResult)})}logout(){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextLogoutResult)})}reAuthFromSession(){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextReAuthResult)})}setTestUser(e={}){this.currentUser=new _g,this.currentUser.set(Object.assign({userName:`JaneDee`,profile:[`USER`],permission:[`CreateRules`]},e)),this.isLoggedIn=!0,this.isLoggedInSubject.next(!0)}resetTestUser(){this.currentUser=null,this.isLoggedIn=!1,this.isLoggedInSubject.next(!1)}};q([C],Fy.prototype,`isWorking`,void 0),q([C],Fy.prototype,`loggedUserResult`,void 0),q([C],Fy.prototype,`currentUser`,void 0),q([C],Fy.prototype,`isLoggedIn`,void 0);var Iy=class{constructor(){this.fetchMetadataRequired=!0,this.fetchingMetadata=!1,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.criteriaOnlyRequest=!1}init(e,t){return Promise.resolve(this.initialized)}startStream(){return Promise.resolve()}setMetadata(e){this.availableIndexes=e.INDEXES??[],this.availableSortableFields=e.SORTABLE_FIELDS??[],this.availableCriteriaFields=e.CRITERIA_FIELDS??[],this.originalFieldDef=wg(e),this.fieldMetadata=Cg(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.fetchMetadataRequired=!1}unsetMedata(){this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.fetchMetadataRequired=!0}setStream(e){this.stream=Dh(Promise.resolve(e))}unsetStream(){this.stream=void 0}deinit(){}destroy(){}validResourceName(e){return!(!e||!e.trim().length)}getMetadata(e){return Promise.resolve(this.fieldMetadata)}snapshot(e){return Promise.resolve(null)}snapshotFiltered(e){return Promise.resolve(null)}updateData(e){return Promise.resolve()}dataHandler(e){return[]}addView(e){}dropView(e){}setFilter(e,t,n){return Promise.resolve()}clearFilter(e){return Promise.resolve()}createItem(e){return Promise.resolve(``)}deleteItem(e){return Promise.resolve()}updateItem(e,t){return Promise.resolve()}get dataserverOnlyParams(){return{}}get requestOnlyParams(){return{}}updateLoadMoreCount(e){}};q([C],Iy.prototype,`status`,void 0),q([C],Iy.prototype,`fetchMetadataRequired`,void 0),q([C],Iy.prototype,`originalFieldDef`,void 0),q([C],Iy.prototype,`fieldMetadata`,void 0),q([C],Iy.prototype,`requestFields`,void 0),q([C],Iy.prototype,`customRequestFields`,void 0),q([C],Iy.prototype,`availableIndexes`,void 0),q([C],Iy.prototype,`availableSortableFields`,void 0),q([C],Iy.prototype,`availableCriteriaFields`,void 0),q([C],Iy.prototype,`criteriaOnlyRequest`,void 0),N.createInterface(e=>e.aliasTo(vg));let Ly=Kd(`foundation-ui`);var Ry=class extends oy(P){constructor(){super(...arguments),this.withGridInit=!0,this.isSnapshot=!1,this.maxRows=$v.MAX_ROWS_250,this.maxView=$v.MAX_VIEW_1000,this.resourceName=``,this.reverse=!1,this.withTimestampFormatting=!0,this.appliedDatasourceConfig={},this.requiresFullDataRefresh=!0,this.moreRowsAvailable=!1,this.pendingMoreRows=0,this.viewRowCount=0,this.nextRequestOffset=0,this.rowsSyncedWithStream=/* @__PURE__ */ new Map,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=/* @__PURE__ */ new Map,this.update=new Xm(/* @__PURE__ */ new Map),this.fetchGeneration=0}criteriaChanged(e,t){let n=e!==gy(t,`;`);this.refetchIfInitializedAndChanged(n)}dataChanged(e){e&&(this.clearData(),this.reset())}requestChanged(e,t){let n=JSON.stringify(e)!==JSON.stringify(t);this.refetchIfInitializedAndChanged(n)}refetchIfInitializedAndChanged(e){this.datasource.initialized&&e&&this.fetchGenesisData(null)}set datasourceConfig(e){e&&Object.keys(e).forEach(t=>{let n=e[t];n!==void 0&&n!==this.appliedDatasourceConfig[t]&&(this.appliedDatasourceConfig[t]=n,this[t]=n)})}disconnectedCallback(){var e,t;super.disconnectedCallback(),this.clearData(),(e=this.dataSub)==null||e.unsubscribe(),(t=this.update)==null||t.unsubscribe(),delete this.dataSub,delete this.update,this.datasource.destroy(),delete this.datasource}get effectiveRowId(){return this.rowId?this.rowId:this.datasource?.resourceType===xg.REQUEST_SERVER?$v.REQUEST_SERVER_ROW_ID:$v.DATASERVER_ROW_ID}reset(){this.requiresFullDataRefresh=!0,this.fetchGenesisData()}fetchGenesisData(){return J(this,arguments,void 0,function*(e=!0){var t;(t=this.dataSub)==null||t.unsubscribe(),this.dataSub=void 0,this.moreRowsAvailable=!1,this.pendingMoreRows=0,this.serverMoreRows=void 0,this.viewRowCount=0,this.pagingStopped=void 0,this.nextRequestOffset=0,this.fetchGeneration+=1;let n=this.fetchGeneration,r=()=>n!==this.fetchGeneration;if(this.data){this.syncComponentData(this.data);return}let i=e||!this.datasource.initialized;i||(this.connect.dataLogoff(this.sourceRef),this.clearData()),this.sourceRef=void 0;let a=yield this.datasource.init(this.datasourceOptions(),i);if(!r()){if(!a){this.handleError({message:`Genesis Datasource init failed for ${this.resourceName}`,loggerType:`error`});return}if(this.isSnapshot){let e=yield this.datasource.snapshot();if(r())return;let t=this.filterSnapshotResult(e);this.updateRequestPagingState(e,t?.length??0,this.initialRequestOffset()),this.syncComponentData(t);return}Ly.debug(`requesting stream for ${this.resourceName}`),this.dataSub=this.datasource.stream.subscribe(e=>{if(r())return;e.DISCONNECTED&&this.handleError({message:`Genesis Datasource disconnected for ${this.resourceName}`,loggerType:`error`}),this.sourceRef=e.SOURCE_REF;let t=e.ROW?Qv(e):void 0;this.updateStreamPagingState(e,t);let n=e.MESSAGE_TYPE;if(n&&n===Ig.LOGOFF_ACK){this.dataSubWasLoggedOff=!0;return}this.dataSubWasLoggedOff=!1,t?this.handleStreamUpdate(t):this.handleStreamUpdate(e)})}})}initDatasource(){return J(this,void 0,void 0,function*(){yield this.datasource.init(this.datasourceOptions(),!0)})}canRequestMoreRows(){if(!this.isConnected||!this.datasource||!this.moreRowsAvailable)return!1;switch(this.datasource.resourceType){case xg.REQUEST_SERVER:return!0;case xg.DATASERVER:return!!this.sourceRef&&!this.dataSubWasLoggedOff;default:return!1}}requestMoreRows(){return J(this,void 0,void 0,function*(){if(this.canRequestMoreRows())try{if(this.datasource.resourceType===xg.DATASERVER){this.pendingMoreRows+=1,yield this.connect.getMoreRows(this.sourceRef);return}let e=this.fetchGeneration,t=this.nextRequestOffset;this.moreRowsAvailable=!1;let n=yield this.datasource.snapshot({DETAILS:Object.assign(Object.assign({},this.datasource.requestOnlyParams?.DETAILS),{OFFSET:t})});if(e!==this.fetchGeneration)return;let r=Array.isArray(n?.REPLY)?n.REPLY:[];this.updateRequestPagingState(n,r.length,t),r.length>0&&this.handleStreamInserts(r)}catch(e){throw this.moreRowsAvailable=!0,this.pendingMoreRows=Math.max(0,this.pendingMoreRows-1),this.handleError({message:`Failed to request more rows for ${this.resourceName}`,loggerType:`error`,loggerArgs:[e]}),e}})}filterSnapshotResult(e){if(e){if(Array.isArray(e))return e;if(e.REPLY)return e.REPLY;if(e.ROW)return Qv(e).inserts}}updateStreamPagingState(e,t){let n=typeof e?.MORE_ROWS==`boolean`;if(this.datasource.resourceType!==xg.DATASERVER){n&&(this.moreRowsAvailable=e.MORE_ROWS);return}this.viewRowCount=Math.max(0,this.viewRowCount+(t?.inserts?.length??0)-(t?.deletes?.length??0));let r=!1;if(n&&(r=this.pendingMoreRows>0,this.pendingMoreRows=Math.max(0,this.pendingMoreRows-1),this.serverMoreRows=e.MORE_ROWS),this.serverMoreRows===void 0)return;let i=r&&e.MORE_ROWS===!0&&!e.ROW?.length,a=ry({moreRows:this.serverMoreRows,emptyReply:i,rowsHeld:this.viewRowCount,maxView:this.maxView});if(a===`more`&&this.pagingStopped===`view-full`)this.pagingStopped=void 0;else if((a===`view-full`||a===`stalled`)&&!this.pagingStopped){this.pagingStopped=a;let e=iy({status:a,resourceName:this.resourceName,rowsHeld:this.viewRowCount,maxView:this.maxView,emptyReply:i,attribute:`maxView`});e&&Ly.warn(e)}this.moreRowsAvailable=a===`more`&&!this.pagingStopped}updateRequestPagingState(e,t,n){if(Array.isArray(e)||!e){this.moreRowsAvailable=!1;return}let r=e,i=r.NEXT_OFFSET,a=typeof i==`number`&&i>n,o=Number(this.maxRows)||0,s=t>0&&o>0&&t>=o;this.moreRowsAvailable=typeof r.MORE_ROWS==`boolean`?r.MORE_ROWS:i!==-1&&(a||s),this.nextRequestOffset=a?i:n+t}initialRequestOffset(){return Number(this.datasource.requestOnlyParams?.DETAILS?.OFFSET)||0}datasourceOptions(){return{criteria:this.buildCriteria(),fields:this.fields,isSnapshot:this.isSnapshot,orderBy:this.orderBy,resourceName:this.resourceName,request:this.request,reverse:this.reverse,maxRows:this.maxRows,maxView:this.maxView}}handleStreamUpdate(e){e&&(e.hasOwnProperty(`REPLY`)?this.applyRequestServerData(e):this.applyDataserverData(e))}applyRequestServerData(e){var t;if(!Array.isArray(e.REPLY)||!e.MESSAGE_TYPE?.startsWith(`REP_`)){this.handleError({message:`received invalid RequestServerResult`,loggerType:`error`,loggerArgs:[e]});return}if(this.requiresFullDataRefresh){(t=e.REPLY)==null||t.forEach(e=>{this.rowsSyncedWithStream.set(e[this.effectiveRowId],e)}),this.syncComponentData(Array.from(this.rowsSyncedWithStream.values()));return}this.handleStreamInserts(e.REPLY);let n=Array.from(this.rowsSyncedWithStream.values()).filter(t=>!e.REPLY.includes(t));this.handleStreamDeletes(n)}applyDataserverData(e){var t;if(this.requiresFullDataRefresh){(t=e.inserts)==null||t.forEach(e=>{this.rowsSyncedWithStream.set(e[this.effectiveRowId],e)});let n=Array.from(this.rowsSyncedWithStream.values());this.syncComponentData(n);return}e.inserts?.length>0&&this.handleStreamInserts(e.inserts),e.deletes?.length>0&&this.handleStreamDeletes(e.deletes),e.updates?.length>0&&this.handleStreamUpdates(e.updates)}buildCriteria(){return gy((this.criteria?.split(`;`)||[]).join(` && `),`;`)}setFilter(e,t){this.criteriaFromFilters.set(e,t),this.update.next(this.criteriaFromFilters)}removeFilter(e){this.criteriaFromFilters.delete(e),this.update.next(this.criteriaFromFilters)}handleError(e={}){let{message:t,loggerType:n,loggerArgs:r=[]}=e;t&&Ly[n](t,...r)}getFieldMetadata(e){return this.datasource.fieldMetadata?.find(t=>t.name===e)}getDefaultLabelFormat(e,t){return t===bg.DATE||t===bg.DATETIME?ep(e,t===bg.DATETIME):e}};q([xv],Ry.prototype,`connect`,void 0),q([my],Ry.prototype,`datasource`,void 0),q([D({mode:`boolean`})],Ry.prototype,`withGridInit`,void 0),q([D],Ry.prototype,`criteria`,void 0),q([C],Ry.prototype,`data`,void 0),q([D],Ry.prototype,`fields`,void 0),q([D({mode:`boolean`})],Ry.prototype,`isSnapshot`,void 0),q([D],Ry.prototype,`maxRows`,void 0),q([D],Ry.prototype,`maxView`,void 0),q([D],Ry.prototype,`orderBy`,void 0),q([D],Ry.prototype,`request`,void 0),q([D],Ry.prototype,`resourceName`,void 0),q([D({mode:`boolean`})],Ry.prototype,`reverse`,void 0),q([D],Ry.prototype,`rowId`,void 0),q([D({mode:`boolean`,attribute:`with-timestamp-formatting`})],Ry.prototype,`withTimestampFormatting`,void 0);let zy=(e,t)=>!e.composedPath().includes(t),By=(e,t)=>e.composedPath().includes(t),Vy=e=>e.tagName.toLowerCase().split(`-`)[0];function Hy(e){let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement:document.activeElement}let Uy=Kd(`foundation-criteria`);var Wy;(function(e){e.AND=`&&`,e.OR=`||`,e.NOT=`!`,e.GT=`>`,e.GE=`>=`,e.LT=`<`,e.LE=`<=`,e.NE=`!=`,e.EQ=`==`})(Wy||(Wy={}));var Gy=class e{constructor(e){this.$$operator=e}static And(){return new e(Wy.AND)}static Or(){return new e(Wy.OR)}static Not(){return new e(Wy.NOT)}static GreaterThan(){return new e(Wy.GT)}static GreaterThanOrEqual(){return new e(Wy.GE)}static LessThan(){return new e(Wy.LT)}static LessThanOrEqual(){return new e(Wy.LE)}static NotEqual(){return new e(Wy.NE)}static Equal(){return new e(Wy.EQ)}get operator(){return this.$$operator}};let Ky=e=>e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`),qy=e=>`'${Ky(e)}'`,Jy=e=>{let{value:t}=e;return e.valueGetter?e.valueGetter(t):typeof t==`function`?t(e):Array.isArray(t)?t.join(`,`):typeof t==`string`?qy(t):t},Yy=e=>t=>`${t.field} ${e} ${Jy(t)}`,Xy=e=>Yy(Wy.NE)(e),Zy=e=>`${e.field}.contains(${Jy(e)})`,Qy={AND:e=>Yy(Wy.AND)(e),OR:e=>Yy(Wy.OR)(e),NOT:Xy,GT:e=>Yy(Wy.GT)(e),GE:e=>Yy(Wy.GE)(e),LT:e=>Yy(Wy.LT)(e),LE:e=>Yy(Wy.LE)(e),NE:Xy,EQ:e=>Yy(Wy.EQ)(e),equals:e=>`${e.field}.equals(${Jy(e)})`,equalsIgnoreCase:e=>`${e.field}.equalsIgnoreCase(${Jy(e)})`,contains:Zy,fieldContains:Zy,containsIgnoreCase:e=>`Expr.containsIgnoreCase(${e.field}, ${Jy(e)})`,startsWith:e=>`${e.field}.startsWith(${Jy(e)})`,endsWith:e=>`${e.field}.endsWith(${Jy(e)})`,dateIsToday:e=>`Expr.dateIsToday(${e.field})`,dateIsEqual:e=>`Expr.dateIsEqual(${e.field}, ${Jy(e)})`,dateIsGreaterEqual:e=>`Expr.dateIsGreaterEqual(${e.field}, ${Jy(e)})`,dateIsLessEqual:e=>`Expr.dateIsLessEqual(${e.field}, ${Jy(e)})`,dateTimeIsGreaterEqual:e=>`Expr.dateTimeIsGreaterEqual(${e.field}, ${Jy(e)})`,dateTimeIsLessEqual:e=>`Expr.dateTimeIsLessEqual(${e.field}, ${Jy(e)})`},$y=(e,t)=>e.flat().flatMap((e,n,r)=>r.length-1===n?e:[e,t]),eb=e=>Array.isArray(e)?e:[e],tb=`default`;var nb=class{constructor(){this.expressions={},this.And=(e,t={})=>this.withExpression(e,t,Gy.And()),this.Or=(e,t={})=>this.withExpression(e,t,Gy.Or()),this.Not=(e,t={})=>this.withExpression(e,t,Gy.Not())}withExpression(e,t={},n=Gy.And()){let{condition:r,join:i,groupName:a}=t,o=(e,t=tb)=>{let a=this.expressions[t]??[];this.expressions[t]=[...a,{join:n||i,condition:r,expression:e}]};if(Array.isArray(e)){if(i){let t=e.filter(e=>{let t=e instanceof Gy;return t&&Uy.warn(`Inline joins will be discarded when join is defined in ExpressionOptions`),!t});a?t.forEach(e=>{o(e,a)}):o($y(t,i),tb)}else o(e,tb)}else typeof e==`string`?o(e,tb):o(e,e.group);return this}build(e){let t=Object.entries(this.expressions).reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:`(${n.filter(({condition:e})=>!e||e()).map(({expression:e,join:t},n,r)=>this.parseExpression(e,r[n-1],t)).join(``)})`}),{});return e?e(t):`(${Object.values(t).join(` && `)})`}reset(){this.expressions={}}parseExpression(e,t,n){let r=[];return n&&t&&r.push(` ${n.operator} `),typeof e==`string`?r.push(e):Array.isArray(e)?(e.forEach((e,t,n)=>{if(e instanceof Gy&&n[t-1]instanceof Gy)throw Error(`Adjacent Join operations detected`)}),r.push(`(${e.map(e=>this.parseExpression(e,void 0)).join(``)})`)):e instanceof Gy?r.push(` ${e.operator} `):e&&r.push(e.serialiser(e)),r.join(``)}},rb=class{constructor(e){this.serialiser=Qy.EQ,this.build=()=>{if(!this.field)throw Error(`Missing required param 'field'`);if(this.value===void 0)throw Error(`Missing required param 'value'`);if(!this.serialiser)throw Error(`Missing required param 'serialise'`);return{field:this.field,value:this.value,serialiser:this.serialiser,params:this.params,valueGetter:this.valueGetter,group:this.group}},e&&(this.field=e.field,this.value=e.value,this.serialiser=e.serialiser,this.params=e.params,this.valueGetter=e.valueGetter,this.group=e.group)}withField(e){return this.field=e,this}withValue(e){return this.value=e,this}withSerialiser(e){return this.serialiser=e,this}withParams(e){return this.params=e,this}withValueGetter(e){return this.valueGetter=e,this}withGroup(e){return this.group=e,this}};let ib=(e=`rapid`)=>T`<${e}-segmented-control :value="${Nf(e=>e.selectedLabel)}"><slot name="label" slot='label'></slot>${j(e=>e.criteriaOptions,T`<${e}-segmented-item @click=${(e,t)=>t.parent.itemClickHandler(e.label)}value=${e=>e.label}>${e=>e.label}</${e}-segmented-item>`)}</${e}-segmented-control>`,ab=class extends Qe{constructor(){super(...arguments),this.criteriaOptions=[],this.createCriteria=e=>{let t=new nb,{field:n,serialiser:r,value:i}=e;return Array.isArray(n)||Array.isArray(i)?t.And(eb(i).map(e=>eb(n).map(t=>new rb().withField(t).withValue(e).withSerialiser(r).build())),{join:Gy.Or()}):t.And(new rb().withField(n).withValue(i).withSerialiser(r).build()),t}}valueChanged(){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}selectedLabelChanged(){let e=this.criteriaOptions.find(e=>e.label===this.selectedLabel);this.value=e?this.createCriteria(e).build():``}itemClickHandler(e){this.selectedLabel===e&&(this.selectedLabel=void 0)}};q([C],ab.prototype,`criteriaOptions`,void 0),q([C],ab.prototype,`prefix`,void 0),q([C],ab.prototype,`value`,void 0),q([C],ab.prototype,`selectedLabel`,void 0),ab=q([$e({name:`criteria-segmented-control`,template:ib(),styles:O``})],ab);function ob(e,t){let n=new nb;n.withExpression(new rb().withField(e.labelField??e.valueField).withValue(t).withSerialiser(Qy.containsIgnoreCase).build()),e.criteria=e.baseCriteria?`${e.baseCriteria} && ${n.build()}`:n.build()}function sb(e,t){let n=new nb;n.withExpression(new rb().withField(e.valueField).withValue(t).withSerialiser(Qy.equals).build()),e.criteria=e.baseCriteria?`${e.baseCriteria} && ${n.build()}`:n.build()}let cb=(e,t,n)=>T`<${t}-icon tooltip="${()=>e}" name="${()=>n}"></${t}-icon>`,lb=e=>T`<${e}-button ${k(`actionsOpener`)}id="actiosnMenuTrigger" class="actions-opener${e=>e.open?` opened`:``}" appearance="${e=>e.buttonAppearance}" part="actions-opener" @click=${e=>e.toggleActionsMenuVisibility()}>${e=>e.open?`✖`:T` ${e.name} `}</${e}-button><${e}-menu ${k(`actionsMenu`)}popover="manual" class="actions-menu ${e=>e.classNames}" part="actions-menu">${j(e=>e.allActions,T` ${A((e,t)=>e.isDisabled&&e.isDisabled(t.parent.rowData),T`<${e}-menu-item class="menu-item" tabindex="${(e,t)=>t.index}" disabled style=${(e,t)=>t.parent.hideDisabled?`display:none`:``}>${(e,t)=>t.parent.getLabel(e.name)}</${e}-menu-item>`)} ${A((e,t)=>!e.isDisabled||!e.isDisabled(t.parent.rowData),T`<${e}-menu-item class="menu-item" tabindex="${(e,t)=>t.index}" @click=${(e,t)=>t.parent.onActionMenuItemClick(e.callback)}style="${e=>e.color?`color: ${e.color};`:``}">${(e,t)=>t.parent.getLabel(e.name)}</${e}-menu-item>`)} `,{positioning:!0})}</${e}-menu>`,ub=e=>T`<${e}-button appearance="${e=>e.buttonAppearance}" part="actions-opener" class="actions-opener" @click=${e=>e?.singleOption.callback(e.rowData)}?disabled=${e=>e?.singleOption.isDisabled&&e?.singleOption.isDisabled(e.rowData)}>${e=>e.getLabel(e?.singleOption.name)}</${e}-button>`,db=T`<div class="actions-container${e=>e.isVertical?` actions-vertical`:``}" part="actions-container">${e=>e.getTemplate(Vy(e))}</div>`;var fb=class extends P{constructor(){super(...arguments),this.isVertical=!1,this.addDefaultActions=!0,this.autoCloseOnAction=!0,this.name=`Actions`,this.open=!1,this.hideDisabled=!1,this.hideMenuSingleOption=!1}disconnectedCallback(){this.actionsMenu?.matches(`:popover-open`)&&this.actionsMenu.hidePopover(),super.disconnectedCallback()}updateMenuPosition(){let e=this.actionsOpener.getBoundingClientRect();this.actionsMenu.style.position=`fixed`,this.actionsMenu.style.top=`${e.top}px`,this.actionsMenu.style.left=`auto`,this.actionsMenu.style.right=`${window.innerWidth-e.right}px`}definitionChanged(e,t){this.actions=t?.actions??[],delete this.definition.actions,t.buttonText&&(this.name=t.buttonText,delete this.definition.customButtonText),t.isVertical&&(this.isVertical=t.isVertical,delete this.definition.isVertical),t.buttonAppearance&&(this.buttonAppearance=t.buttonAppearance,delete this.definition.buttonAppearance),t.hideMenuSingleOption&&(this.hideMenuSingleOption=t.hideMenuSingleOption,delete this.definition.hideMenuSingleOption)}openChanged(){this.classNames=dn([`visible`,this.open],[`hidden`,!this.open]),this.open?(this.updateMenuPosition(),this.actionsMenu.showPopover()):this.actionsMenu?.matches(`:popover-open`)&&this.actionsMenu.hidePopover()}toggleActionsMenuVisibility(){this.open=!this.open}onActionMenuItemClick(e){this.autoCloseOnAction&&(this.open=!1),e(this.rowData)}get allActions(){let e=[{name:`✖`,callback:()=>this.open=!1}];return this.addDefaultActions?[...this.actions??[],...e]:this.actions}get rowData(){if(!this.definition)return;let{node:e,data:t}=this.definition;return e?.data||t}getLabel(e){return typeof e==`function`?e(this.rowData):e}getTemplate(e){if(!this.hideMenuSingleOption)return lb(e);let t=this.actions.filter(e=>!e.isDisabled||!e.isDisabled(this.rowData));if(this.singleOption=null,t.length!==0)return t.length===1?(this.singleOption=t[0],ub(e)):lb(e)}};q([C],fb.prototype,`actions`,void 0),q([D({attribute:`is-vertical`,mode:`boolean`})],fb.prototype,`isVertical`,void 0),q([D({attribute:`add-default-actions`,mode:`boolean`})],fb.prototype,`addDefaultActions`,void 0),q([D({attribute:`auto-close-on-action`,mode:`boolean`})],fb.prototype,`autoCloseOnAction`,void 0),q([C],fb.prototype,`classNames`,void 0),q([C],fb.prototype,`definition`,void 0),q([D],fb.prototype,`name`,void 0),q([D({attribute:`open`,mode:`boolean`})],fb.prototype,`open`,void 0),q([D],fb.prototype,`buttonAppearance`,void 0),q([D({attribute:`hide-disabled`,mode:`boolean`})],fb.prototype,`hideDisabled`,void 0),q([D({attribute:`hide-menu-single-option`,mode:`boolean`})],fb.prototype,`hideMenuSingleOption`,void 0),q([C],fb.prototype,`singleOption`,void 0),fb.compose({baseName:`actions-menu`,styles:Rne,template:db});let pb=()=>{};function mb(e){let t=new AbortController,n=e.filter(e=>e!=null),r=n.find(e=>e.aborted);if(r)return t.abort(r.reason),{signal:t.signal,dispose:pb};function i(){for(let e of n)e.removeEventListener(`abort`,a)}function a(){t.abort(this.reason),i()}for(let e of n)e.addEventListener(`abort`,a);return{signal:t.signal,dispose:i}}let hb=!1;try{typeof GENX_ENABLE_AI<`u`&&(hb=GENX_ENABLE_AI===`true`)}catch{}let gb=()=>hb||Vf(`ai`),_b=Kd(`foundation-ai`);function vb(){return typeof window<`u`&&(`SpeechRecognition`in window||`webkitSpeechRecognition`in window)}function yb(e,t){if(!vb())return null;let n=new(window.SpeechRecognition||window.webkitSpeechRecognition);n.continuous=!0,n.interimResults=!0,n.lang=`en-US`;let r=``;return n.onresult=t=>{let n=``,i=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e][0].transcript;t.results[e].isFinal?i+=r:n+=r}i?(r+=i,e(r,!0)):n&&e(r+n,!1)},n.onerror=e=>{e.error!==`aborted`&&t?.(e.error||`Speech recognition error`)},n.start(),()=>{try{n.stop()}catch{}}}var bb=class{getStatus(){return J(this,void 0,void 0,function*(){return{provider:`none`,model:``}})}interpretCriteria(e,t){return J(this,void 0,void 0,function*(){return null})}};let xb=Object.freeze({anthropic:`Anthropic`,gemini:`Gemini`,openai:`OpenAI`,chrome:`Chrome`});Object.freeze([`anthropic`,`gemini`]),new Map(Object.entries(xb).map(([e,t])=>[t.toLowerCase(),e]));var Sb=class extends Error{constructor(e,t,n,r,i){super(`${e} request refused: the AI usage budget is exhausted`+(t==null?``:` (spent ${n==null?`an unknown amount`:`$${n}`} of a $${t} budget)`)+(r?`: ${r}`:``)+`. Retrying will not clear this — the budget must be raised.`),this.vendorLabel=e,this.budgetUsd=t,this.spentUsd=n,this.detail=r,this.name=`BudgetExhaustedError`,this.otherVendorAvailable=i?.otherVendorAvailable,this.serverVendor=i?.serverVendor}};let Cb=(e,t)=>e===402||t===`BUDGET_EXCEEDED`,wb=e=>{try{return JSON.parse(e)}catch{return}},Tb=e=>{let t=e?.code;return typeof t==`string`?t:void 0},Eb=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,Db=e=>typeof e==`boolean`?e:void 0,Ob=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function kb(e,t,n){let r=typeof t==`object`&&t?t:{},i=typeof r.details==`object`&&r.details!==null?r.details:{},a=typeof r.error==`string`?r.error:n;return new Sb(e,Eb(r.budgetUsd)??Eb(i.budgetUsd),Eb(r.spentUsd)??Eb(i.spentUsd),a,{otherVendorAvailable:Db(r.otherVendorAvailable)??Db(i.otherVendorAvailable),serverVendor:Ob(r.vendor)??Ob(i.vendor)})}var Ab=class extends Error{constructor(e,t,n,r,i){super(`${e} refused the request (${t})`+(n==null?``:` — HTTP ${n}`)+(r?` ${r}`:``)+(i?`: ${i}`:``)+`. Retrying will not clear this — the provider account must be fixed.`),this.vendorLabel=e,this.kind=t,this.upstreamStatus=n,this.upstreamType=r,this.detail=i,this.name=`ProviderRefusedError`}};let jb=Object.freeze([/credit balance/i,/usage limit/i,/spend limit/i,/insufficient (credit|funds|balance)/i]),Mb=Object.freeze([`authentication_error`,`permission_error`]);function Nb(e){let t=typeof e==`object`&&e?e:{};for(let e of[t.error,t.details?.error])if(typeof e==`object`&&e){let{type:t,message:n}=e;return{type:typeof t==`string`?t:void 0,message:typeof n==`string`?n:void 0}}}function Pb(e){let t=typeof e==`object`&&e?e:{},n=typeof t.details==`object`&&t.details!==null?t.details:{};for(let e of[t.kind,n.kind])if(e===`auth`||e===`spend`)return e}function Fb(e){let t=Nb(e);if(t?.type){if(Mb.includes(t.type))return`auth`;if(t.type===`billing_error`)return`spend`}}function Ib(e,t,n){if(t===`PROVIDER_REFUSED`)return Pb(n)??Fb(n)??`spend`;if(e!==`anthropic`)return;let r=Fb(n);if(r)return r;let i=Nb(n);if(i?.type===`invalid_request_error`&&i.message){let e=i.message;if(jb.some(t=>t.test(e)))return`spend`}}function Lb(e,t,n,r,i){let a=Nb(r);return new Ab(e,t,n,a?.type,a?.message??i)}function Rb(e){return Object.entries(xb).find(([,t])=>t===e)?.[0]}let zb=[`gemini-2.5-pro`,`gemini-2.5-flash`,`gemini-2.5-flash-lite`,`gemini-3.8-flash`,`gemini-3.5-flash`,`gemini-3.1-flash-lite`,`gemini-3.1-pro-preview`],Bb=[`claude-fable-5`,`claude-opus-4-8`,`claude-opus-4-7`,`claude-sonnet-5`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`];function Vb(e){return e===`image/jpg`?`image/jpeg`:e}function Hb(e){return e.replace(/^data:[^,]*;base64,/,``)}let Ub=.5;function Wb(e,{defaultTemp:t,maxTemp:n}){let r=Math.min(Math.max(e,0),1);return r<=Ub?r/Ub*t:t+(r-Ub)/.5*(n-t)}let Gb=1e6,Kb={"claude-haiku-4-5-20251001":{promptPerMillion:1,candidatePerMillion:5},"claude-fable-5":{promptPerMillion:10,candidatePerMillion:50},"claude-opus-4-8":{promptPerMillion:5,candidatePerMillion:25},"claude-opus-4-7":{promptPerMillion:5,candidatePerMillion:25},"claude-sonnet-5":{promptPerMillion:2,candidatePerMillion:10},"claude-sonnet-4-6":{promptPerMillion:3,candidatePerMillion:15}};function qb(e){return Kb[e]}function Jb(e,t){let{promptPerMillion:n,candidatePerMillion:r}=qb(e),i=Gb,a=Math.max(0,t.cacheWriteTokens-t.cacheWrite1hTokens),o=t.uncachedInputTokens/i*n,s=t.cacheReadTokens/i*n*.1,c=a/i*n*1.25+t.cacheWrite1hTokens/i*n*2,l=t.outputTokens/i*r,u=t.cacheReadTokens/i*n,d=t.cacheWriteTokens/i*n;return{costUsd:o+s+c+l,savedUsd:u-s+(d-c),breakdown:{promptUsd:o,cacheReadUsd:s,cacheWriteUsd:c,candidateUsd:l}}}let Yb={"gemini-2.5-flash-lite":{kind:`flat`,rate:{promptPerMillion:.1,candidatePerMillion:.4}},"gemini-2.5-flash":{kind:`flat`,rate:{promptPerMillion:.3,candidatePerMillion:2.5}},"gemini-2.5-pro":{kind:`tiered`,standard:{promptPerMillion:1.25,candidatePerMillion:10},longContext:{promptPerMillion:2.5,candidatePerMillion:15}},"gemini-3.1-flash-lite":{kind:`flat`,rate:{promptPerMillion:.25,candidatePerMillion:1.5}},"gemini-3.5-flash":{kind:`flat`,rate:{promptPerMillion:1.5,candidatePerMillion:9}},"gemini-3.8-flash":{kind:`flat`,rate:{promptPerMillion:.75,candidatePerMillion:3.75}},"gemini-3.1-pro-preview":{kind:`tiered`,standard:{promptPerMillion:2,candidatePerMillion:12},longContext:{promptPerMillion:4,candidatePerMillion:18}}};function Xb(e,t){let n=Yb[e];return n.kind===`flat`?n.rate:t>2e5?n.longContext:n.standard}function Zb(e,t){let{promptPerMillion:n,candidatePerMillion:r}=Xb(e,t.promptTokens),i=Gb,a=Math.max(0,t.promptTokens-t.cachedTokens)/i*n,o=t.cachedTokens/i*n*.1,s=(t.candidateTokens+t.thoughtTokens)/i*r;return{costUsd:a+o+s,savedUsd:t.cachedTokens/i*n-o,breakdown:{promptUsd:a,cacheReadUsd:o,cacheWriteUsd:0,candidateUsd:s}}}let Qb=[`properties`,`patternProperties`,`$defs`,`definitions`],$b=[`anyOf`,`oneOf`,`allOf`,`prefixItems`],ex=[`items`,`not`,`additionalProperties`,`propertyNames`,`contains`],tx=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nx(e){if(Array.isArray(e))return e.map(nx);if(tx(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=nx(r);return t}return e}function rx(e,t,n){let r={};for(let[i,a]of Object.entries(e)){let e=`${n}/${i}`;r[i]=Qb.includes(i)&&tx(a)?Object.fromEntries(Object.entries(a).map(([n,r])=>[n,tx(r)?t(r,`${e}/${n}`):nx(r)])):$b.includes(i)&&Array.isArray(a)?a.map((n,r)=>tx(n)?t(n,`${e}/${r}`):nx(n)):ex.includes(i)?tx(a)?t(a,e):Array.isArray(a)?a.map((n,r)=>tx(n)?t(n,`${e}/${r}`):nx(n)):nx(a):nx(a)}return r}function ix(e,t,n=``){return t(rx(e,(e,n)=>ix(e,t,n),n),n)}let ax=[`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],ox=[`oneOf`,`not`];function sx(e){let t=[],n=[],r=[];return{schema:ix(e,(e,i)=>{for(let n of ax)n in e&&(delete e[n],t.push(`${i}/${n}`));typeof e.minItems==`number`&&e.minItems>1&&(delete e.minItems,t.push(`${i}/minItems`));for(let t of ox)t in e&&r.push(`${i}/${t}`);return(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)||tx(e.properties))&&e.additionalProperties!==!1&&(e.additionalProperties!==void 0&&n.push(`${i}/additionalProperties`),e.additionalProperties=!1),e}),stripped:t,overridden:n,undroppable:r}}function cx(e,t){let{schema:n,stripped:r,overridden:i,undroppable:a}=sx(e);return r.length&&_b.warn(`AnthropicTransport: tool "${t}" requested schema enforcement; these keywords cannot be enforced and were removed — validate them yourself: ${r.join(`, `)}`),i.length&&_b.warn(`AnthropicTransport: tool "${t}" requested schema enforcement, which requires closed objects; \`additionalProperties\` was set to false at: ${i.join(`, `)}. The tool now accepts fewer inputs than its schema declared.`),a.length&&_b.warn(`AnthropicTransport: tool "${t}" uses schema keywords enforcement cannot express (${a.join(`, `)}). They cannot be removed without changing the schema's meaning, so the request will be rejected. Rewrite them or drop enforceSchema for this tool.`),n}let lx=[`additionalProperties`,`examples`,`multipleOf`,`patternProperties`,`$defs`,`definitions`];function ux(e,t){if(!t.startsWith(`#/`))return;let n=e;for(let e of t.slice(2).split(`/`)){if(!tx(n))return;n=n[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return tx(n)?n:void 0}function dx(e,t,n,r){let i=t,a=n,o=typeof i.$ref==`string`?i.$ref:void 0;for(;o&&!a.has(o);){let t=ux(e,o);if(!t)break;let{$ref:n}=i,r=dd(i,[`$ref`]);i=Object.assign(Object.assign({},nx(t)),r),a=/* @__PURE__ */ new Set([...a,o]),o=typeof i.$ref==`string`?i.$ref:void 0}return typeof i.$ref==`string`&&r.push(i.$ref),rx(i,t=>dx(e,t,a,r),``)}function fx(e){let t=[],n=dx(e,e,/* @__PURE__ */ new Set,t);return t.length&&_b.warn(`GeminiTransport: these \`$ref\` pointers could not be inlined — a cycle, a typo, or an external ref: ${[...new Set(t)].join(`, `)}. They are left in the schema, so Gemini will reject this declaration; that is deliberate, because dropping them would send a node that constrains nothing.`),ix(n,e=>{if(Array.isArray(e.type)){let t=e.type.filter(e=>e!==`null`);t.length===1&&e.type.length!==t.length&&(e.type=t[0],e.nullable=!0)}if(Array.isArray(e.anyOf)){let t=e.anyOf.filter(tx),n=t.filter(e=>e.type!==`null`);if(t.length===2&&n.length===1){let{anyOf:t}=e,r=dd(e,[`anyOf`]);return Object.assign(Object.assign(Object.assign({},n[0]),r),{nullable:!0})}}`const`in e&&(e.enum=[e.const],delete e.const);for(let t of lx)delete e[t];for(let t of Object.keys(e))t.startsWith(`$`)&&t!==`$ref`&&delete e[t];return e})}function px(e,t,n){return(e instanceof DOMException||e instanceof Error)&&(e.name===`AbortError`||e.name===`TimeoutError`)?n?.aborted?n.reason:t.aborted?t.reason:e:e}function mx(e,t){return new Promise((n,r)=>{let i=()=>t?.reason??new DOMException(`The operation was aborted.`,`AbortError`);if(t?.aborted){r(i());return}let a=()=>{clearTimeout(o),r(i())},o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let hx=Object.freeze({NO_API_KEY:`NO_API_KEY`,BAD_API_KEY:`BAD_API_KEY`,KEY_UNREADABLE:`KEY_UNREADABLE`,MODEL_NOT_ALLOWED:`MODEL_NOT_ALLOWED`,BAD_REQUEST:`BAD_REQUEST`,FALLBACKS_NOT_SUPPORTED:`FALLBACKS_NOT_SUPPORTED`,REQUEST_TOO_LARGE:`REQUEST_TOO_LARGE`,VENDOR_UNREACHABLE:`VENDOR_UNREACHABLE`}),gx=new Set(Object.values(hx));function _x(e){return typeof e==`string`&&gx.has(e)?e:void 0}let vx=Object.freeze({SIGNED_OUT:`SIGNED_OUT`,ACCESS_DENIED:`ACCESS_DENIED`}),yx=e=>{if(!e||typeof e!=`object`)return!1;let{MESSAGE_TYPE:t,ERROR:n}=e;return t===`MSG_NACK`||Array.isArray(n)},bx=e=>e?.code!==void 0;function xx(e,t,n){if(e!==401&&e!==403||bx(t))return;let r=typeof n==`string`&&n.trim()===``;if(yx(t)||r)return e===401?vx.SIGNED_OUT:vx.ACCESS_DENIED}function Sx(e,t){return e===413&&t===void 0}function Cx(e){let t=e?.ERROR,n=Array.isArray(t)?t[0]?.TEXT:void 0;return typeof n==`string`&&n?n:void 0}let wx=`The AI service refused the assistant's request. An administrator can find the details in the browser console.`;Object.freeze({NO_API_KEY:`The assistant isn't set up yet. An administrator needs to add an API key for its AI service.`,BAD_API_KEY:`The assistant can't use its AI service key. An administrator needs to check the key.`,KEY_UNREADABLE:`The assistant can't read its AI service key. An administrator needs to check how the key is stored.`,MODEL_NOT_ALLOWED:`The assistant asked for an AI model this app doesn't allow. An administrator needs to check the app's allowed models.`,BAD_REQUEST:wx,FALLBACKS_NOT_SUPPORTED:wx,REQUEST_TOO_LARGE:`This request is too large to send. Start a new conversation or send a shorter message, and if you attached a file, try a smaller one.`,VENDOR_UNREACHABLE:`The AI service can't be reached right now. Please try again in a few minutes. If it keeps happening, tell an administrator.`,SIGNED_OUT:`Your session has ended. Sign in again to use the assistant.`,ACCESS_DENIED:`You don't have access to the assistant. An administrator can give you access.`});let Tx=e=>e!==hx.VENDOR_UNREACHABLE;var Ex=class extends Error{constructor(e,t,n,r){super(`${e} AI service refused the request (${n} ${t})`),this.vendorLabel=e,this.code=t,this.status=n,this.detail=r,this.name=`AIServiceError`}get terminal(){return Tx(this.code)}};function Dx(e){let t=e?.error;return typeof t==`string`&&t?t:void 0}let Ox=Object.freeze([/prompt is too long/i,/input token count .* exceeds/i,/maximum context length/i,/context[_ ]length[_ ]exceeded/i,/too many (input )?tokens/i]),kx=/(\d[\d,]{2,})\D{0,40}?(?:>|exceeds)\D{0,80}?(\d[\d,]{2,})/i;var Ax=class extends Error{constructor(e,t,n,r){super(`${e} rejected the request — the prompt exceeds the model context window`+(t!=null&&n!=null?` (${t} > ${n})`:``)+(r?`: ${r}`:``)+`. Retrying will not clear this — the conversation must be compacted.`),this.vendorLabel=e,this.promptTokens=t,this.limitTokens=n,this.detail=r,this.name=`ContextOverflowError`}};function jx(e){if(!e||typeof e!=`object`)return[];let t=[],n=(e,r)=>{if(!(r>4||!e||typeof e!=`object`))for(let i of Object.values(e))typeof i==`string`?t.push(i):typeof i==`object`&&n(i,r+1)};return n(e,0),t}function Mx(e,t,n){if(t===400)for(let e of jx(n)){if(!Ox.some(t=>t.test(e)))continue;let t=kx.exec(e);return{promptTokens:t?Number(t[1].replace(/,/g,``)):void 0,limitTokens:t?Number(t[2].replace(/,/g,``)):void 0,message:e}}}function Nx(e,t,n,r){return J(this,void 0,void 0,function*(){let i=e.getReader(),a=new TextDecoder,o=``,s=e=>/* @__PURE__ */ Error(`${n} proxy sent a malformed frame: ${e.slice(0,120)}`),c=e=>{if(!e)return;let t;try{t=JSON.parse(e)}catch{throw s(e)}if(typeof t!=`object`||!t||Array.isArray(t))throw s(e);let i=t;if(i.t===`ok`){if(i.body==null)throw Error(`${n} proxy sent an ok frame without a body`);return i}if(i.t===`err`){if(typeof i.status!=`number`)throw Error(`${n} proxy sent an err frame without a numeric status`);return i}if(i.t===`ping`){if(r>0&&typeof i.sinceLastEventMs==`number`&&i.sinceLastEventMs>r)throw new DOMException(`${n} request stalled: proxy reported ${i.sinceLastEventMs}ms since the last upstream event (exceeds ${r}ms)`,`TimeoutError`);return}};try{for(;;){let{done:e,value:n}=yield i.read();if(e)break;t(),o+=a.decode(n,{stream:!0});let r=o.indexOf(`
|
|
246
|
+
`,JSON.stringify(e,null,2)),!0})}normaliseResourceHealth(e,t=!0){let n=t?e.isConnected:!1,r=e.lastUpdated??this.getNowTimestamp();return Object.assign(Object.assign({},e),{isConnected:n,lastUpdated:r})}normaliseSerializedSocketStatus(e,t=!0){let n=t?e.isConnected:!1,r=!n;return Object.assign(Object.assign({},e),{isConnected:n,isDisconnected:r})}normaliseEventDetail(e){let t=!!(e.socket?.isConfigured?e.isOnline&&e.socket?.isConnected&&e.resourcesAllConnected:e.isOnline),n=e.lastUpdated??this.getNowTimestamp(),r=e.nextUpdate??this.getNextTimestamp(),i=e.isAuthenticated&&this.user?this.user.username:void 0,a=Object.assign(Object.assign({},e),{browserInformation:Ey,username:i,isHealthy:t,lastUpdated:n,nextUpdate:r,firstUpdated:Ty,runAllChecks:()=>{wy.debug(`User activated run checks command starting.`),this.runAllChecks(`user requested`)},reportStabilityToGenesis:()=>this.reportStabilityToGenesis(a)});return a}preFlightSocketChecks(e){if(!e.isConfigured)return wy.debug(`Socket not configured`),!1;if(e.isReconnecting)return wy.debug(`Socket reconnecting`),!1;if(e.isConnecting)return wy.debug(`Socket connecting`),!1;if(e.isDisconnected){let t=e.isDisconnectedByServer?`by the server, code: ${e.closedCode}, reason: ${e.closedReason}`:``;return wy.debug(`Socket disconnected ${t}`),e.reconnectionLimitReached&&wy.debug(`Socket reconnection limit reached`),!1}let t=this.user.isAuthenticated?`with`:`without`;return wy.debug(`Socket connected ${t} valid session`),!0}getFormattedTimestamp(e){return $f(e)}getNowTimestamp(){return Date.now()}getNextTimestamp(){return new Date(Date.now()+this.config.checkInterval).getTime()}synchroniseCheckInterval(){clearInterval(this.internalId),this.internalId=setInterval(()=>this.runAllChecks(`check interval`),this.config.checkInterval)}};q([yy],Oy.prototype,`config`,void 0),q([uv],Oy.prototype,`socketStatus`,void 0),q([Eg],Oy.prototype,`connectEvents`,void 0),q([vg],Oy.prototype,`user`,void 0),q([C],Oy.prototype,`status`,void 0);let ky=N.createInterface(e=>e.singleton(Oy)),Ay={account:`genesis`,namespace:`default`,authKey:`kv-default`,authEmail:void 0},jy=N.createInterface();var My;(function(e){e.REQ_KEY_VALUE_LIST=`REQ_KEY_VALUE_LIST`,e.REQ_KEY_VALUE_READ=`REQ_KEY_VALUE_READ`})(My||(My={}));var Ny;(function(e){e.EVENT_KEY_VALUE_PUT=`EVENT_KEY_VALUE_PUT`,e.EVENT_KEY_VALUE_DELETE=`EVENT_KEY_VALUE_DELETE`})(Ny||(Ny={}));let Py=class{constructor(e,t,n=Ay){this.connect=e,this.user=t,this.kvStorageConfig=n}delete(e){return J(this,void 0,void 0,function*(){let t={DETAILS:{KEYS:e}},n=yield this.connect.commitEvent(Ny.EVENT_KEY_VALUE_DELETE,t);return n&&n.MESSAGE_TYPE===`EVENT_ACK`?!0:{ERROR:n.ERROR,WARNING:n.WARNING}})}get(e){return J(this,void 0,void 0,function*(){let t={REQUEST:{USER_NAME:this.kvStorageConfig.authEmail??this.user.userName,KEY:e}},n=yield this.connect.request(My.REQ_KEY_VALUE_READ,t);if(n&&n.REPLY&&n.REPLY.length>0){let t=n.REPLY.map(e=>{let t=this.getDecodedValue(e.VALUE);return{kv:{key:e.KEY,value:t}}});return e?t[0]:t}return e?void 0:[]})}getDecodedValue(e){!e.startsWith(`str:`)&&!e.startsWith(`bin:`)&&(e=`str:${e}`);let t=Lf(e);return typeof t==`string`&&t.startsWith(`str:`)&&(t=Lf(t)),typeof t==`string`&&t.startsWith(`bin:`)&&(t=Lf(t)),t}list(){return J(this,void 0,void 0,function*(){let e={REQUEST:{USER_NAME:this.kvStorageConfig.authEmail??this.user.userName}},t=yield this.connect.request(My.REQ_KEY_VALUE_LIST,e);return t&&t.REPLY&&t.REPLY.length>0?t.REPLY.map(e=>e.KEY):[]})}put(e){return J(this,void 0,void 0,function*(){let t={DETAILS:{RECORDS:e.map(e=>({KEY:e.key,VALUE:e.base64?zf(e.value):e.value}))}},n=yield this.connect.commitEvent(Ny.EVENT_KEY_VALUE_PUT,t);return n&&n.MESSAGE_TYPE===`EVENT_ACK`?!0:{ERROR:n.ERROR,WARNING:n.WARNING}})}};Py=q([fd(0,xv),fd(1,vg),fd(2,Lt(jy))],Py),N.createInterface(e=>e.singleton(Py));var Fy=class{constructor(){this.isWorking=!1,this.loggedUserResult=null,this.currentUser=null,this.isLoggedIn=!1,this.isLoggedInSubject=new Xm(!1)}get isLoggedIn$(){return this.isLoggedInSubject.asObservable()}login(e){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextLoginResult)})}logout(){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextLogoutResult)})}reAuthFromSession(){return J(this,void 0,void 0,function*(){return Promise.resolve(this.nextReAuthResult)})}setTestUser(e={}){this.currentUser=new _g,this.currentUser.set(Object.assign({userName:`JaneDee`,profile:[`USER`],permission:[`CreateRules`]},e)),this.isLoggedIn=!0,this.isLoggedInSubject.next(!0)}resetTestUser(){this.currentUser=null,this.isLoggedIn=!1,this.isLoggedInSubject.next(!1)}};q([C],Fy.prototype,`isWorking`,void 0),q([C],Fy.prototype,`loggedUserResult`,void 0),q([C],Fy.prototype,`currentUser`,void 0),q([C],Fy.prototype,`isLoggedIn`,void 0);var Iy=class{constructor(){this.fetchMetadataRequired=!0,this.fetchingMetadata=!1,this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.customRequestFields=[],this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.criteriaOnlyRequest=!1}init(e,t){return Promise.resolve(this.initialized)}startStream(){return Promise.resolve()}setMetadata(e){this.availableIndexes=e.INDEXES??[],this.availableSortableFields=e.SORTABLE_FIELDS??[],this.availableCriteriaFields=e.CRITERIA_FIELDS??[],this.originalFieldDef=wg(e),this.fieldMetadata=Cg(this.originalFieldDef),this.requestFields=e.REQUEST_FIELD||[],this.customRequestFields=e.FIELD||[],this.fetchMetadataRequired=!1}unsetMedata(){this.availableIndexes=[],this.availableSortableFields=[],this.availableCriteriaFields=[],this.originalFieldDef=[],this.fieldMetadata=[],this.requestFields=[],this.fetchMetadataRequired=!0}setStream(e){this.stream=Dh(Promise.resolve(e))}unsetStream(){this.stream=void 0}deinit(){}destroy(){}validResourceName(e){return!(!e||!e.trim().length)}getMetadata(e){return Promise.resolve(this.fieldMetadata)}snapshot(e){return Promise.resolve(null)}snapshotFiltered(e){return Promise.resolve(null)}updateData(e){return Promise.resolve()}dataHandler(e){return[]}addView(e){}dropView(e){}setFilter(e,t,n){return Promise.resolve()}clearFilter(e){return Promise.resolve()}createItem(e){return Promise.resolve(``)}deleteItem(e){return Promise.resolve()}updateItem(e,t){return Promise.resolve()}get dataserverOnlyParams(){return{}}get requestOnlyParams(){return{}}updateLoadMoreCount(e){}};q([C],Iy.prototype,`status`,void 0),q([C],Iy.prototype,`fetchMetadataRequired`,void 0),q([C],Iy.prototype,`originalFieldDef`,void 0),q([C],Iy.prototype,`fieldMetadata`,void 0),q([C],Iy.prototype,`requestFields`,void 0),q([C],Iy.prototype,`customRequestFields`,void 0),q([C],Iy.prototype,`availableIndexes`,void 0),q([C],Iy.prototype,`availableSortableFields`,void 0),q([C],Iy.prototype,`availableCriteriaFields`,void 0),q([C],Iy.prototype,`criteriaOnlyRequest`,void 0),N.createInterface(e=>e.aliasTo(vg));let Ly=Kd(`foundation-ui`);var Ry=class extends oy(P){constructor(){super(...arguments),this.withGridInit=!0,this.isSnapshot=!1,this.maxRows=$v.MAX_ROWS_250,this.maxView=$v.MAX_VIEW_1000,this.resourceName=``,this.reverse=!1,this.withTimestampFormatting=!0,this.appliedDatasourceConfig={},this.requiresFullDataRefresh=!0,this.moreRowsAvailable=!1,this.pendingMoreRows=0,this.viewRowCount=0,this.nextRequestOffset=0,this.rowsSyncedWithStream=/* @__PURE__ */ new Map,this.dataSubWasLoggedOff=!1,this.criteriaFromFilters=/* @__PURE__ */ new Map,this.update=new Xm(/* @__PURE__ */ new Map),this.fetchGeneration=0}criteriaChanged(e,t){let n=e!==gy(t,`;`);this.refetchIfInitializedAndChanged(n)}dataChanged(e){e&&(this.clearData(),this.reset())}requestChanged(e,t){let n=JSON.stringify(e)!==JSON.stringify(t);this.refetchIfInitializedAndChanged(n)}refetchIfInitializedAndChanged(e){this.datasource.initialized&&e&&this.fetchGenesisData(null)}set datasourceConfig(e){e&&Object.keys(e).forEach(t=>{let n=e[t];n!==void 0&&n!==this.appliedDatasourceConfig[t]&&(this.appliedDatasourceConfig[t]=n,this[t]=n)})}disconnectedCallback(){var e,t;super.disconnectedCallback(),this.clearData(),(e=this.dataSub)==null||e.unsubscribe(),(t=this.update)==null||t.unsubscribe(),delete this.dataSub,delete this.update,this.datasource.destroy(),delete this.datasource}get effectiveRowId(){return this.rowId?this.rowId:this.datasource?.resourceType===xg.REQUEST_SERVER?$v.REQUEST_SERVER_ROW_ID:$v.DATASERVER_ROW_ID}reset(){this.requiresFullDataRefresh=!0,this.fetchGenesisData()}fetchGenesisData(){return J(this,arguments,void 0,function*(e=!0){var t;(t=this.dataSub)==null||t.unsubscribe(),this.dataSub=void 0,this.moreRowsAvailable=!1,this.pendingMoreRows=0,this.serverMoreRows=void 0,this.viewRowCount=0,this.pagingStopped=void 0,this.nextRequestOffset=0,this.fetchGeneration+=1;let n=this.fetchGeneration,r=()=>n!==this.fetchGeneration;if(this.data){this.syncComponentData(this.data);return}let i=e||!this.datasource.initialized;i||this.clearData(),this.sourceRef=void 0;let a=yield this.datasource.init(this.datasourceOptions(),i);if(!r()){if(!a){this.handleError({message:`Genesis Datasource init failed for ${this.resourceName}`,loggerType:`error`});return}if(this.isSnapshot){let e=yield this.datasource.snapshot();if(r())return;let t=this.filterSnapshotResult(e);this.updateRequestPagingState(e,t?.length??0,this.initialRequestOffset()),this.syncComponentData(t);return}Ly.debug(`requesting stream for ${this.resourceName}`),this.dataSub=this.datasource.stream.subscribe(e=>{if(r())return;e.DISCONNECTED&&this.handleError({message:`Genesis Datasource disconnected for ${this.resourceName}`,loggerType:`error`}),this.sourceRef=e.SOURCE_REF;let t=e.ROW?Qv(e):void 0;this.updateStreamPagingState(e,t);let n=e.MESSAGE_TYPE;if(n&&n===Ig.LOGOFF_ACK){this.dataSubWasLoggedOff=!0;return}this.dataSubWasLoggedOff=!1,t?this.handleStreamUpdate(t):this.handleStreamUpdate(e)})}})}initDatasource(){return J(this,void 0,void 0,function*(){yield this.datasource.init(this.datasourceOptions(),!0)})}canRequestMoreRows(){if(!this.isConnected||!this.datasource||!this.moreRowsAvailable)return!1;switch(this.datasource.resourceType){case xg.REQUEST_SERVER:return!0;case xg.DATASERVER:return!!this.sourceRef&&!this.dataSubWasLoggedOff;default:return!1}}requestMoreRows(){return J(this,void 0,void 0,function*(){if(this.canRequestMoreRows())try{if(this.datasource.resourceType===xg.DATASERVER){this.pendingMoreRows+=1,yield this.connect.getMoreRows(this.sourceRef);return}let e=this.fetchGeneration,t=this.nextRequestOffset;this.moreRowsAvailable=!1;let n=yield this.datasource.snapshot({DETAILS:Object.assign(Object.assign({},this.datasource.requestOnlyParams?.DETAILS),{OFFSET:t})});if(e!==this.fetchGeneration)return;let r=Array.isArray(n?.REPLY)?n.REPLY:[];this.updateRequestPagingState(n,r.length,t),r.length>0&&this.handleStreamInserts(r)}catch(e){throw this.moreRowsAvailable=!0,this.pendingMoreRows=Math.max(0,this.pendingMoreRows-1),this.handleError({message:`Failed to request more rows for ${this.resourceName}`,loggerType:`error`,loggerArgs:[e]}),e}})}filterSnapshotResult(e){if(e){if(Array.isArray(e))return e;if(e.REPLY)return e.REPLY;if(e.ROW)return Qv(e).inserts}}updateStreamPagingState(e,t){let n=typeof e?.MORE_ROWS==`boolean`;if(this.datasource.resourceType!==xg.DATASERVER){n&&(this.moreRowsAvailable=e.MORE_ROWS);return}this.viewRowCount=Math.max(0,this.viewRowCount+(t?.inserts?.length??0)-(t?.deletes?.length??0));let r=!1;if(n&&(r=this.pendingMoreRows>0,this.pendingMoreRows=Math.max(0,this.pendingMoreRows-1),this.serverMoreRows=e.MORE_ROWS),this.serverMoreRows===void 0)return;let i=r&&e.MORE_ROWS===!0&&!e.ROW?.length,a=ry({moreRows:this.serverMoreRows,emptyReply:i,rowsHeld:this.viewRowCount,maxView:this.maxView});if(a===`more`&&this.pagingStopped===`view-full`)this.pagingStopped=void 0;else if((a===`view-full`||a===`stalled`)&&!this.pagingStopped){this.pagingStopped=a;let e=iy({status:a,resourceName:this.resourceName,rowsHeld:this.viewRowCount,maxView:this.maxView,emptyReply:i,attribute:`maxView`});e&&Ly.warn(e)}this.moreRowsAvailable=a===`more`&&!this.pagingStopped}updateRequestPagingState(e,t,n){if(Array.isArray(e)||!e){this.moreRowsAvailable=!1;return}let r=e,i=r.NEXT_OFFSET,a=typeof i==`number`&&i>n,o=Number(this.maxRows)||0,s=t>0&&o>0&&t>=o;this.moreRowsAvailable=typeof r.MORE_ROWS==`boolean`?r.MORE_ROWS:i!==-1&&(a||s),this.nextRequestOffset=a?i:n+t}initialRequestOffset(){return Number(this.datasource.requestOnlyParams?.DETAILS?.OFFSET)||0}datasourceOptions(){return{criteria:this.buildCriteria(),fields:this.fields,isSnapshot:this.isSnapshot,orderBy:this.orderBy,resourceName:this.resourceName,request:this.request,reverse:this.reverse,maxRows:this.maxRows,maxView:this.maxView}}handleStreamUpdate(e){e&&(e.hasOwnProperty(`REPLY`)?this.applyRequestServerData(e):this.applyDataserverData(e))}applyRequestServerData(e){var t;if(!Array.isArray(e.REPLY)||!e.MESSAGE_TYPE?.startsWith(`REP_`)){this.handleError({message:`received invalid RequestServerResult`,loggerType:`error`,loggerArgs:[e]});return}if(this.requiresFullDataRefresh){(t=e.REPLY)==null||t.forEach(e=>{this.rowsSyncedWithStream.set(e[this.effectiveRowId],e)}),this.syncComponentData(Array.from(this.rowsSyncedWithStream.values()));return}this.handleStreamInserts(e.REPLY);let n=Array.from(this.rowsSyncedWithStream.values()).filter(t=>!e.REPLY.includes(t));this.handleStreamDeletes(n)}applyDataserverData(e){var t;if(this.requiresFullDataRefresh){(t=e.inserts)==null||t.forEach(e=>{this.rowsSyncedWithStream.set(e[this.effectiveRowId],e)});let n=Array.from(this.rowsSyncedWithStream.values());this.syncComponentData(n);return}e.inserts?.length>0&&this.handleStreamInserts(e.inserts),e.deletes?.length>0&&this.handleStreamDeletes(e.deletes),e.updates?.length>0&&this.handleStreamUpdates(e.updates)}buildCriteria(){return gy((this.criteria?.split(`;`)||[]).join(` && `),`;`)}setFilter(e,t){this.criteriaFromFilters.set(e,t),this.update.next(this.criteriaFromFilters)}removeFilter(e){this.criteriaFromFilters.delete(e),this.update.next(this.criteriaFromFilters)}handleError(e={}){let{message:t,loggerType:n,loggerArgs:r=[]}=e;t&&Ly[n](t,...r)}getFieldMetadata(e){return this.datasource.fieldMetadata?.find(t=>t.name===e)}getDefaultLabelFormat(e,t){return t===bg.DATE||t===bg.DATETIME?ep(e,t===bg.DATETIME):e}};q([xv],Ry.prototype,`connect`,void 0),q([my],Ry.prototype,`datasource`,void 0),q([D({mode:`boolean`})],Ry.prototype,`withGridInit`,void 0),q([D],Ry.prototype,`criteria`,void 0),q([C],Ry.prototype,`data`,void 0),q([D],Ry.prototype,`fields`,void 0),q([D({mode:`boolean`})],Ry.prototype,`isSnapshot`,void 0),q([D],Ry.prototype,`maxRows`,void 0),q([D],Ry.prototype,`maxView`,void 0),q([D],Ry.prototype,`orderBy`,void 0),q([D],Ry.prototype,`request`,void 0),q([D],Ry.prototype,`resourceName`,void 0),q([D({mode:`boolean`})],Ry.prototype,`reverse`,void 0),q([D],Ry.prototype,`rowId`,void 0),q([D({mode:`boolean`,attribute:`with-timestamp-formatting`})],Ry.prototype,`withTimestampFormatting`,void 0);let zy=(e,t)=>!e.composedPath().includes(t),By=(e,t)=>e.composedPath().includes(t),Vy=e=>e.tagName.toLowerCase().split(`-`)[0];function Hy(e){let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement:document.activeElement}let Uy=Kd(`foundation-criteria`);var Wy;(function(e){e.AND=`&&`,e.OR=`||`,e.NOT=`!`,e.GT=`>`,e.GE=`>=`,e.LT=`<`,e.LE=`<=`,e.NE=`!=`,e.EQ=`==`})(Wy||(Wy={}));var Gy=class e{constructor(e){this.$$operator=e}static And(){return new e(Wy.AND)}static Or(){return new e(Wy.OR)}static Not(){return new e(Wy.NOT)}static GreaterThan(){return new e(Wy.GT)}static GreaterThanOrEqual(){return new e(Wy.GE)}static LessThan(){return new e(Wy.LT)}static LessThanOrEqual(){return new e(Wy.LE)}static NotEqual(){return new e(Wy.NE)}static Equal(){return new e(Wy.EQ)}get operator(){return this.$$operator}};let Ky=e=>e.replace(/\\/g,`\\\\`).replace(/'/g,`\\'`).replace(/\n/g,`\\n`).replace(/\r/g,`\\r`),qy=e=>`'${Ky(e)}'`,Jy=e=>{let{value:t}=e;return e.valueGetter?e.valueGetter(t):typeof t==`function`?t(e):Array.isArray(t)?t.join(`,`):typeof t==`string`?qy(t):t},Yy=e=>t=>`${t.field} ${e} ${Jy(t)}`,Xy=e=>Yy(Wy.NE)(e),Zy=e=>`${e.field}.contains(${Jy(e)})`,Qy={AND:e=>Yy(Wy.AND)(e),OR:e=>Yy(Wy.OR)(e),NOT:Xy,GT:e=>Yy(Wy.GT)(e),GE:e=>Yy(Wy.GE)(e),LT:e=>Yy(Wy.LT)(e),LE:e=>Yy(Wy.LE)(e),NE:Xy,EQ:e=>Yy(Wy.EQ)(e),equals:e=>`${e.field}.equals(${Jy(e)})`,equalsIgnoreCase:e=>`${e.field}.equalsIgnoreCase(${Jy(e)})`,contains:Zy,fieldContains:Zy,containsIgnoreCase:e=>`Expr.containsIgnoreCase(${e.field}, ${Jy(e)})`,startsWith:e=>`${e.field}.startsWith(${Jy(e)})`,endsWith:e=>`${e.field}.endsWith(${Jy(e)})`,dateIsToday:e=>`Expr.dateIsToday(${e.field})`,dateIsEqual:e=>`Expr.dateIsEqual(${e.field}, ${Jy(e)})`,dateIsGreaterEqual:e=>`Expr.dateIsGreaterEqual(${e.field}, ${Jy(e)})`,dateIsLessEqual:e=>`Expr.dateIsLessEqual(${e.field}, ${Jy(e)})`,dateTimeIsGreaterEqual:e=>`Expr.dateTimeIsGreaterEqual(${e.field}, ${Jy(e)})`,dateTimeIsLessEqual:e=>`Expr.dateTimeIsLessEqual(${e.field}, ${Jy(e)})`},$y=(e,t)=>e.flat().flatMap((e,n,r)=>r.length-1===n?e:[e,t]),eb=e=>Array.isArray(e)?e:[e],tb=`default`;var nb=class{constructor(){this.expressions={},this.And=(e,t={})=>this.withExpression(e,t,Gy.And()),this.Or=(e,t={})=>this.withExpression(e,t,Gy.Or()),this.Not=(e,t={})=>this.withExpression(e,t,Gy.Not())}withExpression(e,t={},n=Gy.And()){let{condition:r,join:i,groupName:a}=t,o=(e,t=tb)=>{let a=this.expressions[t]??[];this.expressions[t]=[...a,{join:n||i,condition:r,expression:e}]};if(Array.isArray(e)){if(i){let t=e.filter(e=>{let t=e instanceof Gy;return t&&Uy.warn(`Inline joins will be discarded when join is defined in ExpressionOptions`),!t});a?t.forEach(e=>{o(e,a)}):o($y(t,i),tb)}else o(e,tb)}else typeof e==`string`?o(e,tb):o(e,e.group);return this}build(e){let t=Object.entries(this.expressions).reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:`(${n.filter(({condition:e})=>!e||e()).map(({expression:e,join:t},n,r)=>this.parseExpression(e,r[n-1],t)).join(``)})`}),{});return e?e(t):`(${Object.values(t).join(` && `)})`}reset(){this.expressions={}}parseExpression(e,t,n){let r=[];return n&&t&&r.push(` ${n.operator} `),typeof e==`string`?r.push(e):Array.isArray(e)?(e.forEach((e,t,n)=>{if(e instanceof Gy&&n[t-1]instanceof Gy)throw Error(`Adjacent Join operations detected`)}),r.push(`(${e.map(e=>this.parseExpression(e,void 0)).join(``)})`)):e instanceof Gy?r.push(` ${e.operator} `):e&&r.push(e.serialiser(e)),r.join(``)}},rb=class{constructor(e){this.serialiser=Qy.EQ,this.build=()=>{if(!this.field)throw Error(`Missing required param 'field'`);if(this.value===void 0)throw Error(`Missing required param 'value'`);if(!this.serialiser)throw Error(`Missing required param 'serialise'`);return{field:this.field,value:this.value,serialiser:this.serialiser,params:this.params,valueGetter:this.valueGetter,group:this.group}},e&&(this.field=e.field,this.value=e.value,this.serialiser=e.serialiser,this.params=e.params,this.valueGetter=e.valueGetter,this.group=e.group)}withField(e){return this.field=e,this}withValue(e){return this.value=e,this}withSerialiser(e){return this.serialiser=e,this}withParams(e){return this.params=e,this}withValueGetter(e){return this.valueGetter=e,this}withGroup(e){return this.group=e,this}};let ib=(e=`rapid`)=>T`<${e}-segmented-control :value="${Nf(e=>e.selectedLabel)}"><slot name="label" slot='label'></slot>${j(e=>e.criteriaOptions,T`<${e}-segmented-item @click=${(e,t)=>t.parent.itemClickHandler(e.label)}value=${e=>e.label}>${e=>e.label}</${e}-segmented-item>`)}</${e}-segmented-control>`,ab=class extends Qe{constructor(){super(...arguments),this.criteriaOptions=[],this.createCriteria=e=>{let t=new nb,{field:n,serialiser:r,value:i}=e;return Array.isArray(n)||Array.isArray(i)?t.And(eb(i).map(e=>eb(n).map(t=>new rb().withField(t).withValue(e).withSerialiser(r).build())),{join:Gy.Or()}):t.And(new rb().withField(n).withValue(i).withSerialiser(r).build()),t}}valueChanged(){this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))}selectedLabelChanged(){let e=this.criteriaOptions.find(e=>e.label===this.selectedLabel);this.value=e?this.createCriteria(e).build():``}itemClickHandler(e){this.selectedLabel===e&&(this.selectedLabel=void 0)}};q([C],ab.prototype,`criteriaOptions`,void 0),q([C],ab.prototype,`prefix`,void 0),q([C],ab.prototype,`value`,void 0),q([C],ab.prototype,`selectedLabel`,void 0),ab=q([$e({name:`criteria-segmented-control`,template:ib(),styles:O``})],ab);function ob(e,t){let n=new nb;n.withExpression(new rb().withField(e.labelField??e.valueField).withValue(t).withSerialiser(Qy.containsIgnoreCase).build()),e.criteria=e.baseCriteria?`${e.baseCriteria} && ${n.build()}`:n.build()}function sb(e,t){let n=new nb;n.withExpression(new rb().withField(e.valueField).withValue(t).withSerialiser(Qy.equals).build()),e.criteria=e.baseCriteria?`${e.baseCriteria} && ${n.build()}`:n.build()}let cb=(e,t,n)=>T`<${t}-icon tooltip="${()=>e}" name="${()=>n}"></${t}-icon>`,lb=e=>T`<${e}-button ${k(`actionsOpener`)}id="actiosnMenuTrigger" class="actions-opener${e=>e.open?` opened`:``}" appearance="${e=>e.buttonAppearance}" part="actions-opener" @click=${e=>e.toggleActionsMenuVisibility()}>${e=>e.open?`✖`:T` ${e.name} `}</${e}-button><${e}-menu ${k(`actionsMenu`)}popover="manual" class="actions-menu ${e=>e.classNames}" part="actions-menu">${j(e=>e.allActions,T` ${A((e,t)=>e.isDisabled&&e.isDisabled(t.parent.rowData),T`<${e}-menu-item class="menu-item" tabindex="${(e,t)=>t.index}" disabled style=${(e,t)=>t.parent.hideDisabled?`display:none`:``}>${(e,t)=>t.parent.getLabel(e.name)}</${e}-menu-item>`)} ${A((e,t)=>!e.isDisabled||!e.isDisabled(t.parent.rowData),T`<${e}-menu-item class="menu-item" tabindex="${(e,t)=>t.index}" @click=${(e,t)=>t.parent.onActionMenuItemClick(e.callback)}style="${e=>e.color?`color: ${e.color};`:``}">${(e,t)=>t.parent.getLabel(e.name)}</${e}-menu-item>`)} `,{positioning:!0})}</${e}-menu>`,ub=e=>T`<${e}-button appearance="${e=>e.buttonAppearance}" part="actions-opener" class="actions-opener" @click=${e=>e?.singleOption.callback(e.rowData)}?disabled=${e=>e?.singleOption.isDisabled&&e?.singleOption.isDisabled(e.rowData)}>${e=>e.getLabel(e?.singleOption.name)}</${e}-button>`,db=T`<div class="actions-container${e=>e.isVertical?` actions-vertical`:``}" part="actions-container">${e=>e.getTemplate(Vy(e))}</div>`;var fb=class extends P{constructor(){super(...arguments),this.isVertical=!1,this.addDefaultActions=!0,this.autoCloseOnAction=!0,this.name=`Actions`,this.open=!1,this.hideDisabled=!1,this.hideMenuSingleOption=!1}disconnectedCallback(){this.actionsMenu?.matches(`:popover-open`)&&this.actionsMenu.hidePopover(),super.disconnectedCallback()}updateMenuPosition(){let e=this.actionsOpener.getBoundingClientRect();this.actionsMenu.style.position=`fixed`,this.actionsMenu.style.top=`${e.top}px`,this.actionsMenu.style.left=`auto`,this.actionsMenu.style.right=`${window.innerWidth-e.right}px`}definitionChanged(e,t){this.actions=t?.actions??[],delete this.definition.actions,t.buttonText&&(this.name=t.buttonText,delete this.definition.customButtonText),t.isVertical&&(this.isVertical=t.isVertical,delete this.definition.isVertical),t.buttonAppearance&&(this.buttonAppearance=t.buttonAppearance,delete this.definition.buttonAppearance),t.hideMenuSingleOption&&(this.hideMenuSingleOption=t.hideMenuSingleOption,delete this.definition.hideMenuSingleOption)}openChanged(){this.classNames=dn([`visible`,this.open],[`hidden`,!this.open]),this.open?(this.updateMenuPosition(),this.actionsMenu.showPopover()):this.actionsMenu?.matches(`:popover-open`)&&this.actionsMenu.hidePopover()}toggleActionsMenuVisibility(){this.open=!this.open}onActionMenuItemClick(e){this.autoCloseOnAction&&(this.open=!1),e(this.rowData)}get allActions(){let e=[{name:`✖`,callback:()=>this.open=!1}];return this.addDefaultActions?[...this.actions??[],...e]:this.actions}get rowData(){if(!this.definition)return;let{node:e,data:t}=this.definition;return e?.data||t}getLabel(e){return typeof e==`function`?e(this.rowData):e}getTemplate(e){if(!this.hideMenuSingleOption)return lb(e);let t=this.actions.filter(e=>!e.isDisabled||!e.isDisabled(this.rowData));if(this.singleOption=null,t.length!==0)return t.length===1?(this.singleOption=t[0],ub(e)):lb(e)}};q([C],fb.prototype,`actions`,void 0),q([D({attribute:`is-vertical`,mode:`boolean`})],fb.prototype,`isVertical`,void 0),q([D({attribute:`add-default-actions`,mode:`boolean`})],fb.prototype,`addDefaultActions`,void 0),q([D({attribute:`auto-close-on-action`,mode:`boolean`})],fb.prototype,`autoCloseOnAction`,void 0),q([C],fb.prototype,`classNames`,void 0),q([C],fb.prototype,`definition`,void 0),q([D],fb.prototype,`name`,void 0),q([D({attribute:`open`,mode:`boolean`})],fb.prototype,`open`,void 0),q([D],fb.prototype,`buttonAppearance`,void 0),q([D({attribute:`hide-disabled`,mode:`boolean`})],fb.prototype,`hideDisabled`,void 0),q([D({attribute:`hide-menu-single-option`,mode:`boolean`})],fb.prototype,`hideMenuSingleOption`,void 0),q([C],fb.prototype,`singleOption`,void 0),fb.compose({baseName:`actions-menu`,styles:Rne,template:db});let pb=()=>{};function mb(e){let t=new AbortController,n=e.filter(e=>e!=null),r=n.find(e=>e.aborted);if(r)return t.abort(r.reason),{signal:t.signal,dispose:pb};function i(){for(let e of n)e.removeEventListener(`abort`,a)}function a(){t.abort(this.reason),i()}for(let e of n)e.addEventListener(`abort`,a);return{signal:t.signal,dispose:i}}let hb=!1;try{typeof GENX_ENABLE_AI<`u`&&(hb=GENX_ENABLE_AI===`true`)}catch{}let gb=()=>hb||Vf(`ai`),_b=Kd(`foundation-ai`);function vb(){return typeof window<`u`&&(`SpeechRecognition`in window||`webkitSpeechRecognition`in window)}function yb(e,t){if(!vb())return null;let n=new(window.SpeechRecognition||window.webkitSpeechRecognition);n.continuous=!0,n.interimResults=!0,n.lang=`en-US`;let r=``;return n.onresult=t=>{let n=``,i=``;for(let e=t.resultIndex;e<t.results.length;e+=1){let r=t.results[e][0].transcript;t.results[e].isFinal?i+=r:n+=r}i?(r+=i,e(r,!0)):n&&e(r+n,!1)},n.onerror=e=>{e.error!==`aborted`&&t?.(e.error||`Speech recognition error`)},n.start(),()=>{try{n.stop()}catch{}}}var bb=class{getStatus(){return J(this,void 0,void 0,function*(){return{provider:`none`,model:``}})}interpretCriteria(e,t){return J(this,void 0,void 0,function*(){return null})}};let xb=Object.freeze({anthropic:`Anthropic`,gemini:`Gemini`,openai:`OpenAI`,chrome:`Chrome`});Object.freeze([`anthropic`,`gemini`]),new Map(Object.entries(xb).map(([e,t])=>[t.toLowerCase(),e]));var Sb=class extends Error{constructor(e,t,n,r,i){super(`${e} request refused: the AI usage budget is exhausted`+(t==null?``:` (spent ${n==null?`an unknown amount`:`$${n}`} of a $${t} budget)`)+(r?`: ${r}`:``)+`. Retrying will not clear this — the budget must be raised.`),this.vendorLabel=e,this.budgetUsd=t,this.spentUsd=n,this.detail=r,this.name=`BudgetExhaustedError`,this.otherVendorAvailable=i?.otherVendorAvailable,this.serverVendor=i?.serverVendor}};let Cb=(e,t)=>e===402||t===`BUDGET_EXCEEDED`,wb=e=>{try{return JSON.parse(e)}catch{return}},Tb=e=>{let t=e?.code;return typeof t==`string`?t:void 0},Eb=e=>typeof e==`number`&&Number.isFinite(e)?e:void 0,Db=e=>typeof e==`boolean`?e:void 0,Ob=e=>typeof e==`string`&&e.trim()!==``?e:void 0;function kb(e,t,n){let r=typeof t==`object`&&t?t:{},i=typeof r.details==`object`&&r.details!==null?r.details:{},a=typeof r.error==`string`?r.error:n;return new Sb(e,Eb(r.budgetUsd)??Eb(i.budgetUsd),Eb(r.spentUsd)??Eb(i.spentUsd),a,{otherVendorAvailable:Db(r.otherVendorAvailable)??Db(i.otherVendorAvailable),serverVendor:Ob(r.vendor)??Ob(i.vendor)})}var Ab=class extends Error{constructor(e,t,n,r,i){super(`${e} refused the request (${t})`+(n==null?``:` — HTTP ${n}`)+(r?` ${r}`:``)+(i?`: ${i}`:``)+`. Retrying will not clear this — the provider account must be fixed.`),this.vendorLabel=e,this.kind=t,this.upstreamStatus=n,this.upstreamType=r,this.detail=i,this.name=`ProviderRefusedError`}};let jb=Object.freeze([/credit balance/i,/usage limit/i,/spend limit/i,/insufficient (credit|funds|balance)/i]),Mb=Object.freeze([`authentication_error`,`permission_error`]);function Nb(e){let t=typeof e==`object`&&e?e:{};for(let e of[t.error,t.details?.error])if(typeof e==`object`&&e){let{type:t,message:n}=e;return{type:typeof t==`string`?t:void 0,message:typeof n==`string`?n:void 0}}}function Pb(e){let t=typeof e==`object`&&e?e:{},n=typeof t.details==`object`&&t.details!==null?t.details:{};for(let e of[t.kind,n.kind])if(e===`auth`||e===`spend`)return e}function Fb(e){let t=Nb(e);if(t?.type){if(Mb.includes(t.type))return`auth`;if(t.type===`billing_error`)return`spend`}}function Ib(e,t,n){if(t===`PROVIDER_REFUSED`)return Pb(n)??Fb(n)??`spend`;if(e!==`anthropic`)return;let r=Fb(n);if(r)return r;let i=Nb(n);if(i?.type===`invalid_request_error`&&i.message){let e=i.message;if(jb.some(t=>t.test(e)))return`spend`}}function Lb(e,t,n,r,i){let a=Nb(r);return new Ab(e,t,n,a?.type,a?.message??i)}function Rb(e){return Object.entries(xb).find(([,t])=>t===e)?.[0]}let zb=[`gemini-2.5-pro`,`gemini-2.5-flash`,`gemini-2.5-flash-lite`,`gemini-3.8-flash`,`gemini-3.5-flash`,`gemini-3.1-flash-lite`,`gemini-3.1-pro-preview`],Bb=[`claude-fable-5`,`claude-opus-4-8`,`claude-opus-4-7`,`claude-sonnet-5`,`claude-sonnet-4-6`,`claude-haiku-4-5-20251001`];function Vb(e){return e===`image/jpg`?`image/jpeg`:e}function Hb(e){return e.replace(/^data:[^,]*;base64,/,``)}let Ub=.5;function Wb(e,{defaultTemp:t,maxTemp:n}){let r=Math.min(Math.max(e,0),1);return r<=Ub?r/Ub*t:t+(r-Ub)/.5*(n-t)}let Gb=1e6,Kb={"claude-haiku-4-5-20251001":{promptPerMillion:1,candidatePerMillion:5},"claude-fable-5":{promptPerMillion:10,candidatePerMillion:50},"claude-opus-4-8":{promptPerMillion:5,candidatePerMillion:25},"claude-opus-4-7":{promptPerMillion:5,candidatePerMillion:25},"claude-sonnet-5":{promptPerMillion:2,candidatePerMillion:10},"claude-sonnet-4-6":{promptPerMillion:3,candidatePerMillion:15}};function qb(e){return Kb[e]}function Jb(e,t){let{promptPerMillion:n,candidatePerMillion:r}=qb(e),i=Gb,a=Math.max(0,t.cacheWriteTokens-t.cacheWrite1hTokens),o=t.uncachedInputTokens/i*n,s=t.cacheReadTokens/i*n*.1,c=a/i*n*1.25+t.cacheWrite1hTokens/i*n*2,l=t.outputTokens/i*r,u=t.cacheReadTokens/i*n,d=t.cacheWriteTokens/i*n;return{costUsd:o+s+c+l,savedUsd:u-s+(d-c),breakdown:{promptUsd:o,cacheReadUsd:s,cacheWriteUsd:c,candidateUsd:l}}}let Yb={"gemini-2.5-flash-lite":{kind:`flat`,rate:{promptPerMillion:.1,candidatePerMillion:.4}},"gemini-2.5-flash":{kind:`flat`,rate:{promptPerMillion:.3,candidatePerMillion:2.5}},"gemini-2.5-pro":{kind:`tiered`,standard:{promptPerMillion:1.25,candidatePerMillion:10},longContext:{promptPerMillion:2.5,candidatePerMillion:15}},"gemini-3.1-flash-lite":{kind:`flat`,rate:{promptPerMillion:.25,candidatePerMillion:1.5}},"gemini-3.5-flash":{kind:`flat`,rate:{promptPerMillion:1.5,candidatePerMillion:9}},"gemini-3.8-flash":{kind:`flat`,rate:{promptPerMillion:.75,candidatePerMillion:3.75}},"gemini-3.1-pro-preview":{kind:`tiered`,standard:{promptPerMillion:2,candidatePerMillion:12},longContext:{promptPerMillion:4,candidatePerMillion:18}}};function Xb(e,t){let n=Yb[e];return n.kind===`flat`?n.rate:t>2e5?n.longContext:n.standard}function Zb(e,t){let{promptPerMillion:n,candidatePerMillion:r}=Xb(e,t.promptTokens),i=Gb,a=Math.max(0,t.promptTokens-t.cachedTokens)/i*n,o=t.cachedTokens/i*n*.1,s=(t.candidateTokens+t.thoughtTokens)/i*r;return{costUsd:a+o+s,savedUsd:t.cachedTokens/i*n-o,breakdown:{promptUsd:a,cacheReadUsd:o,cacheWriteUsd:0,candidateUsd:s}}}let Qb=[`properties`,`patternProperties`,`$defs`,`definitions`],$b=[`anyOf`,`oneOf`,`allOf`,`prefixItems`],ex=[`items`,`not`,`additionalProperties`,`propertyNames`,`contains`],tx=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function nx(e){if(Array.isArray(e))return e.map(nx);if(tx(e)){let t={};for(let[n,r]of Object.entries(e))t[n]=nx(r);return t}return e}function rx(e,t,n){let r={};for(let[i,a]of Object.entries(e)){let e=`${n}/${i}`;r[i]=Qb.includes(i)&&tx(a)?Object.fromEntries(Object.entries(a).map(([n,r])=>[n,tx(r)?t(r,`${e}/${n}`):nx(r)])):$b.includes(i)&&Array.isArray(a)?a.map((n,r)=>tx(n)?t(n,`${e}/${r}`):nx(n)):ex.includes(i)?tx(a)?t(a,e):Array.isArray(a)?a.map((n,r)=>tx(n)?t(n,`${e}/${r}`):nx(n)):nx(a):nx(a)}return r}function ix(e,t,n=``){return t(rx(e,(e,n)=>ix(e,t,n),n),n)}let ax=[`minimum`,`maximum`,`exclusiveMinimum`,`exclusiveMaximum`,`multipleOf`,`maxItems`,`uniqueItems`,`minProperties`,`maxProperties`],ox=[`oneOf`,`not`];function sx(e){let t=[],n=[],r=[];return{schema:ix(e,(e,i)=>{for(let n of ax)n in e&&(delete e[n],t.push(`${i}/${n}`));typeof e.minItems==`number`&&e.minItems>1&&(delete e.minItems,t.push(`${i}/minItems`));for(let t of ox)t in e&&r.push(`${i}/${t}`);return(e.type===`object`||Array.isArray(e.type)&&e.type.includes(`object`)||tx(e.properties))&&e.additionalProperties!==!1&&(e.additionalProperties!==void 0&&n.push(`${i}/additionalProperties`),e.additionalProperties=!1),e}),stripped:t,overridden:n,undroppable:r}}function cx(e,t){let{schema:n,stripped:r,overridden:i,undroppable:a}=sx(e);return r.length&&_b.warn(`AnthropicTransport: tool "${t}" requested schema enforcement; these keywords cannot be enforced and were removed — validate them yourself: ${r.join(`, `)}`),i.length&&_b.warn(`AnthropicTransport: tool "${t}" requested schema enforcement, which requires closed objects; \`additionalProperties\` was set to false at: ${i.join(`, `)}. The tool now accepts fewer inputs than its schema declared.`),a.length&&_b.warn(`AnthropicTransport: tool "${t}" uses schema keywords enforcement cannot express (${a.join(`, `)}). They cannot be removed without changing the schema's meaning, so the request will be rejected. Rewrite them or drop enforceSchema for this tool.`),n}let lx=[`additionalProperties`,`examples`,`multipleOf`,`patternProperties`,`$defs`,`definitions`];function ux(e,t){if(!t.startsWith(`#/`))return;let n=e;for(let e of t.slice(2).split(`/`)){if(!tx(n))return;n=n[e.replace(/~1/g,`/`).replace(/~0/g,`~`)]}return tx(n)?n:void 0}function dx(e,t,n,r){let i=t,a=n,o=typeof i.$ref==`string`?i.$ref:void 0;for(;o&&!a.has(o);){let t=ux(e,o);if(!t)break;let{$ref:n}=i,r=dd(i,[`$ref`]);i=Object.assign(Object.assign({},nx(t)),r),a=/* @__PURE__ */ new Set([...a,o]),o=typeof i.$ref==`string`?i.$ref:void 0}return typeof i.$ref==`string`&&r.push(i.$ref),rx(i,t=>dx(e,t,a,r),``)}function fx(e){let t=[],n=dx(e,e,/* @__PURE__ */ new Set,t);return t.length&&_b.warn(`GeminiTransport: these \`$ref\` pointers could not be inlined — a cycle, a typo, or an external ref: ${[...new Set(t)].join(`, `)}. They are left in the schema, so Gemini will reject this declaration; that is deliberate, because dropping them would send a node that constrains nothing.`),ix(n,e=>{if(Array.isArray(e.type)){let t=e.type.filter(e=>e!==`null`);t.length===1&&e.type.length!==t.length&&(e.type=t[0],e.nullable=!0)}if(Array.isArray(e.anyOf)){let t=e.anyOf.filter(tx),n=t.filter(e=>e.type!==`null`);if(t.length===2&&n.length===1){let{anyOf:t}=e,r=dd(e,[`anyOf`]);return Object.assign(Object.assign(Object.assign({},n[0]),r),{nullable:!0})}}`const`in e&&(e.enum=[e.const],delete e.const);for(let t of lx)delete e[t];for(let t of Object.keys(e))t.startsWith(`$`)&&t!==`$ref`&&delete e[t];return e})}function px(e,t,n){return(e instanceof DOMException||e instanceof Error)&&(e.name===`AbortError`||e.name===`TimeoutError`)?n?.aborted?n.reason:t.aborted?t.reason:e:e}function mx(e,t){return new Promise((n,r)=>{let i=()=>t?.reason??new DOMException(`The operation was aborted.`,`AbortError`);if(t?.aborted){r(i());return}let a=()=>{clearTimeout(o),r(i())},o=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e);t?.addEventListener(`abort`,a,{once:!0})})}let hx=Object.freeze({NO_API_KEY:`NO_API_KEY`,BAD_API_KEY:`BAD_API_KEY`,KEY_UNREADABLE:`KEY_UNREADABLE`,MODEL_NOT_ALLOWED:`MODEL_NOT_ALLOWED`,BAD_REQUEST:`BAD_REQUEST`,FALLBACKS_NOT_SUPPORTED:`FALLBACKS_NOT_SUPPORTED`,REQUEST_TOO_LARGE:`REQUEST_TOO_LARGE`,VENDOR_UNREACHABLE:`VENDOR_UNREACHABLE`}),gx=new Set(Object.values(hx));function _x(e){return typeof e==`string`&&gx.has(e)?e:void 0}let vx=Object.freeze({SIGNED_OUT:`SIGNED_OUT`,ACCESS_DENIED:`ACCESS_DENIED`}),yx=e=>{if(!e||typeof e!=`object`)return!1;let{MESSAGE_TYPE:t,ERROR:n}=e;return t===`MSG_NACK`||Array.isArray(n)},bx=e=>e?.code!==void 0;function xx(e,t,n){if(e!==401&&e!==403||bx(t))return;let r=typeof n==`string`&&n.trim()===``;if(yx(t)||r)return e===401?vx.SIGNED_OUT:vx.ACCESS_DENIED}function Sx(e,t){return e===413&&t===void 0}function Cx(e){let t=e?.ERROR,n=Array.isArray(t)?t[0]?.TEXT:void 0;return typeof n==`string`&&n?n:void 0}let wx=`The AI service refused the assistant's request. An administrator can find the details in the browser console.`;Object.freeze({NO_API_KEY:`The assistant isn't set up yet. An administrator needs to add an API key for its AI service.`,BAD_API_KEY:`The assistant can't use its AI service key. An administrator needs to check the key.`,KEY_UNREADABLE:`The assistant can't read its AI service key. An administrator needs to check how the key is stored.`,MODEL_NOT_ALLOWED:`The assistant asked for an AI model this app doesn't allow. An administrator needs to check the app's allowed models.`,BAD_REQUEST:wx,FALLBACKS_NOT_SUPPORTED:wx,REQUEST_TOO_LARGE:`This request is too large to send. Start a new conversation or send a shorter message, and if you attached a file, try a smaller one.`,VENDOR_UNREACHABLE:`The AI service can't be reached right now. Please try again in a few minutes. If it keeps happening, tell an administrator.`,SIGNED_OUT:`Your session has ended. Sign in again to use the assistant.`,ACCESS_DENIED:`You don't have access to the assistant. An administrator can give you access.`});let Tx=e=>e!==hx.VENDOR_UNREACHABLE;var Ex=class extends Error{constructor(e,t,n,r){super(`${e} AI service refused the request (${n} ${t})`),this.vendorLabel=e,this.code=t,this.status=n,this.detail=r,this.name=`AIServiceError`}get terminal(){return Tx(this.code)}};function Dx(e){let t=e?.error;return typeof t==`string`&&t?t:void 0}let Ox=Object.freeze([/prompt is too long/i,/input token count .* exceeds/i,/maximum context length/i,/context[_ ]length[_ ]exceeded/i,/too many (input )?tokens/i]),kx=/(\d[\d,]{2,})\D{0,40}?(?:>|exceeds)\D{0,80}?(\d[\d,]{2,})/i;var Ax=class extends Error{constructor(e,t,n,r){super(`${e} rejected the request — the prompt exceeds the model context window`+(t!=null&&n!=null?` (${t} > ${n})`:``)+(r?`: ${r}`:``)+`. Retrying will not clear this — the conversation must be compacted.`),this.vendorLabel=e,this.promptTokens=t,this.limitTokens=n,this.detail=r,this.name=`ContextOverflowError`}};function jx(e){if(!e||typeof e!=`object`)return[];let t=[],n=(e,r)=>{if(!(r>4||!e||typeof e!=`object`))for(let i of Object.values(e))typeof i==`string`?t.push(i):typeof i==`object`&&n(i,r+1)};return n(e,0),t}function Mx(e,t,n){if(t===400)for(let e of jx(n)){if(!Ox.some(t=>t.test(e)))continue;let t=kx.exec(e);return{promptTokens:t?Number(t[1].replace(/,/g,``)):void 0,limitTokens:t?Number(t[2].replace(/,/g,``)):void 0,message:e}}}function Nx(e,t,n,r){return J(this,void 0,void 0,function*(){let i=e.getReader(),a=new TextDecoder,o=``,s=e=>/* @__PURE__ */ Error(`${n} proxy sent a malformed frame: ${e.slice(0,120)}`),c=e=>{if(!e)return;let t;try{t=JSON.parse(e)}catch{throw s(e)}if(typeof t!=`object`||!t||Array.isArray(t))throw s(e);let i=t;if(i.t===`ok`){if(i.body==null)throw Error(`${n} proxy sent an ok frame without a body`);return i}if(i.t===`err`){if(typeof i.status!=`number`)throw Error(`${n} proxy sent an err frame without a numeric status`);return i}if(i.t===`ping`){if(r>0&&typeof i.sinceLastEventMs==`number`&&i.sinceLastEventMs>r)throw new DOMException(`${n} request stalled: proxy reported ${i.sinceLastEventMs}ms since the last upstream event (exceeds ${r}ms)`,`TimeoutError`);return}};try{for(;;){let{done:e,value:n}=yield i.read();if(e)break;t(),o+=a.decode(n,{stream:!0});let r=o.indexOf(`
|
|
247
247
|
`);for(;r!==-1;){let e=o.slice(0,r).trim();o=o.slice(r+1);let t=c(e);if(t)return t;r=o.indexOf(`
|
|
248
248
|
`)}}let e=c((o+a.decode()).trim());if(e)return e;throw Error(`${n} proxy stream ended without a terminal frame`)}finally{i.cancel().catch(()=>{})}})}let Px=12e4,Fx=1e3;function Ix(e){let t=(e?.get)?.call(e,`x-should-retry`);return typeof t==`string`&&t.trim().toLowerCase()===`false`}function Lx(e){let t=(e?.get)?.call(e,`retry-after`);if(typeof t!=`string`||t.trim()===``)return;let n=Number(t.trim());if(Number.isFinite(n))return Math.max(0,n*Fx);let r=Date.parse(t);if(!Number.isNaN(r))return Math.max(0,r-Date.now())}function Rx(e){let t=typeof e==`object`&&e?e:{},n=typeof t.details==`object`&&t.details!==null?t.details:void 0;for(let e of[t.error,n?.error]){let t=e?.details;if(Array.isArray(t))for(let e of t){let t=e?.[`@type`];if(typeof t!=`string`||!t.endsWith(`google.rpc.RetryInfo`))continue;let n=e?.retryDelay;if(typeof n!=`string`)continue;let r=Number(n.replace(/s$/,``));if(Number.isFinite(r)&&r>=0)return r*Fx}}}function zx(e,t,n,r=1/0){let i=t*2**e;return n==null||!Number.isFinite(n)?i:Math.max(i,Math.min(n,6e4,Math.max(0,r)))}function Bx(e,t){return Math.max(0,e-t)}function Vx(e){return J(this,void 0,void 0,function*(){var t;let{url:n,headers:r,body:i,credentials:a,vendorLabel:o,retryableStatuses:s,timeout:c,stallTimeout:l,backoffBaseMs:u,signal:d}=e,f=Rb(o),p=(e,t,n)=>(_b.error(`${o}Transport: the AI service refused the request (${t} ${e})${n?`: ${n}`:``}`),new Ex(o,e,t,n)),m=0,h=(e,t)=>{let n=u*2**e,r=Px-m,i=zx(e,u,t,r);return m+=Bx(i,n),t!=null&&i>n?_b.warn(`${o}Transport: honouring the server's requested retry delay (${Math.round(i)}ms, asked ${Math.round(t)}ms)`):t!=null&&t>n&&_b.warn(`${o}Transport: declining the server's requested retry delay (asked ${Math.round(t)}ms; the ${Px}ms sequence allowance is spent) — using the ladder's ${Math.round(i)}ms`),mx(i,d)};for(let e=0;e<=5;e+=1){let u=new AbortController,m=performance.now(),g,_,v=()=>{let e=Math.round(performance.now()-m);return g===void 0?`${o} request timed out after ${e}ms — no response headers (the service never answered; nothing was received to stall on)`:`${o} request timed out after ${e}ms — headers arrived in ${Math.round(g-m)}ms (content-type: ${_??`unknown`}) but no body followed`},y=setTimeout(()=>u.abort(new DOMException(v(),`TimeoutError`)),c),b=()=>{l<=0||(clearTimeout(y),y=setTimeout(()=>u.abort(new DOMException(`${o} request stalled (no data for ${l}ms)`,`TimeoutError`)),l))},{signal:ee,dispose:x}=mb([d,u.signal]);try{let c=yield fetch(n,{method:`POST`,headers:r,body:JSON.stringify(i),signal:ee,credentials:a});if(g=performance.now(),_=((t=c.headers)?.get)?.call(t,`content-type`)??void 0,!c.ok){let t=yield c.text(),n=wb(t),r=Ib(f,Tb(n),n);if(r)throw Lb(o,r,c.status,n,t||void 0);let i=Mx(f,c.status,n);if(i)throw new Ax(o,i.promptTokens,i.limitTokens,i.message??(t||void 0));if(Cb(c.status,Tb(n)))throw kb(o,n,t||void 0);let a=_x(Tb(n));if(a&&a!==hx.VENDOR_UNREACHABLE)throw p(a,c.status,Dx(n));let l=xx(c.status,n,t);if(l)throw p(l,c.status,Cx(n)??(t||void 0));if(Sx(c.status,n))throw p(hx.REQUEST_TOO_LARGE,c.status,t||void 0);let u=Ix(c.headers);if(s.includes(c.status)&&!u&&e<5){_b.warn(`${o}Transport: retryable status ${c.status}, retrying (attempt ${e+1}/5)`),clearTimeout(y),yield h(e,Lx(c.headers)||Rx(n));continue}throw a?p(a,c.status,Dx(n)):Error(`${o} request error ${c.status}: ${t}`)}if((c.headers?.get(`content-type`))?.toLowerCase().includes(`application/x-ndjson`)&&c.body){b();let t=yield Nx(c.body,b,o,l);if(t.t===`ok`)return t.body;if(t.code===`UPSTREAM_STALLED`)throw new DOMException(`${o} request stalled: ${t.error??`no upstream data`}`,`TimeoutError`);let n=Ib(f,t.code,t);if(n)throw Lb(o,n,t.status,t,t.error);let r=Mx(f,t.status,t);if(r)throw new Ax(o,r.promptTokens,r.limitTokens,r.message??t.error);if(Cb(t.status,t.code))throw kb(o,t);let i=_x(t.code);if(i&&i!==hx.VENDOR_UNREACHABLE)throw p(i,t.status,Dx(t));if(s.includes(t.status)&&e<5){_b.warn(`${o}Transport: retryable status ${t.status} (err frame), retrying (attempt ${e+1}/5)`),clearTimeout(y),yield h(e,Rx(t));continue}throw i?p(i,t.status,Dx(t)):Error(`${o} request error ${t.status}: ${t.error??JSON.stringify(t.details)}`)}return yield c.json()}catch(e){throw px(e,u.signal,d)}finally{clearTimeout(y),x()}}throw Error(`${o} request failed: max retries exceeded`)})}function Hx(e){if(e&&e!==`auto`)return e===`required`?{type:`any`}:e===`none`?{type:`none`}:{type:`tool`,name:e.tool}}let Ux={"claude-fable-5":1e6,"claude-opus-4-8":1e6,"claude-opus-4-7":1e6,"claude-sonnet-5":1e6,"claude-sonnet-4-6":1e6,"claude-haiku-4-5-20251001":2e5},Wx=`emit_structured_response`;function Gx(e){if(!Bb.includes(e))throw Error(`AnthropicTransport: unsupported model "${e}". Use one of: ${Bb.join(`, `)}.`)}function Kx(e){return e===`claude-fable-5`||e===`claude-opus-4-8`||e===`claude-opus-4-7`||e===`claude-sonnet-5`}function qx(e){return e===`claude-fable-5`||e===`claude-opus-4-8`||e===`claude-sonnet-5`||e===`claude-haiku-4-5-20251001`}function Jx(e){return e!==`claude-haiku-4-5-20251001`}function Yx(e){return e===`claude-fable-5`}function Xx(e,t){let n=e===`claude-sonnet-5`||Yx(e),r={type:`adaptive`,display:`summarized`};return t===`off`?Yx(e)?r:n?{type:`disabled`}:void 0:t===`auto`||t!==void 0?Jx(e)?r:void 0:n?r:void 0}function Zx(e){return e===`claude-fable-5`||e===`claude-opus-4-8`||e===`claude-sonnet-5`}let Qx={minimal:`low`,low:`low`,medium:`medium`,high:`high`,max:`max`};function $x(e,t){if(t!==void 0&&t!==`auto`&&t!==`off`&&Zx(e)&&Jx(e))return Qx[t]}let eS=`anthropic`;var tS=class extends Error{constructor(e,t,n,r){super(`Response truncated at ${t==null?`the model's output-token limit`:`the max_tokens cap (${t})`} for model ${e}`+(r.length>0?` while emitting tool call(s): ${r.join(`, `)}`:``)+`. The output exceeds the per-response limit — raise the provider maxTokens (where configurable) or split the work into smaller outputs.`),this.model=e,this.maxTokens=t,this.outputTokens=n,this.toolNames=r,this.name=`ResponseTruncatedError`}},nS=class e{warnIfThinkingUnclampable(e){if(this.warnedThinkingClamped)return;let t=this.clampWarning(e);t&&(this.warnedThinkingClamped=!0,_b.warn(t))}clampWarning(e){switch(e){case void 0:return;case`off`:return Yx(this.model)?`AnthropicTransport: thinkingPolicy 'off' ignored — ${this.model} always thinks and rejects an explicit disable. Reasoning tokens are still billed as output; switch model if you need them gone.`:void 0;case`auto`:return Jx(this.model)?void 0:`AnthropicTransport: thinkingPolicy 'auto' ignored — ${this.model} does not support adaptive thinking, so this turn runs without reasoning. Use a Sonnet or Opus tier if the agent needs it.`;case`minimal`:case`low`:case`medium`:case`high`:case`max`:return!Jx(this.model)||!Zx(this.model)?`AnthropicTransport: thinkingPolicy '${e}' ignored — ${this.model} predates output_config.effort, so this turn runs at its default posture. Use Opus 4.8, Sonnet 5, or Fable 5 to set reasoning depth.`:void 0;default:return e}}constructor(e={}){this.lifetimeCostUsd=0,this.lifetimeSavingsUsd=0,this.warnedThinkingClamped=!1,this.warnedUnknownServingModels=/* @__PURE__ */ new Set;let t=e.model??`claude-haiku-4-5-20251001`;Gx(t),this.model=t,t===`claude-sonnet-5`?_b.warn(`AnthropicTransport: using claude-sonnet-5 — standard Sonnet tier, higher cost than Haiku, and adaptive thinking runs by default so reasoning tokens add to output cost. Use for stronger reasoning or agent tasks.`):t===`claude-sonnet-4-6`?_b.warn(`AnthropicTransport: using claude-sonnet-4-6 — higher cost than Haiku; use for stronger reasoning or agent tasks.`):t===`claude-opus-4-7`||t===`claude-opus-4-8`?_b.warn(`AnthropicTransport: using ${t} — significantly higher cost; reserve for tasks where Sonnet reliability is insufficient.`):t===`claude-fable-5`&&_b.warn(`AnthropicTransport: using claude-fable-5 — Anthropic's most capable model, priced above Opus tier ($10 / $50 per MTok) with thinking always on. Reserve for the hardest reasoning/long-horizon work. Requires ≥30-day data retention (unavailable under ZDR) and may return stop_reason "refusal"; pair with an Opus 4.8 fallback.`),this.timeout=e.timeout??3e5,this.stallTimeout=e.stallTimeout??3e4,this.apiKey=e.apiKey,this.serverEndpoint=e.serverEndpoint,this.maxTokens=e.maxTokens??4096}getConfig(){return{provider:`anthropic`,model:this.model,contextLimit:Ux[this.model]}}getLifetimeCost(){return this.lifetimeCostUsd}getLifetimeSavings(){return this.lifetimeSavingsUsd}resetLifetimeCost(){this.lifetimeCostUsd=0,this.lifetimeSavingsUsd=0}sendStructuredPrompt(e){return J(this,void 0,void 0,function*(){let{systemPrompt:t,userPrompt:n,responseSchema:r}=e,i=[{role:`user`,content:n}],a={model:this.model,max_tokens:this.maxTokens,messages:i};t&&(a.system=t);let o=r!=null&&qx(this.model),s=r!=null&&!o;o?a.output_config=Object.assign(Object.assign({},a.output_config),{format:{type:`json_schema`,schema:r}}):s&&(a.tools=[{name:Wx,description:`Emit the structured response that matches the required schema.`,input_schema:r}],a.tool_choice={type:`tool`,name:Wx}),this.model===`claude-sonnet-5`&&(a.thinking={type:`disabled`});let c=yield this.post(a);if(s){let e=(c.content??[]).find(e=>e.type===`tool_use`&&e.name===Wx);return e?JSON.stringify(e.input??{}):``}return(c.content??[]).filter(e=>e.type===`text`).map(e=>e.text).join(``)})}sendChatMessage(e,t,n){return J(this,void 0,void 0,function*(){let r=/* @__PURE__ */ new Set([this.model,...(n?.fallbacks??[]).map(e=>e.model)]),i=this.toAnthropicMessages(e,t,n?.attachments,r),a={model:this.model,max_tokens:n?.maxTokens??this.maxTokens,messages:i};if(n?.systemPrompt&&(a.system=n.systemPrompt),n?.tools?.length&&(a.tools=n.tools.map(e=>Object.assign({name:e.name,description:e.description,input_schema:e.enforceSchema?cx(e.parameters,e.name):e.parameters},e.enforceSchema?{strict:!0}:{}))),a.tools?.length){let e=Hx(n?.toolChoice);e&&(a.tool_choice=e)}this.warnIfThinkingUnclampable(n?.thinkingPolicy);let o=Xx(this.model,n?.thinkingPolicy);o&&(a.thinking=o);let s=$x(this.model,n?.thinkingPolicy);s&&(a.output_config=Object.assign(Object.assign({},a.output_config),{effort:s}));let c=o?.type===`adaptive`;n?.temperature!=null&&!Kx(this.model)&&!c&&(a.temperature=Wb(n.temperature,{defaultTemp:1,maxTemp:1})),n?.responseSchema&&qx(this.model)&&(a.output_config=Object.assign(Object.assign({},a.output_config),{format:{type:`json_schema`,schema:n.responseSchema}})),n?.fallbacks?.length&&(a.fallbacks=n.fallbacks.map(e=>e.maxTokens==null?{model:e.model}:{model:e.model,max_tokens:e.maxTokens})),n?.cachePolicy&&this.applyCacheControl(a,n.cachePolicy),n?.tailContext&&this.appendTailContext(a,n.tailContext);let l=yield this.post(a,n?.signal);return this.fromAnthropicResponse(l,a.max_tokens)})}applyCacheControl(e,t){if(t.scope==="default")return;let n=t.ttl===`1h`?{type:`ephemeral`,ttl:`1h`}:{type:`ephemeral`};if(t.scope===`tools`){e.tools?.length&&(e.tools[e.tools.length-1].cache_control=n);return}if(typeof e.system==`string`&&e.system.length>0?e.system=[{type:`text`,text:e.system,cache_control:n}]:e.tools?.length&&(e.tools[e.tools.length-1].cache_control=n),t.scope===`history`){let t=e.messages[e.messages.length-1];t&&Array.isArray(t.content)&&t.content.length>0&&(t.content[t.content.length-1].cache_control=n)}}appendTailContext(e,t){let n={type:`text`,text:t},r=e.messages[e.messages.length-1];r?.role===`user`&&Array.isArray(r.content)?r.content.push(n):e.messages.push({role:`user`,content:[n]})}logTokenUsage(t,n,r,i,a,o){let{costUsd:s,savedUsd:c,breakdown:l}=Jb(t,{uncachedInputTokens:n,outputTokens:r,cacheReadTokens:i,cacheWriteTokens:a,cacheWrite1hTokens:o});this.lifetimeCostUsd+=s,this.lifetimeSavingsUsd+=c;let u=e.COST_DECIMAL_PLACES;return console.log(`--- Anthropic Token Usage (${t}) ---`),console.log(`Prompt Tokens: ${n} ($${l.promptUsd.toFixed(u)})`),console.log(`Cache Read: ${i} ($${l.cacheReadUsd.toFixed(u)})`),console.log(`Cache Write: ${a} ($${l.cacheWriteUsd.toFixed(u)})`),console.log(`Candidate Tokens: ${r} ($${l.candidateUsd.toFixed(u)})`),console.log(`Total Cost: $${s.toFixed(u)}`),console.log(`Cache Saved: $${c.toFixed(u)} (lifetime $${this.lifetimeSavingsUsd.toFixed(u)})`),console.log(`Lifetime Cost: $${this.lifetimeCostUsd.toFixed(u)}`),console.log(`--------------------------`),s}toAnthropicMessages(e,t,n,r=/* @__PURE__ */ new Set([this.model])){let i=[],a=(e,t)=>{let n=i[i.length-1];if(n&&n.role===e&&Array.isArray(n.content)){n.content.push(t);return}i.push({role:e,content:[t]})},o=e=>{let t=[],n=[];for(let r of e)r.kind===`image`?t.push({type:`image`,source:{type:`base64`,media_type:Vb(r.mimeType),data:Hb(r.data)}}):n.push({type:`text`,text:`[File: ${r.name}]\n${r.content}`});return{images:t,texts:n}};for(let t of e){if(t.role===`system`||t.role===`system-event`||t.role===`synthetic-user`||t.role===`compacted-summary`||t.category===`reasoning`||t.category===`narration`||t.excludeFromProvider||t.thinking)continue;if(t.toolResult){let e=t.toolResult.attachments??[];a(`user`,{type:`tool_result`,tool_use_id:t.toolResult.toolCallId,content:e.length?[...t.toolResult.content?[{type:`text`,text:t.toolResult.content}]:[],...e.map(e=>({type:`image`,source:{type:`base64`,media_type:Vb(e.mimeType),data:Hb(e.data)}}))]:t.toolResult.content});continue}if(t.toolCalls?.length){for(let e of this.reasoningToReplay(t.toolCalls[0],r))a(`assistant`,e);t.content&&a(`assistant`,{type:`text`,text:t.content});for(let e of t.toolCalls)a(`assistant`,{type:`tool_use`,id:e.id,name:e.name,input:e.args??{}});continue}let e=t.role===`user`?`user`:`assistant`;if(e===`user`&&t.attachments?.length){let{images:n,texts:r}=o(t.attachments);for(let t of n)a(e,t);t.content&&a(e,{type:`text`,text:t.content});for(let t of r)a(e,t)}else t.content&&a(e,{type:`text`,text:t.content})}if(t||n?.length){let{images:e,texts:r}=o(n??[]);for(let t of e)a(`user`,t);t&&a(`user`,{type:`text`,text:t});for(let e of r)a(`user`,e)}return i}reasoningToReplay(e,t){let n=e.providerMetadata?.[eS];if(!n)return[];let r=n.fallbacks??[],i=n.requestedModel===this.model&&t.has(n.model),a=n.model===this.model||i;return[...r,...a?n.reasoning??[]:[]]}servingModel(e){let t=e.model;return!t||t===this.model?this.model:Bb.includes(t)?t:(this.warnedUnknownServingModels.has(t)||(this.warnedUnknownServingModels.add(t),_b.warn(`AnthropicTransport: response was served by "${t}", which is not a known model — pricing it at the configured "${this.model}" rate instead of guessing. The reported cost for this request may be wrong; add the model to SUPPORTED_ANTHROPIC_MODEL_IDS.`)),this.model)}isUnbilledRefusal(e,t,n){return(t.output_tokens??0)>0?!1:e.type===`message`||n}costAttempt(e,t){let n=t.cache_read_input_tokens??0,r=t.cache_creation,i=r?.ephemeral_1h_input_tokens??0,a=t.cache_creation_input_tokens??(r?(r.ephemeral_5m_input_tokens??0)+i:0);return this.logTokenUsage(e,t.input_tokens??0,t.output_tokens??0,n,a,i)}fromAnthropicResponse(e,t=this.maxTokens){let n,r,i,a,o,s=this.servingModel(e);if(e.usage){let t=e.usage.input_tokens??0,c=e.usage.cache_read_input_tokens??0,l=e.usage.cache_creation,u=l?.ephemeral_1h_input_tokens??0,d=e.usage.cache_creation_input_tokens??(l?(l.ephemeral_5m_input_tokens??0)+u:0),f=e.usage.iterations;if(f?.length){let t=e.stop_reason===`refusal`;o=f.reduce((e,n,r)=>{let i=n.usage??n;if(this.isUnbilledRefusal(n,i,r===f.length-1&&t))return e;let a=n.model?this.servingModel({model:n.model}):this.model;return e+this.costAttempt(a,i)},0)}else o=this.isUnbilledRefusal({},e.usage,e.stop_reason===`refusal`)?0:this.costAttempt(s,e.usage);n=t+c+d,i=c,a=d,e.usage.output_tokens!=null&&(r=e.usage.output_tokens)}let c=e.content??[],l=[],u=[],d=[],f=[],p=c.map(e=>e.type).lastIndexOf(`fallback`),m=c.filter(e=>e.type===`fallback`);for(let[e,t]of c.entries()){let n=e>p;t.type===`tool_use`?n&&l.push({id:t.id,name:t.name,args:t.input??{}}):t.type===`thinking`?(n&&f.push(t),u.push(t.thinking)):t.type===`redacted_thinking`?n&&f.push(t):t.type===`text`&&d.push(t.text)}if(l.length>0&&(f.length>0||m.length>0)){let e={reasoning:f,model:s,requestedModel:this.model};m.length>0&&(e.fallbacks=m),l[0].providerMetadata=Object.assign(Object.assign({},l[0].providerMetadata),{[eS]:e})}if(e.stop_reason===`max_tokens`&&l.length>0)throw new tS(this.model,t,r,l.map(e=>e.name));let h=u.join(``)||void 0,g=l.length>0?{role:`assistant`,content:d.join(``),reasoning:h,toolCalls:l}:{role:`assistant`,content:d.join(``),reasoning:h};n!=null&&(g.inputTokens=n),r!=null&&(g.outputTokens=r),i!=null&&(g.cacheReadTokens=i),a!=null&&(g.cacheWriteTokens=a),o!=null&&(g.cost=o),g.model=s;let _={parts:{functionCall:c.filter(e=>e.type===`tool_use`).length,thought:c.filter(e=>e.type===`thinking`||e.type===`redacted_thinking`).length,text:c.filter(e=>e.type===`text`).length}};return e.stop_reason&&(_.finishReason=e.stop_reason),g.responseMeta=_,g}buildEndpoint(){if(this.apiKey)return{url:`https://api.anthropic.com/v1/messages`,headers:{"Content-Type":`application/json`,"x-api-key":this.apiKey,"anthropic-version":`2023-06-01`,"anthropic-dangerous-direct-browser-access":`true`},credentials:`omit`};if(this.serverEndpoint)return{url:this.serverEndpoint,headers:{"Content-Type":`application/json`,Accept:`application/x-ndjson`},credentials:`include`};throw Error(`AnthropicTransport: no API key or server endpoint configured. Set ANTHROPIC_API_KEY in your .env or pass apiKey/serverEndpoint in AnthropicAIConfig.`)}post(t,n){return J(this,void 0,void 0,function*(){let{url:r,headers:i,credentials:a}=this.buildEndpoint();return yield Vx({url:r,headers:t.fallbacks?.length?Object.assign(Object.assign({},i),{"anthropic-beta":[i[`anthropic-beta`],`server-side-fallback-2026-06-01`].filter(Boolean).join(`,`)}):i,body:t,credentials:a,vendorLabel:xb.anthropic,retryableStatuses:e.RETRYABLE_STATUSES,timeout:this.timeout,stallTimeout:this.stallTimeout,backoffBaseMs:e.BACKOFF_BASE_MS,signal:n})})}};nS.TOKENS_PER_MILLION=1e6,nS.COST_DECIMAL_PLACES=6,nS.RATE_LIMIT_STATUS=429,nS.SERVICE_UNAVAILABLE_STATUS=503,nS.OVERLOADED_STATUS=529,nS.RETRYABLE_STATUSES=[nS.RATE_LIMIT_STATUS,nS.SERVICE_UNAVAILABLE_STATUS,nS.OVERLOADED_STATUS],nS.BACKOFF_BASE_MS=1e3;let rS=`default_api.`,iS=/print\(\s*$/;var aS=class{constructor(e){this.src=e,this.pos=0}parse(){let e=this.src.indexOf(rS);e===-1&&this.bail();let t=iS.test(this.src.slice(0,e));this.pos=e;let n=this.parseCall();return this.skipWhitespace(),t&&(this.expect(`)`),this.skipWhitespace()),this.pos!==this.src.length&&this.bail(),n}parseCall(){this.expectLiteral(rS);let e=this.readIdentifier();this.expect(`(`);let t=this.parseKwargs();return this.expect(`)`),{name:e,args:t}}parseKwargs(){let e={};for(;this.skipWhitespace(),this.peek()!==`)`;){let t=this.readIdentifier();this.skipWhitespace(),this.expect(`=`),this.skipWhitespace();let n=this.parseValue();Object.prototype.hasOwnProperty.call(e,t)&&this.bail(),e[t]=n,this.skipWhitespace();let r=this.peek();if(r===`,`){this.pos+=1;continue}if(r===`)`)break;this.bail()}return e}parseValue(){let e=this.peek();return e===`"`||e===`'`?this.readString():e===`-`||e===`+`||this.isDigit(e)?this.readNumber():/[A-Za-z]/.test(e)?this.readBareword():this.bail()}readString(){let e=this.src[this.pos];this.pos+=1;let t=``;for(;;){this.pos>=this.src.length&&this.bail();let n=this.src[this.pos];if(this.pos+=1,n===e)return t;if(n===`\\`){t+=this.readEscape();continue}t+=n}}readEscape(){this.pos>=this.src.length&&this.bail();let e=this.src[this.pos];switch(this.pos+=1,e){case`n`:return`
|
|
249
249
|
`;case`t`:return` `;case`r`:return`\r`;case`b`:return`\b`;case`f`:return`\f`;case`\\`:return`\\`;case`"`:return`"`;case`'`:return`'`;case`/`:return`/`;case`u`:return this.readHexCodepoint(4);case`x`:return this.readHexCodepoint(2);default:return this.bail()}}readHexCodepoint(e){let t=this.src.slice(this.pos,this.pos+e);return(t.length!==e||!/^[0-9a-fA-F]+$/.test(t))&&this.bail(),this.pos+=e,String.fromCharCode(parseInt(t,16))}readNumber(){let e=this.pos;for((this.peek()===`-`||this.peek()===`+`)&&(this.pos+=1);this.pos<this.src.length&&/[0-9.eE+-]/.test(this.src[this.pos]);)this.pos+=1;let t=Number(this.src.slice(e,this.pos));return Number.isFinite(t)||this.bail(),t}readBareword(){switch(this.readIdentifier()){case`true`:case`True`:return!0;case`false`:case`False`:return!1;case`null`:case`None`:return null;default:return this.bail()}}readIdentifier(){let e=this.pos;for(/[A-Za-z_]/.test(this.peek())||this.bail();this.pos<this.src.length&&/[A-Za-z0-9_]/.test(this.src[this.pos]);)this.pos+=1;return this.src.slice(e,this.pos)}isDigit(e){return e>=`0`&&e<=`9`}peek(){return this.pos<this.src.length?this.src[this.pos]:``}skipWhitespace(){for(;this.pos<this.src.length&&/\s/.test(this.src[this.pos]);)this.pos+=1}expect(e){this.src[this.pos]!==e&&this.bail(),this.pos+=1}expectLiteral(e){this.src.slice(this.pos,this.pos+e.length)!==e&&this.bail(),this.pos+=e.length}bail(){throw Error(`MalformedFunctionCallParser: unexpected token`)}};function oS(e,t){if(!e)return null;let n;try{n=new aS(e).parse()}catch{return null}return t.has(n.name)?n:null}let sS=e=>`https://generativelanguage.googleapis.com/v1beta/models/${e}:generateContent`,cS={"gemini-2.5-pro":1048576,"gemini-2.5-flash":1048576,"gemini-2.5-flash-lite":1048576,"gemini-3.8-flash":1048576,"gemini-3.5-flash":1048576,"gemini-3.1-flash-lite":1048576,"gemini-3.1-pro-preview":1048576};function lS(e){if(e&&e!==`auto`)return e===`required`?{functionCallingConfig:{mode:`ANY`}}:e===`none`?{functionCallingConfig:{mode:`NONE`}}:{functionCallingConfig:{mode:`ANY`,allowedFunctionNames:[e.tool]}}}function uS(e){if(!zb.includes(e))throw Error(`GeminiTransport: unsupported model "${e}". Use one of: ${zb.join(`, `)}.`)}let dS={"gemini-2.5-flash":`GeminiTransport: using gemini-2.5-flash — higher cost than flash-lite; use for harder reasoning or agent tasks.`,"gemini-2.5-pro":`GeminiTransport: using gemini-2.5-pro — significantly higher, prompt-size-tiered cost; reserve for tasks where flash reliability is insufficient.`,"gemini-3.5-flash":`GeminiTransport: using gemini-3.5-flash — frontier model, materially higher cost than flash-lite; use for harder reasoning or agent tasks.`,"gemini-3.8-flash":`GeminiTransport: using gemini-3.8-flash — frontier model, materially higher cost than flash-lite. Its $0.75/$3.75 per-MTok rate is introductory and DOUBLES to $1.50/$7.50 on 2027-01-01; re-check this tier choice before then.`,"gemini-3.1-pro-preview":`GeminiTransport: using gemini-3.1-pro-preview — PREVIEW model (no stability guarantee, may be withdrawn) with significantly higher, prompt-size-tiered cost; reserve for tasks where flash reliability is insufficient.`},fS=[`gemini-2.5-flash`,`gemini-2.5-flash-lite`],pS=[`gemini-3.8-flash`,`gemini-3.5-flash`,`gemini-3.1-flash-lite`,`gemini-3.1-pro-preview`],mS=[`minimal`,`low`,`medium`,`high`],hS={"gemini-3.8-flash":[`low`,`medium`,`high`],"gemini-3.5-flash":[`minimal`,`low`,`medium`,`high`],"gemini-3.1-flash-lite":[`minimal`,`low`,`medium`,`high`],"gemini-3.1-pro-preview":[`low`,`medium`,`high`]};function gS(e,t){if(!e?.length||e.includes(t))return t;let n=mS.indexOf(t),r=e=>Math.abs(mS.indexOf(e)-n),i=e[0];for(let t of e)r(t)<=r(i)&&(i=t);return i}let _S={minimal:`minimal`,low:`low`,medium:`medium`,high:`high`,max:`high`},vS=e=>e!==void 0&&e!==`auto`&&e!==`off`;function yS(e,t){if(vS(t)){let n=hS[e];if(n)return{includeThoughts:!0,thinkingLevel:gS(n,_S[t])}}return t===`off`&&fS.includes(e)?{includeThoughts:!1,thinkingBudget:0}:t===`auto`&&fS.includes(e)?{includeThoughts:!0,thinkingBudget:-1}:{includeThoughts:!0}}let bS=`gemini`;function xS(e){let t=[],n=[];for(let r of e)r.kind===`image`?t.push({inlineData:{mimeType:Vb(r.mimeType),data:Hb(r.data)}}):n.push({text:`[File: ${r.name}]\n${r.content}`});return{imageParts:t,textParts:n}}var SS=class extends Error{constructor(e){super(`Gemini returned MALFORMED_FUNCTION_CALL`),this.finishMessage=e,this.name=`MalformedFunctionCallError`}},CS=class e{warnIfThinkingUnclampable(e){if(!this.warnedThinkingClamped){if(e===`off`&&!fS.includes(this.model)){this.warnedThinkingClamped=!0,_b.warn(`GeminiTransport: thinkingPolicy 'off' ignored — ${this.model} runs its default thinking posture and takes no budget we can safely set. Reasoning tokens are still billed at the candidate rate; use a flash tier if you need them gone.`);return}if(vS(e)){let t=hS[this.model];if(!t){this.warnedThinkingClamped=!0,_b.warn(`GeminiTransport: thinkingPolicy '${e}' ignored — ${this.model} takes a numeric thinking budget, not the graded 'thinkingLevel' the Gemini 3 tiers use, so this turn runs at its default reasoning posture. Use a Gemini 3 tier to set reasoning depth.`);return}let n=_S[e],r=gS(t,n);r!==n&&(this.warnedThinkingClamped=!0,_b.warn(`GeminiTransport: thinkingPolicy '${e}' sent as thinkingLevel '${r}' — ${this.model} does not accept '${n}' (it takes ${t.join(`/`)}). Reasoning bills at the candidate rate, so an upward clamp costs more than you asked for.`))}}}constructor(e={}){this.lifetimeCostUsd=0,this.lifetimeSavingsUsd=0,this.warnedThinkingClamped=!1;let t=e.model??`gemini-2.5-flash-lite`;uS(t),this.model=t;let n=dS[t];n&&_b.warn(n),this.timeout=e.timeout??3e5,this.stallTimeout=e.stallTimeout??3e4,this.apiKey=e.apiKey,this.serverEndpoint=e.serverEndpoint}getConfig(){return{provider:`gemini`,model:this.model,contextLimit:cS[this.model]}}getLifetimeCost(){return this.lifetimeCostUsd}getLifetimeSavings(){return this.lifetimeSavingsUsd}resetLifetimeCost(){this.lifetimeCostUsd=0,this.lifetimeSavingsUsd=0}sendStructuredPrompt(e){return J(this,void 0,void 0,function*(){let{systemPrompt:t,userPrompt:n,responseSchema:r}=e,i=[];return t&&(i.push({role:`user`,parts:[{text:t}]}),i.push({role:`model`,parts:[{text:`Understood.`}]})),i.push({role:`user`,parts:[{text:n}]}),(yield this.post({model:this.model,contents:i,responseSchema:r}))?.content??``})}sendChatMessage(e,t,n){return J(this,void 0,void 0,function*(){let r=this.toGeminiContents(e,t,n?.attachments);n?.tailContext&&r.push({role:`user`,parts:[{text:n.tailContext}]});let i=n?.tools?.length?[{functionDeclarations:n.tools.map(e=>({name:e.name,description:e.description,parameters:fx(e.parameters)}))}]:void 0,a=n?.systemPrompt?{role:`system`,parts:[{text:n.systemPrompt}]}:void 0,o=i?lS(n?.toolChoice):void 0;this.warnIfThinkingUnclampable(n?.thinkingPolicy);let s={thinkingConfig:yS(this.model,n?.thinkingPolicy)};n?.maxTokens!=null&&(s.maxOutputTokens=n.maxTokens);let c=[...n?.attachments??[],...e.flatMap(e=>e.attachments??[]),...e.flatMap(e=>e.toolResult?.attachments??[])].find(e=>e.kind===`image`&&e.detail);c?.kind===`image`&&c.detail&&pS.includes(this.model)&&(s.mediaResolution=`MEDIA_RESOLUTION_${c.detail.toUpperCase()}`),n?.temperature!=null&&(s.temperature=Wb(n.temperature,{defaultTemp:1,maxTemp:2}));let l=new Set((n?.tools??[]).map(e=>e.name)),u=this.model.startsWith(`gemini-3`),d=n?.responseSchema!=null&&(!i||u),f=yield this.post(Object.assign({model:this.model,contents:r,tools:i,systemInstruction:a,toolConfig:o,generationConfig:s},d?{responseSchema:fx(n.responseSchema)}:{}),n?.signal);return this.fromGeminiResponse(f,l,s.maxOutputTokens)})}logTokenUsage(t,n,r,i){let{costUsd:a,savedUsd:o,breakdown:s}=Zb(this.model,{promptTokens:t,candidateTokens:n,thoughtTokens:r,cachedTokens:i});this.lifetimeCostUsd+=a,this.lifetimeSavingsUsd+=o;let c=e.COST_DECIMAL_PLACES;return console.log(`--- Gemini Token Usage (${this.model}) ---`),console.log(`Prompt Tokens: ${t} (${i} cached) ($${s.promptUsd.toFixed(c)} + $${s.cacheReadUsd.toFixed(c)})`),console.log(`Candidate Tokens: ${n} (+${r} thinking) ($${s.candidateUsd.toFixed(c)})`),console.log(`Total Cost: $${a.toFixed(c)}`),console.log(`Cache Saved: $${o.toFixed(c)} (lifetime $${this.lifetimeSavingsUsd.toFixed(c)})`),console.log(`Lifetime Cost: $${this.lifetimeCostUsd.toFixed(c)}`),console.log(`--------------------------`),a}toGeminiContents(e,t,n){let r=[],i=/* @__PURE__ */ new Map;for(let t of e){if(t.role===`system`||t.role===`system-event`||t.role===`synthetic-user`||t.role===`compacted-summary`||t.category===`reasoning`||t.category===`narration`||t.excludeFromProvider||t.thinking)continue;let e=t.role===`user`?`user`:`model`;if(t.toolResult){let e=i.get(t.toolResult.toolCallId)??t.toolResult.toolCallId;r.push({role:`user`,parts:[{functionResponse:{name:e,response:{content:t.toolResult.content}}}]});let n=t.toolResult.attachments??[];n.length&&r.push({role:`user`,parts:n.map(e=>({inlineData:{mimeType:Vb(e.mimeType),data:e.data}}))})}else if(t.toolCalls?.length){for(let e of t.toolCalls)i.set(e.id,e.name);r.push({role:`model`,parts:t.toolCalls.map((e,t)=>{let n={functionCall:{name:e.name,args:e.args}},r=e.providerMetadata?.[bS],i=r?.model===this.model?r.thoughtSignature:void 0;return i?n.thoughtSignature=i:t===0&&(n.thoughtSignature=`skip_thought_signature_validator`),n})})}else if(e===`user`&&t.attachments?.length){let{imageParts:e,textParts:n}=xS(t.attachments);r.push({role:`user`,parts:[...e,...t.content?[{text:t.content}]:[],...n]})}else r.push({role:e,parts:[{text:t.content}]})}let{imageParts:a,textParts:o}=xS(n??[]);return(t||a.length||o.length)&&r.push({role:`user`,parts:[...a,...t?[{text:t}]:[],...o]}),r}usageFromGemini(e){if(!e)return{};let t=e,n=this.logTokenUsage(t.promptTokenCount??0,t.candidatesTokenCount??0,t.thoughtsTokenCount??0,t.cachedContentTokenCount??0);return{inputTokens:t.promptTokenCount,outputTokens:t.candidatesTokenCount!=null||t.thoughtsTokenCount!=null?(t.candidatesTokenCount??0)+(t.thoughtsTokenCount??0):void 0,thoughtsTokens:t.thoughtsTokenCount,cacheReadTokens:t.cachedContentTokenCount,cost:n}}fromGeminiResponse(e,t=/* @__PURE__ */ new Set,n){let{inputTokens:r,outputTokens:i,thoughtsTokens:a,cacheReadTokens:o,cost:s}=this.usageFromGemini(e.usageMetadata),c=e?.candidates?.[0],l=c?.content?.parts??[],u=[],d=[],f=[];for(let e of l)if(e.functionCall){let t={model:this.model};e.thoughtSignature&&(t.thoughtSignature=e.thoughtSignature),u.push({id:crypto.randomUUID(),name:e.functionCall.name,args:e.functionCall.args??{},providerMetadata:{[bS]:t}})}else e.thought&&e.text?d.push(e.text):e.text&&f.push(e.text);if(c?.finishReason===`MALFORMED_FUNCTION_CALL`){let e=oS(c.finishMessage,t);if(!e)throw new SS(c.finishMessage);u.push({id:crypto.randomUUID(),name:e.name,args:e.args})}let p=d.join(``),m=f.join(``),h=u.length>0?{role:`assistant`,content:m,reasoning:p||void 0,toolCalls:u}:{role:`assistant`,content:m,reasoning:p||void 0},g=c?.finishReason;(u.length===0&&!p&&!m||g&&g!==`STOP`&&g!==`MALFORMED_FUNCTION_CALL`)&&this.logAbnormalResponse(e,{finishReason:g,functionCallParts:u.length,thoughtParts:d.length,textParts:f.length}),this.guardMaxTokensTruncation(g,u,m,i,n),r!=null&&(h.inputTokens=r),i!=null&&(h.outputTokens=i),o!=null&&(h.cacheReadTokens=o),s!=null&&(h.cost=s);let _=e.promptFeedback?.blockReason;return(g!=null||a!=null||_!=null)&&(h.responseMeta={finishReason:g,thoughtsTokens:a,parts:{functionCall:u.length,thought:d.length,text:f.length},blockReason:_}),h}guardMaxTokensTruncation(e,t,n,r,i){if(e===`MAX_TOKENS`&&(t.length!==0||n.trim()===``))throw new tS(this.model,i,r,t.map(e=>e.name))}logAbnormalResponse(e,t){let n=e.usageMetadata??{},r=e.candidates?.[0]??{};_b.warn(`GeminiTransport: blank/non-STOP response`,{model:this.model,finishReason:t.finishReason,finishMessage:r.finishMessage,parts:{total:t.functionCallParts+t.thoughtParts+t.textParts,functionCall:t.functionCallParts,thought:t.thoughtParts,text:t.textParts},usage:{promptTokenCount:n.promptTokenCount,candidatesTokenCount:n.candidatesTokenCount,thoughtsTokenCount:n.thoughtsTokenCount,totalTokenCount:n.totalTokenCount},promptFeedback:e.promptFeedback,safetyRatings:r.safetyRatings,citationMetadata:r.citationMetadata})}buildEndpoint(e){if(this.apiKey)return{url:`${sS(this.model)}?key=${this.apiKey}`,payload:this.toDirectPayload(e),headers:{"Content-Type":`application/json`},credentials:`omit`};if(this.serverEndpoint)return{url:this.serverEndpoint,payload:e,headers:{"Content-Type":`application/json`,Accept:`application/x-ndjson`},credentials:`include`};throw Error(`GeminiTransport: no API key or server endpoint configured. Set GEMINI_API_KEY in your .env or pass apiKey/serverEndpoint in GeminiAIConfig.`)}post(t,n){return J(this,void 0,void 0,function*(){let{url:r,payload:i,headers:a,credentials:o}=this.buildEndpoint(t);return yield Vx({url:r,headers:a,body:i,credentials:o,vendorLabel:xb.gemini,retryableStatuses:e.RETRYABLE_STATUSES,timeout:this.timeout,stallTimeout:this.stallTimeout,backoffBaseMs:e.BACKOFF_BASE_MS,signal:n})})}toDirectPayload(e){let t=Object.assign({},e);return delete t.model,t.responseSchema&&(t.generationConfig=Object.assign(Object.assign({},t.generationConfig),{responseMimeType:`application/json`,responseSchema:t.responseSchema}),delete t.responseSchema),t}};CS.TOKENS_PER_MILLION=1e6,CS.COST_DECIMAL_PLACES=6,CS.RATE_LIMIT_STATUS=429,CS.SERVICE_UNAVAILABLE_STATUS=503,CS.BAD_GATEWAY_STATUS=502,CS.RETRYABLE_STATUSES=[CS.RATE_LIMIT_STATUS,CS.SERVICE_UNAVAILABLE_STATUS,CS.BAD_GATEWAY_STATUS],CS.BACKOFF_BASE_MS=1e3;var wS=class e{constructor(){this.noopProvider=new bb}get(t){return t===e.DEFAULT_NAME?this.noopProvider:void 0}default(){return this.noopProvider}defaultName(){return e.DEFAULT_NAME}names(){return[e.DEFAULT_NAME]}getStatus(t){return J(this,void 0,void 0,function*(){var n;return t!==void 0&&t!==e.DEFAULT_NAME?null:(yield(n=this.noopProvider).getStatus?.call(n))??null})}listStatuses(){return J(this,void 0,void 0,function*(){var t;let n=(yield(t=this.noopProvider).getStatus?.call(t))??null;return[{name:e.DEFAULT_NAME,isDefault:!0,status:n}]})}};wS.DEFAULT_NAME=`default`;let TS=N.createInterface(e=>e.singleton(wS)),ES=6e4,DS=3e5;Object.freeze({anthropic:Object.freeze({low:Object.freeze({model:`claude-haiku-4-5-20251001`,maxTokens:16e3,stallTimeoutMs:ES,timeoutMs:DS}),high:Object.freeze({model:`claude-sonnet-5`,maxTokens:128e3,stallTimeoutMs:ES,timeoutMs:DS}),reasoning:Object.freeze({model:`claude-opus-4-8`,maxTokens:32e3,stallTimeoutMs:ES,timeoutMs:DS})}),gemini:Object.freeze({low:Object.freeze({model:`gemini-3.1-flash-lite`,stallTimeoutMs:ES,timeoutMs:DS}),high:Object.freeze({model:`gemini-3.8-flash`,stallTimeoutMs:ES,timeoutMs:DS}),reasoning:Object.freeze({model:`gemini-3.1-pro-preview`,stallTimeoutMs:ES,timeoutMs:DS})})});let OS=O` :host{display: block;width: 800px}.ai-criteria-search{display: flex;flex-direction: column;gap: calc(${B} * 2px)}.ai-criteria-search-row{display: flex;flex-direction: row;gap: calc(${B} * 2px);align-items: center}.criteria-input{height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px);flex: 1;min-width: 0}.criteria-chips-inline{height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px);flex: 1;min-width: 0;display: flex;align-items: center;gap: calc(${B} * 1px);overflow-x: auto;padding: 0 calc(${B} * 2px);background: var(--neutral-fill-input-rest);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px);scrollbar-width: none}.criteria-chips-inline::-webkit-scrollbar{display: none}.mic-icon{color: var(--neutral-foreground-rest);fill: currentColor}.criteria-toggle-button, .criteria-clear-button{flex-shrink: 0}.criteria-chip{display: inline-flex;align-items: center;flex-shrink: 0;gap: calc(${B} * 1px);padding: calc(${B} * 0.5px) calc(${B} * 2px);background: var(--neutral-fill-rest);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(${B} * 4px);font-size: var(--type-ramp-minus-1-font-size);color: var(--neutral-foreground-rest);white-space: nowrap}.criteria-chip-field{font-weight: 600}.criteria-chip-operator{color: var(--neutral-foreground-hint, var(--neutral-foreground-rest));font-style: italic}.criteria-chip-remove{display: inline-flex;align-items: center;justify-content: center;width: 14px;height: 14px;padding: 0;margin-left: calc(${B} * 0.5px);background: none;border: none;cursor: pointer;color: var(--neutral-foreground-hint, var(--neutral-foreground-rest));font-size: 10px;border-radius: 50%;line-height: 1}.criteria-chip-remove:hover{background: var(--neutral-fill-hover);color: var(--neutral-foreground-rest)}`,kS=e=>T` ${A(()=>gb(),T`<div class="ai-criteria-search"><div class="ai-criteria-search-row">${A(e=>!e.showingChips,T`<${e}-text-area ${k(`textAreaRef`)}class="criteria-input" placeholder="${e=>e.placeholder}" ?disabled=${e=>e.disabled||e.isInterpreting}:value=${Nf(e=>e.inputValue,`string`,`input`)}@blur=${e=>e.handleBlur()}rows="1"></${e}-text-area>`)} ${A(e=>e.showingChips,T`<div class="criteria-chips-inline">${j(e=>e.criteriaChips,T`<span class="criteria-chip"><span class="criteria-chip-field">${e=>e.fieldLabel}</span><span class="criteria-chip-operator">${e=>e.operatorLabel}</span>${A(e=>!!e.valueLabel,T`<span class="criteria-chip-value">${e=>e.valueLabel}</span>`)}<button class="criteria-chip-remove" aria-label="Remove filter" @click=${(e,t)=>t.parent.removeChip(e.groupIndex,e.clauseIndex)}>
|
|
@@ -998,11 +998,11 @@ ${e?`<li><strong>Minutes:</strong> Runs at every interval of minutes from the ho
|
|
|
998
998
|
</${t}>`}} `)} `}} `,T`<div>Select a field to set value</div>`)} `,G5=class extends Qe{constructor(){super(...arguments),this.variadic=!1,this.validationError=!1,this.field=null,this.operator=null}connectedCallback(){super.connectedCallback(),I5(this,this.styles,`value`)}validateInput(e){return this.field&&[`validation`in this.field?this.field.validation(e):null,CFe(P5(this),e)].filter(e=>!!e).join(`, `)||null}handleInputChange(e){e.stopPropagation();let t=e.target;if(t.type!==`checkbox`&&t.type!==`select-one`){let e=this.validateInput(t.value);if(e){this.validationError=!0,this.validationMsg=e;return}this.validationError=!1,this.validationMsg=null}let n;n=t.getAttribute(`role`)===`checkbox`?t.checked:t.type===`select-one`?e.target.value:this.field&&U5(P5(this))?parseInt(t.value):this.field&&W5(P5(this))?parseFloat(t.value):t.value,this.value=n;let r={value:n,index:parseInt(this.valueIndex)};this.dispatchEvent(new CustomEvent(L5.ValueUpdated,{detail:r,bubbles:!0,composed:!0}))}handleRemoveVariadicOperand(){if(!this.variadic)throw Error(`Cannot remove inputs for non-variadic operator`);let e={index:parseInt(this.valueIndex)};this.dispatchEvent(new CustomEvent(L5.RemoveVarArg,{detail:e,bubbles:!0,composed:!0}))}};q([D({attribute:`value-index`})],G5.prototype,`valueIndex`,void 0),q([D({mode:`boolean`})],G5.prototype,`variadic`,void 0),q([D({mode:`boolean`,attribute:`validation-error`})],G5.prototype,`validationError`,void 0),q([D({attribute:`validation-msg`})],G5.prototype,`validationMsg`,void 0),q([C],G5.prototype,`field`,void 0),q([C],G5.prototype,`operator`,void 0),q([C],G5.prototype,`value`,void 0),q([C],G5.prototype,`config`,void 0),q([C],G5.prototype,`styles`,void 0),G5=q([$e({name:`expression-rule-value`,template:kFe,styles:wFe,shadowOptions:{delegatesFocus:!0}})],G5);let K5=(e,t)=>t.field.defaultValue===void 0?jFe(e,t):t.field.defaultValue,AFe=(e,t)=>n=>{if(e?.valueType?.type!==t.operator?.valueType?.type||!(`value`in t)||!t.value||!t.operator)return null;let r=t.operator.nbInputs===1?[t.value]:t.value;return n>=r.length?null:r[n]},jFe=(e,t)=>{switch(P5(Object.assign(Object.assign({},t),{operator:e}))){case`string`:return``;case`boolean`:return!1;case`date`:return j5(/* @__PURE__ */ new Date);case`date-time`:return M5(/* @__PURE__ */ new Date);case`double`:case`int`:case`bigdecimal`:case`short`:case`long`:return 0;case`enum`:{let n=e?.valueType?.type===`enum`?e?.valueType?.values:t.field.type===`enum`?t.field.values:{};if(Object.keys(n).length===0)throw Error(`Enums require configured values`);return Object.keys(n)[0]}}},MFe=(e,t)=>{let n=AFe(e,t);switch(e.nbInputs){case 0:return{field:t.field,operator:e,value:void 0};case 1:return{field:t.field,operator:e,value:n(0)??K5(e,t)};case 2:return{field:t.field,operator:e,value:[n(0)??K5(e,t),n(1)??K5(e,t)]};case`many`:return{field:t.field,operator:e,value:[n(0)??K5(e,t)]}}},NFe=(e,t,n)=>{switch(e.operator.nbInputs){case 0:throw Error(`Cannot set the value for a UniraryOperator`);case 1:return{field:e.field,operator:e.operator,value:t};case 2:case`many`:if(!(`value`in e)||!Array.isArray(e.value))throw Error(`Invalid value shape for rule`);return{field:e.field,operator:e.operator,value:e.value.map((e,r)=>r===n?t:e)}}},PFe=e=>!e&&e!==0,FFe=e=>{if(!e.field||!e.operator)return!0;if(e.operator.nbInputs===0)return!1;if(!(`value`in e))throw Error(`No value set as required for operator`);return P5(e)!==`boolean`&&!!(Array.isArray(e.value)?e.value:[e.value]).some(PFe)},IFe=O` .rule-container{border: 1px solid #eee;margin-bottom: 5px;padding: 5px;display: grid;grid-template-columns: auto 1fr}.rule-container.error{border-color: red}.margin{margin-left: calc(var(--design-unit) * 1px);margin-right: calc(var(--design-unit) * 1px)}.rule-header{margin-bottom: 5px;display: flex;justify-content: flex-end}.rule-actions{display: inline-block}.rule-content{display: flex;flex-wrap: wrap;align-items: center}.rule-field-container, .rule-operator-container, .rule-value-container{display: inline-block;margin: 0 5px 0 0;vertical-align: middle}.rule-value-container{border-left: var(--rule-value-separator);padding-left: 5px}.rule-value-container label{margin-bottom: 0;font-weight: normal}.rule-value-container label.block{display: block}expression-rule-value{display: flex}`,LFe=T` ${e=>{let t=e.styles?.customElements?.button||`button`;return T`<div class="rule-container ${e=>dn([`error`,e.error])}"><div class="rule-content"><expression-rule-field class="margin" :fields=${e=>e.config.fields}:field=${e=>e.model?.field}:config=${e=>e.config}:styles=${e=>e.styles}@field-selected=${(e,t)=>e.handleFieldSelected(t.event)}></expression-rule-field><expression-rule-operator class="margin" :operators=${e=>e.config.operators}:field=${e=>e.model.field}:operator=${e=>e.model?.operator}:config=${e=>e.config}:styles=${e=>e.styles}@operator-selected=${(e,t)=>e.handleOperatorSelected(t.event)}></expression-rule-operator>${j(e=>e.operandIterator,T`<expression-rule-value class="margin" :config=${(e,t)=>t.parent.config}:styles=${(e,t)=>t.parent.styles}:field=${(e,t)=>t.parent.model.field}:operator=${(e,t)=>t.parent.model.operator}:value=${(e,t)=>t.parent.operandValue(t.index)}value-index=${(e,t)=>t.index}?variadic=${(e,t)=>t.parent.model?.operator?.nbInputs===`many`}@value-updated=${(e,t)=>t.parent.handleValueChanged(t.event)}@remove-variadic-operand=${(e,t)=>t.parent.handleRemoveVarArg(t.event)}></expression-rule-value>`,{positioning:!0,recycle:!1})} ${A(e=>e.model?.operator?.nbInputs===`many`,T`<${t}type="button" class="btn btn-sm btn-accept" @click="${e=>e.dispatchAddVarArg()}">
|
|
999
999
|
+
|
|
1000
1000
|
</${t}>`)}</div><div class="rule-header"><div class="btn-group rule-actions"><${t}type="button" class="btn btn-sm btn-danger" data-delete="rule" @click="${(e,t)=>e.dispatchDeleteRule(t.event)}">
|
|
1001
|
-
Delete Rule </${t}></div></div></div>`}} `,q5=class extends Qe{constructor(){super(...arguments),this.error=!1}connectedCallback(){super.connectedCallback(),I5(this,this.styles,`rule`),this.config.partialRuleValidationWarning&&(this.error=FFe(this.model))}variadicRule(e){return e.operator.nbInputs===`many`&&`value`in e&&Array.isArray(e.value)}get operandIterator(){if(this.model.operator?.nbInputs===`many`){if(!this.variadicRule(this.model))throw Error(`Varargs disabled for many nbInputs`);return Array(this.model.value.length).fill(!0)}return Array(this.model.operator?.nbInputs??0).fill(!0)}operandValue(e){if(this.model.operator){if(this.model.operator.nbInputs===1&&`value`in this.model)return this.model.value;if((this.model.operator.nbInputs===2||this.model.operator.nbInputs===`many`)&&`value`in this.model&&Array.isArray(this.model.value))return this.model.value[e];throw Error(`Invalid operand lookup`)}}dispatchAddVarArg(){if(!this.variadicRule(this.model))throw Error(`Cannot add inputs for non-variadic operator, or invalid format`);let e={ruleId:this.model.ruleId,newData:{operator:this.model.operator,field:this.model.field,value:[...this.model.value,K5(this.model.operator,this.model)]}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:e,bubbles:!0,composed:!0}))}handleRemoveVarArg(e){let{index:t}=e.detail;if(!this.variadicRule(this.model))throw Error(`Cannot remove inputs for non-variadic operator, or invalid format`);let n={ruleId:this.model.ruleId,newData:{operator:this.model.operator,field:this.model.field,value:this.model.value.filter((e,n)=>n!==t)}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:n,bubbles:!0,composed:!0}))}dispatchDeleteRule(e){e.stopPropagation();let t={ruleId:this.model.ruleId};this.dispatchEvent(new CustomEvent(L5.DelRule,{detail:t,bubbles:!0,composed:!0}))}handleFieldSelected(e){e.stopPropagation();let{fieldId:t}=e.detail,n=this.config.fields.find(e=>e.fieldId===t)??null,r={ruleId:this.model.ruleId,newData:{field:n,value:null,operator:null}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:r,bubbles:!0,composed:!0}))}handleValueChanged(e){e.stopPropagation();let{value:t,index:n}=e.detail,r={ruleId:this.model.ruleId,newData:NFe(this.model,t,n)};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:r,bubbles:!0,composed:!0}))}handleOperatorSelected(e){e.stopPropagation();let{operatorId:t}=e.detail;if(!t)return;let n=this.config.operators.find(e=>e.type===t)??null;if(!n)throw Error(`Unable to find operator of type ${t}`);this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:{ruleId:this.model.ruleId,newData:MFe(n,this.model)},bubbles:!0,composed:!0}))}};q([C],q5.prototype,`config`,void 0),q([C],q5.prototype,`styles`,void 0),q([C],q5.prototype,`model`,void 0),q([C],q5.prototype,`index`,void 0),q([D({mode:`boolean`})],q5.prototype,`error`,void 0),q([w],q5.prototype,`operandIterator`,null),q5=q([$e({name:`expression-rule`,template:LFe,styles:IFe,shadowOptions:{delegatesFocus:!0}})],q5);let J5=class extends Qe{constructor(){super(...arguments),this.model=null,this.ruleCount=0,this.groupCount=0,this.userUpdatingModel=!1,this.handleAddGroup=this._handleAddGroup.bind(this),this.handleAddRule=this._handleAddRule.bind(this),this.handleDeleteGroup=this._handleDeleteGroup.bind(this),this.handleDeleteRule=this._handleDeleteRule.bind(this),this.handleUpdateGroupData=this._handleUpdateGroupData.bind(this),this.handleUpdateRuleData=this._handleUpdateRuleData.bind(this)}configChanged(e,t){if(!this.isValidConfig(t)){console.warn(`Invalid config passed to ExpressionBuilder. Verify you've defined operators, fields, and combinators.`);return}t.model?(this.ruleCount=0,this.groupCount=0,this.userUpdatingModel=!0,this.model=hFe(t.model,this),this.userUpdatingModel=!1):this.model===null&&this.initBaseModel()}modelChanged(e,t){if(!t||this.userUpdatingModel)return;let n=A5(t);this.dispatchChangeEvent(n)}dispatchChangeEvent(e){this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,cancelable:!0,composed:!0}))}getConfig(){return this.config}getGroupId(){return this.groupCount+=1,`group-${this.groupCount}`}getRuleId(){return this.ruleCount+=1,`rule-${this.ruleCount}`}connectedCallback(){if(super.connectedCallback(),this.addEventListener(L5.AddGroup,this.handleAddGroup),this.addEventListener(L5.DelGroup,this.handleDeleteGroup),this.addEventListener(L5.AddRule,this.handleAddRule),this.addEventListener(L5.DelRule,this.handleDeleteRule),this.addEventListener(L5.UpdateGroup,this.handleUpdateGroupData),this.addEventListener(L5.UpdateRule,this.handleUpdateRuleData),!this.isValidConfig(this.config)){this.config&&console.warn(`Config detected during connectedCallback but it isn't valid`),this.config=null;return}this.config.model||this.initBaseModel()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(L5.AddGroup,this.handleAddGroup),this.removeEventListener(L5.DelGroup,this.handleDeleteGroup),this.removeEventListener(L5.AddRule,this.handleAddRule),this.removeEventListener(L5.DelRule,this.handleDeleteRule),this.removeEventListener(L5.UpdateGroup,this.handleUpdateGroupData),this.removeEventListener(L5.UpdateRule,this.handleUpdateRuleData)}isValidConfig(e){return!!(e&&e.combinators?.length&&e.operators?.length&&e.fields?.length)}initBaseModel(){if(!this.isValidConfig(this.config))throw Error(`Invalid config set on ExpressionBuilder. Verify you've defined operators, fields, and combinators.`);this.model={children:[],level:1,groupId:k5,config:this.config,combinator:this.config.combinators[0]}}_handleAddGroup(e){let{parentGroupId:t,newGroup:n}=e.detail,r={groupId:this.getGroupId(),level:n.level,children:[],config:this.config,combinator:this.config.combinators[0]};this.model=O5(this.model,t,r)}_handleAddRule(e){let{parentGroupId:t}=e.detail,n={ruleId:this.getRuleId(),config:this.config,field:null,operator:null,value:null};this.model=O5(this.model,t,n)}_handleDeleteGroup(e){let{groupId:t}=e.detail;this.model=dFe(this.model,t)}_handleDeleteRule(e){let{ruleId:t}=e.detail;this.model=fFe(this.model,t)}_handleUpdateGroupData(e){let{groupId:t,newData:n}=e.detail;this.model=pFe(this.model,t,n)}_handleUpdateRuleData(e){let{ruleId:t,newData:n}=e.detail;this.model=mFe(this.model,t,n)}};q([C],J5.prototype,`config`,void 0),q([C],J5.prototype,`styles`,void 0),q([C],J5.prototype,`model`,void 0),J5=q([$e({name:`expression-builder`,template:B5,styles:R5})],J5);let Y5=class extends J5{};Y5=q([$e({name:`foundation-expression-builder`,styles:R5,template:B5})],Y5);let X5=[`int`,`short`,`long`],Z5=[`double`,`bigdecimal`],Q5=[...X5,...Z5],$5=[`date`,`date-time`],e7=[`string`,`enum`],t7=[`boolean`],n7=e=>e.operator?.valueType?.type??e.field.type;function r7(e){switch(n7(e)){case`int`:case`long`:case`double`:case`bigdecimal`:case`date`:case`date-time`:case`short`:return`NUMBER`;case`string`:case`enum`:return`STRING`;case`boolean`:return`BOOLEAN`}}function i7(e,t,n){return`value`in e?{TYPE:`BINARY_EXPRESSION`,LEFT:{TYPE:`FIELD`,NAME:e.field.fieldId},OPERATION:t,RIGHT:{TYPE:n,VALUE:e.value}}:null}function a7(e,t,n){return{TYPE:`BINARY_EXPRESSION`,LEFT:{TYPE:`FIELD`,NAME:e.field.fieldId},OPERATION:t,RIGHT:n}}function o7(e,t,n=[]){return`value`in e?{TYPE:`METHOD_EXPRESSION`,PARAMETERS:[{TYPE:`FIELD`,NAME:e.field.fieldId},...n],METHOD:t}:null}function s7(e){let t=t=>{let n=n7(e);if(e7.includes(n))return t;if(Q5.includes(n))return t.toString();if(t7.includes(n))return t;if(Array.isArray(t))throw Error(`Not implemented TernararyOperator or VariadicOperator args in rule value transformer`);if($5.includes(n))return new Date(t).getTime().toString();throw Error(`Unhandled transformRuleValue case`)},n=!(!(`value`in e)||e.value===void 0||e.value===null);return Object.assign(Object.assign({},e),n?{value:t(e.value)}:{})}function c7(e,t){return{TYPE:`PREDICATE_EXPRESSION`,OPERATION:e.combinator.type,EXPRESSIONS:e.children.map(e=>`children`in e?c7(e,t):t(e)).filter(Boolean)}}function l7(e,t){let n=t=>{let n=n7(e);if(e7.includes(n))return t;if(X5.includes(n))return parseInt(t);if(Z5.includes(n))return parseFloat(t);if(t7.includes(n))return t;if($5.includes(n)){let e=new Date(parseInt(t));return n===`date`?j5(e):M5(e)}throw Error(`Unhandled rebuildRuleValue case`)},r=e.operator.nbInputs;if(r===`many`||r===2)throw Error(`Not implemented TernararyOperator or VariadicOperator args in rebuildRuleValue`);return Object.assign(Object.assign({},e),r===0?{}:{value:n(t.VALUE)})}let u7={template:B5,styles:R5};var d7;(function(e){e.methodCall={CONTAINS_IGNORE_CASE:`CONTAINS_IGNORE_CASE`,CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE:`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`,IS_NULL_OR_BLANK:`IS_NULL_OR_BLANK`,NOT_NULL_OR_BLANK:`NOT_NULL_OR_BLANK`,TRIM:`TRIM`,LONG_TO_DATE:`LONG_TO_DATE`,LONG_TO_DATE_TIME:`LONG_TO_DATE_TIME`,DATE_TIME_IS_IN_RANGE:`DATE_TIME_IS_IN_RANGE`},e.logicalOperations={AND:`AND`,OR:`OR`},e.operations=Object.assign(Object.assign({},e.logicalOperations),{GREATER_THAN:`GREATER_THAN`,LESS_THAN:`LESS_THAN`,GREATER_THAN_OR_EQUAL:`GREATER_THAN_OR_EQUAL`,LESS_THAN_OR_EQUAL:`LESS_THAN_OR_EQUAL`,EQUALS:`EQUALS`,NOT_EQUALS:`NOT_EQUALS`,PLUS:`PLUS`,MINUS:`MINUS`,MULTIPLY:`MULTIPLY`,DIVIDE:`DIVIDE`,BITWISE_AND:`BITWISE_AND`,BITWISE_OR:`BITWISE_OR`,ASSIGNMENT:`ASSIGNMENT`,IS_CURRENT:`IS_CURRENT`,IS_PREVIOUS:`IS_PREVIOUS`})})(d7||(d7={}));let f7=[{type:d7.logicalOperations.AND,maxRules:`many`},{type:d7.logicalOperations.OR,maxRules:`many`}],$={EQUALS:d7.operations.EQUALS,NOT_EQUALS:d7.operations.NOT_EQUALS,IS_NULL:`IS_NULL`,NOT_NULL:`NOT_NULL`,IS_NULL_OR_BLANK:`IS_NULL_OR_BLANK`,NOT_NULL_OR_BLANK:`NOT_NULL_OR_BLANK`,CONTAINS:`CONTAINS`,CONTAINS_WORDS_STARTING_WITH:`CONTAINS_WORDS_STARTING_WITH`,CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:`CONTAINS_WORDS_STARTING_SPLIT_DELIMITER`,GREATER_THAN:d7.operations.GREATER_THAN,GREATER_THAN_OR_EQUAL:d7.operations.GREATER_THAN_OR_EQUAL,LESS_THAN:d7.operations.LESS_THAN,LESS_THAN_OR_EQUAL:d7.operations.LESS_THAN_OR_EQUAL,IS_BEFORE:`IS_BEFORE`,IS_AFTER:`IS_AFTER`,ON_OR_BEFORE:`ON_OR_BEFORE`,ON_OR_AFTER:`ON_OR_AFTER`,IS_CURRENT:d7.operations.IS_CURRENT,IS_PREVIOUS:d7.operations.IS_PREVIOUS},p7=e=>({type:`enum`,input:`select`,values:e}),RFe=p7({HOUR:{label:`Hour`,tooltip:`Beginning of the hour immediately preceding the current one to the current hour.`},DAY:{label:`Day`,tooltip:`Midnight on the day before today to midnight of the current day.`},WEEK_DAY:{label:`Week day`,tooltip:`Midnight on the day before today to midnight of the current day. If the current day is Monday then the previous day is Friday.`},WEEK:{label:`Week`,tooltip:`Midnight on the Monday of the previous week to midnight on the Monday of the current week.`},MONTH:{label:`Month`,tooltip:`Midnight on the 1st of the previous month to midnight on the 1st of the current month.`},YEAR:{label:`Year`,tooltip:`Midnight on Jan 1st of the previous year to midnight on the 1st Jan of the current year.`}}),zFe=p7({HOUR:{label:`Hour`,tooltip:`Beginning of the current hour to beginning of the next hour.`},DAY:{label:`Day`,tooltip:`Midnight on the current day day to midnight of the next day.`},WEEK_DAY:{label:`Week day`,tooltip:`Midnight on the current day day to midnight of the next day. This filter will never match Sat or Sun, always returning false on the weekends.`},WEEK:{label:`Week`,tooltip:`Midnight on the Monday of the current week to midnight on the Monday of the next week.`},MONTH:{label:`Month`,tooltip:`Midnight on the 1st of the current month to midnight on the 1st of the next month.`},YEAR:{label:`Year`,tooltip:`Midnight on Jan 1st of the current year to midnight on the 1st Jan of the next year.`}}),m7=[{type:$.EQUALS,label:`Equals`,nbInputs:1,applyTo:[...e7,...t7,...Q5,...$5],tooltip:`Check the equality of the field compared to a set value`},{type:$.NOT_EQUALS,label:`Not equals`,nbInputs:1,applyTo:[...e7,...t7,...Q5,...$5],tooltip:`Check that the field is different from a set value`},{type:$.IS_NULL,label:`Is null`,nbInputs:0,applyTo:[`enum`,...t7,...Q5,...$5],tooltip:`Check if the field value is null`},{type:$.NOT_NULL,label:`Not null`,nbInputs:0,applyTo:[`enum`,...t7,...Q5,...$5],tooltip:`Check if the field value is not null`},{type:$.IS_NULL_OR_BLANK,label:`Is null or blank`,nbInputs:0,applyTo:[`string`],tooltip:`Check if the field value is null or an empty string`},{type:$.NOT_NULL_OR_BLANK,label:`Not null or blank`,nbInputs:0,applyTo:[`string`],tooltip:`Check if the field value is not null and not an empty string`},{type:$.CONTAINS,label:`Contains`,nbInputs:1,applyTo:[`string`],tooltip:`Check if the field contains the specified text (case insensitive)`},{type:$.CONTAINS_WORDS_STARTING_WITH,label:`Contains words starting with`,nbInputs:1,applyTo:[`string`],tooltip:`Check if the field contains words that start with the specified text, split by whitespace (case insensitive)`},{type:$.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER,label:`Contains words starting with (split)`,nbInputs:2,applyTo:[`string`],tooltip:`Check if field contains words starting with text, split by a delimiter (case insensitive)`},{type:$.GREATER_THAN,label:`Greater than`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is greater than a specified number`},{type:$.GREATER_THAN_OR_EQUAL,label:`Greater than or equal to`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is greater than or equal to a specified number`},{type:$.LESS_THAN,label:`Less than`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is less than a specified number`},{type:$.LESS_THAN_OR_EQUAL,label:`Less than or equal to`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is less than or equal to a specified number`},{type:$.IS_BEFORE,label:`Is before`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is before a specified date/time`},{type:$.IS_AFTER,label:`Is after`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is after a specified date/time`},{type:$.ON_OR_BEFORE,label:`On or before`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is on or before a specified date/time`},{type:$.ON_OR_AFTER,label:`On or after`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is on or after a specified date/time`},{type:$.IS_CURRENT,label:`Is current`,nbInputs:1,applyTo:[...$5],tooltip:`Check whether the current date/time matches the current hour/day/work day/week/month/year.`,valueType:zFe,optgroup:`Relative Period`},{type:$.IS_PREVIOUS,label:`Is previous`,nbInputs:1,applyTo:[...$5],tooltip:`Check whether the current date/time matches the previous hour/day/work day/week/month/year`,valueType:RFe,optgroup:`Relative Period`}];function BFe(e){switch(e){case`IS_BEFORE`:return`LESS_THAN`;case`IS_AFTER`:return`GREATER_THAN`;case`ON_OR_BEFORE`:return`LESS_THAN_OR_EQUAL`;case`ON_OR_AFTER`:return`GREATER_THAN_OR_EQUAL`;default:return e}}function VFe(e,t){switch(t){case $.IS_NULL_OR_BLANK:return o7(e,d7.methodCall.IS_NULL_OR_BLANK,[]);case $.NOT_NULL_OR_BLANK:return o7(e,d7.methodCall.NOT_NULL_OR_BLANK,[]);case $.CONTAINS:if(!(`value`in e))throw Error(`Invalid shape for operator CONTAINS`);return o7(e,d7.methodCall.CONTAINS_IGNORE_CASE,[{TYPE:`STRING`,VALUE:e.value}]);case $.CONTAINS_WORDS_STARTING_WITH:if(!(`value`in e))throw Error(`Invalid shape for operator CONTAINS_WORDS_STARTING_WITH`);return o7(e,d7.methodCall.CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE,[{TYPE:`STRING`,VALUE:e.value}]);case $.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:if(!(`value`in e)||!Array.isArray(e.value)||e.value.length!==2)throw Error(`Invalid shape for CONTAINS_WORDS_STARTING_SPLIT_DELIMITER`);return o7(e,d7.methodCall.CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE,e.value.map(e=>({TYPE:`STRING`,VALUE:e})));case $.IS_CURRENT:case $.IS_PREVIOUS:if(!(`value`in e))throw Error(`Invalid shape for operator IS_CURRENT | IS_PREVIOUS`);return o7(e,d7.methodCall.DATE_TIME_IS_IN_RANGE,[{TYPE:`STRING`,VALUE:e.value},{TYPE:`STRING`,VALUE:t===$.IS_CURRENT?`CURRENT`:`PREVIOUS`}]);default:throw Error(`Unreachable default case`)}}function HFe(e){if(!(e.operator?.type&&e.field?.fieldId))return null;let t=s7(e),n=r7(t),r=BFe(t.operator.type);switch(r){case $.EQUALS:case $.NOT_EQUALS:case $.GREATER_THAN:case $.GREATER_THAN_OR_EQUAL:case $.LESS_THAN:case $.LESS_THAN_OR_EQUAL:return i7(t,r,n);case $.IS_NULL:return a7(t,d7.operations.EQUALS,{TYPE:`NULL`});case $.NOT_NULL:return a7(t,d7.operations.NOT_EQUALS,{TYPE:`NULL`});case $.IS_NULL_OR_BLANK:case $.NOT_NULL_OR_BLANK:case $.CONTAINS:case $.CONTAINS_WORDS_STARTING_WITH:case $.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:case $.IS_CURRENT:case $.IS_PREVIOUS:return VFe(t,r);default:throw Error(`Unmatched case for operator name: ${r}`)}}function UFe(e,t){if(t.field.type!==`date`&&t.field.type!==`date-time`)return e;switch(e){case`LESS_THAN`:return`IS_BEFORE`;case`GREATER_THAN`:return`IS_AFTER`;case`LESS_THAN_OR_EQUAL`:return`ON_OR_BEFORE`;case`GREATER_THAN_OR_EQUAL`:return`ON_OR_AFTER`;default:return e}}function WFe(e,t){let n=(()=>{if(t.RIGHT.TYPE===`NULL`){let e=t.OPERATION===`EQUALS`?$[$.IS_NULL]:$[$.NOT_NULL];return m7.find(t=>t.type===e)}let n=UFe(t.OPERATION,e);return m7.find(e=>e.type===n)})();return Object.assign(Object.assign({},e),{operator:n})}function GFe(e,t){if(t.LEFT.TYPE!==`FIELD`)throw Error(`BinaryExpression LHS must be TYPE === FIELD`);if(![`STRING`,`NUMBER`,`BOOLEAN`,`NULL`].includes(t.RIGHT.TYPE))throw Error(`BinaryExpression RHS must be TYPE === NUMBER | STRING | BOOLEAN | NULL`);return l7(WFe({field:e.find(e=>e.fieldId===t.LEFT.NAME)},t),t.RIGHT)}function KFe(e,t){let[n,r]=(()=>{switch(!0){case t.METHOD===`IS_NULL_OR_BLANK`:return[$[$.IS_NULL_OR_BLANK],void 0];case t.METHOD===`NOT_NULL_OR_BLANK`:return[$[$.NOT_NULL_OR_BLANK],void 0];case t.METHOD===`CONTAINS_IGNORE_CASE`:return[$[$.CONTAINS],t.PARAMETERS[1].VALUE];case t.METHOD===`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`&&t.PARAMETERS.length===2:return[$[$.CONTAINS_WORDS_STARTING_WITH],t.PARAMETERS[1].VALUE];case t.METHOD===`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`&&t.PARAMETERS.length===3:return[$[$.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER],t.PARAMETERS.slice(1).map(e=>e.VALUE)];case t.METHOD===d7.methodCall.DATE_TIME_IS_IN_RANGE&&t.PARAMETERS.length===3&&t.PARAMETERS[2].TYPE===`STRING`&&(t.PARAMETERS[2].VALUE===`CURRENT`||t.PARAMETERS[2].VALUE===`PREVIOUS`):return[$[t.PARAMETERS[2].VALUE===`CURRENT`?$.IS_CURRENT:$.IS_PREVIOUS],t.PARAMETERS[1].VALUE];default:throw Error(`Unhandled fromMethodExpression case`)}})();return{field:e.find(e=>e.fieldId===t.PARAMETERS[0].NAME),operator:m7.find(e=>e.type===n),value:r}}function h7(e,t){return{combinator:f7.find(e=>e.type===t.OPERATION),children:t.EXPRESSIONS.map(t=>{if(!(`TYPE`in t))throw Error(`RuleExpression format not yet supported - no TYPE`);if(t.TYPE===`PREDICATE_EXPRESSION`)return h7(e,t);if(t.TYPE===`BINARY_EXPRESSION`)return GFe(e,t);if(t.TYPE===`METHOD_EXPRESSION`)return KFe(e,t);throw Error(`RuleExpression format not yet supported - unsupported TYPE`)})}}let g7=class extends J5{ruleConfigChanged(e,t){this.config=Object.assign({combinators:f7,operators:m7,fields:t.fields,maxNesting:t.maxNesting,partialRuleValidationWarning:t.partialRuleValidationWarning},t?.model?{model:h7(t.fields,t.model)}:{})}configChanged(e,t){if(t!==null){if(!t.operators||!t.combinators)throw Error(`Unable to detect operators or combinators. Did you set the config on the rule builder via the config property? Use the ruleConfig property instead`);super.configChanged(e,t)}}dispatchChangeEvent(e){let t=c7(e,HFe);this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,cancelable:!0,composed:!0}))}};q([C],g7.prototype,`ruleConfig`,void 0),g7=q([$e({name:`foundation-rule-expression-builder`,styles:R5,template:B5})],g7);let _7={TRIM:`TRIM`,PLUS:`PLUS`,MINUS:`MINUS`,MULTIPLY:`MULTIPLY`,DIVIDE:`DIVIDE`,CONVERT_TO_DATE:`CONVERT_TO_DATE`,CONVERT_TO_DATE_TIME:`CONVERT_TO_DATE_TIME`},v7=[{type:_7.PLUS,label:`Add (+)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically added to the specified rule value. FIELD + VALUE`},{type:_7.MINUS,label:`Subtract (-)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically subtracted by the specified rule value. FIELD - VALUE`},{type:_7.MULTIPLY,label:`Multiply (*)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically multiplied by the specified rule value. FIELD * VALUE`},{type:_7.DIVIDE,label:`Divide (/)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically divided by the specified rule value. FIELD / VALUE`},{type:_7.CONVERT_TO_DATE,label:`Convert to date`,applyTo:[`date`],nbInputs:0,tooltip:`Returns the date, which is stored as the epoch time, as a formatted date YYYY/dd/mm`},{type:_7.CONVERT_TO_DATE_TIME,label:`Convert to date time`,applyTo:[`date-time`],nbInputs:0,tooltip:`Returns the date-time, which is stored as the epoch time, as a formatted date YYYY/dd/mm HH:mm:ss`}];function qFe(e){return e}function JFe(e,t){switch(t){case _7.TRIM:return o7(e,d7.methodCall.TRIM,[]);case _7.CONVERT_TO_DATE:return o7(e,d7.methodCall.LONG_TO_DATE,[]);case _7.CONVERT_TO_DATE_TIME:return o7(e,d7.methodCall.LONG_TO_DATE_TIME,[])}}function YFe(e){if(!(e.operator?.type&&e.field?.fieldId))return null;let t=s7(e),n=r7(t),r=qFe(t.operator.type);switch(r){case _7.TRIM:case _7.CONVERT_TO_DATE:case _7.CONVERT_TO_DATE_TIME:return JFe(t,r);case _7.PLUS:case _7.MINUS:case _7.DIVIDE:case _7.MULTIPLY:return i7(t,r,n);default:throw Error(`Unmatched case for operator name: ${r}`)}}function XFe(e,t){return t.field.type!==`date`&&t.field.type,e}function ZFe(e,t){let n=(()=>{let n=XFe(t.OPERATION,e);return v7.find(e=>e.type===n)})();return Object.assign(Object.assign({},e),{operator:n})}function QFe(e,t){if(t.LEFT.TYPE!==`FIELD`)throw Error(`BinaryExpression LHS must be TYPE === FIELD`);if(![`STRING`,`NUMBER`,`BOOLEAN`,`NULL`].includes(t.RIGHT.TYPE))throw Error(`BinaryExpression RHS must be TYPE === NUMBER | STRING | BOOLEAN | NULL`);return l7(ZFe({field:e.find(e=>e.fieldId===t.LEFT.NAME)},t),t.RIGHT)}function $Fe(e,t){let[n,r]=(()=>{switch(!0){case t.METHOD===`TRIM`:return[_7[_7.TRIM],void 0];case t.METHOD===`LONG_TO_DATE`:return[_7[_7.CONVERT_TO_DATE],void 0];case t.METHOD===`LONG_TO_DATE_TIME`:return[_7[_7.CONVERT_TO_DATE_TIME],void 0];default:throw Error(`Unhandled fromMethodExpression case`)}})();return{field:e.find(e=>e.fieldId===t.PARAMETERS[0].NAME),operator:v7.find(e=>e.type===n),value:r}}function y7(e,t){return{combinator:b5,children:t.EXPRESSIONS.map(t=>{if(!(`TYPE`in t))throw Error(`RuleExpression format not yet supported - no TYPE`);if(t.TYPE===`PREDICATE_EXPRESSION`)return y7(e,t);if(t.TYPE===`BINARY_EXPRESSION`)return QFe(e,t);if(t.TYPE===`METHOD_EXPRESSION`)return $Fe(e,t);throw Error(`RuleExpression format not yet supported - unsupported TYPE`)})}}let b7=class extends J5{valueConfigChanged(e,t){let n={TYPE:`PREDICATE_EXPRESSION`,OPERATION:`NULL`,EXPRESSIONS:t.model?[t.model]:[]},r=y7(t.fields,n);this.config={combinators:[b5],operators:v7,fields:t.fields,model:r,maxNesting:t.maxNesting,partialRuleValidationWarning:t.partialRuleValidationWarning}}configChanged(e,t){if(t!==null){if(!t.operators||!t.combinators)throw Error(`Unable to detect operators or combinators. Did you set the config on the rule builder via the config property? Use the valueConfig property instead`);super.configChanged(e,t)}}dispatchChangeEvent(e){if(!(`children`in e))throw Error(`Invalid top level group hierarchy`);if(e.children.length>1)throw Error(`Value expressions should not have multiple rules`);if(e.children[0]&&`children`in e.children[0])throw Error(`Trying to convert group to rule`);let t=e.children.length===0?void 0:YFe(e.children[0]);this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,cancelable:!0,composed:!0}))}};q([C],b7.prototype,`valueConfig`,void 0),b7=q([$e({name:`foundation-value-expression-builder`,styles:R5,template:B5})],b7);let x7=T`<template ${k(`notificationListener`)}><slot></slot></template>`,eIe={mode:`open`,delegatesFocus:!0};var S7=class extends P{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[]}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.addEventListener(US.NOTIFICATION_EVENT,e=>{e.stopImmediatePropagation(),ZS(e.detail,this.tagName,this.notificationListener)}),this.connectionSub=this.connect.isConnected$.subscribe(e=>J(this,void 0,void 0,function*(){e&&(yield this.handleReconnection())}))})}handleReconnection(){return J(this,void 0,void 0,function*(){var e;this.resourceName&&((e=this.dataSub)==null||e.unsubscribe(),this.dataSub=void 0,yield this.initializeDatasource(),this.setupDataSubscription())})}initializeDatasource(){return J(this,void 0,void 0,function*(){if(this.datasource?.initialized&&this.datasource.destroy(),!(yield this.datasource.init({resourceName:this.resourceName},!0)))throw Error(`Failed to initialize datasource for ${this.resourceName}`)})}setupDataSubscription(){if(!this.datasource.stream){Ly.warn(`No stream available for ${this.resourceName}`);return}this.dataSub=this.datasource.stream.subscribe(e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate(Qv(e))})}disconnectedCallback(){var e,t,n;super.disconnectedCallback(),(e=this.dataSub)==null||e.unsubscribe(),delete this.dataSub,(t=this.connectionSub)==null||t.unsubscribe(),delete this.connectionSub,(n=this.datasource)==null||n.destroy(),delete this.datasource}handleStreamUpdate(e){let t=e.inserts;t.length>0&&t.forEach(e=>{this.showNotificationToast(e)})}showNotificationToast(e){let{HEADER:t,MESSAGE:n,NOTIFY_SEVERITY:r}=e,i=e.CREATED_AT?new Date(e.CREATED_AT):void 0,a=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0,o=[];this.toastButtons&&this.toastButtons.length>0&&(o=this.toastButtons.filter(({condition:t})=>!t||t({details:e})));let s={title:t,body:n,createdAt:i,toast:{details:e,type:r?.toLowerCase(),buttons:o,autoClose:a===void 0?!!this.closeTimeout:!!a,closeTimeout:a??this.closeTimeout,position:this.toastPosition}};JS(s,this.tagName)}};q([C],S7.prototype,`notificationListener`,void 0),q([xv],S7.prototype,`connect`,void 0),q([D({attribute:`resource-name`})],S7.prototype,`resourceName`,void 0),q([D({attribute:`close-timeout`,converter:E})],S7.prototype,`closeTimeout`,void 0),q([C],S7.prototype,`toastButtons`,void 0),q([D({attribute:`toast-position`})],S7.prototype,`toastPosition`,void 0),q([my],S7.prototype,`datasource`,void 0),S7.compose({baseName:`notification-listener`,template:x7,shadowOptions:eIe});let C7=Kd(`foundation-router`),w7=`$router`,T7=Object.freeze({getOrCreateFor:e=>{let t=e[w7];return t===void 0?e[w7]=new tIe(e):t},find:e=>p_.find(e),from:e=>p_.from(e)});var tIe=class extends m_{};let nIe=/^([a-z][a-z0-9+\-.]*:)?\/\//i;function E7(e){return nIe.test(e)}function D7(e){return e.config instanceof F_?e:T7.find(e)}function rIe(e,t=`/`,n=!1){let r=e.join(t).replace(RegExp(t+`{1,}`,`g`),t);return!n&&r.endsWith(t)?r.slice(0,-1):r}function iIe(e){return e.replace(`/*${s_}`,``)}function O7(){document.querySelector(`foundation-router, fast-router`)===null&&window.dispatchEvent(new PopStateEvent(`popstate`))}let k7=Object.freeze({path:Object.freeze({get current(){return Qg.path.current},generateRoute:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=D7(e);for(;r!==null;){let e=yield r.config.generateRouteFromPath(t,n);if(e!==null)return e;r=r.parent}return null}),push:(e,t=!0)=>{if(e&&E7(e)){location.href=e;return}history.pushState({},document.title,e),O7(),t&&k7.path.trigger(e)},replace:(e,t=!0)=>{if(e&&E7(e)){location.href=e;return}history.replaceState({},document.title,e),O7(),t&&k7.path.trigger(e)},trigger:e=>{Qg.path.trigger(e)}}),name:Object.freeze({generateRoute:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=D7(e);for(;r!==null;){let e=yield r.config.generateRouteFromName(t,n);if(e!==null)return e;r=r.parent}return null}),push:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={},r=!0){let i=yield k7.name.generateRoute(e,t,n);i!==null&&k7.path.push(i,r)}),replace:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={},r=!0){let i=yield k7.name.generateRoute(e,t,n);i!==null&&k7.path.replace(i,r)}),trigger:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=yield k7.name.generateRoute(e,t,n);r!==null&&k7.path.trigger(r)})})}),A7=e=>!e.navId||e.navId===`header`||e.navId===`side-nav`;function aIe(e,t=A7,n=10){let r=[];return e.filter(e=>e.navItems&&e.navItems.some(t)).forEach((e,i)=>{e.navItems.filter(t).map((t,r)=>{let a=t.placementIndex??i*n+r;return Object.assign(Object.assign({},t),{navId:t.navId??`header`,placementIndex:a,routePath:t.routePath??e.path,routeName:t.routeName??e.name})}).forEach(e=>r.push(e))}),r.sort((e,t)=>e.placementIndex-t.placementIndex)}var j7=class extends u_{constructor(){super(...arguments),this.definitions=[]}map(...e){let t=this.owner,n=!t.parent,r=t.basename;n&&r!==``&&r!==`/`&&(C7.debug(`Route paths remap required due to detected sub-path deployment`),e=e.map(e=>{if(!e.path)return e;if(e.path.startsWith(r))return C7.debug(`'${e.path}' path okay as is`),e;let t=e.path.charAt(0)===`/`?``:`/`,n=`${r}${t}${e.path}`;return C7.debug(`'${e.path}' path modified to '${n}'`),Object.assign(Object.assign({},e),{path:n})})),this.definitions=[...e,...this.definitions],super.map(...e)}};q([C],j7.prototype,`definitions`,void 0);var M7=class extends F_{constructor(){super(),this.logger=C7,this.loginPath=`login`,this.notFoundPath=`not-found`,this.notPermittedPath=`not-permitted`,this.routes=new j7(this),this.basename=Hf,this.routes=new j7(this)}getNavItems(e=A7){return aIe(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>J(this,void 0,void 0,function*(){this.analytics.trackEvent(Jd.routeChanged,{path:e.route.endpoint.path})})})}configureRoutePermittedChecks(){this.contributors.push({navigate:e=>J(this,void 0,void 0,function*(){let{settings:t}=e.route;(t?.isPermitted)?.call(t)===!1&&e.cancel(()=>{if(!this.user.isAuthenticated)this.user.trackPath(),k7.name.replace(e.router,this.loginPath);else{let n=t.notPermittedPath?.call(t)??this.notPermittedPath;this.logger.debug(`User not permitted to access route. Re-routing to ${n}.`),k7.name.replace(e.router,n)}})})})}configureFallbackRouteDefinition(){this.routes.fallback(()=>{let e={redirect:this.notFoundPath};return this.user.isAuthenticated||(this.user.trackPath(),this._session.captureReturnUrl(),e={redirect:this.loginPath}),this.logger.debug(`Route unresolved. Re-routing to ${e.redirect}.`),e})}navigationPhaseLoginRedirect(e){e.cancel(()=>{this.user.trackPath(),this._session.captureReturnUrl(),k7.name.replace(e.router,this.loginPath)})}generateRouteFromName(e,t){let n=Object.create(null,{generateRouteFromName:{get:()=>super.generateRouteFromName}});return J(this,void 0,void 0,function*(){let r=yield n.generateRouteFromName.call(this,e,t);return r?this.generateNavigationPath(r):null})}navigateTo(e){return J(this,void 0,void 0,function*(){if(e.name){this.relativeTo||this.logger.error(`unable to navigate by name as the relativeTo router is not set`),yield k7.name.push(this.relativeTo,e.name,e.params,e.trigger);return}if(e.path){k7.path.push(this.generateNavigationPath(e.path,e.params),e.trigger);return}})}generateNavigationPath(e,t){let n=this.getNavigationPathBasename(),r=n_.build(t),i=n&&!e.startsWith(n)?rIe([n,e]):e;return i=r?`${i}?${r}`:i,i}getNavigationPathBasename(){let e=(this.parent?.relativeTo?.route)?.endpoint.route.path;return e?iIe(e):this.basename?this.basename:``}construct(e){return this.container.get(e)}};q([Nt],M7.prototype,`container`,void 0),q([Xd],M7.prototype,`analytics`,void 0),q([vg],M7.prototype,`user`,void 0),q([jg],M7.prototype,`_session`,void 0);let N7=`navigate-to`,P7=`generate-navigation-path`,F7=class extends T7.from(Qe){constructor(){super(...arguments),this.logger=C7,this.onNavigateTo=e=>{e.stopImmediatePropagation(),this.config.navigateTo(e.detail)},this.onGenerateNavigationPath=e=>{e.stopImmediatePropagation();let{path:t,params:n,callback:r}=e.detail;r&&r(this.config.generateNavigationPath(t,n))}}get router(){return this[w7]}connectedCallback(){var e;super.connectedCallback(),!this.config.isConfigured&&((e=this.config).relativeTo??(e.relativeTo=this.router),x.queueUpdate(()=>J(this,void 0,void 0,function*(){this.router.config?this.router.connect():this.router.config=this.config})),this.addEventListeners())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}addEventListeners(){this.addEventListener(N7,this.onNavigateTo),this.addEventListener(P7,this.onGenerateNavigationPath)}removeEventListeners(){this.removeEventListener(N7,this.onNavigateTo),this.removeEventListener(P7,this.onGenerateNavigationPath)}};F7=q([$e({name:`foundation-router`})],F7);let I7=e=>`control: ${e}-control, content: ${e}-content`,oIe=[`background: progress-ring-background`,`progress: progress-ring-progress`,`indeterminate-indicator-1: progress-ring-indeterminate`].join(`, `),L7=e=>T`<${e}-card class=${e=>dn(`stepper-tab`,[`stepper-tab-hidden`,e.hideTabs])}part="stepper-tab" @tab-clicked="${(e,t)=>e.handleStepClick(t.event.detail)}" role="stepper-tab" data-test-id="stepper-tab"><div class=${e=>dn(`stepper-tab-menu`,[`stepper-tab-menu-hidden`,e.hideTabs])}part="stepper-tab-menu"><slot name="tab" ${xt(`tabs`)}></slot></div>${A(e=>e.orientation===za.vertical&&!e.hideProgress,T`<div class="stepper-tab-progress" part="stepper-tab-progress"><${e}-progress-ring class="progress-ring" part="progress-ring" exportparts="${oIe}" value=${e=>e.progressValue}></${e}-progress-ring><label part="progress-label">You have completed ${e=>e.progressValue}% of the fields required to create a project</label></div>`)}</${e}-card>${A(e=>!e.indicatorOnly,T`<${e}-card class="stepper-tab-panel" part="stepper-tab-panel" data-test-id="stepper-tab-panel"><div class="stepper-panel-container" part="stepper-panel-container"><slot name="tab-panel" ${xt(`tabpanels`)}></slot></div>${A(e=>!e.hideAllButtons,T`<div class="action-buttons-container" part="action-buttons-container"><slot name="action-buttons"><${e}-button part="back-button" exportparts="${I7(`back-button`)}" @click=${e=>e.previousStep()}?disabled=${e=>e.disabledPreviousStep}>Back</${e}-button>${A(e=>e.isLastStep&&!e.hideSubmitButton,T`<${e}-button part="submit-button" exportparts="${I7(`submit-button`)}" @click=${e=>e._submit()}?disabled=${e=>e.islastStepValid}data-test-id="submit-button">
|
|
1002
|
-
Submit </${e}-button>`)} ${A(e=>!e.isLastStep,T`<${e}-button part="next-button" exportparts="${I7(`next-button`)}" @click=${e=>e.nextStep()}data-test-id="next-button">Next</${e}-button>`)}</slot></div>`)}</${e}-card>`)} `,sIe=T` ${e=>L7(Vy(e))} `,R7=O` :host{display: flex;height: 100%;width: 100%}:host([orientation='horizontal']){flex-direction: column}.stepper-tab{display: flex;flex-direction: column;width: 100%;height: 100%;max-width: 280px;border-radius: 0}.action-buttons-container{width: 100%;display: flex;justify-content: flex-end}.stepper-panel-container{height: 100%;overflow: hidden;padding: 15px}.stepper-tab-menu{display: flex;flex-direction: column;width: 100%;margin-bottom: 30px}.stepper-tab-menu-hidden{display: none}.stepper-tab-progress{display: flex;flex-direction: column;align-items: center;justify-content: start;flex: 1}.stepper-tab-progress .progress-ring{--design-unit: 10;margin: 0}.stepper-tab-panel{display: flex;flex-direction: column;justify-content: space-between;width: 100%;min-width: 370px;border-radius: 0}label{padding: 0 10px;color: rgb(135 155 166);display: block;cursor: pointer;text-align: center;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}:host([orientation='horizontal']) .stepper-tab-menu{height: 100%;width: 100%;display: flex;flex-direction: row;margin-bottom: 0;align-items: center;justify-content: center;gap: calc(var(--design-unit) * 4px);padding: 0 calc(var(--design-unit) * 4px)}:host([orientation='horizontal']) .stepper-tab-hidden{display: none}:host([orientation='horizontal']) .stepper-tab{max-width: 100%;max-height: 70px;height: 70px}`;var z7=class extends P{constructor(){super(...arguments),this.hideProgress=!1,this.allowBackwardJumps=!1,this.allowForwardJumps=!1,this.hideAllButtons=!1,this.hideTabs=!1,this.indicatorOnly=!1,this.orientation=za.vertical,this.tabs=[],this.tabpanels=[],this.progressValue=0,this.activeTabIndex=0,this.pendingNextStep=!1,this.slotsInitialized=!1,this.setTabs=()=>{this.activeTabIndex=this.getActiveIndex(),this.tabs.forEach((e,t)=>{if(e.slot===`tab`){let n=this.activeTabIndex===t,r=t+1===this.tabIds.length,i=this.tabIds[t],a=this.tabpanelIds[t];e.setAttribute(`id`,i),e.setAttribute(`aria-selected`,n?`true`:`false`),e.setAttribute(`aria-disabled`,n?`false`:`true`),x.setBooleanAttribute(e,`selected`,n),e.setAttribute(`orientation`,this.orientation),a&&e.setAttribute(`aria-controls`,a),e.setAttribute(`tab-position`,String(t+1)),x.setBooleanAttribute(e,`isLast`,r),x.setBooleanAttribute(e,`hideStepNumber`,this.hideStepNumber===!0),e.setAttribute(`tabindex`,n?`0`:`-1`),x.setBooleanAttribute(e,`showCursorPointer`,t<=this.activeTabIndex&&this.allowBackwardJumps||t>this.activeTabIndex&&this.allowForwardJumps),n&&(this.activetab=e,this.activeid=i)}}),this.activeTabIndex===0&&this.resetCompletedState()},this.getCompletedTabs=()=>{let e=0;this.tabs.forEach(t=>{t.isCompleted()&&(e+=1)});let t=this.indicatorOnly?this.tabs.length:this.tabpanels.length;this.progressValue=t?Math.round(e/t*100):0},this.setTabPanels=()=>{this.tabpanels.forEach((e,t)=>{let n=this.tabIds[t],r=this.tabpanelIds[t];e.setAttribute(`id`,r),e.setAttribute(`aria-labelledby`,n),this.activeTabIndex===t?e.removeAttribute(`hidden`):e.setAttribute(`hidden`,``)})}}orientationChanged(){this.$fastController.isConnected&&(this.setTabs(),this.setTabPanels())}activeidChanged(e,t){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabs(),this.setTabPanels(),this.getCompletedTabs())}tabsChanged(){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}tabpanelsChanged(){this.$fastController.isConnected&&this.tabpanels.length<=this.tabs.length&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}connectedCallback(){super.connectedCallback(),this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.activeTabIndex=this.getActiveIndex()}setTabsAndTabPanels(){this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.setTabs(),this.setTabPanels(),this.getCompletedTabs(),this.slotsInitialized=this.tabs.length>0&&(this.indicatorOnly||this.tabpanels.length>0)}checkAndExecutePendingNextStep(){this.pendingNextStep&&this.slotsInitialized&&(this.pendingNextStep=!1,this.nextStep())}getActiveIndex(){return this.activeid===void 0||this.tabIds.indexOf(this.activeid)===-1?0:this.tabIds.indexOf(this.activeid)}goToStep(e,t=!1){let n=e-1;if(e<1||e>this.tabs.length)return Ly.warn(`[Stepper] Invalid step number: ${e}. Must be between 1 and ${this.tabs.length}`),!1;if(n===this.activeTabIndex)return!1;if(t){if(n<this.activeTabIndex)return this.handleBackwardJump(n);if(n>this.activeTabIndex)return this.handleForwardJump(n)}return n<this.activeTabIndex&&this.allowBackwardJumps?this.handleBackwardJump(n):n>this.activeTabIndex&&this.allowForwardJumps?this.handleForwardJump(n):n===this.activeTabIndex+1?(this.nextStep(),!0):(Ly.warn(`[Stepper] Cannot jump to step ${e}. Jumps are not allowed or step is not adjacent.`),!1)}goToFirstStep(){return this.goToStep(1,!0)}goToLastStep(){return this.goToStep(this.tabs.length,!0)}handleStepClick(e){e<this.activeTabIndex&&this.allowBackwardJumps?this.handleBackwardJump(e):e>this.activeTabIndex&&this.allowForwardJumps&&this.handleForwardJump(e)}handleBackwardJump(e){for(let t=e+1;t<=this.activeTabIndex;t+=1)this.tabs[t].completed=!1;return this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.$emit(`step-click`,{activetab:this.activetab,activeid:this.activeid}),!0}handleForwardJump(e){for(let t=this.activeTabIndex;t<e;t+=1)if(this.validation&&this.validation[t]){if(!this.validation[t].isValid())return this.tabs[t].completed=!1,this.tabs[t].error=!0,this.getCompletedTabs(),this.$emit(`validation-failure`,{stepIndex:t,stepId:this.tabIds[t],message:`Validation failed for step ${t+1}`}),!1;this.tabs[t].error=!1}for(let t=this.activeTabIndex;t<e;t+=1)this.tabs[t].completed=!0,this.tabs[t].error=!1;return this.tabs[e].completed=!1,this.tabs[e].error=!1,this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.getCompletedTabs(),this.$emit(`step-click`,{activetab:this.activetab,activeid:this.activeid}),!0}get disabledPreviousStep(){return this.activeTabIndex===0}get isLastStep(){return this.activeTabIndex+1===this.tabs.length}get islastStepValid(){let e=this.tabs.length-1;return this.activeTabIndex===e&&(this.validation&&this.validation[e]?.isValid()||!this.validation||!this.validation[e])?(this.tabs[e].completed=!0,this.getCompletedTabs(),!1):(this.tabs[e].completed=!1,this.getCompletedTabs(),!0)}_submit(){this.$emit(`submit`)}nextStep(){if(!this.slotsInitialized){this.pendingNextStep=!0;return}if(this.validation&&this.validation[this.activeTabIndex]){if(!this.validation[this.activeTabIndex].isValid()){this.tabs[this.activeTabIndex].completed=!1,this.tabs[this.activeTabIndex].error=!0,this.getCompletedTabs();return}this.tabs[this.activeTabIndex].error=!1}this.activeTabIndex+2<=this.tabIds.length&&(this.tabs[this.activeTabIndex].completed=!0,this.activeTabIndex+=1,this.activeid=this.tabIds[this.activeTabIndex],this.$emit(`next-step`),this.$emit(`validation-success`));let e=this.tabs.length-1,t=this.activeTabIndex===e;this.hideSubmitButton&&t&&(this.validation&&this.validation[e]?.isValid()||!this.validation||!this.validation[e])?(this.tabs[e].completed=!0,this.getCompletedTabs()):(this.tabs[e].completed=!1,this.getCompletedTabs())}previousStep(){this.activeTabIndex!==0&&(this.tabs[this.activeTabIndex].completed=!1,--this.activeTabIndex,this.activeid=this.tabIds[this.activeTabIndex])}getTabIds(){return this.tabs.map(e=>e.getAttribute(`id`)??`tab-${In()}`)}getTabPanelIds(){return this.tabpanels.map(e=>e.getAttribute(`id`)??`panel-${In()}`)}resetCompletedState(){this.tabs.forEach(e=>e.completed=!1)}};q([D({attribute:`hide-submit-button`,mode:`boolean`})],z7.prototype,`hideSubmitButton`,void 0),q([D({attribute:`hide-progress`,mode:`boolean`})],z7.prototype,`hideProgress`,void 0),q([D({attribute:`hide-step-number`,mode:`boolean`})],z7.prototype,`hideStepNumber`,void 0),q([D({attribute:`allow-backward-jumps`,mode:`boolean`})],z7.prototype,`allowBackwardJumps`,void 0),q([D({attribute:`allow-forward-jumps`,mode:`boolean`})],z7.prototype,`allowForwardJumps`,void 0),q([D({attribute:`hide-all-buttons`,mode:`boolean`})],z7.prototype,`hideAllButtons`,void 0),q([D({attribute:`hide-tabs`,mode:`boolean`})],z7.prototype,`hideTabs`,void 0),q([D({attribute:`indicator-only`,mode:`boolean`})],z7.prototype,`indicatorOnly`,void 0),q([D],z7.prototype,`orientation`,void 0),q([D],z7.prototype,`activeid`,void 0),q([C],z7.prototype,`tabs`,void 0),q([C],z7.prototype,`tabpanels`,void 0),q([C],z7.prototype,`validation`,void 0),q([C],z7.prototype,`progressValue`,void 0),q([C],z7.prototype,`activeTabIndex`,void 0),q([w],z7.prototype,`disabledPreviousStep`,null),q([w],z7.prototype,`isLastStep`,null),q([w],z7.prototype,`islastStepValid`,null);let B7={};z7.compose(Object.assign({baseName:`stepper`,template:sIe,styles:R7,shadowOptions:void 0},B7));let cIe=class extends $u{}.compose(Object.assign({baseName:`accordion`,template:(e,t)=>uo(e,t),styles:(e,t)=>O` ${Qu(e,t)} :host{border-top: none;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest)}.heading{height: calc(var(--base-height-multiplier) * 4px)}`,shadowOptions:ed},td)),lIe=class extends id{}.compose(Object.assign({baseName:`accordion-item`,template:(e,t)=>nd(e,t),styles:(e,t)=>O` ${rd(e,t)} :host{--icon-container-calculator: calc( (6 + (var(--design-unit) * 6)) * 1px );/* height of section - (padding top +padding-bottom) */ --icon-margin-calculation: calc((6 + (var(--design-unit) * 2 * var(--density))) * 1px)}.region{padding: 0 calc((16 + (var(--design-unit) * 2 * var(--density))) * 1px);color: var(--accent-foreground-rest)}:host([expanded]) .region{color: var(--accent-foreground-rest)}slot[name='expanded-icon']{display: none;stroke: none}slot[name='collapsed-icon'] path.plus-sign, slot[name='expanded-icon'] path.minus-sign{stroke: white}slot[name='expanded-icon'], slot[name='collapsed-icon']{background: var(--neutral-fill-rest);fill: none;stroke: none;height: calc((var(--design-unit) * 4) * 1px);width: calc((var(--design-unit) * 4) * 1px)}svg:not(:root){height: calc((var(--design-unit) * 4) * 1px);width: calc((var(--design-unit) * 4) * 1px)}.icon{height: var( --icon-container-calculator );/* UX 30px* for now it's 30 on default design unit - 4/ */ width: var(--icon-container-calculator);/* UX 30px */ margin: var(--icon-margin-calculation) var(--icon-margin-calculation) var(--icon-margin-calculation) 0}.button{padding: 0 calc((8 + (var(--design-unit) * 2 * var(--density))) * 1px) 0 calc((16 + (var(--design-unit) * 2 * var(--density))) * 1px)}.heading{grid-template-columns: auto 1fr auto;align-items: center}`,shadowOptions:ad},od)),uIe=class extends fb{}.compose({baseName:`actions-menu`,styles:(e,t)=>O` :host{--actions-opener-height-multiplier: 0.6px;--menu-item-height-multiplier: 0.5px}${sd(e,t)} rapid-menu-item{display: flex;user-select: none}rapid-menu-item::part(content){margin-inline: calc(var(--design-unit) * 3px)}rapid-menu-item[disabled]{pointer-events: none}.actions-vertical .actions-menu{padding: 0}.actions-vertical .menu-item{margin: 0;padding: calc(var(--design-unit) * 4px);border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-stealth-hover)}.actions-vertical .menu-item:last-child{border-bottom: none}.actions-vertical .menu-item:focus{border: calc(var(--stroke-width) * 1px) solid var(--accent-foreground-focus)}`,template:db}),dIe=O` ${OS}`,fIe=class extends $S{}.compose(Object.assign({baseName:`ai-criteria-search`,template:(e,t)=>AS,styles:dIe,shadowOptions:void 0},eC)),pIe=class extends rC{}.compose({baseName:`ai-indicator`,template:nC,styles:(e,t)=>O` ${tC(e,t)} :host{--green: var(--success-color);--trafic-light-green: var(--success-color);--red: var(--error-color);--trafic-light-red: var(--error-color);--amber: var(--warning-color);--trafic-light-amber: var(--warning-color)}`});function V7(e,t){return new so(`appearance`,e,t)}let mIe=[`baseClass`,`baseName`,`shadowOptions`,`styles`,`template`],hIe=(e,t=mIe)=>Object.keys(e).filter(e=>!t.includes(e)).reduce((t,n)=>(t[n]=e[n],t),{}),H7=e=>{let{definition:t}=e(),{shadowOptions:n,styles:r,template:i}=t;return{shadowOptions:n,styles:r,template:i,defaultConfig:hIe(t)}},gIe=O` :host([appearance='primary']){background: var(--accent-fill-rest);color: var(--foreground-on-accent-rest)}:host([appearance='primary']:hover){background: var(--accent-fill-hover);color: var(--foreground-on-accent-hover)}:host([appearance='primary']:active){background: var(--accent-fill-active);color: var(--foreground-on-accent-active)}:host([appearance='primary'][disabled]), :host([appearance='primary'][disabled]):hover, :host([appearance='primary'][disabled]):active{opacity: 50%}`,_Ie=O` :host([appearance='secondary']){background: var(--secondary-fill-rest);color: contrast-color(var(--secondary-fill-rest))}:host([appearance='secondary']:hover){background: var(--secondary-fill-hover);color: contrast-color(var(--secondary-fill-hover))}:host([appearance='secondary']:active){background: var(--secondary-fill-active);color: contrast-color(var(--secondary-fill-active))}:host([appearance='secondary'][disabled]), :host([appearance='secondary'][disabled]):hover, :host([appearance='secondary'][disabled]):active{opacity: 50%}`,vIe=O` :host([appearance='neutral']){background: var(--neutral-button-fill, var(--neutral-fill-rest));border: var(--neutral-button-border, 0);color: var(--neutral-button-foreground, var(--neutral-foreground-rest))}:host([appearance='neutral']:hover){background: color-mix( in srgb, var(--neutral-button-fill, var(--neutral-fill-hover)), transparent 20% )}:host([appearance='neutral']:active){background: color-mix( in srgb, var(--neutral-button-fill, var(--neutral-fill-active)), transparent 30% )}:host([appearance='neutral'][disabled]), :host([appearance='neutral'][disabled]):hover, :host([appearance='neutral'][disabled]):active{opacity: 50%;background: var(--neutral-button-fill, var(--neutral-fill-rest));color: var(--neutral-button-foreground, var(--neutral-foreground-rest));border: var(--neutral-button-border, 0)}`,yIe=O` :host([appearance='danger']){background: var(--error-fill-rest);color: contrast-color(var(--error-fill-rest));border: 0}:host([appearance='danger']:hover){background: var(--error-fill-hover);color: contrast-color(var(--error-fill-hover))}:host([appearance='danger']:active){background: var(--error-fill-active);color: contrast-color(var(--error-fill-active))}:host([appearance='danger'][disabled]), :host([appearance='danger'][disabled]):hover, :host([appearance='danger'][disabled]):active{opacity: 50%}`,bIe=O` :host([appearance='success']){background: var(--success-fill-rest);color: contrast-color(var(--success-fill-rest));border: 0}:host([appearance='success']:hover){background: var(--success-fill-hover);color: contrast-color(var(--success-fill-hover))}:host([appearance='success']:active){background: var(--success-fill-active);color: contrast-color(var(--success-fill-active))}:host([appearance='success'][disabled]), :host([appearance='success'][disabled]):hover, :host([appearance='success'][disabled]):active{opacity: 50%}`,xIe=O` :host([appearance='warning']){background: var(--warning-fill-rest);color: contrast-color(var(--warning-fill-rest));border: 0}:host([appearance='warning']:hover){background: var(--warning-fill-hover);color: contrast-color(var(--warning-fill-hover))}:host([appearance='warning']:active){background: var(--warning-fill-active);color: contrast-color(var(--warning-fill-active))}:host([appearance='warning'][disabled]), :host([appearance='warning'][disabled]):hover, :host([appearance='warning'][disabled]):active{opacity: 50%}`,SIe=O` :host([appearance='tertiary']){background: var(--tertiary-fill-rest);color: contrast-color(var(--tertiary-fill-rest));border: 0}:host([appearance='tertiary']:hover){background: var(--tertiary-fill-hover);color: contrast-color(var(--tertiary-fill-hover))}:host([appearance='tertiary']:active){background: var(--tertiary-fill-active);color: contrast-color(var(--tertiary-fill-active))}:host([appearance='tertiary'][disabled]), :host([appearance='tertiary'][disabled]):hover, :host([appearance='tertiary'][disabled]):active{opacity: 50%}`,CIe=O` :host([appearance='primary-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--accent-fill-rest)}:host([appearance='primary-outline']:hover){background: var(--accent-fill-hover);color: contrast-color(var(--accent-fill-hover))}:host([appearance='primary-outline']:active){background: var(--accent-fill-active);color: contrast-color(var(--accent-fill-active))}:host([appearance='primary-outline'][disabled]), :host([appearance='primary-outline'][disabled]):hover, :host([appearance='primary-outline'][disabled]):active{opacity: 50%}`,wIe=O` :host([appearance='secondary-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--secondary-fill-rest)}:host([appearance='secondary-outline']:hover){background: var(--secondary-fill-hover);color: contrast-color(var(--secondary-fill-hover))}:host([appearance='secondary-outline']:active){background: var(--secondary-fill-active);color: contrast-color(var(--secondary-fill-active))}:host([appearance='secondary-outline'][disabled]), :host([appearance='secondary-outline'][disabled]):hover, :host([appearance='secondary-outline'][disabled]):active{opacity: 50%}`,TIe=O` :host([appearance='neutral-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host([appearance='neutral-outline']:hover){background: var(--neutral-fill-hover);color: contrast-color(var(--neutral-fill-hover))}:host([appearance='neutral-outline']:active){background: var(--neutral-fill-active);color: contrast-color(var(--neutral-fill-active))}:host([appearance='neutral-outline'][disabled]), :host([appearance='neutral-outline'][disabled]):hover, :host([appearance='neutral-outline'][disabled]):active{opacity: 50%}`,EIe=O` :host([appearance='link']){background: none;border: none;color: var(--accent-foreground-rest)}:host([appearance='link']) .control{padding: 0}:host([appearance='link']:hover){color: var(--accent-foreground-hover)}:host([appearance='link'][disabled]), :host([appearance='link'][disabled]):hover, :host([appearance='link'][disabled]):active{opacity: 50%}`,DIe=(e,t)=>O` :host{font-weight: 500;color: var(--neutral-foreground-rest);box-sizing: border-box;font-size: var(--type-ramp-base-font-size);height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px)}.control{padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px)}.start{margin-inline-end: calc(var(--design-unit) * 2px)}.end{margin-inline-start: calc(var(--design-unit) * 2px)}.control:has(.start){padding-left: calc((12 + var(--design-unit) * 2 * var(--density)) * 1px)}.control:has(.end){padding-right: calc((12 + var(--design-unit) * 2 * var(--density)) * 1px)}:host([appearance='neutral']){background: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest)}:host([appearance='neutral']:hover){background: var(--neutral-fill-rest)}:host([appearance='neutral']:active){background: color-mix(in srgb, var(--neutral-fill-rest), transparent 70%));border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest)}:host([appearance='neutral'][disabled]), :host([appearance='neutral'][disabled]):hover, :host([appearance='neutral'][disabled]):active{background: color-mix(in srgb, var(--neutral-fill-rest), transparent 70%);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest);color: color-mix(in srgb, var(--neutral-foreground-rest), transparent 50%);opacity: 100%}:host([appearance='accent']){color: contrast-color(var(--accent-fill-rest))}`,U7=(e,t)=>O` ${FC(e,t)} ${DIe(e,t)} `.withBehaviors(V7(`primary`,gIe),V7(`secondary`,_Ie),V7(`tertiary`,SIe),V7(`neutral`,vIe),V7(`danger`,yIe),V7(`success`,bIe),V7(`warning`,xIe),V7(`primary-outline`,CIe),V7(`secondary-outline`,wIe),V7(`neutral-outline`,TIe),V7(`link`,EIe)),OIe=class extends oC{}.compose(Object.assign({baseName:`anchor`,template:(e,t)=>iC(e,t),styles:(e,t)=>O` ${aC(e,t)} ${U7(e,t)} `.withBehaviors(...U7(e,t).behaviors),shadowOptions:sC},cC)),kIe=class extends dC{}.compose(Object.assign({baseName:`anchored-region`,template:(e,t)=>lC(e,t),styles:(e,t)=>O` ${uC(e,t)}`,shadowOptions:fC},pC)),AIe=class extends gC{}.compose(Object.assign({baseName:`avatar`,template:(e,t)=>mC(e,t),styles:(e,t)=>O` ${hC(e,t)}`,shadowOptions:_C},vC)),jIe=class extends xC{}.compose(Object.assign({baseName:`badge`,template:(e,t)=>yC(e,t),styles:(e,t)=>O` ${bC(e,t)} :host{--badge-fill-primary: var(--accent-fill-rest);--badge-fill-neutral: var(--neutral-fill-rest);--badge-fill-success: var(--success-color);--badge-fill-danger: var(--error-color);--badge-fill-warning: var(--warning-color);--badge-fill-buy: var(--buy-color);--badge-fill-sell: var(--sell-color);--badge-color-text: var(--neutral-foreground-rest);font-size: var(--type-ramp-minus-2-font-size)}:host .control{padding: calc(${B} * 1px) calc(${B} * 2px);border: none}`,shadowOptions:void 0},SC)),MIe=O` ${CC} :host{--banner-height: calc( ((var(--design-unit) + 2) * var(--base-height-multiplier)) + (var(--design-unit) * var(--design-unit)) * 1px )}.banner{background-color: var(--neutral-layer-1);color: var(--neutral-foreground-rest);padding: calc(var(--design-unit) * 4px)}.content{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height)}`,NIe=TC,PIe=class extends EC{}.compose({baseName:`banner`,shadowOptions:NIe,styles:MIe,template:wC}),FIe=class extends kC{}.compose(Object.assign({baseName:`breadcrumb`,template:(e,t)=>DC(e,t),styles:(e,t)=>O` ${OC(e,t)}`,shadowOptions:void 0},{})),IIe=class extends MC{}.compose(Object.assign({baseName:`breadcrumb-item`,template:(e,t)=>AC(e,t),styles:(e,t)=>O` ${jC(e,t)} .listitem{color: var(--accent-foreground-rest)}.control{color: var(--neutral-foreground-rest)}.control:hover{color: var(--neutral-foreground-rest)}.separator{color: var(--neutral-stroke-rest);margin: 0 12px}.control:hover .content::before{background: var(--neutral-foreground-rest)}.control .start{width: calc(var(--base-height-multiplier) * 3px);height: calc(var(--base-height-multiplier) * 3px);display: flex;justify-content: center;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);margin: 0 -4px 0 0}.control:hover .start{background: color-mix(in srgb, var(--neutral-foreground-rest), transparent 95%)}`,shadowOptions:void 0},NC)),LIe=class extends IC{}.compose(Object.assign({baseName:`button`,template:(e,t)=>PC(e,t),styles:U7,shadowOptions:LC},RC)),RIe=class extends VC{}.compose(Object.assign({baseName:`calendar`,template:(e,t)=>BC(e,t),styles:()=>O` ${zC()}`,shadowOptions:HC},UC)),zIe=class extends KC{}.compose(Object.assign({baseName:`card`,template:(e,t)=>WC(e,t),styles:(e,t)=>O` ${GC(e,t)} :host{background: var(--neutral-layer-card-container);color: ${H};border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));box-shadow: var(--card-box-shadow, none);border: var( --card-border, 1px solid var(--neutral-stroke-rest) );/** uses a token instead of #2E3339 value available in ux docs */ /* box-shadow and border-radius are being calculated at host level by using design-tokens */}::slotted(rapid-card){background: var(--neutral-layer-3)}`,shadowOptions:void 0},qC)),BIe=O` ${rw} .label{color: var(--neutral-foreground-hint)}.options{background: var(--neutral-layer-4)}rapid-checkbox:hover:not([disabled]){background: var(--neutral-layer-4)}`,VIe=T` ${iw(`rapid`)} `;var HIe=class extends ow{};let UIe=aw,WIe=HIe.compose(Object.assign({baseName:`categorized-multiselect`,template:VIe,styles:BIe,shadowOptions:void 0},UIe)),GIe=class extends lw{}.compose(Object.assign({baseName:`checkbox`,template:(e,t)=>sw(e,t),styles:(e,t)=>O` ${cw(e,t)} .checked-indicator{fill: contrast-color(var(--accent-fill-rest));box-shadow: 2px 1000px 1px rgb(0 0 0 / 20%) inset;border-radius: calc(var(--control-corner-radius) * 1px)}:host([aria-checked='true']:not([disabled])) .control:hover .checked-indicator{fill: var(--neutral-foreground-rest)}.label{padding-inline-start: calc(var(--design-unit) * 2px)}`,shadowOptions:void 0},uw)),KIe=class extends hw{}.compose(Object.assign({baseName:`combobox`,template:(e,t)=>fw(e,t),styles:(e,t)=>O` ${dw(e,t)} :host{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );min-width: 0}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not([open])){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host .listbox ::slotted(*:last-child){border-bottom: none}.control{padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:active{background: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}.combo-box-indicator{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);transition: all 0.35s}.selected-value{height: calc(100% - (var(--design-unit) * 1px));padding: 0;margin: 0}:host(:focus-within:not([disabled])) .indicator{background-color: transparent}:host([open]) .combo-box-indicator{transition: all 0.35s;transform: rotate(180deg)}::slotted([role='option']){margin: 0}`,shadowOptions:gw},_w)),qIe=class extends bw{}.compose({baseName:`connection-indicator`,template:yw,styles:(e,t)=>O` ${vw(e,t)} :host{--light-size: calc(var(--design-unit) * 3px);--red: var(--error-color);--trafic-light-red: color-mix(in srgb, var(--red), transparent 0%);--trafic-light-red-glow: color-mix(in srgb, var(--red), transparent 60%) 0 0 4px 4px, color-mix(in srgb, var(--red), transparent 80%) 0 0 8px 8px;--green: var(--success-color);--trafic-light-green: color-mix(in srgb, var(--green), transparent 0%);--trafic-light-green-glow: color-mix(in srgb, var(--green), transparent 60%) 0 0 4px 4px, color-mix(in srgb, var(--green), transparent 80%) 0 0 8px 8px}.light{margin: calc(var(--design-unit) * 4px)}.label{font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);color: var(--neutral-stroke-rest)}`}),{defaultConfig:JIe,shadowOptions:YIe,styles:XIe,template:ZIe}=H7(xw),QIe=()=>xw(),{defaultConfig:$Ie,shadowOptions:eLe,styles:tLe,template:nLe}=H7(Sw),rLe=()=>Sw(),{defaultConfig:iLe,shadowOptions:aLe,styles:oLe,template:sLe}=H7(Cw),cLe=()=>Cw(),lLe=()=>O` ${ww} :host{--primary-gradient-angle: -113.5deg;display: inline-block}.calendar-dropdown{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}.input-icon-container{display: flex;justify-content: center;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px)}.input-icon-container:hover{background-color: var(--neutral-fill-rest)}.date-toggle::part(end){margin-inline-end: calc(var(--design-unit) * 1px)}.date-toggle{margin-bottom: 0}.month-day{width: calc(((var(--base-height-multiplier) * (var(--design-unit) - 1)) + 2) * 1px);height: calc(((var(--base-height-multiplier) * (var(--design-unit) - 1)) + 2) * 1px)}.week-days span{font-size: var(--type-ramp-minus-2-font-size)}`,uLe=T` ${Ew(`rapid`)} `,dLe=class extends Rw{}.compose(Object.assign({baseName:`date-picker`,template:uLe,styles:lLe,shadowOptions:void 0},{}));var W7;(function(e){e.primary=`#11C9FC`,e.neutral=`#7C909B`,e.error=`#F9644D`,e.success=`#7ACC79`,e.warning=`#FFB660`,e.tertiary=`#7B2FBE`,e.info=`#11C9FC`,e.buy=`#7ACC79`,e.sell=`#F14376`,e.chartPink=`#fb8176`,e.longGreen=`#7acc79`,e.shortPink=`#f14376`,e.warningYellow=`#fcb35f`,e.green=`#44c14c`,e.lightGreen=`#69cd70`,e.red=`#ef4d28`,e.lightRed=`#ee6588`,e.dodgerBlue=`#33a9ff`,e.lightDodgerBlue=`#5cbaff`,e.violet=`#9b1e74`,e.lightViolet=`#b528af`,e.white=`#f9f9f9`,e.silver=`#c1c1c1`,e.salomie=`#ffdf94`,e.lightSalomie=`#ccb276`,e.melon=`#ffbbb2`,e.lightMelon=`#cc968e`,e.portage=`#8a99f5`,e.lightPortage=`#adb8f8`,e.ice=`#97f4eb`,e.lightIce=`#6befe2`})(W7||(W7={}));let{create:G7}=oi,K7=es(W7.error),q7=is.create(K7.r,K7.g,K7.b),J7=G7(`error-color`).withDefault(q7),Y7=es(W7.success),X7=is.create(Y7.r,Y7.g,Y7.b),Z7=G7(`success-color`).withDefault(X7),Q7=es(W7.warning),$7=is.create(Q7.r,Q7.g,Q7.b),e9=G7(`warning-color`).withDefault($7),t9=es(W7.buy),n9=is.create(t9.r,t9.g,t9.b),r9=G7(`buy-color`).withDefault(n9),i9=es(W7.sell),a9=is.create(i9.r,i9.g,i9.b),o9=G7(`sell-color`).withDefault(a9),s9=es(W7.info),c9=is.create(s9.r,s9.g,s9.b),l9=G7(`info-color`).withDefault(c9),u9=es(W7.error),d9=is.create(u9.r,u9.g,u9.b),f9=G7(`serious-notify-color`).withDefault(d9),{create:p9}=oi,m9=e=>oi.create({name:e,cssCustomPropertyName:null}),h9=is.create(1,1,1),fLe=is.create(0,0,0),g9=4.5;function pLe(e,t,n,r,i,a,o,s,c){let l=e.source,u=t.closestIndexOf(n)>=Math.max(o,s,c)?-1:1,d=e.closestIndexOf(l),f=d+u*-1*r,p=f+u*i,m=f+u*a;return{rest:e.get(f),hover:e.get(d),active:e.get(p),focus:e.get(m)}}function mLe(e,t,n,r,i,a,o){let s=e.source,c=e.closestIndexOf(s),l=ss(t)?-1:1,u=c+(l===1?Math.min(r,i):Math.max(l*r,l*i)),d=e.colorContrast(t,n,u,l),f=e.closestIndexOf(d),p=f+l*Math.abs(r-i),m=l===1?r<i:l*r>l*i,h=m?f:p,g=m?p:f;return{rest:e.get(h),hover:e.get(g),active:e.get(h+l*a),focus:e.get(h+l*o)}}function hLe(e,t){return e.contrast(h9)>=t?h9:fLe}function _9(e,t){let n=e,r=m9(`${n}-palette`).withDefault(e=>ls.from(t.getValueFor(e))),i=m9(`${n}-fill-rest-delta`).withDefault(0),a=m9(`${n}-fill-hover-delta`).withDefault(4),o=m9(`${n}-fill-active-delta`).withDefault(-5),s=m9(`${n}-fill-focus-delta`).withDefault(0),c=m9(`${n}-foreground-rest-delta`).withDefault(0),l=m9(`${n}-foreground-hover-delta`).withDefault(6),u=m9(`${n}-foreground-active-delta`).withDefault(-4),d=m9(`${n}-foreground-focus-delta`).withDefault(0),f=m9(`${n}-fill-recipe`).withDefault({evaluate:(e,t)=>pLe(r.getValueFor(e),_c.getValueFor(e),t??Mc.getValueFor(e),a.getValueFor(e),o.getValueFor(e),s.getValueFor(e),Js.getValueFor(e),Ys.getValueFor(e),Xs.getValueFor(e))}),p=p9(`${n}-fill-rest`).withDefault(e=>f.getValueFor(e).evaluate(e).rest),m=p9(`${n}-fill-hover`).withDefault(e=>f.getValueFor(e).evaluate(e).hover),h=p9(`${n}-fill-active`).withDefault(e=>f.getValueFor(e).evaluate(e).active),g=p9(`${n}-fill-focus`).withDefault(e=>f.getValueFor(e).evaluate(e).focus),_=e=>(t,n)=>hLe(n??p.getValueFor(t),e),v=m9(`foreground-on-${n}-recipe`).withDefault({evaluate:(e,t)=>_(g9)(e,t)}),y=p9(`foreground-on-${n}-rest`).withDefault(e=>v.getValueFor(e).evaluate(e,p.getValueFor(e))),b=p9(`foreground-on-${n}-hover`).withDefault(e=>v.getValueFor(e).evaluate(e,m.getValueFor(e))),ee=p9(`foreground-on-${n}-active`).withDefault(e=>v.getValueFor(e).evaluate(e,h.getValueFor(e))),x=p9(`foreground-on-${n}-focus`).withDefault(e=>v.getValueFor(e).evaluate(e,g.getValueFor(e))),te=m9(`foreground-on-${n}-large-recipe`).withDefault({evaluate:(e,t)=>_(7)(e,t)}),ne=p9(`foreground-on-${n}-rest-large`).withDefault(e=>te.getValueFor(e).evaluate(e,p.getValueFor(e))),S=p9(`foreground-on-${n}-hover-large`).withDefault(e=>te.getValueFor(e).evaluate(e,m.getValueFor(e))),C=p9(`foreground-on-${n}-active-large`).withDefault(e=>te.getValueFor(e).evaluate(e,h.getValueFor(e))),w=p9(`foreground-on-${n}-focus-large`).withDefault(e=>te.getValueFor(e).evaluate(e,g.getValueFor(e))),re=m9(`${n}-foreground-recipe`).withDefault({evaluate:(e,t)=>mLe(r.getValueFor(e),t??Mc.getValueFor(e),g9,c.getValueFor(e),l.getValueFor(e),u.getValueFor(e),d.getValueFor(e))});return{palette:r,fillRestDelta:i,fillHoverDelta:a,fillActiveDelta:o,fillFocusDelta:s,foregroundRestDelta:c,foregroundHoverDelta:l,foregroundActiveDelta:u,foregroundFocusDelta:d,fillRecipe:f,fillRest:p,fillHover:m,fillActive:h,fillFocus:g,foregroundOnRecipe:v,foregroundOnRest:y,foregroundOnHover:b,foregroundOnActive:ee,foregroundOnFocus:x,foregroundOnLargeRecipe:te,foregroundOnRestLarge:ne,foregroundOnHoverLarge:S,foregroundOnActiveLarge:C,foregroundOnFocusLarge:w,foregroundRecipe:re,foregroundRest:p9(`${n}-foreground-rest`).withDefault(e=>re.getValueFor(e).evaluate(e).rest),foregroundHover:p9(`${n}-foreground-hover`).withDefault(e=>re.getValueFor(e).evaluate(e).hover),foregroundActive:p9(`${n}-foreground-active`).withDefault(e=>re.getValueFor(e).evaluate(e).active),foregroundFocus:p9(`${n}-foreground-focus`).withDefault(e=>re.getValueFor(e).evaluate(e).focus)}}let v9=es(W7.green),y9=is.create(v9.r,v9.g,v9.b),b9=oi.create(`secondary-color`).withDefault(y9),{palette:gLe,fillRestDelta:_Le,fillHoverDelta:vLe,fillActiveDelta:yLe,fillFocusDelta:bLe,foregroundRestDelta:xLe,foregroundHoverDelta:SLe,foregroundActiveDelta:CLe,foregroundFocusDelta:wLe,fillRecipe:TLe,fillRest:ELe,fillHover:DLe,fillActive:OLe,fillFocus:kLe,foregroundOnRecipe:ALe,foregroundOnRest:jLe,foregroundOnHover:MLe,foregroundOnActive:NLe,foregroundOnFocus:PLe,foregroundOnLargeRecipe:FLe,foregroundOnRestLarge:ILe,foregroundOnHoverLarge:LLe,foregroundOnActiveLarge:RLe,foregroundOnFocusLarge:zLe,foregroundRecipe:BLe,foregroundRest:VLe,foregroundHover:HLe,foregroundActive:ULe,foregroundFocus:WLe}=_9(`secondary`,b9),x9=es(W7.tertiary),S9=is.create(x9.r,x9.g,x9.b),C9=oi.create(`tertiary-color`).withDefault(S9),{palette:GLe,fillRestDelta:KLe,fillHoverDelta:qLe,fillActiveDelta:JLe,fillFocusDelta:YLe,foregroundRestDelta:XLe,foregroundHoverDelta:ZLe,foregroundActiveDelta:QLe,foregroundFocusDelta:$Le,fillRecipe:eRe,fillRest:tRe,fillHover:nRe,fillActive:rRe,fillFocus:iRe,foregroundOnRecipe:aRe,foregroundOnRest:oRe,foregroundOnHover:sRe,foregroundOnActive:cRe,foregroundOnFocus:lRe,foregroundOnLargeRecipe:uRe,foregroundOnRestLarge:dRe,foregroundOnHoverLarge:fRe,foregroundOnActiveLarge:pRe,foregroundOnFocusLarge:mRe,foregroundRecipe:hRe,foregroundRest:gRe,foregroundHover:_Re,foregroundActive:vRe,foregroundFocus:yRe}=_9(`tertiary`,C9),{palette:bRe,fillRestDelta:xRe,fillHoverDelta:SRe,fillActiveDelta:CRe,fillFocusDelta:wRe,foregroundRestDelta:TRe,foregroundHoverDelta:ERe,foregroundActiveDelta:DRe,foregroundFocusDelta:ORe,fillRecipe:kRe,fillRest:ARe,fillHover:jRe,fillActive:MRe,fillFocus:NRe,foregroundOnRecipe:PRe,foregroundOnRest:FRe,foregroundOnHover:IRe,foregroundOnActive:LRe,foregroundOnFocus:RRe,foregroundOnLargeRecipe:zRe,foregroundOnRestLarge:BRe,foregroundOnHoverLarge:VRe,foregroundOnActiveLarge:HRe,foregroundOnFocusLarge:URe,foregroundRecipe:WRe,foregroundRest:GRe,foregroundHover:KRe,foregroundActive:qRe,foregroundFocus:JRe}=_9(`error`,J7),{palette:YRe,fillRestDelta:XRe,fillHoverDelta:ZRe,fillActiveDelta:QRe,fillFocusDelta:$Re,foregroundRestDelta:eze,foregroundHoverDelta:tze,foregroundActiveDelta:nze,foregroundFocusDelta:rze,fillRecipe:ize,fillRest:aze,fillHover:oze,fillActive:sze,fillFocus:cze,foregroundOnRecipe:lze,foregroundOnRest:uze,foregroundOnHover:dze,foregroundOnActive:fze,foregroundOnFocus:pze,foregroundOnLargeRecipe:mze,foregroundOnRestLarge:hze,foregroundOnHoverLarge:gze,foregroundOnActiveLarge:_ze,foregroundOnFocusLarge:vze,foregroundRecipe:yze,foregroundRest:bze,foregroundHover:xze,foregroundActive:Sze,foregroundFocus:Cze}=_9(`success`,Z7),{palette:wze,fillRestDelta:Tze,fillHoverDelta:Eze,fillActiveDelta:Dze,fillFocusDelta:Oze,foregroundRestDelta:kze,foregroundHoverDelta:Aze,foregroundActiveDelta:jze,foregroundFocusDelta:Mze,fillRecipe:Nze,fillRest:Pze,fillHover:Fze,fillActive:Ize,fillFocus:Lze,foregroundOnRecipe:Rze,foregroundOnRest:zze,foregroundOnHover:Bze,foregroundOnActive:Vze,foregroundOnFocus:Hze,foregroundOnLargeRecipe:Uze,foregroundOnRestLarge:Wze,foregroundOnHoverLarge:Gze,foregroundOnActiveLarge:Kze,foregroundOnFocusLarge:qze,foregroundRecipe:Jze,foregroundRest:Yze,foregroundHover:Xze,foregroundActive:Zze,foregroundFocus:Qze}=_9(`warning`,e9);var w9=/* @__PURE__ */ c({accentFillActive:()=>Lc,accentFillActiveDelta:()=>Hs,accentFillFocus:()=>Rc,accentFillFocusDelta:()=>Us,accentFillHover:()=>Ic,accentFillHoverDelta:()=>Vs,accentFillRest:()=>Fc,accentFillRestDelta:()=>Bs,accentForegroundActive:()=>el,accentForegroundActiveDelta:()=>Ks,accentForegroundFocus:()=>tl,accentForegroundFocusDelta:()=>qs,accentForegroundHover:()=>$c,accentForegroundHoverDelta:()=>Gs,accentForegroundRest:()=>Qc,accentForegroundRestDelta:()=>Ws,accentPalette:()=>yc,baseHeightMultiplier:()=>gs,baseLayerLuminance:()=>_s,bodyFont:()=>hs,buyColor:()=>r9,controlCornerRadius:()=>z,defaultBuyColor:()=>n9,defaultErrorColor:()=>q7,defaultInfoColor:()=>c9,defaultSecondaryColor:()=>y9,defaultSellColor:()=>a9,defaultSeriousNotifyColor:()=>d9,defaultSuccessColor:()=>X7,defaultTertiaryColor:()=>S9,defaultWarningColor:()=>$7,density:()=>vs,designUnit:()=>B,direction:()=>ys,disabledOpacity:()=>bs,errorColor:()=>J7,errorFillActive:()=>MRe,errorFillActiveDelta:()=>CRe,errorFillFocus:()=>NRe,errorFillFocusDelta:()=>wRe,errorFillHover:()=>jRe,errorFillHoverDelta:()=>SRe,errorFillRecipe:()=>kRe,errorFillRest:()=>ARe,errorFillRestDelta:()=>xRe,errorForegroundActive:()=>qRe,errorForegroundActiveDelta:()=>DRe,errorForegroundFocus:()=>JRe,errorForegroundFocusDelta:()=>ORe,errorForegroundHover:()=>KRe,errorForegroundHoverDelta:()=>ERe,errorForegroundRecipe:()=>WRe,errorForegroundRest:()=>GRe,errorForegroundRestDelta:()=>TRe,errorPalette:()=>bRe,fillColor:()=>Mc,focusStrokeInner:()=>Tl,focusStrokeOuter:()=>wl,focusStrokeWidth:()=>xs,foregroundOnAccentActive:()=>Uc,foregroundOnAccentActiveLarge:()=>Jc,foregroundOnAccentFocus:()=>Wc,foregroundOnAccentFocusLarge:()=>Yc,foregroundOnAccentHover:()=>Hc,foregroundOnAccentHoverLarge:()=>qc,foregroundOnAccentRest:()=>Vc,foregroundOnAccentRestLarge:()=>Kc,foregroundOnErrorActive:()=>LRe,foregroundOnErrorActiveLarge:()=>HRe,foregroundOnErrorFocus:()=>RRe,foregroundOnErrorFocusLarge:()=>URe,foregroundOnErrorHover:()=>IRe,foregroundOnErrorHoverLarge:()=>VRe,foregroundOnErrorLargeRecipe:()=>zRe,foregroundOnErrorRecipe:()=>PRe,foregroundOnErrorRest:()=>FRe,foregroundOnErrorRestLarge:()=>BRe,foregroundOnSecondaryActive:()=>NLe,foregroundOnSecondaryActiveLarge:()=>RLe,foregroundOnSecondaryFocus:()=>PLe,foregroundOnSecondaryFocusLarge:()=>zLe,foregroundOnSecondaryHover:()=>MLe,foregroundOnSecondaryHoverLarge:()=>LLe,foregroundOnSecondaryLargeRecipe:()=>FLe,foregroundOnSecondaryRecipe:()=>ALe,foregroundOnSecondaryRest:()=>jLe,foregroundOnSecondaryRestLarge:()=>ILe,foregroundOnSuccessActive:()=>fze,foregroundOnSuccessActiveLarge:()=>_ze,foregroundOnSuccessFocus:()=>pze,foregroundOnSuccessFocusLarge:()=>vze,foregroundOnSuccessHover:()=>dze,foregroundOnSuccessHoverLarge:()=>gze,foregroundOnSuccessLargeRecipe:()=>mze,foregroundOnSuccessRecipe:()=>lze,foregroundOnSuccessRest:()=>uze,foregroundOnSuccessRestLarge:()=>hze,foregroundOnTertiaryActive:()=>cRe,foregroundOnTertiaryActiveLarge:()=>pRe,foregroundOnTertiaryFocus:()=>lRe,foregroundOnTertiaryFocusLarge:()=>mRe,foregroundOnTertiaryHover:()=>sRe,foregroundOnTertiaryHoverLarge:()=>fRe,foregroundOnTertiaryLargeRecipe:()=>uRe,foregroundOnTertiaryRecipe:()=>aRe,foregroundOnTertiaryRest:()=>oRe,foregroundOnTertiaryRestLarge:()=>dRe,foregroundOnWarningActive:()=>Vze,foregroundOnWarningActiveLarge:()=>Kze,foregroundOnWarningFocus:()=>Hze,foregroundOnWarningFocusLarge:()=>qze,foregroundOnWarningHover:()=>Bze,foregroundOnWarningHoverLarge:()=>Gze,foregroundOnWarningLargeRecipe:()=>Uze,foregroundOnWarningRecipe:()=>Rze,foregroundOnWarningRest:()=>zze,foregroundOnWarningRestLarge:()=>Wze,infoColor:()=>l9,neutralFillActive:()=>al,neutralFillActiveDelta:()=>Xs,neutralFillFocus:()=>ol,neutralFillFocusDelta:()=>Zs,neutralFillHover:()=>il,neutralFillHoverDelta:()=>Ys,neutralFillInputActive:()=>ul,neutralFillInputActiveDelta:()=>ec,neutralFillInputFocus:()=>dl,neutralFillInputFocusDelta:()=>tc,neutralFillInputHover:()=>ll,neutralFillInputHoverDelta:()=>$s,neutralFillInputRest:()=>cl,neutralFillInputRestDelta:()=>Qs,neutralFillLayerRest:()=>Cl,neutralFillLayerRestDelta:()=>uc,neutralFillRest:()=>rl,neutralFillRestDelta:()=>Js,neutralFillStealthActive:()=>hl,neutralFillStealthActiveDelta:()=>ic,neutralFillStealthFocus:()=>gl,neutralFillStealthFocusDelta:()=>ac,neutralFillStealthHover:()=>ml,neutralFillStealthHoverDelta:()=>rc,neutralFillStealthRest:()=>pl,neutralFillStealthRestDelta:()=>nc,neutralFillStrongActive:()=>bl,neutralFillStrongActiveDelta:()=>cc,neutralFillStrongFocus:()=>xl,neutralFillStrongFocusDelta:()=>lc,neutralFillStrongHover:()=>yl,neutralFillStrongHoverDelta:()=>sc,neutralFillStrongRest:()=>vl,neutralFillStrongRestDelta:()=>oc,neutralForegroundHint:()=>El,neutralForegroundRest:()=>H,neutralLayer1:()=>Tc,neutralLayer2:()=>Dc,neutralLayer3:()=>kc,neutralLayer4:()=>jc,neutralLayerCardContainer:()=>xc,neutralLayerFloating:()=>Cc,neutralPalette:()=>_c,neutralStrokeActive:()=>Al,neutralStrokeActiveDelta:()=>pc,neutralStrokeDividerRest:()=>Ml,neutralStrokeDividerRestDelta:()=>hc,neutralStrokeFocus:()=>jl,neutralStrokeFocusDelta:()=>mc,neutralStrokeHover:()=>kl,neutralStrokeHoverDelta:()=>fc,neutralStrokeRest:()=>Ol,neutralStrokeRestDelta:()=>dc,secondaryColor:()=>b9,secondaryFillActive:()=>OLe,secondaryFillActiveDelta:()=>yLe,secondaryFillFocus:()=>kLe,secondaryFillFocusDelta:()=>bLe,secondaryFillHover:()=>DLe,secondaryFillHoverDelta:()=>vLe,secondaryFillRecipe:()=>TLe,secondaryFillRest:()=>ELe,secondaryFillRestDelta:()=>_Le,secondaryForegroundActive:()=>ULe,secondaryForegroundActiveDelta:()=>CLe,secondaryForegroundFocus:()=>WLe,secondaryForegroundFocusDelta:()=>wLe,secondaryForegroundHover:()=>HLe,secondaryForegroundHoverDelta:()=>SLe,secondaryForegroundRecipe:()=>BLe,secondaryForegroundRest:()=>VLe,secondaryForegroundRestDelta:()=>xLe,secondaryPalette:()=>gLe,sellColor:()=>o9,seriousNotifyColor:()=>f9,strokeWidth:()=>V,successColor:()=>Z7,successFillActive:()=>sze,successFillActiveDelta:()=>QRe,successFillFocus:()=>cze,successFillFocusDelta:()=>$Re,successFillHover:()=>oze,successFillHoverDelta:()=>ZRe,successFillRecipe:()=>ize,successFillRest:()=>aze,successFillRestDelta:()=>XRe,successForegroundActive:()=>Sze,successForegroundActiveDelta:()=>nze,successForegroundFocus:()=>Cze,successForegroundFocusDelta:()=>rze,successForegroundHover:()=>xze,successForegroundHoverDelta:()=>tze,successForegroundRecipe:()=>yze,successForegroundRest:()=>bze,successForegroundRestDelta:()=>eze,successPalette:()=>YRe,tertiaryColor:()=>C9,tertiaryFillActive:()=>rRe,tertiaryFillActiveDelta:()=>JLe,tertiaryFillFocus:()=>iRe,tertiaryFillFocusDelta:()=>YLe,tertiaryFillHover:()=>nRe,tertiaryFillHoverDelta:()=>qLe,tertiaryFillRecipe:()=>eRe,tertiaryFillRest:()=>tRe,tertiaryFillRestDelta:()=>KLe,tertiaryForegroundActive:()=>vRe,tertiaryForegroundActiveDelta:()=>QLe,tertiaryForegroundFocus:()=>yRe,tertiaryForegroundFocusDelta:()=>$Le,tertiaryForegroundHover:()=>_Re,tertiaryForegroundHoverDelta:()=>ZLe,tertiaryForegroundRecipe:()=>hRe,tertiaryForegroundRest:()=>gRe,tertiaryForegroundRestDelta:()=>XLe,tertiaryPalette:()=>GLe,typeRampBaseFontSize:()=>Ss,typeRampBaseLineHeight:()=>Cs,typeRampMinus1FontSize:()=>ws,typeRampMinus1LineHeight:()=>Ts,typeRampMinus2FontSize:()=>Es,typeRampMinus2LineHeight:()=>Ds,typeRampPlus1FontSize:()=>Os,typeRampPlus1LineHeight:()=>ks,typeRampPlus2FontSize:()=>As,typeRampPlus2LineHeight:()=>js,typeRampPlus3FontSize:()=>Ms,typeRampPlus3LineHeight:()=>Ns,typeRampPlus4FontSize:()=>Ps,typeRampPlus4LineHeight:()=>Fs,typeRampPlus5FontSize:()=>Is,typeRampPlus5LineHeight:()=>Ls,typeRampPlus6FontSize:()=>Rs,typeRampPlus6LineHeight:()=>zs,warningColor:()=>e9,warningFillActive:()=>Ize,warningFillActiveDelta:()=>Dze,warningFillFocus:()=>Lze,warningFillFocusDelta:()=>Oze,warningFillHover:()=>Fze,warningFillHoverDelta:()=>Eze,warningFillRecipe:()=>Nze,warningFillRest:()=>Pze,warningFillRestDelta:()=>Tze,warningForegroundActive:()=>Zze,warningForegroundActiveDelta:()=>jze,warningForegroundFocus:()=>Qze,warningForegroundFocusDelta:()=>Mze,warningForegroundHover:()=>Xze,warningForegroundHoverDelta:()=>Aze,warningForegroundRecipe:()=>Jze,warningForegroundRest:()=>Yze,warningForegroundRestDelta:()=>kze,warningPalette:()=>wze});let T9=Uw(W7.primary),E9=Uw(W7.neutral),D9=Uw(W7.green),O9=Uw(W7.tertiary),k9=Uw(W7.error),A9=Uw(W7.success),j9=Uw(W7.warning),M9=ps.DarkMode,$ze=Nn.ltr,N9=`"Segoe UI", Arial, Helvetica, sans-serif`,P9=`14px`,F9=`20px`,eBe={design_tokens:{color:{accent:{$value:T9.source.toColorString(),$type:`color`},neutral:{$value:E9.source.toColorString(),$type:`color`},secondary:{$value:D9.source.toColorString(),$type:`color`},tertiary:{$value:O9.source.toColorString(),$type:`color`},error:{$value:k9.source.toColorString(),$type:`color`},success:{$value:A9.source.toColorString(),$type:`color`},warning:{$value:j9.source.toColorString(),$type:`color`}},fontFamily:{bodyFont:{$value:N9,$type:`fontFamily`}},typography:{baseFontSize:{$value:P9,$type:`dimension`},baseLineHeight:{$value:F9,$type:`dimension`}},mode:{luminance:{$value:M9,$type:`number`}},style:{density:{$value:0,$type:`number`},baseHeightMultiplier:{$value:10,$type:`number`},borderRadius:{$value:4,$type:`number`},strokeWidth:{$value:1,$type:`number`}},space:{designUnit:{$value:4,$type:`number`}}}};var I9=/* @__PURE__ */ c({accentFillActiveDeltaValue:()=>-5,accentFillFocusDeltaValue:()=>0,accentFillHoverDeltaValue:()=>4,accentFillRestDeltaValue:()=>0,accentForegroundActiveDeltaValue:()=>-4,accentForegroundFocusDeltaValue:()=>0,accentForegroundHoverDeltaValue:()=>6,accentForegroundRestDeltaValue:()=>0,accentPaletteValue:()=>T9,baseHeightMultiplierValue:()=>10,baseLayerLuminanceValue:()=>M9,bodyFontValue:()=>N9,controlCornerRadiusValue:()=>4,densityValue:()=>0,designTokens:()=>eBe,designUnitValue:()=>4,directionValue:()=>$ze,disabledOpacityValue:()=>.3,errorPaletteValue:()=>k9,focusStrokeWidthValue:()=>2,neutralFillActiveDeltaValue:()=>5,neutralFillFocusDeltaValue:()=>0,neutralFillHoverDeltaValue:()=>10,neutralFillInputActiveDeltaValue:()=>0,neutralFillInputFocusDeltaValue:()=>10,neutralFillInputHoverDeltaValue:()=>5,neutralFillInputRestDeltaValue:()=>0,neutralFillLayerRestDeltaValue:()=>3,neutralFillRestDeltaValue:()=>7,neutralFillStealthActiveDeltaValue:()=>3,neutralFillStealthFocusDeltaValue:()=>0,neutralFillStealthHoverDeltaValue:()=>5,neutralFillStealthRestDeltaValue:()=>0,neutralFillStrongActiveDeltaValue:()=>-5,neutralFillStrongFocusDeltaValue:()=>0,neutralFillStrongHoverDeltaValue:()=>8,neutralFillStrongRestDeltaValue:()=>0,neutralPaletteValue:()=>E9,neutralStrokeActiveDeltaValue:()=>16,neutralStrokeDividerRestDeltaValue:()=>8,neutralStrokeFocusDeltaValue:()=>25,neutralStrokeHoverDeltaValue:()=>40,neutralStrokeRestDeltaValue:()=>25,prefix:()=>`rapid`,secondaryPaletteValue:()=>D9,strokeWidthValue:()=>1,successPaletteValue:()=>A9,tertiaryPaletteValue:()=>O9,typeRampBaseFontSizeValue:()=>P9,typeRampBaseLineHeightValue:()=>F9,typeRampMinus1FontSizeValue:()=>`13px`,typeRampMinus1LineHeightValue:()=>`19px`,typeRampMinus2FontSizeValue:()=>`12px`,typeRampMinus2LineHeightValue:()=>`18px`,typeRampPlus1FontSizeValue:()=>`15px`,typeRampPlus1LineHeightValue:()=>`21px`,typeRampPlus2FontSizeValue:()=>`16px`,typeRampPlus2LineHeightValue:()=>`22px`,typeRampPlus3FontSizeValue:()=>`17px`,typeRampPlus3LineHeightValue:()=>`23px`,typeRampPlus4FontSizeValue:()=>`18px`,typeRampPlus4LineHeightValue:()=>`24px`,typeRampPlus5FontSizeValue:()=>`19px`,typeRampPlus5LineHeightValue:()=>`25px`,typeRampPlus6FontSizeValue:()=>`20px`,typeRampPlus6LineHeightValue:()=>`26px`,warningPaletteValue:()=>j9});let tBe=class extends K{constructor(){super(),Bw(w9,I9,this)}}.compose({baseName:`design-system-provider`,template:T`<slot></slot>`}),L9=O` ${F1} :host{font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}dialog{position: var(--dialog-position, fixed);top: 0;bottom: 0;border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));border: var(--card-border, calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest));text-align: left;line-height: normal;box-shadow: 0 2px 15px 0 rgb(0 0 0 / 35%);background-color: var(--dialog-background, var(--neutral-layer-1))}.top{display: flex;align-items: center;justify-content: space-between;color: var(--neutral-foreground-rest);margin-bottom: calc(var(--design-unit) * 2px);font-weight: 500}.bottom{display: flex;flex-wrap: wrap;justify-content: flex-end;color: var(--neutral-foreground-rest);gap: calc(var(--design-unit) * 2px)}:host slot:first-of-type{color: ${H}}::slotted(rapid-button){margin-top: calc(var(--design-unit) * 4px - 1px)}slot[name='top']::slotted(*){margin: 0;font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-hint);font-weight: 700}.content-wrapper{min-width: var(--dialog-min-width);min-height: var(--dialog-min-height);height: fit-content;width: fit-content;max-width: var(--dialog-max-width);max-height: var(--dialog-max-height);display: flex;flex-direction: column;justify-content: space-between;align-items: stretch}.close-icon:hover svg{background-color: color-mix(in srgb, var(--neutral-foreground-rest), transparent 95%)}.close-icon svg g path{fill: color-mix(in srgb, var(--neutral-foreground-rest), transparent 50%)}.close-icon:hover svg g path{fill: var(--neutral-foreground-rest)}.close-icon:active svg{background-color: var(--neutral-layer-4)}.close-icon:active svg g path{fill: color-mix(in srgb, var(--neutral-foreground-rest), transparent 67%)}.header-controls{rapid-button{--base-height-multiplier: 8}rapid-button::part(control){padding: 0 calc((8 + var(--design-unit) * 1 * var(--density)) * 1px)}}`,nBe=Z1,rBe=L1,iBe=X1,aBe=class extends $1{}.compose(Object.assign({baseName:`dialog`,shadowOptions:iBe,styles:L9,template:rBe},nBe)),oBe=class extends n0{}.compose(Object.assign({baseName:`disclosure`,template:(e,t)=>e0(e,t),styles:(e,t)=>O` ${t0(e,t)} :host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height);color: var(--neutral-foreground-rest)}:host([appearance='accent']) .invoker{padding: calc((10 + (var(--design-unit) * 2 * var(--density))) * 1px)}#disclosure-content{padding: 0 calc(var(--design-unit) * 4px) calc(var(--design-unit) * 4px);text-align: center}`,shadowOptions:X1},r0)),sBe=class extends o0{}.compose(Object.assign({baseName:`divider`,template:(e,t)=>i0(e,t),styles:(e,t)=>O` ${a0(e,t)}`,shadowOptions:void 0},s0)),cBe=class extends d0{}.compose({baseName:`dropdown-menu`,styles:(e,t)=>O` ${c0(`rapid`,e,t)} .actions-menu{border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);gap: 0;margin: calc(var(--design-unit) * 1px) 0}rapid-menu{margin: 0 0 calc(var(--design-unit) * 1px) calc(var(--design-unit) * -2px);border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}`,template:u0}),lBe=O` ${f0}`,uBe=class extends v0{}.compose({baseName:`environment-indicator`,styles:lBe,template:p0}),{defaultConfig:dBe,shadowOptions:fBe,styles:pBe,template:mBe}=H7(E0),hBe=()=>E0(),gBe=P0,_Be=I0.compose({baseName:`file-reader`,styles:gBe,template:F0}),vBe=O` ${L0} ::-webkit-scrollbar{width: calc(var(--design-unit) * 3px)}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-fill-rest);border: calc(var(--stroke-width) * 3px) solid var(--neutral-layer-4)}:host::part(select-file-button), :host::part(upload-file-button){margin: 0 0 calc(var(--design-unit) * 2px) calc(var(--design-unit) * 2px)}`,yBe=T` ${R0(`rapid`)} `,bBe=B0,xBe=class extends z0{}.compose(Object.assign({baseName:`file-upload`,shadowOptions:void 0,styles:vBe,template:yBe},bBe)),SBe=(e,t)=>O` ${V0} .filter-wrapper{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}.close-icon{border: calc(var(--stroke-width) * 1px) solid transparent}.close-icon:hover{border-color: var(--error-color);background: color-mix(in srgb, var(--error-color), transparent 75%)}.close-icon:hover svg path{fill: var(--error-color)}rapid-select{margin-bottom: calc(var(--design-unit) * 2px)}.flex-row rapid-text-field, .flex-row rapid-select{flex: 1}`,CBe=T` ${W0(`rapid`)} `,wBe=class extends K0{}.compose({baseName:`filter`,template:CBe,styles:SBe}),TBe=(e,t)=>O` ${q0(e,t)} .toggle, .toggle-collapsed{background: var(--neutral-layer-4);color: var(--neutral-foreground-hint)}.toggle{border-top: calc(var(--stroke-width) * 2px) solid}.toggle:hover, .toggle-collapsed:hover{color: var(--accent-foreground-rest)}.filter-bar{background: var(--neutral-layer-3)}`,EBe=T` ${J0(`rapid`)} `,DBe=class extends Y0{}.compose({baseName:`filter-bar`,template:EBe,styles:TBe}),{defaultConfig:OBe,shadowOptions:kBe,styles:ABe,template:jBe}=H7(Q0),MBe=()=>Q0(),NBe=class extends t2{}.compose(Object.assign({baseName:`flipper`,template:(e,t)=>$0(e,t),styles:(e,t)=>O` ${e2(e,t)} :host{color: var(--neutral-foreground-rest)}:host(:hover){color: var(--neutral-foreground-rest)}:host::before{background: color-mix(in srgb, var(--accent-fill-rest), transparent 50%);border: calc(var(--stroke-width) * 1px) solid var(--accent-fill-rest);color: var(--neutral-foreground-rest)}:host(:hover)::before{background: var(--accent-fill-rest);color: var(--neutral-foreground-rest)}`,shadowOptions:void 0},n2)),PBe=O` ${r2} div.flyout{background-color: var(--neutral-layer-1);border-color: var(--neutral-stroke-rest);color: var(--neutral-foreground-rest);padding: calc(var(--design-unit) * 4px)}div.background{padding: calc(var(--design-unit) * 4px) 0}:host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height)}:host([position='left']) div.flyout{border-right-style: solid;border-right-width: calc(var(--stroke-width) * 1px)}:host([position='right']) div.flyout{border-left-style: solid;border-left-width: calc(var(--stroke-width) * 1px)}div.exit{cursor: pointer;width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);display: flex;justify-content: center;align-items: center}div.content, div.footer{padding: 0 0 calc(var(--design-unit) * 2px)}div.exit:hover{background-color: var(--neutral-fill-hover);border-radius: calc(var(--stroke-width) * 3px)}`,FBe=T` ${i2(`rapid`)} `,IBe=o2,LBe=class extends a2{}.compose(Object.assign({baseName:`flyout`,shadowOptions:void 0,styles:PBe,template:FBe},IBe)),{defaultConfig:RBe,shadowOptions:zBe,styles:BBe,template:VBe}=H7(u2),HBe=()=>u2(),{defaultConfig:UBe,shadowOptions:WBe,styles:GBe,template:KBe}=H7(f2),qBe=()=>f2(),JBe=(e,t)=>O` ${m2(e,t)}`,YBe=(e,t)=>p2(e,t);var XBe=class extends h2{};let ZBe={nextFlipper:T`<rapid-flipper @click="${e=>e.scrollToNext()}" aria-hidden="${e=>e.flippersHiddenFromAT}"></rapid-flipper>`,previousFlipper:T`<rapid-flipper @click="${e=>e.scrollToPrevious()}" direction="previous" aria-hidden="${e=>e.flippersHiddenFromAT}"></rapid-flipper>`},QBe=XBe.compose(Object.assign({baseName:`horizontal-scroll`,template:YBe,styles:JBe,shadowOptions:g2},ZBe)),$Be=(e,t)=>O` ${_2(e,t)}`,eVe=T` ${v2(`rapid`)} `;var tVe=class extends S2{};let nVe=b2,rVe=y2,iVe=tVe.compose(Object.assign({baseName:`icon`,template:eVe,styles:$Be,shadowOptions:rVe},nVe)),aVe=class extends T2{}.compose(Object.assign({baseName:`listbox`,template:(e,t)=>C2(e,t),styles:(e,t)=>O` ${w2(e,t)} :host{padding: 0;max-width: 300px;/** if removed max-width will be fit-content */}::slotted(*:last-child){border-bottom: none}`,shadowOptions:void 0},E2)),oVe=class extends k2{}.compose(Object.assign({baseName:`option`,template:(e,t)=>D2(e,t),styles:(e,t)=>O` ${O2(e,t)} :host{border-radius: 0;padding: 0 calc(var(--design-unit) * 4px);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host(.selected), :host(:not([disabled])[aria-selected='true']:active), :host(:not([disabled])[aria-selected='true']:hover){background: var(--neutral-layer-2);color: var(--accent-fill-rest);font-weight: 500}`,shadowOptions:void 0},A2)),sVe=class extends N2{}.compose(Object.assign({baseName:`menu`,template:(e,t)=>j2(e,t),styles:(e,t)=>O` ${M2(e,t)} :host{border: calc(var(--focus-stroke-width) * 1px) solid color-mix(in srgb, ${ml}, transparent 15%);padding: 0}`,shadowOptions:void 0},P2)),cVe=class extends L2{}.compose(Object.assign({baseName:`menu-item`,template:(e,t)=>F2(e,t),styles:(e,t)=>O` ${I2(e,t)} :host{margin: 0;--control-corner-radius: 0;background: var(--neutral-fill-stealth-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host(:hover){background: color-mix(in srgb, ${ml}, transparent 15%);border: calc(var(--focus-stroke-width) * 1px) solid color-mix(in srgb, ${ml}, transparent 15%)}:host(:focus){background: var(--neutral-fill-stealth-hover)}:host(.indent-0){border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-stealth-hover)}/* UX team wants border: solid 1px #2E3339;background: #2E3339 */ /* tokens being used by fast background: ${ml} color: ${H} */`,shadowOptions:void 0},R2)),lVe=O` ${L9}`,uVe=V2,dVe=z2,fVe=B2,pVe=class extends H2{}.compose(Object.assign({baseName:`modal`,shadowOptions:fVe,styles:lVe,template:dVe},uVe)),mVe=O` ${XC} .root{min-width: 0}.control{height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );min-height: 0;outline: none;border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font);box-sizing: border-box}:host(:focus-within:not([disabled])) .control{outline: none;border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}.control:hover:not(:focus):not([disabled]){outline: none;border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}#display-field{min-height: unset;padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px);font-family: var(--body-font), sans-serif;font-size: var(--type-ramp-base-font-size);background-color: transparent}#display-field:focus{outline: none;background: unset}#display-field:hover:not(:focus):not([disabled]){outline: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);left: calc( 100% - ((var(--base-height-multiplier) * (var(--design-unit) - 1)) + (var(--design-unit) - 2)) * 1px );background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}#arrow-icon{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);fill: var(--neutral-foreground-rest)}.label{color: var(--neutral-foreground-hint)}.options{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);overflow-x: hidden}rapid-checkbox{border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);padding: calc((var(--design-unit) + 1) * 1px) 0 calc((var(--design-unit) + 1) * 1px) calc((var(--design-unit) + 1) * 1px);margin: 0}rapid-checkbox:hover:not([disabled]){background: var(--neutral-layer-4)}rapid-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}rapid-checkbox[disabled]{cursor: not-allowed}`,hVe=T` ${ew(`rapid`)} `;var gVe=class extends nw{};let _Ve=tw,vVe=gVe.compose(Object.assign({baseName:`multiselect`,template:hVe,styles:mVe,shadowOptions:void 0},_Ve)),yVe=class extends S7{}.compose({baseName:`notification-listener`,template:x7,shadowOptions:{mode:`open`,delegatesFocus:!0}}),bVe=(e,t)=>O` :host{flex: 1 1 auto;box-sizing: border-box}:host([disabled]){opacity: var(--disabled-opacity);cursor: not-allowed}:host .control{height: 100%;width: 100%;border: none;background-color: transparent;padding: 0 calc(var(--design-unit) * 2px);color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);font-family: var(--body-font)}:host .root{display: flex;box-sizing: border-box;position: relative;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:hover:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host(:focus-within:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{display: block;color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0;font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}.label-hidden{margin: 0}.controls{position: absolute;right: 3px;width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--neutral-fill-rest);border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center;flex-direction: column;cursor: pointer}.step-down, .step-up{width: 1em;height: 1em;margin: -2px}.step-up-glyph, .step-down-glyph{fill: var(--neutral-foreground-hint)}.control:focus-visible{outline: none}:host .control-field .control{width: 100%}${N0}`;var xVe=class extends a4{};let SVe=s4,CVe=U2,wVe=o4,TVe=xVe.compose(Object.assign({baseName:`number-field`,template:CVe,styles:bVe,shadowOptions:wVe},SVe)),EVe=class extends u4{}.compose({baseName:`optgroup`,template:(e,t)=>l4(e,t),styles:(e,t)=>O` ${c4(e,t)}`}),DVe=class extends _4{}.compose(Object.assign({baseName:`system-health-overlay`,template:v4,styles:y4,shadowOptions:void 0},b4)),OVe=O` ${x4} :host{--pill-fill: ${rl};--pill-fill-hover: ${il};--pill-foreground: ${H}}`,kVe=S4,AVe=class extends w4{}.compose(Object.assign({baseName:`pill`,template:kVe,styles:OVe,shadowOptions:void 0},C4)),jVe=class extends p4{}.compose(Object.assign({baseName:`progress`,template:(e,t)=>d4(e,t),styles:(e,t)=>O` ${f4(e,t)}`,shadowOptions:void 0},m4)),MVe=class extends w3{}.compose(Object.assign({baseName:`progress-ring`,template:(e,t)=>S3(e,t),styles:(e,t)=>O` ${C3(e,t)}`,shadowOptions:void 0},T3)),NVe=class extends O3{}.compose(Object.assign({baseName:`radio`,template:(e,t)=>E3(e,t),styles:(e,t)=>O` ${D3(e,t)} :host{margin: 0}:host .control{background: transparent}:host([aria-checked='true']) .control{background: transparent;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host .label{padding-inline-start: calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:hover{background: transparent}:host([aria-checked='true']:not([disabled])) .control:hover{background: transparent;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-hover)}.checked-indicator, :host([aria-checked='true']:not([disabled])) .control:hover .checked-indicator{background: var(--accent-fill-rest)}`,shadowOptions:void 0},k3)),PVe=class extends M3{}.compose(Object.assign({baseName:`radio-group`,template:(e,t)=>A3(e,t),styles:(e,t)=>O` ${j3(e,t)}`,shadowOptions:void 0},N3)),FVe=O` ${P3} :host{font-family: var(--body-font)}`,IVe=T` ${F3(`rapid`)} `,LVe=class extends I3{}.compose(Object.assign({baseName:`scheduler`,template:IVe,styles:FVe,shadowOptions:void 0},L3)),RVe=O` ${K3} :host{font-family: var(--body-font)}`,zVe=T` ${r6(`rapid`)} `,BVe=class extends i6{}.compose(Object.assign({baseName:`scheduler-cron-builder`,template:zVe,styles:RVe,shadowOptions:void 0},a6)),VVe=O` ${o6} :host{font-family: var(--body-font)}`,HVe=T` ${s6(`rapid`)} `,UVe=class extends c6{}.compose(Object.assign({baseName:`scheduler-timezone`,template:HVe,styles:VVe,shadowOptions:void 0},l6)),WVe=O` ${u6}`,GVe=T` ${d6(`rapid`)} `,KVe=class extends f6{}.compose(Object.assign({baseName:`search-bar`,template:GVe,styles:WVe,shadowOptions:void 0},p6)),qVe=class extends g6{}.compose(Object.assign({baseName:`search-bar-combobox`,template:(e,t)=>h6(e,t),styles:(e,t)=>O` ${m6(e,t)} :host{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--neutral-stroke-rest));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not([open])){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host .listbox ::slotted(*:last-child){border-bottom: none}`,shadowOptions:_6},v6)),JVe=class extends T6{}.compose(Object.assign({baseName:`section-navigator`,template:b6,styles:(e,t)=>y6,shadowOptions:E6},D6)),YVe=class extends A6{}.compose(Object.assign({baseName:`segmented-control`,template:(e,t)=>O6(e,t),styles:(e,t)=>O` ${k6(e,t)} :host{font-family: var(--body-font);margin: 0}:host ::slotted(*){transition: color 0.4s ease 0s}:host ::slotted(label){color: var(--neutral-foreground-rest)}:host ::slotted(rapid-segmented-item:first-of-type){border-radius: calc(var(--control-corner-radius) * 1px) 0 0 calc(var(--control-corner-radius) * 1px);border-right-width: 0}:host ::slotted(rapid-segmented-item:last-of-type){border-radius: 0 calc(var(--control-corner-radius) * 1px) calc(var(--control-corner-radius) * 1px) 0;border-left-width: 0}:host ::slotted(rapid-segmented-item:only-of-type){border-radius: calc(var(--control-corner-radius) * 1px);border-left-width: 1px;border-right-width: 1px}:host ::slotted(*[aria-checked='true']){background: var(--neutral-fill-rest);box-shadow: none;color: var(--neutral-foreground-rest)}:host([appearance='primary']) ::slotted(*[aria-checked='true']){background: var(--accent-fill-rest);border-color: transparent;box-shadow: none;color: var(--foreground-on-accent-rest)}`,shadowOptions:void 0},{})),XVe=class extends O3{}.compose(Object.assign({baseName:`segmented-item`,template:(e,t)=>j6(e,t),styles:(e,t)=>O` ${M6(e,t)} :host{color: var(--neutral-fill-strong-rest);font-size: var(--type-ramp-minus-2-font-size);font-weight: 500;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);box-sizing: border-box;height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px);padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);margin: 0}:host([aria-checked='true']){color: color-mix(in srgb, white, transparent 10%)}`,shadowOptions:void 0},{})),ZVe=class extends F6{}.compose(Object.assign({baseName:`select`,template:(e,t)=>N6(e,t),styles:(e,t)=>O` ${P6(e,t)} :host{border-radius: calc(var(--control-corner-radius) * 1px);border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not(.open)){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}.control{padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:active{background: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}.select-indicator{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);transition: all 0.35s;min-width: unset;min-height: unset}.selected-value{display: flex;align-items: center;height: calc(100% - (var(--design-unit) * 1px));padding: 0;margin: 0}:host(:focus-within:not([disabled])) .indicator{background-color: transparent}:host([open]) .select-indicator{transition: all 0.35s;transform: rotate(180deg)}::slotted([role='option']){margin: 0}`,shadowOptions:void 0},I6)),QVe=class extends z6{}.compose(Object.assign({baseName:`skeleton`,template:(e,t)=>L6(e,t),styles:(e,t)=>O` ${R6(e,t)} :host{--skeleton-fill: var( --neutral-fill-stealth-rest );/** value in ux doc rgba(242 242 242 / 0.1) */}`,shadowOptions:void 0},B6)),$Ve=class extends U6{}.compose(Object.assign({baseName:`slider`,template:(e,t)=>V6(e,t),styles:(e,t)=>O` ${H6(e,t)} .thumb-cursor{background: var(--accent-fill-rest);border-radius: calc(var(--control-corner-radius) * 2px)}.thumb-cursor:hover, .thumb-cursor:focus, .thumb-cursor:active{background: var(--accent-fill-rest);border-radius: transparent}:host(:focus-visible) .thumb-cursor{box-shadow: 0 0 0 0}.thumb-cursor:hover::after, .thumb-cursor:focus::after, .thumb-cursor:active::after{content: '';height: calc(var(--thumb-size) * 2px);width: calc(var(--thumb-size) * 2px);border-radius: calc(var(--control-corner-radius) * 4px);position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: -1}.thumb-cursor:hover::after{background-color: color-mix(in srgb, ${Fc}, transparent 90%)}.thumb-cursor:focus::after{background-color: color-mix(in srgb, ${Fc}, transparent 80%)}.thumb-cursor:active::after{background-color: color-mix(in srgb, ${Fc}, transparent 70%)}.track{background-color: var(--neutral-fill-rest)}:host([orientation='horizontal']) .track .track-progress{background-color: var(--neutral-stroke-rest);height: calc((var(--track-width) + 2) * 1px) !important}:host([orientation='vertical']) .track .track-progress{background-color: var(--neutral-stroke-rest);width: calc((var(--track-width) + 2) * 1px) !important}`,shadowOptions:void 0},W6)),eHe=class extends q6{}.compose(Object.assign({baseName:`slider-label`,template:(e,t)=>G6(e,t),styles:(e,t)=>O` ${K6(e,t)} .label{padding: calc((var(--design-unit) - 1) * 2px) calc(var(--design-unit) * 2px);border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-4);background-color: var(--neutral-fill-strong-hover);color: var(--neutral-layer-4);text-align: center;font-size: var(--type-ramp-minus-1-font-size, 12px)}`,shadowOptions:void 0},J6)),R9=O` ${Q6} .snackbar{border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);background-color: var(--neutral-layer-1);padding: calc((var(--design-unit) - 2) * 1px) calc(var(--design-unit) * 4px)}:host([type='error']) .snackbar::after{background-color: var(--error-color)}.content{font-family: var(--body-font);font-size: var(--type-ramp-minus-2-font-size);color: var(--neutral-foreground-rest)}.action{gap: calc(var(--design-unit) * 2px)}`,tHe=T` ${$6(`rapid`)} `,nHe=e8,rHe=class extends t8{}.compose({baseName:`snackbar`,shadowOptions:nHe,styles:R9,template:tHe}),iHe=class extends i8{}.compose({baseName:`stacking-icons`,template:r8,styles:(e,t)=>O` ${n8(e,t)}`}),aHe=class extends u8{}.compose({baseName:`status-pill`,template:o8,styles:a8}),oHe=O` ${R7} :host{font-family: var(--body-font)}:host([orientation='horizontal']){height: 100%}.stepper-tab-panel{border: none;height: auto}:host([orientation='horizontal']) .stepper-tab-panel{height: 100%}.stepper-tab{background-color: var(--neutral-layer-3);border: none}.stepper-panel-container{padding: calc(var(--design-unit) * 4px)}.action-buttons-container{padding: calc(var(--design-unit) * 2px);width: auto;gap: calc(var(--design-unit) * 2px)}.stepper-tab-menu{margin-bottom: calc(var(--design-unit) * 4px)}.stepper-tab-progress{padding: calc(var(--design-unit) * 4px) 0}label{padding: 0 calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}`,sHe=T` ${L7(`rapid`)} `,cHe=class extends z7{}.compose(Object.assign({baseName:`stepper`,template:sHe,styles:oHe,shadowOptions:void 0},B7)),lHe=(e,t)=>O` ${p8(e,t)} rapid-tree-item{--design-unit: 2.5;--neutral-fill-stealth-rest: var(--neutral-layer-3);--neutral-fill-stealth-hover: var(--fill-color);--neutral-fill-rest: var(--fill-color);--base-height-multiplier: 14.5;border-bottom: calc(var(--stroke-width) * 1px) solid var(--fill-color)}.completed-icon{color: var(--success-color)}.tree-item::part(positioning-region)::before{width: var(--tree-item-nested-width)}.stepper-icon{margin-right: calc(var(--design-unit) * 2px)}.error-icon{color: var(--error-color)}.step-number{font-size: var(--type-ramp-minus-1-font-size);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-input-rest)}.step-title{font-size: var(--type-ramp-base-font-size)}.angle-icon{margin: 0 calc(var(--design-unit) * 4px)}:host([completed]) .step-number{border-color: var(--success-color);color: white;background-color: var(--success-color)}:host([completed]) .step-title{color: var(--success-color)}:host([error]) .step-number{border-color: var(--error-color);color: white;background-color: var(--error-color)}:host([error]) .step-title{color: var(--error-color)}`,uHe=T` ${f8(`rapid`)} `,dHe=class extends m8{}.compose(Object.assign({baseName:`stepper-tab`,template:uHe,styles:lHe,shadowOptions:void 0},h8)),fHe=class extends _8{}.compose(Object.assign({baseName:`stepper-tab-panel`,template:(e,t)=>g8(e,t),shadowOptions:void 0},v8)),pHe=class extends x8{}.compose(Object.assign({baseName:`switch`,template:(e,t)=>y8(e,t),styles:(e,t)=>O` ${b8(e,t)} :host{--primary-gradient-angle: -113.5deg}.switch{background: none;border-color: var(--neutral-stroke-rest)}.checked-indicator{background-color: var(--neutral-stroke-rest)}.switch:hover{border-color: var(--neutral-stroke-rest);background: none}:host([aria-checked='true']) .switch{background: none}:host([aria-checked='true']) .checked-indicator{background: var(--accent-fill-rest)}:host([aria-checked='true']:not([disabled])) .switch:hover, :host([aria-checked='true']:not([disabled])) .switch:active{background: none}:host([aria-checked='true']:not([disabled])) .switch:hover .checked-indicator, :host([aria-checked='true']:not([disabled])) .switch:active .checked-indicator{background: var(--accent-fill-rest)}`,shadowOptions:void 0},{switch:`<div class="checked-indicator" part="checked-indicator"></div>`})),mHe=class extends w8{}.compose(Object.assign({baseName:`tab`,template:(e,t)=>S8(e,t),styles:(e,t)=>O` ${C8(e,t)} :host{background-color: var(--neutral-layer-2);border-radius: calc(var(--control-corner-radius) * 2px);box-shadow: 0 0 15px 0 rgb(0 0 0 / 30%);margin-right: calc(var(--design-unit) * 5px);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host([aria-selected='true']), :host([aria-selected='true']:hover){background-color: var(--neutral-layer-4);font-weight: 700}/* * Sustained alert, sampling the flash phase the platform animates on the document. Every * alerting surface reads that one value, so tabs and grid rows brighten and fade together * however long ago each of them started alerting. * * Mixing towards transparent and currentColor lets the tab fade back to its own resting * colours, so selected and unselected tabs each return to the right background. * * !important because a :host rule loses to any app stylesheet that colours tabs from the light * DOM, and an alert nobody can see is worse than no alert. */ :host([alert]){background-color: color-mix( in srgb, var(--tab-alert-color, var(--error-fill-rest)) calc(var(${k0}, 0) * 100%), transparent ) !important;color: color-mix( in srgb, contrast-color(var(--tab-alert-color, var(--error-fill-rest))) calc(var(${k0}, 0) * 100%), currentColor ) !important}/* Reduced motion stops the clock, leaving the phase at 0, so paint a steady alert instead. */ @media (prefers-reduced-motion: reduce){:host([alert]){background-color: var(--tab-alert-color, var(--error-fill-rest)) !important;color: contrast-color(var(--tab-alert-color, var(--error-fill-rest))) !important}}`,shadowOptions:void 0},T8)),hHe=class extends O8{}.compose(Object.assign({baseName:`tab-panel`,template:(e,t)=>E8(e,t),styles:(e,t)=>O` ${D8(e,t)} :host{padding: 0;background-color: var(--neutral-layer-card-container);border-radius: 0 0 var(--card-corner-radius, calc(var(--control-corner-radius) * 1.5px)) var(--card-corner-radius, calc(var(--control-corner-radius) * 1.5px));border-style: solid;border-width: var(--tabs-border-width, 1px);border-color: var(--tabs-border-color, var(--neutral-stroke-rest))}`,shadowOptions:void 0},k8)),gHe=class extends M8{}.compose(Object.assign({baseName:`tabs`,template:(e,t)=>A8(e,t),styles:(e,t)=>O` ${j8(e,t)} :host{background: var(--neutral-layer-3);border-radius: calc(var(--control-corner-radius) * 1px)}:host(:not([appearance='secondary'])){background: var(--rapid-layout-item-background, var(--neutral-layer-3));border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));border: var(--card-border, 0)}:host([appearance='secondary']){background: transparent}:host .tablist{padding: 0;display: grid;width: max-content;margin-top: 0}:host .tabpanel{height: 100%;min-height: 0}:host([appearance='secondary']) .tablist{margin-bottom: 0}:host .end, :host .start{padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);height: calc(100% - 1px);display: flex;align-items: center}::slotted([slot='tab']:hover){color: var(--neutral-foreground-rest);background: var(--neutral-layer-1)}::slotted([role='tab']){border-radius: calc(var(--control-corner-radius) * 1.5px) calc(var(--control-corner-radius) * 1.5px) 0 0;background: var(--tab-rest-background-color, var(--neutral-layer-4));padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);margin-right: 2px;box-shadow: none;font-size: var(--type-ramp-minus-1-font-size);border-style: solid;border-width: var(--tab-rest-border-width, 1px);border-color: var(--tab-rest-border-color, transparent)}::slotted([role='tab'][aria-selected='true']:not([appearance='secondary'])){border-style: solid;border-width: var(--tab-active-border-width, 1px 1px 0 1px);border-color: var(--tab-active-border-color, var(--neutral-stroke-rest));background: var(--tab-active-background-color, var(--neutral-layer-card-container))}::slotted([role='tab'][aria-selected='true']){color: var(--accent-foreground-rest);background: var(--neutral-layer-card-container)}/* stylelint-disable selector-class-pattern */ .activeIndicator{display: none}:host([appearance='secondary']) .tablist .activeIndicator{display: block;height: 1px;margin-top: unset}::slotted([role='tab'][aria-selected='true'][appearance='secondary']){background: none}::slotted([role='tab'][appearance='secondary']){margin-left: 0;box-shadow: none;background: none}:host([appearance='secondary']:hover){color: var(--neutral-foreground-rest);background: none}:host([appearance='secondary']) ::slotted([role='tabpanel']){border: 0}`,shadowOptions:void 0},N8)),_He=class extends I8{}.compose(Object.assign({baseName:`text-area`,template:(e,t)=>P8(e,t),styles:(e,t)=>O` ${F8(e,t)} :host{display: grid;flex: 1 1 auto;box-sizing: border-box}:host .control{height: 100%;border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px);padding: calc(var(--design-unit) * 2px)}:host(:hover:not([disabled])) .control{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host(:is(:focus, :focus-within, :focus-visible):not([disabled])) .control{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}`,shadowOptions:void 0},L8)),vHe=class extends B8{}.compose(Object.assign({baseName:`text-field`,template:(e,t)=>R8(e,t),styles:(e,t)=>O` ${z8(e,t)} :host{display: block;flex: 1 1 auto;box-sizing: border-box}:host .control{height: 100%;border-radius: calc(var(--control-corner-radius) * 1px);padding: 0 calc(var(--design-unit) * 2px)}:host .control-field .control{width: 100%}:host .root{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:hover:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover);box-shadow: none}:host(:is(:focus, :focus-within, :focus-visible):not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{margin: 0}:host input::placeholder{color: var(--neutral-foreground-hint);opacity: 75%}`,shadowOptions:V8},H8)),yHe=O` ${U8} .toast{background-color: ${Tc};border-radius: calc(var(--control-corner-radius) * 2px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}.top{align-items: flex-start}:host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height);color: var(--neutral-foreground-rest)}.content{font-size: var(--type-ramp-minus-1-font-size)}.date{margin: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 0) calc(var(--design-unit) * 1px)}.content-wrapper{padding: calc(var(--design-unit) * 2px)}.toast::after{background-color: var(--accent-fill-rest);border-radius: 0;height: calc(100% - calc(var(--design-unit) * 5px));margin: calc(var(--design-unit) * 0) calc(var(--design-unit) * 1px)}:host([notify='warning']) .toast::after{background-color: var(--warning-color)}:host([notify='success']) .toast::after{background-color: var(--success-color)}:host([notify='critical']) .toast::after, :host([notify='serious']) .toast::after, :host([notify='error']) .toast::after{background-color: var(--error-color)}`,bHe=K8,xHe=G8,SHe=class extends q8{}.compose(Object.assign({baseName:`toast`,shadowOptions:xHe,styles:yHe,template:W8},bHe)),CHe=class extends X8{}.compose(Object.assign({baseName:`toolbar`,template:(e,t)=>J8(e,t),styles:(e,t)=>O` ${Y8(e,t)} :host{align-items: center;color: var(--neutral-foreground-rest)}.positioning-region{align-items: center}`,shadowOptions:void 0},Z8)),wHe=class extends e5{}.compose(Object.assign({baseName:`tooltip`,template:(e,t)=>Q8(e,t),styles:(e,t)=>O` ${$8(e,t)} :host{visibility: visible}.tooltip{padding: calc((var(--design-unit) - 1) * 2px) calc(var(--design-unit) * 2px);text-align: center;white-space: inherit;font-weight: 400}rapid-anchored-region.bottom .tooltip{margin-top: calc(var(--design-unit) * 1px);margin-left: calc(var(--design-unit) * 2px)}rapid-anchored-region.top.right .tooltip, rapid-anchored-region.bottom.right .tooltip{margin-left: 0}`,shadowOptions:void 0},t5)),THe=class extends i5{}.compose(Object.assign({baseName:`tree-item`,template:(e,t)=>n5(e,t),styles:(e,t)=>O` ${r5(e,t)} :host{font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-rest);background-color: transparent}:host(.nested) .expand-collapse-button{background: var(--neutral-fill-rest);border-radius: calc(var(--control-corner-radius) * 1px);width: calc(var(--design-unit) * 5px);height: calc(var(--design-unit) * 5px);margin-left: calc(var(--design-unit) * 2px)}:host([selected]) .positioning-region{background: var(--neutral-fill-stealth-active)}.positioning-region::before{width: calc(var(--design-unit) * 1px)}:host([selected])::after{background: var(--accent-fill-rest);background-origin: border-box;background-size: cover;background-repeat: no-repeat}:host([slot='item']) .content-region{margin-inline-start: calc(var(--design-unit) * 4px + var(--expand-collapse-button-size))}.expand-collapse-glyph{width: calc(var(--design-unit) * 3px);height: calc(var(--design-unit) * 3px)}`,shadowOptions:void 0},{expandCollapseGlyph:`
|
|
1001
|
+
Delete Rule </${t}></div></div></div>`}} `,q5=class extends Qe{constructor(){super(...arguments),this.error=!1}connectedCallback(){super.connectedCallback(),I5(this,this.styles,`rule`),this.config.partialRuleValidationWarning&&(this.error=FFe(this.model))}variadicRule(e){return e.operator.nbInputs===`many`&&`value`in e&&Array.isArray(e.value)}get operandIterator(){if(this.model.operator?.nbInputs===`many`){if(!this.variadicRule(this.model))throw Error(`Varargs disabled for many nbInputs`);return Array(this.model.value.length).fill(!0)}return Array(this.model.operator?.nbInputs??0).fill(!0)}operandValue(e){if(this.model.operator){if(this.model.operator.nbInputs===1&&`value`in this.model)return this.model.value;if((this.model.operator.nbInputs===2||this.model.operator.nbInputs===`many`)&&`value`in this.model&&Array.isArray(this.model.value))return this.model.value[e];throw Error(`Invalid operand lookup`)}}dispatchAddVarArg(){if(!this.variadicRule(this.model))throw Error(`Cannot add inputs for non-variadic operator, or invalid format`);let e={ruleId:this.model.ruleId,newData:{operator:this.model.operator,field:this.model.field,value:[...this.model.value,K5(this.model.operator,this.model)]}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:e,bubbles:!0,composed:!0}))}handleRemoveVarArg(e){let{index:t}=e.detail;if(!this.variadicRule(this.model))throw Error(`Cannot remove inputs for non-variadic operator, or invalid format`);let n={ruleId:this.model.ruleId,newData:{operator:this.model.operator,field:this.model.field,value:this.model.value.filter((e,n)=>n!==t)}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:n,bubbles:!0,composed:!0}))}dispatchDeleteRule(e){e.stopPropagation();let t={ruleId:this.model.ruleId};this.dispatchEvent(new CustomEvent(L5.DelRule,{detail:t,bubbles:!0,composed:!0}))}handleFieldSelected(e){e.stopPropagation();let{fieldId:t}=e.detail,n=this.config.fields.find(e=>e.fieldId===t)??null,r={ruleId:this.model.ruleId,newData:{field:n,value:null,operator:null}};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:r,bubbles:!0,composed:!0}))}handleValueChanged(e){e.stopPropagation();let{value:t,index:n}=e.detail,r={ruleId:this.model.ruleId,newData:NFe(this.model,t,n)};this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:r,bubbles:!0,composed:!0}))}handleOperatorSelected(e){e.stopPropagation();let{operatorId:t}=e.detail;if(!t)return;let n=this.config.operators.find(e=>e.type===t)??null;if(!n)throw Error(`Unable to find operator of type ${t}`);this.dispatchEvent(new CustomEvent(L5.UpdateRule,{detail:{ruleId:this.model.ruleId,newData:MFe(n,this.model)},bubbles:!0,composed:!0}))}};q([C],q5.prototype,`config`,void 0),q([C],q5.prototype,`styles`,void 0),q([C],q5.prototype,`model`,void 0),q([C],q5.prototype,`index`,void 0),q([D({mode:`boolean`})],q5.prototype,`error`,void 0),q([w],q5.prototype,`operandIterator`,null),q5=q([$e({name:`expression-rule`,template:LFe,styles:IFe,shadowOptions:{delegatesFocus:!0}})],q5);let J5=class extends Qe{constructor(){super(...arguments),this.model=null,this.ruleCount=0,this.groupCount=0,this.userUpdatingModel=!1,this.handleAddGroup=this._handleAddGroup.bind(this),this.handleAddRule=this._handleAddRule.bind(this),this.handleDeleteGroup=this._handleDeleteGroup.bind(this),this.handleDeleteRule=this._handleDeleteRule.bind(this),this.handleUpdateGroupData=this._handleUpdateGroupData.bind(this),this.handleUpdateRuleData=this._handleUpdateRuleData.bind(this)}configChanged(e,t){if(!this.isValidConfig(t)){console.warn(`Invalid config passed to ExpressionBuilder. Verify you've defined operators, fields, and combinators.`);return}t.model?(this.ruleCount=0,this.groupCount=0,this.userUpdatingModel=!0,this.model=hFe(t.model,this),this.userUpdatingModel=!1):this.model===null&&this.initBaseModel()}modelChanged(e,t){if(!t||this.userUpdatingModel)return;let n=A5(t);this.dispatchChangeEvent(n)}dispatchChangeEvent(e){this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,cancelable:!0,composed:!0}))}getConfig(){return this.config}getGroupId(){return this.groupCount+=1,`group-${this.groupCount}`}getRuleId(){return this.ruleCount+=1,`rule-${this.ruleCount}`}connectedCallback(){if(super.connectedCallback(),this.addEventListener(L5.AddGroup,this.handleAddGroup),this.addEventListener(L5.DelGroup,this.handleDeleteGroup),this.addEventListener(L5.AddRule,this.handleAddRule),this.addEventListener(L5.DelRule,this.handleDeleteRule),this.addEventListener(L5.UpdateGroup,this.handleUpdateGroupData),this.addEventListener(L5.UpdateRule,this.handleUpdateRuleData),!this.isValidConfig(this.config)){this.config&&console.warn(`Config detected during connectedCallback but it isn't valid`),this.config=null;return}this.config.model||this.initBaseModel()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(L5.AddGroup,this.handleAddGroup),this.removeEventListener(L5.DelGroup,this.handleDeleteGroup),this.removeEventListener(L5.AddRule,this.handleAddRule),this.removeEventListener(L5.DelRule,this.handleDeleteRule),this.removeEventListener(L5.UpdateGroup,this.handleUpdateGroupData),this.removeEventListener(L5.UpdateRule,this.handleUpdateRuleData)}isValidConfig(e){return!!(e&&e.combinators?.length&&e.operators?.length&&e.fields?.length)}initBaseModel(){if(!this.isValidConfig(this.config))throw Error(`Invalid config set on ExpressionBuilder. Verify you've defined operators, fields, and combinators.`);this.model={children:[],level:1,groupId:k5,config:this.config,combinator:this.config.combinators[0]}}_handleAddGroup(e){let{parentGroupId:t,newGroup:n}=e.detail,r={groupId:this.getGroupId(),level:n.level,children:[],config:this.config,combinator:this.config.combinators[0]};this.model=O5(this.model,t,r)}_handleAddRule(e){let{parentGroupId:t}=e.detail,n={ruleId:this.getRuleId(),config:this.config,field:null,operator:null,value:null};this.model=O5(this.model,t,n)}_handleDeleteGroup(e){let{groupId:t}=e.detail;this.model=dFe(this.model,t)}_handleDeleteRule(e){let{ruleId:t}=e.detail;this.model=fFe(this.model,t)}_handleUpdateGroupData(e){let{groupId:t,newData:n}=e.detail;this.model=pFe(this.model,t,n)}_handleUpdateRuleData(e){let{ruleId:t,newData:n}=e.detail;this.model=mFe(this.model,t,n)}};q([C],J5.prototype,`config`,void 0),q([C],J5.prototype,`styles`,void 0),q([C],J5.prototype,`model`,void 0),J5=q([$e({name:`expression-builder`,template:B5,styles:R5})],J5);let Y5=class extends J5{};Y5=q([$e({name:`foundation-expression-builder`,styles:R5,template:B5})],Y5);let X5=[`int`,`short`,`long`],Z5=[`double`,`bigdecimal`],Q5=[...X5,...Z5],$5=[`date`,`date-time`],e7=[`string`,`enum`],t7=[`boolean`],n7=e=>e.operator?.valueType?.type??e.field.type;function r7(e){switch(n7(e)){case`int`:case`long`:case`double`:case`bigdecimal`:case`date`:case`date-time`:case`short`:return`NUMBER`;case`string`:case`enum`:return`STRING`;case`boolean`:return`BOOLEAN`}}function i7(e,t,n){return`value`in e?{TYPE:`BINARY_EXPRESSION`,LEFT:{TYPE:`FIELD`,NAME:e.field.fieldId},OPERATION:t,RIGHT:{TYPE:n,VALUE:e.value}}:null}function a7(e,t,n){return{TYPE:`BINARY_EXPRESSION`,LEFT:{TYPE:`FIELD`,NAME:e.field.fieldId},OPERATION:t,RIGHT:n}}function o7(e,t,n=[]){return`value`in e?{TYPE:`METHOD_EXPRESSION`,PARAMETERS:[{TYPE:`FIELD`,NAME:e.field.fieldId},...n],METHOD:t}:null}function s7(e){let t=t=>{let n=n7(e);if(e7.includes(n))return t;if(Q5.includes(n))return t.toString();if(t7.includes(n))return t;if(Array.isArray(t))throw Error(`Not implemented TernararyOperator or VariadicOperator args in rule value transformer`);if($5.includes(n))return new Date(t).getTime().toString();throw Error(`Unhandled transformRuleValue case`)},n=!(!(`value`in e)||e.value===void 0||e.value===null);return Object.assign(Object.assign({},e),n?{value:t(e.value)}:{})}function c7(e,t){return{TYPE:`PREDICATE_EXPRESSION`,OPERATION:e.combinator.type,EXPRESSIONS:e.children.map(e=>`children`in e?c7(e,t):t(e)).filter(Boolean)}}function l7(e,t){let n=t=>{let n=n7(e);if(e7.includes(n))return t;if(X5.includes(n))return parseInt(t);if(Z5.includes(n))return parseFloat(t);if(t7.includes(n))return t;if($5.includes(n)){let e=new Date(parseInt(t));return n===`date`?j5(e):M5(e)}throw Error(`Unhandled rebuildRuleValue case`)},r=e.operator.nbInputs;if(r===`many`||r===2)throw Error(`Not implemented TernararyOperator or VariadicOperator args in rebuildRuleValue`);return Object.assign(Object.assign({},e),r===0?{}:{value:n(t.VALUE)})}let u7={template:B5,styles:R5};var d7;(function(e){e.methodCall={CONTAINS_IGNORE_CASE:`CONTAINS_IGNORE_CASE`,CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE:`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`,IS_NULL_OR_BLANK:`IS_NULL_OR_BLANK`,NOT_NULL_OR_BLANK:`NOT_NULL_OR_BLANK`,TRIM:`TRIM`,LONG_TO_DATE:`LONG_TO_DATE`,LONG_TO_DATE_TIME:`LONG_TO_DATE_TIME`,DATE_TIME_IS_IN_RANGE:`DATE_TIME_IS_IN_RANGE`},e.logicalOperations={AND:`AND`,OR:`OR`},e.operations=Object.assign(Object.assign({},e.logicalOperations),{GREATER_THAN:`GREATER_THAN`,LESS_THAN:`LESS_THAN`,GREATER_THAN_OR_EQUAL:`GREATER_THAN_OR_EQUAL`,LESS_THAN_OR_EQUAL:`LESS_THAN_OR_EQUAL`,EQUALS:`EQUALS`,NOT_EQUALS:`NOT_EQUALS`,PLUS:`PLUS`,MINUS:`MINUS`,MULTIPLY:`MULTIPLY`,DIVIDE:`DIVIDE`,BITWISE_AND:`BITWISE_AND`,BITWISE_OR:`BITWISE_OR`,ASSIGNMENT:`ASSIGNMENT`,IS_CURRENT:`IS_CURRENT`,IS_PREVIOUS:`IS_PREVIOUS`})})(d7||(d7={}));let f7=[{type:d7.logicalOperations.AND,maxRules:`many`},{type:d7.logicalOperations.OR,maxRules:`many`}],$={EQUALS:d7.operations.EQUALS,NOT_EQUALS:d7.operations.NOT_EQUALS,IS_NULL:`IS_NULL`,NOT_NULL:`NOT_NULL`,IS_NULL_OR_BLANK:`IS_NULL_OR_BLANK`,NOT_NULL_OR_BLANK:`NOT_NULL_OR_BLANK`,CONTAINS:`CONTAINS`,CONTAINS_WORDS_STARTING_WITH:`CONTAINS_WORDS_STARTING_WITH`,CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:`CONTAINS_WORDS_STARTING_SPLIT_DELIMITER`,GREATER_THAN:d7.operations.GREATER_THAN,GREATER_THAN_OR_EQUAL:d7.operations.GREATER_THAN_OR_EQUAL,LESS_THAN:d7.operations.LESS_THAN,LESS_THAN_OR_EQUAL:d7.operations.LESS_THAN_OR_EQUAL,IS_BEFORE:`IS_BEFORE`,IS_AFTER:`IS_AFTER`,ON_OR_BEFORE:`ON_OR_BEFORE`,ON_OR_AFTER:`ON_OR_AFTER`,IS_CURRENT:d7.operations.IS_CURRENT,IS_PREVIOUS:d7.operations.IS_PREVIOUS},p7=e=>({type:`enum`,input:`select`,values:e}),RFe=p7({HOUR:{label:`Hour`,tooltip:`Beginning of the hour immediately preceding the current one to the current hour.`},DAY:{label:`Day`,tooltip:`Midnight on the day before today to midnight of the current day.`},WEEK_DAY:{label:`Week day`,tooltip:`Midnight on the day before today to midnight of the current day. If the current day is Monday then the previous day is Friday.`},WEEK:{label:`Week`,tooltip:`Midnight on the Monday of the previous week to midnight on the Monday of the current week.`},MONTH:{label:`Month`,tooltip:`Midnight on the 1st of the previous month to midnight on the 1st of the current month.`},YEAR:{label:`Year`,tooltip:`Midnight on Jan 1st of the previous year to midnight on the 1st Jan of the current year.`}}),zFe=p7({HOUR:{label:`Hour`,tooltip:`Beginning of the current hour to beginning of the next hour.`},DAY:{label:`Day`,tooltip:`Midnight on the current day day to midnight of the next day.`},WEEK_DAY:{label:`Week day`,tooltip:`Midnight on the current day day to midnight of the next day. This filter will never match Sat or Sun, always returning false on the weekends.`},WEEK:{label:`Week`,tooltip:`Midnight on the Monday of the current week to midnight on the Monday of the next week.`},MONTH:{label:`Month`,tooltip:`Midnight on the 1st of the current month to midnight on the 1st of the next month.`},YEAR:{label:`Year`,tooltip:`Midnight on Jan 1st of the current year to midnight on the 1st Jan of the next year.`}}),m7=[{type:$.EQUALS,label:`Equals`,nbInputs:1,applyTo:[...e7,...t7,...Q5,...$5],tooltip:`Check the equality of the field compared to a set value`},{type:$.NOT_EQUALS,label:`Not equals`,nbInputs:1,applyTo:[...e7,...t7,...Q5,...$5],tooltip:`Check that the field is different from a set value`},{type:$.IS_NULL,label:`Is null`,nbInputs:0,applyTo:[`enum`,...t7,...Q5,...$5],tooltip:`Check if the field value is null`},{type:$.NOT_NULL,label:`Not null`,nbInputs:0,applyTo:[`enum`,...t7,...Q5,...$5],tooltip:`Check if the field value is not null`},{type:$.IS_NULL_OR_BLANK,label:`Is null or blank`,nbInputs:0,applyTo:[`string`],tooltip:`Check if the field value is null or an empty string`},{type:$.NOT_NULL_OR_BLANK,label:`Not null or blank`,nbInputs:0,applyTo:[`string`],tooltip:`Check if the field value is not null and not an empty string`},{type:$.CONTAINS,label:`Contains`,nbInputs:1,applyTo:[`string`],tooltip:`Check if the field contains the specified text (case insensitive)`},{type:$.CONTAINS_WORDS_STARTING_WITH,label:`Contains words starting with`,nbInputs:1,applyTo:[`string`],tooltip:`Check if the field contains words that start with the specified text, split by whitespace (case insensitive)`},{type:$.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER,label:`Contains words starting with (split)`,nbInputs:2,applyTo:[`string`],tooltip:`Check if field contains words starting with text, split by a delimiter (case insensitive)`},{type:$.GREATER_THAN,label:`Greater than`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is greater than a specified number`},{type:$.GREATER_THAN_OR_EQUAL,label:`Greater than or equal to`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is greater than or equal to a specified number`},{type:$.LESS_THAN,label:`Less than`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is less than a specified number`},{type:$.LESS_THAN_OR_EQUAL,label:`Less than or equal to`,nbInputs:1,applyTo:[...Q5],tooltip:`Check if the field value is less than or equal to a specified number`},{type:$.IS_BEFORE,label:`Is before`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is before a specified date/time`},{type:$.IS_AFTER,label:`Is after`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is after a specified date/time`},{type:$.ON_OR_BEFORE,label:`On or before`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is on or before a specified date/time`},{type:$.ON_OR_AFTER,label:`On or after`,nbInputs:1,applyTo:[...$5],tooltip:`Check if the field is on or after a specified date/time`},{type:$.IS_CURRENT,label:`Is current`,nbInputs:1,applyTo:[...$5],tooltip:`Check whether the current date/time matches the current hour/day/work day/week/month/year.`,valueType:zFe,optgroup:`Relative Period`},{type:$.IS_PREVIOUS,label:`Is previous`,nbInputs:1,applyTo:[...$5],tooltip:`Check whether the current date/time matches the previous hour/day/work day/week/month/year`,valueType:RFe,optgroup:`Relative Period`}];function BFe(e){switch(e){case`IS_BEFORE`:return`LESS_THAN`;case`IS_AFTER`:return`GREATER_THAN`;case`ON_OR_BEFORE`:return`LESS_THAN_OR_EQUAL`;case`ON_OR_AFTER`:return`GREATER_THAN_OR_EQUAL`;default:return e}}function VFe(e,t){switch(t){case $.IS_NULL_OR_BLANK:return o7(e,d7.methodCall.IS_NULL_OR_BLANK,[]);case $.NOT_NULL_OR_BLANK:return o7(e,d7.methodCall.NOT_NULL_OR_BLANK,[]);case $.CONTAINS:if(!(`value`in e))throw Error(`Invalid shape for operator CONTAINS`);return o7(e,d7.methodCall.CONTAINS_IGNORE_CASE,[{TYPE:`STRING`,VALUE:e.value}]);case $.CONTAINS_WORDS_STARTING_WITH:if(!(`value`in e))throw Error(`Invalid shape for operator CONTAINS_WORDS_STARTING_WITH`);return o7(e,d7.methodCall.CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE,[{TYPE:`STRING`,VALUE:e.value}]);case $.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:if(!(`value`in e)||!Array.isArray(e.value)||e.value.length!==2)throw Error(`Invalid shape for CONTAINS_WORDS_STARTING_SPLIT_DELIMITER`);return o7(e,d7.methodCall.CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE,e.value.map(e=>({TYPE:`STRING`,VALUE:e})));case $.IS_CURRENT:case $.IS_PREVIOUS:if(!(`value`in e))throw Error(`Invalid shape for operator IS_CURRENT | IS_PREVIOUS`);return o7(e,d7.methodCall.DATE_TIME_IS_IN_RANGE,[{TYPE:`STRING`,VALUE:e.value},{TYPE:`STRING`,VALUE:t===$.IS_CURRENT?`CURRENT`:`PREVIOUS`}]);default:throw Error(`Unreachable default case`)}}function HFe(e){if(!(e.operator?.type&&e.field?.fieldId))return null;let t=s7(e),n=r7(t),r=BFe(t.operator.type);switch(r){case $.EQUALS:case $.NOT_EQUALS:case $.GREATER_THAN:case $.GREATER_THAN_OR_EQUAL:case $.LESS_THAN:case $.LESS_THAN_OR_EQUAL:return i7(t,r,n);case $.IS_NULL:return a7(t,d7.operations.EQUALS,{TYPE:`NULL`});case $.NOT_NULL:return a7(t,d7.operations.NOT_EQUALS,{TYPE:`NULL`});case $.IS_NULL_OR_BLANK:case $.NOT_NULL_OR_BLANK:case $.CONTAINS:case $.CONTAINS_WORDS_STARTING_WITH:case $.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER:case $.IS_CURRENT:case $.IS_PREVIOUS:return VFe(t,r);default:throw Error(`Unmatched case for operator name: ${r}`)}}function UFe(e,t){if(t.field.type!==`date`&&t.field.type!==`date-time`)return e;switch(e){case`LESS_THAN`:return`IS_BEFORE`;case`GREATER_THAN`:return`IS_AFTER`;case`LESS_THAN_OR_EQUAL`:return`ON_OR_BEFORE`;case`GREATER_THAN_OR_EQUAL`:return`ON_OR_AFTER`;default:return e}}function WFe(e,t){let n=(()=>{if(t.RIGHT.TYPE===`NULL`){let e=t.OPERATION===`EQUALS`?$[$.IS_NULL]:$[$.NOT_NULL];return m7.find(t=>t.type===e)}let n=UFe(t.OPERATION,e);return m7.find(e=>e.type===n)})();return Object.assign(Object.assign({},e),{operator:n})}function GFe(e,t){if(t.LEFT.TYPE!==`FIELD`)throw Error(`BinaryExpression LHS must be TYPE === FIELD`);if(![`STRING`,`NUMBER`,`BOOLEAN`,`NULL`].includes(t.RIGHT.TYPE))throw Error(`BinaryExpression RHS must be TYPE === NUMBER | STRING | BOOLEAN | NULL`);return l7(WFe({field:e.find(e=>e.fieldId===t.LEFT.NAME)},t),t.RIGHT)}function KFe(e,t){let[n,r]=(()=>{switch(!0){case t.METHOD===`IS_NULL_OR_BLANK`:return[$[$.IS_NULL_OR_BLANK],void 0];case t.METHOD===`NOT_NULL_OR_BLANK`:return[$[$.NOT_NULL_OR_BLANK],void 0];case t.METHOD===`CONTAINS_IGNORE_CASE`:return[$[$.CONTAINS],t.PARAMETERS[1].VALUE];case t.METHOD===`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`&&t.PARAMETERS.length===2:return[$[$.CONTAINS_WORDS_STARTING_WITH],t.PARAMETERS[1].VALUE];case t.METHOD===`CONTAINS_WORDS_STARTING_WITH_IGNORE_CASE`&&t.PARAMETERS.length===3:return[$[$.CONTAINS_WORDS_STARTING_SPLIT_DELIMITER],t.PARAMETERS.slice(1).map(e=>e.VALUE)];case t.METHOD===d7.methodCall.DATE_TIME_IS_IN_RANGE&&t.PARAMETERS.length===3&&t.PARAMETERS[2].TYPE===`STRING`&&(t.PARAMETERS[2].VALUE===`CURRENT`||t.PARAMETERS[2].VALUE===`PREVIOUS`):return[$[t.PARAMETERS[2].VALUE===`CURRENT`?$.IS_CURRENT:$.IS_PREVIOUS],t.PARAMETERS[1].VALUE];default:throw Error(`Unhandled fromMethodExpression case`)}})();return{field:e.find(e=>e.fieldId===t.PARAMETERS[0].NAME),operator:m7.find(e=>e.type===n),value:r}}function h7(e,t){return{combinator:f7.find(e=>e.type===t.OPERATION),children:t.EXPRESSIONS.map(t=>{if(!(`TYPE`in t))throw Error(`RuleExpression format not yet supported - no TYPE`);if(t.TYPE===`PREDICATE_EXPRESSION`)return h7(e,t);if(t.TYPE===`BINARY_EXPRESSION`)return GFe(e,t);if(t.TYPE===`METHOD_EXPRESSION`)return KFe(e,t);throw Error(`RuleExpression format not yet supported - unsupported TYPE`)})}}let g7=class extends J5{ruleConfigChanged(e,t){this.config=Object.assign({combinators:f7,operators:m7,fields:t.fields,maxNesting:t.maxNesting,partialRuleValidationWarning:t.partialRuleValidationWarning},t?.model?{model:h7(t.fields,t.model)}:{})}configChanged(e,t){if(t!==null){if(!t.operators||!t.combinators)throw Error(`Unable to detect operators or combinators. Did you set the config on the rule builder via the config property? Use the ruleConfig property instead`);super.configChanged(e,t)}}dispatchChangeEvent(e){let t=c7(e,HFe);this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,cancelable:!0,composed:!0}))}};q([C],g7.prototype,`ruleConfig`,void 0),g7=q([$e({name:`foundation-rule-expression-builder`,styles:R5,template:B5})],g7);let _7={TRIM:`TRIM`,PLUS:`PLUS`,MINUS:`MINUS`,MULTIPLY:`MULTIPLY`,DIVIDE:`DIVIDE`,CONVERT_TO_DATE:`CONVERT_TO_DATE`,CONVERT_TO_DATE_TIME:`CONVERT_TO_DATE_TIME`},v7=[{type:_7.PLUS,label:`Add (+)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically added to the specified rule value. FIELD + VALUE`},{type:_7.MINUS,label:`Subtract (-)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically subtracted by the specified rule value. FIELD - VALUE`},{type:_7.MULTIPLY,label:`Multiply (*)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically multiplied by the specified rule value. FIELD * VALUE`},{type:_7.DIVIDE,label:`Divide (/)`,applyTo:[...Q5],nbInputs:1,tooltip:`Returns the result of the field value mathematically divided by the specified rule value. FIELD / VALUE`},{type:_7.CONVERT_TO_DATE,label:`Convert to date`,applyTo:[`date`],nbInputs:0,tooltip:`Returns the date, which is stored as the epoch time, as a formatted date YYYY/dd/mm`},{type:_7.CONVERT_TO_DATE_TIME,label:`Convert to date time`,applyTo:[`date-time`],nbInputs:0,tooltip:`Returns the date-time, which is stored as the epoch time, as a formatted date YYYY/dd/mm HH:mm:ss`}];function qFe(e){return e}function JFe(e,t){switch(t){case _7.TRIM:return o7(e,d7.methodCall.TRIM,[]);case _7.CONVERT_TO_DATE:return o7(e,d7.methodCall.LONG_TO_DATE,[]);case _7.CONVERT_TO_DATE_TIME:return o7(e,d7.methodCall.LONG_TO_DATE_TIME,[])}}function YFe(e){if(!(e.operator?.type&&e.field?.fieldId))return null;let t=s7(e),n=r7(t),r=qFe(t.operator.type);switch(r){case _7.TRIM:case _7.CONVERT_TO_DATE:case _7.CONVERT_TO_DATE_TIME:return JFe(t,r);case _7.PLUS:case _7.MINUS:case _7.DIVIDE:case _7.MULTIPLY:return i7(t,r,n);default:throw Error(`Unmatched case for operator name: ${r}`)}}function XFe(e,t){return t.field.type!==`date`&&t.field.type,e}function ZFe(e,t){let n=(()=>{let n=XFe(t.OPERATION,e);return v7.find(e=>e.type===n)})();return Object.assign(Object.assign({},e),{operator:n})}function QFe(e,t){if(t.LEFT.TYPE!==`FIELD`)throw Error(`BinaryExpression LHS must be TYPE === FIELD`);if(![`STRING`,`NUMBER`,`BOOLEAN`,`NULL`].includes(t.RIGHT.TYPE))throw Error(`BinaryExpression RHS must be TYPE === NUMBER | STRING | BOOLEAN | NULL`);return l7(ZFe({field:e.find(e=>e.fieldId===t.LEFT.NAME)},t),t.RIGHT)}function $Fe(e,t){let[n,r]=(()=>{switch(!0){case t.METHOD===`TRIM`:return[_7[_7.TRIM],void 0];case t.METHOD===`LONG_TO_DATE`:return[_7[_7.CONVERT_TO_DATE],void 0];case t.METHOD===`LONG_TO_DATE_TIME`:return[_7[_7.CONVERT_TO_DATE_TIME],void 0];default:throw Error(`Unhandled fromMethodExpression case`)}})();return{field:e.find(e=>e.fieldId===t.PARAMETERS[0].NAME),operator:v7.find(e=>e.type===n),value:r}}function y7(e,t){return{combinator:b5,children:t.EXPRESSIONS.map(t=>{if(!(`TYPE`in t))throw Error(`RuleExpression format not yet supported - no TYPE`);if(t.TYPE===`PREDICATE_EXPRESSION`)return y7(e,t);if(t.TYPE===`BINARY_EXPRESSION`)return QFe(e,t);if(t.TYPE===`METHOD_EXPRESSION`)return $Fe(e,t);throw Error(`RuleExpression format not yet supported - unsupported TYPE`)})}}let b7=class extends J5{valueConfigChanged(e,t){let n={TYPE:`PREDICATE_EXPRESSION`,OPERATION:`NULL`,EXPRESSIONS:t.model?[t.model]:[]},r=y7(t.fields,n);this.config={combinators:[b5],operators:v7,fields:t.fields,model:r,maxNesting:t.maxNesting,partialRuleValidationWarning:t.partialRuleValidationWarning}}configChanged(e,t){if(t!==null){if(!t.operators||!t.combinators)throw Error(`Unable to detect operators or combinators. Did you set the config on the rule builder via the config property? Use the valueConfig property instead`);super.configChanged(e,t)}}dispatchChangeEvent(e){if(!(`children`in e))throw Error(`Invalid top level group hierarchy`);if(e.children.length>1)throw Error(`Value expressions should not have multiple rules`);if(e.children[0]&&`children`in e.children[0])throw Error(`Trying to convert group to rule`);let t=e.children.length===0?void 0:YFe(e.children[0]);this.dispatchEvent(new CustomEvent(`change`,{detail:t,bubbles:!0,cancelable:!0,composed:!0}))}};q([C],b7.prototype,`valueConfig`,void 0),b7=q([$e({name:`foundation-value-expression-builder`,styles:R5,template:B5})],b7);let x7=T`<template ${k(`notificationListener`)}><slot></slot></template>`,eIe={mode:`open`,delegatesFocus:!0};var S7=class extends P{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[],this.reconnections=0,this.reconnection=Promise.resolve(),this.reconnectionWaitMs=1e4}connectedCallback(){let e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});return J(this,void 0,void 0,function*(){e.connectedCallback.call(this),this.addEventListener(US.NOTIFICATION_EVENT,e=>{e.stopImmediatePropagation(),ZS(e.detail,this.tagName,this.notificationListener)}),this.connectionSub=this.connect.isConnected$.subscribe(e=>{if(!e)return;let t=this.reconnections+=1;this.reconnection=tIe(this.reconnection,this.reconnectionWaitMs).then(()=>this.handleReconnection(t)).catch(e=>Ly.error(e))})})}handleReconnection(e){return J(this,void 0,void 0,function*(){var t;let n=()=>e===this.reconnections&&this.isConnected;if(!this.resourceName||!n())return;(t=this.dataSub)==null||t.unsubscribe(),this.dataSub=void 0;let r=yield this.initializeDatasource();if(n()){if(!r)throw Error(`Failed to initialize datasource for ${this.resourceName}`);this.setupDataSubscription()}})}initializeDatasource(){return J(this,void 0,void 0,function*(){return this.datasource?.initialized&&this.datasource.destroy(),this.datasource.init({resourceName:this.resourceName},!0)})}setupDataSubscription(){if(!this.datasource.stream){Ly.warn(`No stream available for ${this.resourceName}`);return}this.dataSub=this.datasource.stream.subscribe(e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate(Qv(e))})}disconnectedCallback(){var e,t,n;super.disconnectedCallback(),(e=this.dataSub)==null||e.unsubscribe(),delete this.dataSub,(t=this.connectionSub)==null||t.unsubscribe(),delete this.connectionSub,(n=this.datasource)==null||n.destroy(),delete this.datasource}handleStreamUpdate(e){let t=e.inserts;t.length>0&&t.forEach(e=>{this.showNotificationToast(e)})}showNotificationToast(e){let{HEADER:t,MESSAGE:n,NOTIFY_SEVERITY:r}=e,i=e.CREATED_AT?new Date(e.CREATED_AT):void 0,a=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0,o=[];this.toastButtons&&this.toastButtons.length>0&&(o=this.toastButtons.filter(({condition:t})=>!t||t({details:e})));let s={title:t,body:n,createdAt:i,toast:{details:e,type:r?.toLowerCase(),buttons:o,autoClose:a===void 0?!!this.closeTimeout:!!a,closeTimeout:a??this.closeTimeout,position:this.toastPosition}};JS(s,this.tagName)}};q([C],S7.prototype,`notificationListener`,void 0),q([xv],S7.prototype,`connect`,void 0),q([D({attribute:`resource-name`})],S7.prototype,`resourceName`,void 0),q([D({attribute:`close-timeout`,converter:E})],S7.prototype,`closeTimeout`,void 0),q([C],S7.prototype,`toastButtons`,void 0),q([D({attribute:`toast-position`})],S7.prototype,`toastPosition`,void 0),q([my],S7.prototype,`datasource`,void 0);function tIe(e,t){return new Promise(n=>{let r=setTimeout(n,t);e.finally(()=>{clearTimeout(r),n()})})}S7.compose({baseName:`notification-listener`,template:x7,shadowOptions:eIe});let C7=Kd(`foundation-router`),w7=`$router`,T7=Object.freeze({getOrCreateFor:e=>{let t=e[w7];return t===void 0?e[w7]=new nIe(e):t},find:e=>p_.find(e),from:e=>p_.from(e)});var nIe=class extends m_{};let rIe=/^([a-z][a-z0-9+\-.]*:)?\/\//i;function E7(e){return rIe.test(e)}function D7(e){return e.config instanceof F_?e:T7.find(e)}function iIe(e,t=`/`,n=!1){let r=e.join(t).replace(RegExp(t+`{1,}`,`g`),t);return!n&&r.endsWith(t)?r.slice(0,-1):r}function aIe(e){return e.replace(`/*${s_}`,``)}function O7(){document.querySelector(`foundation-router, fast-router`)===null&&window.dispatchEvent(new PopStateEvent(`popstate`))}let k7=Object.freeze({path:Object.freeze({get current(){return Qg.path.current},generateRoute:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=D7(e);for(;r!==null;){let e=yield r.config.generateRouteFromPath(t,n);if(e!==null)return e;r=r.parent}return null}),push:(e,t=!0)=>{if(e&&E7(e)){location.href=e;return}history.pushState({},document.title,e),O7(),t&&k7.path.trigger(e)},replace:(e,t=!0)=>{if(e&&E7(e)){location.href=e;return}history.replaceState({},document.title,e),O7(),t&&k7.path.trigger(e)},trigger:e=>{Qg.path.trigger(e)}}),name:Object.freeze({generateRoute:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=D7(e);for(;r!==null;){let e=yield r.config.generateRouteFromName(t,n);if(e!==null)return e;r=r.parent}return null}),push:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={},r=!0){let i=yield k7.name.generateRoute(e,t,n);i!==null&&k7.path.push(i,r)}),replace:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={},r=!0){let i=yield k7.name.generateRoute(e,t,n);i!==null&&k7.path.replace(i,r)}),trigger:(e,t,...n)=>J(void 0,[e,t,...n],void 0,function*(e,t,n={}){let r=yield k7.name.generateRoute(e,t,n);r!==null&&k7.path.trigger(r)})})}),A7=e=>!e.navId||e.navId===`header`||e.navId===`side-nav`;function oIe(e,t=A7,n=10){let r=[];return e.filter(e=>e.navItems&&e.navItems.some(t)).forEach((e,i)=>{e.navItems.filter(t).map((t,r)=>{let a=t.placementIndex??i*n+r;return Object.assign(Object.assign({},t),{navId:t.navId??`header`,placementIndex:a,routePath:t.routePath??e.path,routeName:t.routeName??e.name})}).forEach(e=>r.push(e))}),r.sort((e,t)=>e.placementIndex-t.placementIndex)}var j7=class extends u_{constructor(){super(...arguments),this.definitions=[]}map(...e){let t=this.owner,n=!t.parent,r=t.basename;n&&r!==``&&r!==`/`&&(C7.debug(`Route paths remap required due to detected sub-path deployment`),e=e.map(e=>{if(!e.path)return e;if(e.path.startsWith(r))return C7.debug(`'${e.path}' path okay as is`),e;let t=e.path.charAt(0)===`/`?``:`/`,n=`${r}${t}${e.path}`;return C7.debug(`'${e.path}' path modified to '${n}'`),Object.assign(Object.assign({},e),{path:n})})),this.definitions=[...e,...this.definitions],super.map(...e)}};q([C],j7.prototype,`definitions`,void 0);var M7=class extends F_{constructor(){super(),this.logger=C7,this.loginPath=`login`,this.notFoundPath=`not-found`,this.notPermittedPath=`not-permitted`,this.routes=new j7(this),this.basename=Hf,this.routes=new j7(this)}getNavItems(e=A7){return oIe(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>J(this,void 0,void 0,function*(){this.analytics.trackEvent(Jd.routeChanged,{path:e.route.endpoint.path})})})}configureRoutePermittedChecks(){this.contributors.push({navigate:e=>J(this,void 0,void 0,function*(){let{settings:t}=e.route;(t?.isPermitted)?.call(t)===!1&&e.cancel(()=>{if(!this.user.isAuthenticated)this.user.trackPath(),k7.name.replace(e.router,this.loginPath);else{let n=t.notPermittedPath?.call(t)??this.notPermittedPath;this.logger.debug(`User not permitted to access route. Re-routing to ${n}.`),k7.name.replace(e.router,n)}})})})}configureFallbackRouteDefinition(){this.routes.fallback(()=>{let e={redirect:this.notFoundPath};return this.user.isAuthenticated||(this.user.trackPath(),this._session.captureReturnUrl(),e={redirect:this.loginPath}),this.logger.debug(`Route unresolved. Re-routing to ${e.redirect}.`),e})}navigationPhaseLoginRedirect(e){e.cancel(()=>{this.user.trackPath(),this._session.captureReturnUrl(),k7.name.replace(e.router,this.loginPath)})}generateRouteFromName(e,t){let n=Object.create(null,{generateRouteFromName:{get:()=>super.generateRouteFromName}});return J(this,void 0,void 0,function*(){let r=yield n.generateRouteFromName.call(this,e,t);return r?this.generateNavigationPath(r):null})}navigateTo(e){return J(this,void 0,void 0,function*(){if(e.name){this.relativeTo||this.logger.error(`unable to navigate by name as the relativeTo router is not set`),yield k7.name.push(this.relativeTo,e.name,e.params,e.trigger);return}if(e.path){k7.path.push(this.generateNavigationPath(e.path,e.params),e.trigger);return}})}generateNavigationPath(e,t){let n=this.getNavigationPathBasename(),r=n_.build(t),i=n&&!e.startsWith(n)?iIe([n,e]):e;return i=r?`${i}?${r}`:i,i}getNavigationPathBasename(){let e=(this.parent?.relativeTo?.route)?.endpoint.route.path;return e?aIe(e):this.basename?this.basename:``}construct(e){return this.container.get(e)}};q([Nt],M7.prototype,`container`,void 0),q([Xd],M7.prototype,`analytics`,void 0),q([vg],M7.prototype,`user`,void 0),q([jg],M7.prototype,`_session`,void 0);let N7=`navigate-to`,P7=`generate-navigation-path`,F7=class extends T7.from(Qe){constructor(){super(...arguments),this.logger=C7,this.onNavigateTo=e=>{e.stopImmediatePropagation(),this.config.navigateTo(e.detail)},this.onGenerateNavigationPath=e=>{e.stopImmediatePropagation();let{path:t,params:n,callback:r}=e.detail;r&&r(this.config.generateNavigationPath(t,n))}}get router(){return this[w7]}connectedCallback(){var e;super.connectedCallback(),!this.config.isConfigured&&((e=this.config).relativeTo??(e.relativeTo=this.router),x.queueUpdate(()=>J(this,void 0,void 0,function*(){this.router.config?this.router.connect():this.router.config=this.config})),this.addEventListeners())}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListeners()}addEventListeners(){this.addEventListener(N7,this.onNavigateTo),this.addEventListener(P7,this.onGenerateNavigationPath)}removeEventListeners(){this.removeEventListener(N7,this.onNavigateTo),this.removeEventListener(P7,this.onGenerateNavigationPath)}};F7=q([$e({name:`foundation-router`})],F7);let I7=e=>`control: ${e}-control, content: ${e}-content`,sIe=[`background: progress-ring-background`,`progress: progress-ring-progress`,`indeterminate-indicator-1: progress-ring-indeterminate`].join(`, `),L7=e=>T`<${e}-card class=${e=>dn(`stepper-tab`,[`stepper-tab-hidden`,e.hideTabs])}part="stepper-tab" @tab-clicked="${(e,t)=>e.handleStepClick(t.event.detail)}" role="stepper-tab" data-test-id="stepper-tab"><div class=${e=>dn(`stepper-tab-menu`,[`stepper-tab-menu-hidden`,e.hideTabs])}part="stepper-tab-menu"><slot name="tab" ${xt(`tabs`)}></slot></div>${A(e=>e.orientation===za.vertical&&!e.hideProgress,T`<div class="stepper-tab-progress" part="stepper-tab-progress"><${e}-progress-ring class="progress-ring" part="progress-ring" exportparts="${sIe}" value=${e=>e.progressValue}></${e}-progress-ring><label part="progress-label">You have completed ${e=>e.progressValue}% of the fields required to create a project</label></div>`)}</${e}-card>${A(e=>!e.indicatorOnly,T`<${e}-card class="stepper-tab-panel" part="stepper-tab-panel" data-test-id="stepper-tab-panel"><div class="stepper-panel-container" part="stepper-panel-container"><slot name="tab-panel" ${xt(`tabpanels`)}></slot></div>${A(e=>!e.hideAllButtons,T`<div class="action-buttons-container" part="action-buttons-container"><slot name="action-buttons"><${e}-button part="back-button" exportparts="${I7(`back-button`)}" @click=${e=>e.previousStep()}?disabled=${e=>e.disabledPreviousStep}>Back</${e}-button>${A(e=>e.isLastStep&&!e.hideSubmitButton,T`<${e}-button part="submit-button" exportparts="${I7(`submit-button`)}" @click=${e=>e._submit()}?disabled=${e=>e.islastStepValid}data-test-id="submit-button">
|
|
1002
|
+
Submit </${e}-button>`)} ${A(e=>!e.isLastStep,T`<${e}-button part="next-button" exportparts="${I7(`next-button`)}" @click=${e=>e.nextStep()}data-test-id="next-button">Next</${e}-button>`)}</slot></div>`)}</${e}-card>`)} `,cIe=T` ${e=>L7(Vy(e))} `,R7=O` :host{display: flex;height: 100%;width: 100%}:host([orientation='horizontal']){flex-direction: column}.stepper-tab{display: flex;flex-direction: column;width: 100%;height: 100%;max-width: 280px;border-radius: 0}.action-buttons-container{width: 100%;display: flex;justify-content: flex-end}.stepper-panel-container{height: 100%;overflow: hidden;padding: 15px}.stepper-tab-menu{display: flex;flex-direction: column;width: 100%;margin-bottom: 30px}.stepper-tab-menu-hidden{display: none}.stepper-tab-progress{display: flex;flex-direction: column;align-items: center;justify-content: start;flex: 1}.stepper-tab-progress .progress-ring{--design-unit: 10;margin: 0}.stepper-tab-panel{display: flex;flex-direction: column;justify-content: space-between;width: 100%;min-width: 370px;border-radius: 0}label{padding: 0 10px;color: rgb(135 155 166);display: block;cursor: pointer;text-align: center;font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-style: normal;margin: calc(var(--design-unit) * 2px) 0}:host([orientation='horizontal']) .stepper-tab-menu{height: 100%;width: 100%;display: flex;flex-direction: row;margin-bottom: 0;align-items: center;justify-content: center;gap: calc(var(--design-unit) * 4px);padding: 0 calc(var(--design-unit) * 4px)}:host([orientation='horizontal']) .stepper-tab-hidden{display: none}:host([orientation='horizontal']) .stepper-tab{max-width: 100%;max-height: 70px;height: 70px}`;var z7=class extends P{constructor(){super(...arguments),this.hideProgress=!1,this.allowBackwardJumps=!1,this.allowForwardJumps=!1,this.hideAllButtons=!1,this.hideTabs=!1,this.indicatorOnly=!1,this.orientation=za.vertical,this.tabs=[],this.tabpanels=[],this.progressValue=0,this.activeTabIndex=0,this.pendingNextStep=!1,this.slotsInitialized=!1,this.setTabs=()=>{this.activeTabIndex=this.getActiveIndex(),this.tabs.forEach((e,t)=>{if(e.slot===`tab`){let n=this.activeTabIndex===t,r=t+1===this.tabIds.length,i=this.tabIds[t],a=this.tabpanelIds[t];e.setAttribute(`id`,i),e.setAttribute(`aria-selected`,n?`true`:`false`),e.setAttribute(`aria-disabled`,n?`false`:`true`),x.setBooleanAttribute(e,`selected`,n),e.setAttribute(`orientation`,this.orientation),a&&e.setAttribute(`aria-controls`,a),e.setAttribute(`tab-position`,String(t+1)),x.setBooleanAttribute(e,`isLast`,r),x.setBooleanAttribute(e,`hideStepNumber`,this.hideStepNumber===!0),e.setAttribute(`tabindex`,n?`0`:`-1`),x.setBooleanAttribute(e,`showCursorPointer`,t<=this.activeTabIndex&&this.allowBackwardJumps||t>this.activeTabIndex&&this.allowForwardJumps),n&&(this.activetab=e,this.activeid=i)}}),this.activeTabIndex===0&&this.resetCompletedState()},this.getCompletedTabs=()=>{let e=0;this.tabs.forEach(t=>{t.isCompleted()&&(e+=1)});let t=this.indicatorOnly?this.tabs.length:this.tabpanels.length;this.progressValue=t?Math.round(e/t*100):0},this.setTabPanels=()=>{this.tabpanels.forEach((e,t)=>{let n=this.tabIds[t],r=this.tabpanelIds[t];e.setAttribute(`id`,r),e.setAttribute(`aria-labelledby`,n),this.activeTabIndex===t?e.removeAttribute(`hidden`):e.setAttribute(`hidden`,``)})}}orientationChanged(){this.$fastController.isConnected&&(this.setTabs(),this.setTabPanels())}activeidChanged(e,t){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabs(),this.setTabPanels(),this.getCompletedTabs())}tabsChanged(){this.$fastController.isConnected&&(this.indicatorOnly||this.tabs.length<=this.tabpanels.length)&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}tabpanelsChanged(){this.$fastController.isConnected&&this.tabpanels.length<=this.tabs.length&&(this.setTabsAndTabPanels(),this.checkAndExecutePendingNextStep())}connectedCallback(){super.connectedCallback(),this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.activeTabIndex=this.getActiveIndex()}setTabsAndTabPanels(){this.tabIds=this.getTabIds(),this.tabpanelIds=this.getTabPanelIds(),this.setTabs(),this.setTabPanels(),this.getCompletedTabs(),this.slotsInitialized=this.tabs.length>0&&(this.indicatorOnly||this.tabpanels.length>0)}checkAndExecutePendingNextStep(){this.pendingNextStep&&this.slotsInitialized&&(this.pendingNextStep=!1,this.nextStep())}getActiveIndex(){return this.activeid===void 0||this.tabIds.indexOf(this.activeid)===-1?0:this.tabIds.indexOf(this.activeid)}goToStep(e,t=!1){let n=e-1;if(e<1||e>this.tabs.length)return Ly.warn(`[Stepper] Invalid step number: ${e}. Must be between 1 and ${this.tabs.length}`),!1;if(n===this.activeTabIndex)return!1;if(t){if(n<this.activeTabIndex)return this.handleBackwardJump(n);if(n>this.activeTabIndex)return this.handleForwardJump(n)}return n<this.activeTabIndex&&this.allowBackwardJumps?this.handleBackwardJump(n):n>this.activeTabIndex&&this.allowForwardJumps?this.handleForwardJump(n):n===this.activeTabIndex+1?(this.nextStep(),!0):(Ly.warn(`[Stepper] Cannot jump to step ${e}. Jumps are not allowed or step is not adjacent.`),!1)}goToFirstStep(){return this.goToStep(1,!0)}goToLastStep(){return this.goToStep(this.tabs.length,!0)}handleStepClick(e){e<this.activeTabIndex&&this.allowBackwardJumps?this.handleBackwardJump(e):e>this.activeTabIndex&&this.allowForwardJumps&&this.handleForwardJump(e)}handleBackwardJump(e){for(let t=e+1;t<=this.activeTabIndex;t+=1)this.tabs[t].completed=!1;return this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.$emit(`step-click`,{activetab:this.activetab,activeid:this.activeid}),!0}handleForwardJump(e){for(let t=this.activeTabIndex;t<e;t+=1)if(this.validation&&this.validation[t]){if(!this.validation[t].isValid())return this.tabs[t].completed=!1,this.tabs[t].error=!0,this.getCompletedTabs(),this.$emit(`validation-failure`,{stepIndex:t,stepId:this.tabIds[t],message:`Validation failed for step ${t+1}`}),!1;this.tabs[t].error=!1}for(let t=this.activeTabIndex;t<e;t+=1)this.tabs[t].completed=!0,this.tabs[t].error=!1;return this.tabs[e].completed=!1,this.tabs[e].error=!1,this.activeTabIndex=e,this.activetab=this.tabs[e],this.activeid=this.tabIds[e],this.getCompletedTabs(),this.$emit(`step-click`,{activetab:this.activetab,activeid:this.activeid}),!0}get disabledPreviousStep(){return this.activeTabIndex===0}get isLastStep(){return this.activeTabIndex+1===this.tabs.length}get islastStepValid(){let e=this.tabs.length-1;return this.activeTabIndex===e&&(this.validation&&this.validation[e]?.isValid()||!this.validation||!this.validation[e])?(this.tabs[e].completed=!0,this.getCompletedTabs(),!1):(this.tabs[e].completed=!1,this.getCompletedTabs(),!0)}_submit(){this.$emit(`submit`)}nextStep(){if(!this.slotsInitialized){this.pendingNextStep=!0;return}if(this.validation&&this.validation[this.activeTabIndex]){if(!this.validation[this.activeTabIndex].isValid()){this.tabs[this.activeTabIndex].completed=!1,this.tabs[this.activeTabIndex].error=!0,this.getCompletedTabs();return}this.tabs[this.activeTabIndex].error=!1}this.activeTabIndex+2<=this.tabIds.length&&(this.tabs[this.activeTabIndex].completed=!0,this.activeTabIndex+=1,this.activeid=this.tabIds[this.activeTabIndex],this.$emit(`next-step`),this.$emit(`validation-success`));let e=this.tabs.length-1,t=this.activeTabIndex===e;this.hideSubmitButton&&t&&(this.validation&&this.validation[e]?.isValid()||!this.validation||!this.validation[e])?(this.tabs[e].completed=!0,this.getCompletedTabs()):(this.tabs[e].completed=!1,this.getCompletedTabs())}previousStep(){this.activeTabIndex!==0&&(this.tabs[this.activeTabIndex].completed=!1,--this.activeTabIndex,this.activeid=this.tabIds[this.activeTabIndex])}getTabIds(){return this.tabs.map(e=>e.getAttribute(`id`)??`tab-${In()}`)}getTabPanelIds(){return this.tabpanels.map(e=>e.getAttribute(`id`)??`panel-${In()}`)}resetCompletedState(){this.tabs.forEach(e=>e.completed=!1)}};q([D({attribute:`hide-submit-button`,mode:`boolean`})],z7.prototype,`hideSubmitButton`,void 0),q([D({attribute:`hide-progress`,mode:`boolean`})],z7.prototype,`hideProgress`,void 0),q([D({attribute:`hide-step-number`,mode:`boolean`})],z7.prototype,`hideStepNumber`,void 0),q([D({attribute:`allow-backward-jumps`,mode:`boolean`})],z7.prototype,`allowBackwardJumps`,void 0),q([D({attribute:`allow-forward-jumps`,mode:`boolean`})],z7.prototype,`allowForwardJumps`,void 0),q([D({attribute:`hide-all-buttons`,mode:`boolean`})],z7.prototype,`hideAllButtons`,void 0),q([D({attribute:`hide-tabs`,mode:`boolean`})],z7.prototype,`hideTabs`,void 0),q([D({attribute:`indicator-only`,mode:`boolean`})],z7.prototype,`indicatorOnly`,void 0),q([D],z7.prototype,`orientation`,void 0),q([D],z7.prototype,`activeid`,void 0),q([C],z7.prototype,`tabs`,void 0),q([C],z7.prototype,`tabpanels`,void 0),q([C],z7.prototype,`validation`,void 0),q([C],z7.prototype,`progressValue`,void 0),q([C],z7.prototype,`activeTabIndex`,void 0),q([w],z7.prototype,`disabledPreviousStep`,null),q([w],z7.prototype,`isLastStep`,null),q([w],z7.prototype,`islastStepValid`,null);let B7={};z7.compose(Object.assign({baseName:`stepper`,template:cIe,styles:R7,shadowOptions:void 0},B7));let lIe=class extends $u{}.compose(Object.assign({baseName:`accordion`,template:(e,t)=>uo(e,t),styles:(e,t)=>O` ${Qu(e,t)} :host{border-top: none;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-divider-rest)}.heading{height: calc(var(--base-height-multiplier) * 4px)}`,shadowOptions:ed},td)),uIe=class extends id{}.compose(Object.assign({baseName:`accordion-item`,template:(e,t)=>nd(e,t),styles:(e,t)=>O` ${rd(e,t)} :host{--icon-container-calculator: calc( (6 + (var(--design-unit) * 6)) * 1px );/* height of section - (padding top +padding-bottom) */ --icon-margin-calculation: calc((6 + (var(--design-unit) * 2 * var(--density))) * 1px)}.region{padding: 0 calc((16 + (var(--design-unit) * 2 * var(--density))) * 1px);color: var(--accent-foreground-rest)}:host([expanded]) .region{color: var(--accent-foreground-rest)}slot[name='expanded-icon']{display: none;stroke: none}slot[name='collapsed-icon'] path.plus-sign, slot[name='expanded-icon'] path.minus-sign{stroke: white}slot[name='expanded-icon'], slot[name='collapsed-icon']{background: var(--neutral-fill-rest);fill: none;stroke: none;height: calc((var(--design-unit) * 4) * 1px);width: calc((var(--design-unit) * 4) * 1px)}svg:not(:root){height: calc((var(--design-unit) * 4) * 1px);width: calc((var(--design-unit) * 4) * 1px)}.icon{height: var( --icon-container-calculator );/* UX 30px* for now it's 30 on default design unit - 4/ */ width: var(--icon-container-calculator);/* UX 30px */ margin: var(--icon-margin-calculation) var(--icon-margin-calculation) var(--icon-margin-calculation) 0}.button{padding: 0 calc((8 + (var(--design-unit) * 2 * var(--density))) * 1px) 0 calc((16 + (var(--design-unit) * 2 * var(--density))) * 1px)}.heading{grid-template-columns: auto 1fr auto;align-items: center}`,shadowOptions:ad},od)),dIe=class extends fb{}.compose({baseName:`actions-menu`,styles:(e,t)=>O` :host{--actions-opener-height-multiplier: 0.6px;--menu-item-height-multiplier: 0.5px}${sd(e,t)} rapid-menu-item{display: flex;user-select: none}rapid-menu-item::part(content){margin-inline: calc(var(--design-unit) * 3px)}rapid-menu-item[disabled]{pointer-events: none}.actions-vertical .actions-menu{padding: 0}.actions-vertical .menu-item{margin: 0;padding: calc(var(--design-unit) * 4px);border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-stealth-hover)}.actions-vertical .menu-item:last-child{border-bottom: none}.actions-vertical .menu-item:focus{border: calc(var(--stroke-width) * 1px) solid var(--accent-foreground-focus)}`,template:db}),fIe=O` ${OS}`,pIe=class extends $S{}.compose(Object.assign({baseName:`ai-criteria-search`,template:(e,t)=>AS,styles:fIe,shadowOptions:void 0},eC)),mIe=class extends rC{}.compose({baseName:`ai-indicator`,template:nC,styles:(e,t)=>O` ${tC(e,t)} :host{--green: var(--success-color);--trafic-light-green: var(--success-color);--red: var(--error-color);--trafic-light-red: var(--error-color);--amber: var(--warning-color);--trafic-light-amber: var(--warning-color)}`});function V7(e,t){return new so(`appearance`,e,t)}let hIe=[`baseClass`,`baseName`,`shadowOptions`,`styles`,`template`],gIe=(e,t=hIe)=>Object.keys(e).filter(e=>!t.includes(e)).reduce((t,n)=>(t[n]=e[n],t),{}),H7=e=>{let{definition:t}=e(),{shadowOptions:n,styles:r,template:i}=t;return{shadowOptions:n,styles:r,template:i,defaultConfig:gIe(t)}},_Ie=O` :host([appearance='primary']){background: var(--accent-fill-rest);color: var(--foreground-on-accent-rest)}:host([appearance='primary']:hover){background: var(--accent-fill-hover);color: var(--foreground-on-accent-hover)}:host([appearance='primary']:active){background: var(--accent-fill-active);color: var(--foreground-on-accent-active)}:host([appearance='primary'][disabled]), :host([appearance='primary'][disabled]):hover, :host([appearance='primary'][disabled]):active{opacity: 50%}`,vIe=O` :host([appearance='secondary']){background: var(--secondary-fill-rest);color: contrast-color(var(--secondary-fill-rest))}:host([appearance='secondary']:hover){background: var(--secondary-fill-hover);color: contrast-color(var(--secondary-fill-hover))}:host([appearance='secondary']:active){background: var(--secondary-fill-active);color: contrast-color(var(--secondary-fill-active))}:host([appearance='secondary'][disabled]), :host([appearance='secondary'][disabled]):hover, :host([appearance='secondary'][disabled]):active{opacity: 50%}`,yIe=O` :host([appearance='neutral']){background: var(--neutral-button-fill, var(--neutral-fill-rest));border: var(--neutral-button-border, 0);color: var(--neutral-button-foreground, var(--neutral-foreground-rest))}:host([appearance='neutral']:hover){background: color-mix( in srgb, var(--neutral-button-fill, var(--neutral-fill-hover)), transparent 20% )}:host([appearance='neutral']:active){background: color-mix( in srgb, var(--neutral-button-fill, var(--neutral-fill-active)), transparent 30% )}:host([appearance='neutral'][disabled]), :host([appearance='neutral'][disabled]):hover, :host([appearance='neutral'][disabled]):active{opacity: 50%;background: var(--neutral-button-fill, var(--neutral-fill-rest));color: var(--neutral-button-foreground, var(--neutral-foreground-rest));border: var(--neutral-button-border, 0)}`,bIe=O` :host([appearance='danger']){background: var(--error-fill-rest);color: contrast-color(var(--error-fill-rest));border: 0}:host([appearance='danger']:hover){background: var(--error-fill-hover);color: contrast-color(var(--error-fill-hover))}:host([appearance='danger']:active){background: var(--error-fill-active);color: contrast-color(var(--error-fill-active))}:host([appearance='danger'][disabled]), :host([appearance='danger'][disabled]):hover, :host([appearance='danger'][disabled]):active{opacity: 50%}`,xIe=O` :host([appearance='success']){background: var(--success-fill-rest);color: contrast-color(var(--success-fill-rest));border: 0}:host([appearance='success']:hover){background: var(--success-fill-hover);color: contrast-color(var(--success-fill-hover))}:host([appearance='success']:active){background: var(--success-fill-active);color: contrast-color(var(--success-fill-active))}:host([appearance='success'][disabled]), :host([appearance='success'][disabled]):hover, :host([appearance='success'][disabled]):active{opacity: 50%}`,SIe=O` :host([appearance='warning']){background: var(--warning-fill-rest);color: contrast-color(var(--warning-fill-rest));border: 0}:host([appearance='warning']:hover){background: var(--warning-fill-hover);color: contrast-color(var(--warning-fill-hover))}:host([appearance='warning']:active){background: var(--warning-fill-active);color: contrast-color(var(--warning-fill-active))}:host([appearance='warning'][disabled]), :host([appearance='warning'][disabled]):hover, :host([appearance='warning'][disabled]):active{opacity: 50%}`,CIe=O` :host([appearance='tertiary']){background: var(--tertiary-fill-rest);color: contrast-color(var(--tertiary-fill-rest));border: 0}:host([appearance='tertiary']:hover){background: var(--tertiary-fill-hover);color: contrast-color(var(--tertiary-fill-hover))}:host([appearance='tertiary']:active){background: var(--tertiary-fill-active);color: contrast-color(var(--tertiary-fill-active))}:host([appearance='tertiary'][disabled]), :host([appearance='tertiary'][disabled]):hover, :host([appearance='tertiary'][disabled]):active{opacity: 50%}`,wIe=O` :host([appearance='primary-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--accent-fill-rest)}:host([appearance='primary-outline']:hover){background: var(--accent-fill-hover);color: contrast-color(var(--accent-fill-hover))}:host([appearance='primary-outline']:active){background: var(--accent-fill-active);color: contrast-color(var(--accent-fill-active))}:host([appearance='primary-outline'][disabled]), :host([appearance='primary-outline'][disabled]):hover, :host([appearance='primary-outline'][disabled]):active{opacity: 50%}`,TIe=O` :host([appearance='secondary-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--secondary-fill-rest)}:host([appearance='secondary-outline']:hover){background: var(--secondary-fill-hover);color: contrast-color(var(--secondary-fill-hover))}:host([appearance='secondary-outline']:active){background: var(--secondary-fill-active);color: contrast-color(var(--secondary-fill-active))}:host([appearance='secondary-outline'][disabled]), :host([appearance='secondary-outline'][disabled]):hover, :host([appearance='secondary-outline'][disabled]):active{opacity: 50%}`,EIe=O` :host([appearance='neutral-outline']){background: none;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host([appearance='neutral-outline']:hover){background: var(--neutral-fill-hover);color: contrast-color(var(--neutral-fill-hover))}:host([appearance='neutral-outline']:active){background: var(--neutral-fill-active);color: contrast-color(var(--neutral-fill-active))}:host([appearance='neutral-outline'][disabled]), :host([appearance='neutral-outline'][disabled]):hover, :host([appearance='neutral-outline'][disabled]):active{opacity: 50%}`,DIe=O` :host([appearance='link']){background: none;border: none;color: var(--accent-foreground-rest)}:host([appearance='link']) .control{padding: 0}:host([appearance='link']:hover){color: var(--accent-foreground-hover)}:host([appearance='link'][disabled]), :host([appearance='link'][disabled]):hover, :host([appearance='link'][disabled]):active{opacity: 50%}`,OIe=(e,t)=>O` :host{font-weight: 500;color: var(--neutral-foreground-rest);box-sizing: border-box;font-size: var(--type-ramp-base-font-size);height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px)}.control{padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px)}.start{margin-inline-end: calc(var(--design-unit) * 2px)}.end{margin-inline-start: calc(var(--design-unit) * 2px)}.control:has(.start){padding-left: calc((12 + var(--design-unit) * 2 * var(--density)) * 1px)}.control:has(.end){padding-right: calc((12 + var(--design-unit) * 2 * var(--density)) * 1px)}:host([appearance='neutral']){background: color-mix(in srgb, var(--neutral-fill-rest), transparent 50%);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest)}:host([appearance='neutral']:hover){background: var(--neutral-fill-rest)}:host([appearance='neutral']:active){background: color-mix(in srgb, var(--neutral-fill-rest), transparent 70%));border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest)}:host([appearance='neutral'][disabled]), :host([appearance='neutral'][disabled]):hover, :host([appearance='neutral'][disabled]):active{background: color-mix(in srgb, var(--neutral-fill-rest), transparent 70%);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-rest);color: color-mix(in srgb, var(--neutral-foreground-rest), transparent 50%);opacity: 100%}:host([appearance='accent']){color: contrast-color(var(--accent-fill-rest))}`,U7=(e,t)=>O` ${FC(e,t)} ${OIe(e,t)} `.withBehaviors(V7(`primary`,_Ie),V7(`secondary`,vIe),V7(`tertiary`,CIe),V7(`neutral`,yIe),V7(`danger`,bIe),V7(`success`,xIe),V7(`warning`,SIe),V7(`primary-outline`,wIe),V7(`secondary-outline`,TIe),V7(`neutral-outline`,EIe),V7(`link`,DIe)),kIe=class extends oC{}.compose(Object.assign({baseName:`anchor`,template:(e,t)=>iC(e,t),styles:(e,t)=>O` ${aC(e,t)} ${U7(e,t)} `.withBehaviors(...U7(e,t).behaviors),shadowOptions:sC},cC)),AIe=class extends dC{}.compose(Object.assign({baseName:`anchored-region`,template:(e,t)=>lC(e,t),styles:(e,t)=>O` ${uC(e,t)}`,shadowOptions:fC},pC)),jIe=class extends gC{}.compose(Object.assign({baseName:`avatar`,template:(e,t)=>mC(e,t),styles:(e,t)=>O` ${hC(e,t)}`,shadowOptions:_C},vC)),MIe=class extends xC{}.compose(Object.assign({baseName:`badge`,template:(e,t)=>yC(e,t),styles:(e,t)=>O` ${bC(e,t)} :host{--badge-fill-primary: var(--accent-fill-rest);--badge-fill-neutral: var(--neutral-fill-rest);--badge-fill-success: var(--success-color);--badge-fill-danger: var(--error-color);--badge-fill-warning: var(--warning-color);--badge-fill-buy: var(--buy-color);--badge-fill-sell: var(--sell-color);--badge-color-text: var(--neutral-foreground-rest);font-size: var(--type-ramp-minus-2-font-size)}:host .control{padding: calc(${B} * 1px) calc(${B} * 2px);border: none}`,shadowOptions:void 0},SC)),NIe=O` ${CC} :host{--banner-height: calc( ((var(--design-unit) + 2) * var(--base-height-multiplier)) + (var(--design-unit) * var(--design-unit)) * 1px )}.banner{background-color: var(--neutral-layer-1);color: var(--neutral-foreground-rest);padding: calc(var(--design-unit) * 4px)}.content{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height)}`,PIe=TC,FIe=class extends EC{}.compose({baseName:`banner`,shadowOptions:PIe,styles:NIe,template:wC}),IIe=class extends kC{}.compose(Object.assign({baseName:`breadcrumb`,template:(e,t)=>DC(e,t),styles:(e,t)=>O` ${OC(e,t)}`,shadowOptions:void 0},{})),LIe=class extends MC{}.compose(Object.assign({baseName:`breadcrumb-item`,template:(e,t)=>AC(e,t),styles:(e,t)=>O` ${jC(e,t)} .listitem{color: var(--accent-foreground-rest)}.control{color: var(--neutral-foreground-rest)}.control:hover{color: var(--neutral-foreground-rest)}.separator{color: var(--neutral-stroke-rest);margin: 0 12px}.control:hover .content::before{background: var(--neutral-foreground-rest)}.control .start{width: calc(var(--base-height-multiplier) * 3px);height: calc(var(--base-height-multiplier) * 3px);display: flex;justify-content: center;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);margin: 0 -4px 0 0}.control:hover .start{background: color-mix(in srgb, var(--neutral-foreground-rest), transparent 95%)}`,shadowOptions:void 0},NC)),RIe=class extends IC{}.compose(Object.assign({baseName:`button`,template:(e,t)=>PC(e,t),styles:U7,shadowOptions:LC},RC)),zIe=class extends VC{}.compose(Object.assign({baseName:`calendar`,template:(e,t)=>BC(e,t),styles:()=>O` ${zC()}`,shadowOptions:HC},UC)),BIe=class extends KC{}.compose(Object.assign({baseName:`card`,template:(e,t)=>WC(e,t),styles:(e,t)=>O` ${GC(e,t)} :host{background: var(--neutral-layer-card-container);color: ${H};border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));box-shadow: var(--card-box-shadow, none);border: var( --card-border, 1px solid var(--neutral-stroke-rest) );/** uses a token instead of #2E3339 value available in ux docs */ /* box-shadow and border-radius are being calculated at host level by using design-tokens */}::slotted(rapid-card){background: var(--neutral-layer-3)}`,shadowOptions:void 0},qC)),VIe=O` ${rw} .label{color: var(--neutral-foreground-hint)}.options{background: var(--neutral-layer-4)}rapid-checkbox:hover:not([disabled]){background: var(--neutral-layer-4)}`,HIe=T` ${iw(`rapid`)} `;var UIe=class extends ow{};let WIe=aw,GIe=UIe.compose(Object.assign({baseName:`categorized-multiselect`,template:HIe,styles:VIe,shadowOptions:void 0},WIe)),KIe=class extends lw{}.compose(Object.assign({baseName:`checkbox`,template:(e,t)=>sw(e,t),styles:(e,t)=>O` ${cw(e,t)} .checked-indicator{fill: contrast-color(var(--accent-fill-rest));box-shadow: 2px 1000px 1px rgb(0 0 0 / 20%) inset;border-radius: calc(var(--control-corner-radius) * 1px)}:host([aria-checked='true']:not([disabled])) .control:hover .checked-indicator{fill: var(--neutral-foreground-rest)}.label{padding-inline-start: calc(var(--design-unit) * 2px)}`,shadowOptions:void 0},uw)),qIe=class extends hw{}.compose(Object.assign({baseName:`combobox`,template:(e,t)=>fw(e,t),styles:(e,t)=>O` ${dw(e,t)} :host{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );min-width: 0}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not([open])){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host .listbox ::slotted(*:last-child){border-bottom: none}.control{padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:active{background: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}.combo-box-indicator{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);transition: all 0.35s}.selected-value{height: calc(100% - (var(--design-unit) * 1px));padding: 0;margin: 0}:host(:focus-within:not([disabled])) .indicator{background-color: transparent}:host([open]) .combo-box-indicator{transition: all 0.35s;transform: rotate(180deg)}::slotted([role='option']){margin: 0}`,shadowOptions:gw},_w)),JIe=class extends bw{}.compose({baseName:`connection-indicator`,template:yw,styles:(e,t)=>O` ${vw(e,t)} :host{--light-size: calc(var(--design-unit) * 3px);--red: var(--error-color);--trafic-light-red: color-mix(in srgb, var(--red), transparent 0%);--trafic-light-red-glow: color-mix(in srgb, var(--red), transparent 60%) 0 0 4px 4px, color-mix(in srgb, var(--red), transparent 80%) 0 0 8px 8px;--green: var(--success-color);--trafic-light-green: color-mix(in srgb, var(--green), transparent 0%);--trafic-light-green-glow: color-mix(in srgb, var(--green), transparent 60%) 0 0 4px 4px, color-mix(in srgb, var(--green), transparent 80%) 0 0 8px 8px}.light{margin: calc(var(--design-unit) * 4px)}.label{font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);color: var(--neutral-stroke-rest)}`}),{defaultConfig:YIe,shadowOptions:XIe,styles:ZIe,template:QIe}=H7(xw),$Ie=()=>xw(),{defaultConfig:eLe,shadowOptions:tLe,styles:nLe,template:rLe}=H7(Sw),iLe=()=>Sw(),{defaultConfig:aLe,shadowOptions:oLe,styles:sLe,template:cLe}=H7(Cw),lLe=()=>Cw(),uLe=()=>O` ${ww} :host{--primary-gradient-angle: -113.5deg;display: inline-block}.calendar-dropdown{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}.input-icon-container{display: flex;justify-content: center;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px)}.input-icon-container:hover{background-color: var(--neutral-fill-rest)}.date-toggle::part(end){margin-inline-end: calc(var(--design-unit) * 1px)}.date-toggle{margin-bottom: 0}.month-day{width: calc(((var(--base-height-multiplier) * (var(--design-unit) - 1)) + 2) * 1px);height: calc(((var(--base-height-multiplier) * (var(--design-unit) - 1)) + 2) * 1px)}.week-days span{font-size: var(--type-ramp-minus-2-font-size)}`,dLe=T` ${Ew(`rapid`)} `,fLe=class extends Rw{}.compose(Object.assign({baseName:`date-picker`,template:dLe,styles:uLe,shadowOptions:void 0},{}));var W7;(function(e){e.primary=`#11C9FC`,e.neutral=`#7C909B`,e.error=`#F9644D`,e.success=`#7ACC79`,e.warning=`#FFB660`,e.tertiary=`#7B2FBE`,e.info=`#11C9FC`,e.buy=`#7ACC79`,e.sell=`#F14376`,e.chartPink=`#fb8176`,e.longGreen=`#7acc79`,e.shortPink=`#f14376`,e.warningYellow=`#fcb35f`,e.green=`#44c14c`,e.lightGreen=`#69cd70`,e.red=`#ef4d28`,e.lightRed=`#ee6588`,e.dodgerBlue=`#33a9ff`,e.lightDodgerBlue=`#5cbaff`,e.violet=`#9b1e74`,e.lightViolet=`#b528af`,e.white=`#f9f9f9`,e.silver=`#c1c1c1`,e.salomie=`#ffdf94`,e.lightSalomie=`#ccb276`,e.melon=`#ffbbb2`,e.lightMelon=`#cc968e`,e.portage=`#8a99f5`,e.lightPortage=`#adb8f8`,e.ice=`#97f4eb`,e.lightIce=`#6befe2`})(W7||(W7={}));let{create:G7}=oi,K7=es(W7.error),q7=is.create(K7.r,K7.g,K7.b),J7=G7(`error-color`).withDefault(q7),Y7=es(W7.success),X7=is.create(Y7.r,Y7.g,Y7.b),Z7=G7(`success-color`).withDefault(X7),Q7=es(W7.warning),$7=is.create(Q7.r,Q7.g,Q7.b),e9=G7(`warning-color`).withDefault($7),t9=es(W7.buy),n9=is.create(t9.r,t9.g,t9.b),r9=G7(`buy-color`).withDefault(n9),i9=es(W7.sell),a9=is.create(i9.r,i9.g,i9.b),o9=G7(`sell-color`).withDefault(a9),s9=es(W7.info),c9=is.create(s9.r,s9.g,s9.b),l9=G7(`info-color`).withDefault(c9),u9=es(W7.error),d9=is.create(u9.r,u9.g,u9.b),f9=G7(`serious-notify-color`).withDefault(d9),{create:p9}=oi,m9=e=>oi.create({name:e,cssCustomPropertyName:null}),h9=is.create(1,1,1),pLe=is.create(0,0,0),g9=4.5;function mLe(e,t,n,r,i,a,o,s,c){let l=e.source,u=t.closestIndexOf(n)>=Math.max(o,s,c)?-1:1,d=e.closestIndexOf(l),f=d+u*-1*r,p=f+u*i,m=f+u*a;return{rest:e.get(f),hover:e.get(d),active:e.get(p),focus:e.get(m)}}function hLe(e,t,n,r,i,a,o){let s=e.source,c=e.closestIndexOf(s),l=ss(t)?-1:1,u=c+(l===1?Math.min(r,i):Math.max(l*r,l*i)),d=e.colorContrast(t,n,u,l),f=e.closestIndexOf(d),p=f+l*Math.abs(r-i),m=l===1?r<i:l*r>l*i,h=m?f:p,g=m?p:f;return{rest:e.get(h),hover:e.get(g),active:e.get(h+l*a),focus:e.get(h+l*o)}}function gLe(e,t){return e.contrast(h9)>=t?h9:pLe}function _9(e,t){let n=e,r=m9(`${n}-palette`).withDefault(e=>ls.from(t.getValueFor(e))),i=m9(`${n}-fill-rest-delta`).withDefault(0),a=m9(`${n}-fill-hover-delta`).withDefault(4),o=m9(`${n}-fill-active-delta`).withDefault(-5),s=m9(`${n}-fill-focus-delta`).withDefault(0),c=m9(`${n}-foreground-rest-delta`).withDefault(0),l=m9(`${n}-foreground-hover-delta`).withDefault(6),u=m9(`${n}-foreground-active-delta`).withDefault(-4),d=m9(`${n}-foreground-focus-delta`).withDefault(0),f=m9(`${n}-fill-recipe`).withDefault({evaluate:(e,t)=>mLe(r.getValueFor(e),_c.getValueFor(e),t??Mc.getValueFor(e),a.getValueFor(e),o.getValueFor(e),s.getValueFor(e),Js.getValueFor(e),Ys.getValueFor(e),Xs.getValueFor(e))}),p=p9(`${n}-fill-rest`).withDefault(e=>f.getValueFor(e).evaluate(e).rest),m=p9(`${n}-fill-hover`).withDefault(e=>f.getValueFor(e).evaluate(e).hover),h=p9(`${n}-fill-active`).withDefault(e=>f.getValueFor(e).evaluate(e).active),g=p9(`${n}-fill-focus`).withDefault(e=>f.getValueFor(e).evaluate(e).focus),_=e=>(t,n)=>gLe(n??p.getValueFor(t),e),v=m9(`foreground-on-${n}-recipe`).withDefault({evaluate:(e,t)=>_(g9)(e,t)}),y=p9(`foreground-on-${n}-rest`).withDefault(e=>v.getValueFor(e).evaluate(e,p.getValueFor(e))),b=p9(`foreground-on-${n}-hover`).withDefault(e=>v.getValueFor(e).evaluate(e,m.getValueFor(e))),ee=p9(`foreground-on-${n}-active`).withDefault(e=>v.getValueFor(e).evaluate(e,h.getValueFor(e))),x=p9(`foreground-on-${n}-focus`).withDefault(e=>v.getValueFor(e).evaluate(e,g.getValueFor(e))),te=m9(`foreground-on-${n}-large-recipe`).withDefault({evaluate:(e,t)=>_(7)(e,t)}),ne=p9(`foreground-on-${n}-rest-large`).withDefault(e=>te.getValueFor(e).evaluate(e,p.getValueFor(e))),S=p9(`foreground-on-${n}-hover-large`).withDefault(e=>te.getValueFor(e).evaluate(e,m.getValueFor(e))),C=p9(`foreground-on-${n}-active-large`).withDefault(e=>te.getValueFor(e).evaluate(e,h.getValueFor(e))),w=p9(`foreground-on-${n}-focus-large`).withDefault(e=>te.getValueFor(e).evaluate(e,g.getValueFor(e))),re=m9(`${n}-foreground-recipe`).withDefault({evaluate:(e,t)=>hLe(r.getValueFor(e),t??Mc.getValueFor(e),g9,c.getValueFor(e),l.getValueFor(e),u.getValueFor(e),d.getValueFor(e))});return{palette:r,fillRestDelta:i,fillHoverDelta:a,fillActiveDelta:o,fillFocusDelta:s,foregroundRestDelta:c,foregroundHoverDelta:l,foregroundActiveDelta:u,foregroundFocusDelta:d,fillRecipe:f,fillRest:p,fillHover:m,fillActive:h,fillFocus:g,foregroundOnRecipe:v,foregroundOnRest:y,foregroundOnHover:b,foregroundOnActive:ee,foregroundOnFocus:x,foregroundOnLargeRecipe:te,foregroundOnRestLarge:ne,foregroundOnHoverLarge:S,foregroundOnActiveLarge:C,foregroundOnFocusLarge:w,foregroundRecipe:re,foregroundRest:p9(`${n}-foreground-rest`).withDefault(e=>re.getValueFor(e).evaluate(e).rest),foregroundHover:p9(`${n}-foreground-hover`).withDefault(e=>re.getValueFor(e).evaluate(e).hover),foregroundActive:p9(`${n}-foreground-active`).withDefault(e=>re.getValueFor(e).evaluate(e).active),foregroundFocus:p9(`${n}-foreground-focus`).withDefault(e=>re.getValueFor(e).evaluate(e).focus)}}let v9=es(W7.green),y9=is.create(v9.r,v9.g,v9.b),b9=oi.create(`secondary-color`).withDefault(y9),{palette:_Le,fillRestDelta:vLe,fillHoverDelta:yLe,fillActiveDelta:bLe,fillFocusDelta:xLe,foregroundRestDelta:SLe,foregroundHoverDelta:CLe,foregroundActiveDelta:wLe,foregroundFocusDelta:TLe,fillRecipe:ELe,fillRest:DLe,fillHover:OLe,fillActive:kLe,fillFocus:ALe,foregroundOnRecipe:jLe,foregroundOnRest:MLe,foregroundOnHover:NLe,foregroundOnActive:PLe,foregroundOnFocus:FLe,foregroundOnLargeRecipe:ILe,foregroundOnRestLarge:LLe,foregroundOnHoverLarge:RLe,foregroundOnActiveLarge:zLe,foregroundOnFocusLarge:BLe,foregroundRecipe:VLe,foregroundRest:HLe,foregroundHover:ULe,foregroundActive:WLe,foregroundFocus:GLe}=_9(`secondary`,b9),x9=es(W7.tertiary),S9=is.create(x9.r,x9.g,x9.b),C9=oi.create(`tertiary-color`).withDefault(S9),{palette:KLe,fillRestDelta:qLe,fillHoverDelta:JLe,fillActiveDelta:YLe,fillFocusDelta:XLe,foregroundRestDelta:ZLe,foregroundHoverDelta:QLe,foregroundActiveDelta:$Le,foregroundFocusDelta:eRe,fillRecipe:tRe,fillRest:nRe,fillHover:rRe,fillActive:iRe,fillFocus:aRe,foregroundOnRecipe:oRe,foregroundOnRest:sRe,foregroundOnHover:cRe,foregroundOnActive:lRe,foregroundOnFocus:uRe,foregroundOnLargeRecipe:dRe,foregroundOnRestLarge:fRe,foregroundOnHoverLarge:pRe,foregroundOnActiveLarge:mRe,foregroundOnFocusLarge:hRe,foregroundRecipe:gRe,foregroundRest:_Re,foregroundHover:vRe,foregroundActive:yRe,foregroundFocus:bRe}=_9(`tertiary`,C9),{palette:xRe,fillRestDelta:SRe,fillHoverDelta:CRe,fillActiveDelta:wRe,fillFocusDelta:TRe,foregroundRestDelta:ERe,foregroundHoverDelta:DRe,foregroundActiveDelta:ORe,foregroundFocusDelta:kRe,fillRecipe:ARe,fillRest:jRe,fillHover:MRe,fillActive:NRe,fillFocus:PRe,foregroundOnRecipe:FRe,foregroundOnRest:IRe,foregroundOnHover:LRe,foregroundOnActive:RRe,foregroundOnFocus:zRe,foregroundOnLargeRecipe:BRe,foregroundOnRestLarge:VRe,foregroundOnHoverLarge:HRe,foregroundOnActiveLarge:URe,foregroundOnFocusLarge:WRe,foregroundRecipe:GRe,foregroundRest:KRe,foregroundHover:qRe,foregroundActive:JRe,foregroundFocus:YRe}=_9(`error`,J7),{palette:XRe,fillRestDelta:ZRe,fillHoverDelta:QRe,fillActiveDelta:$Re,fillFocusDelta:eze,foregroundRestDelta:tze,foregroundHoverDelta:nze,foregroundActiveDelta:rze,foregroundFocusDelta:ize,fillRecipe:aze,fillRest:oze,fillHover:sze,fillActive:cze,fillFocus:lze,foregroundOnRecipe:uze,foregroundOnRest:dze,foregroundOnHover:fze,foregroundOnActive:pze,foregroundOnFocus:mze,foregroundOnLargeRecipe:hze,foregroundOnRestLarge:gze,foregroundOnHoverLarge:_ze,foregroundOnActiveLarge:vze,foregroundOnFocusLarge:yze,foregroundRecipe:bze,foregroundRest:xze,foregroundHover:Sze,foregroundActive:Cze,foregroundFocus:wze}=_9(`success`,Z7),{palette:Tze,fillRestDelta:Eze,fillHoverDelta:Dze,fillActiveDelta:Oze,fillFocusDelta:kze,foregroundRestDelta:Aze,foregroundHoverDelta:jze,foregroundActiveDelta:Mze,foregroundFocusDelta:Nze,fillRecipe:Pze,fillRest:Fze,fillHover:Ize,fillActive:Lze,fillFocus:Rze,foregroundOnRecipe:zze,foregroundOnRest:Bze,foregroundOnHover:Vze,foregroundOnActive:Hze,foregroundOnFocus:Uze,foregroundOnLargeRecipe:Wze,foregroundOnRestLarge:Gze,foregroundOnHoverLarge:Kze,foregroundOnActiveLarge:qze,foregroundOnFocusLarge:Jze,foregroundRecipe:Yze,foregroundRest:Xze,foregroundHover:Zze,foregroundActive:Qze,foregroundFocus:$ze}=_9(`warning`,e9);var w9=/* @__PURE__ */ c({accentFillActive:()=>Lc,accentFillActiveDelta:()=>Hs,accentFillFocus:()=>Rc,accentFillFocusDelta:()=>Us,accentFillHover:()=>Ic,accentFillHoverDelta:()=>Vs,accentFillRest:()=>Fc,accentFillRestDelta:()=>Bs,accentForegroundActive:()=>el,accentForegroundActiveDelta:()=>Ks,accentForegroundFocus:()=>tl,accentForegroundFocusDelta:()=>qs,accentForegroundHover:()=>$c,accentForegroundHoverDelta:()=>Gs,accentForegroundRest:()=>Qc,accentForegroundRestDelta:()=>Ws,accentPalette:()=>yc,baseHeightMultiplier:()=>gs,baseLayerLuminance:()=>_s,bodyFont:()=>hs,buyColor:()=>r9,controlCornerRadius:()=>z,defaultBuyColor:()=>n9,defaultErrorColor:()=>q7,defaultInfoColor:()=>c9,defaultSecondaryColor:()=>y9,defaultSellColor:()=>a9,defaultSeriousNotifyColor:()=>d9,defaultSuccessColor:()=>X7,defaultTertiaryColor:()=>S9,defaultWarningColor:()=>$7,density:()=>vs,designUnit:()=>B,direction:()=>ys,disabledOpacity:()=>bs,errorColor:()=>J7,errorFillActive:()=>NRe,errorFillActiveDelta:()=>wRe,errorFillFocus:()=>PRe,errorFillFocusDelta:()=>TRe,errorFillHover:()=>MRe,errorFillHoverDelta:()=>CRe,errorFillRecipe:()=>ARe,errorFillRest:()=>jRe,errorFillRestDelta:()=>SRe,errorForegroundActive:()=>JRe,errorForegroundActiveDelta:()=>ORe,errorForegroundFocus:()=>YRe,errorForegroundFocusDelta:()=>kRe,errorForegroundHover:()=>qRe,errorForegroundHoverDelta:()=>DRe,errorForegroundRecipe:()=>GRe,errorForegroundRest:()=>KRe,errorForegroundRestDelta:()=>ERe,errorPalette:()=>xRe,fillColor:()=>Mc,focusStrokeInner:()=>Tl,focusStrokeOuter:()=>wl,focusStrokeWidth:()=>xs,foregroundOnAccentActive:()=>Uc,foregroundOnAccentActiveLarge:()=>Jc,foregroundOnAccentFocus:()=>Wc,foregroundOnAccentFocusLarge:()=>Yc,foregroundOnAccentHover:()=>Hc,foregroundOnAccentHoverLarge:()=>qc,foregroundOnAccentRest:()=>Vc,foregroundOnAccentRestLarge:()=>Kc,foregroundOnErrorActive:()=>RRe,foregroundOnErrorActiveLarge:()=>URe,foregroundOnErrorFocus:()=>zRe,foregroundOnErrorFocusLarge:()=>WRe,foregroundOnErrorHover:()=>LRe,foregroundOnErrorHoverLarge:()=>HRe,foregroundOnErrorLargeRecipe:()=>BRe,foregroundOnErrorRecipe:()=>FRe,foregroundOnErrorRest:()=>IRe,foregroundOnErrorRestLarge:()=>VRe,foregroundOnSecondaryActive:()=>PLe,foregroundOnSecondaryActiveLarge:()=>zLe,foregroundOnSecondaryFocus:()=>FLe,foregroundOnSecondaryFocusLarge:()=>BLe,foregroundOnSecondaryHover:()=>NLe,foregroundOnSecondaryHoverLarge:()=>RLe,foregroundOnSecondaryLargeRecipe:()=>ILe,foregroundOnSecondaryRecipe:()=>jLe,foregroundOnSecondaryRest:()=>MLe,foregroundOnSecondaryRestLarge:()=>LLe,foregroundOnSuccessActive:()=>pze,foregroundOnSuccessActiveLarge:()=>vze,foregroundOnSuccessFocus:()=>mze,foregroundOnSuccessFocusLarge:()=>yze,foregroundOnSuccessHover:()=>fze,foregroundOnSuccessHoverLarge:()=>_ze,foregroundOnSuccessLargeRecipe:()=>hze,foregroundOnSuccessRecipe:()=>uze,foregroundOnSuccessRest:()=>dze,foregroundOnSuccessRestLarge:()=>gze,foregroundOnTertiaryActive:()=>lRe,foregroundOnTertiaryActiveLarge:()=>mRe,foregroundOnTertiaryFocus:()=>uRe,foregroundOnTertiaryFocusLarge:()=>hRe,foregroundOnTertiaryHover:()=>cRe,foregroundOnTertiaryHoverLarge:()=>pRe,foregroundOnTertiaryLargeRecipe:()=>dRe,foregroundOnTertiaryRecipe:()=>oRe,foregroundOnTertiaryRest:()=>sRe,foregroundOnTertiaryRestLarge:()=>fRe,foregroundOnWarningActive:()=>Hze,foregroundOnWarningActiveLarge:()=>qze,foregroundOnWarningFocus:()=>Uze,foregroundOnWarningFocusLarge:()=>Jze,foregroundOnWarningHover:()=>Vze,foregroundOnWarningHoverLarge:()=>Kze,foregroundOnWarningLargeRecipe:()=>Wze,foregroundOnWarningRecipe:()=>zze,foregroundOnWarningRest:()=>Bze,foregroundOnWarningRestLarge:()=>Gze,infoColor:()=>l9,neutralFillActive:()=>al,neutralFillActiveDelta:()=>Xs,neutralFillFocus:()=>ol,neutralFillFocusDelta:()=>Zs,neutralFillHover:()=>il,neutralFillHoverDelta:()=>Ys,neutralFillInputActive:()=>ul,neutralFillInputActiveDelta:()=>ec,neutralFillInputFocus:()=>dl,neutralFillInputFocusDelta:()=>tc,neutralFillInputHover:()=>ll,neutralFillInputHoverDelta:()=>$s,neutralFillInputRest:()=>cl,neutralFillInputRestDelta:()=>Qs,neutralFillLayerRest:()=>Cl,neutralFillLayerRestDelta:()=>uc,neutralFillRest:()=>rl,neutralFillRestDelta:()=>Js,neutralFillStealthActive:()=>hl,neutralFillStealthActiveDelta:()=>ic,neutralFillStealthFocus:()=>gl,neutralFillStealthFocusDelta:()=>ac,neutralFillStealthHover:()=>ml,neutralFillStealthHoverDelta:()=>rc,neutralFillStealthRest:()=>pl,neutralFillStealthRestDelta:()=>nc,neutralFillStrongActive:()=>bl,neutralFillStrongActiveDelta:()=>cc,neutralFillStrongFocus:()=>xl,neutralFillStrongFocusDelta:()=>lc,neutralFillStrongHover:()=>yl,neutralFillStrongHoverDelta:()=>sc,neutralFillStrongRest:()=>vl,neutralFillStrongRestDelta:()=>oc,neutralForegroundHint:()=>El,neutralForegroundRest:()=>H,neutralLayer1:()=>Tc,neutralLayer2:()=>Dc,neutralLayer3:()=>kc,neutralLayer4:()=>jc,neutralLayerCardContainer:()=>xc,neutralLayerFloating:()=>Cc,neutralPalette:()=>_c,neutralStrokeActive:()=>Al,neutralStrokeActiveDelta:()=>pc,neutralStrokeDividerRest:()=>Ml,neutralStrokeDividerRestDelta:()=>hc,neutralStrokeFocus:()=>jl,neutralStrokeFocusDelta:()=>mc,neutralStrokeHover:()=>kl,neutralStrokeHoverDelta:()=>fc,neutralStrokeRest:()=>Ol,neutralStrokeRestDelta:()=>dc,secondaryColor:()=>b9,secondaryFillActive:()=>kLe,secondaryFillActiveDelta:()=>bLe,secondaryFillFocus:()=>ALe,secondaryFillFocusDelta:()=>xLe,secondaryFillHover:()=>OLe,secondaryFillHoverDelta:()=>yLe,secondaryFillRecipe:()=>ELe,secondaryFillRest:()=>DLe,secondaryFillRestDelta:()=>vLe,secondaryForegroundActive:()=>WLe,secondaryForegroundActiveDelta:()=>wLe,secondaryForegroundFocus:()=>GLe,secondaryForegroundFocusDelta:()=>TLe,secondaryForegroundHover:()=>ULe,secondaryForegroundHoverDelta:()=>CLe,secondaryForegroundRecipe:()=>VLe,secondaryForegroundRest:()=>HLe,secondaryForegroundRestDelta:()=>SLe,secondaryPalette:()=>_Le,sellColor:()=>o9,seriousNotifyColor:()=>f9,strokeWidth:()=>V,successColor:()=>Z7,successFillActive:()=>cze,successFillActiveDelta:()=>$Re,successFillFocus:()=>lze,successFillFocusDelta:()=>eze,successFillHover:()=>sze,successFillHoverDelta:()=>QRe,successFillRecipe:()=>aze,successFillRest:()=>oze,successFillRestDelta:()=>ZRe,successForegroundActive:()=>Cze,successForegroundActiveDelta:()=>rze,successForegroundFocus:()=>wze,successForegroundFocusDelta:()=>ize,successForegroundHover:()=>Sze,successForegroundHoverDelta:()=>nze,successForegroundRecipe:()=>bze,successForegroundRest:()=>xze,successForegroundRestDelta:()=>tze,successPalette:()=>XRe,tertiaryColor:()=>C9,tertiaryFillActive:()=>iRe,tertiaryFillActiveDelta:()=>YLe,tertiaryFillFocus:()=>aRe,tertiaryFillFocusDelta:()=>XLe,tertiaryFillHover:()=>rRe,tertiaryFillHoverDelta:()=>JLe,tertiaryFillRecipe:()=>tRe,tertiaryFillRest:()=>nRe,tertiaryFillRestDelta:()=>qLe,tertiaryForegroundActive:()=>yRe,tertiaryForegroundActiveDelta:()=>$Le,tertiaryForegroundFocus:()=>bRe,tertiaryForegroundFocusDelta:()=>eRe,tertiaryForegroundHover:()=>vRe,tertiaryForegroundHoverDelta:()=>QLe,tertiaryForegroundRecipe:()=>gRe,tertiaryForegroundRest:()=>_Re,tertiaryForegroundRestDelta:()=>ZLe,tertiaryPalette:()=>KLe,typeRampBaseFontSize:()=>Ss,typeRampBaseLineHeight:()=>Cs,typeRampMinus1FontSize:()=>ws,typeRampMinus1LineHeight:()=>Ts,typeRampMinus2FontSize:()=>Es,typeRampMinus2LineHeight:()=>Ds,typeRampPlus1FontSize:()=>Os,typeRampPlus1LineHeight:()=>ks,typeRampPlus2FontSize:()=>As,typeRampPlus2LineHeight:()=>js,typeRampPlus3FontSize:()=>Ms,typeRampPlus3LineHeight:()=>Ns,typeRampPlus4FontSize:()=>Ps,typeRampPlus4LineHeight:()=>Fs,typeRampPlus5FontSize:()=>Is,typeRampPlus5LineHeight:()=>Ls,typeRampPlus6FontSize:()=>Rs,typeRampPlus6LineHeight:()=>zs,warningColor:()=>e9,warningFillActive:()=>Lze,warningFillActiveDelta:()=>Oze,warningFillFocus:()=>Rze,warningFillFocusDelta:()=>kze,warningFillHover:()=>Ize,warningFillHoverDelta:()=>Dze,warningFillRecipe:()=>Pze,warningFillRest:()=>Fze,warningFillRestDelta:()=>Eze,warningForegroundActive:()=>Qze,warningForegroundActiveDelta:()=>Mze,warningForegroundFocus:()=>$ze,warningForegroundFocusDelta:()=>Nze,warningForegroundHover:()=>Zze,warningForegroundHoverDelta:()=>jze,warningForegroundRecipe:()=>Yze,warningForegroundRest:()=>Xze,warningForegroundRestDelta:()=>Aze,warningPalette:()=>Tze});let T9=Uw(W7.primary),E9=Uw(W7.neutral),D9=Uw(W7.green),O9=Uw(W7.tertiary),k9=Uw(W7.error),A9=Uw(W7.success),j9=Uw(W7.warning),M9=ps.DarkMode,eBe=Nn.ltr,N9=`"Segoe UI", Arial, Helvetica, sans-serif`,P9=`14px`,F9=`20px`,tBe={design_tokens:{color:{accent:{$value:T9.source.toColorString(),$type:`color`},neutral:{$value:E9.source.toColorString(),$type:`color`},secondary:{$value:D9.source.toColorString(),$type:`color`},tertiary:{$value:O9.source.toColorString(),$type:`color`},error:{$value:k9.source.toColorString(),$type:`color`},success:{$value:A9.source.toColorString(),$type:`color`},warning:{$value:j9.source.toColorString(),$type:`color`}},fontFamily:{bodyFont:{$value:N9,$type:`fontFamily`}},typography:{baseFontSize:{$value:P9,$type:`dimension`},baseLineHeight:{$value:F9,$type:`dimension`}},mode:{luminance:{$value:M9,$type:`number`}},style:{density:{$value:0,$type:`number`},baseHeightMultiplier:{$value:10,$type:`number`},borderRadius:{$value:4,$type:`number`},strokeWidth:{$value:1,$type:`number`}},space:{designUnit:{$value:4,$type:`number`}}}};var I9=/* @__PURE__ */ c({accentFillActiveDeltaValue:()=>-5,accentFillFocusDeltaValue:()=>0,accentFillHoverDeltaValue:()=>4,accentFillRestDeltaValue:()=>0,accentForegroundActiveDeltaValue:()=>-4,accentForegroundFocusDeltaValue:()=>0,accentForegroundHoverDeltaValue:()=>6,accentForegroundRestDeltaValue:()=>0,accentPaletteValue:()=>T9,baseHeightMultiplierValue:()=>10,baseLayerLuminanceValue:()=>M9,bodyFontValue:()=>N9,controlCornerRadiusValue:()=>4,densityValue:()=>0,designTokens:()=>tBe,designUnitValue:()=>4,directionValue:()=>eBe,disabledOpacityValue:()=>.3,errorPaletteValue:()=>k9,focusStrokeWidthValue:()=>2,neutralFillActiveDeltaValue:()=>5,neutralFillFocusDeltaValue:()=>0,neutralFillHoverDeltaValue:()=>10,neutralFillInputActiveDeltaValue:()=>0,neutralFillInputFocusDeltaValue:()=>10,neutralFillInputHoverDeltaValue:()=>5,neutralFillInputRestDeltaValue:()=>0,neutralFillLayerRestDeltaValue:()=>3,neutralFillRestDeltaValue:()=>7,neutralFillStealthActiveDeltaValue:()=>3,neutralFillStealthFocusDeltaValue:()=>0,neutralFillStealthHoverDeltaValue:()=>5,neutralFillStealthRestDeltaValue:()=>0,neutralFillStrongActiveDeltaValue:()=>-5,neutralFillStrongFocusDeltaValue:()=>0,neutralFillStrongHoverDeltaValue:()=>8,neutralFillStrongRestDeltaValue:()=>0,neutralPaletteValue:()=>E9,neutralStrokeActiveDeltaValue:()=>16,neutralStrokeDividerRestDeltaValue:()=>8,neutralStrokeFocusDeltaValue:()=>25,neutralStrokeHoverDeltaValue:()=>40,neutralStrokeRestDeltaValue:()=>25,prefix:()=>`rapid`,secondaryPaletteValue:()=>D9,strokeWidthValue:()=>1,successPaletteValue:()=>A9,tertiaryPaletteValue:()=>O9,typeRampBaseFontSizeValue:()=>P9,typeRampBaseLineHeightValue:()=>F9,typeRampMinus1FontSizeValue:()=>`13px`,typeRampMinus1LineHeightValue:()=>`19px`,typeRampMinus2FontSizeValue:()=>`12px`,typeRampMinus2LineHeightValue:()=>`18px`,typeRampPlus1FontSizeValue:()=>`15px`,typeRampPlus1LineHeightValue:()=>`21px`,typeRampPlus2FontSizeValue:()=>`16px`,typeRampPlus2LineHeightValue:()=>`22px`,typeRampPlus3FontSizeValue:()=>`17px`,typeRampPlus3LineHeightValue:()=>`23px`,typeRampPlus4FontSizeValue:()=>`18px`,typeRampPlus4LineHeightValue:()=>`24px`,typeRampPlus5FontSizeValue:()=>`19px`,typeRampPlus5LineHeightValue:()=>`25px`,typeRampPlus6FontSizeValue:()=>`20px`,typeRampPlus6LineHeightValue:()=>`26px`,warningPaletteValue:()=>j9});let nBe=class extends K{constructor(){super(),Bw(w9,I9,this)}}.compose({baseName:`design-system-provider`,template:T`<slot></slot>`}),L9=O` ${F1} :host{font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}dialog{position: var(--dialog-position, fixed);top: 0;bottom: 0;border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));border: var(--card-border, calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest));text-align: left;line-height: normal;box-shadow: 0 2px 15px 0 rgb(0 0 0 / 35%);background-color: var(--dialog-background, var(--neutral-layer-1))}.top{display: flex;align-items: center;justify-content: space-between;color: var(--neutral-foreground-rest);margin-bottom: calc(var(--design-unit) * 2px);font-weight: 500}.bottom{display: flex;flex-wrap: wrap;justify-content: flex-end;color: var(--neutral-foreground-rest);gap: calc(var(--design-unit) * 2px)}:host slot:first-of-type{color: ${H}}::slotted(rapid-button){margin-top: calc(var(--design-unit) * 4px - 1px)}slot[name='top']::slotted(*){margin: 0;font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-hint);font-weight: 700}.content-wrapper{min-width: var(--dialog-min-width);min-height: var(--dialog-min-height);height: fit-content;width: fit-content;max-width: var(--dialog-max-width);max-height: var(--dialog-max-height);display: flex;flex-direction: column;justify-content: space-between;align-items: stretch}.close-icon:hover svg{background-color: color-mix(in srgb, var(--neutral-foreground-rest), transparent 95%)}.close-icon svg g path{fill: color-mix(in srgb, var(--neutral-foreground-rest), transparent 50%)}.close-icon:hover svg g path{fill: var(--neutral-foreground-rest)}.close-icon:active svg{background-color: var(--neutral-layer-4)}.close-icon:active svg g path{fill: color-mix(in srgb, var(--neutral-foreground-rest), transparent 67%)}.header-controls{rapid-button{--base-height-multiplier: 8}rapid-button::part(control){padding: 0 calc((8 + var(--design-unit) * 1 * var(--density)) * 1px)}}`,rBe=Z1,iBe=L1,aBe=X1,oBe=class extends $1{}.compose(Object.assign({baseName:`dialog`,shadowOptions:aBe,styles:L9,template:iBe},rBe)),sBe=class extends n0{}.compose(Object.assign({baseName:`disclosure`,template:(e,t)=>e0(e,t),styles:(e,t)=>O` ${t0(e,t)} :host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height);color: var(--neutral-foreground-rest)}:host([appearance='accent']) .invoker{padding: calc((10 + (var(--design-unit) * 2 * var(--density))) * 1px)}#disclosure-content{padding: 0 calc(var(--design-unit) * 4px) calc(var(--design-unit) * 4px);text-align: center}`,shadowOptions:X1},r0)),cBe=class extends o0{}.compose(Object.assign({baseName:`divider`,template:(e,t)=>i0(e,t),styles:(e,t)=>O` ${a0(e,t)}`,shadowOptions:void 0},s0)),lBe=class extends d0{}.compose({baseName:`dropdown-menu`,styles:(e,t)=>O` ${c0(`rapid`,e,t)} .actions-menu{border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);gap: 0;margin: calc(var(--design-unit) * 1px) 0}rapid-menu{margin: 0 0 calc(var(--design-unit) * 1px) calc(var(--design-unit) * -2px);border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}`,template:u0}),uBe=O` ${f0}`,dBe=class extends v0{}.compose({baseName:`environment-indicator`,styles:uBe,template:p0}),{defaultConfig:fBe,shadowOptions:pBe,styles:mBe,template:hBe}=H7(E0),gBe=()=>E0(),_Be=P0,vBe=I0.compose({baseName:`file-reader`,styles:_Be,template:F0}),yBe=O` ${L0} ::-webkit-scrollbar{width: calc(var(--design-unit) * 3px)}::-webkit-scrollbar-track{background: rgb(31 33 38)}::-webkit-scrollbar-thumb{width: 8px;border-radius: 10px;box-shadow: inset 0 0 6px rgba(0 0 0 / 30%);background-color: var(--neutral-fill-rest);border: calc(var(--stroke-width) * 3px) solid var(--neutral-layer-4)}:host::part(select-file-button), :host::part(upload-file-button){margin: 0 0 calc(var(--design-unit) * 2px) calc(var(--design-unit) * 2px)}`,bBe=T` ${R0(`rapid`)} `,xBe=B0,SBe=class extends z0{}.compose(Object.assign({baseName:`file-upload`,shadowOptions:void 0,styles:yBe,template:bBe},xBe)),CBe=(e,t)=>O` ${V0} .filter-wrapper{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}.close-icon{border: calc(var(--stroke-width) * 1px) solid transparent}.close-icon:hover{border-color: var(--error-color);background: color-mix(in srgb, var(--error-color), transparent 75%)}.close-icon:hover svg path{fill: var(--error-color)}rapid-select{margin-bottom: calc(var(--design-unit) * 2px)}.flex-row rapid-text-field, .flex-row rapid-select{flex: 1}`,wBe=T` ${W0(`rapid`)} `,TBe=class extends K0{}.compose({baseName:`filter`,template:wBe,styles:CBe}),EBe=(e,t)=>O` ${q0(e,t)} .toggle, .toggle-collapsed{background: var(--neutral-layer-4);color: var(--neutral-foreground-hint)}.toggle{border-top: calc(var(--stroke-width) * 2px) solid}.toggle:hover, .toggle-collapsed:hover{color: var(--accent-foreground-rest)}.filter-bar{background: var(--neutral-layer-3)}`,DBe=T` ${J0(`rapid`)} `,OBe=class extends Y0{}.compose({baseName:`filter-bar`,template:DBe,styles:EBe}),{defaultConfig:kBe,shadowOptions:ABe,styles:jBe,template:MBe}=H7(Q0),NBe=()=>Q0(),PBe=class extends t2{}.compose(Object.assign({baseName:`flipper`,template:(e,t)=>$0(e,t),styles:(e,t)=>O` ${e2(e,t)} :host{color: var(--neutral-foreground-rest)}:host(:hover){color: var(--neutral-foreground-rest)}:host::before{background: color-mix(in srgb, var(--accent-fill-rest), transparent 50%);border: calc(var(--stroke-width) * 1px) solid var(--accent-fill-rest);color: var(--neutral-foreground-rest)}:host(:hover)::before{background: var(--accent-fill-rest);color: var(--neutral-foreground-rest)}`,shadowOptions:void 0},n2)),FBe=O` ${r2} div.flyout{background-color: var(--neutral-layer-1);border-color: var(--neutral-stroke-rest);color: var(--neutral-foreground-rest);padding: calc(var(--design-unit) * 4px)}div.background{padding: calc(var(--design-unit) * 4px) 0}:host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height)}:host([position='left']) div.flyout{border-right-style: solid;border-right-width: calc(var(--stroke-width) * 1px)}:host([position='right']) div.flyout{border-left-style: solid;border-left-width: calc(var(--stroke-width) * 1px)}div.exit{cursor: pointer;width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);display: flex;justify-content: center;align-items: center}div.content, div.footer{padding: 0 0 calc(var(--design-unit) * 2px)}div.exit:hover{background-color: var(--neutral-fill-hover);border-radius: calc(var(--stroke-width) * 3px)}`,IBe=T` ${i2(`rapid`)} `,LBe=o2,RBe=class extends a2{}.compose(Object.assign({baseName:`flyout`,shadowOptions:void 0,styles:FBe,template:IBe},LBe)),{defaultConfig:zBe,shadowOptions:BBe,styles:VBe,template:HBe}=H7(u2),UBe=()=>u2(),{defaultConfig:WBe,shadowOptions:GBe,styles:KBe,template:qBe}=H7(f2),JBe=()=>f2(),YBe=(e,t)=>O` ${m2(e,t)}`,XBe=(e,t)=>p2(e,t);var ZBe=class extends h2{};let QBe={nextFlipper:T`<rapid-flipper @click="${e=>e.scrollToNext()}" aria-hidden="${e=>e.flippersHiddenFromAT}"></rapid-flipper>`,previousFlipper:T`<rapid-flipper @click="${e=>e.scrollToPrevious()}" direction="previous" aria-hidden="${e=>e.flippersHiddenFromAT}"></rapid-flipper>`},$Be=ZBe.compose(Object.assign({baseName:`horizontal-scroll`,template:XBe,styles:YBe,shadowOptions:g2},QBe)),eVe=(e,t)=>O` ${_2(e,t)}`,tVe=T` ${v2(`rapid`)} `;var nVe=class extends S2{};let rVe=b2,iVe=y2,aVe=nVe.compose(Object.assign({baseName:`icon`,template:tVe,styles:eVe,shadowOptions:iVe},rVe)),oVe=class extends T2{}.compose(Object.assign({baseName:`listbox`,template:(e,t)=>C2(e,t),styles:(e,t)=>O` ${w2(e,t)} :host{padding: 0;max-width: 300px;/** if removed max-width will be fit-content */}::slotted(*:last-child){border-bottom: none}`,shadowOptions:void 0},E2)),sVe=class extends k2{}.compose(Object.assign({baseName:`option`,template:(e,t)=>D2(e,t),styles:(e,t)=>O` ${O2(e,t)} :host{border-radius: 0;padding: 0 calc(var(--design-unit) * 4px);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host(.selected), :host(:not([disabled])[aria-selected='true']:active), :host(:not([disabled])[aria-selected='true']:hover){background: var(--neutral-layer-2);color: var(--accent-fill-rest);font-weight: 500}`,shadowOptions:void 0},A2)),cVe=class extends N2{}.compose(Object.assign({baseName:`menu`,template:(e,t)=>j2(e,t),styles:(e,t)=>O` ${M2(e,t)} :host{border: calc(var(--focus-stroke-width) * 1px) solid color-mix(in srgb, ${ml}, transparent 15%);padding: 0}`,shadowOptions:void 0},P2)),lVe=class extends L2{}.compose(Object.assign({baseName:`menu-item`,template:(e,t)=>F2(e,t),styles:(e,t)=>O` ${I2(e,t)} :host{margin: 0;--control-corner-radius: 0;background: var(--neutral-fill-stealth-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host(:hover){background: color-mix(in srgb, ${ml}, transparent 15%);border: calc(var(--focus-stroke-width) * 1px) solid color-mix(in srgb, ${ml}, transparent 15%)}:host(:focus){background: var(--neutral-fill-stealth-hover)}:host(.indent-0){border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-stealth-hover)}/* UX team wants border: solid 1px #2E3339;background: #2E3339 */ /* tokens being used by fast background: ${ml} color: ${H} */`,shadowOptions:void 0},R2)),uVe=O` ${L9}`,dVe=V2,fVe=z2,pVe=B2,mVe=class extends H2{}.compose(Object.assign({baseName:`modal`,shadowOptions:pVe,styles:uVe,template:fVe},dVe)),hVe=O` ${XC} .root{min-width: 0}.control{height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px );min-height: 0;outline: none;border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height);font-family: var(--body-font);box-sizing: border-box}:host(:focus-within:not([disabled])) .control{outline: none;border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}.control:hover:not(:focus):not([disabled]){outline: none;border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}#display-field{min-height: unset;padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px);font-family: var(--body-font), sans-serif;font-size: var(--type-ramp-base-font-size);background-color: transparent}#display-field:focus{outline: none;background: unset}#display-field:hover:not(:focus):not([disabled]){outline: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);left: calc( 100% - ((var(--base-height-multiplier) * (var(--design-unit) - 1)) + (var(--design-unit) - 2)) * 1px );background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}#arrow-icon{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);fill: var(--neutral-foreground-rest)}.label{color: var(--neutral-foreground-hint)}.options{border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);overflow-x: hidden}rapid-checkbox{border-bottom: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);padding: calc((var(--design-unit) + 1) * 1px) 0 calc((var(--design-unit) + 1) * 1px) calc((var(--design-unit) + 1) * 1px);margin: 0}rapid-checkbox:hover:not([disabled]){background: var(--neutral-layer-4)}rapid-checkbox::part(label){overflow-x: hidden;text-overflow: ellipsis;white-space: nowrap}rapid-checkbox[disabled]{cursor: not-allowed}`,gVe=T` ${ew(`rapid`)} `;var _Ve=class extends nw{};let vVe=tw,yVe=_Ve.compose(Object.assign({baseName:`multiselect`,template:gVe,styles:hVe,shadowOptions:void 0},vVe)),bVe=class extends S7{}.compose({baseName:`notification-listener`,template:x7,shadowOptions:{mode:`open`,delegatesFocus:!0}}),xVe=(e,t)=>O` :host{flex: 1 1 auto;box-sizing: border-box}:host([disabled]){opacity: var(--disabled-opacity);cursor: not-allowed}:host .control{height: 100%;width: 100%;border: none;background-color: transparent;padding: 0 calc(var(--design-unit) * 2px);color: var(--neutral-foreground-rest);font-size: var(--type-ramp-base-font-size);font-family: var(--body-font)}:host .root{display: flex;box-sizing: border-box;position: relative;align-items: center;border-radius: calc(var(--control-corner-radius) * 1px);border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:hover:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host(:focus-within:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{display: block;color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0;font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);line-height: var(--type-ramp-base-line-height)}.label-hidden{margin: 0}.controls{position: absolute;right: 3px;width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--neutral-fill-rest);border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center;flex-direction: column;cursor: pointer}.step-down, .step-up{width: 1em;height: 1em;margin: -2px}.step-up-glyph, .step-down-glyph{fill: var(--neutral-foreground-hint)}.control:focus-visible{outline: none}:host .control-field .control{width: 100%}${N0}`;var SVe=class extends a4{};let CVe=s4,wVe=U2,TVe=o4,EVe=SVe.compose(Object.assign({baseName:`number-field`,template:wVe,styles:xVe,shadowOptions:TVe},CVe)),DVe=class extends u4{}.compose({baseName:`optgroup`,template:(e,t)=>l4(e,t),styles:(e,t)=>O` ${c4(e,t)}`}),OVe=class extends _4{}.compose(Object.assign({baseName:`system-health-overlay`,template:v4,styles:y4,shadowOptions:void 0},b4)),kVe=O` ${x4} :host{--pill-fill: ${rl};--pill-fill-hover: ${il};--pill-foreground: ${H}}`,AVe=S4,jVe=class extends w4{}.compose(Object.assign({baseName:`pill`,template:AVe,styles:kVe,shadowOptions:void 0},C4)),MVe=class extends p4{}.compose(Object.assign({baseName:`progress`,template:(e,t)=>d4(e,t),styles:(e,t)=>O` ${f4(e,t)}`,shadowOptions:void 0},m4)),NVe=class extends w3{}.compose(Object.assign({baseName:`progress-ring`,template:(e,t)=>S3(e,t),styles:(e,t)=>O` ${C3(e,t)}`,shadowOptions:void 0},T3)),PVe=class extends O3{}.compose(Object.assign({baseName:`radio`,template:(e,t)=>E3(e,t),styles:(e,t)=>O` ${D3(e,t)} :host{margin: 0}:host .control{background: transparent}:host([aria-checked='true']) .control{background: transparent;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}:host .label{padding-inline-start: calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:hover{background: transparent}:host([aria-checked='true']:not([disabled])) .control:hover{background: transparent;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-hover)}.checked-indicator, :host([aria-checked='true']:not([disabled])) .control:hover .checked-indicator{background: var(--accent-fill-rest)}`,shadowOptions:void 0},k3)),FVe=class extends M3{}.compose(Object.assign({baseName:`radio-group`,template:(e,t)=>A3(e,t),styles:(e,t)=>O` ${j3(e,t)}`,shadowOptions:void 0},N3)),IVe=O` ${P3} :host{font-family: var(--body-font)}`,LVe=T` ${F3(`rapid`)} `,RVe=class extends I3{}.compose(Object.assign({baseName:`scheduler`,template:LVe,styles:IVe,shadowOptions:void 0},L3)),zVe=O` ${K3} :host{font-family: var(--body-font)}`,BVe=T` ${r6(`rapid`)} `,VVe=class extends i6{}.compose(Object.assign({baseName:`scheduler-cron-builder`,template:BVe,styles:zVe,shadowOptions:void 0},a6)),HVe=O` ${o6} :host{font-family: var(--body-font)}`,UVe=T` ${s6(`rapid`)} `,WVe=class extends c6{}.compose(Object.assign({baseName:`scheduler-timezone`,template:UVe,styles:HVe,shadowOptions:void 0},l6)),GVe=O` ${u6}`,KVe=T` ${d6(`rapid`)} `,qVe=class extends f6{}.compose(Object.assign({baseName:`search-bar`,template:KVe,styles:GVe,shadowOptions:void 0},p6)),JVe=class extends g6{}.compose(Object.assign({baseName:`search-bar-combobox`,template:(e,t)=>h6(e,t),styles:(e,t)=>O` ${m6(e,t)} :host{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--neutral-stroke-rest));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not([open])){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}:host .listbox ::slotted(*:last-child){border-bottom: none}`,shadowOptions:_6},v6)),YVe=class extends T6{}.compose(Object.assign({baseName:`section-navigator`,template:b6,styles:(e,t)=>y6,shadowOptions:E6},D6)),XVe=class extends A6{}.compose(Object.assign({baseName:`segmented-control`,template:(e,t)=>O6(e,t),styles:(e,t)=>O` ${k6(e,t)} :host{font-family: var(--body-font);margin: 0}:host ::slotted(*){transition: color 0.4s ease 0s}:host ::slotted(label){color: var(--neutral-foreground-rest)}:host ::slotted(rapid-segmented-item:first-of-type){border-radius: calc(var(--control-corner-radius) * 1px) 0 0 calc(var(--control-corner-radius) * 1px);border-right-width: 0}:host ::slotted(rapid-segmented-item:last-of-type){border-radius: 0 calc(var(--control-corner-radius) * 1px) calc(var(--control-corner-radius) * 1px) 0;border-left-width: 0}:host ::slotted(rapid-segmented-item:only-of-type){border-radius: calc(var(--control-corner-radius) * 1px);border-left-width: 1px;border-right-width: 1px}:host ::slotted(*[aria-checked='true']){background: var(--neutral-fill-rest);box-shadow: none;color: var(--neutral-foreground-rest)}:host([appearance='primary']) ::slotted(*[aria-checked='true']){background: var(--accent-fill-rest);border-color: transparent;box-shadow: none;color: var(--foreground-on-accent-rest)}`,shadowOptions:void 0},{})),ZVe=class extends O3{}.compose(Object.assign({baseName:`segmented-item`,template:(e,t)=>j6(e,t),styles:(e,t)=>O` ${M6(e,t)} :host{color: var(--neutral-fill-strong-rest);font-size: var(--type-ramp-minus-2-font-size);font-weight: 500;border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);box-sizing: border-box;height: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit) - 4) * 1px);padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);margin: 0}:host([aria-checked='true']){color: color-mix(in srgb, white, transparent 10%)}`,shadowOptions:void 0},{})),QVe=class extends F6{}.compose(Object.assign({baseName:`select`,template:(e,t)=>N6(e,t),styles:(e,t)=>O` ${P6(e,t)} :host{border-radius: calc(var(--control-corner-radius) * 1px);border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:focus-within:not([disabled])){border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus)}:host(:hover:not([disabled]):not(.open)){border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host([open][position='below']) .listbox{padding: 0;margin-top: calc(${B} * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest);border-radius: calc(var(--control-corner-radius) * 1px)}.control{padding: 0 calc((var(--design-unit) - 2) * 1px) 0 calc(var(--design-unit) * 2px)}:host(:not([disabled])) .control:active{background: none}.indicator{width: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);height: calc((var(--base-height-multiplier) * (var(--design-unit) - 1)) * 1px);background-color: var(--dropdown-indicator-background, var(--neutral-fill-rest));border-radius: calc(var(--control-corner-radius) * 1px);display: flex;justify-content: center;align-items: center}.select-indicator{width: calc(var(--design-unit) * 3.5px);height: calc(var(--design-unit) * 3.5px);transition: all 0.35s;min-width: unset;min-height: unset}.selected-value{display: flex;align-items: center;height: calc(100% - (var(--design-unit) * 1px));padding: 0;margin: 0}:host(:focus-within:not([disabled])) .indicator{background-color: transparent}:host([open]) .select-indicator{transition: all 0.35s;transform: rotate(180deg)}::slotted([role='option']){margin: 0}`,shadowOptions:void 0},I6)),$Ve=class extends z6{}.compose(Object.assign({baseName:`skeleton`,template:(e,t)=>L6(e,t),styles:(e,t)=>O` ${R6(e,t)} :host{--skeleton-fill: var( --neutral-fill-stealth-rest );/** value in ux doc rgba(242 242 242 / 0.1) */}`,shadowOptions:void 0},B6)),eHe=class extends U6{}.compose(Object.assign({baseName:`slider`,template:(e,t)=>V6(e,t),styles:(e,t)=>O` ${H6(e,t)} .thumb-cursor{background: var(--accent-fill-rest);border-radius: calc(var(--control-corner-radius) * 2px)}.thumb-cursor:hover, .thumb-cursor:focus, .thumb-cursor:active{background: var(--accent-fill-rest);border-radius: transparent}:host(:focus-visible) .thumb-cursor{box-shadow: 0 0 0 0}.thumb-cursor:hover::after, .thumb-cursor:focus::after, .thumb-cursor:active::after{content: '';height: calc(var(--thumb-size) * 2px);width: calc(var(--thumb-size) * 2px);border-radius: calc(var(--control-corner-radius) * 4px);position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: -1}.thumb-cursor:hover::after{background-color: color-mix(in srgb, ${Fc}, transparent 90%)}.thumb-cursor:focus::after{background-color: color-mix(in srgb, ${Fc}, transparent 80%)}.thumb-cursor:active::after{background-color: color-mix(in srgb, ${Fc}, transparent 70%)}.track{background-color: var(--neutral-fill-rest)}:host([orientation='horizontal']) .track .track-progress{background-color: var(--neutral-stroke-rest);height: calc((var(--track-width) + 2) * 1px) !important}:host([orientation='vertical']) .track .track-progress{background-color: var(--neutral-stroke-rest);width: calc((var(--track-width) + 2) * 1px) !important}`,shadowOptions:void 0},W6)),R9=class extends q6{}.compose(Object.assign({baseName:`slider-label`,template:(e,t)=>G6(e,t),styles:(e,t)=>O` ${K6(e,t)} .label{padding: calc((var(--design-unit) - 1) * 2px) calc(var(--design-unit) * 2px);border-radius: calc(var(--control-corner-radius) * 1px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-4);background-color: var(--neutral-fill-strong-hover);color: var(--neutral-layer-4);text-align: center;font-size: var(--type-ramp-minus-1-font-size, 12px)}`,shadowOptions:void 0},J6)),tHe=O` ${Q6} .snackbar{border: calc(var(--stroke-width) * 1px) solid var(--neutral-layer-2);background-color: var(--neutral-layer-1);padding: calc((var(--design-unit) - 2) * 1px) calc(var(--design-unit) * 4px)}:host([type='error']) .snackbar::after{background-color: var(--error-color)}.content{font-family: var(--body-font);font-size: var(--type-ramp-minus-2-font-size);color: var(--neutral-foreground-rest)}.action{gap: calc(var(--design-unit) * 2px)}`,nHe=T` ${$6(`rapid`)} `,rHe=e8,iHe=class extends t8{}.compose({baseName:`snackbar`,shadowOptions:rHe,styles:tHe,template:nHe}),aHe=class extends i8{}.compose({baseName:`stacking-icons`,template:r8,styles:(e,t)=>O` ${n8(e,t)}`}),oHe=class extends u8{}.compose({baseName:`status-pill`,template:o8,styles:a8}),sHe=O` ${R7} :host{font-family: var(--body-font)}:host([orientation='horizontal']){height: 100%}.stepper-tab-panel{border: none;height: auto}:host([orientation='horizontal']) .stepper-tab-panel{height: 100%}.stepper-tab{background-color: var(--neutral-layer-3);border: none}.stepper-panel-container{padding: calc(var(--design-unit) * 4px)}.action-buttons-container{padding: calc(var(--design-unit) * 2px);width: auto;gap: calc(var(--design-unit) * 2px)}.stepper-tab-menu{margin-bottom: calc(var(--design-unit) * 4px)}.stepper-tab-progress{padding: calc(var(--design-unit) * 4px) 0}label{padding: 0 calc(var(--design-unit) * 2px);color: var(--neutral-foreground-hint)}`,cHe=T` ${L7(`rapid`)} `,lHe=class extends z7{}.compose(Object.assign({baseName:`stepper`,template:cHe,styles:sHe,shadowOptions:void 0},B7)),uHe=(e,t)=>O` ${p8(e,t)} rapid-tree-item{--design-unit: 2.5;--neutral-fill-stealth-rest: var(--neutral-layer-3);--neutral-fill-stealth-hover: var(--fill-color);--neutral-fill-rest: var(--fill-color);--base-height-multiplier: 14.5;border-bottom: calc(var(--stroke-width) * 1px) solid var(--fill-color)}.completed-icon{color: var(--success-color)}.tree-item::part(positioning-region)::before{width: var(--tree-item-nested-width)}.stepper-icon{margin-right: calc(var(--design-unit) * 2px)}.error-icon{color: var(--error-color)}.step-number{font-size: var(--type-ramp-minus-1-font-size);border: calc(var(--stroke-width) * 1px) solid var(--neutral-fill-input-rest)}.step-title{font-size: var(--type-ramp-base-font-size)}.angle-icon{margin: 0 calc(var(--design-unit) * 4px)}:host([completed]) .step-number{border-color: var(--success-color);color: white;background-color: var(--success-color)}:host([completed]) .step-title{color: var(--success-color)}:host([error]) .step-number{border-color: var(--error-color);color: white;background-color: var(--error-color)}:host([error]) .step-title{color: var(--error-color)}`,dHe=T` ${f8(`rapid`)} `,fHe=class extends m8{}.compose(Object.assign({baseName:`stepper-tab`,template:dHe,styles:uHe,shadowOptions:void 0},h8)),pHe=class extends _8{}.compose(Object.assign({baseName:`stepper-tab-panel`,template:(e,t)=>g8(e,t),shadowOptions:void 0},v8)),mHe=class extends x8{}.compose(Object.assign({baseName:`switch`,template:(e,t)=>y8(e,t),styles:(e,t)=>O` ${b8(e,t)} :host{--primary-gradient-angle: -113.5deg}.switch{background: none;border-color: var(--neutral-stroke-rest)}.checked-indicator{background-color: var(--neutral-stroke-rest)}.switch:hover{border-color: var(--neutral-stroke-rest);background: none}:host([aria-checked='true']) .switch{background: none}:host([aria-checked='true']) .checked-indicator{background: var(--accent-fill-rest)}:host([aria-checked='true']:not([disabled])) .switch:hover, :host([aria-checked='true']:not([disabled])) .switch:active{background: none}:host([aria-checked='true']:not([disabled])) .switch:hover .checked-indicator, :host([aria-checked='true']:not([disabled])) .switch:active .checked-indicator{background: var(--accent-fill-rest)}`,shadowOptions:void 0},{switch:`<div class="checked-indicator" part="checked-indicator"></div>`})),hHe=class extends w8{}.compose(Object.assign({baseName:`tab`,template:(e,t)=>S8(e,t),styles:(e,t)=>O` ${C8(e,t)} :host{background-color: var(--neutral-layer-2);border-radius: calc(var(--control-corner-radius) * 2px);box-shadow: 0 0 15px 0 rgb(0 0 0 / 30%);margin-right: calc(var(--design-unit) * 5px);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host([aria-selected='true']), :host([aria-selected='true']:hover){background-color: var(--neutral-layer-4);font-weight: 700}/* * Sustained alert, sampling the flash phase the platform animates on the document. Every * alerting surface reads that one value, so tabs and grid rows brighten and fade together * however long ago each of them started alerting. * * Mixing towards transparent and currentColor lets the tab fade back to its own resting * colours, so selected and unselected tabs each return to the right background. * * !important because a :host rule loses to any app stylesheet that colours tabs from the light * DOM, and an alert nobody can see is worse than no alert. */ :host([alert]){background-color: color-mix( in srgb, var(--tab-alert-color, var(--error-fill-rest)) calc(var(${k0}, 0) * 100%), transparent ) !important;color: color-mix( in srgb, contrast-color(var(--tab-alert-color, var(--error-fill-rest))) calc(var(${k0}, 0) * 100%), currentColor ) !important}/* Reduced motion stops the clock, leaving the phase at 0, so paint a steady alert instead. */ @media (prefers-reduced-motion: reduce){:host([alert]){background-color: var(--tab-alert-color, var(--error-fill-rest)) !important;color: contrast-color(var(--tab-alert-color, var(--error-fill-rest))) !important}}`,shadowOptions:void 0},T8)),gHe=class extends O8{}.compose(Object.assign({baseName:`tab-panel`,template:(e,t)=>E8(e,t),styles:(e,t)=>O` ${D8(e,t)} :host{padding: 0;background-color: var(--neutral-layer-card-container);border-radius: 0 0 var(--card-corner-radius, calc(var(--control-corner-radius) * 1.5px)) var(--card-corner-radius, calc(var(--control-corner-radius) * 1.5px));border-style: solid;border-width: var(--tabs-border-width, 1px);border-color: var(--tabs-border-color, var(--neutral-stroke-rest))}`,shadowOptions:void 0},k8)),_He=class extends M8{}.compose(Object.assign({baseName:`tabs`,template:(e,t)=>A8(e,t),styles:(e,t)=>O` ${j8(e,t)} :host{background: var(--neutral-layer-3);border-radius: calc(var(--control-corner-radius) * 1px)}:host(:not([appearance='secondary'])){background: var(--rapid-layout-item-background, var(--neutral-layer-3));border-radius: var(--card-corner-radius, calc(var(--control-corner-radius) * 1px));border: var(--card-border, 0)}:host([appearance='secondary']){background: transparent}:host .tablist{padding: 0;display: grid;width: max-content;margin-top: 0}:host .tabpanel{height: 100%;min-height: 0}:host([appearance='secondary']) .tablist{margin-bottom: 0}:host .end, :host .start{padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);height: calc(100% - 1px);display: flex;align-items: center}::slotted([slot='tab']:hover){color: var(--neutral-foreground-rest);background: var(--neutral-layer-1)}::slotted([role='tab']){border-radius: calc(var(--control-corner-radius) * 1.5px) calc(var(--control-corner-radius) * 1.5px) 0 0;background: var(--tab-rest-background-color, var(--neutral-layer-4));padding: 0 calc((16 + var(--design-unit) * 2 * var(--density)) * 1px);margin-right: 2px;box-shadow: none;font-size: var(--type-ramp-minus-1-font-size);border-style: solid;border-width: var(--tab-rest-border-width, 1px);border-color: var(--tab-rest-border-color, transparent)}::slotted([role='tab'][aria-selected='true']:not([appearance='secondary'])){border-style: solid;border-width: var(--tab-active-border-width, 1px 1px 0 1px);border-color: var(--tab-active-border-color, var(--neutral-stroke-rest));background: var(--tab-active-background-color, var(--neutral-layer-card-container))}::slotted([role='tab'][aria-selected='true']){color: var(--accent-foreground-rest);background: var(--neutral-layer-card-container)}/* stylelint-disable selector-class-pattern */ .activeIndicator{display: none}:host([appearance='secondary']) .tablist .activeIndicator{display: block;height: 1px;margin-top: unset}::slotted([role='tab'][aria-selected='true'][appearance='secondary']){background: none}::slotted([role='tab'][appearance='secondary']){margin-left: 0;box-shadow: none;background: none}:host([appearance='secondary']:hover){color: var(--neutral-foreground-rest);background: none}:host([appearance='secondary']) ::slotted([role='tabpanel']){border: 0}`,shadowOptions:void 0},N8)),vHe=class extends I8{}.compose(Object.assign({baseName:`text-area`,template:(e,t)=>P8(e,t),styles:(e,t)=>O` ${F8(e,t)} :host{display: grid;flex: 1 1 auto;box-sizing: border-box}:host .control{height: 100%;border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);border-radius: calc(var(--control-corner-radius) * 1px);padding: calc(var(--design-unit) * 2px)}:host(:hover:not([disabled])) .control{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover)}:host(:is(:focus, :focus-within, :focus-visible):not([disabled])) .control{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}`,shadowOptions:void 0},L8)),yHe=class extends B8{}.compose(Object.assign({baseName:`text-field`,template:(e,t)=>R8(e,t),styles:(e,t)=>O` ${z8(e,t)} :host{display: block;flex: 1 1 auto;box-sizing: border-box}:host .control{height: 100%;border-radius: calc(var(--control-corner-radius) * 1px);padding: 0 calc(var(--design-unit) * 2px)}:host .control-field .control{width: 100%}:host .root{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}:host(:hover:not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover);box-shadow: none}:host(:is(:focus, :focus-within, :focus-visible):not([disabled])) .root{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{margin: 0}:host input::placeholder{color: var(--neutral-foreground-hint);opacity: 75%}`,shadowOptions:V8},H8)),bHe=O` ${U8} .toast{background-color: ${Tc};border-radius: calc(var(--control-corner-radius) * 2px);border: calc(var(--stroke-width) * 1px) solid var(--neutral-stroke-rest)}.top{align-items: flex-start}:host{font-size: var(--type-ramp-base-font-size);font-family: var(--body-font);line-height: var(--type-ramp-base-line-height);color: var(--neutral-foreground-rest)}.content{font-size: var(--type-ramp-minus-1-font-size)}.date{margin: calc(var(--design-unit) * 2px) calc(var(--design-unit) * 0) calc(var(--design-unit) * 1px)}.content-wrapper{padding: calc(var(--design-unit) * 2px)}.toast::after{background-color: var(--accent-fill-rest);border-radius: 0;height: calc(100% - calc(var(--design-unit) * 5px));margin: calc(var(--design-unit) * 0) calc(var(--design-unit) * 1px)}:host([notify='warning']) .toast::after{background-color: var(--warning-color)}:host([notify='success']) .toast::after{background-color: var(--success-color)}:host([notify='critical']) .toast::after, :host([notify='serious']) .toast::after, :host([notify='error']) .toast::after{background-color: var(--error-color)}`,xHe=K8,SHe=G8,CHe=class extends q8{}.compose(Object.assign({baseName:`toast`,shadowOptions:SHe,styles:bHe,template:W8},xHe)),wHe=class extends X8{}.compose(Object.assign({baseName:`toolbar`,template:(e,t)=>J8(e,t),styles:(e,t)=>O` ${Y8(e,t)} :host{align-items: center;color: var(--neutral-foreground-rest)}.positioning-region{align-items: center}`,shadowOptions:void 0},Z8)),THe=class extends e5{}.compose(Object.assign({baseName:`tooltip`,template:(e,t)=>Q8(e,t),styles:(e,t)=>O` ${$8(e,t)} :host{visibility: visible}.tooltip{padding: calc((var(--design-unit) - 1) * 2px) calc(var(--design-unit) * 2px);text-align: center;white-space: inherit;font-weight: 400}rapid-anchored-region.bottom .tooltip{margin-top: calc(var(--design-unit) * 1px);margin-left: calc(var(--design-unit) * 2px)}rapid-anchored-region.top.right .tooltip, rapid-anchored-region.bottom.right .tooltip{margin-left: 0}`,shadowOptions:void 0},t5)),EHe=class extends i5{}.compose(Object.assign({baseName:`tree-item`,template:(e,t)=>n5(e,t),styles:(e,t)=>O` ${r5(e,t)} :host{font-size: var(--type-ramp-base-font-size);color: var(--neutral-foreground-rest);background-color: transparent}:host(.nested) .expand-collapse-button{background: var(--neutral-fill-rest);border-radius: calc(var(--control-corner-radius) * 1px);width: calc(var(--design-unit) * 5px);height: calc(var(--design-unit) * 5px);margin-left: calc(var(--design-unit) * 2px)}:host([selected]) .positioning-region{background: var(--neutral-fill-stealth-active)}.positioning-region::before{width: calc(var(--design-unit) * 1px)}:host([selected])::after{background: var(--accent-fill-rest);background-origin: border-box;background-size: cover;background-repeat: no-repeat}:host([slot='item']) .content-region{margin-inline-start: calc(var(--design-unit) * 4px + var(--expand-collapse-button-size))}.expand-collapse-glyph{width: calc(var(--design-unit) * 3px);height: calc(var(--design-unit) * 3px)}`,shadowOptions:void 0},{expandCollapseGlyph:`
|
|
1003
1003
|
<svg viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" class="expand-collapse-glyph">
|
|
1004
1004
|
<path d="M4.023 15.273L11.29 8 4.023.727l.704-.704L12.71 8l-7.984 7.977-.704-.704z"/>
|
|
1005
|
-
</svg>`})),
|
|
1005
|
+
</svg>`})),DHe=class extends s5{}.compose(Object.assign({baseName:`tree-view`,template:(e,t)=>a5(e,t),styles:(e,t)=>O` ${o5(e,t)}`,shadowOptions:void 0},c5)),OHe=(e,t)=>O` ${l5(e,t)} a{color: var(--accent-fill-rest);opacity: 65%}a:hover{opacity: 100%}.url-input-link{font-family: var(--body-font);font-size: var(--type-ramp-base-font-size);top: calc(((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) / 2 * 1px)}`,kHe=T` ${u5(`rapid`)} `,AHe=class extends f5{}.compose(Object.assign({baseName:`url-input`,template:kHe,styles:OHe,shadowOptions:void 0},d5)),jHe=O` ${p5} .digit .control{height: 100%;border-radius: calc(var(--control-corner-radius) * 1px);padding: 0 calc(var(--design-unit) * 2px)}.digit .control-field .control{width: 100%}.digit .root{border-style: solid;border-width: var(--neutral-stroke-width-rest, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-rest, var(--focus-stroke-outer));background-color: var(--neutral-fill-input-rest);height: calc( (((var(--base-height-multiplier) + var(--density)) * var(--design-unit)) - 4) * 1px )}.digit:hover:not(.disabled) .root{border-style: solid;border-width: var(--neutral-stroke-width-hover, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-hover, var(--neutral-foreground-rest));background: var(--neutral-fill-input-hover);box-shadow: none}.digit:focus-within:not(.disabled) .root{border-style: solid;border-width: var(--neutral-stroke-width-focus, 1px 1px 1px 1px);border-color: var(--neutral-stroke-fill-focus, var(--accent-fill-rest));background-color: var(--neutral-fill-input-focus);box-shadow: none}.label{color: var(--neutral-foreground-hint);font-weight: 700;margin: calc(var(--design-unit) * 2px) 0}.label-hidden{margin: 0}`,MHe=m5;var NHe=class extends v5{};let PHe=g5,FHe=h5,z9={designSystemProvider:nBe,rapidAccordion:lIe,rapidAccordionItem:uIe,rapidAiCriteriaSearch:pIe,rapidAiIndicator:mIe,rapidActionsMenu:dIe,rapidAnchor:kIe,rapidSectionNavigator:YVe,rapidAnchoredRegion:AIe,rapidAvatar:jIe,rapidBadge:MIe,rapidBanner:FIe,rapidBreadcrumb:IIe,rapidBreadcrumbItem:LIe,rapidButton:RIe,rapidCalendar:zIe,rapidCard:BIe,rapidCategorizedMultiselect:GIe,rapidCheckbox:KIe,rapidCombobox:qIe,rapidConnectionIndicator:JIe,rapidDataGrid:$Ie,rapidDataGridCell:iLe,rapidDataGridRow:lLe,rapidDatePicker:fLe,rapidDialog:oBe,rapidDisclosure:sBe,rapidDivider:cBe,rapidDropdownMenu:lBe,rapidEnvironmentIndicator:dBe,rapidErrorBoundary:gBe,rapidFileReader:vBe,rapidFileUpload:SBe,rapidFilter:TBe,rapidFilterBar:OBe,rapidFlexLayout:NBe,rapidFlipper:PBe,rapidFlyout:RBe,rapidGridLayout:UBe,rapidGridLayoutItem:JBe,rapidHorizontalScroll:$Be,rapidIcon:aVe,rapidListbox:oVe,rapidListboxOption:sVe,rapidMenu:cVe,rapidMenuItem:lVe,rapidModal:mVe,rapidMultiselect:yVe,rapidNotificationListener:bVe,rapidNumberField:EVe,rapidOptgroup:DVe,rapidPill:jVe,rapidProgress:MVe,rapidProgressRing:NVe,rapidRadio:PVe,rapidRadioGroup:FVe,rapidScheduler:RVe,rapidSchedulerCronBuilder:VVe,rapidSchedulerTimezone:WVe,rapidSearchBar:qVe,rapidSearchBarCombobox:JVe,rapidSegmentedControl:XVe,rapidSegmentedItem:ZVe,rapidSelect:QVe,rapidSkeleton:$Ve,rapidSlider:eHe,rapidSliderLabel:R9,rapidSnackbar:iHe,rapidStackingIcons:aHe,rapidStatusPill:oHe,rapidStepper:lHe,rapidStepperTab:fHe,rapidStepperTabPanel:pHe,rapidSwitch:mHe,rapidSystemHealthOverlay:OVe,rapidTab:hHe,rapidTabPanel:gHe,rapidTabs:_He,rapidTextArea:vHe,rapidTextField:yHe,rapidToast:CHe,rapidToolbar:wHe,rapidTooltip:THe,rapidTreeItem:EHe,rapidTreeView:DHe,rapidUrlInput:AHe,rapidVerificationCodeInput:NHe.compose(Object.assign({baseName:`verification-code-input`,template:MHe,styles:jHe,shadowOptions:FHe},PHe)),register(e,...t){if(e)for(let n in this)n!==`register`&&this[n]().register(e,...t)}},B9=(e,t=`rapid`)=>h4(e,t,I9,w9),V9=es(`#585858`);is.create(V9.r,V9.g,V9.b);let H9=es(`#202126`),IHe=is.create(H9.r,H9.g,H9.b);ls.from(IHe);function U9(e,...t){let n=``;return e.forEach((e,r)=>{n+=e,r<t.length&&(n+=t[r])}),n}let W9={number:`rapid-number-field`,text:`rapid-text-field`,date:`rapid-text-field`,datetimeLocal:`rapid-text-field`,checkbox:`rapid-checkbox`,button:`rapid-button`,select:`rapid-select`,option:`rapid-option`,optgroup:`rapid-optgroup`,radio:{input:`rapid-radio`,group:`rapid-radio-group`}},G9=U9` rapid-select, rapid-text-field, rapid-number-field{min-width: 180px}rapid-button.btn{padding: 0}rapid-button.btn-success{background-color: var(--accent-fill-active);border-color: var(--accent-fill-active)}rapid-button.btn-danger{background-color: var(--error-color);border-color: var(--error-border-color)}rapid-select::part(listbox){max-height: 15vh}`,K9=U9` border: unset;border: 1px solid var(--focus-stroke-outer);padding: calc(var(--design-unit) * 2.5px);border-radius: 10px;margin: calc(var(--design-unit) * 1px);`,q9={value:U9` ${G9} rapid-number-field, rapid-text-field{margin-bottom: 0}rapid-number-field::part(label){display: none}p.validation-msg{color: var(--neutral-foreground-rest)}`,rule:U9` ${G9} div.rule-container{${K9}}div.rule-container.error{border-color: var(--error-border-color)}`,operator:U9` ${G9} rapid-select{min-width: 350px}`,field:U9` ${G9} rapid-select{min-width: 350px}`,group:U9` ${G9} div.rules-group-container{${K9}}p.group-combinator-link{padding-left: calc(var(--design-unit) * 2.5px);color: var(--neutral-foreground-rest)}`},J9=class extends Y5{constructor(){super(...arguments),this.styles={customElements:W9,customStyles:q9}}};q([C],J9.prototype,`styles`,void 0),J9=q([$e({name:`rapid-expression-builder`,styles:u7.styles,template:u7.template})],J9);let Y9=class extends g7{constructor(){super(...arguments),this.styles={customElements:W9,customStyles:q9}}};q([C],Y9.prototype,`styles`,void 0),Y9=q([$e({name:`rapid-rule-expression-builder`,styles:u7.styles,template:u7.template})],Y9);let X9=class extends b7{constructor(){super(...arguments),this.styles={customElements:W9,customStyles:q9}}};q([C],X9.prototype,`styles`,void 0),X9=q([$e({name:`rapid-value-expression-builder`,styles:u7.styles,template:u7.template})],X9),O` ${`/* ============================================================================
|
|
1006
1006
|
* flexlayout-react base theme — VENDORED from flexlayout-react@0.10.8 (style/dark.css).
|
|
1007
1007
|
* ========================================================================== */
|
|
1008
1008
|
@charset "UTF-8";
|
|
@@ -2359,4 +2359,4 @@ ${e?`<li><strong>Minutes:</strong> Runs at every interval of minutes from the ho
|
|
|
2359
2359
|
&.flexlayout__tab_button--selected {
|
|
2360
2360
|
border: 0;
|
|
2361
2361
|
}
|
|
2362
|
-
}`}`;let Z9=()=>B9().register(z9),
|
|
2362
|
+
}`}`;let Z9=()=>B9().register(z9),LHe={LightMode:1,DarkMode:.23},RHe={baseLayerLuminance:_s,fillColor:Mc,accentPalette:yc,neutralPalette:_c,errorColor:J7,successColor:Z7,warningColor:e9,infoColor:l9,buyColor:r9,sellColor:o9,seriousNotifyColor:f9,designUnit:B,baseHeightMultiplier:gs,density:vs,controlCornerRadius:z,bodyFont:hs},Q9=`rapid-design-system-provider`,zHe=()=>{if(document.querySelector(Q9))return;let e=document.createElement(Q9);e.setAttribute(`with-defaults`,``),e.style.display=`block`;let t=document.createDocumentFragment();for(;document.body.firstChild;)t.appendChild(document.body.firstChild);e.appendChild(t),document.body.appendChild(e)},$9=()=>{Z9(),zHe()};if(typeof document<`u`){document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,$9,{once:!0}):$9();let e=window;e.rapid=Object.assign(e.rapid||{},{provideDesignSystem:B9,baseComponents:z9,registerRapidDesignSystem:Z9,tokens:RHe,StandardLuminance:LHe,docsUrl:`https://cdn.jsdelivr.net/npm/@genesislcap/foundation-rapid-cdn/components.md`,aiReference:`AI ASSISTANTS: When generating React code that uses Genesis Rapid Design System components, fetch https://cdn.jsdelivr.net/npm/@genesislcap/foundation-rapid-cdn/components.md for the component reference. In a normal app, import wrappers from @genesislcap/rapid-design-system/react (PascalCase: Button, TextField, …). In a Claude artifact, also load https://cdn.jsdelivr.net/npm/@genesislcap/foundation-rapid-cdn/dist/foundation-rapid-cdn.react.iife.min.js (after this main bundle and after React) — wrappers are exposed on window.rapid.react — destructure from there: const { Button, TextField } = window.rapid.react. Either way, do not emit raw <rapid-*> web component tags in JSX when wrappers are available.`})}return e.baseComponents=z9,e.provideDesignSystem=B9,e.registerRapidDesignSystem=Z9,e})({});
|