@foxy.io/elements 1.40.0-beta.1 → 1.40.0-beta.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/cdn/foxy-address-form.js +1 -1
- package/dist/cdn/foxy-admin-subscription-form.js +1 -1
- package/dist/cdn/foxy-applied-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-cart-form.js +2 -2
- package/dist/cdn/foxy-client-form.js +1 -1
- package/dist/cdn/foxy-coupon-code-form.js +1 -1
- package/dist/cdn/foxy-coupon-form.js +1 -1
- package/dist/cdn/foxy-customer-form.js +1 -1
- package/dist/cdn/foxy-customer-portal-settings-form.js +1 -1
- package/dist/cdn/foxy-customer-portal.js +1 -1
- package/dist/cdn/foxy-customer.js +1 -1
- package/dist/cdn/foxy-downloadable-form.js +1 -1
- package/dist/cdn/foxy-email-template-form.js +1 -1
- package/dist/cdn/foxy-experimental-add-to-cart-builder.js +1 -1
- package/dist/cdn/foxy-filter-attribute-form.js +1 -1
- package/dist/cdn/foxy-generate-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-code-form.js +1 -1
- package/dist/cdn/foxy-gift-card-codes-form.js +1 -1
- package/dist/cdn/foxy-gift-card-form.js +1 -1
- package/dist/cdn/foxy-integration-form.js +1 -1
- package/dist/cdn/foxy-item-category-form.js +1 -1
- package/dist/cdn/foxy-item-form.js +1 -1
- package/dist/cdn/foxy-item-option-form.js +1 -1
- package/dist/cdn/foxy-native-integration-form.js +1 -1
- package/dist/cdn/foxy-passkey-form.js +1 -1
- package/dist/cdn/foxy-payment-method-card.js +1 -1
- package/dist/cdn/foxy-payments-api-fraud-protection-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-method-form.js +1 -1
- package/dist/cdn/foxy-payments-api-payment-preset-form.js +1 -1
- package/dist/cdn/foxy-store-form.js +1 -1
- package/dist/cdn/foxy-store-shipping-method-form.js +1 -1
- package/dist/cdn/foxy-subscription-form.js +1 -1
- package/dist/cdn/foxy-subscription-settings-form.js +1 -1
- package/dist/cdn/foxy-tax-form.js +1 -1
- package/dist/cdn/foxy-template-config-form.js +1 -1
- package/dist/cdn/foxy-template-form.js +1 -1
- package/dist/cdn/foxy-template-set-form.js +1 -1
- package/dist/cdn/foxy-transaction.js +1 -1
- package/dist/cdn/foxy-update-payment-method-form.js +1 -1
- package/dist/cdn/foxy-user-form.js +1 -1
- package/dist/cdn/foxy-user-invitation-form.js +1 -1
- package/dist/cdn/foxy-users-table.js +1 -1
- package/dist/cdn/foxy-webhook-form.js +1 -1
- package/dist/cdn/shared-00e02b35.js +1 -0
- package/dist/cdn/{shared-2508187b.js → shared-0c2879b9.js} +1 -1
- package/dist/cdn/shared-4a32f76a.js +1 -0
- package/dist/cdn/shared-5cd33249.js +1 -0
- package/dist/cdn/shared-aca2705d.js +1 -0
- package/dist/cdn/shared-e0da7113.js +1 -0
- package/dist/cdn/{shared-2ab1e9eb.js → shared-e21ddeae.js} +1 -1
- package/dist/cdn/translations/tax-form/en.json +8 -3
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js +10 -9
- package/dist/elements/internal/InternalFrequencyControl/InternalFrequencyControl.js.map +1 -1
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js +15 -23
- package/dist/elements/internal/InternalNumberControl/InternalNumberControl.js.map +1 -1
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js +10 -9
- package/dist/elements/internal/InternalResourcePickerControl/InternalResourcePickerControl.js.map +1 -1
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js +44 -40
- package/dist/elements/internal/InternalSelectControl/InternalSelectControl.js.map +1 -1
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js +8 -2
- package/dist/elements/internal/InternalSwitchControl/InternalSwitchControl.js.map +1 -1
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js +14 -13
- package/dist/elements/internal/InternalTextControl/InternalTextControl.js.map +1 -1
- package/dist/elements/public/TaxForm/TaxForm.d.ts +0 -4
- package/dist/elements/public/TaxForm/TaxForm.js +16 -30
- package/dist/elements/public/TaxForm/TaxForm.js.map +1 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js +1 -1
- package/dist/elements/public/TemplateConfigForm/TemplateConfigForm.js.map +1 -1
- package/package.json +1 -1
- package/dist/cdn/shared-27cfa174.js +0 -1
- package/dist/cdn/shared-2c81b7df.js +0 -1
- package/dist/cdn/shared-afe24913.js +0 -1
- package/dist/cdn/shared-c05643e6.js +0 -1
- package/dist/cdn/shared-eea8debb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-9e8ed3af.js";import"./shared-eef73355.js";import"./shared-0c134ce7.js";import"./shared-2ab1e9eb.js";import"./shared-4a4f6eb9.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-3a952968.js";import{a as t}from"./shared-11351c00.js";import{B as i}from"./shared-cb58dfcd.js";import{p as s}from"./shared-8eeddc22.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-3661a086.js";import{p as n}from"./shared-4d32d19e.js";import{I as a}from"./shared-f1a70f51.js";import"./shared-cc7e1dc6.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./shared-f989c70e.js";import"./shared-37348820.js";import"./shared-53e42a77.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-8b25a098.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const p=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends p{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let f,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(f||(f=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},p={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},f=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,p,f,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
|
|
1
|
+
import"./shared-9e8ed3af.js";import"./shared-eef73355.js";import"./shared-0c134ce7.js";import"./shared-e21ddeae.js";import"./shared-4a4f6eb9.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-3a952968.js";import{a as t}from"./shared-11351c00.js";import{B as i}from"./shared-cb58dfcd.js";import{p as s}from"./shared-8eeddc22.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-3661a086.js";import{p as n}from"./shared-4d32d19e.js";import{I as a}from"./shared-f1a70f51.js";import"./shared-cc7e1dc6.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./shared-f989c70e.js";import"./shared-37348820.js";import"./shared-53e42a77.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-c18f681b.js";import"./shared-2aa23b5f.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./foxy-swipe-actions.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-8b25a098.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";let r,l=e=>e;const d=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form",class extends d{constructor(){super(...arguments),this.__valuesInputParams={type:"number",step:"1",min:"1",max:"999"},this.__valuesGetValue=()=>{var e;return null===(e=this.form.values)||void 0===e?void 0:e.map((e=>{if(".5m"===e)return{value:e,label:this.t("values.twice_a_week")};const{units:t,count:i}=s(e);return{value:e,label:this.t(`values.${t}`,{count:i})}}))},this.__valuesSetValue=e=>{const t=e.filter((({value:e})=>parseFloat(e)<=999)).map((({unit:e,value:t})=>e?`${t}${e}`:t)).filter(((e,t,i)=>i.indexOf(e)===t));this.edit({values:t})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({values:e})=>!!e&&e.length>0||"values:v8n_required",({values:e})=>!e||e.length<=20||"values:v8n_too_long"]}get hiddenSelector(){return new i(`timestamps ${super.hiddenSelector}`.trim())}renderBody(){return o(r||(r=l` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-editable-list-control infer="values" .inputParams="${0}" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__valuesInputParams,this.__valuesGetValue,this.__valuesSetValue,[{label:this.t("values.unit_years"),value:"y"},{label:this.t("values.unit_months"),value:"m"},{label:this.t("values.unit_weeks"),value:"w"},{label:this.t("values.unit_days"),value:"d"}],super.renderBody())}});let u,c=e=>e;const p=t(a);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card",class extends p{renderBody(){var e;const{jsonataQuery:t,values:i}=null!==(e=this.data)&&void 0!==e?e:{},n=null==i?void 0:i.map((e=>{if(".5m"===e)return this.t("twice_a_week");const{units:t,count:i}=s(e);return this.t(t,{count:i})}));return o(u||(u=c` <section class="h-s flex flex-col justify-center leading-xs"> <p class="text-m font-medium min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> <p class="text-s text-secondary min-w-0"> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),"*"===t?"title_all":"title_matching",{query:t},(null==i?void 0:i.length)?"subtitle_list":"subtitle_empty",{list:null==n?void 0:n.join(", ")})}});let f,h=e=>e;const m=t(e);customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form",class extends m{constructor(){super(...arguments),this.__minmaxRestrictionsGetValue=()=>{const e=[],t=this.form;return t.min&&e.push("min"),t.max&&e.push("max"),e},this.__minmaxRestrictionsSetValue=e=>{const t=this.form;this.edit({min:e.includes("min")?t.min||"1m":null,max:e.includes("max")?t.max||"1y":null})},this.__minmaxRestrictionsOptions=[{label:"option_min",value:"min"},{label:"option_max",value:"max"}],this.__dayAndDateRestrictionsGetValue=()=>{var e;const t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.type;return"day"===t?"days":"month"===t?"dates":"none"},this.__dayAndDateRestrictionsSetValue=e=>{"dates"===e?this.edit({allowedDays:{type:"month",days:[]}}):"days"===e?this.edit({allowedDays:{type:"day",days:[]}}):this.edit({allowedDays:null})},this.__dayAndDateRestrictionsOptions=[{label:"option_none",value:"none"},{label:"option_dates",value:"dates"},{label:"option_days",value:"days"}],this.__daysOfWeekGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>String(e))))&&void 0!==t?t:[]},this.__daysOfWeekSetValue=e=>{this.edit({allowedDays:{type:"day",days:e.map(Number)}})},this.__daysOfWeekOptions=[{label:"option_1",value:"1"},{label:"option_2",value:"2"},{label:"option_3",value:"3"},{label:"option_4",value:"4"},{label:"option_5",value:"5"},{label:"option_6",value:"6"},{label:"option_7",value:"7"}],this.__datesOfMonthInputParams={type:"number",min:"1",max:"31",step:"1"},this.__datesOfMonthGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.allowedDays)||void 0===e?void 0:e.days.map((e=>({value:String(e)}))))&&void 0!==t?t:[]},this.__datesOfMonthSetValue=e=>{this.edit({allowedDays:{type:"month",days:e.map((e=>parseInt(e.value))).filter((e=>Number.isInteger(e)&&e>=1&&e<=31))}})},this.__disallowedDatesInputParams={type:"date"},this.__disallowedDatesGetValue=()=>{var e,t;return null!==(t=null===(e=this.form.disallowedDates)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==t?t:[]},this.__disallowedDatesSetValue=e=>{this.edit({disallowedDates:e.map((e=>e.value))})}}static get v8n(){return[({jsonataQuery:e})=>!!e||"jsonata-query:v8n_required",({jsonataQuery:e})=>!e||e.length<=200||"jsonata-query:v8n_too_long",({disallowedDates:e})=>!e||e.length<=10||"disallowed-dates:v8n_too_long"]}get hiddenSelector(){var e,t;const s=["timestamps",super.hiddenSelector.toString()],o=this.form;return o.min||s.unshift("min"),o.max||s.unshift("max"),"day"!==(null===(e=o.allowedDays)||void 0===e?void 0:e.type)&&s.unshift("days-of-week"),"month"!==(null===(t=o.allowedDays)||void 0===t?void 0:t.type)&&s.unshift("dates-of-month"),new i(s.join(" ").trim())}renderBody(){return o(f||(f=h` <foxy-internal-source-control infer="jsonata-query" property="jsonataQuery"> </foxy-internal-source-control> <foxy-internal-checkbox-group-control infer="minmax-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-frequency-control infer="min"></foxy-internal-frequency-control> <foxy-internal-frequency-control infer="max"></foxy-internal-frequency-control> <foxy-internal-radio-group-control infer="day-and-date-restrictions" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-radio-group-control> <foxy-internal-checkbox-group-control infer="days-of-week" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-editable-list-control infer="dates-of-month" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-editable-list-control infer="disallowed-dates" range="optional" .inputParams="${0}" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> ${0} `),this.__minmaxRestrictionsGetValue,this.__minmaxRestrictionsSetValue,this.__minmaxRestrictionsOptions,this.__dayAndDateRestrictionsGetValue,this.__dayAndDateRestrictionsSetValue,this.__dayAndDateRestrictionsOptions,this.__daysOfWeekGetValue,this.__daysOfWeekSetValue,this.__daysOfWeekOptions,this.__datesOfMonthInputParams,this.__datesOfMonthGetValue,this.__datesOfMonthSetValue,this.__disallowedDatesInputParams,this.__disallowedDatesGetValue,this.__disallowedDatesSetValue,super.renderBody())}});let y,_=e=>e;const v=t(a);function x(e){try{return new URL(e).origin===e.toLowerCase()}catch(e){return!1}}customElements.define("foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card",class extends v{renderBody(){var e;const{min:t,max:i,allowedDays:s,jsonataQuery:a,disallowedDates:r}=null!==(e=this.data)&&void 0!==e?e:{},l=t?n(t):void 0,d=i?n(i):void 0,u="*"===a?"line_1_all":"line_1_matching",c={query:a},p={from:l?this.t(`unit_${l.units}`,{count:l.count}):this.t("any"),to:d?this.t(`unit_${d.units}`,{count:d.count}):this.t("any")},f=`line_3_${s?s.type:"any"}`,h={list:"month"===(null==s?void 0:s.type)?null==s?void 0:s.days.join(", "):null==s?void 0:s.days.map((e=>this.t(`day_${e}`))).join(", ")},m=r?"line_4_some":"line_4_none",v={list:null==r?void 0:r.map((e=>{const[t,i]=e.split("..");return t&&i?this.t("date_range",{from:t,to:i}):this.t("single_date",{value:e})})).join(", ")};return o(y||(y=_` <section class="leading-xs" style="margin:-.25ch 0"> <p class="text-m font-medium truncate"> <foxy-i18n infer="" key="${0}" .options="${0}"></foxy-i18n> </p> <p class="text-s text-secondary"> <foxy-i18n infer="" class="block truncate" key="line_2" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> <foxy-i18n infer="" class="block truncate" key="${0}" .options="${0}"> </foxy-i18n> </p> </section> `),u,c,p,f,h,m,v)}});let g,b=e=>e;const j=t(e,"customer-portal-settings-form");class w extends j{constructor(){super(...arguments),this.__sessionLifespanInMinutesOptions=[{value:"m",label:"option_minute"},{value:"h",label:"option_hour"},{value:"d",label:"option_day"},{value:"w",label:"option_week"}],this.__sessionLifespanInMinutesGetValue=()=>{var e;const t=null!==(e=this.form.sessionLifespanInMinutes)&&void 0!==e?e:0;return t%10080==0?t/10080+"w":t%1440==0?t/1440+"d":t%60==0?t/60+"h":`${t}m`},this.__sessionLifespanInMinutesSetValue=e=>{const t=parseInt(e);e.endsWith("w")?this.edit({sessionLifespanInMinutes:10080*t}):e.endsWith("d")?this.edit({sessionLifespanInMinutes:1440*t}):e.endsWith("h")?this.edit({sessionLifespanInMinutes:60*t}):this.edit({sessionLifespanInMinutes:t})},this.__allowedOriginsGetValue=()=>{var e;return null===(e=this.form.allowedOrigins)||void 0===e?void 0:e.map((e=>({label:x(e)?e:`⚠️ ${e}`,value:e})))},this.__allowedOriginsSetValue=e=>{this.edit({allowedOrigins:e.map((({value:e})=>function(e){try{return new URL(e).origin}catch(t){return e}}(e))).filter(((e,t,i)=>i.indexOf(e)===t))})},this.__featuresOptions=[{value:"sso",label:"option_sso"},{value:"sign-up",label:"option_sign_up"},{value:"frequency-modification",label:"option_frequency_modification"},{value:"next-date-modification",label:"option_next_date_modification"}],this.__featuresGetValue=()=>{var e,t,i;const s=[];return this.form.sso&&s.push("sso"),(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)&&s.push("sign-up"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&s.push("next-date-modification"),(null===(i=this.form.subscriptions)||void 0===i?void 0:i.allowFrequencyModification.length)&&s.push("frequency-modification"),s},this.__featuresSetValue=e=>{var t,i,s,o,n;const a=null!==(i=null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification)&&void 0!==i?i:[];this.edit({sso:e.includes("sso"),signUp:{enabled:e.includes("sign-up"),verification:null!==(o=null===(s=this.form.signUp)||void 0===s?void 0:s.verification)&&void 0!==o?o:{type:"hcaptcha",siteKey:"",secretKey:""}},subscriptions:{allowFrequencyModification:e.includes("frequency-modification")?0===a.length?[{jsonataQuery:"*",values:[]}]:a:[],allowNextDateModification:!!e.includes("next-date-modification")&&((null===(n=this.form.subscriptions)||void 0===n?void 0:n.allowNextDateModification)||[])}})},this.__signUpVerificationHcaptchaSiteKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.siteKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSiteKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.secretKey)&&void 0!==o?o:"",siteKey:e,type:"hcaptcha"}}})},this.__signUpVerificationHcaptchaSecretKeyGetValue=()=>{var e,t,i;return null!==(i=null===(t=null===(e=this.form.signUp)||void 0===e?void 0:e.verification)||void 0===t?void 0:t.secretKey)&&void 0!==i?i:""},this.__signUpVerificationHcaptchaSecretKeySetValue=e=>{var t,i,s,o;this.edit({signUp:{enabled:!!(null===(t=this.form.signUp)||void 0===t?void 0:t.enabled),verification:{secretKey:e,siteKey:null!==(o=null===(s=null===(i=this.form.signUp)||void 0===i?void 0:i.verification)||void 0===s?void 0:s.siteKey)&&void 0!==o?o:"",type:"hcaptcha"}}})},this.__jwtSecretGeneratorOptions={charset:"abcdefghijklmnopqrstuvwxyz0123456789",length:64}}static get v8n(){return[({sessionLifespanInMinutes:e})=>"number"!=typeof e||e<=40320||"session-lifespan-in-minutes:v8n_too_long",({allowedOrigins:e=[]})=>e.length<=10||"allowed-origins:v8n_too_many",({allowedOrigins:e=[]})=>e.every(x)||"allowed-origins:v8n_invalid",({jwtSharedSecret:e})=>!e||/^[a-z0-9-]+$/.test(e)||"jwt-shared-secret:v8n_invalid",({jwtSharedSecret:e})=>!e||e.length>=40||"jwt-shared-secret:v8n_too_short",({jwtSharedSecret:e})=>!e||e.length<=100||"jwt-shared-secret:v8n_too_long",({signUp:e})=>{const t=null==e?void 0:e.verification.siteKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-site-key:v8n_too_long"},({signUp:e})=>{const t=null==e?void 0:e.verification.secretKey;return!t||t.length<=100||"sign-up-verification-hcaptcha-secret-key:v8n_too_long"}]}get hiddenSelector(){var e,t,s;const o=["header:copy-id",super.hiddenSelector.toString()];return(null===(e=this.form.signUp)||void 0===e?void 0:e.enabled)||o.push("sign-up-verification-hcaptcha-site-key","sign-up-verification-hcaptcha-secret-key"),(null===(t=this.form.subscriptions)||void 0===t?void 0:t.allowFrequencyModification.length)||o.push("subscriptions-allow-frequency-modification"),(null===(s=this.form.subscriptions)||void 0===s?void 0:s.allowNextDateModification)||o.push("subscriptions-allow-next-date-modification"),new i(o.join(" ").trim())}renderBody(){return o(g||(g=b` ${0} <foxy-internal-editable-list-control infer="allowed-origins" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-checkbox-group-control infer="features" theme="vertical" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-checkbox-group-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-site-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-password-control infer="sign-up-verification-hcaptcha-secret-key" .getValue="${0}" .setValue="${0}"> </foxy-internal-password-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowFrequencyModification" infer="subscriptions-allow-frequency-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-frequency-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-async-list-control first="foxy://${0}/form/subscriptions/allowNextDateModification" infer="subscriptions-allow-next-date-modification" limit="20" form="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-form" item="foxy-internal-customer-portal-settings-form-subscriptions-allow-next-date-modification-rule-card" alert> </foxy-internal-async-list-control> <foxy-internal-frequency-control infer="session-lifespan-in-minutes" max="" .getValue="${0}" .setValue="${0}" .options="${0}"> </foxy-internal-frequency-control> <foxy-internal-password-control property="jwtSharedSecret" infer="jwt-shared-secret" show-generator .generatorOptions="${0}"> </foxy-internal-password-control> ${0} `),this.renderHeader(),this.__allowedOriginsGetValue,this.__allowedOriginsSetValue,this.__featuresGetValue,this.__featuresSetValue,this.__featuresOptions,this.__signUpVerificationHcaptchaSiteKeyGetValue,this.__signUpVerificationHcaptchaSiteKeySetValue,this.__signUpVerificationHcaptchaSecretKeyGetValue,this.__signUpVerificationHcaptchaSecretKeySetValue,this.virtualHost,this.virtualHost,this.__sessionLifespanInMinutesGetValue,this.__sessionLifespanInMinutesSetValue,this.__sessionLifespanInMinutesOptions,this.__jwtSecretGeneratorOptions,super.renderBody())}async _sendPost(e){return this.__removeNullProperties(e),super._sendPost(e)}async _sendPatch(e){return this.__removeNullProperties(e),super._sendPatch(e)}__removeNullProperties(e){var t,i;"object"==typeof(null===(t=e.subscriptions)||void 0===t?void 0:t.allowNextDateModification)&&(null===(i=e.subscriptions)||void 0===i||i.allowNextDateModification.forEach((e=>{for(const t in e){const i=t;null===e[i]&&delete e[i]}})))}}customElements.define("foxy-customer-portal-settings-form",w);export{w as CustomerPortalSettingsForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./foxy-customer.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-4a4f6eb9.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-
|
|
1
|
+
import"./foxy-customer.js";import"./shared-8ef0ca65.js";import"./shared-c18f681b.js";import"./shared-37348820.js";import"./shared-4a4f6eb9.js";import"./shared-5212ef4f.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-access-recovery-form.js";import"./foxy-payment-method-card.js";import{TransactionsTable as t}from"./foxy-transactions-table.js";import"./foxy-subscription-card.js";import"./foxy-subscription-form.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import{u as s}from"./shared-0c2879b9.js";import"./foxy-sign-in-form.js";import"./foxy-form-dialog.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import{_ as r,B as o,aH as i}from"./shared-cb58dfcd.js";import{h as a,L as n,c as d}from"./shared-ba5c42c7.js";import{A as l}from"./shared-99a8889a.js";import"./shared-673d668a.js";import{C as c}from"./shared-d0363ae9.js";import{a as m,T as u}from"./shared-11351c00.js";import{U as p}from"./shared-cd96ff03.js";import{i as h}from"./shared-53e42a77.js";import{c as f}from"./shared-4e709717.js";import{A as g}from"./shared-5592ec6e.js";import{C as y}from"./shared-5afb584d.js";import{I as $}from"./shared-2aa23b5f.js";import"./shared-21e68b72.js";import"./foxy-update-payment-method-form.js";import"./shared-aca2705d.js";import"./shared-0c134ce7.js";import"./shared-f9ac8763.js";import"./shared-315d7620.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./foxy-nucleon-element.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-be442f26.js";import"./shared-8b0f00fa.js";import"./shared-c1e86ea4.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-5fd5805c.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./shared-9e8ed3af.js";import"./shared-5cd33249.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-4a32f76a.js";import"./shared-d0aed1c1.js";import"./foxy-table.js";import"./shared-e3421ca1.js";import"./shared-c46affa4.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";import"./shared-84eb85dd.js";import"./shared-230dee11.js";import"./shared-8eeddc22.js";import"./shared-ada5e9f5.js";import"./shared-cf613436.js";import"./shared-e0da7113.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-eb963ba3.js";import"./shared-a6b2bd14.js";import"./shared-8b25a098.js";import"./shared-b738ee96.js";import"./shared-f1033d78.js";
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-37348820.js";import"./shared-c18f681b.js";import{h as t}from"./shared-21e68b72.js";import"./shared-8ef0ca65.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-
|
|
1
|
+
import"./shared-37348820.js";import"./shared-c18f681b.js";import{h as t}from"./shared-21e68b72.js";import"./shared-8ef0ca65.js";import"./shared-5212ef4f.js";import"./foxy-payment-method-card.js";import"./foxy-update-payment-method-form.js";import"./foxy-subscription-form.js";import"./foxy-form-dialog.js";import"./foxy-transactions-table.js";import"./foxy-collection-pages.js";import"./foxy-collection-page.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import"./shared-0c2879b9.js";import"./foxy-address-card.js";import"./foxy-address-form.js";import"./foxy-spinner.js";import"./foxy-table.js";import"./shared-4d32d19e.js";import{aH as e,_ as s}from"./shared-cb58dfcd.js";import{L as r,h as a,c as o}from"./shared-ba5c42c7.js";import{C as i}from"./shared-5afb584d.js";import"./shared-f9ac8763.js";import"./shared-360d6a20.js";import{z as h,S as d,T as n,a as l}from"./shared-11351c00.js";import{c as m}from"./shared-4e709717.js";import{S as c}from"./shared-c46affa4.js";import"./shared-048d5cae.js";import{G as v}from"./shared-84eb85dd.js";import"./shared-be442f26.js";import"./shared-c1e86ea4.js";import"./shared-7dc9c80b.js";import"./shared-f989c70e.js";import"./shared-bd5285ff.js";import"./shared-8b0f00fa.js";import{N as p}from"./shared-f83207fb.js";import{S as f}from"./shared-230dee11.js";import{i as g}from"./shared-53e42a77.js";import"./shared-315d7620.js";import"./shared-e5546d55.js";import"./shared-cf613436.js";import"./foxy-nucleon-element.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-2aa23b5f.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-aca2705d.js";import"./shared-0c134ce7.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-c25538f1.js";import"./shared-80a1bf6f.js";import"./shared-5b4e2567.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-bab2ea2c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-53e476fd.js";import"./foxy-template-set-card.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./foxy-payment-card-embed.js";import"./shared-99a8889a.js";import"./shared-673d668a.js";import"./shared-5fd5805c.js";import"./shared-243456aa.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-e0da7113.js";import"./shared-b65d169b.js";import"./shared-f69aacbc.js";import"./shared-43e2c3f6.js";import"./shared-79d0699c.js";import"./foxy-transaction-card.js";import"./shared-3661a086.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";import"./shared-ada5e9f5.js";import"./shared-e3421ca1.js";import"./shared-cc7e1dc6.js";import"./shared-3a952968.js";import"./shared-a6b2bd14.js";import"./shared-4a4f6eb9.js";import"./shared-8b25a098.js";import"./shared-4a32f76a.js";import"./shared-d0aed1c1.js";import"./shared-b738ee96.js";import"./shared-9e8ed3af.js";import"./shared-5cd33249.js";import"./shared-83c5e004.js";import"./shared-495860b4.js";import"./shared-6683daed.js";import"./shared-a03facdf.js";import"./shared-a587fd4b.js";let z,u,b,$=t=>t;class H extends r{constructor(){super(...arguments),this.value=0,this.size=0}static get properties(){return{value:{type:Number},size:{type:Number}}}static get styles(){return h.styles}render(){const t=[],e=[];for(let s=0;s<this.size;++s)t.push(a(z||(z=$` <button id="tab-${0}" role="tab" class="${0}" aria-controls="panel-${0}" aria-selected="${0}" @click="${0}" @keydown="${0}"> <slot name="tab-${0}"></slot> </button> `),s,m({"text-l font-medium px-s rounded focus-outline-none focus-shadow-outline":!0,"text-tertiary hover-text-body focus-text-body":this.value!==s}),s,this.value===s,(()=>this.value=s),this.__handleKeyDown,s)),e.push(a(u||(u=$` <slot id="panel-${0}" role="tabpanel" name="panel-${0}" class="${0}" aria-hidden="${0}" aria-labelledby="tab-${0}"> </slot> `),s,s,m({hidden:this.value!==s}),this.value!==s,s));return a(b||(b=$` <div role="tablist" aria-orientation="horizontal" class="-mx-s mb-s">${0}</div> ${0} `),t,e)}__handleKeyDown(t){if(t.key.startsWith("Arrow")){t.preventDefault();const e=t.target;let s=null;"ArrowRight"===t.key||"ArrowDown"===t.key?s=e.nextElementSibling:"ArrowLeft"!==t.key&&"ArrowUp"!==t.key||(s=e.previousElementSibling),null==s||s.click(),null==s||s.focus()}}}
|
|
2
2
|
/**
|
|
3
3
|
@license
|
|
4
4
|
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as e,a as t,I as r}from"./shared-5b4e2567.js";import"./shared-8b0f00fa.js";import"./shared-f9ac8763.js";import"./shared-be442f26.js";import"./shared-8ef0ca65.js";import{h as a,P as o,B as i}from"./shared-21e68b72.js";import{E as s,T as l}from"./shared-315d7620.js";import"./shared-37348820.js";import"./shared-4d32d19e.js";import{x as n,a as d}from"./shared-11351c00.js";import{c as A,h as u}from"./shared-ba5c42c7.js";import{i as p}from"./shared-53e42a77.js";import{c}from"./shared-4e709717.js";import"./shared-243456aa.js";import{_ as m,B as h}from"./shared-cb58dfcd.js";import{A as g}from"./shared-5592ec6e.js";import"./shared-
|
|
1
|
+
import{b as e,a as t,I as r}from"./shared-5b4e2567.js";import"./shared-8b0f00fa.js";import"./shared-f9ac8763.js";import"./shared-be442f26.js";import"./shared-8ef0ca65.js";import{h as a,P as o,B as i}from"./shared-21e68b72.js";import{E as s,T as l}from"./shared-315d7620.js";import"./shared-37348820.js";import"./shared-4d32d19e.js";import{x as n,a as d}from"./shared-11351c00.js";import{c as A,h as u}from"./shared-ba5c42c7.js";import{i as p}from"./shared-53e42a77.js";import{c}from"./shared-4e709717.js";import"./shared-243456aa.js";import{_ as m,B as h}from"./shared-cb58dfcd.js";import{A as g}from"./shared-5592ec6e.js";import"./shared-e0da7113.js";import"./shared-4a32f76a.js";import"./foxy-nucleon-element.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-b65d169b.js";import"./shared-d0aed1c1.js";const f=a`<dom-module id="lumo-progress-bar" theme-for="vaadin-progress-bar">
|
|
2
2
|
<template>
|
|
3
3
|
<style>
|
|
4
4
|
:host {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-80a1bf6f.js";import"./shared-3a952968.js";import"./shared-
|
|
1
|
+
import"./shared-80a1bf6f.js";import"./shared-3a952968.js";import"./shared-5cd33249.js";import"./shared-00e02b35.js";import"./shared-4a32f76a.js";import{b as t,I as e}from"./shared-5b4e2567.js";import"./shared-8ef0ca65.js";import"./shared-4d32d19e.js";import{_ as r,B as s}from"./shared-cb58dfcd.js";import{N as a}from"./shared-f83207fb.js";import{h as o}from"./shared-ba5c42c7.js";import{a as n}from"./shared-11351c00.js";import{i}from"./shared-53e42a77.js";import"./shared-5fd5805c.js";import"./shared-243456aa.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-37348820.js";import"./shared-c25538f1.js";import"./shared-315d7620.js";import"./shared-c1e86ea4.js";import"./shared-8b0f00fa.js";import"./shared-651c44fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-4e709717.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-d0aed1c1.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";let l,c=t=>t;customElements.define("foxy-internal-email-template-form-async-action",class extends t{constructor(){super(...arguments),this.theme=null,this.href=null,this.__state="idle"}static get properties(){return r(r({},super.properties),{},{__state:{type:String},theme:{type:String},href:{type:String}})}renderControl(){const t=this.__state,e="fail"===t?"error":"";return o(l||(l=c` <vaadin-button theme="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n key="${0}" infer=""></foxy-i18n> </vaadin-button> `),`${this.theme} ${null!=e?e:""}`.trim(),"busy"===t||this.disabled,this.__submit,t)}async __submit(){var t,e;if("busy"!==this.__state)try{this.__state="busy";const r=new a.API(this),s=await r.fetch(null!==(t=this.href)&&void 0!==t?t:"",{method:"POST"});this.__state=s.ok?"idle":"fail",s.ok&&(null===(e=this.nucleon)||void 0===e||e.refresh())}catch(t){this.__state="fail"}}});let h,m=t=>t;const d=n(e,"email-template-form");class f extends d{constructor(){super(...arguments),this.defaultSubject=null,this.__templateLanguageOptions=[{rawLabel:"Nunjucks",value:"nunjucks"},{rawLabel:"Handlebars",value:"handlebars"},{rawLabel:"Pug",value:"pug"},{rawLabel:"Twig",value:"twig"},{rawLabel:"EJS",value:"ejs"}],this.__toggleGetValue=()=>!!this.form.subject,this.__toggleSetValue=t=>{var e;t?this.edit({subject:null!==(e=this.defaultSubject)&&void 0!==e?e:this.t("general.subject.default_value")}):this.edit({subject:""})}}static get properties(){return r(r({},super.properties),{},{defaultSubject:{attribute:"default-subject"}})}get readonlySelector(){const t=[super.readonlySelector.toString()],e=this.form.subject;return this.form.content_html_url&&e&&t.unshift("content-html"),this.form.content_text_url&&e&&t.unshift("content-text"),new s(t.join(" ").trim())}get disabledSelector(){const t=[super.disabledSelector.toString()];return this.in({idle:{snapshot:"clean"}})&&this.data.content_html_url&&this.data.content_text_url||t.unshift("html-source:cache","text-source:cache"),this.form.subject||t.unshift("general:template-language","html-source","text-source","content-html","content-text"),new s(t.join(" ").trim())}get hiddenSelector(){var t,e,r;const a=[super.hiddenSelector.toString()];return(null===(t=this.data)||void 0===t?void 0:t.content_html_url)||a.unshift("html-source:cache"),(null===(e=this.data)||void 0===e?void 0:e.content_text_url)||a.unshift("text-source:cache"),(null===(r=this.data)||void 0===r?void 0:r.subject)||this.form.subject||a.unshift("general:template-language","general:subject","html-source","text-source","content-html","content-text"),new s(a.join(" ").trim())}renderBody(){var t,e;return o(h||(h=m` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="description"> </foxy-internal-text-control> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="subject"> </foxy-internal-text-control> <foxy-internal-select-control layout="summary-item" infer="template-language" .options="${0}"> </foxy-internal-select-control> </foxy-internal-summary-control> ${0} <foxy-internal-source-control infer="content-html"></foxy-internal-source-control> <foxy-internal-summary-control infer="html-source"> <foxy-internal-text-control layout="summary-item" infer="content-html-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> <foxy-internal-source-control infer="content-text"></foxy-internal-source-control> <foxy-internal-summary-control infer="text-source"> <foxy-internal-text-control layout="summary-item" infer="content-text-url"> </foxy-internal-text-control> <foxy-internal-email-template-form-async-action theme="tertiary-inline" infer="cache" href="${0}"> </foxy-internal-email-template-form-async-action> </foxy-internal-summary-control> ${0} `),this.renderHeader(),this.__toggleGetValue,this.__toggleSetValue,this.__templateLanguageOptions,this.renderTemplateOrSlot(),i(null===(t=this.data)||void 0===t?void 0:t._links["fx:cache"].href),i(null===(e=this.data)||void 0===e?void 0:e._links["fx:cache"].href),super.renderBody())}async _sendPost(t){const e=await super._sendPost(t);if(t.content_html_url&&t.content_text_url){const t=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(t,{method:"POST"})).ok)throw["error:failed_to_cache"]}return await this._fetch(e._links.self.href)}async _sendPatch(t){const e=await super._sendPatch(t);if(!t.content_html_url&&!t.content_text_url)return e;const r=e._links["fx:cache"].href;if(!(await new f.API(this).fetch(r,{method:"POST"})).ok)throw["error:failed_to_cache"];return await this._fetch(e._links.self.href)}}customElements.define("foxy-email-template-form",f);export{f as EmailTemplateForm};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./shared-8ef0ca65.js";import"./shared-27cfa174.js";import"./shared-eef73355.js";import"./shared-80a1bf6f.js";import"./shared-2c81b7df.js";import"./shared-eea8debb.js";import"./shared-afe24913.js";import{I as e,b as t}from"./shared-5b4e2567.js";import"./foxy-template-set-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import"./shared-2ab1e9eb.js";import"./shared-0c134ce7.js";import"./shared-c05643e6.js";import"./shared-e4119ddc.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-3661a086.js";import{I as n}from"./shared-f1a70f51.js";import{h as r,d as i,N as o,i as a,s}from"./shared-ba5c42c7.js";import{_ as l,B as u}from"./shared-cb58dfcd.js";import{a as d,R as c,w as m}from"./shared-11351c00.js";import{i as f}from"./shared-53e42a77.js";import{e as h,d as g}from"./shared-eb963ba3.js";import{c as p}from"./shared-4e709717.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-cd96ff03.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./shared-f83207fb.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-8b0f00fa.js";import"./shared-651c44fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-5212ef4f.js";import"./shared-0df46275.js";import"./shared-c18f681b.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-6957b8e6.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-63c32024.js";let y,_=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-card",class extends n{renderBody(){var e,t;return r(y||(y=_` <div class="flex justify-between items-center h-xs"> <span class="font-medium">${0}​</span> <span class="text-secondary">${0}​</span> </div> `),null===(e=this.data)||void 0===e?void 0:e.name,null===(t=this.data)||void 0===t?void 0:t.value)}});let b,x=e=>e;const v=d(e,"internal-experimental-add-to-cart-builder-custom-option-form");customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-form",class extends v{constructor(){super(...arguments),this.defaultWeightUnit=null,this.existingOptions=[],this.itemCategories=null,this.currencyCode=null}static get properties(){return l(l({},super.properties),{},{defaultWeightUnit:{attribute:"default-weight-unit"},existingOptions:{type:Array,attribute:"existing-options"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"}})}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.unshift("basics-group"),new u(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return!this.href&&this.existingOptions.some((e=>e.name===this.form.name))&&e.unshift("basics-group:value-configurable"),new u(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.value_configurable&&e.unshift("price-group","weight-group","code-group","category-group"),new u(e.join(" ").trim())}renderBody(){var e,t,n,i;return r(b||(b=x` <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-text-control property="value" layout="summary-item" infer="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="value-configurable"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="price"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-price"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="weight-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="weight"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-weight"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-switch-control infer="replace-code"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-group"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> `),this.form.value_configurable?"default-value":"value",f(null!==(e=this.currencyCode)&&void 0!==e?e:void 0),f(null!==(t=this.__resolvedDefaultWeightUnit)&&void 0!==t?t:void 0),f(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),f(null!==(i=this.form.item_category_uri)&&void 0!==i?i:void 0),(()=>this.requestUpdate()))}async _sendPost(e){const t=this.existingOptions.filter((t=>t.name===e.name));if(t.some((e=>e.value_configurable)))throw["error:option_exists_configurable"];if(t.some((t=>t.value===e.value)))throw["error:option_exists"];return super._sendPost(e)}get __resolvedDefaultWeightUnit(){var e,t;const n=this.renderRoot.querySelector("#itemCategoryLoader");return null!==(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.default_weight_unit)&&void 0!==t?t:this.defaultWeightUnit}});let $,w,E,S,j,k,C,N,L,M,R,O,P,T,A,I,q=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-item-control",class extends t{constructor(){super(...arguments),this.defaultItemCategory=null,this.itemCategories=null,this.currencyCode=null,this.index=0}static get properties(){return l(l({},super.properties),{},{defaultItemCategory:{type:Object,attribute:"default-item-category"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"},index:{type:Number}})}renderControl(){var e,t,n,i,o,a,s,l,u;const d=this.__resolvedItemCategory,c=null==d?void 0:d.item_delivery_type,m=this.nucleon,h=this.index,g=null===(e=null==m?void 0:m.form.items)||void 0===e?void 0:e[h];return r($||($=q` <div class="space-y-m"> <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control property="items.${0}.name" layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-resource-picker-control property="items.${0}.item_category_uri" layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control property="items.${0}.price" layout="summary-item" suffix="${0}" infer="${0}"> </foxy-internal-number-control> <foxy-internal-switch-control property="items.${0}.price_configurable" layout="summary-item" infer="price-configurable"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control property="items.${0}.code" layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-text-control property="items.${0}.parent_code" layout="summary-item" infer="parent-code"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-internal-summary-control infer="subscriptions-group"> <foxy-internal-switch-control property="items.${0}.sub_enabled" layout="summary-item" infer="sub-enabled"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="quantity-group" layout="details"> <foxy-internal-number-control property="items.${0}.quantity" layout="summary-item" infer="quantity" step="1" min="1"> </foxy-internal-number-control> ${0} <foxy-internal-switch-control property="items.${0}.hide_quantity" infer="hide-quantity"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="advanced-group" layout="details"> <foxy-internal-text-control property="items.${0}.discount_name" layout="summary-item" infer="discount-name"> </foxy-internal-text-control> ${0} <foxy-internal-text-control property="items.${0}.image" layout="summary-item" infer="image"> </foxy-internal-text-control> ${0} <foxy-internal-select-control property="items.${0}.expires_format" layout="summary-item" infer="expires-format" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-async-list-control layout="details" first="foxy://${0}/form/items/${0}/custom_options" infer="custom-options" form="foxy-internal-experimental-add-to-cart-builder-custom-option-form" item="foxy-internal-experimental-add-to-cart-builder-custom-option-card" alert .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> </div> `),h,h,f(null!==(t=this.itemCategories)&&void 0!==t?t:void 0),h,f(null!==(n=this.currencyCode)&&void 0!==n?n:void 0),(null==g?void 0:g.price_configurable)?"price-default":"price",h,h,h,"notshipped"===c||"downloaded"===c?"":r(w||(w=q` <foxy-internal-summary-control infer="appearance-group"> <foxy-internal-number-control placeholder="${0}" property="items.${0}.weight" layout="summary-item" suffix="${0}" infer="weight" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> `),f(null==d?void 0:d.default_weight),h,f(null==d?void 0:d.default_weight_unit)),h,(null==g?void 0:g.sub_enabled)?r(E||(E=q` <foxy-internal-frequency-control property="items.${0}.sub_frequency" layout="summary-item" infer="sub-frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-select-control property="items.${0}.sub_startdate_format" layout="summary-item" infer="sub-startdate-format" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control property="items.${0}.sub_enddate_format" layout="summary-item" infer="sub-enddate-format" .options="${0}"> </foxy-internal-select-control> ${0} `),h,h,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_dd",value:"dd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===g.sub_startdate_format?r(S||(S=q` <foxy-internal-date-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-yyyymmdd"> </foxy-internal-date-control> `),h):"duration"===g.sub_startdate_format?r(j||(j=q` <foxy-internal-frequency-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-duration"> </foxy-internal-frequency-control> `),h):"dd"===g.sub_startdate_format?r(k||(k=q` <foxy-internal-number-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-dd" step="1" min="1" max="31"> </foxy-internal-number-control> `),h):"",h,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===g.sub_enddate_format?r(C||(C=q` <foxy-internal-date-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-yyyymmdd"> </foxy-internal-date-control> `),h):"duration"===g.sub_enddate_format?r(N||(N=q` <foxy-internal-frequency-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-duration"> </foxy-internal-frequency-control> `),h):""):"",h,"minutes"===(null==g?void 0:g.expires_format)?"":r(L||(L=q` <foxy-internal-number-control property="items.${0}.quantity_min" layout="summary-item" infer="quantity-min" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.quantity_max" layout="summary-item" infer="quantity-max" step="1" min="1"> </foxy-internal-number-control> `),h,h),h,h,(null==g?void 0:g.discount_name)?r(M||(M=q` <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),{details:null!==(i=null==g?void 0:g.discount_details)&&void 0!==i?i:"",type:null!==(o=null==g?void 0:g.discount_type)&&void 0!==o?o:"amount_percentage",name:null!==(a=null==g?void 0:g.discount_name)&&void 0!==a?a:""},(e=>{this.__handleDiscountBuilderChange(e,g,h)})):"",h,(null==g?void 0:g.image)?r(R||(R=q` <foxy-internal-text-control property="items.${0}.url" layout="summary-item" infer="url"> </foxy-internal-text-control> `),h):"",h,[{label:"option_none",value:"none"},{label:"option_minutes",value:"minutes"},{label:"option_timestamp",value:"timestamp"}],"minutes"===(null==g?void 0:g.expires_format)?r(O||(O=q` <foxy-internal-number-control property="items.${0}.expires_value" layout="summary-item" suffix="min" infer="expires-value-minutes"> </foxy-internal-number-control> `),h):"timestamp"===(null==g?void 0:g.expires_format)?r(P||(P=q` <foxy-internal-date-control property="items.${0}.expires_value" layout="summary-item" format="unix" infer="expires-value-timestamp"> </foxy-internal-date-control> `),h):"","notshipped"===c||"downloaded"===c?"":r(T||(T=q` <foxy-internal-number-control property="items.${0}.length" layout="summary-item" suffix="${0}" infer="length" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.width" layout="summary-item" suffix="${0}" infer="width" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.height" layout="summary-item" suffix="${0}" infer="height" min="0"> </foxy-internal-number-control> `),h,f(null==d?void 0:d.default_length_unit),h,f(null==d?void 0:d.default_length_unit),h,f(null==d?void 0:d.default_length_unit)),null==m?void 0:m.virtualHost,h,{".defaultWeightUnit":null==d?void 0:d.default_weight_unit,".existingOptions":null!==(s=null==g?void 0:g.custom_options)&&void 0!==s?s:[],".itemCategories":this.itemCategories,".currencyCode":this.currencyCode},(null!==(u=null===(l=null==m?void 0:m.form.items)||void 0===l?void 0:l.length)&&void 0!==u?u:0)<=1?r(A||(A=q``)):r(I||(I=q` <vaadin-button theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="delete" key="caption"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>this.dispatchEvent(new CustomEvent("remove")))),f(null==g?void 0:g.item_category_uri),(()=>this.requestUpdate()))}get __resolvedItemCategory(){var e,t;return null!==(t=null===(e=this.__itemCategoryLoader)||void 0===e?void 0:e.data)&&void 0!==t?t:this.defaultItemCategory}get __itemCategoryLoader(){return this.renderRoot.querySelector("#itemCategoryLoader")}__handleDiscountBuilderChange(e,t,n){var r;const i=e.currentTarget,o=this.nucleon;t.discount_details=i.parsedValue.details,t.discount_type=i.parsedValue.type,t.discount_name=i.parsedValue.name;const a=null!==(r=null==o?void 0:o.form.items)&&void 0!==r?r:[];a.splice(n,1,t),null==o||o.edit({items:[...a]})}});const D=new WeakMap,H=i((e=>t=>{if(!(t instanceof o))throw new Error("unsafeHTML can only be used in text bindings");const n=D.get(t);if(void 0!==n&&a(e)&&e===n.value&&t.value===n.fragment)return;const r=document.createElement("template");r.innerHTML=e;const i=document.importNode(r.content,!0);t.setValue(i),D.set(t,{value:e,fragment:i})}));
|
|
1
|
+
import"./shared-8ef0ca65.js";import"./shared-aca2705d.js";import"./shared-eef73355.js";import"./shared-80a1bf6f.js";import"./shared-00e02b35.js";import"./shared-5cd33249.js";import"./shared-4a32f76a.js";import{I as e,b as t}from"./shared-5b4e2567.js";import"./foxy-template-set-card.js";import"./foxy-copy-to-clipboard.js";import"./foxy-nucleon-element.js";import"./foxy-spinner.js";import"./shared-4d32d19e.js";import"./shared-e21ddeae.js";import"./shared-0c134ce7.js";import"./shared-e0da7113.js";import"./shared-e4119ddc.js";import"./foxy-item-category-card.js";import"./foxy-discount-builder.js";import"./shared-3661a086.js";import{I as n}from"./shared-f1a70f51.js";import{h as r,d as i,N as o,i as a,s}from"./shared-ba5c42c7.js";import{_ as l,B as u}from"./shared-cb58dfcd.js";import{a as d,R as c,w as m}from"./shared-11351c00.js";import{i as f}from"./shared-53e42a77.js";import{e as h,d as g}from"./shared-eb963ba3.js";import{c as p}from"./shared-4e709717.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-cd96ff03.js";import"./shared-53e476fd.js";import"./shared-bab2ea2c.js";import"./shared-f83207fb.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-243456aa.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./shared-c1e86ea4.js";import"./shared-8b0f00fa.js";import"./shared-651c44fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-5212ef4f.js";import"./shared-0df46275.js";import"./shared-c18f681b.js";import"./shared-b65d169b.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-6957b8e6.js";import"./foxy-collection-page.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-63c32024.js";let y,_=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-card",class extends n{renderBody(){var e,t;return r(y||(y=_` <div class="flex justify-between items-center h-xs"> <span class="font-medium">${0}​</span> <span class="text-secondary">${0}​</span> </div> `),null===(e=this.data)||void 0===e?void 0:e.name,null===(t=this.data)||void 0===t?void 0:t.value)}});let b,x=e=>e;const v=d(e,"internal-experimental-add-to-cart-builder-custom-option-form");customElements.define("foxy-internal-experimental-add-to-cart-builder-custom-option-form",class extends v{constructor(){super(...arguments),this.defaultWeightUnit=null,this.existingOptions=[],this.itemCategories=null,this.currencyCode=null}static get properties(){return l(l({},super.properties),{},{defaultWeightUnit:{attribute:"default-weight-unit"},existingOptions:{type:Array,attribute:"existing-options"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"}})}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.unshift("basics-group"),new u(e.join(" ").trim())}get disabledSelector(){const e=[super.disabledSelector.toString()];return!this.href&&this.existingOptions.some((e=>e.name===this.form.name))&&e.unshift("basics-group:value-configurable"),new u(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.form.value_configurable&&e.unshift("price-group","weight-group","code-group","category-group"),new u(e.join(" ").trim())}renderBody(){var e,t,n,i;return r(b||(b=x` <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control layout="summary-item" infer="name"></foxy-internal-text-control> <foxy-internal-text-control property="value" layout="summary-item" infer="${0}"> </foxy-internal-text-control> <foxy-internal-switch-control infer="value-configurable"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="price"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-price"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="weight-group"> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="weight"> </foxy-internal-number-control> <foxy-internal-switch-control infer="replace-weight"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-switch-control infer="replace-code"></foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="category-group"> <foxy-internal-resource-picker-control layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> `),this.form.value_configurable?"default-value":"value",f(null!==(e=this.currencyCode)&&void 0!==e?e:void 0),f(null!==(t=this.__resolvedDefaultWeightUnit)&&void 0!==t?t:void 0),f(null!==(n=this.itemCategories)&&void 0!==n?n:void 0),f(null!==(i=this.form.item_category_uri)&&void 0!==i?i:void 0),(()=>this.requestUpdate()))}async _sendPost(e){const t=this.existingOptions.filter((t=>t.name===e.name));if(t.some((e=>e.value_configurable)))throw["error:option_exists_configurable"];if(t.some((t=>t.value===e.value)))throw["error:option_exists"];return super._sendPost(e)}get __resolvedDefaultWeightUnit(){var e,t;const n=this.renderRoot.querySelector("#itemCategoryLoader");return null!==(t=null===(e=null==n?void 0:n.data)||void 0===e?void 0:e.default_weight_unit)&&void 0!==t?t:this.defaultWeightUnit}});let $,w,E,S,j,k,C,N,L,M,R,O,P,T,A,I,q=e=>e;customElements.define("foxy-internal-experimental-add-to-cart-builder-item-control",class extends t{constructor(){super(...arguments),this.defaultItemCategory=null,this.itemCategories=null,this.currencyCode=null,this.index=0}static get properties(){return l(l({},super.properties),{},{defaultItemCategory:{type:Object,attribute:"default-item-category"},itemCategories:{attribute:"item-categories"},currencyCode:{attribute:"currency-code"},index:{type:Number}})}renderControl(){var e,t,n,i,o,a,s,l,u;const d=this.__resolvedItemCategory,c=null==d?void 0:d.item_delivery_type,m=this.nucleon,h=this.index,g=null===(e=null==m?void 0:m.form.items)||void 0===e?void 0:e[h];return r($||($=q` <div class="space-y-m"> <foxy-internal-summary-control infer="basics-group"> <foxy-internal-text-control property="items.${0}.name" layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-resource-picker-control property="items.${0}.item_category_uri" layout="summary-item" first="${0}" infer="item-category-uri" item="foxy-item-category-card"> </foxy-internal-resource-picker-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="price-group"> <foxy-internal-number-control property="items.${0}.price" layout="summary-item" suffix="${0}" infer="${0}"> </foxy-internal-number-control> <foxy-internal-switch-control property="items.${0}.price_configurable" layout="summary-item" infer="price-configurable"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="code-group"> <foxy-internal-text-control property="items.${0}.code" layout="summary-item" infer="code"> </foxy-internal-text-control> <foxy-internal-text-control property="items.${0}.parent_code" layout="summary-item" infer="parent-code"> </foxy-internal-text-control> </foxy-internal-summary-control> ${0} <foxy-internal-summary-control infer="subscriptions-group"> <foxy-internal-switch-control property="items.${0}.sub_enabled" layout="summary-item" infer="sub-enabled"> </foxy-internal-switch-control> ${0} </foxy-internal-summary-control> <foxy-internal-summary-control infer="quantity-group" layout="details"> <foxy-internal-number-control property="items.${0}.quantity" layout="summary-item" infer="quantity" step="1" min="1"> </foxy-internal-number-control> ${0} <foxy-internal-switch-control property="items.${0}.hide_quantity" infer="hide-quantity"> </foxy-internal-switch-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="advanced-group" layout="details"> <foxy-internal-text-control property="items.${0}.discount_name" layout="summary-item" infer="discount-name"> </foxy-internal-text-control> ${0} <foxy-internal-text-control property="items.${0}.image" layout="summary-item" infer="image"> </foxy-internal-text-control> ${0} <foxy-internal-select-control property="items.${0}.expires_format" layout="summary-item" infer="expires-format" .options="${0}"> </foxy-internal-select-control> ${0} ${0} </foxy-internal-summary-control> <foxy-internal-async-list-control layout="details" first="foxy://${0}/form/items/${0}/custom_options" infer="custom-options" form="foxy-internal-experimental-add-to-cart-builder-custom-option-form" item="foxy-internal-experimental-add-to-cart-builder-custom-option-card" alert .formProps="${0}"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="itemCategoryLoader" @update="${0}"> </foxy-nucleon> </div> `),h,h,f(null!==(t=this.itemCategories)&&void 0!==t?t:void 0),h,f(null!==(n=this.currencyCode)&&void 0!==n?n:void 0),(null==g?void 0:g.price_configurable)?"price-default":"price",h,h,h,"notshipped"===c||"downloaded"===c?"":r(w||(w=q` <foxy-internal-summary-control infer="appearance-group"> <foxy-internal-number-control placeholder="${0}" property="items.${0}.weight" layout="summary-item" suffix="${0}" infer="weight" min="0"> </foxy-internal-number-control> </foxy-internal-summary-control> `),f(null==d?void 0:d.default_weight),h,f(null==d?void 0:d.default_weight_unit)),h,(null==g?void 0:g.sub_enabled)?r(E||(E=q` <foxy-internal-frequency-control property="items.${0}.sub_frequency" layout="summary-item" infer="sub-frequency" allow-twice-a-month> </foxy-internal-frequency-control> <foxy-internal-select-control property="items.${0}.sub_startdate_format" layout="summary-item" infer="sub-startdate-format" .options="${0}"> </foxy-internal-select-control> ${0} <foxy-internal-select-control property="items.${0}.sub_enddate_format" layout="summary-item" infer="sub-enddate-format" .options="${0}"> </foxy-internal-select-control> ${0} `),h,h,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_dd",value:"dd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===g.sub_startdate_format?r(S||(S=q` <foxy-internal-date-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-yyyymmdd"> </foxy-internal-date-control> `),h):"duration"===g.sub_startdate_format?r(j||(j=q` <foxy-internal-frequency-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-duration"> </foxy-internal-frequency-control> `),h):"dd"===g.sub_startdate_format?r(k||(k=q` <foxy-internal-number-control property="items.${0}.sub_startdate" layout="summary-item" infer="sub-startdate-dd" step="1" min="1" max="31"> </foxy-internal-number-control> `),h):"",h,[{label:"option_none",value:"none"},{label:"option_yyyymmdd",value:"yyyymmdd"},{label:"option_duration",value:"duration"}],"yyyymmdd"===g.sub_enddate_format?r(C||(C=q` <foxy-internal-date-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-yyyymmdd"> </foxy-internal-date-control> `),h):"duration"===g.sub_enddate_format?r(N||(N=q` <foxy-internal-frequency-control property="items.${0}.sub_enddate" layout="summary-item" infer="sub-enddate-duration"> </foxy-internal-frequency-control> `),h):""):"",h,"minutes"===(null==g?void 0:g.expires_format)?"":r(L||(L=q` <foxy-internal-number-control property="items.${0}.quantity_min" layout="summary-item" infer="quantity-min" step="1" min="1"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.quantity_max" layout="summary-item" infer="quantity-max" step="1" min="1"> </foxy-internal-number-control> `),h,h),h,h,(null==g?void 0:g.discount_name)?r(M||(M=q` <foxy-discount-builder infer="discount-builder" .parsedValue="${0}" @change="${0}"> </foxy-discount-builder> `),{details:null!==(i=null==g?void 0:g.discount_details)&&void 0!==i?i:"",type:null!==(o=null==g?void 0:g.discount_type)&&void 0!==o?o:"amount_percentage",name:null!==(a=null==g?void 0:g.discount_name)&&void 0!==a?a:""},(e=>{this.__handleDiscountBuilderChange(e,g,h)})):"",h,(null==g?void 0:g.image)?r(R||(R=q` <foxy-internal-text-control property="items.${0}.url" layout="summary-item" infer="url"> </foxy-internal-text-control> `),h):"",h,[{label:"option_none",value:"none"},{label:"option_minutes",value:"minutes"},{label:"option_timestamp",value:"timestamp"}],"minutes"===(null==g?void 0:g.expires_format)?r(O||(O=q` <foxy-internal-number-control property="items.${0}.expires_value" layout="summary-item" suffix="min" infer="expires-value-minutes"> </foxy-internal-number-control> `),h):"timestamp"===(null==g?void 0:g.expires_format)?r(P||(P=q` <foxy-internal-date-control property="items.${0}.expires_value" layout="summary-item" format="unix" infer="expires-value-timestamp"> </foxy-internal-date-control> `),h):"","notshipped"===c||"downloaded"===c?"":r(T||(T=q` <foxy-internal-number-control property="items.${0}.length" layout="summary-item" suffix="${0}" infer="length" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.width" layout="summary-item" suffix="${0}" infer="width" min="0"> </foxy-internal-number-control> <foxy-internal-number-control property="items.${0}.height" layout="summary-item" suffix="${0}" infer="height" min="0"> </foxy-internal-number-control> `),h,f(null==d?void 0:d.default_length_unit),h,f(null==d?void 0:d.default_length_unit),h,f(null==d?void 0:d.default_length_unit)),null==m?void 0:m.virtualHost,h,{".defaultWeightUnit":null==d?void 0:d.default_weight_unit,".existingOptions":null!==(s=null==g?void 0:g.custom_options)&&void 0!==s?s:[],".itemCategories":this.itemCategories,".currencyCode":this.currencyCode},(null!==(u=null===(l=null==m?void 0:m.form.items)||void 0===l?void 0:l.length)&&void 0!==u?u:0)<=1?r(A||(A=q``)):r(I||(I=q` <vaadin-button theme="error" class="w-full" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="delete" key="caption"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>this.dispatchEvent(new CustomEvent("remove")))),f(null==g?void 0:g.item_category_uri),(()=>this.requestUpdate()))}get __resolvedItemCategory(){var e,t;return null!==(t=null===(e=this.__itemCategoryLoader)||void 0===e?void 0:e.data)&&void 0!==t?t:this.defaultItemCategory}get __itemCategoryLoader(){return this.renderRoot.querySelector("#itemCategoryLoader")}__handleDiscountBuilderChange(e,t,n){var r;const i=e.currentTarget,o=this.nucleon;t.discount_details=i.parsedValue.details,t.discount_type=i.parsedValue.type,t.discount_name=i.parsedValue.name;const a=null!==(r=null==o?void 0:o.form.items)&&void 0!==r?r:[];a.splice(n,1,t),null==o||o.edit({items:[...a]})}});const D=new WeakMap,H=i((e=>t=>{if(!(t instanceof o))throw new Error("unsafeHTML can only be used in text bindings");const n=D.get(t);if(void 0!==n&&a(e)&&e===n.value&&t.value===n.fragment)return;const r=document.createElement("template");r.innerHTML=e;const i=document.importNode(r.content,!0);t.setValue(i),D.set(t,{value:e,fragment:i})}));
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,I as t}from"./shared-5b4e2567.js";import"./shared-8ef0ca65.js";import"./shared-4d32d19e.js";import{h as r}from"./shared-ba5c42c7.js";import"./shared-
|
|
1
|
+
import{b as e,I as t}from"./shared-5b4e2567.js";import"./shared-8ef0ca65.js";import"./shared-4d32d19e.js";import{h as r}from"./shared-ba5c42c7.js";import"./shared-4a32f76a.js";import"./shared-2d596f72.js";import{_ as s,B as i}from"./shared-cb58dfcd.js";import{a}from"./shared-11351c00.js";import{d as o,e as n}from"./shared-eb963ba3.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-53e42a77.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-d0aed1c1.js";import"./shared-8874ec69.js";import"./shared-63c32024.js";import"./shared-79d0699c.js";import"./shared-5fd5805c.js";let d,l,m=e=>e;customElements.define("foxy-internal-filter-attribute-form-action-control",class extends e{renderControl(){const e=this.nucleon,t=null==e?void 0:e.in({idle:{snapshot:"dirty"}}),s=!!(null==e?void 0:e.data);return r(d||(d=m` <div class="grid grid-cols-2 gap-m"> ${0} <vaadin-button theme="${0}" class="${0}" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="${0}"> </foxy-i18n> </vaadin-button> </div> `),s&&t?r(l||(l=m` <vaadin-button theme="contrast" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="" key="reset"></foxy-i18n> </vaadin-button> `),this.disabled,(()=>null==e?void 0:e.undo())):"",s?t?"secondary":"error":"success",s&&t?"":"col-span-2",this.disabled,(()=>!s||t?null==e?void 0:e.submit():null==e?void 0:e.delete()),s?t?"update":"delete":"create")}});let h,u=e=>e;const c=a(t,"filter-attribute-form");class f extends c{constructor(){super(...arguments),this.pathname=null,this.options=[],this.__filterNameGetValue=()=>{const e=this.constructor;return this.__getValueParam(e.filterNameKey)},this.__filterNameSetValue=e=>{const t=this.constructor;this.__setValueParam(t.filterNameKey,e)}}static get properties(){return s(s({},super.properties),{},{pathname:{},options:{type:Array}})}get hiddenSelector(){const e=[],t=this.constructor,r=this.__getValueParam(t.filterQueryKey),s=!!this.data;return s||e.push("filter-name"),r||s||e.push("action"),new i(`${e.join(" ")} ${super.hiddenSelector}`.trim())}renderBody(){const e=this.constructor;return r(h||(h=u` <foxy-query-builder infer="filter-query" .options="${0}" .value="${0}" @change="${0}"> </foxy-query-builder> <foxy-internal-text-control infer="filter-name" .getValue="${0}" .setValue="${0}"> </foxy-internal-text-control> <foxy-internal-filter-attribute-form-action-control infer="action"> </foxy-internal-filter-attribute-form-action-control> `),this.options,this.__getValueParam(e.filterQueryKey),this.__handleFilterQueryChange,this.__filterNameGetValue,this.__filterNameSetValue)}updated(e){var t;if(super.updated(e),"string"==typeof this.form.value){const e=new URL(o(this.form.value),"https://example.com");e.pathname=null!==(t=this.pathname)&&void 0!==t?t:"";const r=n(e.toString().substring(e.origin.length));r!==this.form.value&&this.edit({value:r})}}submit(){const e=this.constructor;this.edit({visibility:e.attributeVisibility,name:e.attributeName}),super.submit()}__getValueParam(e){var t,r;try{return null!==(r=new URL(o(null!==(t=this.form.value)&&void 0!==t?t:""),"https://example.com").searchParams.get(e))&&void 0!==r?r:""}catch(e){return""}}__setValueParam(e,t){var r;try{const s=new URL(o(null!==(r=this.form.value)&&void 0!==r?r:""),"https://example.com");s.searchParams.set(e,t),this.edit({value:n(s.toString().substring(s.origin.length))})}catch(e){}}__handleFilterQueryChange(e){var t;const r=this.constructor,s=e.currentTarget;this.__setValueParam(r.filterQueryKey,null!==(t=s.value)&&void 0!==t?t:"")}}f.attributeVisibility="restricted",f.filterQueryKey="filter_query",f.attributeName="foxy-admin-bookmark",f.filterNameKey="filter_name",customElements.define("foxy-filter-attribute-form",f);export{f as FilterAttributeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-b65d169b.js";import"./shared-edeeb089.js";import"./shared-83c5e004.js";import{a as e,I as r}from"./shared-5b4e2567.js";import{_ as s,B as t}from"./shared-cb58dfcd.js";import{i}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-
|
|
1
|
+
import"./shared-b65d169b.js";import"./shared-edeeb089.js";import"./shared-83c5e004.js";import{a as e,I as r}from"./shared-5b4e2567.js";import{_ as s,B as t}from"./shared-cb58dfcd.js";import{i}from"./shared-53e42a77.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-e0da7113.js";import"./shared-3a952968.js";import"./shared-4a32f76a.js";import{a}from"./shared-11351c00.js";import"./shared-8b0f00fa.js";import"./shared-21e68b72.js";import"./shared-f9ac8763.js";import"./shared-be442f26.js";import"./shared-f989c70e.js";import"./shared-8ef0ca65.js";import"./shared-315d7620.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-4e709717.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";let n,d,l,h=e=>e;customElements.define("foxy-internal-integer-control",class extends e{constructor(){super(...arguments),this.showControls=!1,this.prefix=null,this.suffix=null,this.min=null,this.max=null}static get properties(){return s(s({},super.properties),{},{showControls:{type:Boolean,attribute:"show-controls"},prefix:{},suffix:{},min:{type:Number},max:{type:Number}})}renderControl(){var e,r;return o(n||(n=h` <vaadin-integer-field error-message="${0}" placeholder="${0}" helper-text="${0}" label="${0}" class="w-full" min="${0}" max="${0}" ?has-controls="${0}" ?disabled="${0}" ?readonly="${0}" .checkValidity="${0}" .value="${0}" clear-button-visible @keydown="${0}" @change="${0}"> ${0} ${0} </vaadin-integer-field> `),i(this._errorMessage),this.placeholder,this.helperText,this.label,i(null!==(e=this.min)&&void 0!==e?e:void 0),i(null!==(r=this.max)&&void 0!==r?r:void 0),this.showControls,this.disabled,this.readonly,this._checkValidity,this._value,(e=>{var r;return"Enter"===e.key&&(null===(r=this.nucleon)||void 0===r?void 0:r.submit())}),(e=>{const r=e.currentTarget;this._value=parseInt(r.value)}),this.prefix?o(d||(d=h`<div slot="prefix">${0}</div>`),this.prefix):"",this.suffix?o(l||(l=h`<div class="pr-s font-medium" slot="suffix">${0}</div>`),this.suffix):"")}});let m,p=e=>e;const c=a(r,"generate-codes-form");class f extends c{constructor(){super(...arguments),this.__exampleGetValue=()=>{var e,r;const s=null!==(e=this.form.prefix)&&void 0!==e?e:"",t=(null!==(r=this.form.length)&&void 0!==r?r:6)-s.length;if(t>0)return["1V3BJ3USJKSS1BYANMNBT7AJ06R6QQ8RB0VPPL03ATQVY186X2","P4YNSW7NSSAY43PL4H7BKHDUVNAE9UR13FC0XAAJHDLZWW8AJC","7DGT4Q91FV4KK095WLX1ML1HFNU6ZCGVBVPMGR7D3P52A9UFTB"].map((e=>`${s}${e.slice(0,t)}`)).join("\n")}}static get v8n(){return[({prefix:e="",length:r=6})=>r-e.length>0&&r<=50&&!(null==e?void 0:e.includes(" "))||"error:invalid_form"]}get readonlySelector(){const e=["example",super.readonlySelector.toString()];return this.href&&e.push("length number-of-codes current-balance prefix"),new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return e.unshift("delete timestamps"),this.href&&e.push("example"),this.errors.includes("error:invalid_form")&&e.push("example"),new t(e.join(" ").trim())}renderBody(){return o(m||(m=p` <foxy-internal-text-control infer="prefix"></foxy-internal-text-control> <div class="grid grid-cols-2 gap-m"> <foxy-internal-integer-control infer="length" min="1"></foxy-internal-integer-control> <foxy-internal-integer-control infer="number-of-codes" min="1"> </foxy-internal-integer-control> </div> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> <foxy-internal-source-control infer="example" .getValue="${0}"> </foxy-internal-source-control> ${0} `),this.__exampleGetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-generate-codes-form",f);export{f as GenerateCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-
|
|
1
|
+
import"./shared-aca2705d.js";import"./shared-0c134ce7.js";import"./shared-80a1bf6f.js";import"./shared-e0da7113.js";import"./shared-e4119ddc.js";import"./shared-4a32f76a.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-nucleon-element.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{g as o}from"./shared-bab2ea2c.js";import{a as s}from"./shared-11351c00.js";import{T as a}from"./shared-8874ec69.js";import{i}from"./shared-53e42a77.js";import{h as d}from"./shared-ba5c42c7.js";import"./shared-8ef0ca65.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./foxy-copy-to-clipboard.js";import"./shared-d807cb20.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-5592ec6e.js";import"./shared-4e709717.js";import"./shared-cd96ff03.js";import"./shared-53e476fd.js";import"./shared-f83207fb.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-6957b8e6.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-5fd5805c.js";import"./foxy-swipe-actions.js";import"./foxy-pagination.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-29f60d2f.js";import"./shared-c1e86ea4.js";import"./shared-a587fd4b.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./shared-d0aed1c1.js";import"./shared-5212ef4f.js";import"./shared-3661a086.js";import"./shared-f1a70f51.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";let n,l=e=>e;const m=s(e,"gift-card-code-form");class c extends m{constructor(){super(...arguments),this.getTransactionPageHref=null,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.__cartItemGetItemUrl=(e,r)=>{var t;let o=null;try{const e=null==r?void 0:r._links["fx:transaction"].href;e&&(o=null===(t=this.getTransactionPageHref)||void 0===t?void 0:t.call(this,e))}catch(e){console.log(e)}return null!=o?o:null},this.__customerGetValue=()=>{var e,r,t;const o=null===(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:customer"])||void 0===t?void 0:t.href,s=this.form.customer_id;return void 0===s?o:this.getCustomerHref(s)},this.__customerSetValue=e=>{const r=o(e);this.edit({customer_id:"number"==typeof r?r:""})},this.__customerFilters=[{type:a.String,path:"id",label:"filters.id"},{type:a.String,path:"tax_id",label:"filters.tax_id"},{type:a.String,path:"email",label:"filters.email"},{type:a.String,path:"first_name",label:"filters.first_name"},{type:a.String,path:"last_name",label:"filters.last_name"},{type:a.Boolean,path:"is_anonymous",label:"filters.is_anonymous",list:[{label:"filters.is_anonymous_true",value:"true"},{label:"filters.is_anonymous_false",value:"false"}]},{type:a.Date,path:"last_login_date",label:"filters.last_login_date"},{type:a.Date,path:"date_created",label:"filters.date_created"},{type:a.Date,path:"date_modified",label:"filters.date_modified"}],this.__storeLoaderId="storeLoader"}static get properties(){return r(r({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerHref:{attribute:!1}})}static get v8n(){return[({code:e})=>!!e||"code:v8n_required",({code:e})=>!e||e.length<=50||"code:v8n_too_long",({code:e})=>!(null==e?void 0:e.includes(" "))||"code:v8n_has_spaces",({current_balance:e})=>"number"==typeof e||"current-balance:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString(),"cart-item"];return new t(e.join(" ").trim())}get hiddenSelector(){const e=[super.hiddenSelector.toString()];return this.href||e.push("customer","cart-item","logs"),new t(e.join(" ").trim())}renderBody(){var e,r,t,o,s,a,m,c;let f;try{const o=new URL(null!==(t=null===(r=null===(e=this.data)||void 0===e?void 0:e._links)||void 0===r?void 0:r["fx:provisioned_by_transaction_detail_id"].href)&&void 0!==t?t:"");o.searchParams.set("zoom","item_options"),f=o.toString()}catch(e){f=void 0}return d(n||(n=l` ${0} <foxy-internal-summary-control infer="settings"> <foxy-internal-text-control layout="summary-item" infer="code"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" infer="current-balance"> </foxy-internal-number-control> <foxy-internal-date-control layout="summary-item" format="iso-long" infer="end-date"> </foxy-internal-date-control> </foxy-internal-summary-control> <foxy-internal-resource-picker-control infer="customer" first="${0}" item="foxy-customer-card" .getValue="${0}" .setValue="${0}" .filters="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-resource-picker-control infer="cart-item" item="foxy-item-card" .getItemUrl="${0}" .getValue="${0}"> </foxy-internal-resource-picker-control> <foxy-internal-async-list-control infer="logs" first="${0}" limit="5" item="foxy-gift-card-code-log-card"> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),i(null===(s=null===(o=this.__storeLoader)||void 0===o?void 0:o.data)||void 0===s?void 0:s._links["fx:customers"].href),this.__customerGetValue,this.__customerSetValue,this.__customerFilters,this.__cartItemGetItemUrl,(()=>f),i(null===(m=null===(a=this.data)||void 0===a?void 0:a._links)||void 0===m?void 0:m["fx:gift_card_code_logs"].href),super.renderBody(),i(null===(c=this.data)||void 0===c?void 0:c._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-code-form",c);export{c as GiftCardCodeForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-eef73355.js";import"./shared-
|
|
1
|
+
import"./shared-eef73355.js";import"./shared-e0da7113.js";import{I as e}from"./shared-5b4e2567.js";import{a as r}from"./shared-11351c00.js";import{B as s}from"./shared-cb58dfcd.js";import{h as t}from"./shared-ba5c42c7.js";import"./shared-d807cb20.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-f9ac8763.js";import"./shared-37348820.js";import"./shared-360d6a20.js";import"./shared-4e709717.js";import"./shared-5fd5805c.js";import"./shared-d0aed1c1.js";import"./shared-53e476fd.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8ef0ca65.js";import"./shared-53e42a77.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5212ef4f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-copy-to-clipboard.js";import"./shared-c18f681b.js";import"./foxy-spinner.js";import"./shared-bab2ea2c.js";let d,a=e=>e;const o=r(e,"gift-card-codes-form");class i extends o{constructor(){super(...arguments),this.__giftCardCodesGetValue=()=>{var e,r;return null!==(r=null===(e=this.form.gift_card_codes)||void 0===e?void 0:e.map((e=>({value:e}))))&&void 0!==r?r:[]},this.__giftCardCodesSetValue=e=>{this.edit({gift_card_codes:e.map((({value:e})=>e.split(" ").map((e=>e.trim())))).flat().filter(((e,r,s)=>s.indexOf(e)===r))})}}static get v8n(){return[({gift_card_codes:e})=>e&&e.length>0||"gift-card-codes:v8n_required"]}get readonlySelector(){const e=[super.readonlySelector.toString()];return this.href&&e.push("gift-card-codes"),new s(e.join(" ").trim())}get hiddenSelector(){const e=["delete timestamps",super.hiddenSelector.toString()];return new s(e.join(" ").trim())}renderBody(){return t(d||(d=a` <foxy-internal-editable-list-control infer="gift-card-codes" .getValue="${0}" .setValue="${0}"> </foxy-internal-editable-list-control> <foxy-internal-number-control infer="current-balance" min="0"></foxy-internal-number-control> ${0} `),this.__giftCardCodesGetValue,this.__giftCardCodesSetValue,super.renderBody())}async _sendPost(e){const r=JSON.stringify(e),s=await this._fetch(this.parent,{body:r,method:"POST"});return this.status={key:"success"},s}}customElements.define("foxy-gift-card-codes-form",i);export{i as GiftCardCodesForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-17f2f27a.js";import"./shared-c73c69bf.js";import"./shared-eef73355.js";import"./shared-0c134ce7.js";import"./shared-2ab1e9eb.js";import"./shared-80a1bf6f.js";import"./shared-eea8debb.js";import"./shared-2c81b7df.js";import"./shared-c05643e6.js";import"./shared-afe24913.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{T as i}from"./shared-8874ec69.js";import{h as o}from"./shared-ba5c42c7.js";import{R as a,a as s}from"./shared-11351c00.js";import{i as n}from"./shared-53e42a77.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-d0aed1c1.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-swipe-actions.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-3a952968.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-3661a086.js";import"./shared-27cfa174.js";import"./shared-e4119ddc.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";import"./shared-cc7e1dc6.js";const d=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let l,c,f=e=>e;const m=a(s(e,"gift-card-form"));class p extends m{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.codesFilter=null,this.__provisioningMaxBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_max},this.__provisioningMaxBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:i>e?e:i,initial_balance_max:e}})},this.__provisioningMinBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_min},this.__provisioningMinBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:i<e?e:i}})},this.__provisioningToggleValueGetter=()=>{var e;return!!(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)},this.__provisioningToggleValueSetter=e=>{var r,t,i,o;e?this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:0,initial_balance_max:null!==(o=null===(i=this.form.provisioning_config)||void 0===i?void 0:i.initial_balance_max)&&void 0!==o?o:0}}):this.edit({provisioning_config:null})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:r})=>"block"===r?`-${e}`:e)).filter(((e,r,t)=>!!e&&t.indexOf(e)===r)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"current_balance",path:"current_balance",type:i.Number},{label:"end_date",path:"end_date",type:i.Date},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(r){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(r.code),e.__codesActions[0].state="end"}catch(r){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return r(r({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerHref:{attribute:!1},codesFilter:{attribute:"codes-filter"}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var r;if(null===(r=e.provisioning_config)||void 0===r?void 0:r.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_min;return!("number"==typeof t&&t<0)||"min-balance:v8n_negative"},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_max;return!("number"==typeof t&&t<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){var e;const r=[super.hiddenSelector.toString()];return this.data||r.push("codes","category-restrictions","attributes"),(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)||r.push("provisioning:sku","provisioning:min-balance","provisioning:max-balance"),new t(r.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return o(l||(l=f` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,r,t,i,a,s,l,m,p,u,_;let h;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==r?r:"");t.searchParams.set("order","date_created desc"),h=t.toString()}catch(e){h=void 0}return o(c||(c=f` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" layout="summary-item" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" layout="summary-item" infer="expires"> </foxy-internal-frequency-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="provisioning"> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="sku"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="min-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="max-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control filter="${0}" first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .actions="${0}" .filters="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,d.map((e=>({label:this.t(`general.currency.code_${e}`),value:e}))),this.__provisioningToggleValueGetter,this.__provisioningToggleValueSetter,n(null===(t=this.form.currency_code)||void 0===t?void 0:t.toUpperCase()),this.__provisioningMinBalanceValueGetter,this.__provisioningMinBalanceValueSetter,n(null===(i=this.form.currency_code)||void 0===i?void 0:i.toUpperCase()),this.__provisioningMaxBalanceValueGetter,this.__provisioningMaxBalanceValueSetter,n(null!==(a=this.codesFilter)&&void 0!==a?a:void 0),h,this.__codesActions,this.__codesFilters,{".getTransactionPageHref":this.getTransactionPageHref,".getCustomerHref":this.getCustomerHref},this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],n(null===(l=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===l?void 0:l._links["fx:item_categories"].href),n(null===(m=this.data)||void 0===m?void 0:m._links["fx:gift_card_item_categories"].href),n(null===(p=this.data)||void 0===p?void 0:p._links.self.href),n(null===(u=this.data)||void 0===u?void 0:u._links["fx:attributes"].href),super.renderBody(),n(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",p);export{p as GiftCardForm};
|
|
1
|
+
import"./shared-17f2f27a.js";import"./shared-c73c69bf.js";import"./shared-eef73355.js";import"./shared-0c134ce7.js";import"./shared-e21ddeae.js";import"./shared-80a1bf6f.js";import"./shared-5cd33249.js";import"./shared-00e02b35.js";import"./shared-e0da7113.js";import"./shared-4a32f76a.js";import{I as e}from"./shared-5b4e2567.js";import"./foxy-generate-codes-form.js";import"./foxy-gift-card-codes-form.js";import"./foxy-item-category-card.js";import"./foxy-gift-card-code-card.js";import"./foxy-gift-card-code-form.js";import"./foxy-nucleon-element.js";import"./foxy-attribute-card.js";import"./foxy-attribute-form.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{T as i}from"./shared-8874ec69.js";import{h as o}from"./shared-ba5c42c7.js";import{R as a,a as s}from"./shared-11351c00.js";import{i as n}from"./shared-53e42a77.js";import"./shared-6957b8e6.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-8ef0ca65.js";import"./foxy-collection-page.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-4d32d19e.js";import"./shared-343d1fd7.js";import"./shared-2aa23b5f.js";import"./shared-5afb584d.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-7594e563.js";import"./shared-0aedd809.js";import"./shared-5ef40e86.js";import"./shared-5fd5805c.js";import"./shared-53e476fd.js";import"./foxy-pagination.js";import"./shared-4e709717.js";import"./foxy-form-dialog.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";import"./shared-d0aed1c1.js";import"./shared-3556f4b7.js";import"./shared-7dc9c80b.js";import"./shared-c25538f1.js";import"./foxy-swipe-actions.js";import"./shared-b65d169b.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-83c5e004.js";import"./shared-6683daed.js";import"./shared-243456aa.js";import"./shared-c1e86ea4.js";import"./shared-651c44fa.js";import"./shared-1c355fac.js";import"./shared-cf12f33b.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-bab2ea2c.js";import"./shared-3a952968.js";import"./shared-0df46275.js";import"./shared-f1a70f51.js";import"./shared-3661a086.js";import"./shared-aca2705d.js";import"./shared-e4119ddc.js";import"./shared-29f60d2f.js";import"./shared-a587fd4b.js";import"./shared-79d0699c.js";import"./shared-43e2c3f6.js";import"./foxy-gift-card-code-log-card.js";import"./foxy-customer-card.js";import"./foxy-item-card.js";import"./shared-8eeddc22.js";import"./shared-eb963ba3.js";import"./shared-cc7e1dc6.js";const d=["aed","afn","all","amd","ang","aoa","ars","aud","awg","azn","bam","bbd","bdt","bgn","bhd","bif","bmd","bnd","bob","brl","bsd","btc","btn","bwp","byn","bzd","cad","cdf","chf","clf","clp","cnh","cny","cop","crc","cuc","cup","cve","czk","djf","dkk","dop","dzd","egp","ern","etb","eur","fjd","fkp","gbp","gel","ggp","ghs","gip","gmd","gnf","gtq","gyd","hkd","hnl","hrk","htg","huf","idr","ils","imp","inr","iqd","irr","isk","jep","jmd","jod","jpy","kes","kgs","khr","kmf","kpw","krw","kwd","kyd","kzt","lak","lbp","lkr","lrd","lsl","lyd","mad","mdl","mga","mkd","mmk","mnt","mop","mru","mur","mvr","mwk","mxn","myr","mzn","nad","ngn","nio","nok","npr","nzd","omr","pab","pen","pgk","php","pkr","pln","pyg","qar","ron","rsd","rub","rwf","sar","sbd","scr","sdg","sek","sgd","shp","sll","sos","srd","ssp","std","stn","svc","syp","szl","thb","tjs","tmt","tnd","top","try","ttd","twd","tzs","uah","ugx","usd","uyu","uzs","vef","ves","vnd","vuv","wst","xaf","xag","xau","xcd","xdr","xof","xpd","xpf","xpt","yer","zar","zmw","zwl"];let l,c,f=e=>e;const m=a(s(e,"gift-card-form"));class p extends m{constructor(){var e;super(...arguments),e=this,this.getTransactionPageHref=null,this.getCustomerHref=e=>`https://api.foxycart.com/customers/${e}`,this.codesFilter=null,this.__provisioningMaxBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_max},this.__provisioningMaxBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:i>e?e:i,initial_balance_max:e}})},this.__provisioningMinBalanceValueGetter=()=>{var e;return null===(e=this.form.provisioning_config)||void 0===e?void 0:e.initial_balance_min},this.__provisioningMinBalanceValueSetter=e=>{var r,t;const i=null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_max)&&void 0!==t?t:e;this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:e,initial_balance_max:i<e?e:i}})},this.__provisioningToggleValueGetter=()=>{var e;return!!(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)},this.__provisioningToggleValueSetter=e=>{var r,t,i,o;e?this.edit({provisioning_config:{allow_autoprovisioning:!0,initial_balance_min:null!==(t=null===(r=this.form.provisioning_config)||void 0===r?void 0:r.initial_balance_min)&&void 0!==t?t:0,initial_balance_max:null!==(o=null===(i=this.form.provisioning_config)||void 0===i?void 0:i.initial_balance_max)&&void 0!==o?o:0}}):this.edit({provisioning_config:null})},this.__productCodeRestrictionsGetValue=()=>{var e;return null===(e=this.form.product_code_restrictions)||void 0===e?void 0:e.split(",").filter((e=>!!e.trim())).map((e=>({value:e,label:e.startsWith("-")?this.t("product-code-restrictions.label_block",{value:e.substring(1)}):this.t("product-code-restrictions.label_allow",{value:e})})))},this.__productCodeRestrictionsSetValue=e=>{this.edit({product_code_restrictions:e.map((({value:e,unit:r})=>"block"===r?`-${e}`:e)).filter(((e,r,t)=>!!e&&t.indexOf(e)===r)).join(",")})},this.__currencyCodeGetValue=()=>{var e;return null===(e=this.form.currency_code)||void 0===e?void 0:e.toLowerCase()},this.__storeLoaderId="storeLoader",this.__codesFilters=[{label:"code",path:"code",type:i.String},{label:"current_balance",path:"current_balance",type:i.Number},{label:"end_date",path:"end_date",type:i.Date},{label:"date_created",path:"date_created",type:i.Date},{label:"date_modified",path:"date_modified",type:i.Date}],this.__codesActions=[{theme:"contrast",state:"idle",text:"copy_button_text",onClick:async function(r){e.__codesActions[0].state="busy",e.__codesActions=[...e.__codesActions];try{await navigator.clipboard.writeText(r.code),e.__codesActions[0].state="end"}catch(r){e.__codesActions[0].state="error"}finally{e.__codesActions=[...e.__codesActions],setTimeout((()=>{e.__codesActions[0].state="idle",e.__codesActions=[...e.__codesActions]}),1e3)}}}]}static get properties(){return r(r({},super.properties),{},{getTransactionPageHref:{attribute:!1},getCustomerHref:{attribute:!1},codesFilter:{attribute:"codes-filter"}})}static get v8n(){return[({name:e})=>!!e||"name:v8n_required",({name:e})=>!e||e.length<=50||"name:v8n_too_long",e=>{var r;if(null===(r=e.provisioning_config)||void 0===r?void 0:r.allow_autoprovisioning){if(!e.sku)return"sku:v8n_required";if(e.sku.length>200)return"sku:v8n_too_long"}return!0},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_min;return!("number"==typeof t&&t<0)||"min-balance:v8n_negative"},e=>{var r;const t=null===(r=e.provisioning_config)||void 0===r?void 0:r.initial_balance_max;return!("number"==typeof t&&t<0)||"max-balance:v8n_negative"},({product_code_restrictions:e})=>!e||e.length<=5e3||"product-code-restrictions:v8n_too_long"]}get hiddenSelector(){var e;const r=[super.hiddenSelector.toString()];return this.data||r.push("codes","category-restrictions","attributes"),(null===(e=this.form.provisioning_config)||void 0===e?void 0:e.allow_autoprovisioning)||r.push("provisioning:sku","provisioning:min-balance","provisioning:max-balance"),new t(r.join(" ").trim())}get headerSubtitleOptions(){return{id:this.headerCopyIdValue}}renderHeaderActions(e){return o(l||(l=f` <foxy-internal-bulk-add-action-control parent="${0}" infer="generate" form="foxy-generate-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> <foxy-internal-bulk-add-action-control parent="${0}" infer="import" form="foxy-gift-card-codes-form" .related="${0}"> </foxy-internal-bulk-add-action-control> ${0} `),e._links["fx:generate_codes"].href,[e._links["fx:gift_card_codes"].href],e._links["fx:gift_card_codes"].href,[e._links["fx:gift_card_codes"].href],super.renderHeaderActions(e))}renderBody(){var e,r,t,i,a,s,l,m,p,u,_;let h;try{const t=new URL(null!==(r=null===(e=this.data)||void 0===e?void 0:e._links["fx:gift_card_codes"].href)&&void 0!==r?r:"");t.searchParams.set("order","date_created desc"),h=t.toString()}catch(e){h=void 0}return o(c||(c=f` ${0} <foxy-internal-summary-control infer="general"> <foxy-internal-text-control layout="summary-item" infer="name"> </foxy-internal-text-control> <foxy-internal-select-control property="currency_code" layout="summary-item" infer="currency" .getValue="${0}" .options="${0}"> </foxy-internal-select-control> <foxy-internal-frequency-control property="expires_after" layout="summary-item" infer="expires"> </foxy-internal-frequency-control> </foxy-internal-summary-control> <foxy-internal-summary-control infer="provisioning"> <foxy-internal-switch-control infer="toggle" .getValue="${0}" .setValue="${0}"> </foxy-internal-switch-control> <foxy-internal-text-control layout="summary-item" infer="sku"></foxy-internal-text-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="min-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> <foxy-internal-number-control layout="summary-item" suffix="${0}" infer="max-balance" min="0" .getValue="${0}" .setValue="${0}"> </foxy-internal-number-control> </foxy-internal-summary-control> <foxy-internal-async-list-control filter="${0}" first="${0}" limit="5" infer="codes" item="foxy-gift-card-code-card" form="foxy-gift-card-code-form" alert .actions="${0}" .filters="${0}" .formProps="${0}"> </foxy-internal-async-list-control> <foxy-internal-editable-list-control infer="product-code-restrictions" .getValue="${0}" .setValue="${0}" .units="${0}"> </foxy-internal-editable-list-control> <foxy-internal-async-resource-link-list-control foreign-key-for-uri="item_category_uri" foreign-key-for-id="item_category_id" own-key-for-uri="gift_card_uri" options-href="${0}" links-href="${0}" embed-key="fx:gift_card_item_categories" own-uri="${0}" infer="category-restrictions" limit="5" item="foxy-item-category-card"> </foxy-internal-async-resource-link-list-control> <foxy-internal-async-list-control first="${0}" limit="5" infer="attributes" item="foxy-attribute-card" form="foxy-attribute-form" alert> </foxy-internal-async-list-control> ${0} <foxy-nucleon infer="" class="hidden" href="${0}" id="${0}" @update="${0}"> </foxy-nucleon> `),this.renderHeader(),this.__currencyCodeGetValue,d.map((e=>({label:this.t(`general.currency.code_${e}`),value:e}))),this.__provisioningToggleValueGetter,this.__provisioningToggleValueSetter,n(null===(t=this.form.currency_code)||void 0===t?void 0:t.toUpperCase()),this.__provisioningMinBalanceValueGetter,this.__provisioningMinBalanceValueSetter,n(null===(i=this.form.currency_code)||void 0===i?void 0:i.toUpperCase()),this.__provisioningMaxBalanceValueGetter,this.__provisioningMaxBalanceValueSetter,n(null!==(a=this.codesFilter)&&void 0!==a?a:void 0),h,this.__codesActions,this.__codesFilters,{".getTransactionPageHref":this.getTransactionPageHref,".getCustomerHref":this.getCustomerHref},this.__productCodeRestrictionsGetValue,this.__productCodeRestrictionsSetValue,[{label:this.t("product-code-restrictions.unit_allow"),value:"allow"},{label:this.t("product-code-restrictions.unit_block"),value:"block"}],n(null===(l=null===(s=this.__storeLoader)||void 0===s?void 0:s.data)||void 0===l?void 0:l._links["fx:item_categories"].href),n(null===(m=this.data)||void 0===m?void 0:m._links["fx:gift_card_item_categories"].href),n(null===(p=this.data)||void 0===p?void 0:p._links.self.href),n(null===(u=this.data)||void 0===u?void 0:u._links["fx:attributes"].href),super.renderBody(),n(null===(_=this.data)||void 0===_?void 0:_._links["fx:store"].href),this.__storeLoaderId,(()=>this.requestUpdate()))}get __storeLoader(){return this.renderRoot.querySelector(`#${this.__storeLoaderId}`)}}customElements.define("foxy-gift-card-form",p);export{p as GiftCardForm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./shared-8ef0ca65.js";import"./shared-33ecc7ee.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-
|
|
1
|
+
import"./shared-8ef0ca65.js";import"./shared-33ecc7ee.js";import{I as e}from"./shared-5b4e2567.js";import"./shared-4a32f76a.js";import"./shared-5212ef4f.js";import"./foxy-copy-to-clipboard.js";import"./shared-4d32d19e.js";import{_ as r,B as t}from"./shared-cb58dfcd.js";import{a as s}from"./shared-11351c00.js";import{c as a}from"./shared-4e709717.js";import{h as o}from"./shared-ba5c42c7.js";import"./shared-f9ac8763.js";import"./shared-21e68b72.js";import"./shared-315d7620.js";import"./shared-495860b4.js";import"./shared-edeeb089.js";import"./shared-f989c70e.js";import"./shared-8b0f00fa.js";import"./shared-be442f26.js";import"./shared-53e42a77.js";import"./shared-0aedd809.js";import"./shared-7594e563.js";import"./shared-5afb584d.js";import"./shared-2aa23b5f.js";import"./shared-f83207fb.js";import"./shared-5592ec6e.js";import"./shared-343d1fd7.js";import"./shared-cd96ff03.js";import"./shared-5e4a03d1.js";import"./shared-5ef40e86.js";import"./shared-e5546d55.js";import"./shared-048d5cae.js";import"./foxy-spinner.js";import"./shared-37348820.js";import"./shared-c18f681b.js";import"./shared-bab2ea2c.js";import"./shared-d0aed1c1.js";import"./shared-d807cb20.js";import"./shared-360d6a20.js";let i,n,d,l,c,h,p,_,m,b,f,u,y=e=>e;const x=s(e,"integration-form");class j extends x{constructor(){super(...arguments),this.__postResponse=null}static get properties(){return r(r({},super.properties),{},{__postResponse:{attribute:!1}})}static get v8n(){return[({project_name:e})=>!!e||"project-name:v8n_required"]}get hiddenSelector(){return new t(`header:copy-id ${super.hiddenSelector}`.trimEnd())}renderBody(){return this.data?this.__renderSnapshotBody():this.__renderTemplateBody()}async _fetch(...e){var r;const t=this.constructor,s=await new t.API(this).fetch(...e),a="string"==typeof e[0]?null===(r=e[1])||void 0===r?void 0:r.method:e[0].method,o="string"==typeof e[0]?e[0]:e[0].url;if(!s.ok)throw s;const i=await s.json();return"POST"===(null==a?void 0:a.toUpperCase())&&o===this.parent&&(this.__postResponse=i),i}__renderSnapshotBody(){const e=this.hiddenSelector,r=this.__postResponse;return o(i||(i=y` ${0} ${0} ${0} <foxy-internal-delete-control infer="delete"></foxy-internal-delete-control> `),this.renderHeader(),e.matches("message",!0)||!r?"":this.__renderMessage(),e.matches("table")?"":this.__renderTable())}__renderTemplateBody(){return o(n||(n=y` ${0} <foxy-internal-text-control infer="project-name"></foxy-internal-text-control> <foxy-internal-text-area-control infer="project-description"> </foxy-internal-text-area-control> <foxy-internal-submit-control infer="create"></foxy-internal-submit-control> `),this.renderHeader())}__renderMessage(){return o(d||(d=y` ${0} <div class="bg-success-10 text-success p-m pb-s space-y-xs leading-s rounded-t-l rounded-b-l"> <foxy-i18n infer="message" class="block" key="text"></foxy-i18n> <vaadin-button data-testid="message-action" theme="tertiary contrast" class="p-0" ?disabled="${0}" @click="${0}"> <foxy-i18n infer="message" key="action"></foxy-i18n> </vaadin-button> </div> ${0} `),this.renderTemplateOrSlot("message:before"),this.disabledSelector.matches("message",!0),(()=>this.__postResponse=null),this.renderTemplateOrSlot("message:after"))}__renderTable(){var e;const r=this.data,t=new Date(1e3*(null!==(e=r.expires)&&void 0!==e?e:0)),s=this.__postResponse;return o(l||(l=y` ${0} <table class="font-lumo text-m leading-m w-full"> <tbody class="divide-y divide-contrast-10"> ${0} ${0} ${0} ${0} ${0} ${0} ${0} </tbody> </table> ${0} `),this.renderTemplateOrSlot("table:before"),this.__renderTableRow({label:this.__renderTableI18n("added_by"),value:this.__renderMailToLink(r.added_by_email,r.added_by_name)}),this.__renderTableRow({label:this.__renderTableI18n("contact"),value:this.__renderMailToLink(r.contact_email,r.contact_name)}),this.__renderTableRow({label:this.__renderTableI18n("company"),value:this.__renderLink(r.company_url,r.company_name)}),this.__renderTableRow({label:this.__renderTableI18n("expires"),value:this.__renderTableI18n("expires_date",{date:t})}),this.__renderTableRow({label:"Client ID",value:this.__renderCopiableText(r.client_id)}),s?o(c||(c=y` ${0} ${0} ${0} `),this.__renderTableRow({highlight:!0,label:"Client secret",value:this.__renderCopiableText(s.client_secret)}),this.__renderTableRow({highlight:!0,label:"Refresh token",value:this.__renderCopiableText(s.refresh_token)}),this.__renderTableRow({highlight:!0,label:"Access token",value:this.__renderCopiableText(s.access_token)})):"",this.__renderTableRow({label:"Scope",value:o(h||(h=y`<code>${0}</code>`),r.scope)}),this.renderTemplateOrSlot("table:after"))}__renderCopiableText(e){return o(p||(p=y` <div class="flex items-center gap-s"> <code class="truncate flex-1">${0}</code> <foxy-copy-to-clipboard infer="copy-to-clipboard" class="inline-block" text="${0}"> </foxy-copy-to-clipboard> </div> `),e,e)}__renderMailToLink(e,r){return e?this.__renderLink(`mailto:${e}`,r):o(_||(_=y`${0}`),r)}__renderLink(e,r){return e?o(b||(b=y` <a target="_blank" class="font-medium text-primary rounded hover-underline focus-outline-none focus-ring-2 focus-ring-primary-50" href="${0}"> ${0} </a> `),e,r):o(m||(m=y`${0}`),r)}__renderTableRow(e){const{label:r,value:t,highlight:s=!1}=e;return o(f||(f=y` <tr class="${0}"> <td class="max-w-0 truncate py-s text-secondary w-1-3 pr-m">${0}</td> <td class="max-w-0 truncate py-s text-body w-2-3">${0}</td> </tr> `),a({"font-medium text-success":s}),r,t)}__renderTableI18n(e,r){return o(u||(u=y`<foxy-i18n infer="table" key="${0}" .options="${0}"></foxy-i18n>`),e,r)}}customElements.define("foxy-integration-form",j);export{j as IntegrationForm};
|