PageSourceSearch

https://www.hem.se/_next/static/chunks/943.81a272d952444018.js

js hem.se collected 2026-10-02 05:55:02 UTC 17,113 bytes, 21 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[943],{72748:function(e,t,n){n.d(t,{s2:function(){return E},Zh:function(){return v},Ny:function(){return P},K4:function(){return x},pX:function(){return V},dT:function(){return O},Tl:function(){return M},PI:function(){return p},hw:function(){return Y},Pn:function(){return A},eO:function(){return D},aS:function(){return d},fS:function(){return b},gb:function(){return F},_M:function(){return L},dB:function(){return C},Ft:function(){return w},Ew:function(){return _}});var r,i,o,a,s,l,u,c,d,f,p,m,h,v,g=function(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}l((r=r.apply(e,t||[])).next())})};class y{constructor(e){this.config=e}send(e,t,n,r,i){return g(this,void 0,void 0,function*(){let o=new URL(`${this.config.baseURL}${e}`,"http://temp");if(n)for(var a in n)o.searchParams.set(a,n[a]);let s={method:t,credentials:"include",headers:null!=r?r:this.config.headers,body:i?JSON.stringify(i):void 0};return new Promise((e,t)=>{fetch(o.href,s).then(n=>g(this,void 0,void 0,function*(){n.ok?e((yield n.json())):t(n)})).catch(e=>{t(e)})})})}get(e,t){return g(this,void 0,void 0,function*(){return new Promise((n,r)=>{this.send(e,"GET",t).then(e=>{n(e)}).catch(e=>{r(e)})})})}post(e,t,n){return g(this,void 0,void 0,function*(){return new Promise((r,i)=>{this.send(e,"POST",n,void 0,t).then(e=>{r(e)}).catch(e=>{i(e)})})})}}let S={baseURL:"/",headers:{"Content-Type":"application/json"}};(r=c||(c={})).apiVersion="v1",r.apiEndpoint="_forms/v1/forms";class x{constructor(e){this.client=new y(Object.assign(Object.assign({},S),e))}getForm(e,t){return new Promise((n,r)=>{this.client.get(`${c.apiEndpoint}/${e}`,{locale:t}).then(e=>{n(e)}).catch(e=>{r(e)})})}queryForm(e,t,n){return new Promise((r,i)=>{fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({query:`
2            query FormQuery($key: String, $language: String) {
3                FormContainer(where: { Key: { eq: $key }, Locale: { eq: $language } }) {
4                    items {
5                        Key
6                        Locale
7                        Properties
8                        Localizations
9                        FormElements {
10                            Key
11                            ContentType
12                            DisplayName
13                            Locale
14                            Localizations
15                            Properties
16                            Locale
17                        }
18                    }
19                }
20            }
21            `,variables:{key:t,language:n}})}).then(e=>{var t,n,o,a;return t=this,n=void 0,o=void 0,a=function*(){if(e.ok){let t=(yield e.json()).data.FormContainer.items[0];r(this.convertFirstLetterToLowerCase(t))}else i(e)},new(o||(o=Promise))(function(e,r){function i(e){try{l(a.next(e))}catch(e){r(e)}}function s(e){try{l(a.throw(e))}catch(e){r(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof o?n:new o(function(e){e(n)})).then(i,s)}l((a=a.apply(t,n||[])).next())})}).catch(e=>{i(e)})})}convertFirstLetterToLowerCase(e){let t="object"==typeof e;return e&&t&&!Array.isArray(e)?Object.keys(e).reduce((n,r)=>(n[r.charAt(0).toLowerCase()+r.slice(1)]=t?this.convertFirstLetterToLowerCase(e[r]):e[r],n),{}):Array.isArray(e)?e.map(e=>this.convertFirstLetterToLowerCase(e)):e}}function _(e){return w(e)||""===e}function w(e){return null==e}function b(e,t,n=!1){return n?e.toLowerCase()===t.toLowerCase():e===t}function k(e){return!isNaN(parseFloat(e))&&isFinite(e)}function C(e,t,n=!1){return n&&(e=e.toLowerCase(),t=t.map(e=>e.toLowerCase())),t.indexOf(e)>-1}function F(e){var t=document.createElement("textarea");return t.innerHTML=e,t.value}(i=d||(d={})).RequiredValidator="RequiredValidator",i.EmailValidator="EmailValidator",i.RegularExpressionValidator="RegularExpressionValidator",i.DateDDMMYYYYValidator="DateDDMMYYYYValidator",i.DateMMDDYYYYValidator="DateMMDDYYYYValidator",i.DateYYYYMMDDValidator="DateYYYYMMDDValidator",i.UrlValidator="UrlValidator",i.IntegerValidator="IntegerValidator",i.PositiveIntegerValidator="PositiveIntegerValidator",i.AllowedExtensionsValidator="AllowedExtensionsValidator",i.MaxFileSizeValidator="MaxFileSizeValidator",i.NumericValidator="NumericValidator",i.CaptchaValidator="CaptchaValidator",(o=f||(f={})).All="All",o.Any="Any",(a=p||(p={})).Show="show",a.Hide="hide",(s=m||(m={})).MatchRegularExpression="MatchRegularExpression",s.Contains="Contains",s.NotContains="NotContains",s.Equals="Equals",s.NotEquals="NotEquals",(l=h||(h={})).PreviousStep="PreviousStep",l.NextStep="NextStep",(u=v||(v={})).FormAccessToken="form_access_token",u.FormFieldPrefix="__field_",u.FormCurrentStep="form_current_step_",u.FormSubmissionId="form_submission_id_";class E{constructor(e){this._storage=null!=e?e:window.sessionStorage}get(e){let t=this._storage[e];if(t&&("object"==typeof t&&(t=JSON.parse(t)),t))return t}set(e,t){try{"object"==typeof t?this._storage.setItem(e,JSON.stringify(t)):this._storage.setItem(e,t)}catch(e){console.log("Local Storage not supported: "+e.message)}return t}remove(e){this._storage.removeItem(e)}}class D{constructor(e){this._tempBaseUrl="http://temp",this._form=e}isAllStepsAreNotLinked(){return!this._form.steps.some(e=>{var t;return!_(null===(t=e.formStep.properties)||void 0===t?void 0:t.attachedContentLink)})}isMalFormSteps(){let e=!1;return this._form.steps.length>=2&&!this.isAllStepsAreNotLinked()&&(e=this._form.steps.some(e=>{var t;return _(null===(t=e.formStep.properties)||void 0===t?void 0:t.attachedContentLink)})),e}getCurrentStepIndex(e){let t=0;return this.isAllStepsAreNotLinked()?t=0:this._form.steps.every((n,r)=>{var i;let o=new URL(null===(i=n.formStep.properties)||void 0===i?void 0:i.attachedContentLink,this._tempBaseUrl);return!b(new URL(null!=e?e:"/",this._tempBaseUrl).pathname,o.pathname)||(t=r,!1)}),t}isInCurrentStep(e,t){let n=this._form.steps[t];return!n||n.elements.some(t=>b(t.key,e))}getFirstInvalidElement(e,t){var n;return null===(n=e.filter(e=>
21!e.result.valid&&this.isInCurrentStep(e.elementKey,t))[0])||void 0===n?void 0:n.elementKey}isNeedCheckDependCondition(e){var t,n,r;let i=null===(t=this._form.steps[e])||void 0===t?void 0:t.formStep;return!w(i)&&!_(null===(r=null===(n=i.properties)||void 0===n?void 0:n.dependField)||void 0===r?void 0:r.key)}getFirstInputElement(e,t){var n;let r=this._form.steps[e].elements.find(e=>e.contentType.indexOf("ElementBlock")>0&&0>t.indexOf(e.key));return null!==(n=null==r?void 0:r.key)&&void 0!==n?n:""}}class V{constructor(e){this._form=e}getStorage(){return window.sessionStorage}saveFormDataToStorage(e){let t=this.getStorage();try{t.setItem(this._form.key,JSON.stringify(e))}catch(e){console.log("Local Storage not supported: "+e.message)}return e}loadFormDataFromStorage(){let e=this.getStorage()[this._form.key];return e&&(e=JSON.parse(e))?e:[]}removeFormDataInStorage(){this.getStorage().removeItem(this._form.key)}}function L(e,t,n){var r;let i=new V(e).loadFormDataFromStorage(),o=new E,a=new D(e),s=[],l=[],u=[],c=[];null===(r=e.steps)||void 0===r||r.forEach(e=>{e.elements.forEach(t=>{t.key!=e.formStep.key&&(l=l.concat({elementKey:t.key,result:{valid:!0,message:""}}),s=s.concat({elementKey:t.key,value:function(e){var t;let n=e.properties,r=null!==(t=null==n?void 0:n.forms_ExternalSystemsFieldMappings)&&void 0!==t?t:[],i=_(null==n?void 0:n.predefinedValue)?r.length>0?r[0]:void 0:n.predefinedValue,o=e.properties;if(!w(null==o?void 0:o.items)){let e=[];o.items.forEach(t=>t.checked&&e.push(t.value)),e.length>0&&(i=e.join(","))}let a=e.properties;if(!w(null==a?void 0:a.min)){if(_(i)||!k(i))i=a.min;else{let e=parseInt(i);i=e>a.max||e<a.min?a.min:e}}return i}(t)}),c=c.concat({elementKey:t.key,isSatisfied:!0,sastisfiedAction:t.properties.satisfiedAction}))}),u=u.concat({elementKey:e.formStep.key,isSatisfied:!1})}),i.length>0&&(s=s.map(e=>i.find(t=>
21b(t.elementKey,e.elementKey))||e));let d=o.get(v.FormCurrentStep+e.key);return{isReset:!1,focusOn:"",dependencyInactiveElements:[],currentStepIndex:_(d)?a.getCurrentStepIndex(t):parseInt(d),formSubmissions:s,formValidationResults:l,stepDependencies:u,formContainer:e,history:n,elementDependencies:c}}class Y{constructor(e){this._form=e}buildForm(){let e=[],t=[],n={key:"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})};return this._form.formElements.forEach((r,i)=>{this.isFormStep(r)&&(0!==i&&e.push({formStep:Object.assign({},n),elements:[...t]}),t=[],n=Object.assign({},r)),t.push(r)}),e.push({formStep:Object.assign({},n),elements:[...t]}),Object.assign(Object.assign({},this._form),{steps:e})}isFormStep(e){return b(e.contentType,"FormStepBlock")}}function N(e,t){return e instanceof Array?e.join(t):e}let I={[m.Contains]:function(e,t){let n=w(e)?"":N(e.toString(),",").toLocaleUpperCase();return t=t?t.toLocaleUpperCase():"",n.indexOf(t)>=0},[m.NotContains]:function(e,t){let n=e?N(e.toString(),",").toLocaleUpperCase():"",r=_(n),i=_(t);return!r&&i||r&&!i||!r&&!i&&0>n.indexOf(t.toLocaleUpperCase())},[m.Equals]:function(e,t){return(_(e)?"":N(e.toString(),",").toLocaleUpperCase())===(t=t?t.toLocaleUpperCase():"")},[m.NotEquals]:function(e,t){return(e?N(e.toString(),",").toLocaleUpperCase():"")!==(t=t?t.toLocaleUpperCase():"")},[m.MatchRegularExpression]:function(e,t){var n=RegExp(t,"igm");let r=e?N(e.toString(),","):"";return _(t)||!_(t)&&n.test(r)}};class A{constructor(e,t){this._tempBaseUrl="http://temp",this._form=e,this._formStorage=new V(e),this._inactiveElements=t,this._stepHelper=new D(e)}isSatisfied(e){var t,n,r;let i=null===(t=this._form.steps[e])||void 0===t?void 0:t.formStep;if(!i)return!1;let o=null===(n=i.properties)||void 0===n?void 0:n.dependField,a=this._formStorage.loadFormDataFromStorage().find(e=>e.elementKey===(null==o?void 0:o.key)),s=I[null===(r=i.properties)||void 0===r?void 0:r.dependCondition];return!o||!s||!a||s(!o&&C(o,this._inactiveElements)?null:null==a?void 0:a.value,i.properties.dependValue)}findNextStep(e){let t=e+1;return this._form.steps[t]?this.isSatisfied(t)?t:this.findNextStep(t):this._form.steps.length-1}findPreviousStep(e){let t=e-1;if(this._form.steps[t])return this.isSatisfied(t)?t:this.findPreviousStep(t)}isStepValidToDisplay(e,t){var n;let r=this._form.steps.length;if(e<0||e>=r)return!1;let i=null===(n=this._form.steps[e].formStep.properties)||void 0===n?void 0:n.attachedContentLink,o=new URL(i,this._tempBaseUrl),a=new URL(t,this._tempBaseUrl);return!!(_(i)||b(o.pathname,a.pathname))&&(!(e!=r-1&&this._stepHelper.isNeedCheckDependCondition(e))||0!==this._formStorage.loadFormDataFromStorage().length&&!this.getInactiveStepsIndex().some(t=>t===e))}getInactiveStepsIndex(){if(1===this._form.steps.length)return[];let e=[];return this._form.steps.forEach((t,n)=>{this._stepHelper.isNeedCheckDependCondition(n)&&!this.isSatisfied(n)&&(e=e.concat(n))}),e}}class M{constructor(e){this._element=e}validateRequired(e){return!(w(e)||"string"==typeof e&&_(e.trim()))&&(!(e instanceof Array)||0!==e.length)}validateRegex(e,t){return!!(w(null==t?void 0:t.jsPattern)||_(e))||
21!!function(e,t){try{var n=new RegExp(t).exec(e);return null!=n&&n.length>0}catch(e){return console.debug(e.message),!1}}(e,t.jsPattern)}validateFileExtension(e,t){if(_(e)||e instanceof Array&&0===e.length)return!0;var n=t.accept,r=_(n)?[]:n.split(","),i=r.length,o=e.length;if(i>0)for(let e=0;e<i;e++)r[e]=r[e].substring(1);for(let t=0;t<o;t++)if(!function(e,t){var n=e.substring((~-e.lastIndexOf(".")>>>0)+2);return!(n.length<1)&&(t.length<1||C(n,t,!0))}(e[t].name,r))return!1;return!0}validateFileSize(e,t){if(w(e))return!0;var n=e.length,r=t.sizeInBytes;for(let t=0;t<n;t++)if(e[t].size>r)return!1;return!0}validateNumeric(e){return _(e)||k(e)}validate(e){let t={valid:!0,message:""},n=this._element.properties;return w(null==n?void 0:n.validators)||n.validators.every(n=>{let r=!0;switch(n.type){case d.CaptchaValidator:case d.RequiredValidator:r=this.validateRequired(e);break;case d.RegularExpressionValidator:case d.EmailValidator:case d.UrlValidator:case d.DateDDMMYYYYValidator:case d.DateMMDDYYYYValidator:case d.DateYYYYMMDDValidator:case d.IntegerValidator:case d.PositiveIntegerValidator:r=this.validateRegex(e,n.model);break;case d.AllowedExtensionsValidator:r=this.validateFileExtension(e,n.model);break;case d.MaxFileSizeValidator:r=this.validateFileSize(e,n.model);break;case d.NumericValidator:r=this.validateNumeric(e)}return!!r||(t={valid:r,message:n.model.message},!1)}),t}}class P{constructor(e){this.checkConditions=(e,t=[])=>{if(!w(e)){let n=this._element.properties;if(w(null==n?void 0:n.conditions))return!0;for(let r=0;r<n.conditions.length;r++){let i=n.conditions[r],o=function(e,t,n){var r,i=null===(r=t.filter(t=>b(t.elementKey,e.field))[0])||void 0===r?void 0:r.value;let o=n.find(t=>t.elementKey===e.field);return o&&!o.isSatisfied&&(i=void 0),i}(i,e,t),a=I[i.operator];if(!w(a)){let e=a(null==o?"":o.toString(),i.fieldValue);if(n.conditionCombination===f.Any&&e)return!0;if(n.conditionCombination!==f.Any&&!e)return!1}}return n.conditionCombination!==f.Any}return!1},this._element=e}}class O{constructor(e,t){this._form=e,this._baseUrl=t}combineData(e,t){let n=new Map;return t.forEach(e=>{n.set(e.elementKey,e)}),[...t,...e.filter(e=>!n.has(e.elementKey))]}doSubmit(e){return new Promise((t,n)=>{let r=new FormData,i={};i.FormKey=e.formKey,i.Locale=e.locale,i.IsFinalized=e.isFinalized,i.SubmissionKey=e.partialSubmissionKey,i.HostedPageUrl=e.hostedPageUrl,i.CurrentStep=e.currentStepIndex;let o={};e.submissionData.forEach(e=>{let t=e.value,n=e.elementKey;if(!w(t)){if(Array.isArray(t)&&t.length>0&&null!==t[0]&&"object"==typeof t[0]){let o="";for(var i=0;i<t.length;i++){let e=t[i].file;e&&Object.getPrototypeOf(e)===File.prototype&&r.append(n+"_file_"+i,e),i>0&&i!=t.length-1&&(o+=" | "),o+=t[i].name}r.append(n,o),e.prevValue=o}else o[n]=e.value}}),i.Fields=o,r.append("data",JSON.stringify(i));let a=new V(this._form),s=a.loadFormDataFromStorage(),l=this.combineData(s,e.submissionData);a.saveFormDataToStorage(l);let u={method:"PUT",headers:{Authorization:`Bearer ${e.accessToken}`},body:r};fetch(`${this._baseUrl}${c.apiEndpoint}`,u).then(r=>{var i,o,s,l;return i=this,o=void 0,s=void 0,l=function*(){let i=yield r.json();r.ok?(i.success&&e.isFinalized&&a.removeFormDataInStorage(),t(i)):n(i)},new(s||(s=Promise))(function(e,t){function n(e){try{a(l.next(e))}catch(e){t(e)}}function r(e){try{a(l.throw(e))}catch(e){t(e)}}function a(t){var i;t.done?e(t.value):((i=t.value)instanceof s?i:new s(function(e){e(i)})).then(n,r)}a((l=l.apply(i,o||[])).next())})}).catch(e=>{n(e)})})}doValidate(e){return this._form.formElements.filter(t=>e.some(e=>b(e.elementKey,t.key))).map(t=>{var n;let r=new M(t),i=null===(n=e.filter(e=>b(e.elementKey,t.key))[0])||void 0===n?void 0:n.value;return{elementKey:t.key,result:r.validate(i)}})}}},16986:function(e){e.exports=i,e.exports.isMobile=i,e.exports.default=i;let t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|redmi|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,n=/CrOS/,r=
21/android|ipad|playbook|silk/i;function i(e){e||(e={});let i=e.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;let o=t.test(i)&&!n.test(i)||!!e.tablet&&r.test(i);return!o&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(o=!0),o}},51410:function(e,t,n){n.d(t,{E:function(){return r}});function r(e,t){if(t.has(e))throw TypeError("Cannot initialize the same private elements twice on an object")}},16123:function(e,t,n){n.d(t,{J:function(){return r}});function r(e,t,n){if(!t.has(e))throw TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}},53359:function(e,t,n){n.d(t,{_:function(){return i}});var r=n(16123);function i(e,t){var n=(0,r.J)(e,t,"get");return n.get?n.get.call(e):n.value}},10851:function(e,t,n){n.d(t,{_:function(){return i}});var r=n(51410);function i(e,t,n){(0,r.E)(e,t),t.set(e,n)}},70262:function(e,t,n){n.d(t,{_:function(){return i}});var r=n(16123);function i(e,t,n){var i=(0,r.J)(e,t,"set");return!function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw TypeError("attempted to set read only private field");t.value=n}}(e,i,n),n}},27938:function(e,t,n){n.d(t,{_:function(){return r}});function r(e,t,n){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return n}},12226:function(e,t,n){n.d(t,{_:function(){return i}});var r=n(51410);function i(e,t){(0,r.E)(e,t),t.add(e)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.