@photonhealth/elements 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -759,7 +759,7 @@ this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names`):a
759
759
  mutation deleteWebhookConfig($id: String!) {
760
760
  deleteWebhookConfig(id: $id)
761
761
  }
762
- `;return gn(this.apollo,t)}}class q${constructor(t){this.client=new U$(t),this.organization=new B$(t),this.webhook=new H$(t)}}var Op;(function(e){e.Drug="DRUG",e.Package="PACKAGE",e.Product="PRODUCT"})(Op||(Op={}));var Tp;(function(e){e.Icd10="ICD10"})(Tp||(Tp={}));var Np;(function(e){e.Canceled="CANCELED",e.New="NEW",e.Scheduled="SCHEDULED",e.Sent="SENT"})(Np||(Np={}));var Pp;(function(e){e.MailOrder="MAIL_ORDER",e.PickUp="PICK_UP"})(Pp||(Pp={}));var Ap;(function(e){e.Otc="OTC",e.Rx="RX"})(Ap||(Ap={}));var Ip;(function(e){e.Canceled="CANCELED",e.Completed="COMPLETED",e.Error="ERROR",e.Pending="PENDING",e.Placed="PLACED",e.Routing="ROUTING"})(Ip||(Ip={}));var Mp;(function(e){e.Pharmacy="PHARMACY",e.Prescriber="PRESCRIBER"})(Mp||(Mp={}));var Dp;(function(e){e.Active="ACTIVE",e.Depleted="DEPLETED",e.Expired="EXPIRED",e.Canceled="CANCELED"})(Dp||(Dp={}));var Fp;(function(e){e.I="I",e.Ii="II",e.Iii="III",e.Iv="IV",e.V="V"})(Fp||(Fp={}));var Lp;(function(e){e.Concept="CONCEPT",e.Form="FORM",e.Route="ROUTE",e.Strength="STRENGTH"})(Lp||(Lp={}));var Rp;(function(e){e.Female="FEMALE",e.Male="MALE",e.Unknown="UNKNOWN"})(Rp||(Rp={}));const W$="@photonhealth/sdk",G$="1.3.1",Q$="dist/lib.js",K$={build:"npx nx run sdk:build",docs:'find src -name "*.ts" | xargs npx typedoc --out docs',prepublishOnly:"npm run build"},Y$={access:"public"},Z$=[],X$="",J$="ISC",ew={"@babel/core":"^7.18.9","@babel/preset-env":"^7.18.9","@rollup/plugin-typescript":"^8.3.4","@types/node":"^18.6.3",path:"^0.12.7",rimraf:"^3.0.2",tslib:"^2.4.0",typedoc:"^0.23.10"},tw={"@apollo/client":"^3.6.9","@auth0/auth0-spa-js":"^2.1.3","@nanostores/react":"^0.4.1",nanostores:"^0.7.4"},nw={".":{import:"./dist/lib.mjs",require:"./dist/lib.js"}},rw="./dist/lib.d.ts",iw={type:"git",url:"git+https://github.com/Photon-Health/photon-sdk-js.git"},ow={url:"https://github.com/Photon-Health/photon-sdk-js/issues"},aw="https://github.com/Photon-Health/photon-sdk-js#readme",sw="",lw="af370de34a8764638dbdc4bd5092f62db2eefee2",Yu={name:W$,version:G$,main:Q$,scripts:K$,publishConfig:Y$,keywords:Z$,author:X$,license:J$,devDependencies:ew,dependencies:tw,exports:nw,types:rw,repository:iw,bugs:ow,homepage:aw,description:sw,gitHead:lw};var Zu;const dw=(Zu=Yu?.version)!==null&&Zu!==void 0?Zu:"unknown";class cw{constructor({domain:t,clientId:n,redirectURI:r,organization:i,env:o="photon",audience:a,uri:s,developmentMode:l=!1},d){this.audience=a||Ks[o],this.uri=s||`${Ks[o]}/graphql`,this.clinicalUrl=s?N$(s):w1[o],this.clinicalApiUri=`${Sp[o]}/graphql`,l&&(this.audience=Ks.neutron,this.uri=`${Ks.neutron}/graphql'`,this.clinicalApiUri=`${Sp.neutron}/graphql'`);const c={domain:t||(l?"auth.neutron.health":"auth.photon.health"),clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{redirect_uri:r,audience:this.audience}};this.auth0Client=new d8(c),this.organization=i,this.authentication=new _p({authentication:this.auth0Client,organization:this.organization,audience:this.audience}),this.apollo=this.constructApolloClient({elementsVersion:d,isServices:!1}),this.apolloClinical=this.constructApolloClient({elementsVersion:d,isServices:!0}),this.clinical=new V$(this.apollo),this.management=new q$(this.apollo)}constructApolloClient({elementsVersion:t,isServices:n}={isServices:!1}){return new m$({link:k$((i,o)=>De(this,void 0,void 0,function*(){var{headers:a}=o,s=di(o,["headers"]);const l=yield this.authentication.getAccessToken(),d=Object.assign(Object.assign(Object.assign({},a),{"x-photon-sdk-version":dw}),t?{"x-photon-elements-version":t}:{});return l?Object.assign(Object.assign({},s),{headers:n?Object.assign(Object.assign({},d),{"x-photon-auth-token":l,"x-photon-auth-token-type":"auth0"}):Object.assign(Object.assign({},d),{authorization:l})}):Object.assign({headers:d},s)})).concat(new a6({uri:n?this.clinicalApiUri:this.uri})),defaultOptions:{query:{fetchPolicy:"cache-first",errorPolicy:"all"},mutate:{onQueryUpdated:fw}},cache:new s$})}setOrganization(t){return this.organization=t,this.authentication=new _p({authentication:this.auth0Client,organization:t,audience:this.audience}),this}}const uw=e=>new Promise(t=>setTimeout(t,e)),fw=e=>De(void 0,void 0,void 0,function*(){yield uw(1e3),e.refetch()}),hw=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pw=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...hw]),mw=new Set(["innerHTML","textContent","innerText","children"]),gw=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),zp=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),vw=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),yw=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),bw={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function $w(e,t,n){let r=n.length,i=t.length,o=r,a=0,s=0,l=t[i-1].nextSibling,d=null;for(;a<i||s<o;){if(t[a]===n[s]){a++,s++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===a){const c=o<r?s?n[s-1].nextSibling:n[o-s]:l;for(;s<o;)e.insertBefore(n[s++],c)}else if(o===s)for(;a<i;)(!d||!d.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[o-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--o],c),t[i]=n[o]}else{if(!d){d=new Map;let u=s;for(;u<o;)d.set(n[u],u++)}const c=d.get(t[a]);if(c!=null)if(s<c&&c<o){let u=a,f=1,h;for(;++u<i&&u<o&&!((h=d.get(t[u]))==null||h!==c+f);)f++;if(f>c-s){const p=t[a];for(;s<c;)e.insertBefore(n[s++],p)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}}const jp="_$DX_DELEGATE";function b(e,t,n){const r=document.createElement("template");r.innerHTML=e;let i=r.content.firstChild;return n&&(i=i.firstChild),i}function Ur(e,t=window.document){const n=t[jp]||(t[jp]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Ew))}}function tt(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function ww(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function wt(e,t){t==null?e.removeAttribute("class"):e.className=t}function F6(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n)}function _w(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Vp(e,s,!1),delete n[s])}for(o=0,a=r.length;o<a;o++){const s=r[o],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(Vp(e,s,!0),n[s]=l)}return n}function rr(e,t,n){if(!t)return n?tt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function Wn(e,t={},n,r){const i={};return r||te(()=>i.children=Qo(e,t.children,i.children)),te(()=>t.ref&&t.ref(e)),te(()=>xw(e,t,n,!0,i,!0)),i}function hi(e,t,n){return de(()=>e(t,n))}function S(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Qo(e,t,r,n);te(i=>Qo(e,t(),i,n),r)}function xw(e,t,n,r,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=Up(e,a,null,i[a],n,o)}for(const a in t){if(a==="children"){r||Qo(e,t.children);continue}const s=t[a];i[a]=Up(e,a,s,i[a],n,o)}}function kw(e){let t,n;return!ut.context||!(t=ut.registry.get(n=Sw()))?e.cloneNode(!0):(ut.completed&&ut.completed.add(t),ut.registry.delete(n),t)}function Cw(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vp(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function Up(e,t,n,r,i,o){let a,s,l;if(t==="style")return rr(e,n,r);if(t==="classList")return _w(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),c=vw.has(d);if(!c&&r){const u=Array.isArray(r)?r[0]:r;e.removeEventListener(d,u)}(c||n)&&(F6(e,d,n,c),c&&Ur([d]))}else if((l=mw.has(t))||!i&&(zp[t]||(s=pw.has(t)))||(a=e.nodeName.includes("-")))t==="class"||t==="className"?wt(e,n):a&&!s&&!l?e[Cw(t)]=n:e[zp[t]||t]=n;else{const d=i&&t.indexOf(":")>-1&&bw[t.split(":")[0]];d?ww(e,d,t,n):tt(e,gw[t]||t,n)}return n}function Ew(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),ut.registry&&!ut.done&&(ut.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let i=r.nextSibling;r.remove(),r=i}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?r.call(n,i,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Qo(e,t,n,r,i){for(ut.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(ut.context)return n;if(o==="number"&&(t=t.toString()),a){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=po(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(ut.context)return n;n=po(e,n,r)}else{if(o==="function")return te(()=>{let s=t();for(;typeof s=="function";)s=s();n=Qo(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(_1(s,t,n,i))return te(()=>n=Qo(e,s,n,r,!0)),()=>n;if(ut.context){if(!s.length)return n;for(let d=0;d<s.length;d++)if(s[d].parentNode)return n=s}if(s.length===0){if(n=po(e,n,r),a)return n}else l?n.length===0?Bp(e,s,r):$w(e,n,s):(n&&po(e),Bp(e,s));n=s}else if(t instanceof Node){if(ut.context&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=po(e,n,r,t);po(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _1(e,t,n,r){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],l=n&&n[o];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))i=_1(e,s,l)||i;else if(typeof s=="function")if(r){for(;typeof s=="function";)s=s();i=_1(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const d=String(s);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return i}function Bp(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function po(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const l=s.parentNode===e;!o&&!a?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function Sw(){const e=ut.context;return`${e.id}${e.count++}`}const Ow="http://www.w3.org/2000/svg";function Tw(e,t=!1){return t?document.createElementNS(Ow,e):document.createElement(e)}function Nw(e){const[t,n]=Ho(e,["component"]),r=q(()=>t.component);return q(()=>{const i=r();switch(typeof i){case"function":return de(()=>i(n));case"string":const o=yw.has(i),a=ut.context?kw():Tw(i,o);return Wn(a,n,o),a}})}function Pw(e,...t){const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Dr(e){let t;return Pw(e,n=>t=n)(),t}class Aw extends Error{constructor(t,n){super(t),this.name="FelteSubmitError",this.response=n}}function Iw(e,t){return Object.keys(e).some(n=>t(e[n]))}function Xc(e,t){return Object.keys(e||{}).reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])}),{})}function Re(e){return Object.prototype.toString.call(e)==="[object Object]"}function xn(e){return Object.keys(e||{}).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:Re(e[n])?xn(e[n]):Array.isArray(e[n])?[...e[n]]:e[n]}),{})}function Mw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Dw(e){return function(t){if(Re(t)){const n=kn(t,e);return Mw(n,["key"])}return e}}function kn(e,t){return Xc(e,n=>Re(n)?kn(n,t):Array.isArray(n)?n.map(Dw(t)):t)}function ii(...e){const t=e.pop(),n=e.shift();if(typeof n=="string")return n;const r=xn(n);if(e.length===0)return r;for(const i of e){if(!i)continue;if(typeof i=="string")return i;let o=t(r,i);if(typeof o<"u")return o;const a=Array.from(new Set(Object.keys(r).concat(Object.keys(i))));for(const s of a)if(o=t(r[s],i[s]),typeof o<"u")r[s]=o;else if(Re(i[s])&&Re(r[s]))r[s]=ii(r[s],i[s],t);else if(Array.isArray(i[s]))r[s]=i[s].map((l,d)=>{if(!Re(l))return l;const c=Array.isArray(r[s])?r[s][d]:r[s];return ii(c,l,t)});else if(Re(i[s])){const l=kn(xn(i[s]),void 0);r[s]=ii(l,i[s],t)}else typeof i[s]<"u"&&(r[s]=i[s])}return r}function Fw(e,t){if(!(Re(e)&&Re(t))){if(Array.isArray(t)){if(t.some(Re))return;const n=Array.isArray(e)?e:[];return t.map((r,i)=>{var o;return(o=n[i])!==null&&o!==void 0?o:r})}if(typeof e<"u")return e}}function Hp(...e){return ii(...e,Fw)}function L6(...e){return ii(...e,()=>{})}function kr(e,t,n){const r=o=>String.prototype.split.call(t,o).filter(Boolean).reduce((a,s)=>a!=null?a[s]:a,e),i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return i===void 0||i===e?n:i}function ca(e,t,n){e&&(e=xn(e)),Re(e)||(e={});const r=Array.isArray(t)?t:t.match(/[^.[\]]+/g)||[],i=r[r.length-1];if(!i)return e;let o=e;for(let a=0;a<r.length-1;a++){const s=r[a];if(!o[s]||!Re(o[s])&&!Array.isArray(o[s])){const l=r[a+1];isNaN(Number(l))?o[s]={}:o[s]=[]}o=o[s]}return o[i]=n(o[i]),e}function dt(e,t,n){return ca(e,t,()=>n)}function qa(e,t){if(!e||Object(e)!==e)return;typeof e<"u"&&(e=xn(e));const n=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[],r=n.length===1?e:kr(e,n.slice(0,-1).join("."));return Array.isArray(r)?r.splice(Number(n[n.length-1]),1):r==null||delete r[n[n.length-1]],e}function ls(e,t){return Iw(e,n=>Re(n)?ls(n,t):Array.isArray(n)?n.length===0||n.every(r=>typeof r=="string")?t(n):n.some(r=>Re(r)?ls(r,t):t(r)):t(n))}function Lo(e){return e?.nodeName==="INPUT"}function Lw(e){return e?.nodeName==="TEXTAREA"}function Ro(e){return e?.nodeName==="SELECT"}function Jc(e){return e?.nodeName==="FIELDSET"}function Ut(e){return Lo(e)||Lw(e)||Ro(e)}function x1(e){return e.nodeType===Node.ELEMENT_NODE}function en(e,t){return t??(Ut(e)?e.name:"")}function Xu(e){let t=e;for(;t&&t.nodeName!=="FORM";){if(t.hasAttribute("data-felte-ignore"))return!0;t=t.parentElement}return!1}function qp(e,t){return!Re(e)||!t?e:typeof t=="string"?kr(e,t):t(e)}function Rw(e,t){if(!(Re(e)||Re(t))){if(e===null||e==="")return t;if(t===null||t===""||!t)return e;if(!(!e||!t)){if(Array.isArray(e)){if(!Array.isArray(t))return[...e,t];const n=[],r=Math.max(t.length,e.length);for(let i=0;i<r;i++){let o=e[i],a=t[i];!Re(o)&&!Re(a)?(Array.isArray(o)||(o=[o]),Array.isArray(a)||(a=[a]),n.push(...o,...a)):n.push(_o([o??{},a??{}]))}return n.filter(Boolean)}return Array.isArray(t)||(t=[t]),[e,...t].reduce((n,r)=>n.concat(r),[]).filter(Boolean)}}}function _o(e){return ii(...e,Rw)}function zw(e,t){return t?(Array.isArray(t)?t:[t]).map(n=>n(e)):[]}function k1(e,t){return t?Array.isArray(t)?t.reduce((n,r)=>r(n),e):t(e):e}function R6(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}function C1(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>C1(n,t[r]));if(Re(e)&&Re(t)){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>C1(e[i],t[i]))}return!1}function Td(e,t,{onInit:n,onEnd:r}={}){let i;return(...o)=>{i||n?.(),i&&clearTimeout(i),i=setTimeout(()=>{e.apply(this,o),i=void 0,r?.()},t)}}function E1(e){if(Ut(e))return[e];if(e.childElementCount===0)return[];const t=new Set;for(const n of e.children){if(Ut(n)&&t.add(n),Jc(n))for(const r of n.elements)Ut(r)&&t.add(r);n.childElementCount>0&&E1(n).forEach(r=>t.add(r))}return Array.from(t)}function z6(e){for(const t of e.elements)!Ut(t)&&!Jc(t)||e.hasAttribute("data-felte-keep-on-remove")&&!t.hasAttribute("data-felte-keep-on-remove")&&(t.dataset.felteKeepOnRemove=e.dataset.felteKeepOnRemove)}function j6(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:null:e.value}function Wp(e){var t;let n={},r={};for(const i of e.elements){if(Jc(i)&&z6(i),!Ut(i)||!i.name)continue;const o=en(i);if(Lo(i)){if(i.type==="checkbox"){if(typeof kr(n,o)>"u"){if(Array.from(e.querySelectorAll(`[name="${i.name}"]`)).filter(s=>Ut(s)?o===en(s):!1).length===1){n=dt(n,o,i.checked),r=dt(r,o,!1);continue}n=dt(n,o,i.checked?[i.value]:[]),r=dt(r,o,!1);continue}Array.isArray(kr(n,o))&&i.checked&&(n=ca(n,o,s=>[...s,i.value]));continue}if(i.type==="radio"){if(kr(n,o))continue;n=dt(n,o,i.checked?i.value:void 0),r=dt(r,o,!1);continue}if(i.type==="file"){n=dt(n,o,i.multiple?Array.from(i.files||[]):(t=i.files)===null||t===void 0?void 0:t[0]),r=dt(r,o,!1);continue}}else if(Ro(i)){if(!i.multiple)n=dt(n,o,i.value);else{const s=Array.from(i.selectedOptions).map(l=>l.value);n=dt(n,o,s)}r=dt(r,o,!1);continue}const a=j6(i);n=dt(n,o,a),r=dt(r,o,!1)}return{defaultData:n,defaultTouched:r}}function kl(e,t){var n;if(!Ut(e))return;const r=t;if(Lo(e)){if(e.type==="checkbox"){const i=r;if(typeof i>"u"||typeof i=="boolean"){e.checked=!!i;return}Array.isArray(i)&&(i.includes(e.value)?e.checked=!0:e.checked=!1);return}if(e.type==="radio"){const i=r;e.value===i?e.checked=!0:e.checked=!1;return}if(e.type==="file"){if(t instanceof FileList)e.files=t;else if(t instanceof File&&typeof DataTransfer<"u"){const i=new DataTransfer;i.items.add(t),e.files=i.files}else if(typeof DataTransfer<"u"&&Array.isArray(t)&&t.some(i=>i instanceof File)){const i=new DataTransfer;for(const o of t)o instanceof File&&i.items.add(o);e.files=i.files}else(!t||Array.isArray(t)&&!t.length)&&(e.files=null,e.value="");return}}else if(Ro(e)){if(e.multiple){if(Array.isArray(r)){e.value=String((n=r[0])!==null&&n!==void 0?n:"");const i=r.map(o=>String(o));for(const o of e.options)i.includes(o.value)?o.selected=!0:o.selected=!1}}else{e.value=String(r??"");for(const i of e.options)i.value===String(r)?i.selected=!0:i.selected=!1}return}e.value=String(r??"")}function Ys(e,t){for(const n of e.elements){if(Jc(n)&&z6(n),!Ut(n)||!n.name)continue;const r=en(n);kl(n,kr(t,r))}}const jw={attributes:!0,attributeFilter:["data-felte-validation-message","aria-invalid"]};function Vw(e,t){var n,r;let i,o,a,s,l,d;typeof e=="string"?(i=e,o=t?.defaultValue,a=(n=t?.touchOnChange)!==null&&n!==void 0?n:!1,d=t?.onFormReset):(i=e.name,o=e.defaultValue,a=(r=e.touchOnChange)!==null&&r!==void 0?r:!1,d=e?.onFormReset);function c(v,x){if(!l)return;kl(l,x);const _=new Event(v,{bubbles:!0,composed:!0});l.dispatchEvent(_)}function u(v){v.forEach(()=>{const x=l.getAttribute("aria-invalid");x?s.setAttribute("aria-invalid",x):s.removeAttribute("aria-invalid");const _=l.getAttribute("data-felte-validation-message");_?s.setAttribute("data-felte-validation-message",_):s.removeAttribute("data-felte-validation-message")})}function f(v){!d||(kl(l,o),d(v))}function h(v){s=v;let x,_;if(Ut(v))return l=v,l.name=i,{};{let w=!1,k=!1;return setTimeout(()=>{if(k)return;const N=s.parentNode;if(!N||!x1(N))return;const T=N.querySelector(`[name="${i}"]`);if(!T||!Ut(T)){const A=document.createElement("input");A.type="hidden",A.name=i,N.insertBefore(A,v.nextSibling),l=A,w=!0}else l=T;kl(l,o),x=new MutationObserver(u),x.observe(l,jw),_=l.closest("form"),_?.addEventListener("reset",f)}),{destroy(){var N;w&&((N=l.parentNode)===null||N===void 0||N.removeChild(l)),k=!0,x?.disconnect(),_?.removeEventListener("reset",f)}}}}function p(v){c(a?"change":"input",v)}function y(){c("focusout")}return{field:h,onInput:p,onChange:p,onBlur:y}}function V6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fr(e,t){return Xc(e,n=>Re(n)?Fr(n,t):Array.isArray(n)?n.length===0||n.every(r=>typeof r=="string")?t:n.map(r=>{const i=Fr(r,t);return V6(i,["key"])}):t)}function Zi(e){return e?Xc(e,t=>Re(t)?Zi(t):Array.isArray(t)?t.length===0||t.every(n=>typeof n=="string")?t:t.map(n=>{if(!Re(n))return n;const r=Zi(n);return r.key||(r.key=R6()),r}):t):{}}function Vi(e){return e?Xc(e,t=>Re(t)?Vi(t):Array.isArray(t)?t.length===0||t.every(n=>typeof n=="string")?t:t.map(n=>{if(!Re(n))return n;const r=Vi(n);return V6(r,["key"])}):t):{}}function Uw(){class e extends CustomEvent{constructor(i){super("feltesuccess",{detail:i})}}class t extends CustomEvent{constructor(i){super("felteerror",{detail:i,cancelable:!0})}setErrors(i){this.preventDefault(),this.errors=i}}class n extends Event{constructor(){super("feltesubmit",{cancelable:!0})}handleSubmit(i){this.onSubmit=i}handleError(i){this.onError=i}handleSuccess(i){this.onSuccess=i}}return{createErrorEvent:r=>new t(r),createSubmitEvent:()=>new n,createSuccessEvent:r=>new e(r)}}function Bw(e){if(e)return async function(){let t=new FormData(e);const n=new URL(e.action),r=e.method.toLowerCase()==="get"?"get":n.searchParams.get("_method")||e.method;let i=e.enctype;e.querySelector('input[type="file"]')&&(i="multipart/form-data"),(r==="get"||i==="application/x-www-form-urlencoded")&&(t=new URLSearchParams(t));let o;r==="get"?(t.forEach((s,l)=>{n.searchParams.append(l,s)}),o={method:r,headers:{Accept:"application/json"}}):o={method:r,body:t,headers:Object.assign(Object.assign({},i!=="multipart/form-data"&&{"Content-Type":i}),{Accept:"application/json"})};const a=await window.fetch(n.toString(),o);if(a.ok)return a;throw new Aw("An error occurred while submitting the form",a)}}function Zs(e,t,n,r){return ca(e,t,i=>(typeof i<"u"&&!Array.isArray(i)||(i||(i=[]),typeof r>"u"?i.push(n):i.splice(r,0,n)),i))}function Hw(e,t,n,r){return ca(e,t,i=>(!i||!Array.isArray(i)||([i[n],i[r]]=[i[r],i[n]]),i))}function qw(e,t,n,r){return ca(e,t,i=>(!i||!Array.isArray(i)||i.splice(r,0,i.splice(n,1)[0]),i))}function Gp(e){return typeof e=="function"}function Wr(e){return(t,n)=>{if(typeof t=="string"){const r=t;e(i=>{const o=Gp(n)?n(kr(i,r)):n;return dt(i,r,o)})}else e(r=>Gp(t)?t(r):t)}}function Ww({stores:e,config:t,validateErrors:n,validateWarnings:r,_getCurrentExtenders:i}){var o;let a,s=Zi((o=t.initialValues)!==null&&o!==void 0?o:{});const{data:l,touched:d,errors:c,warnings:u,isDirty:f,isSubmitting:h,interacted:p}=e,y=Wr(l.update),v=Wr(d.update),x=Wr(c.update),_=Wr(u.update);function w(L){y(R=>{const ie=L(R);return a&&Ys(a,ie),ie})}const k=(L,R,ie)=>{Wr(w)(L,R),typeof L=="string"&&ie&&v(L,!0)};function N(L,R,ie){const ce=Re(R)?Fr(R,!1):!1,W=Re(ce)?kn(ce,[]):[];R=Re(R)?Object.assign(Object.assign({},R),{key:R6()}):R,c.update(xe=>Zs(xe,L,W,ie)),u.update(xe=>Zs(xe,L,W,ie)),d.update(xe=>Zs(xe,L,ce,ie)),l.update(xe=>{const Oe=Zs(xe,L,R,ie);return setTimeout(()=>a&&Ys(a,Oe)),Oe})}function T(L){c.update(L),u.update(L),d.update(L),l.update(R=>{const ie=L(R);return setTimeout(()=>a&&Ys(a,ie)),ie})}function A(L){T(R=>qa(R,L))}function P(L,R,ie){T(ce=>Hw(ce,L,R,ie))}function G(L,R,ie){T(ce=>qw(ce,L,R,ie))}function Q(L){const R=kr(s,L),ie=Re(R)?Fr(R,!1):!1,ce=Re(ie)?kn(ie,[]):[];l.update(W=>{const xe=dt(W,L,R);return a&&Ys(a,xe),xe}),d.update(W=>dt(W,L,ie)),c.update(W=>dt(W,L,ce)),u.update(W=>dt(W,L,ce))}const Y=Wr(h.update),z=Wr(f.update),V=Wr(p.update);async function B(){const L=Dr(l);d.set(Fr(L,!0)),p.set(null);const R=await n(L);return await r(L),R}function I(){k(xn(s)),v(L=>kn(L,!1)),p.set(null),f.set(!1)}function ne(L){return async function(R){var ie,ce,W,xe,Oe,Ve,oe;const{createErrorEvent:Se,createSubmitEvent:Ce,createSuccessEvent:pe}=Uw(),$e=Ce();a?.dispatchEvent($e);const ke=(ce=(ie=$e.onError)!==null&&ie!==void 0?ie:L?.onError)!==null&&ce!==void 0?ce:t.onError,Ie=(xe=(W=$e.onSuccess)!==null&&W!==void 0?W:L?.onSuccess)!==null&&xe!==void 0?xe:t.onSuccess,ue=(oe=(Ve=(Oe=$e.onSubmit)!==null&&Oe!==void 0?Oe:L?.onSubmit)!==null&&Ve!==void 0?Ve:t.onSubmit)!==null&&oe!==void 0?oe:Bw(a);if(!ue||(R?.preventDefault(),$e.defaultPrevented))return;h.set(!0),p.set(null);const K=Vi(Dr(l)),_e=await n(K,L?.validate),Me=await r(K,L?.warn);if(Me&&u.set(L6(kn(K,[]),Me)),d.set(Fr(K,!0)),_e&&(d.set(Fr(_e,!0)),ls(_e,Ze=>Array.isArray(Ze)?Ze.length>=1:!!Ze))){await new Promise(Ze=>setTimeout(Ze)),i().forEach(Ze=>{var fn;return(fn=Ze.onSubmitError)===null||fn===void 0?void 0:fn.call(Ze,{data:K,errors:_e})}),h.set(!1);return}const bt={event:R,setFields:k,setData:y,setTouched:v,setErrors:x,setWarnings:_,unsetField:A,addField:N,resetField:Q,reset:I,setInitialValues:X.setInitialValues,moveField:G,swapFields:P,form:a,controls:a&&Array.from(a.elements).filter(Ut),config:Object.assign(Object.assign({},t),L)};try{const Ze=await ue(K,bt);a?.dispatchEvent(pe(Object.assign({response:Ze},bt))),await Ie?.(Ze,bt)}catch(Ze){const fn=Se(Object.assign({error:Ze},bt));if(a?.dispatchEvent(fn),!ke&&!fn.defaultPrevented)throw Ze;if(!ke&&!fn.errors)return;const Pt=fn.errors||await ke?.(Ze,bt);Pt&&(d.set(Fr(Pt,!0)),c.set(Pt),await new Promise(Ln=>setTimeout(Ln)),i().forEach(Ln=>{var Rn;return(Rn=Ln.onSubmitError)===null||Rn===void 0?void 0:Rn.call(Ln,{data:K,errors:Dr(c)})}))}finally{h.set(!1)}}}const X={setData:y,setFields:k,setTouched:v,setErrors:x,setWarnings:_,setIsSubmitting:Y,setIsDirty:z,setInteracted:V,validate:B,reset:I,unsetField:A,resetField:Q,addField:N,swapFields:P,moveField:G,createSubmitHandler:ne,handleSubmit:ne(),setInitialValues:L=>{s=Zi(L)}};return{public:X,private:{_setFormNode(L){a=L},_getInitialValues:()=>s}}}function Gw({helpers:e,stores:t,config:n,extender:r,createSubmitHandler:i,handleSubmit:o,_setFormNode:a,_getInitialValues:s,_setCurrentExtenders:l,_getCurrentExtenders:d}){const{setFields:c,setTouched:u,reset:f,setInitialValues:h}=e,{addValidator:p,addTransformer:y,validate:v}=e,{data:x,errors:_,warnings:w,touched:k,isSubmitting:N,isDirty:T,interacted:A,isValid:P,isValidating:G}=t;function Q(Y){Y.requestSubmit||(Y.requestSubmit=o);function z(ue){return function(K){return K({form:Y,stage:ue,controls:Array.from(Y.elements).filter(Ut),data:x,errors:_,warnings:w,touched:k,isValid:P,isValidating:G,isSubmitting:N,isDirty:T,interacted:A,config:n,addValidator:p,addTransformer:y,setFields:c,validate:v,reset:f,createSubmitHandler:i,handleSubmit:o})}}l(r.map(z("MOUNT"))),Y.noValidate=!!n.validate;const{defaultData:V,defaultTouched:B}=Wp(Y);a(Y),h(L6(xn(V),s())),c(s()),k.set(B);function I(ue){const K=en(ue),_e=Array.from(Y.querySelectorAll(`[name="${ue.name}"]`)).filter(Me=>Ut(Me)?K===en(Me):!1);if(_e.length!==0)return _e.length===1?x.update(Me=>dt(Me,en(ue),ue.checked)):x.update(Me=>dt(Me,en(ue),_e.filter(Lo).filter(bt=>bt.checked).map(bt=>bt.value)))}function ne(ue){const K=Y.querySelectorAll(`[name="${ue.name}"]`),_e=Array.from(K).find(Me=>Lo(Me)&&Me.checked);x.update(Me=>dt(Me,en(ue),_e?.value))}function X(ue){var K;const _e=Array.from((K=ue.files)!==null&&K!==void 0?K:[]);x.update(Me=>dt(Me,en(ue),ue.multiple?_e:_e[0]))}function L(ue){if(!ue.multiple)x.update(K=>dt(K,en(ue),ue.value));else{const K=Array.from(ue.selectedOptions).map(_e=>_e.value);x.update(_e=>dt(_e,en(ue),K))}}function R(ue){const K=ue.target;if(!K||!Ut(K)||Ro(K)||Xu(K)||["checkbox","radio","file"].includes(K.type)||!K.name)return;T.set(!0);const _e=j6(K);A.set(K.name),x.update(Me=>dt(Me,en(K),_e))}function ie(ue){const K=ue.target;if(!(!K||!Ut(K)||Xu(K))&&!!K.name)if(u(en(K),!0),A.set(K.name),(Ro(K)||["checkbox","radio","file","hidden"].includes(K.type))&&T.set(!0),K.type==="hidden"&&x.update(_e=>dt(_e,en(K),K.value)),Ro(K))L(K);else if(Lo(K))K.type==="checkbox"?I(K):K.type==="radio"?ne(K):K.type==="file"&&X(K);else return}function ce(ue){const K=ue.target;!K||!Ut(K)||Xu(K)||!K.name||(u(en(K),!0),A.set(K.name))}function W(ue){ue.preventDefault(),f()}const xe={childList:!0,subtree:!0};function Oe(ue){let K=Dr(x),_e=Dr(k),Me=Dr(_),bt=Dr(w);for(const Ze of ue.reverse()){if(Ze.hasAttribute("data-felte-keep-on-remove")&&Ze.dataset.felteKeepOnRemove!=="false")continue;const fn=/.*(\[[0-9]+\]|\.[0-9]+)\.[^.]+$/;let Pt=en(Ze);const Ln=Dr(k);if(fn.test(Pt)){const Rn=Pt.split(".").slice(0,-1).join("."),_i=kr(Ln,Rn);Re(_i)&&Object.keys(_i).length<=1&&(Pt=Rn)}K=qa(K,Pt),_e=qa(_e,Pt),Me=qa(Me,Pt),bt=qa(bt,Pt)}x.set(K),k.set(_e),_.set(Me),w.set(bt)}const Ve=Td(()=>{d().forEach(_e=>{var Me;return(Me=_e.destroy)===null||Me===void 0?void 0:Me.call(_e)}),l(r.map(z("UPDATE")));const{defaultData:ue,defaultTouched:K}=Wp(Y);x.update(_e=>Hp(_e,ue)),k.update(_e=>Hp(_e,K)),e.setFields(Dr(x))},0);let oe=[];const Se=Td(()=>{d().forEach(ue=>{var K;return(K=ue.destroy)===null||K===void 0?void 0:K.call(ue)}),l(r.map(z("UPDATE"))),Oe(oe),oe=[]},0);function Ce(ue){!Array.from(ue.addedNodes).some(K=>x1(K)?Ut(K)?!0:E1(K).length>0:!1)||Ve()}function pe(ue){for(const K of ue.removedNodes){if(!x1(K))continue;const _e=E1(K);_e.length!==0&&(oe.push(..._e),Se())}}function $e(ue){for(const K of ue)K.type==="childList"&&(K.addedNodes.length>0&&Ce(K),K.removedNodes.length>0&&pe(K))}const ke=new MutationObserver($e);ke.observe(Y,xe),Y.addEventListener("input",R),Y.addEventListener("change",ie),Y.addEventListener("focusout",ce),Y.addEventListener("submit",o),Y.addEventListener("reset",W);const Ie=_.subscribe(ue=>{for(const K of Y.elements){if(!Ut(K)||!K.name)continue;const _e=kr(ue,en(K)),Me=Array.isArray(_e)?_e.join(`
762
+ `;return gn(this.apollo,t)}}class q${constructor(t){this.client=new U$(t),this.organization=new B$(t),this.webhook=new H$(t)}}var Op;(function(e){e.Drug="DRUG",e.Package="PACKAGE",e.Product="PRODUCT"})(Op||(Op={}));var Tp;(function(e){e.Icd10="ICD10"})(Tp||(Tp={}));var Np;(function(e){e.Canceled="CANCELED",e.New="NEW",e.Scheduled="SCHEDULED",e.Sent="SENT"})(Np||(Np={}));var Pp;(function(e){e.MailOrder="MAIL_ORDER",e.PickUp="PICK_UP"})(Pp||(Pp={}));var Ap;(function(e){e.Otc="OTC",e.Rx="RX"})(Ap||(Ap={}));var Ip;(function(e){e.Canceled="CANCELED",e.Completed="COMPLETED",e.Error="ERROR",e.Pending="PENDING",e.Placed="PLACED",e.Routing="ROUTING"})(Ip||(Ip={}));var Mp;(function(e){e.Pharmacy="PHARMACY",e.Prescriber="PRESCRIBER"})(Mp||(Mp={}));var Dp;(function(e){e.Active="ACTIVE",e.Depleted="DEPLETED",e.Expired="EXPIRED",e.Canceled="CANCELED"})(Dp||(Dp={}));var Fp;(function(e){e.I="I",e.Ii="II",e.Iii="III",e.Iv="IV",e.V="V"})(Fp||(Fp={}));var Lp;(function(e){e.Concept="CONCEPT",e.Form="FORM",e.Route="ROUTE",e.Strength="STRENGTH"})(Lp||(Lp={}));var Rp;(function(e){e.Female="FEMALE",e.Male="MALE",e.Unknown="UNKNOWN"})(Rp||(Rp={}));const W$="@photonhealth/sdk",G$="1.3.2",Q$="dist/lib.js",K$={build:"npx nx run sdk:build",docs:'find src -name "*.ts" | xargs npx typedoc --out docs',prepublishOnly:"npm run build"},Y$={access:"public"},Z$=[],X$="",J$="ISC",ew={"@babel/core":"^7.18.9","@babel/preset-env":"^7.18.9","@rollup/plugin-typescript":"^8.3.4","@types/node":"^18.6.3",path:"^0.12.7",rimraf:"^3.0.2",tslib:"^2.4.0",typedoc:"^0.23.10"},tw={"@apollo/client":"^3.6.9","@auth0/auth0-spa-js":"^2.1.3","@nanostores/react":"^0.4.1",nanostores:"^0.7.4"},nw={".":{import:"./dist/lib.mjs",require:"./dist/lib.js"}},rw="./dist/lib.d.ts",iw={type:"git",url:"git+https://github.com/Photon-Health/photon-sdk-js.git"},ow={url:"https://github.com/Photon-Health/photon-sdk-js/issues"},aw="https://github.com/Photon-Health/photon-sdk-js#readme",sw="",lw="af370de34a8764638dbdc4bd5092f62db2eefee2",Yu={name:W$,version:G$,main:Q$,scripts:K$,publishConfig:Y$,keywords:Z$,author:X$,license:J$,devDependencies:ew,dependencies:tw,exports:nw,types:rw,repository:iw,bugs:ow,homepage:aw,description:sw,gitHead:lw};var Zu;const dw=(Zu=Yu?.version)!==null&&Zu!==void 0?Zu:"unknown";class cw{constructor({domain:t,clientId:n,redirectURI:r,organization:i,env:o="photon",audience:a,uri:s,developmentMode:l=!1},d){this.audience=a||Ks[o],this.uri=s||`${Ks[o]}/graphql`,this.clinicalUrl=s?N$(s):w1[o],this.clinicalApiUri=`${Sp[o]}/graphql`,l&&(this.audience=Ks.neutron,this.uri=`${Ks.neutron}/graphql`,this.clinicalApiUri=`${Sp.neutron}/graphql`);const c={domain:t||(l?"auth.neutron.health":"auth.photon.health"),clientId:n,cacheLocation:"localstorage",useRefreshTokens:!0,useRefreshTokensFallback:!0,authorizationParams:{redirect_uri:r,audience:this.audience}};this.auth0Client=new d8(c),this.organization=i,this.authentication=new _p({authentication:this.auth0Client,organization:this.organization,audience:this.audience}),this.apollo=this.constructApolloClient({elementsVersion:d,isServices:!1}),this.apolloClinical=this.constructApolloClient({elementsVersion:d,isServices:!0}),this.clinical=new V$(this.apollo),this.management=new q$(this.apollo)}constructApolloClient({elementsVersion:t,isServices:n}={isServices:!1}){return new m$({link:k$((i,o)=>De(this,void 0,void 0,function*(){var{headers:a}=o,s=di(o,["headers"]);const l=yield this.authentication.getAccessToken(),d=Object.assign(Object.assign(Object.assign({},a),{"x-photon-sdk-version":dw}),t?{"x-photon-elements-version":t}:{});return l?Object.assign(Object.assign({},s),{headers:n?Object.assign(Object.assign({},d),{"x-photon-auth-token":l,"x-photon-auth-token-type":"auth0"}):Object.assign(Object.assign({},d),{authorization:l})}):Object.assign({headers:d},s)})).concat(new a6({uri:n?this.clinicalApiUri:this.uri})),defaultOptions:{query:{fetchPolicy:"cache-first",errorPolicy:"all"},mutate:{onQueryUpdated:fw}},cache:new s$})}setOrganization(t){return this.organization=t,this.authentication=new _p({authentication:this.auth0Client,organization:t,audience:this.audience}),this}}const uw=e=>new Promise(t=>setTimeout(t,e)),fw=e=>De(void 0,void 0,void 0,function*(){yield uw(1e3),e.refetch()}),hw=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected"],pw=new Set(["className","value","readOnly","formNoValidate","isMap","noModule","playsInline",...hw]),mw=new Set(["innerHTML","textContent","innerText","children"]),gw=Object.assign(Object.create(null),{className:"class",htmlFor:"for"}),zp=Object.assign(Object.create(null),{class:"className",formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly"}),vw=new Set(["beforeinput","click","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"]),yw=new Set(["altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignObject","g","glyph","glyphRef","hkern","image","line","linearGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","set","stop","svg","switch","symbol","text","textPath","tref","tspan","use","view","vkern"]),bw={xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace"};function $w(e,t,n){let r=n.length,i=t.length,o=r,a=0,s=0,l=t[i-1].nextSibling,d=null;for(;a<i||s<o;){if(t[a]===n[s]){a++,s++;continue}for(;t[i-1]===n[o-1];)i--,o--;if(i===a){const c=o<r?s?n[s-1].nextSibling:n[o-s]:l;for(;s<o;)e.insertBefore(n[s++],c)}else if(o===s)for(;a<i;)(!d||!d.has(t[a]))&&t[a].remove(),a++;else if(t[a]===n[o-1]&&n[s]===t[i-1]){const c=t[--i].nextSibling;e.insertBefore(n[s++],t[a++].nextSibling),e.insertBefore(n[--o],c),t[i]=n[o]}else{if(!d){d=new Map;let u=s;for(;u<o;)d.set(n[u],u++)}const c=d.get(t[a]);if(c!=null)if(s<c&&c<o){let u=a,f=1,h;for(;++u<i&&u<o&&!((h=d.get(t[u]))==null||h!==c+f);)f++;if(f>c-s){const p=t[a];for(;s<c;)e.insertBefore(n[s++],p)}else e.replaceChild(n[s++],t[a++])}else a++;else t[a++].remove()}}}const jp="_$DX_DELEGATE";function b(e,t,n){const r=document.createElement("template");r.innerHTML=e;let i=r.content.firstChild;return n&&(i=i.firstChild),i}function Ur(e,t=window.document){const n=t[jp]||(t[jp]=new Set);for(let r=0,i=e.length;r<i;r++){const o=e[r];n.has(o)||(n.add(o),t.addEventListener(o,Ew))}}function tt(e,t,n){n==null?e.removeAttribute(t):e.setAttribute(t,n)}function ww(e,t,n,r){r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r)}function wt(e,t){t==null?e.removeAttribute("class"):e.className=t}function F6(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){const i=n[0];e.addEventListener(t,n[0]=o=>i.call(e,n[1],o))}else e.addEventListener(t,n)}function _w(e,t,n={}){const r=Object.keys(t||{}),i=Object.keys(n);let o,a;for(o=0,a=i.length;o<a;o++){const s=i[o];!s||s==="undefined"||t[s]||(Vp(e,s,!1),delete n[s])}for(o=0,a=r.length;o<a;o++){const s=r[o],l=!!t[s];!s||s==="undefined"||n[s]===l||!l||(Vp(e,s,!0),n[s]=l)}return n}function rr(e,t,n){if(!t)return n?tt(e,"style"):t;const r=e.style;if(typeof t=="string")return r.cssText=t;typeof n=="string"&&(r.cssText=n=void 0),n||(n={}),t||(t={});let i,o;for(o in n)t[o]==null&&r.removeProperty(o),delete n[o];for(o in t)i=t[o],i!==n[o]&&(r.setProperty(o,i),n[o]=i);return n}function Wn(e,t={},n,r){const i={};return r||te(()=>i.children=Qo(e,t.children,i.children)),te(()=>t.ref&&t.ref(e)),te(()=>xw(e,t,n,!0,i,!0)),i}function hi(e,t,n){return de(()=>e(t,n))}function S(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return Qo(e,t,r,n);te(i=>Qo(e,t(),i,n),r)}function xw(e,t,n,r,i={},o=!1){t||(t={});for(const a in i)if(!(a in t)){if(a==="children")continue;i[a]=Up(e,a,null,i[a],n,o)}for(const a in t){if(a==="children"){r||Qo(e,t.children);continue}const s=t[a];i[a]=Up(e,a,s,i[a],n,o)}}function kw(e){let t,n;return!ut.context||!(t=ut.registry.get(n=Sw()))?e.cloneNode(!0):(ut.completed&&ut.completed.add(t),ut.registry.delete(n),t)}function Cw(e){return e.toLowerCase().replace(/-([a-z])/g,(t,n)=>n.toUpperCase())}function Vp(e,t,n){const r=t.trim().split(/\s+/);for(let i=0,o=r.length;i<o;i++)e.classList.toggle(r[i],n)}function Up(e,t,n,r,i,o){let a,s,l;if(t==="style")return rr(e,n,r);if(t==="classList")return _w(e,n,r);if(n===r)return r;if(t==="ref")o||n(e);else if(t.slice(0,3)==="on:"){const d=t.slice(3);r&&e.removeEventListener(d,r),n&&e.addEventListener(d,n)}else if(t.slice(0,10)==="oncapture:"){const d=t.slice(10);r&&e.removeEventListener(d,r,!0),n&&e.addEventListener(d,n,!0)}else if(t.slice(0,2)==="on"){const d=t.slice(2).toLowerCase(),c=vw.has(d);if(!c&&r){const u=Array.isArray(r)?r[0]:r;e.removeEventListener(d,u)}(c||n)&&(F6(e,d,n,c),c&&Ur([d]))}else if((l=mw.has(t))||!i&&(zp[t]||(s=pw.has(t)))||(a=e.nodeName.includes("-")))t==="class"||t==="className"?wt(e,n):a&&!s&&!l?e[Cw(t)]=n:e[zp[t]||t]=n;else{const d=i&&t.indexOf(":")>-1&&bw[t.split(":")[0]];d?ww(e,d,t,n):tt(e,gw[t]||t,n)}return n}function Ew(e){const t=`$$${e.type}`;let n=e.composedPath&&e.composedPath()[0]||e.target;for(e.target!==n&&Object.defineProperty(e,"target",{configurable:!0,value:n}),Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return n||document}}),ut.registry&&!ut.done&&(ut.done=!0,document.querySelectorAll("[id^=pl-]").forEach(r=>{for(;r&&r.nodeType!==8&&r.nodeValue!=="pl-"+e;){let i=r.nextSibling;r.remove(),r=i}r&&r.remove()}));n;){const r=n[t];if(r&&!n.disabled){const i=n[`${t}Data`];if(i!==void 0?r.call(n,i,e):r.call(n,e),e.cancelBubble)return}n=n._$host||n.parentNode||n.host}}function Qo(e,t,n,r,i){for(ut.context&&!n&&(n=[...e.childNodes]);typeof n=="function";)n=n();if(t===n)return n;const o=typeof t,a=r!==void 0;if(e=a&&n[0]&&n[0].parentNode||e,o==="string"||o==="number"){if(ut.context)return n;if(o==="number"&&(t=t.toString()),a){let s=n[0];s&&s.nodeType===3?s.data=t:s=document.createTextNode(t),n=po(e,n,r,s)}else n!==""&&typeof n=="string"?n=e.firstChild.data=t:n=e.textContent=t}else if(t==null||o==="boolean"){if(ut.context)return n;n=po(e,n,r)}else{if(o==="function")return te(()=>{let s=t();for(;typeof s=="function";)s=s();n=Qo(e,s,n,r)}),()=>n;if(Array.isArray(t)){const s=[],l=n&&Array.isArray(n);if(_1(s,t,n,i))return te(()=>n=Qo(e,s,n,r,!0)),()=>n;if(ut.context){if(!s.length)return n;for(let d=0;d<s.length;d++)if(s[d].parentNode)return n=s}if(s.length===0){if(n=po(e,n,r),a)return n}else l?n.length===0?Bp(e,s,r):$w(e,n,s):(n&&po(e),Bp(e,s));n=s}else if(t instanceof Node){if(ut.context&&t.parentNode)return n=a?[t]:t;if(Array.isArray(n)){if(a)return n=po(e,n,r,t);po(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function _1(e,t,n,r){let i=!1;for(let o=0,a=t.length;o<a;o++){let s=t[o],l=n&&n[o];if(s instanceof Node)e.push(s);else if(!(s==null||s===!0||s===!1))if(Array.isArray(s))i=_1(e,s,l)||i;else if(typeof s=="function")if(r){for(;typeof s=="function";)s=s();i=_1(e,Array.isArray(s)?s:[s],Array.isArray(l)?l:[l])||i}else e.push(s),i=!0;else{const d=String(s);l&&l.nodeType===3&&l.data===d?e.push(l):e.push(document.createTextNode(d))}}return i}function Bp(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function po(e,t,n,r){if(n===void 0)return e.textContent="";const i=r||document.createTextNode("");if(t.length){let o=!1;for(let a=t.length-1;a>=0;a--){const s=t[a];if(i!==s){const l=s.parentNode===e;!o&&!a?l?e.replaceChild(i,s):e.insertBefore(i,n):l&&s.remove()}else o=!0}}else e.insertBefore(i,n);return[i]}function Sw(){const e=ut.context;return`${e.id}${e.count++}`}const Ow="http://www.w3.org/2000/svg";function Tw(e,t=!1){return t?document.createElementNS(Ow,e):document.createElement(e)}function Nw(e){const[t,n]=Ho(e,["component"]),r=q(()=>t.component);return q(()=>{const i=r();switch(typeof i){case"function":return de(()=>i(n));case"string":const o=yw.has(i),a=ut.context?kw():Tw(i,o);return Wn(a,n,o),a}})}function Pw(e,...t){const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Dr(e){let t;return Pw(e,n=>t=n)(),t}class Aw extends Error{constructor(t,n){super(t),this.name="FelteSubmitError",this.response=n}}function Iw(e,t){return Object.keys(e).some(n=>t(e[n]))}function Xc(e,t){return Object.keys(e||{}).reduce((n,r)=>Object.assign(Object.assign({},n),{[r]:t(e[r])}),{})}function Re(e){return Object.prototype.toString.call(e)==="[object Object]"}function xn(e){return Object.keys(e||{}).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:Re(e[n])?xn(e[n]):Array.isArray(e[n])?[...e[n]]:e[n]}),{})}function Mw(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Dw(e){return function(t){if(Re(t)){const n=kn(t,e);return Mw(n,["key"])}return e}}function kn(e,t){return Xc(e,n=>Re(n)?kn(n,t):Array.isArray(n)?n.map(Dw(t)):t)}function ii(...e){const t=e.pop(),n=e.shift();if(typeof n=="string")return n;const r=xn(n);if(e.length===0)return r;for(const i of e){if(!i)continue;if(typeof i=="string")return i;let o=t(r,i);if(typeof o<"u")return o;const a=Array.from(new Set(Object.keys(r).concat(Object.keys(i))));for(const s of a)if(o=t(r[s],i[s]),typeof o<"u")r[s]=o;else if(Re(i[s])&&Re(r[s]))r[s]=ii(r[s],i[s],t);else if(Array.isArray(i[s]))r[s]=i[s].map((l,d)=>{if(!Re(l))return l;const c=Array.isArray(r[s])?r[s][d]:r[s];return ii(c,l,t)});else if(Re(i[s])){const l=kn(xn(i[s]),void 0);r[s]=ii(l,i[s],t)}else typeof i[s]<"u"&&(r[s]=i[s])}return r}function Fw(e,t){if(!(Re(e)&&Re(t))){if(Array.isArray(t)){if(t.some(Re))return;const n=Array.isArray(e)?e:[];return t.map((r,i)=>{var o;return(o=n[i])!==null&&o!==void 0?o:r})}if(typeof e<"u")return e}}function Hp(...e){return ii(...e,Fw)}function L6(...e){return ii(...e,()=>{})}function kr(e,t,n){const r=o=>String.prototype.split.call(t,o).filter(Boolean).reduce((a,s)=>a!=null?a[s]:a,e),i=r(/[,[\]]+?/)||r(/[,[\].]+?/);return i===void 0||i===e?n:i}function ca(e,t,n){e&&(e=xn(e)),Re(e)||(e={});const r=Array.isArray(t)?t:t.match(/[^.[\]]+/g)||[],i=r[r.length-1];if(!i)return e;let o=e;for(let a=0;a<r.length-1;a++){const s=r[a];if(!o[s]||!Re(o[s])&&!Array.isArray(o[s])){const l=r[a+1];isNaN(Number(l))?o[s]={}:o[s]=[]}o=o[s]}return o[i]=n(o[i]),e}function dt(e,t,n){return ca(e,t,()=>n)}function qa(e,t){if(!e||Object(e)!==e)return;typeof e<"u"&&(e=xn(e));const n=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g)||[],r=n.length===1?e:kr(e,n.slice(0,-1).join("."));return Array.isArray(r)?r.splice(Number(n[n.length-1]),1):r==null||delete r[n[n.length-1]],e}function ls(e,t){return Iw(e,n=>Re(n)?ls(n,t):Array.isArray(n)?n.length===0||n.every(r=>typeof r=="string")?t(n):n.some(r=>Re(r)?ls(r,t):t(r)):t(n))}function Lo(e){return e?.nodeName==="INPUT"}function Lw(e){return e?.nodeName==="TEXTAREA"}function Ro(e){return e?.nodeName==="SELECT"}function Jc(e){return e?.nodeName==="FIELDSET"}function Ut(e){return Lo(e)||Lw(e)||Ro(e)}function x1(e){return e.nodeType===Node.ELEMENT_NODE}function en(e,t){return t??(Ut(e)?e.name:"")}function Xu(e){let t=e;for(;t&&t.nodeName!=="FORM";){if(t.hasAttribute("data-felte-ignore"))return!0;t=t.parentElement}return!1}function qp(e,t){return!Re(e)||!t?e:typeof t=="string"?kr(e,t):t(e)}function Rw(e,t){if(!(Re(e)||Re(t))){if(e===null||e==="")return t;if(t===null||t===""||!t)return e;if(!(!e||!t)){if(Array.isArray(e)){if(!Array.isArray(t))return[...e,t];const n=[],r=Math.max(t.length,e.length);for(let i=0;i<r;i++){let o=e[i],a=t[i];!Re(o)&&!Re(a)?(Array.isArray(o)||(o=[o]),Array.isArray(a)||(a=[a]),n.push(...o,...a)):n.push(_o([o??{},a??{}]))}return n.filter(Boolean)}return Array.isArray(t)||(t=[t]),[e,...t].reduce((n,r)=>n.concat(r),[]).filter(Boolean)}}}function _o(e){return ii(...e,Rw)}function zw(e,t){return t?(Array.isArray(t)?t:[t]).map(n=>n(e)):[]}function k1(e,t){return t?Array.isArray(t)?t.reduce((n,r)=>r(n),e):t(e):e}function R6(e=8){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let n="";for(let r=0;r<e;r++)n+=t.charAt(Math.floor(Math.random()*t.length));return n}function C1(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t))return e.length!==t.length?!1:e.every((n,r)=>C1(n,t[r]));if(Re(e)&&Re(t)){const n=Object.keys(e),r=Object.keys(t);return n.length!==r.length?!1:n.every(i=>C1(e[i],t[i]))}return!1}function Td(e,t,{onInit:n,onEnd:r}={}){let i;return(...o)=>{i||n?.(),i&&clearTimeout(i),i=setTimeout(()=>{e.apply(this,o),i=void 0,r?.()},t)}}function E1(e){if(Ut(e))return[e];if(e.childElementCount===0)return[];const t=new Set;for(const n of e.children){if(Ut(n)&&t.add(n),Jc(n))for(const r of n.elements)Ut(r)&&t.add(r);n.childElementCount>0&&E1(n).forEach(r=>t.add(r))}return Array.from(t)}function z6(e){for(const t of e.elements)!Ut(t)&&!Jc(t)||e.hasAttribute("data-felte-keep-on-remove")&&!t.hasAttribute("data-felte-keep-on-remove")&&(t.dataset.felteKeepOnRemove=e.dataset.felteKeepOnRemove)}function j6(e){return e.type.match(/^(number|range)$/)?e.value?+e.value:null:e.value}function Wp(e){var t;let n={},r={};for(const i of e.elements){if(Jc(i)&&z6(i),!Ut(i)||!i.name)continue;const o=en(i);if(Lo(i)){if(i.type==="checkbox"){if(typeof kr(n,o)>"u"){if(Array.from(e.querySelectorAll(`[name="${i.name}"]`)).filter(s=>Ut(s)?o===en(s):!1).length===1){n=dt(n,o,i.checked),r=dt(r,o,!1);continue}n=dt(n,o,i.checked?[i.value]:[]),r=dt(r,o,!1);continue}Array.isArray(kr(n,o))&&i.checked&&(n=ca(n,o,s=>[...s,i.value]));continue}if(i.type==="radio"){if(kr(n,o))continue;n=dt(n,o,i.checked?i.value:void 0),r=dt(r,o,!1);continue}if(i.type==="file"){n=dt(n,o,i.multiple?Array.from(i.files||[]):(t=i.files)===null||t===void 0?void 0:t[0]),r=dt(r,o,!1);continue}}else if(Ro(i)){if(!i.multiple)n=dt(n,o,i.value);else{const s=Array.from(i.selectedOptions).map(l=>l.value);n=dt(n,o,s)}r=dt(r,o,!1);continue}const a=j6(i);n=dt(n,o,a),r=dt(r,o,!1)}return{defaultData:n,defaultTouched:r}}function kl(e,t){var n;if(!Ut(e))return;const r=t;if(Lo(e)){if(e.type==="checkbox"){const i=r;if(typeof i>"u"||typeof i=="boolean"){e.checked=!!i;return}Array.isArray(i)&&(i.includes(e.value)?e.checked=!0:e.checked=!1);return}if(e.type==="radio"){const i=r;e.value===i?e.checked=!0:e.checked=!1;return}if(e.type==="file"){if(t instanceof FileList)e.files=t;else if(t instanceof File&&typeof DataTransfer<"u"){const i=new DataTransfer;i.items.add(t),e.files=i.files}else if(typeof DataTransfer<"u"&&Array.isArray(t)&&t.some(i=>i instanceof File)){const i=new DataTransfer;for(const o of t)o instanceof File&&i.items.add(o);e.files=i.files}else(!t||Array.isArray(t)&&!t.length)&&(e.files=null,e.value="");return}}else if(Ro(e)){if(e.multiple){if(Array.isArray(r)){e.value=String((n=r[0])!==null&&n!==void 0?n:"");const i=r.map(o=>String(o));for(const o of e.options)i.includes(o.value)?o.selected=!0:o.selected=!1}}else{e.value=String(r??"");for(const i of e.options)i.value===String(r)?i.selected=!0:i.selected=!1}return}e.value=String(r??"")}function Ys(e,t){for(const n of e.elements){if(Jc(n)&&z6(n),!Ut(n)||!n.name)continue;const r=en(n);kl(n,kr(t,r))}}const jw={attributes:!0,attributeFilter:["data-felte-validation-message","aria-invalid"]};function Vw(e,t){var n,r;let i,o,a,s,l,d;typeof e=="string"?(i=e,o=t?.defaultValue,a=(n=t?.touchOnChange)!==null&&n!==void 0?n:!1,d=t?.onFormReset):(i=e.name,o=e.defaultValue,a=(r=e.touchOnChange)!==null&&r!==void 0?r:!1,d=e?.onFormReset);function c(v,x){if(!l)return;kl(l,x);const _=new Event(v,{bubbles:!0,composed:!0});l.dispatchEvent(_)}function u(v){v.forEach(()=>{const x=l.getAttribute("aria-invalid");x?s.setAttribute("aria-invalid",x):s.removeAttribute("aria-invalid");const _=l.getAttribute("data-felte-validation-message");_?s.setAttribute("data-felte-validation-message",_):s.removeAttribute("data-felte-validation-message")})}function f(v){!d||(kl(l,o),d(v))}function h(v){s=v;let x,_;if(Ut(v))return l=v,l.name=i,{};{let w=!1,k=!1;return setTimeout(()=>{if(k)return;const N=s.parentNode;if(!N||!x1(N))return;const T=N.querySelector(`[name="${i}"]`);if(!T||!Ut(T)){const A=document.createElement("input");A.type="hidden",A.name=i,N.insertBefore(A,v.nextSibling),l=A,w=!0}else l=T;kl(l,o),x=new MutationObserver(u),x.observe(l,jw),_=l.closest("form"),_?.addEventListener("reset",f)}),{destroy(){var N;w&&((N=l.parentNode)===null||N===void 0||N.removeChild(l)),k=!0,x?.disconnect(),_?.removeEventListener("reset",f)}}}}function p(v){c(a?"change":"input",v)}function y(){c("focusout")}return{field:h,onInput:p,onChange:p,onBlur:y}}function V6(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function Fr(e,t){return Xc(e,n=>Re(n)?Fr(n,t):Array.isArray(n)?n.length===0||n.every(r=>typeof r=="string")?t:n.map(r=>{const i=Fr(r,t);return V6(i,["key"])}):t)}function Zi(e){return e?Xc(e,t=>Re(t)?Zi(t):Array.isArray(t)?t.length===0||t.every(n=>typeof n=="string")?t:t.map(n=>{if(!Re(n))return n;const r=Zi(n);return r.key||(r.key=R6()),r}):t):{}}function Vi(e){return e?Xc(e,t=>Re(t)?Vi(t):Array.isArray(t)?t.length===0||t.every(n=>typeof n=="string")?t:t.map(n=>{if(!Re(n))return n;const r=Vi(n);return V6(r,["key"])}):t):{}}function Uw(){class e extends CustomEvent{constructor(i){super("feltesuccess",{detail:i})}}class t extends CustomEvent{constructor(i){super("felteerror",{detail:i,cancelable:!0})}setErrors(i){this.preventDefault(),this.errors=i}}class n extends Event{constructor(){super("feltesubmit",{cancelable:!0})}handleSubmit(i){this.onSubmit=i}handleError(i){this.onError=i}handleSuccess(i){this.onSuccess=i}}return{createErrorEvent:r=>new t(r),createSubmitEvent:()=>new n,createSuccessEvent:r=>new e(r)}}function Bw(e){if(e)return async function(){let t=new FormData(e);const n=new URL(e.action),r=e.method.toLowerCase()==="get"?"get":n.searchParams.get("_method")||e.method;let i=e.enctype;e.querySelector('input[type="file"]')&&(i="multipart/form-data"),(r==="get"||i==="application/x-www-form-urlencoded")&&(t=new URLSearchParams(t));let o;r==="get"?(t.forEach((s,l)=>{n.searchParams.append(l,s)}),o={method:r,headers:{Accept:"application/json"}}):o={method:r,body:t,headers:Object.assign(Object.assign({},i!=="multipart/form-data"&&{"Content-Type":i}),{Accept:"application/json"})};const a=await window.fetch(n.toString(),o);if(a.ok)return a;throw new Aw("An error occurred while submitting the form",a)}}function Zs(e,t,n,r){return ca(e,t,i=>(typeof i<"u"&&!Array.isArray(i)||(i||(i=[]),typeof r>"u"?i.push(n):i.splice(r,0,n)),i))}function Hw(e,t,n,r){return ca(e,t,i=>(!i||!Array.isArray(i)||([i[n],i[r]]=[i[r],i[n]]),i))}function qw(e,t,n,r){return ca(e,t,i=>(!i||!Array.isArray(i)||i.splice(r,0,i.splice(n,1)[0]),i))}function Gp(e){return typeof e=="function"}function Wr(e){return(t,n)=>{if(typeof t=="string"){const r=t;e(i=>{const o=Gp(n)?n(kr(i,r)):n;return dt(i,r,o)})}else e(r=>Gp(t)?t(r):t)}}function Ww({stores:e,config:t,validateErrors:n,validateWarnings:r,_getCurrentExtenders:i}){var o;let a,s=Zi((o=t.initialValues)!==null&&o!==void 0?o:{});const{data:l,touched:d,errors:c,warnings:u,isDirty:f,isSubmitting:h,interacted:p}=e,y=Wr(l.update),v=Wr(d.update),x=Wr(c.update),_=Wr(u.update);function w(L){y(R=>{const ie=L(R);return a&&Ys(a,ie),ie})}const k=(L,R,ie)=>{Wr(w)(L,R),typeof L=="string"&&ie&&v(L,!0)};function N(L,R,ie){const ce=Re(R)?Fr(R,!1):!1,W=Re(ce)?kn(ce,[]):[];R=Re(R)?Object.assign(Object.assign({},R),{key:R6()}):R,c.update(xe=>Zs(xe,L,W,ie)),u.update(xe=>Zs(xe,L,W,ie)),d.update(xe=>Zs(xe,L,ce,ie)),l.update(xe=>{const Oe=Zs(xe,L,R,ie);return setTimeout(()=>a&&Ys(a,Oe)),Oe})}function T(L){c.update(L),u.update(L),d.update(L),l.update(R=>{const ie=L(R);return setTimeout(()=>a&&Ys(a,ie)),ie})}function A(L){T(R=>qa(R,L))}function P(L,R,ie){T(ce=>Hw(ce,L,R,ie))}function G(L,R,ie){T(ce=>qw(ce,L,R,ie))}function Q(L){const R=kr(s,L),ie=Re(R)?Fr(R,!1):!1,ce=Re(ie)?kn(ie,[]):[];l.update(W=>{const xe=dt(W,L,R);return a&&Ys(a,xe),xe}),d.update(W=>dt(W,L,ie)),c.update(W=>dt(W,L,ce)),u.update(W=>dt(W,L,ce))}const Y=Wr(h.update),z=Wr(f.update),V=Wr(p.update);async function B(){const L=Dr(l);d.set(Fr(L,!0)),p.set(null);const R=await n(L);return await r(L),R}function I(){k(xn(s)),v(L=>kn(L,!1)),p.set(null),f.set(!1)}function ne(L){return async function(R){var ie,ce,W,xe,Oe,Ve,oe;const{createErrorEvent:Se,createSubmitEvent:Ce,createSuccessEvent:pe}=Uw(),$e=Ce();a?.dispatchEvent($e);const ke=(ce=(ie=$e.onError)!==null&&ie!==void 0?ie:L?.onError)!==null&&ce!==void 0?ce:t.onError,Ie=(xe=(W=$e.onSuccess)!==null&&W!==void 0?W:L?.onSuccess)!==null&&xe!==void 0?xe:t.onSuccess,ue=(oe=(Ve=(Oe=$e.onSubmit)!==null&&Oe!==void 0?Oe:L?.onSubmit)!==null&&Ve!==void 0?Ve:t.onSubmit)!==null&&oe!==void 0?oe:Bw(a);if(!ue||(R?.preventDefault(),$e.defaultPrevented))return;h.set(!0),p.set(null);const K=Vi(Dr(l)),_e=await n(K,L?.validate),Me=await r(K,L?.warn);if(Me&&u.set(L6(kn(K,[]),Me)),d.set(Fr(K,!0)),_e&&(d.set(Fr(_e,!0)),ls(_e,Ze=>Array.isArray(Ze)?Ze.length>=1:!!Ze))){await new Promise(Ze=>setTimeout(Ze)),i().forEach(Ze=>{var fn;return(fn=Ze.onSubmitError)===null||fn===void 0?void 0:fn.call(Ze,{data:K,errors:_e})}),h.set(!1);return}const bt={event:R,setFields:k,setData:y,setTouched:v,setErrors:x,setWarnings:_,unsetField:A,addField:N,resetField:Q,reset:I,setInitialValues:X.setInitialValues,moveField:G,swapFields:P,form:a,controls:a&&Array.from(a.elements).filter(Ut),config:Object.assign(Object.assign({},t),L)};try{const Ze=await ue(K,bt);a?.dispatchEvent(pe(Object.assign({response:Ze},bt))),await Ie?.(Ze,bt)}catch(Ze){const fn=Se(Object.assign({error:Ze},bt));if(a?.dispatchEvent(fn),!ke&&!fn.defaultPrevented)throw Ze;if(!ke&&!fn.errors)return;const Pt=fn.errors||await ke?.(Ze,bt);Pt&&(d.set(Fr(Pt,!0)),c.set(Pt),await new Promise(Ln=>setTimeout(Ln)),i().forEach(Ln=>{var Rn;return(Rn=Ln.onSubmitError)===null||Rn===void 0?void 0:Rn.call(Ln,{data:K,errors:Dr(c)})}))}finally{h.set(!1)}}}const X={setData:y,setFields:k,setTouched:v,setErrors:x,setWarnings:_,setIsSubmitting:Y,setIsDirty:z,setInteracted:V,validate:B,reset:I,unsetField:A,resetField:Q,addField:N,swapFields:P,moveField:G,createSubmitHandler:ne,handleSubmit:ne(),setInitialValues:L=>{s=Zi(L)}};return{public:X,private:{_setFormNode(L){a=L},_getInitialValues:()=>s}}}function Gw({helpers:e,stores:t,config:n,extender:r,createSubmitHandler:i,handleSubmit:o,_setFormNode:a,_getInitialValues:s,_setCurrentExtenders:l,_getCurrentExtenders:d}){const{setFields:c,setTouched:u,reset:f,setInitialValues:h}=e,{addValidator:p,addTransformer:y,validate:v}=e,{data:x,errors:_,warnings:w,touched:k,isSubmitting:N,isDirty:T,interacted:A,isValid:P,isValidating:G}=t;function Q(Y){Y.requestSubmit||(Y.requestSubmit=o);function z(ue){return function(K){return K({form:Y,stage:ue,controls:Array.from(Y.elements).filter(Ut),data:x,errors:_,warnings:w,touched:k,isValid:P,isValidating:G,isSubmitting:N,isDirty:T,interacted:A,config:n,addValidator:p,addTransformer:y,setFields:c,validate:v,reset:f,createSubmitHandler:i,handleSubmit:o})}}l(r.map(z("MOUNT"))),Y.noValidate=!!n.validate;const{defaultData:V,defaultTouched:B}=Wp(Y);a(Y),h(L6(xn(V),s())),c(s()),k.set(B);function I(ue){const K=en(ue),_e=Array.from(Y.querySelectorAll(`[name="${ue.name}"]`)).filter(Me=>Ut(Me)?K===en(Me):!1);if(_e.length!==0)return _e.length===1?x.update(Me=>dt(Me,en(ue),ue.checked)):x.update(Me=>dt(Me,en(ue),_e.filter(Lo).filter(bt=>bt.checked).map(bt=>bt.value)))}function ne(ue){const K=Y.querySelectorAll(`[name="${ue.name}"]`),_e=Array.from(K).find(Me=>Lo(Me)&&Me.checked);x.update(Me=>dt(Me,en(ue),_e?.value))}function X(ue){var K;const _e=Array.from((K=ue.files)!==null&&K!==void 0?K:[]);x.update(Me=>dt(Me,en(ue),ue.multiple?_e:_e[0]))}function L(ue){if(!ue.multiple)x.update(K=>dt(K,en(ue),ue.value));else{const K=Array.from(ue.selectedOptions).map(_e=>_e.value);x.update(_e=>dt(_e,en(ue),K))}}function R(ue){const K=ue.target;if(!K||!Ut(K)||Ro(K)||Xu(K)||["checkbox","radio","file"].includes(K.type)||!K.name)return;T.set(!0);const _e=j6(K);A.set(K.name),x.update(Me=>dt(Me,en(K),_e))}function ie(ue){const K=ue.target;if(!(!K||!Ut(K)||Xu(K))&&!!K.name)if(u(en(K),!0),A.set(K.name),(Ro(K)||["checkbox","radio","file","hidden"].includes(K.type))&&T.set(!0),K.type==="hidden"&&x.update(_e=>dt(_e,en(K),K.value)),Ro(K))L(K);else if(Lo(K))K.type==="checkbox"?I(K):K.type==="radio"?ne(K):K.type==="file"&&X(K);else return}function ce(ue){const K=ue.target;!K||!Ut(K)||Xu(K)||!K.name||(u(en(K),!0),A.set(K.name))}function W(ue){ue.preventDefault(),f()}const xe={childList:!0,subtree:!0};function Oe(ue){let K=Dr(x),_e=Dr(k),Me=Dr(_),bt=Dr(w);for(const Ze of ue.reverse()){if(Ze.hasAttribute("data-felte-keep-on-remove")&&Ze.dataset.felteKeepOnRemove!=="false")continue;const fn=/.*(\[[0-9]+\]|\.[0-9]+)\.[^.]+$/;let Pt=en(Ze);const Ln=Dr(k);if(fn.test(Pt)){const Rn=Pt.split(".").slice(0,-1).join("."),_i=kr(Ln,Rn);Re(_i)&&Object.keys(_i).length<=1&&(Pt=Rn)}K=qa(K,Pt),_e=qa(_e,Pt),Me=qa(Me,Pt),bt=qa(bt,Pt)}x.set(K),k.set(_e),_.set(Me),w.set(bt)}const Ve=Td(()=>{d().forEach(_e=>{var Me;return(Me=_e.destroy)===null||Me===void 0?void 0:Me.call(_e)}),l(r.map(z("UPDATE")));const{defaultData:ue,defaultTouched:K}=Wp(Y);x.update(_e=>Hp(_e,ue)),k.update(_e=>Hp(_e,K)),e.setFields(Dr(x))},0);let oe=[];const Se=Td(()=>{d().forEach(ue=>{var K;return(K=ue.destroy)===null||K===void 0?void 0:K.call(ue)}),l(r.map(z("UPDATE"))),Oe(oe),oe=[]},0);function Ce(ue){!Array.from(ue.addedNodes).some(K=>x1(K)?Ut(K)?!0:E1(K).length>0:!1)||Ve()}function pe(ue){for(const K of ue.removedNodes){if(!x1(K))continue;const _e=E1(K);_e.length!==0&&(oe.push(..._e),Se())}}function $e(ue){for(const K of ue)K.type==="childList"&&(K.addedNodes.length>0&&Ce(K),K.removedNodes.length>0&&pe(K))}const ke=new MutationObserver($e);ke.observe(Y,xe),Y.addEventListener("input",R),Y.addEventListener("change",ie),Y.addEventListener("focusout",ce),Y.addEventListener("submit",o),Y.addEventListener("reset",W);const Ie=_.subscribe(ue=>{for(const K of Y.elements){if(!Ut(K)||!K.name)continue;const _e=kr(ue,en(K)),Me=Array.isArray(_e)?_e.join(`
763
763
  `):typeof _e=="string"?_e:void 0;Me!==K.dataset.felteValidationMessage&&(Me?(K.dataset.felteValidationMessage=Me,K.setAttribute("aria-invalid","true")):(delete K.dataset.felteValidationMessage,K.removeAttribute("aria-invalid")))}});return{destroy(){ke.disconnect(),Y.removeEventListener("input",R),Y.removeEventListener("change",ie),Y.removeEventListener("focusout",ce),Y.removeEventListener("submit",o),Y.removeEventListener("reset",W),Ie(),d().forEach(ue=>{var K;return(K=ue.destroy)===null||K===void 0?void 0:K.call(ue)})}}}return{form:Q}}function Qw(e){const t={aborted:!1,priority:e};return{signal:t,abort(){t.aborted=!0}}}function Kw(e,t){if(Re(e))return!t||Re(t)&&Object.keys(t).length===0?kn(e,null):void 0;if(Array.isArray(e)){if(e.some(Re))return;const n=Array.isArray(t)?t:[];return e.map((r,i)=>{const o=n[i];return Array.isArray(o)&&o.length===0?null:r&&o||null})}return Array.isArray(t)&&t.length===0?null:Array.isArray(t)?e?t:null:e&&t?[t]:null}function Yw(e,t){if(Re(e))return!t||Re(t)&&Object.keys(t).length===0?kn(e,null):void 0;if(Array.isArray(e)){if(e.some(Re))return;const n=Array.isArray(t)?t:[];return e.map((r,i)=>{const o=n[i];return Array.isArray(o)&&o.length===0?null:o||null})}return Array.isArray(t)&&t.length===0?null:Array.isArray(t)?t:t?[t]:null}function Zw([e,t]){return ii(t,e,Kw)}function Xw([e,t]){return ii(t,e,Yw)}function Jw(e){return function(t,n,r){const i=Array.isArray(t)?t:[t],o=new Array(i.length),a=e(r),s=a.set,l=a.subscribe;let d;function c(){d=i.map((f,h)=>f.subscribe(p=>{o[h]=p,s(n(o))}))}function u(){d?.forEach(f=>f())}return a.subscribe=function(f){const h=l(f);return()=>{h()}},[a,c,u]}}function e_(e,t){var n,r,i,o,a,s,l,d,c;const u=Jw(e),f=t.initialValues=t.initialValues?Zi(k1(xn(t.initialValues),t.transform)):{},h=Fr(Vi(f),!1),p=e(h),y=e(0),[v,x,_]=u([p,y],([lt,_t])=>ls(lt,xt=>!!xt)&&_t>=1,!1);delete v.set,delete v.update;function w(lt){let _t;return async function(xt,Tn,zn,Xt=!1){if(!zn||!xt)return;let Jn=Tn&&Object.keys(Tn).length>0?Tn:kn(xt,[]);const er=Qw(Xt);if((!_t?.signal.priority||Xt)&&(_t?.abort(),_t=er),_t.signal.priority&&!Xt)return;y.update(jn=>jn+1);const pr=zw(xt,zn);return pr.forEach(async jn=>{const Ir=await jn;er.signal.aborted||(Jn=_o([Jn,Ir]),lt.set(Jn))}),await Promise.all(pr),_t=void 0,y.update(jn=>jn-1),Jn}}let k=kn(h,[]);const N=e(f),T=kn(h,[]),A=e(T),P=e(xn(T)),[G,Q,Y]=u([A,P],_o,xn(T)),z=kn(h,[]),V=e(z),B=e(xn(z)),[I,ne,X]=u([V,B],_o,xn(z)),[L,R,ie]=u([G,p],Zw,xn(T)),[ce,W,xe]=u([I,p],Xw,xn(z));let Oe=!1;const[Ve,oe,Se]=u(G,([lt])=>{var _t;return Oe?!ls(lt,xt=>Array.isArray(xt)?xt.length>=1:!!xt):(Oe=!0,!t.validate&&!(!((_t=t.debounced)===null||_t===void 0)&&_t.validate))},!t.validate&&!(!((n=t.debounced)===null||n===void 0)&&n.validate));delete Ve.set,delete Ve.update;const Ce=e(!1),pe=e(!1),$e=e(null),ke=w(A),Ie=w(V),ue=w(P),K=w(B),_e=Td(ue,(a=(i=(r=t.debounced)===null||r===void 0?void 0:r.validateTimeout)!==null&&i!==void 0?i:(o=t.debounced)===null||o===void 0?void 0:o.timeout)!==null&&a!==void 0?a:300,{onInit:()=>{y.update(lt=>lt+1)},onEnd:()=>{y.update(lt=>lt-1)}}),Me=Td(K,(c=(l=(s=t.debounced)===null||s===void 0?void 0:s.warnTimeout)!==null&&l!==void 0?l:(d=t.debounced)===null||d===void 0?void 0:d.timeout)!==null&&c!==void 0?c:300);async function bt(lt,_t){var xt;const Tn=Vi(lt),zn=ke(Tn,k,_t??t.validate,!0);if(_t)return zn;const Xt=ue(Tn,k,(xt=t.debounced)===null||xt===void 0?void 0:xt.validate,!0);return _o(await Promise.all([zn,Xt]))}async function Ze(lt,_t){var xt;const Tn=Vi(lt),zn=Ie(Tn,k,_t??t.warn,!0);if(_t)return zn;const Xt=K(Tn,k,(xt=t.debounced)===null||xt===void 0?void 0:xt.warn,!0);return _o(await Promise.all([zn,Xt]))}let fn=T,Pt=z;function Ln(){const lt=N.subscribe(Xt=>{var Jn,er;const pr=Vi(Xt);ke(pr,k,t.validate),Ie(pr,k,t.warn),_e(pr,k,(Jn=t.debounced)===null||Jn===void 0?void 0:Jn.validate),Me(pr,k,(er=t.debounced)===null||er===void 0?void 0:er.warn)}),_t=p.subscribe(Xt=>{k=kn(Xt,[])}),xt=G.subscribe(Xt=>{fn=Xt}),Tn=I.subscribe(Xt=>{Pt=Xt});Q(),oe(),ne(),R(),W(),x();function zn(){lt(),ie(),Y(),X(),xe(),Se(),_(),_t(),xt(),Tn()}return zn}function Rn(lt){A.set(lt(fn)),P.set({})}function _i(lt){V.set(lt(Pt)),B.set({})}function yu(lt){Rn(()=>lt)}function bu(lt){_i(()=>lt)}return L.set=yu,L.update=Rn,ce.set=bu,ce.update=_i,{data:N,errors:L,warnings:ce,touched:p,isValid:Ve,isSubmitting:Ce,isDirty:pe,isValidating:v,interacted:$e,validateErrors:bt,validateWarnings:Ze,cleanup:t.preventStoreStart?()=>{}:Ln(),start:Ln}}function t_(e,t){var n,r;(n=e.extend)!==null&&n!==void 0||(e.extend=[]),(r=e.debounced)!==null&&r!==void 0||(e.debounced={}),e.validate&&!Array.isArray(e.validate)&&(e.validate=[e.validate]),e.debounced.validate&&!Array.isArray(e.debounced.validate)&&(e.debounced.validate=[e.debounced.validate]),e.transform&&!Array.isArray(e.transform)&&(e.transform=[e.transform]),e.warn&&!Array.isArray(e.warn)&&(e.warn=[e.warn]),e.debounced.warn&&!Array.isArray(e.debounced.warn)&&(e.debounced.warn=[e.debounced.warn]);function i(ne,{debounced:X,level:L}={debounced:!1,level:"error"}){var R;const ie=L==="error"?"validate":"warn";(R=e.debounced)!==null&&R!==void 0||(e.debounced={});const ce=X?e.debounced:e;ce[ie]?ce[ie]=[...ce[ie],ne]:ce[ie]=[ne]}function o(ne){e.transform?e.transform=[...e.transform,ne]:e.transform=[ne]}const a=Array.isArray(e.extend)?e.extend:[e.extend];let s=[];const l=()=>s,d=ne=>{s=ne},{isSubmitting:c,isValidating:u,data:f,errors:h,warnings:p,touched:y,isValid:v,isDirty:x,cleanup:_,start:w,validateErrors:k,validateWarnings:N,interacted:T}=e_(t.storeFactory,e),A=f.update,P=f.set,G=ne=>A(X=>Zi(k1(ne(X),e.transform))),Q=ne=>P(Zi(k1(ne,e.transform)));f.update=G,f.set=Q;const Y=Ww({extender:a,config:e,addValidator:i,addTransformer:o,validateErrors:k,validateWarnings:N,_getCurrentExtenders:l,stores:{data:f,errors:h,warnings:p,touched:y,isValid:v,isValidating:u,isSubmitting:c,isDirty:x,interacted:T}}),{createSubmitHandler:z,handleSubmit:V}=Y.public;s=a.map(ne=>ne({stage:"SETUP",errors:h,warnings:p,touched:y,data:f,isDirty:x,isValid:v,isValidating:u,isSubmitting:c,interacted:T,config:e,addValidator:i,addTransformer:o,setFields:Y.public.setFields,reset:Y.public.reset,validate:Y.public.validate,handleSubmit:V,createSubmitHandler:z}));const B=Object.assign({config:e,stores:{data:f,touched:y,errors:h,warnings:p,isSubmitting:c,isValidating:u,isValid:v,isDirty:x,interacted:T},createSubmitHandler:z,handleSubmit:V,helpers:Object.assign(Object.assign({},Y.public),{addTransformer:o,addValidator:i}),extender:a,_getCurrentExtenders:l,_setCurrentExtenders:d},Y.private),{form:I}=Gw(B);return Object.assign({data:f,errors:h,warnings:p,touched:y,isValid:v,isSubmitting:c,isValidating:u,isDirty:x,interacted:T,form:I,cleanup:_,startStores:w},Y.public)}function n_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function r_(e){const t={},n={};function r(i){if(!i)return e();if(!t[i.toString()]){const a=U(qp(de(e),i));n[i.toString()]=a,t[i.toString()]=i}const[o]=n[i.toString()];return o()}return ve(()=>{const i=e(),o=Object.keys(t);for(const a of o){const s=t[a],l=qp(i,s),[d,c]=n[s.toString()];C1(l,de(d))||c(l)}}),r}function i_(e){return function(t){return Io(n=>(ve(()=>t(e())),n))}}const o_=e=>{const[t,n]=U(e);function r(s){n(()=>s)}function i(s){n(s)}const o=r_(t),a=i_(t);return o.subscribe=a,o.set=r,o.update=i,o};function U6(e){const t=t_(e??{},{storeFactory:o_}),{form:n,cleanup:r,startStores:i,data:o,errors:a,warnings:s,touched:l}=t,d=n_(t,["form","cleanup","startStores","data","errors","warnings","touched"]);function c(u){const{destroy:f}=n(u);return En(f),{destroy:f}}return En(r),Object.assign(Object.assign({},d),{data:o,errors:a,warnings:s,touched:l,form:c})}function a_(e,t){const{field:n,onChange:r,onInput:i,onBlur:o}=Vw(e,t);function a(s){const{destroy:l}=n(s);return En(()=>l?.()),{destroy:l}}return{field:a,onChange:r,onInput:i,onBlur:o}}function s_(e){function t(n){return n.issues.reduce((r,i)=>i.path?ca(r,i.path.join("."),o=>!o||!Array.isArray(o)?[i.message]:[...o,i.message]):r,{})}return async function(n){try{await e.parseAsync(n)}catch(r){return t(r)}}}function B6({schema:e,level:t="error"}){return function(n){if(n.stage!=="SETUP")return{};const r=s_(e);return n.addValidator(r,{level:t}),{}}}var Ge;(function(e){e.assertEqual=i=>i;function t(i){}e.assertIs=t;function n(i){throw new Error}e.assertNever=n,e.arrayToEnum=i=>{const o={};for(const a of i)o[a]=a;return o},e.getValidEnumValues=i=>{const o=e.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),a={};for(const s of o)a[s]=i[s];return e.objectValues(a)},e.objectValues=i=>e.objectKeys(i).map(function(o){return i[o]}),e.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const o=[];for(const a in i)Object.prototype.hasOwnProperty.call(i,a)&&o.push(a);return o},e.find=(i,o)=>{for(const a of i)if(o(a))return a},e.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function r(i,o=" | "){return i.map(a=>typeof a=="string"?`'${a}'`:a).join(o)}e.joinValues=r,e.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ge||(Ge={}));var Qp;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Qp||(Qp={}));const be=Ge.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Fi=e=>{switch(typeof e){case"undefined":return be.undefined;case"string":return be.string;case"number":return isNaN(e)?be.nan:be.number;case"boolean":return be.boolean;case"function":return be.function;case"bigint":return be.bigint;case"symbol":return be.symbol;case"object":return Array.isArray(e)?be.array:e===null?be.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?be.promise:typeof Map<"u"&&e instanceof Map?be.map:typeof Set<"u"&&e instanceof Set?be.set:typeof Date<"u"&&e instanceof Date?be.date:be.object;default:return be.unknown}},se=Ge.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Xi extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const a of o.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let s=r,l=0;for(;l<a.path.length;){const d=a.path[l];l===a.path.length-1?(s[d]=s[d]||{_errors:[]},s[d]._errors.push(n(a))):s[d]=s[d]||{_errors:[]},s=s[d],l++}}};return i(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ge.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Xi.create=e=>new Xi(e);const H6=(e,t)=>{let n;switch(e.code){case se.invalid_type:e.received===be.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case se.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Ge.jsonStringifyReplacer)}`;break;case se.unrecognized_keys:n=`Unrecognized key(s) in object: ${Ge.joinValues(e.keys,", ")}`;break;case se.invalid_union:n="Invalid input";break;case se.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Ge.joinValues(e.options)}`;break;case se.invalid_enum_value:n=`Invalid enum value. Expected ${Ge.joinValues(e.options)}, received '${e.received}'`;break;case se.invalid_arguments:n="Invalid function arguments";break;case se.invalid_return_type:n="Invalid function return type";break;case se.invalid_date:n="Invalid date";break;case se.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Ge.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case se.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case se.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case se.custom:n="Invalid input";break;case se.invalid_intersection_types:n="Intersection results could not be merged";break;case se.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case se.not_finite:n="Number must be finite";break;default:n=t.defaultError,Ge.assertNever(e)}return{message:n}};let l_=H6;function d_(){return l_}const c_=e=>{const{data:t,path:n,errorMaps:r,issueData:i}=e,o=[...n,...i.path||[]],a={...i,path:o};let s="";const l=r.filter(d=>!!d).slice().reverse();for(const d of l)s=d(a,{data:t,defaultError:s}).message;return{...i,path:o,message:i.message||s}};function ye(e,t){const n=c_({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,d_(),H6].filter(r=>!!r)});e.common.issues.push(n)}class In{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const i of n){if(i.status==="aborted")return je;i.status==="dirty"&&t.dirty(),r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const i of n)r.push({key:await i.key,value:await i.value});return In.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const i of n){const{key:o,value:a}=i;if(o.status==="aborted"||a.status==="aborted")return je;o.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),o.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet)&&(r[o.value]=a.value)}return{status:t.value,value:r}}}const je=Object.freeze({status:"aborted"}),u_=e=>({status:"dirty",value:e}),Kn=e=>({status:"valid",value:e}),Kp=e=>e.status==="aborted",Yp=e=>e.status==="dirty",Nd=e=>e.status==="valid",S1=e=>typeof Promise<"u"&&e instanceof Promise;var Ee;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Ee||(Ee={}));class pi{constructor(t,n,r,i){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Zp=(e,t)=>{if(Nd(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Xi(e.common.issues);return this._error=n,this._error}}};function ze(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(o,a)=>o.code!=="invalid_type"?{message:a.defaultError}:typeof a.data>"u"?{message:r??a.defaultError}:{message:n??a.defaultError},description:i}}class qe{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return Fi(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:Fi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new In,ctx:{common:t.parent.common,data:t.data,parsedType:Fi(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(S1(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const i={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fi(t)},o=this._parseSync({data:t,path:i.path,parent:i});return Zp(i,o)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Fi(t)},i=this._parse({data:t,path:r.path,parent:r}),o=await(S1(i)?i:Promise.resolve(i));return Zp(r,o)}refine(t,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,o)=>{const a=t(i),s=()=>o.addIssue({code:se.custom,...r(i)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,n){return this._refinement((r,i)=>t(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(t){return new Yo({schema:this,typeName:Ae.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return oi.create(this,this._def)}nullable(){return Zo.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Cr.create(this,this._def)}promise(){return Md.create(this,this._def)}or(t){return Ad.create([this,t],this._def)}and(t){return Id.create(this,t,this._def)}transform(t){return new Yo({...ze(this._def),schema:this,typeName:Ae.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new T1({...ze(this._def),innerType:this,defaultValue:n,typeName:Ae.ZodDefault})}brand(){return new x_({typeName:Ae.ZodBranded,type:this,...ze(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new N1({...ze(this._def),innerType:this,catchValue:n,typeName:Ae.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return lh.create(this,t)}readonly(){return P1.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const f_=/^c[^\s-]{8,}$/i,h_=/^[a-z][a-z0-9]*$/,p_=/^[0-9A-HJKMNP-TV-Z]{26}$/,m_=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,g_=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,v_="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Ju;const y_=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,b_=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,$_=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function w_(e,t){return!!((t==="v4"||!t)&&y_.test(e)||(t==="v6"||!t)&&b_.test(e))}class ni extends qe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==be.string){const i=this._getOrReturnCtx(t);return ye(i,{code:se.invalid_type,expected:be.string,received:i.parsedType}),je}const n=new In;let r;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(r=this._getOrReturnCtx(t,r),ye(r,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")t.data.length>i.value&&(r=this._getOrReturnCtx(t,r),ye(r,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(r=this._getOrReturnCtx(t,r),o?ye(r,{code:se.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&ye(r,{code:se.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")g_.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"email",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")Ju||(Ju=new RegExp(v_,"u")),Ju.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"emoji",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")m_.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"uuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")f_.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"cuid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")h_.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"cuid2",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")p_.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"ulid",code:se.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),ye(r,{validation:"url",code:se.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"regex",code:se.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(t,r),ye(r,{code:se.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(r=this._getOrReturnCtx(t,r),ye(r,{code:se.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(r=this._getOrReturnCtx(t,r),ye(r,{code:se.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?$_(i).test(t.data)||(r=this._getOrReturnCtx(t,r),ye(r,{code:se.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="ip"?w_(t.data,i.version)||(r=this._getOrReturnCtx(t,r),ye(r,{validation:"ip",code:se.invalid_string,message:i.message}),n.dirty()):Ge.assertNever(i);return{status:n.value,value:t.data}}_regex(t,n,r){return this.refinement(i=>t.test(i),{validation:n,code:se.invalid_string,...Ee.errToObj(r)})}_addCheck(t){return new ni({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Ee.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Ee.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Ee.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Ee.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Ee.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Ee.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Ee.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Ee.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,...Ee.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Ee.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Ee.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Ee.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Ee.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Ee.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Ee.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Ee.errToObj(n)})}nonempty(t){return this.min(1,Ee.errToObj(t))}trim(){return new ni({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ni({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ni({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}ni.create=e=>{var t;return new ni({checks:[],typeName:Ae.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};function __(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,i=n>r?n:r,o=parseInt(e.toFixed(i).replace(".","")),a=parseInt(t.toFixed(i).replace(".",""));return o%a/Math.pow(10,i)}class ds extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==be.number){const i=this._getOrReturnCtx(t);return ye(i,{code:se.invalid_type,expected:be.number,received:i.parsedType}),je}let n;const r=new In;for(const i of this._def.checks)i.kind==="int"?Ge.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ye(n,{code:se.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):i.kind==="multipleOf"?__(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ye(n,{code:se.not_finite,message:i.message}),r.dirty()):Ge.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ee.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ee.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ee.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ee.toString(n))}setLimit(t,n,r,i){return new ds({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ee.toString(i)}]})}_addCheck(t){return new ds({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Ee.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ee.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Ee.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ee.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ee.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&Ge.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}ds.create=e=>new ds({checks:[],typeName:Ae.ZodNumber,coerce:e?.coerce||!1,...ze(e)});class cs extends qe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==be.bigint){const i=this._getOrReturnCtx(t);return ye(i,{code:se.invalid_type,expected:be.bigint,received:i.parsedType}),je}let n;const r=new In;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ye(n,{code:se.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):Ge.assertNever(i);return{status:r.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Ee.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Ee.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Ee.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Ee.toString(n))}setLimit(t,n,r,i){return new cs({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Ee.toString(i)}]})}_addCheck(t){return new cs({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ee.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ee.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Ee.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}cs.create=e=>{var t;return new cs({checks:[],typeName:Ae.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...ze(e)})};class Xp extends qe{_parse(t){if(this._def.coerce&&(t.data=Boolean(t.data)),this._getType(t)!==be.boolean){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.boolean,received:n.parsedType}),je}return Kn(t.data)}}Xp.create=e=>new Xp({typeName:Ae.ZodBoolean,coerce:e?.coerce||!1,...ze(e)});class Pd extends qe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==be.date){const i=this._getOrReturnCtx(t);return ye(i,{code:se.invalid_type,expected:be.date,received:i.parsedType}),je}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ye(i,{code:se.invalid_date}),je}const n=new In;let r;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(r=this._getOrReturnCtx(t,r),ye(r,{code:se.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(r=this._getOrReturnCtx(t,r),ye(r,{code:se.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):Ge.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Pd({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Ee.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Ee.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Pd.create=e=>new Pd({checks:[],coerce:e?.coerce||!1,typeName:Ae.ZodDate,...ze(e)});class Jp extends qe{_parse(t){if(this._getType(t)!==be.symbol){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.symbol,received:n.parsedType}),je}return Kn(t.data)}}Jp.create=e=>new Jp({typeName:Ae.ZodSymbol,...ze(e)});class e3 extends qe{_parse(t){if(this._getType(t)!==be.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.undefined,received:n.parsedType}),je}return Kn(t.data)}}e3.create=e=>new e3({typeName:Ae.ZodUndefined,...ze(e)});class t3 extends qe{_parse(t){if(this._getType(t)!==be.null){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.null,received:n.parsedType}),je}return Kn(t.data)}}t3.create=e=>new t3({typeName:Ae.ZodNull,...ze(e)});class n3 extends qe{constructor(){super(...arguments),this._any=!0}_parse(t){return Kn(t.data)}}n3.create=e=>new n3({typeName:Ae.ZodAny,...ze(e)});class r3 extends qe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Kn(t.data)}}r3.create=e=>new r3({typeName:Ae.ZodUnknown,...ze(e)});class mi extends qe{_parse(t){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.never,received:n.parsedType}),je}}mi.create=e=>new mi({typeName:Ae.ZodNever,...ze(e)});class i3 extends qe{_parse(t){if(this._getType(t)!==be.undefined){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.void,received:n.parsedType}),je}return Kn(t.data)}}i3.create=e=>new i3({typeName:Ae.ZodVoid,...ze(e)});class Cr extends qe{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),i=this._def;if(n.parsedType!==be.array)return ye(n,{code:se.invalid_type,expected:be.array,received:n.parsedType}),je;if(i.exactLength!==null){const a=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(a||s)&&(ye(n,{code:a?se.too_big:se.too_small,minimum:s?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(ye(n,{code:se.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(ye(n,{code:se.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,s)=>i.type._parseAsync(new pi(n,a,n.path,s)))).then(a=>In.mergeArray(r,a));const o=[...n.data].map((a,s)=>i.type._parseSync(new pi(n,a,n.path,s)));return In.mergeArray(r,o)}get element(){return this._def.type}min(t,n){return new Cr({...this._def,minLength:{value:t,message:Ee.toString(n)}})}max(t,n){return new Cr({...this._def,maxLength:{value:t,message:Ee.toString(n)}})}length(t,n){return new Cr({...this._def,exactLength:{value:t,message:Ee.toString(n)}})}nonempty(t){return this.min(1,t)}}Cr.create=(e,t)=>new Cr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ae.ZodArray,...ze(t)});function xo(e){if(e instanceof Ct){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=oi.create(xo(r))}return new Ct({...e._def,shape:()=>t})}else return e instanceof Cr?new Cr({...e._def,type:xo(e.element)}):e instanceof oi?oi.create(xo(e.unwrap())):e instanceof Zo?Zo.create(xo(e.unwrap())):e instanceof Ji?Ji.create(e.items.map(t=>xo(t))):e}class Ct extends qe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=Ge.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==be.object){const l=this._getOrReturnCtx(t);return ye(l,{code:se.invalid_type,expected:be.object,received:l.parsedType}),je}const{status:n,ctx:r}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof mi&&this._def.unknownKeys==="strip"))for(const l in r.data)o.includes(l)||a.push(l);const s=[];for(const l of o){const d=i[l],c=r.data[l];s.push({key:{status:"valid",value:l},value:d._parse(new pi(r,c,r.path,l)),alwaysSet:l in r.data})}if(this._def.catchall instanceof mi){const l=this._def.unknownKeys;if(l==="passthrough")for(const d of a)s.push({key:{status:"valid",value:d},value:{status:"valid",value:r.data[d]}});else if(l==="strict")a.length>0&&(ye(r,{code:se.unrecognized_keys,keys:a}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const d of a){const c=r.data[d];s.push({key:{status:"valid",value:d},value:l._parse(new pi(r,c,r.path,d)),alwaysSet:d in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const l=[];for(const d of s){const c=await d.key;l.push({key:c,value:await d.value,alwaysSet:d.alwaysSet})}return l}).then(l=>In.mergeObjectSync(n,l)):In.mergeObjectSync(n,s)}get shape(){return this._def.shape()}strict(t){return Ee.errToObj,new Ct({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var i,o,a,s;const l=(a=(o=(i=this._def).errorMap)===null||o===void 0?void 0:o.call(i,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(s=Ee.errToObj(t).message)!==null&&s!==void 0?s:l}:{message:l}}}:{}})}strip(){return new Ct({...this._def,unknownKeys:"strip"})}passthrough(){return new Ct({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ct({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ct({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Ae.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new Ct({...this._def,catchall:t})}pick(t){const n={};return Ge.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}omit(t){const n={};return Ge.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new Ct({...this._def,shape:()=>n})}deepPartial(){return xo(this)}partial(t){const n={};return Ge.objectKeys(this.shape).forEach(r=>{const i=this.shape[r];t&&!t[r]?n[r]=i:n[r]=i.optional()}),new Ct({...this._def,shape:()=>n})}required(t){const n={};return Ge.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof oi;)i=i._def.innerType;n[r]=i}}),new Ct({...this._def,shape:()=>n})}keyof(){return q6(Ge.objectKeys(this.shape))}}Ct.create=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strip",catchall:mi.create(),typeName:Ae.ZodObject,...ze(t)});Ct.strictCreate=(e,t)=>new Ct({shape:()=>e,unknownKeys:"strict",catchall:mi.create(),typeName:Ae.ZodObject,...ze(t)});Ct.lazycreate=(e,t)=>new Ct({shape:e,unknownKeys:"strip",catchall:mi.create(),typeName:Ae.ZodObject,...ze(t)});class Ad extends qe{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function i(o){for(const s of o)if(s.result.status==="valid")return s.result;for(const s of o)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const a=o.map(s=>new Xi(s.ctx.common.issues));return ye(n,{code:se.invalid_union,unionErrors:a}),je}if(n.common.async)return Promise.all(r.map(async o=>{const a={...n,common:{...n.common,issues:[]},parent:null};return{result:await o._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(i);{let o;const a=[];for(const l of r){const d={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:d});if(c.status==="valid")return c;c.status==="dirty"&&!o&&(o={result:c,ctx:d}),d.common.issues.length&&a.push(d.common.issues)}if(o)return n.common.issues.push(...o.ctx.common.issues),o.result;const s=a.map(l=>new Xi(l));return ye(n,{code:se.invalid_union,unionErrors:s}),je}}get options(){return this._def.options}}Ad.create=(e,t)=>new Ad({options:e,typeName:Ae.ZodUnion,...ze(t)});function O1(e,t){const n=Fi(e),r=Fi(t);if(e===t)return{valid:!0,data:e};if(n===be.object&&r===be.object){const i=Ge.objectKeys(t),o=Ge.objectKeys(e).filter(s=>i.indexOf(s)!==-1),a={...e,...t};for(const s of o){const l=O1(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(n===be.array&&r===be.array){if(e.length!==t.length)return{valid:!1};const i=[];for(let o=0;o<e.length;o++){const a=e[o],s=t[o],l=O1(a,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===be.date&&r===be.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Id extends qe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=(o,a)=>{if(Kp(o)||Kp(a))return je;const s=O1(o.value,a.value);return s.valid?((Yp(o)||Yp(a))&&n.dirty(),{status:n.value,value:s.data}):(ye(r,{code:se.invalid_intersection_types}),je)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([o,a])=>i(o,a)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Id.create=(e,t,n)=>new Id({left:e,right:t,typeName:Ae.ZodIntersection,...ze(n)});class Ji extends qe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.array)return ye(r,{code:se.invalid_type,expected:be.array,received:r.parsedType}),je;if(r.data.length<this._def.items.length)return ye(r,{code:se.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),je;!this._def.rest&&r.data.length>this._def.items.length&&(ye(r,{code:se.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const s=this._def.items[a]||this._def.rest;return s?s._parse(new pi(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>In.mergeArray(n,o)):In.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new Ji({...this._def,rest:t})}}Ji.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ji({items:e,typeName:Ae.ZodTuple,rest:null,...ze(t)})};class o3 extends qe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.map)return ye(r,{code:se.invalid_type,expected:be.map,received:r.parsedType}),je;const i=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([s,l],d)=>({key:i._parse(new pi(r,s,r.path,[d,"key"])),value:o._parse(new pi(r,l,r.path,[d,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const d=await l.key,c=await l.value;if(d.status==="aborted"||c.status==="aborted")return je;(d.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(d.value,c.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of a){const d=l.key,c=l.value;if(d.status==="aborted"||c.status==="aborted")return je;(d.status==="dirty"||c.status==="dirty")&&n.dirty(),s.set(d.value,c.value)}return{status:n.value,value:s}}}}o3.create=(e,t,n)=>new o3({valueType:t,keyType:e,typeName:Ae.ZodMap,...ze(n)});class us extends qe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==be.set)return ye(r,{code:se.invalid_type,expected:be.set,received:r.parsedType}),je;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(ye(r,{code:se.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(ye(r,{code:se.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const o=this._def.valueType;function a(l){const d=new Set;for(const c of l){if(c.status==="aborted")return je;c.status==="dirty"&&n.dirty(),d.add(c.value)}return{status:n.value,value:d}}const s=[...r.data.values()].map((l,d)=>o._parse(new pi(r,l,r.path,d)));return r.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,n){return new us({...this._def,minSize:{value:t,message:Ee.toString(n)}})}max(t,n){return new us({...this._def,maxSize:{value:t,message:Ee.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}us.create=(e,t)=>new us({valueType:e,minSize:null,maxSize:null,typeName:Ae.ZodSet,...ze(t)});class a3 extends qe{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}a3.create=(e,t)=>new a3({getter:e,typeName:Ae.ZodLazy,...ze(t)});class s3 extends qe{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return ye(n,{received:n.data,code:se.invalid_literal,expected:this._def.value}),je}return{status:"valid",value:t.data}}get value(){return this._def.value}}s3.create=(e,t)=>new s3({value:e,typeName:Ae.ZodLiteral,...ze(t)});function q6(e,t){return new Ko({values:e,typeName:Ae.ZodEnum,...ze(t)})}class Ko extends qe{_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{expected:Ge.joinValues(r),received:n.parsedType,code:se.invalid_type}),je}if(this._def.values.indexOf(t.data)===-1){const n=this._getOrReturnCtx(t),r=this._def.values;return ye(n,{received:n.data,code:se.invalid_enum_value,options:r}),je}return Kn(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t){return Ko.create(t)}exclude(t){return Ko.create(this.options.filter(n=>!t.includes(n)))}}Ko.create=q6;class l3 extends qe{_parse(t){const n=Ge.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==be.string&&r.parsedType!==be.number){const i=Ge.objectValues(n);return ye(r,{expected:Ge.joinValues(i),received:r.parsedType,code:se.invalid_type}),je}if(n.indexOf(t.data)===-1){const i=Ge.objectValues(n);return ye(r,{received:r.data,code:se.invalid_enum_value,options:i}),je}return Kn(t.data)}get enum(){return this._def.values}}l3.create=(e,t)=>new l3({values:e,typeName:Ae.ZodNativeEnum,...ze(t)});class Md extends qe{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==be.promise&&n.common.async===!1)return ye(n,{code:se.invalid_type,expected:be.promise,received:n.parsedType}),je;const r=n.parsedType===be.promise?n.data:Promise.resolve(n.data);return Kn(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Md.create=(e,t)=>new Md({type:e,typeName:Ae.ZodPromise,...ze(t)});class Yo extends qe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ae.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),i=this._def.effect||null,o={addIssue:a=>{ye(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){const a=i.transform(r.data,o);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(s=>this._def.schema._parseAsync({data:s,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(i.type==="refinement"){const a=s=>{const l=i.refinement(s,o);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?je:(s.status==="dirty"&&n.dirty(),a(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?je:(s.status==="dirty"&&n.dirty(),a(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Nd(a))return a;const s=i.transform(a.value,o);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Nd(a)?Promise.resolve(i.transform(a.value,o)).then(s=>({status:n.value,value:s})):a);Ge.assertNever(i)}}Yo.create=(e,t,n)=>new Yo({schema:e,typeName:Ae.ZodEffects,effect:t,...ze(n)});Yo.createWithPreprocess=(e,t,n)=>new Yo({schema:t,effect:{type:"preprocess",transform:e},typeName:Ae.ZodEffects,...ze(n)});class oi extends qe{_parse(t){return this._getType(t)===be.undefined?Kn(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}oi.create=(e,t)=>new oi({innerType:e,typeName:Ae.ZodOptional,...ze(t)});class Zo extends qe{_parse(t){return this._getType(t)===be.null?Kn(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Zo.create=(e,t)=>new Zo({innerType:e,typeName:Ae.ZodNullable,...ze(t)});class T1 extends qe{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===be.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}T1.create=(e,t)=>new T1({innerType:e,typeName:Ae.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...ze(t)});class N1 extends qe{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return S1(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Xi(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Xi(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}N1.create=(e,t)=>new N1({innerType:e,typeName:Ae.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...ze(t)});class d3 extends qe{_parse(t){if(this._getType(t)!==be.nan){const n=this._getOrReturnCtx(t);return ye(n,{code:se.invalid_type,expected:be.nan,received:n.parsedType}),je}return{status:"valid",value:t.data}}}d3.create=e=>new d3({typeName:Ae.ZodNaN,...ze(e)});class x_ extends qe{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class lh extends qe{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?je:i.status==="dirty"?(n.dirty(),u_(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?je:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,n){return new lh({in:t,out:n,typeName:Ae.ZodPipeline})}}class P1 extends qe{_parse(t){const n=this._def.innerType._parse(t);return Nd(n)&&(n.value=Object.freeze(n.value)),n}}P1.create=(e,t)=>new P1({innerType:e,typeName:Ae.ZodReadonly,...ze(t)});Ct.lazycreate;var Ae;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ae||(Ae={}));const ko=ni.create;mi.create;Cr.create;const W6=Ct.create;Ct.strictCreate;Ad.create;Id.create;Ji.create;Ko.create;Md.create;oi.create;Zo.create;var Dd=function(){return Dd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},Dd.apply(this,arguments)};function e0(e,t){if(!Boolean(e))throw new Error(t)}function k_(e){return typeof e=="object"&&e!==null}function C_(e,t){if(!Boolean(e))throw new Error(t??"Unexpected invariant triggered.")}const E_=/\r\n|[\n\r]/g;function A1(e,t){let n=0,r=1;for(const i of e.body.matchAll(E_)){if(typeof i.index=="number"||C_(!1),i.index>=t)break;n=i.index+i[0].length,r+=1}return{line:r,column:t+1-n}}function S_(e){return G6(e.source,A1(e.source,e.start))}function G6(e,t){const n=e.locationOffset.column-1,r="".padStart(n)+e.body,i=t.line-1,o=e.locationOffset.line-1,a=t.line+o,s=t.line===1?n:0,l=t.column+s,d=`${e.name}:${a}:${l}
764
764
  `,c=r.split(/\r\n|[\n\r]/g),u=c[i];if(u.length>120){const f=Math.floor(l/80),h=l%80,p=[];for(let y=0;y<u.length;y+=80)p.push(u.slice(y,y+80));return d+c3([[`${a} |`,p[0]],...p.slice(1,f+1).map(y=>["|",y]),["|","^".padStart(h)],["|",p[f+1]]])}return d+c3([[`${a-1} |`,c[i-1]],[`${a} |`,u],["|","^".padStart(l)],[`${a+1} |`,c[i+1]]])}function c3(e){const t=e.filter(([r,i])=>i!==void 0),n=Math.max(...t.map(([r])=>r.length));return t.map(([r,i])=>r.padStart(n)+(i?" "+i:"")).join(`
765
765
  `)}function O_(e){const t=e[0];return t==null||"kind"in t||"length"in t?{nodes:t,source:e[1],positions:e[2],path:e[3],originalError:e[4],extensions:e[5]}:t}class dh extends Error{constructor(t,...n){var r,i,o;const{nodes:a,source:s,positions:l,path:d,originalError:c,extensions:u}=O_(n);super(t),this.name="GraphQLError",this.path=d??void 0,this.originalError=c??void 0,this.nodes=u3(Array.isArray(a)?a:a?[a]:void 0);const f=u3((r=this.nodes)===null||r===void 0?void 0:r.map(p=>p.loc).filter(p=>p!=null));this.source=s??(f==null||(i=f[0])===null||i===void 0?void 0:i.source),this.positions=l??f?.map(p=>p.start),this.locations=l&&s?l.map(p=>A1(s,p)):f?.map(p=>A1(p.source,p.start));const h=k_(c?.extensions)?c?.extensions:void 0;this.extensions=(o=u??h)!==null&&o!==void 0?o:Object.create(null),Object.defineProperties(this,{message:{writable:!0,enumerable:!0},name:{enumerable:!1},nodes:{enumerable:!1},source:{enumerable:!1},positions:{enumerable:!1},originalError:{enumerable:!1}}),c!=null&&c.stack?Object.defineProperty(this,"stack",{value:c.stack,writable:!0,configurable:!0}):Error.captureStackTrace?Error.captureStackTrace(this,dh):Object.defineProperty(this,"stack",{value:Error().stack,writable:!0,configurable:!0})}get[Symbol.toStringTag](){return"GraphQLError"}toString(){let t=this.message;if(this.nodes)for(const n of this.nodes)n.loc&&(t+=`
@@ -1252,7 +1252,7 @@ Description:
1252
1252
  }
1253
1253
  }
1254
1254
  }
1255
- `;class Tj{sdk;setStore;store;authentication;getSDK;clinical;constructor(t){this.sdk=t;const[n,r]=$i({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=r,this.store=n,this.authentication={state:n.authentication,handleRedirect:async i=>{try{const o=await this.sdk.authentication.handleRedirect(i);Sj(o?.appState)}catch(o){const s=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):s?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const n=await this.sdk.authentication.getUser(),r=!!this.sdk?.organization&&!!n?.org_id;let i;try{const o=await this.sdk.authentication.getAccessToken();i=Hv(o)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:n,isLoading:!1,isInOrg:t&&r&&this.sdk.organization===n.org_id,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?n.patients:this.store.patients.patients.concat(n.patients),finished:n.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:n.patient}),n.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:n}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:{CatalogTreatmentsFields:Oj}});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:n.catalog.treatments.map(r=>r)||[],templates:n.catalog.templates.map(r=>r)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((n,r)=>({id:String(r),...n}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const n=this.sdk.clinical.prescription.createPrescription({});try{const{data:r,errors:i}=await n({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),r?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:r.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:r,errors:i}}catch(r){return this.setStore("prescription",{...this.store.prescription,error:r,isLoading:!1}),{data:null,errors:[]}}}}const Nj=/[?&]code=[^&]+/,Pj=/[?&]state=[^&]+/,Aj=/[?&]error=[^&]+/,Ij=(e=window.location.search)=>(Nj.test(e)||Aj.test(e))&&Pj.test(e),Mj=e=>/^\d+$/.test(e)&&e.length>=5,qv=Dn(),On=()=>wn(qv),Dj="@photonhealth/elements",Fj="0.5.1",Lj="",Rj="dist/index.js",zj="./dist/index.d.ts",jj={start:"vite --port 3000",build:"rimraf dist && NODE_ENV=development vite build","build:prod":"npx nx run elements:build","build:watch":"rimraf dist && vite build --watch",prepublishOnly:"npm run build:prod","upload-s3":"npm run upload-s3:package-json && npm run upload-s3:dist && npm run upload-s3:package-json-latest && npm run upload-s3:dist-latest","upload-s3:package-json":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX","upload-s3:dist":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX/dist","upload-s3:package-json-latest":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST","upload-s3:dist-latest":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST/dist",lint:"eslint src","lint:only-errors":"eslint src --quiet","lint:fix":"eslint src --fix"},Vj={access:"public"},Uj=["dist","package.json"],Bj=[],Hj="",qj="ISC",Wj={"@babel/core":"^7.18.13","@csstools/postcss-sass":"^5.0.1","@rollup/plugin-typescript":"^11.0.0","@types/lodash":"^4.14.185","@types/node":"^18.7.18","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1",autoprefixer:"^10.4.13","babel-loader":"^8.2.5","css-has-pseudo":"^4.0.1",eslint:"^8.31.0","eslint-plugin-unused-imports":"^2.0.0","fast-glob":"^3.2.12","open-props":"^1.4.16",postcss:"^8.4.31","postcss-custom-media":"^8.0.2","postcss-jit-props":"^1.0.7",rimraf:"^3.0.2",vite:"^3.0.6","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},Gj={"@photonhealth/components":"*","@photonhealth/sdk":"*","@shoelace-style/shoelace":"^2.4.0","@solid-primitives/scheduled":"^1.2.0","@solid-primitives/timer":"^1.3.4","@tanstack/solid-virtual":"^3.0.0-beta.6","date-fns":"^2.29.3",graphql:"^16.6.0","graphql-tag":"^2.12.6","jwt-decode":"^3.1.2","libphonenumber-js":"^1.10.14","solid-element":"^1.6.4",superstruct:"^1.0.3"},Qj={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},Kj="3283ed3794cd092af27cfc26db5ad4535853caf8",Yj={name:Dj,version:Fj,description:Lj,main:Rj,types:zj,scripts:jj,publishConfig:Vj,files:Uj,keywords:Bj,author:Hj,license:qj,devDependencies:Wj,dependencies:Gj,exports:Qj,gitHead:Kj},Zj=H("<slot></slot>"),Xj=H("<div></div>"),Jj=Yj?.version??"unknown";st("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{let t;const n=new cw({env:e.env,domain:e.domain,audience:e.audience,uri:e.uri,clientId:e.id,redirectURI:e.redirectUri?e.redirectUri:window.location.origin,organization:e.org,developmentMode:e.developmentMode},Jj),r=new Tj(n);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[i]=U(r),o=async()=>{await i()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},a=async()=>{await i()?.authentication.checkSession(),bj(async()=>{await i()?.authentication.checkSession()},6e4,setInterval)};return ve(()=>{Ij()&&i()?o():i()&&a()}),ve(()=>{if(!i()?.authentication.state.isLoading&&!i()?.authentication.state.isAuthenticated&&e.autoLogin){const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}}),(()=>{const s=Xj.cloneNode(!0),l=t;return typeof l=="function"?He(l,s):t=s,O(s,g(qv.Provider,{get value(){return i()},get children(){return g(PD,{client:n,get children(){const d=Zj.cloneNode(!0);return d._$owner=le(),d}})}})),s})()});const Mt=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-2{margin-top:.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113/var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49 130 206/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28/var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13 148 136/var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255/var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43 108 176/var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:text-right{text-align:right}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:\\!w-auto{width:auto!important}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}
1255
+ `;class Tj{sdk;setStore;store;authentication;getSDK;clinical;constructor(t){this.sdk=t;const[n,r]=$i({authentication:{isAuthenticated:!1,isInOrg:!1,permissions:[],isLoading:!0,error:void 0,user:void 0},catalog:{isLoading:!1,treatments:[],templates:[]},catalogs:{isLoading:!1,catalogs:[]},dispenseUnits:{isLoading:!1,dispenseUnits:new Array},patients:{isLoading:!1,patients:[],finished:!1},patient:{isLoading:!1,patient:void 0},prescription:{isLoading:!1,errors:[],error:void 0,data:void 0}});this.setStore=r,this.store=n,this.authentication={state:n.authentication,handleRedirect:async i=>{try{const o=await this.sdk.authentication.handleRedirect(i);Sj(o?.appState)}catch(o){const s=new URLSearchParams(window.location.search).get("error_description");o.message.includes("must be an organization id")?this.setStore("authentication",{...this.store.authentication,error:"The provided organization id is invalid or does not exist"}):s?.includes("is not part of the org")?this.setStore("authentication",{...this.store.authentication,error:"User is not authorized",isLoading:!1}):this.setStore("authentication",{...this.store.authentication,error:o.message})}},checkSession:this.checkSession.bind(this),login:this.login.bind(this),logout:this.logout.bind(this)},this.getSDK=this._getSDK.bind(this),this.clinical={catalog:{state:n.catalog,getCatalog:this.getCatalog.bind(this)},catalogs:{state:n.catalogs,getCatalogs:this.getCatalogs.bind(this)},dispenseUnits:{state:n.dispenseUnits,getDispenseUnits:this.getDispenseUnits.bind(this)},patients:{state:n.patients,getPatients:this.getPatients.bind(this)},patient:{state:n.patient,getPatient:this.getPatient.bind(this)},prescription:{state:n.prescription,createPrescription:this.createPrescription.bind(this)}}}_getSDK(){return this.sdk}async checkSession(){try{await this.sdk.authentication.checkSession();const t=await this.sdk.authentication.isAuthenticated();this.setStore("authentication",{...this.store.authentication,isAuthenticated:t});const n=await this.sdk.authentication.getUser(),r=!!this.sdk?.organization&&!!n?.org_id;let i;try{const o=await this.sdk.authentication.getAccessToken();i=Hv(o)?.permissions||[]}catch{i=[]}this.setStore("authentication",{...this.store.authentication,user:n,isLoading:!1,isInOrg:t&&r&&this.sdk.organization===n.org_id,permissions:i||[]})}catch{this.setStore("authentication",{...this.store.authentication,isLoading:!1})}}async login(t={}){await this.sdk.authentication.login(t),await this.checkSession()}async logout(t={}){await this.sdk.authentication.logout(t),this.setStore("authentication",{...this.store.authentication,isAuthenticated:!1,isInOrg:!1,permissions:[],user:void 0})}async getPatients(t){t||(t={}),this.setStore("patients",{...this.store.patients,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatients(t);this.setStore("patients",{...this.store.patients,isLoading:!1,patients:t.clear?n.patients:this.store.patients.patients.concat(n.patients),finished:n.patients.length==0})}async getPatient(t){this.setStore("patient",{...this.store.patient,isLoading:!0});const{data:n}=await this.sdk.clinical.patient.getPatient(t);return this.setStore("patient",{...this.store.patient,isLoading:!1,patient:n.patient}),n.patient}async getCatalog(t){this.setStore("catalog",{...this.store.catalog,isLoading:!0});const{data:n}=await this.sdk.clinical.catalog.getCatalog({id:t.id,fragment:{CatalogTreatmentsFields:Oj}});this.setStore("catalog",{...this.store.catalog,isLoading:!1,treatments:n.catalog.treatments.map(r=>r)||[],templates:n.catalog.templates.map(r=>r)||[]})}async getCatalogs(){this.setStore("catalogs",{...this.store.catalogs,isLoading:!0});const{data:t}=await this.sdk.clinical.catalog.getCatalogs();this.setStore("catalogs",{...this.store.catalogs,isLoading:!1,catalogs:t.catalogs})}async getDispenseUnits(){this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!0});const{data:t}=await this.sdk.clinical.prescription.getDispenseUnits();this.setStore("dispenseUnits",{...this.store.dispenseUnits,isLoading:!1,dispenseUnits:t.dispenseUnits.map((n,r)=>({id:String(r),...n}))})}async createPrescription(t){this.setStore("prescription",{...this.store.prescription,isLoading:!0});const n=this.sdk.clinical.prescription.createPrescription({});try{const{data:r,errors:i}=await n({variables:t,refetchQueries:[],awaitRefetchQueries:!1});return i&&i.length>0&&this.setStore("prescription",{...this.store.prescription,errors:[...i]}),r?.createPrescription&&this.setStore("prescription",{...this.store.prescription,data:r.createPrescription}),this.setStore("prescription",{...this.store.prescription,isLoading:!1}),{data:r,errors:i}}catch(r){return this.setStore("prescription",{...this.store.prescription,error:r,isLoading:!1}),{data:null,errors:[]}}}}const Nj=/[?&]code=[^&]+/,Pj=/[?&]state=[^&]+/,Aj=/[?&]error=[^&]+/,Ij=(e=window.location.search)=>(Nj.test(e)||Aj.test(e))&&Pj.test(e),Mj=e=>/^\d+$/.test(e)&&e.length>=5,qv=Dn(),On=()=>wn(qv),Dj="@photonhealth/elements",Fj="0.5.2",Lj="",Rj="dist/index.js",zj="./dist/index.d.ts",jj={start:"vite --port 3000",build:"rimraf dist && NODE_ENV=development vite build","build:prod":"npx nx run elements:build","build:watch":"rimraf dist && vite build --watch",prepublishOnly:"npm run build:prod","upload-s3":"npm run upload-s3:package-json && npm run upload-s3:dist && npm run upload-s3:package-json-latest && npm run upload-s3:dist-latest","upload-s3:package-json":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX","upload-s3:dist":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX/dist","upload-s3:package-json-latest":"s3-deploy './package.json' --cwd './' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST","upload-s3:dist-latest":"s3-deploy './dist/**' --cwd './dist/' --region 'us-east-1' --bucket 'cdn.rx.dev' --filePrefix $PREFIX_LATEST/dist",lint:"eslint src","lint:only-errors":"eslint src --quiet","lint:fix":"eslint src --fix"},Vj={access:"public"},Uj=["dist","package.json"],Bj=[],Hj="",qj="ISC",Wj={"@babel/core":"^7.18.13","@csstools/postcss-sass":"^5.0.1","@rollup/plugin-typescript":"^11.0.0","@types/lodash":"^4.14.185","@types/node":"^18.7.18","@typescript-eslint/eslint-plugin":"^5.48.1","@typescript-eslint/parser":"^5.48.1",autoprefixer:"^10.4.13","babel-loader":"^8.2.5","css-has-pseudo":"^4.0.1",eslint:"^8.31.0","eslint-plugin-unused-imports":"^2.0.0","fast-glob":"^3.2.12","open-props":"^1.4.16",postcss:"^8.4.31","postcss-custom-media":"^8.0.2","postcss-jit-props":"^1.0.7",rimraf:"^3.0.2",vite:"^3.0.6","vite-plugin-solid":"^2.3.0","vite-plugin-static-copy":"^0.13.1"},Gj={"@photonhealth/components":"*","@photonhealth/sdk":"*","@shoelace-style/shoelace":"^2.4.0","@solid-primitives/scheduled":"^1.2.0","@solid-primitives/timer":"^1.3.4","@tanstack/solid-virtual":"^3.0.0-beta.6","date-fns":"^2.29.3",graphql:"^16.6.0","graphql-tag":"^2.12.6","jwt-decode":"^3.1.2","libphonenumber-js":"^1.10.14","solid-element":"^1.6.4",superstruct:"^1.0.3"},Qj={".":{import:"./dist/index.mjs",require:"./dist/index.js"}},Kj="3283ed3794cd092af27cfc26db5ad4535853caf8",Yj={name:Dj,version:Fj,description:Lj,main:Rj,types:zj,scripts:jj,publishConfig:Vj,files:Uj,keywords:Bj,author:Hj,license:qj,devDependencies:Wj,dependencies:Gj,exports:Qj,gitHead:Kj},Zj=H("<slot></slot>"),Xj=H("<div></div>"),Jj=Yj?.version??"unknown";st("photon-client",{domain:{attribute:"domain",value:void 0,reflect:!1,notify:!1,parse:!1},id:{attribute:"id",value:void 0,reflect:!1,notify:!1,parse:!1},redirectUri:{attribute:"redirect-uri",value:void 0,reflect:!1,notify:!1,parse:!1},redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1},org:{attribute:"org",value:void 0,reflect:!1,notify:!1,parse:!1},audience:{attribute:"audience",value:void 0,reflect:!1,notify:!1,parse:!1},uri:{attribute:"uri",value:void 0,reflect:!1,notify:!1,parse:!1},developmentMode:{attribute:"dev-mode",value:!1,reflect:!0,notify:!1,parse:!0},errorMessage:{attribute:"error-message",value:"Oh snap! There was an error loading. Please contact your site's administrator",reflect:!1,notify:!1,parse:!1},autoLogin:{attribute:"auto-login",value:!1,reflect:!1,notify:!1,parse:!0},env:{attribute:"env",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{let t;const n=new cw({env:e.env,domain:e.domain,audience:e.audience,uri:e.uri,clientId:e.id,redirectURI:e.redirectUri?e.redirectUri:window.location.origin,organization:e.org,developmentMode:e.developmentMode},Jj),r=new Tj(n);e.developmentMode&&console.info("[PhotonClient]: Development mode enabled");const[i]=U(r),o=async()=>{await i()?.authentication.handleRedirect(),e.redirectPath&&window.location.replace(e.redirectPath)},a=async()=>{await i()?.authentication.checkSession(),bj(async()=>{await i()?.authentication.checkSession()},6e4,setInterval)};return ve(()=>{Ij()&&i()?o():i()&&a()}),ve(()=>{if(!i()?.authentication.state.isLoading&&!i()?.authentication.state.isAuthenticated&&e.autoLogin){const s={appState:{}};e.redirectPath&&(s.appState.returnTo=e.redirectPath),i()?.authentication.login(s)}}),(()=>{const s=Xj.cloneNode(!0),l=t;return typeof l=="function"?He(l,s):t=s,O(s,g(qv.Provider,{get value(){return i()},get children(){return g(PD,{client:n,get children(){const d=Zj.cloneNode(!0);return d._$owner=le(),d}})}})),s})()});const Mt=`*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.left-0{left:0}.left-4{left:1rem}.top-0{top:0}.z-10{z-index:10}.order-last{order:9999}.m-3{margin:.75rem}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-8{margin-top:2rem;margin-bottom:2rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.mr-1{margin-right:.25rem}.mt-2{margin-top:.5rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-10{height:2.5rem}.h-\\[21px\\]{height:21px}.h-\\[28px\\]{height:28px}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-2\\/5{width:40%}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-screen{width:100vw}.min-w-\\[40\\%\\]{min-width:40%}.min-w-\\[48\\%\\]{min-width:48%}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink{flex-shrink:1}.flex-grow{flex-grow:1}.cursor-pointer{cursor:pointer}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.self-start{align-self:flex-start}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.overflow-ellipsis{text-overflow:ellipsis}.whitespace-normal{white-space:normal}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-lg{border-radius:.5rem}.border{border-width:1px}.border-2{border-width:2px}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235/var(--tw-border-opacity))}.border-red-400{--tw-border-opacity: 1;border-color:rgb(248 113 113/var(--tw-border-opacity))}.border-red-500{--tw-border-opacity: 1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.bg-\\[\\#F9FAFB\\]{--tw-bg-opacity: 1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-photon-blue{--tw-bg-opacity: 1;background-color:rgb(49 130 206/var(--tw-bg-opacity))}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.p-4{padding:1rem}.px-4{padding-left:1rem;padding-right:1rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pb-24{padding-bottom:6rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-\\[19\\.75px\\]{padding-left:19.75px}.pt-1{padding-top:.25rem}.pt-28{padding-top:7rem}.text-left{text-align:left}.text-center{text-align:center}.font-sans{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji"}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-light{font-weight:300}.font-medium{font-weight:500}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28/var(--tw-text-opacity))}.text-teal-600{--tw-text-opacity: 1;color:rgb(13 148 136/var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255/var(--tw-text-opacity))}.shadow-card{--tw-shadow: 0px 0px 1px rgba(48, 49, 51, .05),0px 2px 4px rgba(48, 49, 51, .1);--tw-shadow-colored: 0px 0px 1px var(--tw-shadow-color), 0px 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-ring-shadow, 0 0 rgba(0, 0, 0, 0)),var(--tw-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:cursor-pointer:hover{cursor:pointer}.hover\\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216/var(--tw-bg-opacity))}.hover\\:bg-photon-blue-dark:hover{--tw-bg-opacity: 1;background-color:rgb(43 108 176/var(--tw-bg-opacity))}.hover\\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99/var(--tw-text-opacity))}.hover\\:underline:hover{text-decoration-line:underline}.disabled\\:bg-gray-500:disabled{--tw-bg-opacity: 1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}@media (min-width: 475px){.xs\\:mx-auto{margin-left:auto;margin-right:auto}.xs\\:min-w-\\[40\\%\\]{min-width:40%}.xs\\:min-w-\\[48\\%\\]{min-width:48%}.xs\\:flex-row{flex-direction:row}.xs\\:gap-4{gap:1rem}.xs\\:pb-2{padding-bottom:.5rem}.xs\\:pt-28{padding-top:7rem}.xs\\:text-base{font-size:1rem;line-height:1.5rem}}@media (min-width: 640px){.sm\\:order-first{order:-9999}.sm\\:mt-0{margin-top:0}.sm\\:inline{display:inline}.sm\\:grid{display:grid}.sm\\:w-\\[600px\\]{width:600px}.sm\\:w-auto{width:auto}.sm\\:flex-none{flex:none}.sm\\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.sm\\:gap-3{gap:.75rem}.sm\\:gap-4{gap:1rem}.sm\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.sm\\:text-right{text-align:right}}@media (min-width: 768px){.md\\:static{position:static}.md\\:mb-0{margin-bottom:0}.md\\:\\!w-auto{width:auto!important}.md\\:flex-1{flex:1 1 0%}.md\\:flex-row{flex-direction:row}.md\\:justify-center{justify-content:center}.md\\:px-4{padding-left:1rem;padding-right:1rem}.md\\:px-8{padding-left:2rem;padding-right:2rem}.md\\:py-2{padding-top:.5rem;padding-bottom:.5rem}.md\\:py-3{padding-top:.75rem;padding-bottom:.75rem}.md\\:pb-52{padding-bottom:13rem}.md\\:pr-2{padding-right:.5rem}.md\\:pt-4{padding-top:1rem}.md\\:text-3xl{font-size:1.875rem;line-height:2.25rem}.md\\:text-xl{font-size:1.25rem;line-height:1.75rem}}@media (min-width: 1024px){.lg\\:gap-2{gap:.5rem}.lg\\:pt-20{padding-top:5rem}}
1256
1256
  `,eV=H("<style></style>"),tV=H('<button class="w-full disabled:bg-gray-500 bg-photon-blue hover:bg-blue-700 text-white h-10 px-4 rounded-lg font-sans hover:bg-photon-blue-dark transition ease-in-out delay-50"></button>');st("photon-auth-button",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{const t=On();return ve(()=>{t||console.error("[photon-auth-button] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{const n=eV.cloneNode(!0);return O(n,Mt),n})(),t?(()=>{const n=tV.cloneNode(!0);return n.$$click=async()=>{const r={appState:{}};e.redirectPath&&(r.appState.returnTo=e.redirectPath),t.authentication.state.isAuthenticated?await t.authentication.logout():await t.authentication.login(r)},O(n,()=>t.authentication.state.isAuthenticated?"Log out":"Log in"),te(()=>n.disabled=t.authentication.state.isLoading),n})():null]});jc(["click"]);const nV=H("<style></style>"),rV=H(`<div class="flex flex-col w-screen max-w-sm"><svg viewBox="0 0 305 62.61" xmlns="http://www.w3.org/2000/svg" class="h-[28px] pl-[19.75px]"><g fill="#273D52"><path d="M0 54.1169H6.81375V35.7722H18.0826C29.5481 35.7722 34.3963 30.3343 34.3963 18.7378V17.4275C34.3963 5.76548 29.417 0.655167 18.0826 0.655167H0V54.1169ZM6.81375 30.1377V6.28961H18.2792C24.7653 6.28961 27.386 8.9758 27.386 16.0516V20.0481C27.386 27.1895 24.7653 30.1377 18.2792 30.1377H6.81375Z"></path><path d="M70.9593 54.1169H77.773V0.655167H70.9593V24.4378H50.8456V0.655167H44.0319V54.1169H50.8456V30.3343H70.9593V54.1169Z"></path><path d="M107.146 54.772C119.528 54.772 125.687 46.5169 125.687 34.9205V19.7861C125.687 8.25511 119.528 0 107.146 0C94.6974 0 88.5388 8.25511 88.5388 19.7861V34.9205C88.5388 46.5169 94.6974 54.772 107.146 54.772ZM95.5491 35.9687V18.8033C95.5491 10.7448 99.4801 5.89651 107.146 5.89651C114.745 5.89651 118.677 10.7448 118.677 18.8033V35.9687C118.677 44.0928 114.745 48.8755 107.146 48.8755C99.4801 48.8755 95.5491 44.0928 95.5491 35.9687Z"></path><path d="M144.295 54.1169H151.109V6.48616H164.54V0.655167H130.864V6.48616H144.295V54.1169Z"></path><path d="M188.299 54.772C200.682 54.772 206.841 46.5169 206.841 34.9205V19.7861C206.841 8.25511 200.682 0 188.299 0C175.851 0 169.693 8.25511 169.693 19.7861V34.9205C169.693 46.5169 175.851 54.772 188.299 54.772ZM176.703 35.9687V18.8033C176.703 10.7448 180.634 5.89651 188.299 5.89651C195.899 5.89651 199.83 10.7448 199.83 18.8033V35.9687C199.83 44.0928 195.899 48.8755 188.299 48.8755C180.634 48.8755 176.703 44.0928 176.703 35.9687Z"></path><path d="M217.6 54.1169H224.021V14.3482L245.576 54.1169H252.608L248.058 45.1084L245.641 40.4239L224.086 0.655167H217.6V54.1169Z"></path></g><g fill="#B35724"><circle cx="249.798" cy="5.202" r="5.202"></circle></g></svg><h1 class="font-medium text-3xl text-center font-sans mt-6 mb-3">Log in to your account</h1><p class="text-gray-500 font-sans text-center mb-8">Don't have an account? <a href="mailto:rado@photon.health" class="text-teal-600 hover:underline hover:cursor-pointer font-sans font-light">Contact Sales</a></p><photon-auth-button></photon-auth-button></div>`);st("photon-login",{redirectPath:{attribute:"redirect-path",value:void 0,reflect:!1,notify:!1,parse:!1}},e=>{const t=On();return ve(()=>{t||console.error("[photon-login] No valid PhotonClient instance was provided. Please ensure you are wrapping the element in a photon-client element")}),[(()=>{const n=nV.cloneNode(!0);return O(n,Mt),n})(),(()=>{const n=de(()=>document.importNode(rV,!0)),r=n.firstChild,i=r.nextSibling,o=i.nextSibling,a=o.nextSibling;return a._$owner=le(),te(()=>a.redirectPath=e.redirectPath),n})()]});var Eh=(e,t)=>{let n;const r=()=>clearTimeout(n);return le()&&En(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>e(...o),t)},{clear:r})},Ol=window,Sh=Ol.ShadowRoot&&(Ol.ShadyCSS===void 0||Ol.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Oh=Symbol(),z3=new WeakMap,Wv=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==Oh)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(Sh&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=z3.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&z3.set(t,e))}return e}toString(){return this.cssText}},iV=e=>new Wv(typeof e=="string"?e:e+"",void 0,Oh),Yt=(e,...t)=>{const n=e.length===1?e[0]:t.reduce((r,i,o)=>r+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+e[o+1],e[0]);return new Wv(n,e,Oh)},oV=(e,t)=>{Sh?e.adoptedStyleSheets=t.map(n=>n instanceof CSSStyleSheet?n:n.styleSheet):t.forEach(n=>{const r=document.createElement("style"),i=Ol.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=n.cssText,e.appendChild(r)})},j3=Sh?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let n="";for(const r of t.cssRules)n+=r.cssText;return iV(n)})(e):e,c0,qd=window,V3=qd.trustedTypes,aV=V3?V3.emptyScript:"",U3=qd.reactiveElementPolyfillSupport,ms={toAttribute(e,t){switch(t){case Boolean:e=e?aV:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},Gv=(e,t)=>t!==e&&(t==t||e==e),u0={attribute:!0,type:String,converter:ms,reflect:!1,hasChanged:Gv},So=class extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this.u()}static addInitializer(e){var t;this.finalize(),((t=this.h)!==null&&t!==void 0?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((t,n)=>{const r=this._$Ep(n,t);r!==void 0&&(this._$Ev.set(r,n),e.push(r))}),e}static createProperty(e,t=u0){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){const n=typeof e=="symbol"?Symbol():"__"+e,r=this.getPropertyDescriptor(e,n,t);r!==void 0&&Object.defineProperty(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(r){const i=this[e];this[t]=r,this.requestUpdate(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||u0}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const t=this.properties,n=[...Object.getOwnPropertyNames(t),...Object.getOwnPropertySymbols(t)];for(const r of n)this.createProperty(r,t[r])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const r of n)t.unshift(j3(r))}else e!==void 0&&t.push(j3(e));return t}static _$Ep(e,t){const n=t.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}u(){var e;this._$E_=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(t=>t(this))}addController(e){var t,n;((t=this._$ES)!==null&&t!==void 0?t:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((n=e.hostConnected)===null||n===void 0||n.call(e))}removeController(e){var t;(t=this._$ES)===null||t===void 0||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;const t=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return oV(t,this.constructor.elementStyles),t}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostConnected)===null||n===void 0?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(t=>{var n;return(n=t.hostDisconnected)===null||n===void 0?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EO(e,t,n=u0){var r;const i=this.constructor._$Ep(e,n);if(i!==void 0&&n.reflect===!0){const o=(((r=n.converter)===null||r===void 0?void 0:r.toAttribute)!==void 0?n.converter:ms).toAttribute(t,n.type);this._$El=e,o==null?this.removeAttribute(i):this.setAttribute(i,o),this._$El=null}}_$AK(e,t){var n;const r=this.constructor,i=r._$Ev.get(e);if(i!==void 0&&this._$El!==i){const o=r.getPropertyOptions(i),a=typeof o.converter=="function"?{fromAttribute:o.converter}:((n=o.converter)===null||n===void 0?void 0:n.fromAttribute)!==void 0?o.converter:ms;this._$El=i,this[i]=a.fromAttribute(t,o.type),this._$El=null}}requestUpdate(e,t,n){let r=!0;e!==void 0&&(((n=n||this.constructor.getPropertyOptions(e)).hasChanged||Gv)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,n))):r=!1),!this.isUpdatePending&&r&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((r,i)=>this[i]=r),this._$Ei=void 0);let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostUpdate)===null||i===void 0?void 0:i.call(r)}),this.update(n)):this._$Ek()}catch(r){throw t=!1,this._$Ek(),r}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$ES)===null||t===void 0||t.forEach(n=>{var r;return(r=n.hostUpdated)===null||r===void 0?void 0:r.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((t,n)=>this._$EO(n,this[n],t)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}};So.finalized=!0,So.elementProperties=new Map,So.elementStyles=[],So.shadowRootOptions={mode:"open"},U3?.({ReactiveElement:So}),((c0=qd.reactiveElementVersions)!==null&&c0!==void 0?c0:qd.reactiveElementVersions=[]).push("1.6.1");var f0,Wd=window,ra=Wd.trustedTypes,B3=ra?ra.createPolicy("lit-html",{createHTML:e=>e}):void 0,ti=`lit$${(Math.random()+"").slice(9)}$`,Qv="?"+ti,sV=`<${Qv}>`,ia=document,gs=(e="")=>ia.createComment(e),vs=e=>e===null||typeof e!="object"&&typeof e!="function",Kv=Array.isArray,lV=e=>Kv(e)||typeof e?.[Symbol.iterator]=="function",Da=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,H3=/-->/g,q3=/>/g,Si=RegExp(`>|[
1257
1257
  \f\r](?:([^\\s"'>=/]+)([
1258
1258
  \f\r]*=[
package/dist/index.mjs CHANGED
@@ -10277,7 +10277,7 @@ var Rp;
10277
10277
  (function(e) {
10278
10278
  e.Female = "FEMALE", e.Male = "MALE", e.Unknown = "UNKNOWN";
10279
10279
  })(Rp || (Rp = {}));
10280
- const W$ = "@photonhealth/sdk", G$ = "1.3.1", Q$ = "dist/lib.js", K$ = {
10280
+ const W$ = "@photonhealth/sdk", G$ = "1.3.2", Q$ = "dist/lib.js", K$ = {
10281
10281
  build: "npx nx run sdk:build",
10282
10282
  docs: 'find src -name "*.ts" | xargs npx typedoc --out docs',
10283
10283
  prepublishOnly: "npm run build"
@@ -10330,7 +10330,7 @@ var Zu;
10330
10330
  const dw = (Zu = Yu?.version) !== null && Zu !== void 0 ? Zu : "unknown";
10331
10331
  class cw {
10332
10332
  constructor({ domain: t, clientId: n, redirectURI: r, organization: i, env: o = "photon", audience: a, uri: s, developmentMode: l = !1 }, d) {
10333
- this.audience = a || Ks[o], this.uri = s || `${Ks[o]}/graphql`, this.clinicalUrl = s ? N$(s) : w1[o], this.clinicalApiUri = `${Sp[o]}/graphql`, l && (this.audience = Ks.neutron, this.uri = `${Ks.neutron}/graphql'`, this.clinicalApiUri = `${Sp.neutron}/graphql'`);
10333
+ this.audience = a || Ks[o], this.uri = s || `${Ks[o]}/graphql`, this.clinicalUrl = s ? N$(s) : w1[o], this.clinicalApiUri = `${Sp[o]}/graphql`, l && (this.audience = Ks.neutron, this.uri = `${Ks.neutron}/graphql`, this.clinicalApiUri = `${Sp.neutron}/graphql`);
10334
10334
  const c = {
10335
10335
  domain: t || (l ? "auth.neutron.health" : "auth.photon.health"),
10336
10336
  clientId: n,
@@ -31240,7 +31240,7 @@ class Tj {
31240
31240
  }
31241
31241
  }
31242
31242
  }
31243
- const Nj = /[?&]code=[^&]+/, Pj = /[?&]state=[^&]+/, Aj = /[?&]error=[^&]+/, Ij = (e = window.location.search) => (Nj.test(e) || Aj.test(e)) && Pj.test(e), Mj = (e) => /^\d+$/.test(e) && e.length >= 5, qv = Dn(), On = () => wn(qv), Dj = "@photonhealth/elements", Fj = "0.5.1", Lj = "", Rj = "dist/index.js", zj = "./dist/index.d.ts", jj = {
31243
+ const Nj = /[?&]code=[^&]+/, Pj = /[?&]state=[^&]+/, Aj = /[?&]error=[^&]+/, Ij = (e = window.location.search) => (Nj.test(e) || Aj.test(e)) && Pj.test(e), Mj = (e) => /^\d+$/.test(e) && e.length >= 5, qv = Dn(), On = () => wn(qv), Dj = "@photonhealth/elements", Fj = "0.5.2", Lj = "", Rj = "dist/index.js", zj = "./dist/index.d.ts", jj = {
31244
31244
  start: "vite --port 3000",
31245
31245
  build: "rimraf dist && NODE_ENV=development vite build",
31246
31246
  "build:prod": "npx nx run elements:build",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",